From 93ef6aa371f3639c443b7b61f9800f8866d985ea Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Fri, 20 Jan 2023 11:30:59 +0000 Subject: [PATCH] build: update `@types/yargs` to `^17.0.20` --- package.json | 2 +- packages/angular/cli/src/commands/generate/cli.ts | 15 +++++++++++---- yarn.lock | 11 ++++++++--- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index efd3c24cedbc..76d990816d7c 100644 --- a/package.json +++ b/package.json @@ -120,7 +120,7 @@ "@types/shelljs": "^0.8.11", "@types/tar": "^6.1.2", "@types/text-table": "^0.2.1", - "@types/yargs": "^17.0.8", + "@types/yargs": "^17.0.20", "@types/yargs-parser": "^21.0.0", "@types/yarnpkg__lockfile": "^1.1.5", "@typescript-eslint/eslint-plugin": "5.48.2", diff --git a/packages/angular/cli/src/commands/generate/cli.ts b/packages/angular/cli/src/commands/generate/cli.ts index 2124f2333a25..c4029e5a7e1f 100644 --- a/packages/angular/cli/src/commands/generate/cli.ts +++ b/packages/angular/cli/src/commands/generate/cli.ts @@ -12,7 +12,7 @@ import { FileSystemCollectionDescription, FileSystemSchematicDescription, } from '@angular-devkit/schematics/tools'; -import { Argv } from 'yargs'; +import { ArgumentsCamelCase, Argv } from 'yargs'; import { CommandModuleError, CommandModuleImplementation, @@ -40,7 +40,7 @@ export class GenerateCommandModule longDescriptionPath?: string | undefined; override async builder(argv: Argv): Promise> { - let localYargs = (await super.builder(argv)).command({ + let localYargs = (await super.builder(argv)).command({ command: '$0 ', describe: 'Run the provided schematic.', builder: (localYargs) => @@ -51,7 +51,7 @@ export class GenerateCommandModule demandOption: true, }) .strict(), - handler: (options) => this.handler(options), + handler: (options) => this.handler(options as ArgumentsCamelCase), }); for (const [schematicName, collectionName] of await this.getSchematicsToRegister()) { @@ -88,7 +88,14 @@ export class GenerateCommandModule : undefined, builder: (localYargs) => this.addSchemaOptionsToCommand(localYargs, options).strict(), handler: (options) => - this.handler({ ...options, schematic: `${collectionName}:${schematicName}` }), + this.handler({ + ...options, + schematic: `${collectionName}:${schematicName}`, + } as ArgumentsCamelCase< + SchematicsCommandArgs & { + schematic: string; + } + >), }); } diff --git a/yarn.lock b/yarn.lock index 81ca5edeb6f7..b7450775687c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -121,7 +121,6 @@ "@angular/build-tooling@https://github.com/angular/dev-infra-private-build-tooling-builds.git#5854dda71b14fd9032ca67125b902464ebb7b228": version "0.0.0-fa8e18e7dd9b4d3764afb6a4393a6d64491b2023" - uid "5854dda71b14fd9032ca67125b902464ebb7b228" resolved "https://github.com/angular/dev-infra-private-build-tooling-builds.git#5854dda71b14fd9032ca67125b902464ebb7b228" dependencies: "@angular-devkit/build-angular" "15.1.0-rc.0" @@ -307,7 +306,6 @@ "@angular/ng-dev@https://github.com/angular/dev-infra-private-ng-dev-builds.git#9abd9ebd6280363e722044539d056804fe6f3235": version "0.0.0-fa8e18e7dd9b4d3764afb6a4393a6d64491b2023" - uid "9abd9ebd6280363e722044539d056804fe6f3235" resolved "https://github.com/angular/dev-infra-private-ng-dev-builds.git#9abd9ebd6280363e722044539d056804fe6f3235" dependencies: "@yarnpkg/lockfile" "^1.1.0" @@ -3483,13 +3481,20 @@ resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.0.tgz#0c60e537fa790f5f9472ed2776c2b71ec117351b" integrity sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA== -"@types/yargs@^17.0.0", "@types/yargs@^17.0.8": +"@types/yargs@^17.0.0": version "17.0.19" resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.19.tgz#8dbecdc9ab48bee0cb74f6e3327de3fa0d0c98ae" integrity sha512-cAx3qamwaYX9R0fzOIZAlFpo4A+1uBVCxqpKz9D26uTF4srRXaGTTsikQmaotCtNdbhzyUH7ft6p9ktz9s6UNQ== dependencies: "@types/yargs-parser" "*" +"@types/yargs@^17.0.20": + version "17.0.20" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.20.tgz#107f0fcc13bd4a524e352b41c49fe88aab5c54d5" + integrity sha512-eknWrTHofQuPk2iuqDm1waA7V6xPlbgBoaaXEgYkClhLOnB0TtbW+srJaOToAgawPxPlHQzwypFA2bhZaUGP5A== + dependencies: + "@types/yargs-parser" "*" + "@types/yarnpkg__lockfile@^1.1.5": version "1.1.5" resolved "https://registry.yarnpkg.com/@types/yarnpkg__lockfile/-/yarnpkg__lockfile-1.1.5.tgz#9639020e1fb65120a2f4387db8f1e8b63efdf229"