Skip to content

Commit

Permalink
chore(cli): Update dependencies (#7808)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile authored Dec 18, 2024
1 parent 7880bfc commit 795cee2
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 29 deletions.
44 changes: 22 additions & 22 deletions cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,38 +44,38 @@
"watch": "npm run assets && tsc -w"
},
"dependencies": {
"@ionic/cli-framework-output": "^2.2.5",
"@ionic/utils-subprocess": "2.1.11",
"@ionic/utils-terminal": "^2.3.3",
"commander": "^9.3.0",
"debug": "^4.3.4",
"@ionic/cli-framework-output": "^2.2.8",
"@ionic/utils-subprocess": "^3.0.1",
"@ionic/utils-terminal": "^2.3.5",
"commander": "^12.1.0",
"debug": "^4.4.0",
"env-paths": "^2.2.0",
"fs-extra": "^11.2.0",
"kleur": "^4.1.4",
"native-run": "^2.0.0",
"kleur": "^4.1.5",
"native-run": "^2.0.1",
"open": "^8.4.0",
"plist": "^3.0.5",
"plist": "^3.1.0",
"prompts": "^2.4.2",
"rimraf": "^4.4.1",
"semver": "^7.3.7",
"rimraf": "^6.0.1",
"semver": "^7.6.3",
"tar": "^6.1.11",
"tslib": "^2.4.0",
"xml2js": "^0.5.0"
"tslib": "^2.8.1",
"xml2js": "^0.6.2"
},
"devDependencies": {
"@types/debug": "^4.1.7",
"@types/debug": "^4.1.12",
"@types/fs-extra": "^11.0.4",
"@types/jest": "^29.5.0",
"@types/plist": "^3.0.2",
"@types/prompts": "^2.0.14",
"@types/semver": "^7.3.10",
"@types/jest": "^29.5.14",
"@types/plist": "^3.0.5",
"@types/prompts": "^2.4.9",
"@types/semver": "^7.5.8",
"@types/tar": "^6.1.1",
"@types/tmp": "^0.2.3",
"@types/tmp": "^0.2.6",
"@types/xml2js": "0.4.5",
"jest": "^29.5.0",
"jest-environment-jsdom": "^29.5.0",
"jest-jasmine2": "^29.5.0",
"tmp": "^0.2.1",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jest-jasmine2": "^29.7.0",
"tmp": "^0.2.3",
"ts-jest": "^29.0.5",
"typescript": "~5.0.2"
},
Expand Down
6 changes: 3 additions & 3 deletions cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,7 @@ export function runProgram(config: Config): void {
.option('--scheme <schemeName>', 'set the scheme of the iOS project')
.option('--flavor <flavorName>', 'set the flavor of the Android project (flavor dimensions not yet supported)')
.option('--list', 'list targets, then quit')
// TODO: remove once --json is a hidden option (https://github.com/tj/commander.js/issues/1106)
.allowUnknownOption(true)
.addOption(new Option('--json').hideHelp())
.option('--target <id>', 'use a specific target')
.option('--no-sync', `do not run ${c.input('sync')}`)
.option('--forwardPorts <port:port>', 'Automatically run "adb reverse" for better live-reloading support')
Expand All @@ -202,13 +201,14 @@ export function runProgram(config: Config): void {
config,
async (
platform,
{ scheme, flavor, list, target, sync, forwardPorts, liveReload, host, port, configuration },
{ scheme, flavor, list, json, target, sync, forwardPorts, liveReload, host, port, configuration },
) => {
const { runCommand } = await import('./tasks/run');
await runCommand(config, platform, {
scheme,
flavor,
list,
json,
target,
sync,
forwardPorts,
Expand Down
4 changes: 2 additions & 2 deletions cli/src/tasks/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export interface RunCommandOptions {
scheme?: string;
flavor?: string;
list?: boolean;
json?: boolean;
target?: string;
sync?: boolean;
forwardPorts?: string;
Expand Down Expand Up @@ -67,8 +68,7 @@ export async function runCommand(
id: t.id ?? '?',
}));

// TODO: make hidden commander option (https://github.com/tj/commander.js/issues/1106)
if (process.argv.includes('--json')) {
if (options.json) {
process.stdout.write(`${JSON.stringify(outputTargets)}\n`);
} else {
const rows = outputTargets.map((t) => [t.name, t.api, t.id]);
Expand Down
2 changes: 1 addition & 1 deletion cli/src/util/subprocess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export async function runCommand(
} catch (e) {
if (e instanceof SubprocessError) {
// old behavior of just throwing the stdout/stderr strings
throw e.output ? e.output : e.code ? e.code : e.error ? e.error.message : 'Unknown error';
throw e.output ? e.output : e.cause ? `${e.message} ${e.cause.toString()}` : e.code ? e.code : 'Unknown error';
}

throw e;
Expand Down
5 changes: 4 additions & 1 deletion cli/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
"declaration": true,
"esModuleInterop": true,
"importHelpers": true,
"lib": ["es2019"],
"lib": [
"ES2021",
"ES2022.Error"
],
"module": "commonjs",
"moduleResolution": "node",
"noEmitHelpers": true,
Expand Down

0 comments on commit 795cee2

Please sign in to comment.