Skip to content

Commit eb95f58

Browse files
authored
feat(@142vip/fairy-cli): 移除monorepo方法,使用VipMonorepo工具替换 (#460)
1 parent 3baf42a commit eb95f58

File tree

4 files changed

+17
-43
lines changed

4 files changed

+17
-43
lines changed

packages/fairy-cli/src/commands/release.ts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
import type { VersionBumpOptions } from '@142vip/release-version'
22
import type { VipCommander } from '@142vip/utils'
33
import { versionBump } from '@142vip/release-version'
4-
import { VipColor, VipConsole, VipGit, VipInquirer, VipNodeJS } from '@142vip/utils'
4+
import {
5+
VipColor,
6+
VipConsole,
7+
VipGit,
8+
VipInquirer,
9+
VipMonorepo,
10+
VipNodeJS,
11+
} from '@142vip/utils'
512
import {
613
CliCommandEnum,
7-
getPackageListInMonorepo,
814
getReleasePkgJSON,
915
printPreCheckRelease,
1016
releaseMonorepoPackage,
@@ -23,22 +29,23 @@ interface VipReleaseExtraOptions {
2329
}
2430

2531
const defaultRepoName = 'main'
32+
2633
/**
2734
* 版本发布
2835
*/
2936
async function execNormalRelease(args: ReleaseOptions): Promise<void> {
3037
// 指定包
3138
if (args.package != null) {
32-
const packageJSONList = await getPackageListInMonorepo()
39+
const packageJSONList = await VipMonorepo.getPackageJSONPathList()
3340
// const packageJSONList: string[] = []
3441
if (!packageJSONList.includes(`${args.package}/package.json`)) {
3542
// 抛错,提醒用户包在monorepo下找不到
36-
VipConsole.log('正确')
43+
VipConsole.log('release包在monorepo下找不到,请检查!!')
3744
}
3845
}
3946
else {
4047
// 对话框,用户自行选择
41-
VipConsole.log('错误')
48+
VipConsole.log('报错,暂未支持!!')
4249
}
4350

4451
// 指定文件更新版本
@@ -66,7 +73,7 @@ async function execVipRelease(args: VipReleaseExtraOptions): Promise<void> {
6673

6774
// 预先检查子模块
6875
if (args.checkRelease) {
69-
printPreCheckRelease(packageNames)
76+
await printPreCheckRelease(packageNames)
7077
return VipNodeJS.exitProcess(0)
7178
}
7279

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
export * from './cli-command.enum'
2-
export * from './monorepo'
32
export * from './release-package'

packages/fairy-cli/src/shared/monorepo.ts

Lines changed: 0 additions & 32 deletions
This file was deleted.

packages/utils/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,17 @@
5050
"commander": "12.1.0",
5151
"convert-gitmoji": "0.1.5",
5252
"dayjs": "1.11.13",
53+
"js-yaml": "4.1.0",
5354
"klona": "2.0.6",
5455
"lodash": "4.17.21",
5556
"nanoid": "3.3.8",
5657
"qs": "6.14.0",
57-
"semver": "7.7.0",
58-
"js-yaml": "4.1.0"
58+
"semver": "7.7.0"
5959
},
6060
"devDependencies": {
6161
"@types/inquirer": "9.0.7",
62-
"@types/semver": "7.7.0",
63-
"@types/js-yaml": "4.0.9"
62+
"@types/js-yaml": "4.0.9",
63+
"@types/semver": "7.7.0"
6464
},
6565
"publishConfig": {
6666
"access": "public",

0 commit comments

Comments
 (0)