Skip to content

Commit

Permalink
feat(@142vip/fairy-cli): 代码清理,模块结构优化
Browse files Browse the repository at this point in the history
  • Loading branch information
mmdapl committed Oct 28, 2024
1 parent 80f31cf commit 08df8bd
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 12 deletions.
4 changes: 2 additions & 2 deletions packages/fairy-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
"email": "mmdapl@163.com"
},
"license": "MIT",
"homepage": "https://github.com/142vip/core-x/tree/main/packages/fairy-cli",
"homepage": "https://142vip.github.io/core-x/packages/fairy-cli/",
"repository": {
"type": "git",
"url": "https://github.com/142vip/core-x",
"url": "git+https://github.com/142vip/core-x.git",
"directory": "packages/fairy-cli"
},
"bugs": {
Expand Down
4 changes: 1 addition & 3 deletions packages/fairy-cli/src/commands/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ function execDeploy(args: DeployOptions) {
* github page 静态页面部署
* @constructor
*/
function DeployGithubPage() {

}
function DeployGithubPage() {}

/**
*
Expand Down
8 changes: 6 additions & 2 deletions packages/fairy-cli/src/commands/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ async function execLogin(platform: LoginPlatformEnum, args: LoginOptions) {
}
}

// docker 登录
/**
* docker 登录
*/
async function loginDocker(args: DockerOptions) {
let registryUrl = RegistryURLEnum.DOCKER as string
if (args.registryUrl != null) {
Expand All @@ -56,7 +58,9 @@ async function loginDocker(args: DockerOptions) {
await commandStandardExecutor(command)
}

// npm 登录
/**
* npm 登录
*/
async function loginNpm(args: NpmOptions) {
let registryUrl = RegistryURLEnum.NPM as string
if (args.registryUrl != null) {
Expand Down
1 change: 0 additions & 1 deletion packages/fairy-cli/src/commands/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ async function publishNpm(args: NpmOptions) {

/**
* publish 命令入口
* @param program
*/
export async function publishMain(program: Command) {
program
Expand Down
1 change: 1 addition & 0 deletions packages/fairy-cli/src/commands/release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
// execute?: string
// package?: string
// }

interface ReleaseOptions extends Pick<VersionBumpOptions, 'preid' | 'tag' | 'commit' | 'push' | 'all' | 'execute'> {
package?: string
}
Expand Down
2 changes: 0 additions & 2 deletions packages/fairy-cli/src/commands/turbopack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,13 @@ async function execTurboPack(repoNames: string[], args: TurboPackOptions) {
* 获取需要执行命令的repo
* - 支持多个--filter
* - 支持所有repo
* @param repoNames
*/
function getFilterRepo(repoNames: string[]) {
return repoNames.map(name => `--filter=${name}`).join(' ')
}

/**
* turbo命令入口
* @param program
*/
export async function turboPackMain(program: Command) {
program
Expand Down
2 changes: 1 addition & 1 deletion packages/fairy-cli/src/fairy-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ export async function fairyCliMain() {
// fairy-cli turbo 基于turborepo项目管理
await turboPackMain(program)

// fairy-cli clean
await cleanUpMain(program)

// 参数解析
program.parse(process.argv)
}
1 change: 0 additions & 1 deletion packages/fairy-cli/src/shared/release-package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ interface ValidatePkgJSON {
* 参考:
* - pnpm 命令: https://pnpm.io/cli/list
* - filter参数: https://pnpm.io/filtering
*
*/
export function getReleasePkgJSON(filter?: string | string[]) {
try {
Expand Down

0 comments on commit 08df8bd

Please sign in to comment.