Skip to content

Commit 3145dc9

Browse files
committed
build: remove repo root usage of yargs-parser
The `scripts/devkit-admin.mts` infrastructure script has been migrated to use the native Node.js `parseArgs` API. This removes the last non-package usage of the `yargs-parser` package and allows the root level dependency to be removed.
1 parent 5dc3b64 commit 3145dc9

File tree

5 files changed

+17
-13
lines changed

5 files changed

+17
-13
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@
140140
"unenv": "^1.10.0",
141141
"verdaccio": "6.2.3",
142142
"verdaccio-auth-memory": "^10.0.0",
143-
"yargs-parser": "22.0.0",
144143
"zod": "4.1.13",
145144
"zone.js": "^0.16.0"
146145
},

packages/angular_devkit/architect_cli/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ ts_project(
2121
":node_modules/@angular-devkit/core",
2222
":node_modules/ansi-colors",
2323
":node_modules/progress",
24+
":node_modules/yargs-parser",
2425
"//:node_modules/@types/node",
2526
"//:node_modules/@types/progress",
2627
"//:node_modules/@types/yargs-parser",
27-
"//:node_modules/yargs-parser",
2828
],
2929
)
3030

packages/angular_devkit/schematics_cli/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ ts_project(
4949
":node_modules/@angular-devkit/schematics",
5050
":node_modules/@inquirer/prompts",
5151
":node_modules/ansi-colors",
52+
":node_modules/yargs-parser",
5253
"//:node_modules/@types/node",
5354
"//:node_modules/@types/yargs-parser",
54-
"//:node_modules/yargs-parser",
5555
],
5656
)
5757

pnpm-lock.yaml

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/devkit-admin.mts

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,24 @@
88
*/
99

1010
import path from 'node:path';
11-
import { styleText } from 'node:util';
12-
import yargsParser from 'yargs-parser';
11+
import { parseArgs, styleText } from 'node:util';
1312

14-
const args = yargsParser(process.argv.slice(2), {
15-
boolean: ['verbose'],
16-
configuration: {
17-
'camel-case-expansion': false,
13+
const { values, positionals } = parseArgs({
14+
args: process.argv.slice(2),
15+
options: {
16+
verbose: {
17+
type: 'boolean',
18+
},
1819
},
20+
allowPositionals: true,
21+
strict: false, // Allow unknown options to pass through.
1922
});
20-
const scriptName = args._.shift();
23+
24+
const scriptName = positionals.shift();
25+
const args = {
26+
...values,
27+
_: positionals,
28+
};
2129

2230
const cwd = process.cwd();
2331
const scriptDir = import.meta.dirname;

0 commit comments

Comments
 (0)