Merge pull request #32583 from Believe-SA/commander-14

chore: update dependency commander to v14
This commit is contained in:
Fredrik Adelöw
2026-02-20 21:04:31 +01:00
committed by GitHub
13 changed files with 51 additions and 44 deletions
+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",
+3 -3
View File
@@ -29,10 +29,10 @@ jest.mock('./paths', () => ({
}));
describe('findRoleFromCommand', () => {
function mkCommand(args: string) {
function mkCommand(args?: string) {
const parsed = new Command()
.option('--role <role>', 'test role')
.parse(['node', 'entry.js', ...args.split(' ')]) as Command;
.parse(args?.split(' ') ?? [], { from: 'user' });
return parsed.opts();
}
@@ -48,7 +48,7 @@ describe('findRoleFromCommand', () => {
});
it('provides role info by role', async () => {
await expect(findRoleFromCommand(mkCommand(''))).resolves.toEqual(
await expect(findRoleFromCommand(mkCommand())).resolves.toEqual(
'web-library',
);
+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'),
);