refactor: update yargs to new API for ESM compatibility (#43431)

Given that we ship all of compiler-cli and localize in ESM
mode now, we need to use a ESM compatible version of Yargs.
The latest version seems ESM compatible but with some small
API changes. This commit updates Yargs and updates the command
line option code to use the new API.

PR Close #43431
This commit is contained in:
Paul Gschwendtner
2021-09-26 12:29:54 +02:00
committed by Dylan Hunn
parent d442764470
commit cebcfbe1d9
8 changed files with 17 additions and 17 deletions
@@ -14,7 +14,7 @@ import {NgccOptions} from './ngcc_options';
export function parseCommandLineOptions(args: string[]): NgccOptions {
const options =
yargs
yargs(args)
.option('s', {
alias: 'source',
describe:
@@ -114,7 +114,7 @@ export function parseCommandLineOptions(args: string[]): NgccOptions {
})
.strict()
.help()
.parse(args);
.parseSync();
if (options.f?.length) {
console.error(
+1 -1
View File
@@ -61,7 +61,7 @@
"source-map": "^0.6.1",
"sourcemap-codec": "^1.4.8",
"tslib": "^2.3.0",
"yargs": "^17.0.0"
"yargs": "^17.2.1"
},
"peerDependencies": {
"@angular/compiler": "0.0.0-PLACEHOLDER",