chore: update dependency commander to v14, remove old @types/commander

Signed-off-by: Gabriel Dugny <gabriel.dugny@believe.com>
This commit is contained in:
Gabriel Dugny
2026-01-13 00:49:02 +01:00
parent c8f65a1e53
commit de62a9d322
14 changed files with 52 additions and 41 deletions
+9
View File
@@ -0,0 +1,9 @@
---
'@backstage/cli': patch
'@backstage/codemods': patch
'@backstage/create-app': patch
'@backstage/repo-tools': patch
'@techdocs/cli': patch
---
Upgraded `commander` dependency from `^12.0.0` to `^14.0.3` across all CLI packages.
+1 -1
View File
@@ -150,7 +150,7 @@ Options:
--legacyCopyReadmeMdToIndexMd Attempt to ensure an index.md exists falling back to using <docs-dir>/README.md or README.md
in case a default <docs-dir>/index.md is not provided. (default: false)
--runAsDefaultUser Bypass setting the container user as the same user and group id as host for Linux and MacOS (default: false)
-v --verbose Enable verbose output. (default: false)
-v, --verbose Enable verbose output. (default: false)
-h, --help display help for command
```
+1 -1
View File
@@ -83,7 +83,7 @@
"buffer": "^6.0.3",
"chalk": "^4.0.0",
"chokidar": "^3.3.1",
"commander": "^12.0.0",
"commander": "^14.0.3",
"cross-fetch": "^4.0.0",
"cross-spawn": "^7.0.3",
"css-loader": "^6.5.1",
+1
View File
@@ -31,6 +31,7 @@ jest.mock('./paths', () => ({
describe('findRoleFromCommand', () => {
function mkCommand(args: string) {
const parsed = new Command()
.allowExcessArguments(true)
.option('--role <role>', 'test role')
.parse(['node', 'entry.js', ...args.split(' ')]) as Command;
return parsed.opts();
+3 -1
View File
@@ -27,6 +27,7 @@ export default createCliPlugin({
execute: async ({ args }) => {
const command = new Command();
command.allowUnknownOption(true);
command.allowExcessArguments(true);
command.option(
'--since <ref>',
'Only test packages that changed since the specified ref',
@@ -53,7 +54,8 @@ export default createCliPlugin({
const command = new Command();
command.allowUnknownOption(true);
command.helpOption(', --backstage-cli-help');
command.allowExcessArguments(true);
command.helpOption('--backstage-cli-help');
command.action(
lazy(() => import('./commands/package/test'), 'default'),
);
+1 -1
View File
@@ -45,7 +45,7 @@
"dependencies": {
"@backstage/cli-common": "workspace:^",
"chalk": "^4.0.0",
"commander": "^12.0.0",
"commander": "^14.0.3",
"jscodeshift": "^0.16.0",
"jscodeshift-add-imports": "^1.0.10"
},
+1 -1
View File
@@ -45,7 +45,7 @@
"dependencies": {
"@backstage/cli-common": "workspace:^",
"chalk": "^4.0.0",
"commander": "^12.0.0",
"commander": "^14.0.3",
"fs-extra": "^11.2.0",
"handlebars": "^4.7.3",
"inquirer": "^8.2.0",
+1 -1
View File
@@ -36,7 +36,7 @@
"@backstage/create-app": "workspace:^",
"@backstage/errors": "workspace:^",
"chalk": "^4.0.0",
"commander": "^12.0.0",
"commander": "^14.0.3",
"cross-fetch": "^4.0.0",
"fs-extra": "^11.2.0",
"handlebars": "^4.7.3",
+1 -1
View File
@@ -67,7 +67,7 @@
"chokidar": "^3.5.3",
"codeowners-utils": "^1.0.2",
"command-exists": "^1.2.9",
"commander": "^12.0.0",
"commander": "^14.0.3",
"fs-extra": "^11.2.0",
"glob": "^8.0.3",
"globby": "^11.0.0",
@@ -205,6 +205,7 @@ export function registerCommands(program: Command) {
program
.command('type-deps')
.description('Find inconsistencies in types of all packages and plugins')
.allowExcessArguments(true)
.action(lazy(() => import('./type-deps/type-deps'), 'default'));
program
@@ -213,6 +214,7 @@ export function registerCommands(program: Command) {
'Ensure your packages are using the correct peer dependency format.',
)
.option('--fix', 'Fix the issues found')
.allowExcessArguments(true)
.action(lazy(() => import('./peer-deps/peer-deps'), 'default'));
program
@@ -226,6 +228,7 @@ export function registerCommands(program: Command) {
'CI run checks that there are no changes to catalog-info.yaml files',
)
.description('Create or fix info yaml files for all backstage packages')
.allowExcessArguments(true)
.action(
lazy(
() => import('./generate-catalog-info/generate-catalog-info'),
+4 -4
View File
@@ -39,7 +39,7 @@ Options:
--source-dir <PATH>
--techdocs-ref <HOST_TYPE:URL>
-h, --help
-v --verbose
-v, --verbose
```
### `techdocs-cli migrate`
@@ -62,7 +62,7 @@ Options:
--removeOriginal
--storage-name <BUCKET/CONTAINER NAME>
-h, --help
-v --verbose
-v, --verbose
```
### `techdocs-cli publish`
@@ -112,7 +112,7 @@ Options:
-c, --mkdocs-config-file-name <FILENAME>
-h, --help
-i, --docker-image <DOCKER_IMAGE>
-v --verbose
-v, --verbose
```
### `techdocs-cli serve:mkdocs`
@@ -128,5 +128,5 @@ Options:
-h, --help
-i, --docker-image <DOCKER_IMAGE>
-p, --port <PORT>
-v --verbose
-v, --verbose
```
+1 -2
View File
@@ -49,7 +49,7 @@
"@backstage/cli-common": "workspace:^",
"@backstage/config": "workspace:^",
"@backstage/plugin-techdocs-node": "workspace:^",
"commander": "^12.0.0",
"commander": "^14.0.3",
"fs-extra": "^11.0.0",
"global-agent": "^3.0.0",
"http-proxy": "^1.18.1",
@@ -59,7 +59,6 @@
},
"devDependencies": {
"@backstage/cli": "workspace:^",
"@types/commander": "^2.12.2",
"@types/fs-extra": "^11.0.0",
"@types/http-proxy": "^1.17.4",
"@types/node": "^22.13.14",
+4 -4
View File
@@ -59,7 +59,7 @@ export function registerCommands(program: Command) {
'Name for site when using default MkDocs config',
'Documentation Site',
)
.option('-v --verbose', 'Enable verbose output.', false)
.option('-v, --verbose', 'Enable verbose output.', false)
.option(
'--omitTechdocsCoreMkdocsPlugin',
"Don't patch MkDocs file automatically with techdocs-core plugin.",
@@ -142,7 +142,7 @@ export function registerCommands(program: Command) {
'Optional Controls the number of API requests allowed to be performed simultaneously.',
'25',
)
.option('-v --verbose', 'Enable verbose output.', false)
.option('-v, --verbose', 'Enable verbose output.', false)
.action(lazy(() => import('./migrate/migrate'), 'default'));
program
@@ -253,7 +253,7 @@ export function registerCommands(program: Command) {
'Documentation Site',
)
.option('-p, --port <PORT>', 'Port to serve documentation locally', '8000')
.option('-v --verbose', 'Enable verbose output.', false)
.option('-v, --verbose', 'Enable verbose output.', false)
.action(lazy(() => import('./serve/mkdocs'), 'default'));
program
@@ -284,7 +284,7 @@ export function registerCommands(program: Command) {
'Documentation Site',
)
.option('--mkdocs-port <PORT>', 'Port for MkDocs server to use', '8000')
.option('-v --verbose', 'Enable verbose output.', false)
.option('-v, --verbose', 'Enable verbose output.', false)
.option(
'--preview-app-bundle-path <PATH_TO_BUNDLE>',
'Preview documentation using another web app',
+21 -24
View File
@@ -3351,7 +3351,7 @@ __metadata:
buffer: "npm:^6.0.3"
chalk: "npm:^4.0.0"
chokidar: "npm:^3.3.1"
commander: "npm:^12.0.0"
commander: "npm:^14.0.3"
cross-fetch: "npm:^4.0.0"
cross-spawn: "npm:^7.0.3"
css-loader: "npm:^6.5.1"
@@ -3479,7 +3479,7 @@ __metadata:
"@types/jscodeshift": "npm:^0.12.0"
"@types/node": "npm:^22.13.14"
chalk: "npm:^4.0.0"
commander: "npm:^12.0.0"
commander: "npm:^14.0.3"
jscodeshift: "npm:^0.16.0"
jscodeshift-add-imports: "npm:^1.0.10"
bin:
@@ -3735,7 +3735,7 @@ __metadata:
"@types/node": "npm:^22.13.14"
"@types/recursive-readdir": "npm:^2.2.0"
chalk: "npm:^4.0.0"
commander: "npm:^12.0.0"
commander: "npm:^14.0.3"
fs-extra: "npm:^11.2.0"
handlebars: "npm:^4.7.3"
inquirer: "npm:^8.2.0"
@@ -7991,7 +7991,7 @@ __metadata:
chokidar: "npm:^3.5.3"
codeowners-utils: "npm:^1.0.2"
command-exists: "npm:^1.2.9"
commander: "npm:^12.0.0"
commander: "npm:^14.0.3"
fs-extra: "npm:^11.2.0"
glob: "npm:^8.0.3"
globby: "npm:^11.0.0"
@@ -20690,13 +20690,12 @@ __metadata:
"@backstage/cli-common": "workspace:^"
"@backstage/config": "workspace:^"
"@backstage/plugin-techdocs-node": "workspace:^"
"@types/commander": "npm:^2.12.2"
"@types/fs-extra": "npm:^11.0.0"
"@types/http-proxy": "npm:^1.17.4"
"@types/node": "npm:^22.13.14"
"@types/serve-handler": "npm:^6.1.0"
"@types/webpack-env": "npm:^1.15.3"
commander: "npm:^12.0.0"
commander: "npm:^14.0.3"
find-process: "npm:^2.0.0"
fs-extra: "npm:^11.0.0"
global-agent: "npm:^3.0.0"
@@ -21208,15 +21207,6 @@ __metadata:
languageName: node
linkType: hard
"@types/commander@npm:^2.12.2":
version: 2.12.5
resolution: "@types/commander@npm:2.12.5"
dependencies:
commander: "npm:*"
checksum: 10/5b70bf09366f778f54cd0b831417aa1f749cdd9e95e81016d0537b801ad14275973b04c34ff4dfaa344986aa93b4518c2df12647ecf8b499b636585335ae3edc
languageName: node
linkType: hard
"@types/compression@npm:^1.7.5":
version: 1.8.1
resolution: "@types/compression@npm:1.8.1"
@@ -27579,13 +27569,6 @@ __metadata:
languageName: node
linkType: hard
"commander@npm:*, commander@npm:^13.1.0":
version: 13.1.0
resolution: "commander@npm:13.1.0"
checksum: 10/d3b4b79e6be8471ddadacbb8cd441fe82154d7da7393b50e76165a9e29ccdb74fa911a186437b9a211d0fc071db6051915c94fb8ef16d77511d898e9dbabc6af
languageName: node
linkType: hard
"commander@npm:11.1.0, commander@npm:^11.0.0":
version: 11.1.0
resolution: "commander@npm:11.1.0"
@@ -27621,13 +27604,27 @@ __metadata:
languageName: node
linkType: hard
"commander@npm:^12.0.0, commander@npm:^12.1.0":
"commander@npm:^12.1.0":
version: 12.1.0
resolution: "commander@npm:12.1.0"
checksum: 10/cdaeb672d979816853a4eed7f1310a9319e8b976172485c2a6b437ed0db0a389a44cfb222bfbde772781efa9f215bdd1b936f80d6b249485b465c6cb906e1f93
languageName: node
linkType: hard
"commander@npm:^13.1.0":
version: 13.1.0
resolution: "commander@npm:13.1.0"
checksum: 10/d3b4b79e6be8471ddadacbb8cd441fe82154d7da7393b50e76165a9e29ccdb74fa911a186437b9a211d0fc071db6051915c94fb8ef16d77511d898e9dbabc6af
languageName: node
linkType: hard
"commander@npm:^14.0.3":
version: 14.0.3
resolution: "commander@npm:14.0.3"
checksum: 10/dfa9ebe2a433d277de5cb0252d23b10a543d245d892db858d23b516336a835c50fd4f52bee4cd13c705cc8acb6f03dc632c73dd806f7d06d3353eb09953dd17a
languageName: node
linkType: hard
"commander@npm:^2.19.0, commander@npm:^2.20.0":
version: 2.20.3
resolution: "commander@npm:2.20.3"
@@ -29776,7 +29773,7 @@ __metadata:
"@types/fs-extra": "npm:^11.0.0"
"@types/node": "npm:^22.13.14"
chalk: "npm:^4.0.0"
commander: "npm:^12.0.0"
commander: "npm:^14.0.3"
cross-fetch: "npm:^4.0.0"
fs-extra: "npm:^11.2.0"
handlebars: "npm:^4.7.3"