From c1c166130794fa029d5b10982c3c4b5dc2255752 Mon Sep 17 00:00:00 2001 From: ChristopherPHolder Date: Fri, 26 Apr 2024 14:25:45 +0200 Subject: [PATCH] fix(cli): convert bing file to ts esm --- packages/cli/package.json | 4 ++-- packages/cli/project.json | 1 - packages/cli/src/cli.js | 5 ----- packages/cli/src/cli.ts | 6 ++++++ packages/cli/src/lib/boot-cli.ts | 5 +++-- packages/cli/src/lib/core/yargs/index.ts | 3 +-- packages/cli/tsconfig.lib.json | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) delete mode 100644 packages/cli/src/cli.js create mode 100644 packages/cli/src/cli.ts diff --git a/packages/cli/package.json b/packages/cli/package.json index 3785428cc..b9ba8890a 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -24,10 +24,10 @@ "tslib": "^2.3.1", "yargs": "^17.7.2", "typescript": "^4.6.3", - "lighthouse": "^9.6.7", + "lighthouse": "^11.7.1", "puppeteer": "^19.0.0", "@puppeteer/replay": "^1.3.1", - "prettier": "2.6.2", + "prettier": "^3.2.5", "enquirer": "^2.3.6", "concurrently": "^7.1.0" } diff --git a/packages/cli/project.json b/packages/cli/project.json index cb75a554b..097a4dc18 100644 --- a/packages/cli/project.json +++ b/packages/cli/project.json @@ -21,7 +21,6 @@ "assets": [ "README.md", "packages/cli/*.md", - "packages/cli/src/cli.js", "packages/cli/*.schema.json", "packages/cli/**/static/**" ] diff --git a/packages/cli/src/cli.js b/packages/cli/src/cli.js deleted file mode 100644 index 34066da65..000000000 --- a/packages/cli/src/cli.js +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env node -'use strict'; - -/* eslint-disable */ -import('./lib/boot-cli.js'); diff --git a/packages/cli/src/cli.ts b/packages/cli/src/cli.ts new file mode 100644 index 000000000..482c30d8f --- /dev/null +++ b/packages/cli/src/cli.ts @@ -0,0 +1,6 @@ +#!/usr/bin/env node +'use strict'; + +import bootCli from './lib/boot-cli.js'; + +await bootCli(); diff --git a/packages/cli/src/lib/boot-cli.ts b/packages/cli/src/lib/boot-cli.ts index b87d41a98..5c57fa3cf 100644 --- a/packages/cli/src/lib/boot-cli.ts +++ b/packages/cli/src/lib/boot-cli.ts @@ -14,7 +14,8 @@ function configParser(rcPath?: string): {} { return { ...globalConfig, ...rcConfig }; } -(async () => runCli({ +export default async () => await runCli({ commands: commands, options: {...GLOBAL_OPTIONS_YARGS_CFG}, - configParser }))(); + configParser +}); diff --git a/packages/cli/src/lib/core/yargs/index.ts b/packages/cli/src/lib/core/yargs/index.ts index 5c5c38463..67572b2c4 100644 --- a/packages/cli/src/lib/core/yargs/index.ts +++ b/packages/cli/src/lib/core/yargs/index.ts @@ -32,7 +32,6 @@ export function runCli(cliCfg: { options: { [key: string]: Options }; configParser: Options['configParser']; }) { - // apply `.argv` to get args as plain obj available - setupYargs(cliCfg.commands, cliCfg.options, cliCfg.configParser).argv; + return setupYargs(cliCfg.commands, cliCfg.options, cliCfg.configParser).parse(); } diff --git a/packages/cli/tsconfig.lib.json b/packages/cli/tsconfig.lib.json index 673e19316..dc41d1036 100644 --- a/packages/cli/tsconfig.lib.json +++ b/packages/cli/tsconfig.lib.json @@ -20,6 +20,6 @@ "**/*.test.ts", "**/static/**", "**/test-data/**", - "jest.config.ts" + "vite.config.ts" ] }