diff --git a/.changeset/migrate-cli-commands-to-cleye.md b/.changeset/migrate-cli-commands-to-cleye.md index 45f76fb6af..e6792423ee 100644 --- a/.changeset/migrate-cli-commands-to-cleye.md +++ b/.changeset/migrate-cli-commands-to-cleye.md @@ -2,4 +2,4 @@ '@backstage/cli': patch --- -Migrated remaining CLI command handlers from `commander` to `cleye` for argument parsing. CLI flags are now displayed in kebab-case in help output (e.g. `--success-cache` instead of `--successCache`), but both forms are accepted transparently — no changes needed in existing scripts or CI configurations. +Migrated remaining CLI command handlers from `commander` to `cleye` for argument parsing. Several camelCase CLI flags have been deprecated in favor of their kebab-case equivalents (e.g. `--successCache` → `--success-cache`). The old camelCase forms still work but will now log a deprecation warning. Please update any scripts or CI configurations to use the kebab-case versions. diff --git a/packages/cli/src/modules/lint/commands/repo/lint.ts b/packages/cli/src/modules/lint/commands/repo/lint.ts index 513c76e0a5..174282ffcf 100644 --- a/packages/cli/src/modules/lint/commands/repo/lint.ts +++ b/packages/cli/src/modules/lint/commands/repo/lint.ts @@ -40,6 +40,19 @@ function depCount(pkg: BackstagePackageJson) { } export default async ({ args, info }: CommandContext) => { + for (const flag of [ + 'outputFile', + 'successCache', + 'successCacheDir', + 'maxWarnings', + ]) { + if (args.some(a => a === `--${flag}` || a.startsWith(`--${flag}=`))) { + process.stderr.write( + `DEPRECATION WARNING: --${flag} is deprecated, use the kebab-case form instead\n`, + ); + } + } + const { flags: { fix, diff --git a/packages/cli/src/modules/new/commands/new.ts b/packages/cli/src/modules/new/commands/new.ts index a4899cf509..082d0ca028 100644 --- a/packages/cli/src/modules/new/commands/new.ts +++ b/packages/cli/src/modules/new/commands/new.ts @@ -19,6 +19,14 @@ import { createNewPackage } from '../lib/createNewPackage'; import type { CommandContext } from '../../../wiring/types'; export default async ({ args, info }: CommandContext) => { + for (const flag of ['skipInstall', 'npmRegistry', 'baseVersion']) { + if (args.some(a => a === `--${flag}` || a.startsWith(`--${flag}=`))) { + process.stderr.write( + `DEPRECATION WARNING: --${flag} is deprecated, use the kebab-case form instead\n`, + ); + } + } + const { flags: { select, diff --git a/packages/cli/src/modules/test/commands/repo/test.ts b/packages/cli/src/modules/test/commands/repo/test.ts index 743aa87c3d..c331caf994 100644 --- a/packages/cli/src/modules/test/commands/repo/test.ts +++ b/packages/cli/src/modules/test/commands/repo/test.ts @@ -134,6 +134,14 @@ export function createFlagFinder(args: string[]) { export default async ({ args, info }: CommandContext) => { const testGlobal = global as TestGlobal; + for (const flag of ['successCache', 'successCacheDir', 'jestHelp']) { + if (args.some(a => a === `--${flag}` || a.startsWith(`--${flag}=`))) { + process.stderr.write( + `DEPRECATION WARNING: --${flag} is deprecated, use the kebab-case form instead\n`, + ); + } + } + // Parse Backstage-specific flags; unknown flags and arguments are left in // args so they can be forwarded to Jest. const { flags: opts } = cli(