diff --git a/packages/release-version/src/core/normalize-options.ts b/packages/release-version/src/core/normalize-options.ts index 2fcf42c..262f619 100644 --- a/packages/release-version/src/core/normalize-options.ts +++ b/packages/release-version/src/core/normalize-options.ts @@ -65,6 +65,8 @@ export interface NormalizedOptions { customVersion?: VersionBumpOptions['customVersion'] currentVersion?: string changelog?: boolean + // monorepo 模块名 + scopeName?: string } /** @@ -81,6 +83,8 @@ export async function normalizeOptions(raw: VersionBumpOptions): Promise void /** - * Excute additional command after bumping and before commiting + * Execute additional command after bumping and before commiting */ execute?: string + /** + * monorepo package name + */ + scopeName?: string + /** * Bump the files recursively for monorepo. Only works without `files` option. * diff --git a/packages/release-version/src/utils/parse-args.ts b/packages/release-version/src/utils/parse-args.ts index f43b7d7..f74b437 100644 --- a/packages/release-version/src/utils/parse-args.ts +++ b/packages/release-version/src/utils/parse-args.ts @@ -43,6 +43,7 @@ export async function parseArgs(): Promise { execute: args.execute, recursive: !!args.recursive, changelog: !!args.changelog, + scopeName: args.scopeName, }), } @@ -87,6 +88,7 @@ export function loadCliArgs(argv = process.argv) { .option('--changelog', 'generate CHANGELOG.md', { default: false }) .option('-v, --version ', 'Target version') .option('--current-version ', 'Current version') + .option('--scopeName ', 'Package name in monorepo') .option('-x, --execute ', 'Commands to execute after version bumps') .help()