From ff618514ff4c19b198e6471adf4b6ba6150296f9 Mon Sep 17 00:00:00 2001 From: aramissennyeydd Date: Sun, 13 Apr 2025 16:43:43 -0400 Subject: [PATCH] hide deprecated commands from the list of commands Signed-off-by: aramissennyeydd --- .../cli/cli-report.backstage-cli-alpha.md | 28 +++++++++++++++++++ packages/cli/cli-report.backstage-cli.md | 10 ++----- packages/cli/src/commands/index.ts | 1 - packages/cli/src/modules/new/alpha.ts | 2 ++ packages/cli/src/wiring/CliInitializer.ts | 2 +- packages/cli/src/wiring/types.ts | 1 + 6 files changed, 34 insertions(+), 10 deletions(-) diff --git a/packages/cli/cli-report.backstage-cli-alpha.md b/packages/cli/cli-report.backstage-cli-alpha.md index b52d40c809..917a915fe5 100644 --- a/packages/cli/cli-report.backstage-cli-alpha.md +++ b/packages/cli/cli-report.backstage-cli-alpha.md @@ -18,9 +18,11 @@ Commands: config:docs config:print config:schema + create-github-app help [command] info migrate [command] + new package [command] repo [command] versions:bump @@ -132,6 +134,15 @@ Options: --version ``` +### `backstage-cli-alpha create-github-app` + +``` +Usage: program [options] + +Options: + -h, --help +``` + ### `backstage-cli-alpha info` ``` @@ -204,6 +215,23 @@ Options: -h, --help ``` +### `backstage-cli-alpha new` + +``` +Usage: program [options] + +Options: + --baseVersion + --license + --no-private + --npm-registry + --option = + --scope + --select + --skip-install + -h, --help +``` + ### `backstage-cli-alpha package` ``` diff --git a/packages/cli/cli-report.backstage-cli.md b/packages/cli/cli-report.backstage-cli.md index 524bda846d..ed6ae9049e 100644 --- a/packages/cli/cli-report.backstage-cli.md +++ b/packages/cli/cli-report.backstage-cli.md @@ -12,17 +12,11 @@ Options: -h, --help Commands: + build-workspace [options] [packages...] + config:check [options] config:docs [options] config:print [options] config:schema [options] - repo [command] - package [command] - versions:bump [options] - versions:migrate [options] - migrate [command] - build-workspace [options] [packages...] - info - new [options] create-github-app help [command] info diff --git a/packages/cli/src/commands/index.ts b/packages/cli/src/commands/index.ts index 3640091f60..8483fd79c0 100644 --- a/packages/cli/src/commands/index.ts +++ b/packages/cli/src/commands/index.ts @@ -15,7 +15,6 @@ */ import { Command } from 'commander'; -import { lazy } from '../lib/lazy'; import { registerCommands as registerConfigCommands } from '../modules/config'; import { registerPackageCommands as registerPackageBuildCommands, diff --git a/packages/cli/src/modules/new/alpha.ts b/packages/cli/src/modules/new/alpha.ts index 9a9b26e85a..6802077507 100644 --- a/packages/cli/src/modules/new/alpha.ts +++ b/packages/cli/src/modules/new/alpha.ts @@ -69,6 +69,7 @@ export default createCliPlugin({ reg.addCommand({ path: ['create'], description: 'Create a new Backstage app', + deprecated: true, execute: async () => { removed("use 'backstage-cli new' instead")(); }, @@ -76,6 +77,7 @@ export default createCliPlugin({ reg.addCommand({ path: ['create-plugin'], description: 'Create a new Backstage plugin', + deprecated: true, execute: async () => { removed("use 'backstage-cli new' instead")(); }, diff --git a/packages/cli/src/wiring/CliInitializer.ts b/packages/cli/src/wiring/CliInitializer.ts index d7fdfdccab..d3cba34f60 100644 --- a/packages/cli/src/wiring/CliInitializer.ts +++ b/packages/cli/src/wiring/CliInitializer.ts @@ -88,7 +88,7 @@ export class CliInitializer { ); } else { argParser - .command(node.name) + .command(node.name, { hidden: !!node.command.deprecated }) .description(node.command.description) .helpOption(false) .allowUnknownOption(true) diff --git a/packages/cli/src/wiring/types.ts b/packages/cli/src/wiring/types.ts index d9237a4c3a..0decdc6479 100644 --- a/packages/cli/src/wiring/types.ts +++ b/packages/cli/src/wiring/types.ts @@ -18,6 +18,7 @@ import { CommandRegistry } from './CommandRegistry'; export interface BackstageCommand { path: string[]; description: string; + deprecated?: boolean; execute: (options: { args: string[] }) => Promise; }