Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps(yargs): upgrade to 17.3.1 #13590

Merged
merged 21 commits into from
Jan 26, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update types
  • Loading branch information
connorjclark committed Jan 25, 2022
commit 544e0cbfd24e43ce6fbc79be7808f120f426c89b
2 changes: 1 addition & 1 deletion lighthouse-cli/cli-flags.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ function getFlags(manualArgv, options = {}) {

// Augmenting yargs type with auto-camelCasing breaks in tsc@4.1.2 and @types/yargs@15.0.11,
// so for now cast to add yarg's camelCase properties to type.
const argv = parser.argv;
const argv = /** @type {Awaited<typeof parser.argv>} */ (parser.argv);
const cliFlags = /** @type {typeof argv & CamelCasify<typeof argv>} */ (argv);

return cliFlags;
Expand Down
3 changes: 2 additions & 1 deletion lighthouse-cli/test/smokehouse/frontends/smokehouse-bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ async function begin() {

// Augmenting yargs type with auto-camelCasing breaks in tsc@4.1.2 and @types/yargs@15.0.11,
// so for now cast to add yarg's camelCase properties to type.
const argv = /** @type {typeof rawArgv & CamelCasify<typeof rawArgv>} */ (rawArgv);
const argv =
/** @type {Awaited<typeof rawArgv> & CamelCasify<Awaited<typeof rawArgv>>} */ (rawArgv);

const jobs = Number.isFinite(argv.jobs) ? argv.jobs : undefined;
const retries = Number.isFinite(argv.retries) ? argv.retries : undefined;
Expand Down
3 changes: 2 additions & 1 deletion lighthouse-core/scripts/compare-runs.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ const rawArgv = y

// Augmenting yargs type with auto-camelCasing breaks in tsc@4.1.2 and @types/yargs@15.0.11,
// so for now cast to add yarg's camelCase properties to type.
const argv = /** @type {typeof rawArgv & CamelCasify<typeof rawArgv>} */ (rawArgv);
const argv =
/** @type {Awaited<typeof rawArgv> & CamelCasify<Awaited<typeof rawArgv>>} */ (rawArgv);

const reportExcludeRegex =
argv.reportExclude !== 'none' ? new RegExp(argv.reportExclude, 'i') : null;
Expand Down
3 changes: 2 additions & 1 deletion lighthouse-core/scripts/pptr-run-devtools.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import yargs from 'yargs';
import * as yargsHelpers from 'yargs/helpers';

const y = yargs(yargsHelpers.hideBin(process.argv));
const argv = y
const argv_ = y
.usage('$0 [url]')
.help('help').alias('help', 'h')
.option('_', {type: 'string'})
Expand All @@ -50,6 +50,7 @@ const argv = y
})
.argv;

const argv = /** @type {Awaited<typeof argv_>} */ (argv_);
/** @type {LH.Config.Json=} */
const config = argv.config ? JSON.parse(argv.config) : undefined;

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
"@types/tabulator-tables": "^4.9.1",
"@types/update-notifier": "^4.1.0",
"@types/ws": "^7.0.0",
"@types/yargs": "^16.0.0",
"@types/yargs": "^17.0.8",
"@types/yargs-parser": "^15.0.0",
"@typescript-eslint/eslint-plugin": "^5.6.0",
"@typescript-eslint/parser": "^5.6.0",
Expand Down
7 changes: 7 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1741,6 +1741,13 @@
dependencies:
"@types/yargs-parser" "*"

"@types/yargs@^17.0.8":
version "17.0.8"
resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.8.tgz#d23a3476fd3da8a0ea44b5494ca7fa677b9dad4c"
integrity sha512-wDeUwiUmem9FzsyysEwRukaEdDNcwbROvQ9QGRKaLI6t+IltNzbn4/i4asmB10auvZGQCzSQ6t0GSczEThlUXw==
dependencies:
"@types/yargs-parser" "*"

"@types/yauzl@^2.9.1":
version "2.9.1"
resolved "https://registry.yarnpkg.com/@types/yauzl/-/yauzl-2.9.1.tgz#d10f69f9f522eef3cf98e30afb684a1e1ec923af"
Expand Down