From ed231504e63543064a1bd318cbfeaa7737c26f0f Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Tue, 12 Dec 2023 12:10:21 -0500 Subject: [PATCH 1/5] chore: deprecate ssh commands (#5069) --- packages/@ionic/cli/src/commands/ssh/add.ts | 3 ++- packages/@ionic/cli/src/commands/ssh/delete.ts | 3 ++- packages/@ionic/cli/src/commands/ssh/generate.ts | 1 + packages/@ionic/cli/src/commands/ssh/index.ts | 4 ++++ packages/@ionic/cli/src/commands/ssh/list.ts | 2 ++ packages/@ionic/cli/src/commands/ssh/setup.ts | 2 ++ packages/@ionic/cli/src/commands/ssh/use.ts | 3 ++- 7 files changed, 15 insertions(+), 3 deletions(-) diff --git a/packages/@ionic/cli/src/commands/ssh/add.ts b/packages/@ionic/cli/src/commands/ssh/add.ts index a6ab8a3132..4bbb3d44d2 100644 --- a/packages/@ionic/cli/src/commands/ssh/add.ts +++ b/packages/@ionic/cli/src/commands/ssh/add.ts @@ -1,4 +1,4 @@ -import { validators } from '@ionic/cli-framework'; +import { validators, MetadataGroup } from '@ionic/cli-framework'; import { pathAccessible, pathExists } from '@ionic/utils-fs'; import { expandPath, prettyPath } from '@ionic/utils-terminal'; import * as fs from 'fs'; @@ -33,6 +33,7 @@ export class SSHAddCommand extends SSHBaseCommand implements CommandPreRun { type: Boolean, }, ], + groups: [MetadataGroup.DEPRECATED], }; } diff --git a/packages/@ionic/cli/src/commands/ssh/delete.ts b/packages/@ionic/cli/src/commands/ssh/delete.ts index 39ef5b73ef..571a2cb969 100644 --- a/packages/@ionic/cli/src/commands/ssh/delete.ts +++ b/packages/@ionic/cli/src/commands/ssh/delete.ts @@ -1,4 +1,4 @@ -import { validators } from '@ionic/cli-framework'; +import { validators, MetadataGroup } from '@ionic/cli-framework'; import { CommandLineInputs, CommandLineOptions, CommandMetadata, CommandPreRun } from '../../definitions'; import { input, strong } from '../../lib/color'; @@ -18,6 +18,7 @@ export class SSHDeleteCommand extends SSHBaseCommand implements CommandPreRun { validators: [validators.required], }, ], + groups: [MetadataGroup.DEPRECATED], }; } diff --git a/packages/@ionic/cli/src/commands/ssh/generate.ts b/packages/@ionic/cli/src/commands/ssh/generate.ts index 370da34ddc..20600efd9e 100644 --- a/packages/@ionic/cli/src/commands/ssh/generate.ts +++ b/packages/@ionic/cli/src/commands/ssh/generate.ts @@ -44,6 +44,7 @@ export class SSHGenerateCommand extends SSHBaseCommand implements CommandPreRun groups: [MetadataGroup.ADVANCED], }, ], + groups: [MetadataGroup.DEPRECATED], }; } diff --git a/packages/@ionic/cli/src/commands/ssh/index.ts b/packages/@ionic/cli/src/commands/ssh/index.ts index b00f68d1df..3e92e81832 100644 --- a/packages/@ionic/cli/src/commands/ssh/index.ts +++ b/packages/@ionic/cli/src/commands/ssh/index.ts @@ -1,3 +1,4 @@ +import { MetadataGroup } from '@ionic/cli-framework'; import { input } from '../../lib/color'; import { CommandMap, Namespace } from '../../lib/namespace'; @@ -12,6 +13,8 @@ export class SSHNamespace extends Namespace { These commands help automate your SSH configuration for Ionic. As an alternative, SSH configuration can be done entirely manually by visiting your Personal Settings[^dashboard-settings-ssh-keys]. To begin, run ${input('ionic ssh setup')}, which lets you use existing keys or generate new ones just for Ionic. + +Deprecated. Developers should configure SSH by visiting their Personal Settings at https://dashboard.ionicframework.com/settings/ssh-keys. `, footnotes: [ { @@ -19,6 +22,7 @@ To begin, run ${input('ionic ssh setup')}, which lets you use existing keys or g url: `${dashUrl}/settings/ssh-keys`, }, ], + groups: [MetadataGroup.DEPRECATED], }; } diff --git a/packages/@ionic/cli/src/commands/ssh/list.ts b/packages/@ionic/cli/src/commands/ssh/list.ts index 15496cff43..29e74ece6c 100644 --- a/packages/@ionic/cli/src/commands/ssh/list.ts +++ b/packages/@ionic/cli/src/commands/ssh/list.ts @@ -1,3 +1,4 @@ +import { MetadataGroup } from '@ionic/cli-framework'; import { columnar } from '@ionic/utils-terminal'; import { COLUMNAR_OPTIONS } from '../../constants'; @@ -19,6 +20,7 @@ export class SSHListCommand extends SSHBaseCommand implements CommandPreRun { type: Boolean, }, ], + groups: [MetadataGroup.DEPRECATED], }; } diff --git a/packages/@ionic/cli/src/commands/ssh/setup.ts b/packages/@ionic/cli/src/commands/ssh/setup.ts index f1a21061c0..b8abd7a680 100644 --- a/packages/@ionic/cli/src/commands/ssh/setup.ts +++ b/packages/@ionic/cli/src/commands/ssh/setup.ts @@ -1,3 +1,4 @@ +import { MetadataGroup } from '@ionic/cli-framework'; import { pathExists } from '@ionic/utils-fs'; import { prettyPath } from '@ionic/utils-terminal'; @@ -31,6 +32,7 @@ If you are having issues setting up SSH keys, please get in touch with our Suppo url: 'https://ion.link/support-request', }, ], + groups: [MetadataGroup.DEPRECATED], }; } diff --git a/packages/@ionic/cli/src/commands/ssh/use.ts b/packages/@ionic/cli/src/commands/ssh/use.ts index 9db519ce13..5e30aed4c2 100644 --- a/packages/@ionic/cli/src/commands/ssh/use.ts +++ b/packages/@ionic/cli/src/commands/ssh/use.ts @@ -1,4 +1,4 @@ -import { validators } from '@ionic/cli-framework'; +import { validators, MetadataGroup } from '@ionic/cli-framework'; import { fileToString, writeFile } from '@ionic/utils-fs'; import { expandPath, prettyPath } from '@ionic/utils-terminal'; @@ -32,6 +32,7 @@ Before making changes, ${input('ionic ssh use')} will print a diff and ask for p validators: [validators.required], }, ], + groups: [MetadataGroup.DEPRECATED], }; } From 4050419bef70fb92e58b0a83cd4b68b48090e596 Mon Sep 17 00:00:00 2001 From: Sean Perkins <13732623+sean-perkins@users.noreply.github.com> Date: Tue, 19 Dec 2023 11:31:51 -0500 Subject: [PATCH 2/5] fix(cli): resolve vm2 security vulnerability (#5070) --- .../@ionic/cli-framework-prompts/src/index.ts | 2 +- .../src/lib/__tests__/options.ts | 2 +- .../@ionic/cli-framework/src/lib/colors.ts | 2 +- packages/@ionic/cli-framework/src/lib/help.ts | 4 +- .../@ionic/cli-framework/src/lib/options.ts | 14 +- .../cli-framework/src/lib/validators.ts | 2 +- .../@ionic/cli-framework/src/utils/ipc.ts | 2 +- packages/@ionic/cli/.gitignore | 1 + packages/@ionic/cli/package.json | 3 +- packages/@ionic/cli/src/bootstrap.ts | 2 +- .../@ionic/cli/src/commands/capacitor/run.ts | 10 +- .../@ionic/cli/src/commands/config/get.ts | 2 +- .../@ionic/cli/src/commands/cordova/run.ts | 8 +- .../cli/src/commands/integrations/list.ts | 2 +- packages/@ionic/cli/src/commands/link.ts | 4 +- .../cli/src/commands/live-update/manifest.ts | 8 +- packages/@ionic/cli/src/commands/login.ts | 6 +- .../cli/src/commands/monitoring/syncmaps.ts | 4 +- packages/@ionic/cli/src/commands/start.ts | 88 ++++++------ packages/@ionic/cli/src/constants.ts | 2 +- packages/@ionic/cli/src/index.ts | 4 +- .../cli/src/lib/__tests__/ssh-config.ts | 2 +- packages/@ionic/cli/src/lib/build.ts | 10 +- packages/@ionic/cli/src/lib/color.ts | 2 +- packages/@ionic/cli/src/lib/events.ts | 2 +- packages/@ionic/cli/src/lib/hooks.ts | 8 +- packages/@ionic/cli/src/lib/http.ts | 4 +- packages/@ionic/cli/src/lib/index.ts | 6 +- .../src/lib/integrations/capacitor/index.ts | 18 +-- .../integrations/cordova/__tests__/project.ts | 2 +- .../src/lib/integrations/cordova/config.ts | 14 +- .../cli/src/lib/integrations/cordova/index.ts | 8 +- .../src/lib/integrations/cordova/project.ts | 2 +- packages/@ionic/cli/src/lib/ionitron.ts | 2 +- packages/@ionic/cli/src/lib/open.ts | 4 +- .../cli/src/lib/project/angular/generate.ts | 4 +- .../cli/src/lib/project/angular/index.ts | 12 +- .../cli/src/lib/project/angular/serve.ts | 6 +- packages/@ionic/cli/src/lib/project/index.ts | 2 +- .../cli/src/lib/project/react-vite/index.ts | 4 +- .../@ionic/cli/src/lib/project/react/index.ts | 6 +- .../cli/src/lib/project/vue-vite/index.ts | 4 +- .../@ionic/cli/src/lib/project/vue/index.ts | 4 +- packages/@ionic/cli/src/lib/serve.ts | 16 +-- packages/@ionic/cli/src/lib/shell.ts | 8 +- packages/@ionic/cli/src/lib/ssh-config.ts | 4 +- packages/@ionic/cli/src/lib/telemetry.ts | 4 +- packages/@ionic/cli/src/lib/utils/http.ts | 9 +- packages/@ionic/cli/src/lib/utils/logger.ts | 2 +- .../cli/src/lib/utils/superagent-proxy.ts | 131 ++++++++++++++++++ packages/@ionic/cli/tsconfig.json | 1 - packages/@ionic/discover/src/comm.ts | 5 +- packages/@ionic/discover/src/publisher.ts | 36 ++--- .../utils-network/src/__tests__/index.ts | 2 +- packages/@ionic/utils-network/src/index.ts | 6 +- packages/@ionic/utils-process/src/index.ts | 10 +- .../utils-stream/src/__tests__/index.ts | 2 +- packages/@ionic/utils-subprocess/src/index.ts | 4 +- packages/@ionic/utils-terminal/src/cursor.ts | 2 +- packages/@ionic/utils-terminal/src/info.ts | 2 +- packages/cli-scripts/src/docs/index.ts | 2 +- packages/cli-scripts/src/docs/utils.ts | 6 +- tsconfig.base.json | 6 +- 63 files changed, 342 insertions(+), 214 deletions(-) create mode 100644 packages/@ionic/cli/src/lib/utils/superagent-proxy.ts diff --git a/packages/@ionic/cli-framework-prompts/src/index.ts b/packages/@ionic/cli-framework-prompts/src/index.ts index 153f031e00..a46722f693 100644 --- a/packages/@ionic/cli-framework-prompts/src/index.ts +++ b/packages/@ionic/cli-framework-prompts/src/index.ts @@ -1,5 +1,5 @@ import { TERMINAL_INFO } from '@ionic/utils-terminal'; -import * as Debug from 'debug'; +import { debug as Debug } from 'debug'; const debug = Debug('ionic:cli-framework-prompts'); diff --git a/packages/@ionic/cli-framework/src/lib/__tests__/options.ts b/packages/@ionic/cli-framework/src/lib/__tests__/options.ts index 363e062dc9..7cfdfd797b 100644 --- a/packages/@ionic/cli-framework/src/lib/__tests__/options.ts +++ b/packages/@ionic/cli-framework/src/lib/__tests__/options.ts @@ -1,4 +1,4 @@ -import * as minimist from 'minimist'; +import minimist from 'minimist'; import { CommandMetadata } from '../../definitions'; import { OptionFilters, filterCommandLineOptions, filterCommandLineOptionsByGroup, metadataOptionsToParseArgsOptions, separateArgv, stripOptions, unparseArgs } from '../options'; diff --git a/packages/@ionic/cli-framework/src/lib/colors.ts b/packages/@ionic/cli-framework/src/lib/colors.ts index 6201cde2c7..cee61e2ad9 100644 --- a/packages/@ionic/cli-framework/src/lib/colors.ts +++ b/packages/@ionic/cli-framework/src/lib/colors.ts @@ -1,5 +1,5 @@ import { ColorFunction, Colors as BaseColors } from '@ionic/cli-framework-output'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; import * as lodash from 'lodash'; import { MetadataGroup } from '../definitions'; diff --git a/packages/@ionic/cli-framework/src/lib/help.ts b/packages/@ionic/cli-framework/src/lib/help.ts index 992abfde42..b6c88559d7 100644 --- a/packages/@ionic/cli-framework/src/lib/help.ts +++ b/packages/@ionic/cli-framework/src/lib/help.ts @@ -1,6 +1,6 @@ import { filter, map } from '@ionic/utils-array'; import { generateFillSpaceStringList, stringWidth, wordWrap } from '@ionic/utils-terminal'; -import * as Debug from 'debug'; +import { debug as Debug } from 'debug'; import * as lodash from 'lodash'; import { CommandMetadata, CommandMetadataInput, CommandMetadataOption, Footnote, HydratedCommandMetadata, HydratedNamespaceMetadata, ICommand, INamespace, LinkFootnote, MetadataGroup, NamespaceLocateResult, NamespaceMetadata } from '../definitions'; @@ -223,7 +223,7 @@ export class NamespaceStringHelpFormatter, N e const filteredCommands = await filter(commands, async cmd => this.filterCommandCallback(cmd)); - const [ cmdDetails, nsDetails ] = await Promise.all([ + const [cmdDetails, nsDetails] = await Promise.all([ this.getListOfCommandDetails(filteredCommands.filter(cmd => cmd.namespace === this.namespace)), this.getListOfNamespaceDetails(filteredCommands.filter(cmd => cmd.namespace !== this.namespace)), ]); diff --git a/packages/@ionic/cli-framework/src/lib/options.ts b/packages/@ionic/cli-framework/src/lib/options.ts index b622b27c9e..dc5994737a 100644 --- a/packages/@ionic/cli-framework/src/lib/options.ts +++ b/packages/@ionic/cli-framework/src/lib/options.ts @@ -1,5 +1,5 @@ import * as lodash from 'lodash'; -import * as minimist from 'minimist'; +import minimist from 'minimist'; import { CommandLineOptions, CommandMetadataOption, HydratedParseArgsOptions, ParsedArg } from '../definitions'; @@ -19,7 +19,7 @@ export { ParsedArgs } from 'minimist'; */ export function stripOptions(pargv: readonly string[], { includeSeparated = true }: { includeSeparated?: boolean; }): string[] { const r = /^\-/; - const [ ownArgs, otherArgs ] = separateArgv(pargv); + const [ownArgs, otherArgs] = separateArgv(pargv); const filteredArgs = ownArgs.filter(arg => !r.test(arg)); if (!includeSeparated) { @@ -50,7 +50,7 @@ export function separateArgv(pargv: readonly string[]): [string[], string[]] { otherArgs.shift(); // strip separator } - return [ ownArgs, otherArgs ]; + return [ownArgs, otherArgs]; } /** @@ -166,8 +166,8 @@ export function filterCommandLineOptions(option const pairs = Object.keys(parsedArgs) .map((k): [string, O | undefined, ParsedArg | undefined] => [k, mapped.get(k), parsedArgs[k]]) - .filter(([ k, opt, value ]) => opt && predicate(opt, value)) - .map(([ k, opt, value ]) => [opt ? opt.name : k, value]); + .filter(([k, opt, value]) => opt && predicate(opt, value)) + .map(([k, opt, value]) => [opt ? opt.name : k, value]); return { ...initial, ...lodash.fromPairs(pairs) }; } @@ -221,7 +221,7 @@ export function unparseArgs(parsedArgs: minimist.ParsedArgs, { useDoubleQuotes, const dashKey = (k: string) => (k.length === 1 ? '-' : '--') + k; const pushPairs = (...pairs: [string, string | undefined][]) => { - for (const [ k, val ] of pairs) { + for (const [k, val] of pairs) { const key = dashKey(allowCamelCase ? k : k.replace(/[A-Z]/g, '-$&').toLowerCase()); if (useEquals) { @@ -274,7 +274,7 @@ export function unparseArgs(parsedArgs: minimist.ParsedArgs, { useDoubleQuotes, isKnown(k) ); - for (const [ key, val ] of pairedOptions) { + for (const [key, val] of pairedOptions) { if (val === true) { pushPairs([key, undefined]); } else if (val === false && !ignoreFalse) { diff --git a/packages/@ionic/cli-framework/src/lib/validators.ts b/packages/@ionic/cli-framework/src/lib/validators.ts index 17a0c0c142..a22ee49d81 100644 --- a/packages/@ionic/cli-framework/src/lib/validators.ts +++ b/packages/@ionic/cli-framework/src/lib/validators.ts @@ -1,4 +1,4 @@ -import * as chalk from 'chalk'; +import chalk from 'chalk'; import { ValidationError, Validator, Validators } from '../definitions'; import { InputValidationError } from '../errors'; diff --git a/packages/@ionic/cli-framework/src/utils/ipc.ts b/packages/@ionic/cli-framework/src/utils/ipc.ts index c35b8a9182..97102babc6 100644 --- a/packages/@ionic/cli-framework/src/utils/ipc.ts +++ b/packages/@ionic/cli-framework/src/utils/ipc.ts @@ -1,6 +1,6 @@ import { fork } from '@ionic/utils-subprocess'; import { ChildProcess } from 'child_process'; -import * as Debug from 'debug'; +import { debug as Debug } from 'debug'; import * as fs from 'fs'; import { ERROR_IPC_UNKNOWN_PROCEDURE, IPCError } from '../errors'; diff --git a/packages/@ionic/cli/.gitignore b/packages/@ionic/cli/.gitignore index 988c2bd32f..d2e88252f6 100644 --- a/packages/@ionic/cli/.gitignore +++ b/packages/@ionic/cli/.gitignore @@ -3,3 +3,4 @@ !jest.config.js !lint-staged.config.js *.d.ts +*.tgz diff --git a/packages/@ionic/cli/package.json b/packages/@ionic/cli/package.json index f634bfe893..66de878ce0 100644 --- a/packages/@ionic/cli/package.json +++ b/packages/@ionic/cli/package.json @@ -63,7 +63,7 @@ "ssh-config": "^1.1.1", "stream-combiner2": "^1.1.1", "superagent": "^8.0.9", - "superagent-proxy": "^3.0.0", + "proxy-agent": "^6.3.0", "tar": "^6.0.1", "tslib": "^2.0.1" }, @@ -77,7 +77,6 @@ "@types/semver": "^7.1.0", "@types/split2": "^2.1.6", "@types/superagent": "4.1.3", - "@types/superagent-proxy": "^3.0.0", "@types/tar": "^6.1.2", "jest": "^26.4.2", "jest-cli": "^26.0.1", diff --git a/packages/@ionic/cli/src/bootstrap.ts b/packages/@ionic/cli/src/bootstrap.ts index 9c3c1d7e9d..63ce9277d8 100644 --- a/packages/@ionic/cli/src/bootstrap.ts +++ b/packages/@ionic/cli/src/bootstrap.ts @@ -1,5 +1,5 @@ import { compileNodeModulesPaths, readPackageJsonFile } from '@ionic/cli-framework/utils/node'; -import * as Debug from 'debug'; +import { debug as Debug } from 'debug'; import * as path from 'path'; import * as semver from 'semver'; diff --git a/packages/@ionic/cli/src/commands/capacitor/run.ts b/packages/@ionic/cli/src/commands/capacitor/run.ts index 5724e24e2c..0398a6e902 100644 --- a/packages/@ionic/cli/src/commands/capacitor/run.ts +++ b/packages/@ionic/cli/src/commands/capacitor/run.ts @@ -1,8 +1,8 @@ import { BaseError, Footnote, validators } from '@ionic/cli-framework'; import { sleepForever } from '@ionic/utils-process'; import { columnar } from '@ionic/utils-terminal'; -import * as chalk from 'chalk'; -import * as Debug from 'debug'; +import chalk from 'chalk'; +import { debug as Debug } from 'debug'; import * as lodash from 'lodash'; import * as semver from 'semver'; @@ -233,7 +233,7 @@ For Android and iOS, you can setup Remote Debugging on your device with browser throw new FatalException(`Cannot run ${input('ionic capacitor run')} outside a project directory.`); } - const [ platform ] = inputs; + const [platform] = inputs; const doLiveReload = !!options['livereload']; const doOpenFlow = (await this.isOldCapacitor()) || options['open'] === true; @@ -297,7 +297,7 @@ For Android and iOS, you can setup Remote Debugging on your device with browser throw new FatalException(`Cannot run ${input('ionic capacitor run')} outside a project directory.`); } - const [ platform ] = inputs; + const [platform] = inputs; await this.runCapacitorRunHook('capacitor:run:before', inputs, options, { ...this.env, project: this.project }); @@ -326,7 +326,7 @@ For Android and iOS, you can setup Remote Debugging on your device with browser throw new FatalException(`Cannot run ${input('ionic capacitor run')} outside a project directory.`); } - const [ platform ] = inputs; + const [platform] = inputs; await this.runCapacitorRunHook('capacitor:run:before', inputs, options, { ...this.env, project: this.project }); await this.runCapacitor(['run', platform, ...(shouldSync ? [] : ['--no-sync']), '--target', String(options['target'])]); diff --git a/packages/@ionic/cli/src/commands/config/get.ts b/packages/@ionic/cli/src/commands/config/get.ts index 37969695b4..6a814a757f 100644 --- a/packages/@ionic/cli/src/commands/config/get.ts +++ b/packages/@ionic/cli/src/commands/config/get.ts @@ -1,7 +1,7 @@ import { MetadataGroup } from '@ionic/cli-framework'; import { strcmp } from '@ionic/cli-framework/utils/string'; import { columnar, prettyPath } from '@ionic/utils-terminal'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; import * as lodash from 'lodash'; import * as util from 'util'; diff --git a/packages/@ionic/cli/src/commands/cordova/run.ts b/packages/@ionic/cli/src/commands/cordova/run.ts index 81fc5556cf..5662d59e31 100644 --- a/packages/@ionic/cli/src/commands/cordova/run.ts +++ b/packages/@ionic/cli/src/commands/cordova/run.ts @@ -1,6 +1,6 @@ import { Footnote, MetadataGroup, validators } from '@ionic/cli-framework'; import { onBeforeExit, sleepForever } from '@ionic/utils-process'; -import * as Debug from 'debug'; +import { debug as Debug } from 'debug'; import * as lodash from 'lodash'; import { CommandInstanceInfo, CommandLineInputs, CommandLineOptions, CommandMetadata, CommandMetadataOption, CommandPreRun, IShellRunOptions, ServeDetails } from '../../definitions'; @@ -212,7 +212,7 @@ Just like with ${input('ionic cordova build')}, you can pass additional options inputs[0] = p.trim(); } - const [ platform ] = inputs; + const [platform] = inputs; if (platform && options['native-run'] && !SUPPORTED_PLATFORMS.includes(platform)) { this.env.log.warn(`${input(platform)} is not supported by ${input('native-run')}. Using Cordova to run the app.`); @@ -298,7 +298,7 @@ Just like with ${input('ionic cordova build')}, you can pass additional options buildOpts.stdio = options['verbose'] ? 'inherit' : ['pipe', 'ignore', 'pipe']; if (options['native-run']) { - const [ platform ] = inputs; + const [platform] = inputs; await this.runCordova(filterArgumentsForCordova({ ...metadata, name: 'build' }, options), buildOpts); @@ -336,7 +336,7 @@ Just like with ${input('ionic cordova build')}, you can pass additional options if (options['native-run']) { const conf = await loadCordovaConfig(this.integration); - const [ platform ] = inputs; + const [platform] = inputs; await this.runCordova(filterArgumentsForCordova({ ...metadata, name: 'build' }, options), { stdio: 'inherit' }); diff --git a/packages/@ionic/cli/src/commands/integrations/list.ts b/packages/@ionic/cli/src/commands/integrations/list.ts index 450338e433..f629df1ca0 100644 --- a/packages/@ionic/cli/src/commands/integrations/list.ts +++ b/packages/@ionic/cli/src/commands/integrations/list.ts @@ -1,5 +1,5 @@ import { columnar } from '@ionic/utils-terminal'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; import { CommandLineInputs, CommandLineOptions, CommandMetadata, IntegrationName } from '../../definitions'; import { input, strong } from '../../lib/color'; diff --git a/packages/@ionic/cli/src/commands/link.ts b/packages/@ionic/cli/src/commands/link.ts index d06276877f..d9e4e5ad63 100644 --- a/packages/@ionic/cli/src/commands/link.ts +++ b/packages/@ionic/cli/src/commands/link.ts @@ -1,7 +1,7 @@ import { MetadataGroup, validators } from '@ionic/cli-framework'; import { createPromptChoiceSeparator } from '@ionic/cli-framework-prompts'; import { prettyPath } from '@ionic/utils-terminal'; -import * as Debug from 'debug'; +import { debug as Debug } from 'debug'; import { PROJECT_FILE } from '../constants'; import { App, CommandInstanceInfo, CommandLineInputs, CommandLineOptions, CommandMetadata, CommandPreRun, GithubBranch, GithubRepo } from '../definitions'; @@ -468,7 +468,7 @@ If you are having issues linking, please get in touch with our Support[^support- } formatRepoName(fullName: string) { - const [ org, name ] = fullName.split('/'); + const [org, name] = fullName.split('/'); return `${weak(`${org} /`)} ${name}`; } diff --git a/packages/@ionic/cli/src/commands/live-update/manifest.ts b/packages/@ionic/cli/src/commands/live-update/manifest.ts index 832d6e0ea7..18cf415957 100644 --- a/packages/@ionic/cli/src/commands/live-update/manifest.ts +++ b/packages/@ionic/cli/src/commands/live-update/manifest.ts @@ -7,7 +7,7 @@ import * as crypto from 'crypto'; import * as fs from 'fs'; import lodash = require('lodash'); import * as path from 'path'; -import * as Debug from 'debug'; +import { debug as Debug } from 'debug'; import { CommandMetadata } from '../../definitions'; import { input } from '../../lib/color'; @@ -62,7 +62,7 @@ export class LiveUpdatesManifestCommand extends LiveUpdatesCoreCommand { private async getFilesAndSizesAndHashesForGlobPattern(buildDir: string): Promise { const contents = await readdirp(buildDir, { filter: item => !/(css|js)\.map$/.test(item.path) }); const stats = await map(contents, async (f): Promise<[string, fs.Stats]> => [f, await stat(f)]); - const files = stats.filter(([ , s ]) => !s.isDirectory()); + const files = stats.filter(([, s]) => !s.isDirectory()); const items = await Promise.all(files.map(([f, s]) => this.getFileAndSizeAndHashForFile(buildDir, f, s))); @@ -113,7 +113,7 @@ export class LiveUpdatesManifestCommand extends LiveUpdatesCoreCommand { level: LOGGER_LEVELS.INFO, handlers: createDefaultLoggerHandlers(), }); - const shell = new Shell({ log }, { alterPath: p => { return prependNodeModulesBinToPath(this.env.ctx.execPath, p)} }); + const shell = new Shell({ log }, { alterPath: p => { return prependNodeModulesBinToPath(this.env.ctx.execPath, p) } }); debug('Getting config with Capacitor CLI: %O', args); @@ -126,7 +126,7 @@ export class LiveUpdatesManifestCommand extends LiveUpdatesCoreCommand { try { return JSON.parse(output); - } catch(e) { + } catch (e) { debug('Could not get config from Capacitor CLI (probably old version)', e); return; } diff --git a/packages/@ionic/cli/src/commands/login.ts b/packages/@ionic/cli/src/commands/login.ts index 9b9905a6e3..46f709c107 100644 --- a/packages/@ionic/cli/src/commands/login.ts +++ b/packages/@ionic/cli/src/commands/login.ts @@ -1,5 +1,5 @@ import { combine, validators } from '@ionic/cli-framework'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; import * as readline from 'readline'; import { CommandLineInputs, CommandLineOptions, CommandMetadata, CommandPreRun } from '../definitions'; @@ -155,7 +155,7 @@ If you are having issues logging in, please get in touch with our Support[^suppo } async run(inputs: CommandLineInputs, options: CommandLineOptions): Promise { - const [ email, password ] = inputs; + const [email, password] = inputs; if (email && password) { await this.logout(); @@ -182,7 +182,7 @@ If you are having issues logging in, please get in touch with our Support[^suppo await this.logout(); await this.env.session.webLogin(); } else { - return ; + return; } } diff --git a/packages/@ionic/cli/src/commands/monitoring/syncmaps.ts b/packages/@ionic/cli/src/commands/monitoring/syncmaps.ts index 4089dfb9f4..e27afa5a19 100644 --- a/packages/@ionic/cli/src/commands/monitoring/syncmaps.ts +++ b/packages/@ionic/cli/src/commands/monitoring/syncmaps.ts @@ -1,6 +1,6 @@ import { pathExists, readFile, readdirSafe } from '@ionic/utils-fs'; import { columnar, prettyPath } from '@ionic/utils-terminal'; -import * as Debug from 'debug'; +import { debug as Debug } from 'debug'; import * as path from 'path'; import { APIResponseSuccess, CommandLineInputs, CommandLineOptions, CommandMetadata } from '../../definitions'; @@ -48,7 +48,7 @@ By default, ${input('ionic monitoring syncmaps')} will upload the sourcemap file const token = await this.env.session.getUserToken(); const appflowId = await this.project.requireAppflowId(); - const [ snapshotId ] = inputs; + const [snapshotId] = inputs; const doBuild = options.build ? true : false; const cordova = this.project.requireIntegration('cordova'); diff --git a/packages/@ionic/cli/src/commands/start.ts b/packages/@ionic/cli/src/commands/start.ts index 5d976f38e8..8328e3efc1 100644 --- a/packages/@ionic/cli/src/commands/start.ts +++ b/packages/@ionic/cli/src/commands/start.ts @@ -2,8 +2,8 @@ import { MetadataGroup, validators } from '@ionic/cli-framework'; import { isValidURL, slugify } from '@ionic/cli-framework/utils/string'; import { mkdir, pathExists, remove, unlink } from '@ionic/utils-fs'; import { columnar, prettyPath } from '@ionic/utils-terminal'; -import * as chalk from 'chalk'; -import * as Debug from 'debug'; +import chalk from 'chalk'; +import { debug as Debug } from 'debug'; import * as path from 'path'; import { COLUMNAR_OPTIONS, PROJECT_FILE, ANGULAR_STANDALONE } from '../constants'; @@ -263,16 +263,16 @@ Use the ${input( const appIconBuffer = data.appIcon ? Buffer.from( - data.appIcon.replace(/^data:image\/\w+;base64,/, ''), - 'base64' - ) + data.appIcon.replace(/^data:image\/\w+;base64,/, ''), + 'base64' + ) : undefined; const splashBuffer = data.appSplash ? Buffer.from( - data.appSplash.replace(/^data:image\/\w+;base64,/, ''), - 'base64' - ) + data.appSplash.replace(/^data:image\/\w+;base64,/, ''), + 'base64' + ) : undefined; this.schema = { @@ -397,8 +397,8 @@ Use the ${input( let projectType = isValidURL(inputs[1]) ? 'custom' : options['type'] - ? String(options['type']) - : await this.getProjectType(); + ? String(options['type']) + : await this.getProjectType(); if (options['cordova']) { const { checkForUnsupportedProject } = await import( @@ -435,9 +435,9 @@ Use the ${input( this.env.log.nl(); this.env.log.msg( `${strong(`Every great app needs a name! ${emoji('😍', '')}`)}\n` + - `Please enter the full name of your app. You can change this at any time. To bypass this prompt next time, supply ${input( - 'name' - )}, the first argument to ${input('ionic start')}.\n\n` + `Please enter the full name of your app. You can change this at any time. To bypass this prompt next time, supply ${input( + 'name' + )}, the first argument to ${input('ionic start')}.\n\n` ); } @@ -459,9 +459,9 @@ Use the ${input( `${strong( `Let's pick the perfect starter template! ${emoji('💪', '')}` )}\n` + - `Starter templates are ready-to-go Ionic apps that come packed with everything you need to build your app. To bypass this prompt next time, supply ${input( - 'template' - )}, the second argument to ${input('ionic start')}.\n\n` + `Starter templates are ready-to-go Ionic apps that come packed with everything you need to build your app. To bypass this prompt next time, supply ${input( + 'template' + )}, the second argument to ${input('ionic start')}.\n\n` ); } @@ -589,9 +589,9 @@ Use the ${input( if (options['v1'] || options['v2']) { throw new FatalException( `The ${input('--v1')} and ${input('--v2')} flags have been removed.\n` + - `Use the ${input('--type')} option. (see ${input( - 'ionic start --help' - )})` + `Use the ${input('--type')} option. (see ${input( + 'ionic start --help' + )})` ); } @@ -670,9 +670,9 @@ Use the ${input( this.env.log.nl(); this.env.log.msg( `${strong(`Pick a framework! ${emoji('😁', '')}`)}\n\n` + - `Please select the JavaScript framework to use for your new app. To bypass this prompt next time, supply a value for the ${input( - '--type' - )} option.\n\n` + `Please select the JavaScript framework to use for your new app. To bypass this prompt next time, supply a value for the ${input( + '--type' + )} option.\n\n` ); } @@ -734,16 +734,16 @@ Use the ${input( if (appflowId) { throw new FatalException( `Git CLI not found on your PATH.\n` + - `Git must be installed to connect this app to Ionic. ${installationDocs}` + `Git must be installed to connect this app to Ionic. ${installationDocs}` ); } if (this.schema.cloned) { throw new FatalException( `Git CLI not found on your PATH.\n` + - `Git must be installed to clone apps with ${input( - 'ionic start' - )}. ${installationDocs}` + `Git must be installed to clone apps with ${input( + 'ionic start' + )}. ${installationDocs}` ); } } @@ -1038,9 +1038,8 @@ Use the ${input( if (starterTemplate && starterTemplate.type === 'managed') { return { ...starterTemplate, - archive: `${STARTER_BASE_URL}/${tag === 'latest' ? '' : `${tag}/`}${ - starterTemplate.id - }.tar.gz`, + archive: `${STARTER_BASE_URL}/${tag === 'latest' ? '' : `${tag}/`}${starterTemplate.id + }.tar.gz`, }; } @@ -1058,16 +1057,15 @@ Use the ${input( return { name: starter.name, projectType: starter.type, - archive: `${STARTER_BASE_URL}/${tag === 'latest' ? '' : `${tag}/`}${ - starter.id - }.tar.gz`, + archive: `${STARTER_BASE_URL}/${tag === 'latest' ? '' : `${tag}/`}${starter.id + }.tar.gz`, }; } else { throw new FatalException( `Unable to find starter template for ${input(template)}\n` + - `If this is not a typo, please make sure it is a valid starter template within the starters repo: ${strong( - 'https://github.com/ionic-team/starters' - )}` + `If this is not a typo, please make sure it is a valid starter template within the starters repo: ${strong( + 'https://github.com/ionic-team/starters' + )}` ); } } @@ -1078,9 +1076,9 @@ Use the ${input( if (!['custom', ...projectTypes].includes(type)) { throw new FatalException( `${input(type)} is not a valid project type.\n` + - `Please choose a different ${input('--type')}. Use ${input( - 'ionic start --list' - )} to list all available starter templates.` + `Please choose a different ${input('--type')}. Use ${input( + 'ionic start --list' + )} to list all available starter templates.` ); } } @@ -1089,9 +1087,9 @@ Use the ${input( if (!isValidProjectId(projectId)) { throw new FatalException( `${input(projectId)} is not a valid package or directory name.\n` + - `Please choose a different ${input( - '--project-id' - )}. Alphanumeric characters are always safe.` + `Please choose a different ${input( + '--project-id' + )}. Alphanumeric characters are always safe.` ); } } @@ -1162,11 +1160,11 @@ Use the ${input( )} within the app directory to see your app in the browser`, isCapacitor ? `Run ${input( - 'ionic capacitor add' - )} to add a native iOS or Android project using Capacitor` + 'ionic capacitor add' + )} to add a native iOS or Android project using Capacitor` : `Run ${input( - 'ionic cordova platform add' - )} to add a native iOS or Android project using Cordova`, + 'ionic cordova platform add' + )} to add a native iOS or Android project using Cordova`, `Generate your app icon and splash screens using ${input( cordovaResCommand )}`, diff --git a/packages/@ionic/cli/src/constants.ts b/packages/@ionic/cli/src/constants.ts index de126950c7..1d31eb7bed 100644 --- a/packages/@ionic/cli/src/constants.ts +++ b/packages/@ionic/cli/src/constants.ts @@ -1,4 +1,4 @@ -import * as chalk from 'chalk'; +import chalk from 'chalk'; import * as lodash from 'lodash'; import * as path from 'path'; diff --git a/packages/@ionic/cli/src/index.ts b/packages/@ionic/cli/src/index.ts index 9b72945baf..949d9057fc 100644 --- a/packages/@ionic/cli/src/index.ts +++ b/packages/@ionic/cli/src/index.ts @@ -1,7 +1,7 @@ import { BaseError, InputValidationError, PackageJson } from '@ionic/cli-framework'; import { readPackageJsonFile } from '@ionic/cli-framework/utils/node'; import { processExit } from '@ionic/utils-process'; -import * as Debug from 'debug'; +import { debug as Debug } from 'debug'; import * as path from 'path'; import * as util from 'util'; @@ -126,7 +126,7 @@ export async function run(pargv: string[]): Promise { const location = await executor.locate(pargv); - const [ , [ cmd = '' ] = [] ] = location.path; + const [, [cmd = ''] = []] = location.path; if (!['config', 'completion', 'help', 'login', 'logout', 'version'].includes(cmd)) { await authenticateFromEnvironment(ienv); diff --git a/packages/@ionic/cli/src/lib/__tests__/ssh-config.ts b/packages/@ionic/cli/src/lib/__tests__/ssh-config.ts index 52e1628728..479ed17679 100644 --- a/packages/@ionic/cli/src/lib/__tests__/ssh-config.ts +++ b/packages/@ionic/cli/src/lib/__tests__/ssh-config.ts @@ -1,6 +1,6 @@ import * as path from 'path'; -import * as SSHConfig from 'ssh-config'; +import SSHConfig from 'ssh-config'; import { readFile } from '@ionic/utils-fs'; import { ensureHostAndKeyPath } from '../ssh-config'; diff --git a/packages/@ionic/cli/src/lib/build.ts b/packages/@ionic/cli/src/lib/build.ts index 6889c8caf7..dc07de3a3b 100644 --- a/packages/@ionic/cli/src/lib/build.ts +++ b/packages/@ionic/cli/src/lib/build.ts @@ -2,7 +2,7 @@ import { BaseError, MetadataGroup } from '@ionic/cli-framework'; import { PromptModule } from '@ionic/cli-framework-prompts'; import { createProcessEnv } from '@ionic/utils-process'; import { ERROR_COMMAND_NOT_FOUND, SubprocessError } from '@ionic/utils-subprocess'; -import * as Debug from 'debug'; +import { debug as Debug } from 'debug'; import { BaseBuildOptions, BuildOptions, CommandLineInputs, CommandLineOptions, CommandMetadata, CommandMetadataOption, IConfig, ILogger, IProject, IShell, NpmClient, Runner } from '../definitions'; @@ -62,7 +62,7 @@ export abstract class BuildRunner> implements Runner createBaseOptionsFromCommandLine(inputs: CommandLineInputs, options: CommandLineOptions): BaseBuildOptions { const separatedArgs = options['--']; - const [ platform ] = options['platform'] ? [String(options['platform'])] : inputs; + const [platform] = options['platform'] ? [String(options['platform'])] : inputs; const engine = this.determineEngineFromCommandLine(options); const project = options['project'] ? String(options['project']) : undefined; const verbose = !!options['verbose']; @@ -153,7 +153,7 @@ export abstract class BuildCLI { private _resolvedProgram?: string; - constructor(protected readonly e: BuildRunnerDeps) {} + constructor(protected readonly e: BuildRunnerDeps) { } get resolvedProgram() { if (this._resolvedProgram) { @@ -251,7 +251,7 @@ export abstract class BuildCLI { protected async promptToInstall(): Promise { const { pkgManagerArgs } = await import('./utils/npm'); - const [ manager, ...managerArgs ] = await pkgManagerArgs(this.e.config.get('npmClient'), { command: 'install', pkg: this.pkg, saveDev: true, saveExact: true }); + const [manager, ...managerArgs] = await pkgManagerArgs(this.e.config.get('npmClient'), { command: 'install', pkg: this.pkg, saveDev: true, saveExact: true }); this.e.log.nl(); @@ -283,7 +283,7 @@ abstract class PkgManagerBuildCLI extends BuildCLI { protected async buildArgs(options: BaseBuildOptions): Promise { const { pkgManagerArgs } = await import('./utils/npm'); - const [ , ...pkgArgs ] = await pkgManagerArgs(this.program, { command: 'run', script: this.script, scriptArgs: [...options['--'] || []] }); + const [, ...pkgArgs] = await pkgManagerArgs(this.program, { command: 'run', script: this.script, scriptArgs: [...options['--'] || []] }); return pkgArgs; } diff --git a/packages/@ionic/cli/src/lib/color.ts b/packages/@ionic/cli/src/lib/color.ts index e57bb07009..789ff736d6 100644 --- a/packages/@ionic/cli/src/lib/color.ts +++ b/packages/@ionic/cli/src/lib/color.ts @@ -1,5 +1,5 @@ import { Colors, DEFAULT_COLORS, HelpColors } from '@ionic/cli-framework'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; const HELP_COLORS: Partial = { title: chalk.bold, diff --git a/packages/@ionic/cli/src/lib/events.ts b/packages/@ionic/cli/src/lib/events.ts index f05e486e9a..3c52b85650 100644 --- a/packages/@ionic/cli/src/lib/events.ts +++ b/packages/@ionic/cli/src/lib/events.ts @@ -1,4 +1,4 @@ -import * as Debug from 'debug'; +import { debug as Debug } from 'debug'; import { ServeDetails } from '../definitions'; diff --git a/packages/@ionic/cli/src/lib/hooks.ts b/packages/@ionic/cli/src/lib/hooks.ts index 93b71c5612..8f9fe41ea1 100644 --- a/packages/@ionic/cli/src/lib/hooks.ts +++ b/packages/@ionic/cli/src/lib/hooks.ts @@ -1,6 +1,6 @@ import { conform } from '@ionic/utils-array'; import { prettyPath } from '@ionic/utils-terminal'; -import * as Debug from 'debug'; +import { debug as Debug } from 'debug'; import * as lodash from 'lodash'; import * as path from 'path'; @@ -24,7 +24,7 @@ export abstract class Hook { return `ionic:${this.name}`; } - constructor(protected readonly e: HookDeps) {} + constructor(protected readonly e: HookDeps) { } async run(input: HookInput) { const { pkgManagerArgs } = await import('./utils/npm'); @@ -35,7 +35,7 @@ export abstract class Hook { return; // TODO: will we need hooks outside a project? } - const [ pkg ] = await this.e.project.getPackageJson(undefined, { logErrors: false }); + const [pkg] = await this.e.project.getPackageJson(undefined, { logErrors: false }); if (!pkg) { return; @@ -47,7 +47,7 @@ export abstract class Hook { if (pkg.scripts && pkg.scripts[this.script]) { debug(`Invoking ${ancillary(this.script)} npm script.`); - const [ pkgManager, ...pkgArgs ] = await pkgManagerArgs(this.e.config.get('npmClient'), { command: 'run', script: this.script }); + const [pkgManager, ...pkgArgs] = await pkgManagerArgs(this.e.config.get('npmClient'), { command: 'run', script: this.script }); await this.e.shell.run(pkgManager, pkgArgs, { env: ctxEnvironment, }); diff --git a/packages/@ionic/cli/src/lib/http.ts b/packages/@ionic/cli/src/lib/http.ts index ff07e2da88..4363110e8e 100644 --- a/packages/@ionic/cli/src/lib/http.ts +++ b/packages/@ionic/cli/src/lib/http.ts @@ -1,4 +1,4 @@ -import * as chalk from 'chalk'; +import chalk from 'chalk'; import * as lodash from 'lodash'; import * as util from 'util'; @@ -36,7 +36,7 @@ export const ERROR_UNKNOWN_CONTENT_TYPE = 'UNKNOWN_CONTENT_TYPE'; export const ERROR_UNKNOWN_RESPONSE_FORMAT = 'UNKNOWN_RESPONSE_FORMAT'; export class Client implements IClient { - constructor(public config: IConfig) {} + constructor(public config: IConfig) { } async make(method: HttpMethod, path: string, contentType: ContentType = ContentType.JSON): Promise<{ req: SuperAgentRequest; }> { const url = path.startsWith('http://') || path.startsWith('https://') ? path : `${this.config.getAPIUrl()}${path}`; diff --git a/packages/@ionic/cli/src/lib/index.ts b/packages/@ionic/cli/src/lib/index.ts index 1effce3290..2d54055fcc 100644 --- a/packages/@ionic/cli/src/lib/index.ts +++ b/packages/@ionic/cli/src/lib/index.ts @@ -1,7 +1,7 @@ import { LOGGER_LEVELS } from '@ionic/cli-framework-output'; import { createPromptModule } from '@ionic/cli-framework-prompts'; import { TERMINAL_INFO, prettyPath } from '@ionic/utils-terminal'; -import * as Debug from 'debug'; +import { debug as Debug } from 'debug'; import * as path from 'path'; import { ERROR_VERSION_TOO_OLD } from '../bootstrap'; @@ -49,13 +49,13 @@ export async function generateIonicEnvironment(ctx: IonicContext, pargv: string[ const proxyVars = PROXY_ENVIRONMENT_VARIABLES.map((e): [string, string | undefined] => [e, process.env[e]]).filter(([, v]) => !!v); const getInfo = async () => { - const osName = await import('os-name'); + const osName = (await import('os-name')).default; const semver = await import('semver'); const { getUpdateConfig } = await import('./updates'); const os = osName(); - const [ npm, nativeRun, cordovaRes ] = await Promise.all([ + const [npm, nativeRun, cordovaRes] = await Promise.all([ shell.cmdinfo('npm', ['-v']), shell.cmdinfo('native-run', ['--version']), shell.cmdinfo('cordova-res', ['--version']), diff --git a/packages/@ionic/cli/src/lib/integrations/capacitor/index.ts b/packages/@ionic/cli/src/lib/integrations/capacitor/index.ts index 223daabbcf..1fbc6ed3c3 100644 --- a/packages/@ionic/cli/src/lib/integrations/capacitor/index.ts +++ b/packages/@ionic/cli/src/lib/integrations/capacitor/index.ts @@ -1,8 +1,8 @@ import { parseArgs } from '@ionic/cli-framework'; import { mkdirp, pathExists } from '@ionic/utils-fs'; import { prettyPath } from '@ionic/utils-terminal'; -import * as chalk from 'chalk'; -import * as Debug from 'debug'; +import chalk from 'chalk'; +import { debug as Debug } from 'debug'; import * as lodash from 'lodash'; import * as path from 'path'; @@ -99,17 +99,17 @@ export class Integration extends BaseIntegration { } async installCapacitorCore() { - const [ manager, ...managerArgs ] = await pkgManagerArgs(this.e.config.get('npmClient'), { command: 'install', pkg: '@capacitor/core@latest' }); + const [manager, ...managerArgs] = await pkgManagerArgs(this.e.config.get('npmClient'), { command: 'install', pkg: '@capacitor/core@latest' }); await this.e.shell.run(manager, managerArgs, { cwd: this.root }); } async installCapacitorCLI() { - const [ manager, ...managerArgs ] = await pkgManagerArgs(this.e.config.get('npmClient'), { command: 'install', pkg: '@capacitor/cli@latest', saveDev: true }); + const [manager, ...managerArgs] = await pkgManagerArgs(this.e.config.get('npmClient'), { command: 'install', pkg: '@capacitor/cli@latest', saveDev: true }); await this.e.shell.run(manager, managerArgs, { cwd: this.root }); } async installCapacitorPlugins() { - const [ manager, ...managerArgs ] = await pkgManagerArgs(this.e.config.get('npmClient'), { command: 'install', pkg: ['@capacitor/haptics', '@capacitor/app', '@capacitor/keyboard', '@capacitor/status-bar'] }); + const [manager, ...managerArgs] = await pkgManagerArgs(this.e.config.get('npmClient'), { command: 'install', pkg: ['@capacitor/haptics', '@capacitor/app', '@capacitor/keyboard', '@capacitor/status-bar'] }); await this.e.shell.run(manager, managerArgs, { cwd: this.root }); } @@ -131,10 +131,10 @@ export class Integration extends BaseIntegration { const bundleId = conf?.appId; const [ - [ capacitorCorePkg, capacitorCorePkgPath ], + [capacitorCorePkg, capacitorCorePkgPath], capacitorCLIVersion, - [ capacitorIOSPkg, capacitorIOSPkgPath ], - [ capacitorAndroidPkg, capacitorAndroidPkgPath ], + [capacitorIOSPkg, capacitorIOSPkgPath], + [capacitorAndroidPkg, capacitorAndroidPkgPath], ] = await (Promise.all([ this.e.project.getPackageJson('@capacitor/core'), this.getCapacitorCLIVersion(), @@ -219,7 +219,7 @@ export class Integration extends BaseIntegration { // Capacitor 1 returns the `command not found` error in stdout instead of stderror like in Capacitor 2 // This ensures that the output from the command is valid JSON to account for this return JSON.parse(output); - } catch(e) { + } catch (e) { debug('Could not get config from Capacitor CLI (probably old version)', e); return; } diff --git a/packages/@ionic/cli/src/lib/integrations/cordova/__tests__/project.ts b/packages/@ionic/cli/src/lib/integrations/cordova/__tests__/project.ts index 13777cd1be..34c1a8f211 100644 --- a/packages/@ionic/cli/src/lib/integrations/cordova/__tests__/project.ts +++ b/packages/@ionic/cli/src/lib/integrations/cordova/__tests__/project.ts @@ -1,4 +1,4 @@ -import * as fsExtraSpy from 'fs-extra'; +import fsExtraSpy from 'fs-extra'; import * as fsSafeSpy from '@ionic/utils-fs/dist/safe'; import * as project from '../project'; diff --git a/packages/@ionic/cli/src/lib/integrations/cordova/config.ts b/packages/@ionic/cli/src/lib/integrations/cordova/config.ts index 2bf00cf692..c342061cee 100644 --- a/packages/@ionic/cli/src/lib/integrations/cordova/config.ts +++ b/packages/@ionic/cli/src/lib/integrations/cordova/config.ts @@ -1,7 +1,7 @@ import { readPackageJsonFile } from '@ionic/cli-framework/utils/node'; import { readFile, writeFile } from '@ionic/utils-fs'; import { prettyPath } from '@ionic/utils-terminal'; -import * as Debug from 'debug'; +import { debug as Debug } from 'debug'; import * as et from 'elementtree'; import * as path from 'path'; @@ -24,7 +24,7 @@ export class CordovaConfig { protected _sessionid?: string; protected saving = false; - constructor(readonly configXmlPath: string, readonly packageJsonPath: string) {} + constructor(readonly configXmlPath: string, readonly packageJsonPath: string) { } get doc(): et.ElementTree { if (!this._doc) { @@ -237,11 +237,11 @@ export async function loadCordovaConfig(integration: Required { .map(m => [m[1], m[2]]); const whitelistedPlugins = plugins - .filter(([ plugin, version ]) => whitelist.some(re => re.test(plugin))) - .map(([ plugin, version ]) => `${plugin} ${version}`); + .filter(([plugin, version]) => whitelist.some(re => re.test(plugin))) + .map(([plugin, version]) => `${plugin} ${version}`); const count = plugins.length - whitelistedPlugins.length; diff --git a/packages/@ionic/cli/src/lib/integrations/cordova/project.ts b/packages/@ionic/cli/src/lib/integrations/cordova/project.ts index aa0db6654c..7ffa6fb988 100644 --- a/packages/@ionic/cli/src/lib/integrations/cordova/project.ts +++ b/packages/@ionic/cli/src/lib/integrations/cordova/project.ts @@ -1,6 +1,6 @@ import { filter } from '@ionic/utils-array'; import { readJson, readdirSafe, statSafe } from '@ionic/utils-fs'; -import * as Debug from 'debug'; +import { debug as Debug } from 'debug'; import * as path from 'path'; import { AndroidBuildOutput, LegacyAndroidBuildOutputEntry } from '../../../definitions'; diff --git a/packages/@ionic/cli/src/lib/ionitron.ts b/packages/@ionic/cli/src/lib/ionitron.ts index 8637fdef80..f2a4522ed0 100644 --- a/packages/@ionic/cli/src/lib/ionitron.ts +++ b/packages/@ionic/cli/src/lib/ionitron.ts @@ -1,4 +1,4 @@ -import * as chalk from 'chalk'; +import chalk from 'chalk'; export function getIonitronString(quote: string) { const quoteFormatted = quote diff --git a/packages/@ionic/cli/src/lib/open.ts b/packages/@ionic/cli/src/lib/open.ts index cb910a4120..e33f21c826 100644 --- a/packages/@ionic/cli/src/lib/open.ts +++ b/packages/@ionic/cli/src/lib/open.ts @@ -1,4 +1,4 @@ -import * as Debug from 'debug'; +import { debug as Debug } from 'debug'; const debug = Debug('ionic:lib:open'); @@ -7,7 +7,7 @@ export interface OpenUrlOptions { } export async function openUrl(target: string, options: OpenUrlOptions = {}): Promise { - const o = await import ('open'); + const o = (await import('open')).default; const p = await o(target, { ...options, wait: false, url: true }); const e = (err: Error) => debug('Error during open: %O', err); const n = p.on.bind(p); diff --git a/packages/@ionic/cli/src/lib/project/angular/generate.ts b/packages/@ionic/cli/src/lib/project/angular/generate.ts index ce64456439..7324685b27 100644 --- a/packages/@ionic/cli/src/lib/project/angular/generate.ts +++ b/packages/@ionic/cli/src/lib/project/angular/generate.ts @@ -1,5 +1,5 @@ import { unparseArgs, validators } from '@ionic/cli-framework'; -import * as Debug from 'debug'; +import { debug as Debug } from 'debug'; import * as lodash from 'lodash'; import { AngularGenerateOptions, CommandLineInputs, CommandLineOptions, CommandMetadata } from '../../../definitions'; @@ -100,7 +100,7 @@ To test a generator before file modifications are made, use the ${input('--dry-r createOptionsFromCommandLine(inputs: CommandLineInputs, options: CommandLineOptions): AngularGenerateOptions { const [schematic, name] = inputs; - const baseOptions = {name, schematic} + const baseOptions = { name, schematic } const project = options['project'] ? String(options['project']) : 'app'; // TODO: this is a little gross, is there a better way to pass in all the diff --git a/packages/@ionic/cli/src/lib/project/angular/index.ts b/packages/@ionic/cli/src/lib/project/angular/index.ts index 56ff341d95..71803ab1d7 100644 --- a/packages/@ionic/cli/src/lib/project/angular/index.ts +++ b/packages/@ionic/cli/src/lib/project/angular/index.ts @@ -1,4 +1,4 @@ -import * as Debug from 'debug'; +import { debug as Debug } from 'debug'; import * as lodash from 'lodash'; import * as path from 'path'; @@ -13,11 +13,11 @@ export class AngularProject extends Project { async getInfo(): Promise { const [ - [ ionicAngularPkg, ionicAngularPkgPath ], - [ ionicAngularToolkitPkg, ionicAngularToolkitPkgPath ], - [ angularCLIPkg, angularCLIPkgPath ], - [ angularDevKitBuildAngularPkg, angularDevKitBuildAngularPkgPath ], - [ angularDevKitSchematicsPkg, angularDevKitSchematicsPkgPath ], + [ionicAngularPkg, ionicAngularPkgPath], + [ionicAngularToolkitPkg, ionicAngularToolkitPkgPath], + [angularCLIPkg, angularCLIPkgPath], + [angularDevKitBuildAngularPkg, angularDevKitBuildAngularPkgPath], + [angularDevKitSchematicsPkg, angularDevKitSchematicsPkgPath], ] = await Promise.all([ this.getPackageJson('@ionic/angular'), this.getPackageJson('@ionic/angular-toolkit'), diff --git a/packages/@ionic/cli/src/lib/project/angular/serve.ts b/packages/@ionic/cli/src/lib/project/angular/serve.ts index 21f75d27c9..444f1aafda 100644 --- a/packages/@ionic/cli/src/lib/project/angular/serve.ts +++ b/packages/@ionic/cli/src/lib/project/angular/serve.ts @@ -2,7 +2,7 @@ import { MetadataGroup, ParsedArgs, unparseArgs } from '@ionic/cli-framework'; import { str2num } from '@ionic/cli-framework/utils/string'; import { findClosestOpenPort } from '@ionic/utils-network'; import { stripAnsi } from '@ionic/utils-terminal'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; import { AngularServeOptions, CommandLineInputs, CommandLineOptions, CommandMetadata, ServeDetails } from '../../../definitions'; import { input, strong, weak } from '../../color'; @@ -123,7 +123,7 @@ The dev server can use HTTPS via the ${input('--ssl')} option ${chalk.bold.red(' } async serveProject(options: AngularServeOptions): Promise { - const [ externalIP, availableInterfaces ] = await this.selectExternalIP(options); + const [externalIP, availableInterfaces] = await this.selectExternalIP(options); const port = options.port = await findClosestOpenPort(options.port); @@ -200,7 +200,7 @@ export class AngularServeCLI extends ServeCLI { if (this.resolvedProgram === this.program) { return [...this.buildArchitectCommand(options), ...args]; } else { - const [ , ...pkgArgs ] = await pkgManagerArgs(this.e.config.get('npmClient'), { command: 'run', script: this.script, scriptArgs: [...args] }); + const [, ...pkgArgs] = await pkgManagerArgs(this.e.config.get('npmClient'), { command: 'run', script: this.script, scriptArgs: [...args] }); return pkgArgs; } } diff --git a/packages/@ionic/cli/src/lib/project/index.ts b/packages/@ionic/cli/src/lib/project/index.ts index 77449ca6dd..9e42e3db94 100644 --- a/packages/@ionic/cli/src/lib/project/index.ts +++ b/packages/@ionic/cli/src/lib/project/index.ts @@ -4,7 +4,7 @@ import { resolveValue } from '@ionic/cli-framework/utils/fn'; import { ERROR_INVALID_PACKAGE_JSON, compileNodeModulesPaths, isValidPackageName, readPackageJsonFile } from '@ionic/cli-framework/utils/node'; import { ensureDir, findBaseDirectory, readFile, writeFile, writeJson } from '@ionic/utils-fs'; import { TTY_WIDTH, prettyPath, wordWrap } from '@ionic/utils-terminal'; -import * as Debug from 'debug'; +import { debug as Debug } from 'debug'; import * as lodash from 'lodash'; import * as path from 'path'; diff --git a/packages/@ionic/cli/src/lib/project/react-vite/index.ts b/packages/@ionic/cli/src/lib/project/react-vite/index.ts index daf9f78ac4..136ab3e124 100755 --- a/packages/@ionic/cli/src/lib/project/react-vite/index.ts +++ b/packages/@ionic/cli/src/lib/project/react-vite/index.ts @@ -1,5 +1,5 @@ -import * as chalk from 'chalk'; -import * as Debug from 'debug'; +import chalk from 'chalk'; +import { debug as Debug } from 'debug'; import * as lodash from 'lodash'; import * as path from 'path'; diff --git a/packages/@ionic/cli/src/lib/project/react/index.ts b/packages/@ionic/cli/src/lib/project/react/index.ts index b713847d9d..05a05929a9 100644 --- a/packages/@ionic/cli/src/lib/project/react/index.ts +++ b/packages/@ionic/cli/src/lib/project/react/index.ts @@ -1,5 +1,5 @@ -import * as chalk from 'chalk'; -import * as Debug from 'debug'; +import chalk from 'chalk'; +import { debug as Debug } from 'debug'; import * as lodash from 'lodash'; import * as path from 'path'; @@ -14,7 +14,7 @@ export class ReactProject extends Project { async getInfo(): Promise { const [ - [ ionicReactPkg, ionicReactPkgPath ], + [ionicReactPkg, ionicReactPkgPath], ] = await Promise.all([ this.getPackageJson('@ionic/react'), ]); diff --git a/packages/@ionic/cli/src/lib/project/vue-vite/index.ts b/packages/@ionic/cli/src/lib/project/vue-vite/index.ts index 1364760629..9304bd7b7f 100755 --- a/packages/@ionic/cli/src/lib/project/vue-vite/index.ts +++ b/packages/@ionic/cli/src/lib/project/vue-vite/index.ts @@ -1,5 +1,5 @@ -import * as chalk from 'chalk'; -import * as Debug from 'debug'; +import chalk from 'chalk'; +import { debug as Debug } from 'debug'; import * as lodash from 'lodash'; import * as path from 'path'; diff --git a/packages/@ionic/cli/src/lib/project/vue/index.ts b/packages/@ionic/cli/src/lib/project/vue/index.ts index 22f1da0d67..da584e1e50 100644 --- a/packages/@ionic/cli/src/lib/project/vue/index.ts +++ b/packages/@ionic/cli/src/lib/project/vue/index.ts @@ -1,5 +1,5 @@ -import * as chalk from 'chalk'; -import * as Debug from 'debug'; +import chalk from 'chalk'; +import { debug as Debug } from 'debug'; import * as lodash from 'lodash'; import * as path from 'path'; diff --git a/packages/@ionic/cli/src/lib/serve.ts b/packages/@ionic/cli/src/lib/serve.ts index 4d6b362565..0e8ff5b6eb 100644 --- a/packages/@ionic/cli/src/lib/serve.ts +++ b/packages/@ionic/cli/src/lib/serve.ts @@ -4,11 +4,11 @@ import { PromptModule } from '@ionic/cli-framework-prompts'; import { str2num } from '@ionic/cli-framework/utils/string'; import { NetworkInterface, getExternalIPv4Interfaces, isHostConnectable } from '@ionic/utils-network'; import { createProcessEnv, killProcessTree, onBeforeExit, processExit } from '@ionic/utils-process'; -import * as chalk from 'chalk'; -import * as Debug from 'debug'; +import chalk from 'chalk'; +import { debug as Debug } from 'debug'; import { EventEmitter } from 'events'; import * as lodash from 'lodash'; -import * as split2 from 'split2'; +import split2 from 'split2'; import * as stream from 'stream'; import { CommandLineInputs, CommandLineOptions, CommandMetadata, CommandMetadataOption, IConfig, ILogger, IProject, IShell, IonicEnvironmentFlags, NpmClient, Runner, ServeDetails, ServeOptions } from '../definitions'; @@ -138,7 +138,7 @@ export abstract class ServeRunner implements Runner implements Runner extends EventEmitter { return; } - const [ pkg ] = await this.e.project.getPackageJson(undefined, { logErrors: false }); + const [pkg] = await this.e.project.getPackageJson(undefined, { logErrors: false }); if (!pkg) { return; @@ -557,7 +557,7 @@ export abstract class ServeCLI extends EventEmitter { protected async promptToInstall(): Promise { const { pkgManagerArgs } = await import('./utils/npm'); - const [ manager, ...managerArgs ] = await pkgManagerArgs(this.e.config.get('npmClient'), { command: 'install', pkg: this.pkg, saveDev: true, saveExact: true }); + const [manager, ...managerArgs] = await pkgManagerArgs(this.e.config.get('npmClient'), { command: 'install', pkg: this.pkg, saveDev: true, saveExact: true }); this.e.log.nl(); @@ -600,7 +600,7 @@ abstract class PkgManagerServeCLI extends ServeCLI { }; const scriptArgs = [...unparseArgs(args), ...options['--'] || []]; - const [ , ...pkgArgs ] = await pkgManagerArgs(this.program, { command: 'run', script: this.script, scriptArgs }); + const [, ...pkgArgs] = await pkgManagerArgs(this.program, { command: 'run', script: this.script, scriptArgs }); return pkgArgs; } diff --git a/packages/@ionic/cli/src/lib/shell.ts b/packages/@ionic/cli/src/lib/shell.ts index d392ecf873..e4a60a01de 100644 --- a/packages/@ionic/cli/src/lib/shell.ts +++ b/packages/@ionic/cli/src/lib/shell.ts @@ -2,12 +2,12 @@ import { LOGGER_LEVELS } from '@ionic/cli-framework-output'; import { createProcessEnv, killProcessTree, onBeforeExit } from '@ionic/utils-process'; import { ERROR_COMMAND_NOT_FOUND, Subprocess, SubprocessError, SubprocessOptions, WhichOptions, which } from '@ionic/utils-subprocess'; import { TERMINAL_INFO } from '@ionic/utils-terminal'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; import { ChildProcess, SpawnOptions } from 'child_process'; -import * as Debug from 'debug'; +import { debug as Debug } from 'debug'; import * as path from 'path'; -import * as split2 from 'split2'; -import * as combineStreams from 'stream-combiner2'; +import split2 from 'split2'; +import combineStreams from 'stream-combiner2'; import { ILogger, IShell, IShellOutputOptions, IShellRunOptions, IShellSpawnOptions } from '../definitions'; import { isExitCodeException } from '../guards'; diff --git a/packages/@ionic/cli/src/lib/ssh-config.ts b/packages/@ionic/cli/src/lib/ssh-config.ts index aff90fbf1f..edbeda7e33 100644 --- a/packages/@ionic/cli/src/lib/ssh-config.ts +++ b/packages/@ionic/cli/src/lib/ssh-config.ts @@ -1,7 +1,7 @@ import { fileToString } from '@ionic/utils-fs'; -import * as os from 'os'; +import os from 'os'; import * as path from 'path'; -import * as SSHConfig from 'ssh-config'; +import SSHConfig from 'ssh-config'; export { SSHConfig }; diff --git a/packages/@ionic/cli/src/lib/telemetry.ts b/packages/@ionic/cli/src/lib/telemetry.ts index 02ee09a35d..3ae1703037 100644 --- a/packages/@ionic/cli/src/lib/telemetry.ts +++ b/packages/@ionic/cli/src/lib/telemetry.ts @@ -1,4 +1,4 @@ -import * as Debug from 'debug'; +import { debug as Debug } from 'debug'; import * as lodash from 'lodash'; import { IClient, IConfig, IProject, ISession, ITelemetry, InfoItem, IonicContext } from '../definitions'; @@ -44,7 +44,7 @@ export class Telemetry implements ITelemetry { async function getLeek({ config, version }: { config: IConfig; version: string; }): Promise { if (!_gaTracker) { - const Leek = await import('leek'); + const Leek = (await import('leek')).default; let telemetryToken = config.get('tokens.telemetry'); if (!telemetryToken) { diff --git a/packages/@ionic/cli/src/lib/utils/http.ts b/packages/@ionic/cli/src/lib/utils/http.ts index 74ca72ed3c..2498d5f7e5 100644 --- a/packages/@ionic/cli/src/lib/utils/http.ts +++ b/packages/@ionic/cli/src/lib/utils/http.ts @@ -1,6 +1,8 @@ import { conform } from '@ionic/utils-array'; import { readFile } from '@ionic/utils-fs'; -import * as Debug from 'debug'; +import { debug as Debug } from 'debug'; + +import superagentProxy from './superagent-proxy'; import { CreateRequestOptions, HttpMethod } from '../../definitions'; @@ -21,7 +23,7 @@ function getGlobalProxy(): { envvar: string; envval: string; } | undefined { } export async function createRequest(method: HttpMethod, url: string, { userAgent, proxy, ssl }: CreateRequestOptions): Promise<{ req: SuperAgentRequest; }> { - const superagent = await import('superagent'); + const superagent = (await import('superagent')).default; if (!proxy) { const gproxy = getGlobalProxy(); @@ -31,14 +33,13 @@ export async function createRequest(method: HttpMethod, url: string, { userAgent } } - const req = superagent(method, url); + const req = superagent(method, url) as SuperAgentRequest & { proxy?: (uri: string) => void }; req .set('User-Agent', userAgent) .redirects(25); if (proxy) { - const superagentProxy = await import('superagent-proxy'); superagentProxy(superagent); if (req.proxy) { diff --git a/packages/@ionic/cli/src/lib/utils/logger.ts b/packages/@ionic/cli/src/lib/utils/logger.ts index 27d4807022..0fae1f193f 100644 --- a/packages/@ionic/cli/src/lib/utils/logger.ts +++ b/packages/@ionic/cli/src/lib/utils/logger.ts @@ -1,6 +1,6 @@ import { DEFAULT_COLORS } from '@ionic/cli-framework'; import { CreateTaggedFormatterOptions, DEFAULT_LOGGER_HANDLERS, LOGGER_LEVELS, Logger as BaseLogger, LoggerFormatter, LoggerLevelWeight, createPrefixedFormatter, createTaggedFormatter } from '@ionic/cli-framework-output'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; import { ILogger } from '../../definitions'; import { weak } from '../color'; diff --git a/packages/@ionic/cli/src/lib/utils/superagent-proxy.ts b/packages/@ionic/cli/src/lib/utils/superagent-proxy.ts new file mode 100644 index 0000000000..d2aa6fe691 --- /dev/null +++ b/packages/@ionic/cli/src/lib/utils/superagent-proxy.ts @@ -0,0 +1,131 @@ +/** + * (The MIT License) + * + * Copyright (c) 2013 Nathan Rajlich + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * This is a fork of the original source, upgraded to proxy-agent v6 and TypeScript. + * Original source: https://github.com/TooTallNate/superagent-proxy/blob/ef2cc112926b574547cf2f765ae3dfd80bdeb9a0/index.js + * + */ +import { ProxyAgent } from 'proxy-agent'; +import { debug as Debug } from 'debug'; +import { SuperAgent, SuperAgentRequest } from 'superagent'; + +const debug = Debug('superagent-proxy'); + +/** + * Adds a `.proxy(uri)` function to the "superagent" module's Request class. + * + * ``` js + * var request = require('superagent'); + * require('superagent-proxy')(request); + * + * request + * .get(uri) + * .proxy(uri) + * .end(fn); + * ``` + * + * Or, you can pass in a `superagent.Request` instance, and it's like calling the + * `.proxy(uri)` function on it, but without extending the prototype: + * + * ``` js + * var request = require('superagent'); + * var proxy = require('superagent-proxy'); + * + * proxy(request.get(uri), uri).end(fn); + * ``` + * + * @param {Object} superagent The `superagent` exports object + * @api public + */ + +export default function setup(superagent: any, uri?: string): SuperAgent & { proxy: (uri?: string) => SuperAgent } { + const Request = superagent.Request; + if (Request) { + // the superagent exports object - extent Request with "proxy" + Request.prototype.proxy = proxy; + return superagent; + } else { + // assume it's a `superagent.Request` instance + return proxy.call(superagent, uri); + } +} + +/** + * Sets the proxy server to use for this HTTP(s) request. + * + * @param {String} uri proxy url + * @api public + */ + +function proxy(this: any, uri?: string) { + debug('Request#proxy(%o)', uri); + // we need to observe the `url` field from now on... Superagent sometimes + // re-uses the `req` instance but changes its `url` field (i.e. in the case of + // a redirect), so when that happens we need to potentially re-set the proxy + // agent + setupUrl(this); + + // attempt to get a proxying `http.Agent` instance + const agent = new ProxyAgent(uri !== undefined ? { getProxyForUrl: () => uri } : {}); + + // if we have an `http.Agent` instance then call the .agent() function + if (agent) this.agent(agent); + + // store the proxy URI in case of changes to the `url` prop in the future + this._proxyUri = uri; + + return this; +} + +/** + * Sets up a get/set descriptor for the `url` property of the provided `req` + * Request instance. This is so that we can re-run the "proxy agent" logic when + * the `url` field is changed, i.e. during a 302 Redirect scenario. + * + * @api private + */ + +function setupUrl(req: any): void { + var desc = Object.getOwnPropertyDescriptor(req, 'url'); + if (desc?.get == getUrl && desc?.set == setUrl) return; // already patched + + // save current value + req._url = req.url; + + if (desc) { + desc.get = getUrl; + desc.set = setUrl; + delete desc.value; + delete desc.writable; + + Object.defineProperty(req, 'url', desc); + debug('patched superagent Request "url" property for changes'); + } +} + +/** + * `url` property getter. + * + * @api protected + */ + +function getUrl(this: any): string { + return this._url; +} + +/** + * `url` property setter. + * + * @api protected + */ + +function setUrl(this: any, v: string): void { + debug('set `.url`: %o', v); + this._url = v; + proxy.call(this, this._proxyUri); +} diff --git a/packages/@ionic/cli/tsconfig.json b/packages/@ionic/cli/tsconfig.json index 6d50be6c3d..85d3dba781 100644 --- a/packages/@ionic/cli/tsconfig.json +++ b/packages/@ionic/cli/tsconfig.json @@ -10,7 +10,6 @@ "../../../types/leek.d.ts", "../../../types/ssh-config.d.ts", "../../../types/stream-combiner2.d.ts", - "../../../types/superagent-proxy.d.ts", "src/**/*.ts" ], "exclude": [ diff --git a/packages/@ionic/discover/src/comm.ts b/packages/@ionic/discover/src/comm.ts index ddb2e08018..5fb3af0776 100644 --- a/packages/@ionic/discover/src/comm.ts +++ b/packages/@ionic/discover/src/comm.ts @@ -1,7 +1,8 @@ -import * as Debug from 'debug'; +import { debug as Debug } from 'debug'; import * as events from 'events'; import * as util from 'util'; -import * as WebSocket from 'ws'; +import WebSocket from 'ws'; + const debug = Debug('ionic:discover:comm'); diff --git a/packages/@ionic/discover/src/publisher.ts b/packages/@ionic/discover/src/publisher.ts index 82058ba4df..d36f2b112d 100644 --- a/packages/@ionic/discover/src/publisher.ts +++ b/packages/@ionic/discover/src/publisher.ts @@ -1,4 +1,4 @@ -import * as Debug from 'debug'; +import { debug as Debug } from 'debug'; import * as dgram from 'dgram'; import * as events from 'events'; import { Netmask } from 'netmask'; @@ -156,23 +156,23 @@ export function prepareInterfaces(interfaces: NodeJS.Dict prev?.concat(current ? current : [])); if (flatValues) { - return flatValues - .filter((iface: os.NetworkInterfaceInfo) => iface.family === 'IPv4') - .map((iface: os.NetworkInterfaceInfo) => { - return { - address: iface.address, - broadcast: computeBroadcastAddress(iface.address, iface.netmask), - }; - }) - .filter((iface: any) => { - if (!set.has(iface.broadcast)) { - set.add(iface.broadcast); - - return true; - } - - return false; - }); + return flatValues + .filter((iface: os.NetworkInterfaceInfo) => iface.family === 'IPv4') + .map((iface: os.NetworkInterfaceInfo) => { + return { + address: iface.address, + broadcast: computeBroadcastAddress(iface.address, iface.netmask), + }; + }) + .filter((iface: any) => { + if (!set.has(iface.broadcast)) { + set.add(iface.broadcast); + + return true; + } + + return false; + }); } } diff --git a/packages/@ionic/utils-network/src/__tests__/index.ts b/packages/@ionic/utils-network/src/__tests__/index.ts index f08d710b90..4fed64770f 100644 --- a/packages/@ionic/utils-network/src/__tests__/index.ts +++ b/packages/@ionic/utils-network/src/__tests__/index.ts @@ -1,4 +1,4 @@ -import * as osSpy from 'os'; +import osSpy from 'os'; import { getExternalIPv4Interfaces } from '../'; describe('@ionic/utils-network', () => { diff --git a/packages/@ionic/utils-network/src/index.ts b/packages/@ionic/utils-network/src/index.ts index 23b3898fe1..4211b03f51 100644 --- a/packages/@ionic/utils-network/src/index.ts +++ b/packages/@ionic/utils-network/src/index.ts @@ -1,6 +1,6 @@ -import * as Debug from 'debug'; +import { debug as Debug } from 'debug'; import * as net from 'net'; -import * as os from 'os'; +import os from 'os'; const debug = Debug('ionic:utils-network'); @@ -105,7 +105,7 @@ export function isPortAvailableForHost(host: string, port: number): Promise { resolve(true); // found available host/port }) - .close(); + .close(); }) .on('error', (err: any) => { reject(err); diff --git a/packages/@ionic/utils-process/src/index.ts b/packages/@ionic/utils-process/src/index.ts index 71cfd9ba93..51ae15768d 100644 --- a/packages/@ionic/utils-process/src/index.ts +++ b/packages/@ionic/utils-process/src/index.ts @@ -1,9 +1,9 @@ import { createCaseInsensitiveObject } from '@ionic/utils-object'; import { TERMINAL_INFO } from '@ionic/utils-terminal'; -import * as Debug from 'debug'; +import { debug as Debug } from 'debug'; import * as pathlib from 'path'; -import * as onSignalExit from 'signal-exit'; -import * as kill from 'tree-kill'; +import onSignalExit from 'signal-exit'; +import treeKill from 'tree-kill'; const debug = Debug('ionic:utils-process'); @@ -11,7 +11,7 @@ export const ERROR_TIMEOUT_REACHED = new Error('TIMEOUT_REACHED'); export function killProcessTree(pid: number, signal: string | number = 'SIGTERM'): Promise { return new Promise((resolve, reject) => { - kill(pid, signal, err => { + treeKill(pid, signal, err => { if (err) { debug('error while killing process tree for %d: %O', pid, err); return reject(err); @@ -157,7 +157,7 @@ const BEFORE_EXIT_SIGNAL_LISTENERS: BeforeExitSignalListeners = { SIGBREAK: beforeExitHandlerWrapper('SIGBREAK'), }; -for (const [ signal, fn ] of Object.entries(BEFORE_EXIT_SIGNAL_LISTENERS)) { +for (const [signal, fn] of Object.entries(BEFORE_EXIT_SIGNAL_LISTENERS)) { process.on(signal as BeforeExitSignal, fn); } diff --git a/packages/@ionic/utils-stream/src/__tests__/index.ts b/packages/@ionic/utils-stream/src/__tests__/index.ts index 885a252bf1..b0ca3ce832 100644 --- a/packages/@ionic/utils-stream/src/__tests__/index.ts +++ b/packages/@ionic/utils-stream/src/__tests__/index.ts @@ -1,5 +1,5 @@ import { PassThrough, Writable } from 'stream'; -import * as combineStreams from 'stream-combiner2'; +import combineStreams from 'stream-combiner2'; import { NullStream, ReadableStreamBuffer, WritableStreamBuffer, growBufferForAppendedData } from '../'; describe('@ionic/utils-stream', () => { diff --git a/packages/@ionic/utils-subprocess/src/index.ts b/packages/@ionic/utils-subprocess/src/index.ts index 0ff8bb63bb..4488ab57fd 100644 --- a/packages/@ionic/utils-subprocess/src/index.ts +++ b/packages/@ionic/utils-subprocess/src/index.ts @@ -4,7 +4,7 @@ import { createProcessEnv, getPathParts } from '@ionic/utils-process'; import { WritableStreamBuffer } from '@ionic/utils-stream'; import { TERMINAL_INFO } from '@ionic/utils-terminal'; import { ChildProcess, ForkOptions, SpawnOptions, fork as _fork } from 'child_process'; -import * as crossSpawn from 'cross-spawn'; +import crossSpawn from 'cross-spawn'; import * as os from 'os'; import * as pathlib from 'path'; @@ -42,7 +42,7 @@ export class SubprocessError extends Error { exitCode?: number; } -export interface SubprocessOptions extends SpawnOptions {} +export interface SubprocessOptions extends SpawnOptions { } export interface SubprocessBashifyOptions { diff --git a/packages/@ionic/utils-terminal/src/cursor.ts b/packages/@ionic/utils-terminal/src/cursor.ts index bd369cd0f3..def0352baa 100644 --- a/packages/@ionic/utils-terminal/src/cursor.ts +++ b/packages/@ionic/utils-terminal/src/cursor.ts @@ -1,4 +1,4 @@ -import * as onExit from 'signal-exit'; +import onExit from 'signal-exit'; import { EscapeCode } from './ansi'; diff --git a/packages/@ionic/utils-terminal/src/info.ts b/packages/@ionic/utils-terminal/src/info.ts index 688eb2a1f3..7230db5bdf 100644 --- a/packages/@ionic/utils-terminal/src/info.ts +++ b/packages/@ionic/utils-terminal/src/info.ts @@ -1,4 +1,4 @@ -import * as Debug from 'debug'; +import { debug as Debug } from 'debug'; import * as os from 'os'; const debug = Debug('ionic:utils-terminal:info'); diff --git a/packages/cli-scripts/src/docs/index.ts b/packages/cli-scripts/src/docs/index.ts index 7c803d0a60..dbcf12c72e 100644 --- a/packages/cli-scripts/src/docs/index.ts +++ b/packages/cli-scripts/src/docs/index.ts @@ -3,7 +3,7 @@ import { Command, CommandHelpSchemaFootnote, CommandHelpSchemaInput, CommandHelp import { strcmp } from '@ionic/cli-framework/utils/string'; import { CommandHelpSchema, NamespaceSchemaHelpFormatter } from '@ionic/cli/lib/help'; import { mkdirp, remove, writeFile } from '@ionic/utils-fs'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; import * as lodash from 'lodash'; import * as path from 'path'; import stripAnsi = require('strip-ansi'); diff --git a/packages/cli-scripts/src/docs/utils.ts b/packages/cli-scripts/src/docs/utils.ts index c37b65c0e2..6f4247338d 100644 --- a/packages/cli-scripts/src/docs/utils.ts +++ b/packages/cli-scripts/src/docs/utils.ts @@ -1,7 +1,7 @@ import { Colors } from '@ionic/cli-framework'; import { COLORS } from '@ionic/cli/lib/color'; -import * as chalk from 'chalk'; -import * as escapeStringRegexp from 'escape-string-regexp'; +import chalk from 'chalk'; +import escapeStringRegexp from 'escape-string-regexp'; interface CodePair { open: string; @@ -36,7 +36,7 @@ export function convertHTMLEntities(str: string): string { function convertAnsiToMd(str: string, styles: readonly CodePair[], md: CodePair): string { const start = styles.map(style => style.open).join(''); const end = [...styles].reverse().map(style => style.close).join(''); - const re = new RegExp(escapeStringRegexp(start) + '(.*?)' + escapeStringRegexp(end) , 'g'); + const re = new RegExp(escapeStringRegexp(start) + '(.*?)' + escapeStringRegexp(end), 'g'); return str.replace(re, md.open + '$1' + md.close); } diff --git a/tsconfig.base.json b/tsconfig.base.json index 282786c623..d13a4a9107 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -6,14 +6,12 @@ "module": "commonjs", "moduleResolution": "node", "noFallthroughCasesInSwitch": true, + "esModuleInterop": true, "noUnusedLocals": true, "pretty": true, "strict": true, "target": "ES2021", "types": [], - "lib": [ - "ES2021", - "ES2022.Error" - ] + "lib": ["ES2021", "ES2022.Error"] } } From 05d64e9097d49008528ba8e1b134f065e906b676 Mon Sep 17 00:00:00 2001 From: Ionitron Date: Tue, 19 Dec 2023 22:38:18 +0000 Subject: [PATCH 3/5] chore(release): publish [skip ci] - @ionic/cli-framework-output@2.2.8 - @ionic/cli-framework-prompts@2.1.13 - @ionic/cli-framework@6.0.1 - @ionic/cli@7.1.6 - @ionic/discover@3.1.8 - @ionic/utils-network@2.1.7 - @ionic/utils-process@2.1.12 - @ionic/utils-stream@3.1.7 - @ionic/utils-subprocess@3.0.1 - @ionic/utils-terminal@2.3.5 - cli-scripts@2.1.73 --- .../@ionic/cli-framework-output/CHANGELOG.md | 8 ++++++++ .../@ionic/cli-framework-output/package.json | 6 +++--- .../@ionic/cli-framework-prompts/CHANGELOG.md | 11 ++++++++++ .../@ionic/cli-framework-prompts/package.json | 4 ++-- packages/@ionic/cli-framework/CHANGELOG.md | 11 ++++++++++ packages/@ionic/cli-framework/package.json | 12 +++++------ packages/@ionic/cli/CHANGELOG.md | 11 ++++++++++ packages/@ionic/cli/package.json | 20 +++++++++---------- packages/@ionic/discover/CHANGELOG.md | 11 ++++++++++ packages/@ionic/discover/package.json | 2 +- packages/@ionic/utils-network/CHANGELOG.md | 11 ++++++++++ packages/@ionic/utils-network/package.json | 2 +- packages/@ionic/utils-process/CHANGELOG.md | 11 ++++++++++ packages/@ionic/utils-process/package.json | 4 ++-- packages/@ionic/utils-stream/CHANGELOG.md | 11 ++++++++++ packages/@ionic/utils-stream/package.json | 2 +- packages/@ionic/utils-subprocess/CHANGELOG.md | 11 ++++++++++ packages/@ionic/utils-subprocess/package.json | 8 ++++---- packages/@ionic/utils-terminal/CHANGELOG.md | 11 ++++++++++ packages/@ionic/utils-terminal/package.json | 2 +- packages/cli-scripts/CHANGELOG.md | 11 ++++++++++ packages/cli-scripts/package.json | 6 +++--- 22 files changed, 152 insertions(+), 34 deletions(-) diff --git a/packages/@ionic/cli-framework-output/CHANGELOG.md b/packages/@ionic/cli-framework-output/CHANGELOG.md index 9103cfa1b4..ce325a9d25 100644 --- a/packages/@ionic/cli-framework-output/CHANGELOG.md +++ b/packages/@ionic/cli-framework-output/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.2.8](https://github.com/ionic-team/ionic-cli/compare/@ionic/cli-framework-output@2.2.7...@ionic/cli-framework-output@2.2.8) (2023-12-19) + +**Note:** Version bump only for package @ionic/cli-framework-output + + + + + ## [2.2.7](https://github.com/ionic-team/ionic-cli/compare/@ionic/cli-framework-output@2.2.6...@ionic/cli-framework-output@2.2.7) (2023-11-07) **Note:** Version bump only for package @ionic/cli-framework-output diff --git a/packages/@ionic/cli-framework-output/package.json b/packages/@ionic/cli-framework-output/package.json index 5be75c68e0..76bab15ccb 100644 --- a/packages/@ionic/cli-framework-output/package.json +++ b/packages/@ionic/cli-framework-output/package.json @@ -1,6 +1,6 @@ { "name": "@ionic/cli-framework-output", - "version": "2.2.7", + "version": "2.2.8", "description": "The log/tasks/spinners portion of Ionic CLI Framework", "homepage": "https://ionicframework.com/", "author": "Ionic Team (https://ionicframework.com)", @@ -31,12 +31,12 @@ }, "license": "MIT", "dependencies": { - "@ionic/utils-terminal": "2.3.4", + "@ionic/utils-terminal": "2.3.5", "debug": "^4.0.0", "tslib": "^2.0.1" }, "devDependencies": { - "@ionic/utils-stream": "3.1.6", + "@ionic/utils-stream": "3.1.7", "@types/debug": "^4.1.1", "@types/inquirer": "0.0.43", "@types/jest": "^26.0.10", diff --git a/packages/@ionic/cli-framework-prompts/CHANGELOG.md b/packages/@ionic/cli-framework-prompts/CHANGELOG.md index 90e229b5bb..4a0bd1e5ba 100644 --- a/packages/@ionic/cli-framework-prompts/CHANGELOG.md +++ b/packages/@ionic/cli-framework-prompts/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.1.13](https://github.com/ionic-team/ionic-cli/compare/@ionic/cli-framework-prompts@2.1.12...@ionic/cli-framework-prompts@2.1.13) (2023-12-19) + + +### Bug Fixes + +* **cli:** resolve vm2 security vulnerability ([#5070](https://github.com/ionic-team/ionic-cli/issues/5070)) ([4050419](https://github.com/ionic-team/ionic-cli/commit/4050419bef70fb92e58b0a83cd4b68b48090e596)) + + + + + ## [2.1.12](https://github.com/ionic-team/ionic-cli/compare/@ionic/cli-framework-prompts@2.1.11...@ionic/cli-framework-prompts@2.1.12) (2023-11-07) **Note:** Version bump only for package @ionic/cli-framework-prompts diff --git a/packages/@ionic/cli-framework-prompts/package.json b/packages/@ionic/cli-framework-prompts/package.json index c8eb7a6483..ce4aacfe5b 100644 --- a/packages/@ionic/cli-framework-prompts/package.json +++ b/packages/@ionic/cli-framework-prompts/package.json @@ -1,6 +1,6 @@ { "name": "@ionic/cli-framework-prompts", - "version": "2.1.12", + "version": "2.1.13", "description": "The interactive prompts portion of Ionic CLI Framework", "homepage": "https://ionicframework.com/", "author": "Ionic Team (https://ionicframework.com)", @@ -31,7 +31,7 @@ }, "license": "MIT", "dependencies": { - "@ionic/utils-terminal": "2.3.4", + "@ionic/utils-terminal": "2.3.5", "debug": "^4.0.0", "inquirer": "^7.0.0", "tslib": "^2.0.1" diff --git a/packages/@ionic/cli-framework/CHANGELOG.md b/packages/@ionic/cli-framework/CHANGELOG.md index b92121fffe..26ddfa9909 100644 --- a/packages/@ionic/cli-framework/CHANGELOG.md +++ b/packages/@ionic/cli-framework/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [6.0.1](https://github.com/ionic-team/ionic-cli/compare/@ionic/cli-framework@6.0.0...@ionic/cli-framework@6.0.1) (2023-12-19) + + +### Bug Fixes + +* **cli:** resolve vm2 security vulnerability ([#5070](https://github.com/ionic-team/ionic-cli/issues/5070)) ([4050419](https://github.com/ionic-team/ionic-cli/commit/4050419bef70fb92e58b0a83cd4b68b48090e596)) + + + + + # [6.0.0](https://github.com/ionic-team/ionic-cli/compare/@ionic/cli-framework@5.1.7...@ionic/cli-framework@6.0.0) (2023-11-08) diff --git a/packages/@ionic/cli-framework/package.json b/packages/@ionic/cli-framework/package.json index bf696f832d..d3b7b99dfe 100644 --- a/packages/@ionic/cli-framework/package.json +++ b/packages/@ionic/cli-framework/package.json @@ -1,6 +1,6 @@ { "name": "@ionic/cli-framework", - "version": "6.0.0", + "version": "6.0.1", "description": "The foundation framework of the Ionic CLI", "homepage": "https://ionicframework.com/", "author": "Ionic Team (https://ionicframework.com) ", @@ -26,14 +26,14 @@ }, "license": "MIT", "dependencies": { - "@ionic/cli-framework-output": "2.2.7", + "@ionic/cli-framework-output": "2.2.8", "@ionic/utils-array": "2.1.6", "@ionic/utils-fs": "3.1.7", "@ionic/utils-object": "2.1.6", - "@ionic/utils-process": "2.1.11", - "@ionic/utils-stream": "3.1.6", - "@ionic/utils-subprocess": "3.0.0", - "@ionic/utils-terminal": "2.3.4", + "@ionic/utils-process": "2.1.12", + "@ionic/utils-stream": "3.1.7", + "@ionic/utils-subprocess": "3.0.1", + "@ionic/utils-terminal": "2.3.5", "chalk": "^4.0.0", "debug": "^4.0.0", "lodash": "^4.17.5", diff --git a/packages/@ionic/cli/CHANGELOG.md b/packages/@ionic/cli/CHANGELOG.md index 1e33320689..4d9991688d 100644 --- a/packages/@ionic/cli/CHANGELOG.md +++ b/packages/@ionic/cli/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [7.1.6](https://github.com/ionic-team/ionic-cli/compare/@ionic/cli@7.1.5...@ionic/cli@7.1.6) (2023-12-19) + + +### Bug Fixes + +* **cli:** resolve vm2 security vulnerability ([#5070](https://github.com/ionic-team/ionic-cli/issues/5070)) ([4050419](https://github.com/ionic-team/ionic-cli/commit/4050419bef70fb92e58b0a83cd4b68b48090e596)) + + + + + ## [7.1.5](https://github.com/ionic-team/ionic-cli/compare/@ionic/cli@7.1.4...@ionic/cli@7.1.5) (2023-11-08) diff --git a/packages/@ionic/cli/package.json b/packages/@ionic/cli/package.json index 66de878ce0..203ea6a534 100644 --- a/packages/@ionic/cli/package.json +++ b/packages/@ionic/cli/package.json @@ -1,6 +1,6 @@ { "name": "@ionic/cli", - "version": "7.1.5", + "version": "7.1.6", "description": "A tool for creating and developing Ionic Framework mobile apps.", "homepage": "https://ionicframework.com", "author": "Ionic Team (https://ionicframework.com) ", @@ -40,16 +40,16 @@ }, "license": "MIT", "dependencies": { - "@ionic/cli-framework": "6.0.0", - "@ionic/cli-framework-output": "2.2.7", - "@ionic/cli-framework-prompts": "2.1.12", + "@ionic/cli-framework": "6.0.1", + "@ionic/cli-framework-output": "2.2.8", + "@ionic/cli-framework-prompts": "2.1.13", "@ionic/utils-array": "2.1.6", "@ionic/utils-fs": "3.1.7", - "@ionic/utils-network": "2.1.6", - "@ionic/utils-process": "2.1.11", - "@ionic/utils-stream": "3.1.6", - "@ionic/utils-subprocess": "3.0.0", - "@ionic/utils-terminal": "2.3.4", + "@ionic/utils-network": "2.1.7", + "@ionic/utils-process": "2.1.12", + "@ionic/utils-stream": "3.1.7", + "@ionic/utils-subprocess": "3.0.1", + "@ionic/utils-terminal": "2.3.5", "chalk": "^4.0.0", "debug": "^4.0.0", "diff": "^4.0.1", @@ -58,12 +58,12 @@ "lodash": "^4.17.5", "open": "^7.0.4", "os-name": "^4.0.0", + "proxy-agent": "^6.3.0", "semver": "^7.1.1", "split2": "^3.0.0", "ssh-config": "^1.1.1", "stream-combiner2": "^1.1.1", "superagent": "^8.0.9", - "proxy-agent": "^6.3.0", "tar": "^6.0.1", "tslib": "^2.0.1" }, diff --git a/packages/@ionic/discover/CHANGELOG.md b/packages/@ionic/discover/CHANGELOG.md index fc132affd8..51de1d984c 100644 --- a/packages/@ionic/discover/CHANGELOG.md +++ b/packages/@ionic/discover/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [3.1.8](https://github.com/ionic-team/ionic-cli/compare/@ionic/discover@3.1.7...@ionic/discover@3.1.8) (2023-12-19) + + +### Bug Fixes + +* **cli:** resolve vm2 security vulnerability ([#5070](https://github.com/ionic-team/ionic-cli/issues/5070)) ([4050419](https://github.com/ionic-team/ionic-cli/commit/4050419bef70fb92e58b0a83cd4b68b48090e596)) + + + + + ## [3.1.7](https://github.com/ionic-team/ionic-cli/compare/@ionic/discover@3.1.6...@ionic/discover@3.1.7) (2023-11-07) **Note:** Version bump only for package @ionic/discover diff --git a/packages/@ionic/discover/package.json b/packages/@ionic/discover/package.json index ddd3eebbdd..fc684c5114 100644 --- a/packages/@ionic/discover/package.json +++ b/packages/@ionic/discover/package.json @@ -1,6 +1,6 @@ { "name": "@ionic/discover", - "version": "3.1.7", + "version": "3.1.8", "description": "Simple UDP based protocol for service discovery implemented in pure JS.", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/@ionic/utils-network/CHANGELOG.md b/packages/@ionic/utils-network/CHANGELOG.md index b3e855051a..40478269c6 100644 --- a/packages/@ionic/utils-network/CHANGELOG.md +++ b/packages/@ionic/utils-network/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.1.7](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-network@2.1.6...@ionic/utils-network@2.1.7) (2023-12-19) + + +### Bug Fixes + +* **cli:** resolve vm2 security vulnerability ([#5070](https://github.com/ionic-team/ionic-cli/issues/5070)) ([4050419](https://github.com/ionic-team/ionic-cli/commit/4050419bef70fb92e58b0a83cd4b68b48090e596)) + + + + + ## [2.1.6](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-network@2.1.5...@ionic/utils-network@2.1.6) (2023-03-29) **Note:** Version bump only for package @ionic/utils-network diff --git a/packages/@ionic/utils-network/package.json b/packages/@ionic/utils-network/package.json index 668421dc99..e417450863 100644 --- a/packages/@ionic/utils-network/package.json +++ b/packages/@ionic/utils-network/package.json @@ -1,6 +1,6 @@ { "name": "@ionic/utils-network", - "version": "2.1.6", + "version": "2.1.7", "description": "Network utils for Node", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/@ionic/utils-process/CHANGELOG.md b/packages/@ionic/utils-process/CHANGELOG.md index 5dde8de34b..ad449ab4a7 100644 --- a/packages/@ionic/utils-process/CHANGELOG.md +++ b/packages/@ionic/utils-process/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.1.12](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-process@2.1.11...@ionic/utils-process@2.1.12) (2023-12-19) + + +### Bug Fixes + +* **cli:** resolve vm2 security vulnerability ([#5070](https://github.com/ionic-team/ionic-cli/issues/5070)) ([4050419](https://github.com/ionic-team/ionic-cli/commit/4050419bef70fb92e58b0a83cd4b68b48090e596)) + + + + + ## [2.1.11](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-process@2.1.10...@ionic/utils-process@2.1.11) (2023-03-29) **Note:** Version bump only for package @ionic/utils-process diff --git a/packages/@ionic/utils-process/package.json b/packages/@ionic/utils-process/package.json index 672d868d31..872f9af426 100644 --- a/packages/@ionic/utils-process/package.json +++ b/packages/@ionic/utils-process/package.json @@ -1,6 +1,6 @@ { "name": "@ionic/utils-process", - "version": "2.1.11", + "version": "2.1.12", "description": "Process utils for NodeJS", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -32,7 +32,7 @@ }, "dependencies": { "@ionic/utils-object": "2.1.6", - "@ionic/utils-terminal": "2.3.4", + "@ionic/utils-terminal": "2.3.5", "debug": "^4.0.0", "signal-exit": "^3.0.3", "tree-kill": "^1.2.2", diff --git a/packages/@ionic/utils-stream/CHANGELOG.md b/packages/@ionic/utils-stream/CHANGELOG.md index 82c1f2c20e..61e814434b 100644 --- a/packages/@ionic/utils-stream/CHANGELOG.md +++ b/packages/@ionic/utils-stream/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [3.1.7](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-stream@3.1.6...@ionic/utils-stream@3.1.7) (2023-12-19) + + +### Bug Fixes + +* **cli:** resolve vm2 security vulnerability ([#5070](https://github.com/ionic-team/ionic-cli/issues/5070)) ([4050419](https://github.com/ionic-team/ionic-cli/commit/4050419bef70fb92e58b0a83cd4b68b48090e596)) + + + + + ## [3.1.6](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-stream@3.1.5...@ionic/utils-stream@3.1.6) (2023-03-29) **Note:** Version bump only for package @ionic/utils-stream diff --git a/packages/@ionic/utils-stream/package.json b/packages/@ionic/utils-stream/package.json index d8c30590b1..14b1fa2f46 100644 --- a/packages/@ionic/utils-stream/package.json +++ b/packages/@ionic/utils-stream/package.json @@ -1,6 +1,6 @@ { "name": "@ionic/utils-stream", - "version": "3.1.6", + "version": "3.1.7", "description": "Stream utils for NodeJS", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/@ionic/utils-subprocess/CHANGELOG.md b/packages/@ionic/utils-subprocess/CHANGELOG.md index 03ab6a1d90..a52c3e556b 100644 --- a/packages/@ionic/utils-subprocess/CHANGELOG.md +++ b/packages/@ionic/utils-subprocess/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [3.0.1](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-subprocess@3.0.0...@ionic/utils-subprocess@3.0.1) (2023-12-19) + + +### Bug Fixes + +* **cli:** resolve vm2 security vulnerability ([#5070](https://github.com/ionic-team/ionic-cli/issues/5070)) ([4050419](https://github.com/ionic-team/ionic-cli/commit/4050419bef70fb92e58b0a83cd4b68b48090e596)) + + + + + # [3.0.0](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-subprocess@2.1.14...@ionic/utils-subprocess@3.0.0) (2023-11-08) diff --git a/packages/@ionic/utils-subprocess/package.json b/packages/@ionic/utils-subprocess/package.json index 833b7ddfeb..90d51bf519 100644 --- a/packages/@ionic/utils-subprocess/package.json +++ b/packages/@ionic/utils-subprocess/package.json @@ -1,6 +1,6 @@ { "name": "@ionic/utils-subprocess", - "version": "3.0.0", + "version": "3.0.1", "description": "Subprocess utils for NodeJS", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -33,9 +33,9 @@ "dependencies": { "@ionic/utils-array": "2.1.6", "@ionic/utils-fs": "3.1.7", - "@ionic/utils-process": "2.1.11", - "@ionic/utils-stream": "3.1.6", - "@ionic/utils-terminal": "2.3.4", + "@ionic/utils-process": "2.1.12", + "@ionic/utils-stream": "3.1.7", + "@ionic/utils-terminal": "2.3.5", "cross-spawn": "^7.0.3", "debug": "^4.0.0", "tslib": "^2.0.1" diff --git a/packages/@ionic/utils-terminal/CHANGELOG.md b/packages/@ionic/utils-terminal/CHANGELOG.md index 4b306df5cc..b1c0953b73 100644 --- a/packages/@ionic/utils-terminal/CHANGELOG.md +++ b/packages/@ionic/utils-terminal/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.3.5](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-terminal@2.3.4...@ionic/utils-terminal@2.3.5) (2023-12-19) + + +### Bug Fixes + +* **cli:** resolve vm2 security vulnerability ([#5070](https://github.com/ionic-team/ionic-cli/issues/5070)) ([4050419](https://github.com/ionic-team/ionic-cli/commit/4050419bef70fb92e58b0a83cd4b68b48090e596)) + + + + + ## [2.3.4](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-terminal@2.3.3...@ionic/utils-terminal@2.3.4) (2023-03-29) **Note:** Version bump only for package @ionic/utils-terminal diff --git a/packages/@ionic/utils-terminal/package.json b/packages/@ionic/utils-terminal/package.json index 9b979d512a..d4e3e53fff 100644 --- a/packages/@ionic/utils-terminal/package.json +++ b/packages/@ionic/utils-terminal/package.json @@ -1,6 +1,6 @@ { "name": "@ionic/utils-terminal", - "version": "2.3.4", + "version": "2.3.5", "description": "Terminal utils for NodeJS", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/cli-scripts/CHANGELOG.md b/packages/cli-scripts/CHANGELOG.md index 3cd6c59528..ec914d2467 100644 --- a/packages/cli-scripts/CHANGELOG.md +++ b/packages/cli-scripts/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.1.73](https://github.com/ionic-team/ionic-cli/compare/cli-scripts@2.1.72...cli-scripts@2.1.73) (2023-12-19) + + +### Bug Fixes + +* **cli:** resolve vm2 security vulnerability ([#5070](https://github.com/ionic-team/ionic-cli/issues/5070)) ([4050419](https://github.com/ionic-team/ionic-cli/commit/4050419bef70fb92e58b0a83cd4b68b48090e596)) + + + + + ## [2.1.72](https://github.com/ionic-team/ionic-cli/compare/cli-scripts@2.1.71...cli-scripts@2.1.72) (2023-11-08) **Note:** Version bump only for package cli-scripts diff --git a/packages/cli-scripts/package.json b/packages/cli-scripts/package.json index 4fa070793b..937306b77f 100644 --- a/packages/cli-scripts/package.json +++ b/packages/cli-scripts/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "cli-scripts", - "version": "2.1.72", + "version": "2.1.73", "bin": { "ionic-cli-scripts": "./bin/ionic-cli-scripts" }, @@ -16,8 +16,8 @@ "main": "./dist/index.js", "types": "./dist/index.d.ts", "dependencies": { - "@ionic/cli": "7.1.5", - "@ionic/cli-framework": "6.0.0", + "@ionic/cli": "7.1.6", + "@ionic/cli-framework": "6.0.1", "@ionic/utils-fs": "3.1.7", "ansi-styles": "^4.0.0", "chalk": "^4.0.0", From ef5706ed5e7ef347280320a88b5604a279667184 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Wilski?= <12202969+triforcely@users.noreply.github.com> Date: Wed, 20 Dec 2023 22:33:34 +0100 Subject: [PATCH 4/5] fix: live reload deploys app when warnings are present #4807 (#5043) Co-authored-by: Michal Wilski --- packages/@ionic/cli/src/lib/project/react/serve.ts | 2 +- packages/@ionic/cli/src/lib/project/vue/serve.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/@ionic/cli/src/lib/project/react/serve.ts b/packages/@ionic/cli/src/lib/project/react/serve.ts index cc3b697ee1..d085b50854 100644 --- a/packages/@ionic/cli/src/lib/project/react/serve.ts +++ b/packages/@ionic/cli/src/lib/project/react/serve.ts @@ -112,7 +112,7 @@ export class ReactServeCLI extends ServeCLI { const strippedLine = stripAnsi(line); - const compileMsgs = ['Compiled successfully', 'Compiled with warnings', 'Failed to compile']; + const compileMsgs = ['Compiled successfully', 'Compiled with', 'Failed to compile']; if (compileMsgs.some(msg => strippedLine.includes(msg))) { this.emit('ready'); return false; diff --git a/packages/@ionic/cli/src/lib/project/vue/serve.ts b/packages/@ionic/cli/src/lib/project/vue/serve.ts index b207117720..999fdda433 100644 --- a/packages/@ionic/cli/src/lib/project/vue/serve.ts +++ b/packages/@ionic/cli/src/lib/project/vue/serve.ts @@ -63,7 +63,7 @@ export class VueServeCLI extends ServeCLI { } const strippedLine = stripAnsi(line); - const compileMsgs = ['Compiled successfully', 'Compiled with warnings', 'Failed to compile']; + const compileMsgs = ['Compiled successfully', 'Compiled with', 'Failed to compile']; if (compileMsgs.some(msg => strippedLine.includes(msg))) { this.emit('ready'); return false; From 2e3a5de3ab3191ce5f301cf8bd09817d961c252b Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Tue, 2 Jan 2024 12:34:04 -0500 Subject: [PATCH 5/5] chore: deprecate the ssl command (#5068) --- packages/@ionic/cli/src/commands/ssl/generate.ts | 4 +++- packages/@ionic/cli/src/commands/ssl/index.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/@ionic/cli/src/commands/ssl/generate.ts b/packages/@ionic/cli/src/commands/ssl/generate.ts index 485923bc1b..acb1a3e595 100644 --- a/packages/@ionic/cli/src/commands/ssl/generate.ts +++ b/packages/@ionic/cli/src/commands/ssl/generate.ts @@ -53,6 +53,8 @@ Uses OpenSSL to create a self-signed certificate for ${strong('localhost')} (by After the certificate is generated, you will still need to add it to your system or browser as a trusted certificate. The default directory for ${input('--key-path')} and ${input('--cert-path')} is ${input('.ionic/ssl/')}. + +Deprecated. Developers should generate an SSL certificate locally and then configure it using their project tooling such as Vite or Angular CLI. `, options: [ { @@ -110,7 +112,7 @@ The default directory for ${input('--key-path')} and ${input('--cert-path')} is groups: [MetadataGroup.ADVANCED], }, ], - groups: [MetadataGroup.EXPERIMENTAL], + groups: [MetadataGroup.DEPRECATED], }; } diff --git a/packages/@ionic/cli/src/commands/ssl/index.ts b/packages/@ionic/cli/src/commands/ssl/index.ts index 89fb4bf472..21988e0309 100644 --- a/packages/@ionic/cli/src/commands/ssl/index.ts +++ b/packages/@ionic/cli/src/commands/ssl/index.ts @@ -8,7 +8,7 @@ export class SSLNamespace extends Namespace { return { name: 'ssl', summary: 'Commands for managing SSL keys & certificates', - groups: [MetadataGroup.EXPERIMENTAL], + groups: [MetadataGroup.DEPRECATED], description: ` These commands make it easy to manage SSL certificates for using HTTPS with ${input('ionic serve')}. `,