From e909ae83e5f3120efebb0fc3d2c66f9aebbfae32 Mon Sep 17 00:00:00 2001 From: Mark Lee Date: Sun, 9 Jan 2022 09:44:42 -0800 Subject: [PATCH] fix: replace colors with chalk (#2666) * chore(deps): upgrade electron-rebuild to ^3.2.6 --- .github/dependabot.yml | 1 + package.json | 3 +- packages/api/cli/package.json | 2 +- .../api/cli/src/electron-forge-install.ts | 3 +- packages/api/cli/src/electron-forge.ts | 8 +- packages/api/cli/src/util/terminate.ts | 24 +- packages/api/core/package.json | 4 +- packages/api/core/src/api/import.ts | 14 +- packages/api/core/src/api/index.ts | 1 - packages/api/core/src/api/install.ts | 8 +- packages/api/core/src/api/lint.ts | 1 - packages/api/core/src/api/make.ts | 99 ++++---- packages/api/core/src/api/package.ts | 8 +- packages/api/core/src/api/publish.ts | 5 +- packages/api/core/src/api/start.ts | 4 +- packages/api/core/src/util/deprecate.ts | 4 +- .../api/core/src/util/electron-executable.ts | 8 +- packages/api/core/src/util/yarn-or-npm.ts | 3 +- .../api/core/test/slow/install_spec_slow.ts | 3 +- packages/maker/wix/package.json | 2 +- packages/maker/wix/src/MakerWix.ts | 7 +- packages/plugin/webpack/package.json | 1 + packages/plugin/webpack/src/WebpackPlugin.ts | 8 +- packages/utils/async-ora/package.json | 2 +- packages/utils/async-ora/src/ora-handler.ts | 12 +- packages/utils/async-ora/src/ora.ts | 10 +- packages/utils/types/package.json | 2 +- tools/bump.ts | 10 +- tools/publish.js | 8 +- tools/test-dist.ts | 6 +- tools/update-dependencies.js | 1 + yarn.lock | 223 ++++++++++++------ 32 files changed, 303 insertions(+), 192 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 77dd3d22d1..0740af3ddf 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -12,6 +12,7 @@ updates: - dependency-name: '@aws-sdk/lib-storage' - dependency-name: '@aws-sdk/types' - dependency-name: '@types/node-fetch' + - dependency-name: 'chalk' - dependency-name: commander - dependency-name: electron-notarize - dependency-name: find-up diff --git a/package.json b/package.json index 3e02d020ef..2002f41dfa 100644 --- a/package.json +++ b/package.json @@ -48,6 +48,7 @@ "@octokit/plugin-retry": "^3.0.9", "@octokit/rest": "^18.0.11", "@octokit/types": "^6.1.2", + "chalk": "^4.0.0", "colors": "^1.4.0", "commander": "^4.1.1", "cross-spawn": "^7.0.3", @@ -55,7 +56,7 @@ "debug": "^4.3.1", "electron-osx-sign": "^0.5.0", "electron-packager": "^15.4.0", - "electron-rebuild": "^3.2.2", + "electron-rebuild": "^3.2.6", "express": "^4.17.1", "express-ws": "^5.0.2", "fast-glob": "^3.2.7", diff --git a/packages/api/cli/package.json b/packages/api/cli/package.json index 68c7dc62eb..f799a0784a 100644 --- a/packages/api/cli/package.json +++ b/packages/api/cli/package.json @@ -21,7 +21,7 @@ "@electron-forge/core": "6.0.0-beta.61", "@electron-forge/shared-types": "6.0.0-beta.61", "@electron/get": "^1.9.0", - "colors": "^1.4.0", + "chalk": "^4.0.0", "commander": "^4.1.1", "debug": "^4.3.1", "fs-extra": "^10.0.0", diff --git a/packages/api/cli/src/electron-forge-install.ts b/packages/api/cli/src/electron-forge-install.ts index c1bb495e07..ff1b43ad5d 100644 --- a/packages/api/cli/src/electron-forge-install.ts +++ b/packages/api/cli/src/electron-forge-install.ts @@ -1,5 +1,6 @@ import { api, InstallAsset } from '@electron-forge/core'; +import chalk from 'chalk'; import fs from 'fs-extra'; import inquirer from 'inquirer'; import program from 'commander'; @@ -28,7 +29,7 @@ import './util/terminate'; choices, type: 'list', name: 'assetID', - message: 'Multiple potential assets found, please choose one from the list below:'.cyan, + message: chalk.cyan('Multiple potential assets found, please choose one from the list below:'), }); // eslint-disable-next-line @typescript-eslint/no-non-null-assertion diff --git a/packages/api/cli/src/electron-forge.ts b/packages/api/cli/src/electron-forge.ts index f2868677d5..e860ec5287 100755 --- a/packages/api/cli/src/electron-forge.ts +++ b/packages/api/cli/src/electron-forge.ts @@ -1,5 +1,5 @@ -import 'colors'; import { asyncOra } from '@electron-forge/async-ora'; +import chalk from 'chalk'; import program from 'commander'; import './util/terminate'; @@ -41,7 +41,7 @@ program // eslint-disable-next-line no-underscore-dangle if (!program._execs.has(commands[0])) { console.error(); - console.error(`Unknown command "${program.args.join(' ')}".`.red); + console.error(chalk.red(`Unknown command "${program.args.join(' ')}".`)); console.error('See --help for a list of available commands.'); process.exit(1); } @@ -55,8 +55,8 @@ program if (!goodSystem) { console.error( - `It looks like you are missing some dependencies you need to get Electron running. -Make sure you have git installed and Node.js version ${metadata.engines.node}`.red + chalk.red(`It looks like you are missing some dependencies you need to get Electron running. +Make sure you have git installed and Node.js version ${metadata.engines.node}`) ); process.exit(1); } diff --git a/packages/api/cli/src/util/terminate.ts b/packages/api/cli/src/util/terminate.ts index 31f79f37ac..864d106164 100644 --- a/packages/api/cli/src/util/terminate.ts +++ b/packages/api/cli/src/util/terminate.ts @@ -1,21 +1,25 @@ -import colors from 'colors'; +import chalk from 'chalk'; + +function redConsoleError(msg: string) { + console.error(chalk.red(msg)); +} process.on('unhandledRejection', (reason: string, promise: Promise) => { - console.error('\nAn unhandled rejection has occurred inside Forge:'.red); - console.error(colors.red(reason.toString())); - console.error('\nElectron Forge was terminated. Location:'.red); - console.error(colors.red(JSON.stringify(promise))); + redConsoleError('\nAn unhandled rejection has occurred inside Forge:'); + redConsoleError(reason.toString()); + redConsoleError('\nElectron Forge was terminated. Location:'); + redConsoleError(JSON.stringify(promise)); process.exit(1); }); process.on('uncaughtException', (err) => { if (err && err.message && err.stack) { - console.error('\nAn unhandled exception has occurred inside Forge:'.red); - console.error(colors.red(err.message)); - console.error(colors.red(err.stack)); + redConsoleError('\nAn unhandled exception has occurred inside Forge:'); + redConsoleError(err.message); + redConsoleError(err.stack); } else { - console.error('\nElectron Forge was terminated:'.red); - console.error(colors.red(typeof err === 'string' ? err : JSON.stringify(err))); + redConsoleError('\nElectron Forge was terminated:'); + redConsoleError(typeof err === 'string' ? err : JSON.stringify(err)); } process.exit(1); }); diff --git a/packages/api/core/package.json b/packages/api/core/package.json index ddd7b47528..ad94742b71 100644 --- a/packages/api/core/package.json +++ b/packages/api/core/package.json @@ -53,10 +53,10 @@ "@electron-forge/template-webpack": "6.0.0-beta.61", "@electron/get": "^1.9.0", "@malept/cross-spawn-promise": "^2.0.0", - "colors": "^1.4.0", + "chalk": "^4.0.0", "debug": "^4.3.1", "electron-packager": "^15.4.0", - "electron-rebuild": "^3.2.2", + "electron-rebuild": "^3.2.6", "fast-glob": "^3.2.7", "find-up": "^5.0.0", "fs-extra": "^10.0.0", diff --git a/packages/api/core/src/api/import.ts b/packages/api/core/src/api/import.ts index 5ff9cefd8e..d4fbd58c0b 100644 --- a/packages/api/core/src/api/import.ts +++ b/packages/api/core/src/api/import.ts @@ -1,8 +1,9 @@ -import { merge } from 'lodash'; import { asyncOra } from '@electron-forge/async-ora'; import baseTemplate from '@electron-forge/template-base'; +import chalk from 'chalk'; import debug from 'debug'; import fs from 'fs-extra'; +import { merge } from 'lodash'; import path from 'path'; import initGit from './init-scripts/init-git'; @@ -85,7 +86,7 @@ export default async ({ let packageJSON = await readRawPackageJson(dir); if (packageJSON.config && packageJSON.config.forge) { if (packageJSON.config.forge.makers) { - warn(interactive, 'It looks like this project is already configured for Electron Forge'.green); + warn(interactive, chalk.green('It looks like this project is already configured for Electron Forge')); if (typeof shouldContinueOnExisting === 'function') { if (!(await shouldContinueOnExisting())) { // TODO: figure out if we can just return early here @@ -96,8 +97,9 @@ export default async ({ } else if (typeof packageJSON.config.forge === 'string') { warn( interactive, - "We can't tell if the Electron Forge config is compatible because it's in an external JavaScript file, not trying to convert it and continuing anyway" - .yellow + chalk.yellow( + "We can't tell if the Electron Forge config is compatible because it's in an external JavaScript file, not trying to convert it and continuing anyway" + ) ); } else { d('Upgrading an Electron Forge < 6 project'); @@ -191,7 +193,7 @@ export default async ({ packageJSON = await readRawPackageJson(dir); if (!packageJSON.version) { - warn(interactive, 'Please set the "version" in your application\'s package.json'.yellow); + warn(interactive, chalk.yellow('Please set the "version" in your application\'s package.json')); } packageJSON.config = packageJSON.config || {}; @@ -225,6 +227,6 @@ export default async ({ We have ATTEMPTED to convert your app to be in a format that electron-forge understands. -Thanks for using ${'"electron-forge"'.green}!!!` +Thanks for using ${chalk.green('Electron Forge')}!!!` ); }; diff --git a/packages/api/core/src/api/index.ts b/packages/api/core/src/api/index.ts index e2e5a57162..ce066089e3 100644 --- a/packages/api/core/src/api/index.ts +++ b/packages/api/core/src/api/index.ts @@ -1,4 +1,3 @@ -import 'colors'; import { ElectronProcess, ForgeMakeResult } from '@electron-forge/shared-types'; import _import, { ImportOptions } from './import'; diff --git a/packages/api/core/src/api/install.ts b/packages/api/core/src/api/install.ts index 90b3f29f36..2b1718544c 100644 --- a/packages/api/core/src/api/install.ts +++ b/packages/api/core/src/api/install.ts @@ -1,6 +1,5 @@ -import 'colors'; import { asyncOra } from '@electron-forge/async-ora'; -import InstallerBase from '@electron-forge/installer-base'; +import chalk from 'chalk'; import debug from 'debug'; import fetch from 'node-fetch'; import fs from 'fs-extra'; @@ -9,6 +8,7 @@ import path from 'path'; import { promisify } from 'util'; import semver from 'semver'; +import InstallerBase from '@electron-forge/installer-base'; import DMGInstaller from '@electron-forge/installer-dmg'; import ZipInstaller from '@electron-forge/installer-zip'; import DebInstaller from '@electron-forge/installer-deb'; @@ -133,11 +133,11 @@ export default async ({ interactive = false, prerelease = false, repo, chooseAss }); if (possibleAssets.length === 0) { - throw new Error(`Failed to find any installable assets for target platform: ${`${process.platform}`.cyan}`); + throw new Error(`Failed to find any installable assets for target platform: ${chalk.cyan(`${process.platform}`)}`); } }); - info(interactive, `Found latest release${prerelease ? ' (including prereleases)' : ''}: ${latestRelease.tag_name.cyan}`); + info(interactive, `Found latest release${prerelease ? ' (including prereleases)' : ''}: ${chalk.cyan(latestRelease.tag_name)}`); let targetAsset = possibleAssets[0]; if (possibleAssets.length > 1) { diff --git a/packages/api/core/src/api/lint.ts b/packages/api/core/src/api/lint.ts index 4bcd783a74..874a11f5fe 100644 --- a/packages/api/core/src/api/lint.ts +++ b/packages/api/core/src/api/lint.ts @@ -1,4 +1,3 @@ -import 'colors'; import { asyncOra } from '@electron-forge/async-ora'; import debug from 'debug'; import { yarnOrNpmSpawn } from '../util/yarn-or-npm'; diff --git a/packages/api/core/src/api/make.ts b/packages/api/core/src/api/make.ts index 5f91eabdad..09226e576a 100644 --- a/packages/api/core/src/api/make.ts +++ b/packages/api/core/src/api/make.ts @@ -1,5 +1,5 @@ -import 'colors'; import { asyncOra } from '@electron-forge/async-ora'; +import chalk from 'chalk'; import { getHostArch } from '@electron/get'; import { IForgeResolvableMaker, ForgeConfig, ForgeArch, ForgePlatform, ForgeMakeResult } from '@electron-forge/shared-types'; import MakerBase from '@electron-forge/maker-base'; @@ -157,7 +157,7 @@ export default async ({ } if (!skipPackage) { - info(interactive, 'We need to package your application before we can make it'.green); + info(interactive, chalk.green('We need to package your application before we can make it')); await packager({ dir, interactive, @@ -166,7 +166,7 @@ export default async ({ platform: actualTargetPlatform, }); } else { - warn(interactive, 'WARNING: Skipping the packaging step, this could result in an out of date build'.red); + warn(interactive, chalk.red('WARNING: Skipping the packaging step, this could result in an out of date build')); } targets = targets.filter((_, i) => makers[i]); @@ -175,7 +175,7 @@ export default async ({ throw new Error(`Could not find any make targets configured for the "${actualTargetPlatform}" platform.`); } - info(interactive, `Making for the following targets: ${`${targets.map((_t, i) => makers[i].name).join(', ')}`.cyan}`); + info(interactive, `Making for the following targets: ${chalk.cyan(`${targets.map((_t, i) => makers[i].name).join(', ')}`)}`); const packageJSON = await readMutatedPackageJson(dir, forgeConfig); const appName = forgeConfig.packagerConfig.name || packageJSON.productName || packageJSON.name; @@ -196,52 +196,55 @@ export default async ({ targetId += 1; // eslint-disable-next-line no-loop-func - await asyncOra(`Making for target: ${maker.name.green} - On platform: ${actualTargetPlatform.cyan} - For arch: ${targetArch.cyan}`, async () => { - try { - /** - * WARNING: DO NOT ATTEMPT TO PARALLELIZE MAKERS - * - * Currently it is assumed we have 1 maker per make call but that is - * not enforced. It is technically possible to have 1 maker be called - * multiple times. The "prepareConfig" method however implicitly - * requires a lock that is not enforced. There are two options: - * - * * Provide makers a getConfig() method - * * Remove support for config being provided as a method - * * Change the entire API of maker from a single constructor to - * providing a MakerFactory - */ - maker.prepareConfig(targetArch); - const artifacts = await maker.make({ - appName, - forgeConfig, - packageJSON, - targetArch, - dir: packageDir, - makeDir: path.resolve(actualOutDir, 'make'), - targetPlatform: actualTargetPlatform, - }); - - outputs.push({ - artifacts, - packageJSON, - platform: actualTargetPlatform, - arch: targetArch, - }); - } catch (err) { - if (err instanceof Error) { - // eslint-disable-next-line no-throw-literal - throw { - message: `An error occured while making for target: ${maker.name}`, - stack: `${err.message}\n${err.stack}`, - }; - } else if (err) { - throw err; - } else { - throw new Error(`An unknown error occured while making for target: ${maker.name}`); + await asyncOra( + `Making for target: ${chalk.green(maker.name)} - On platform: ${chalk.cyan(actualTargetPlatform)} - For arch: ${chalk.cyan(targetArch)}`, + async () => { + try { + /** + * WARNING: DO NOT ATTEMPT TO PARALLELIZE MAKERS + * + * Currently it is assumed we have 1 maker per make call but that is + * not enforced. It is technically possible to have 1 maker be called + * multiple times. The "prepareConfig" method however implicitly + * requires a lock that is not enforced. There are two options: + * + * * Provide makers a getConfig() method + * * Remove support for config being provided as a method + * * Change the entire API of maker from a single constructor to + * providing a MakerFactory + */ + maker.prepareConfig(targetArch); + const artifacts = await maker.make({ + appName, + forgeConfig, + packageJSON, + targetArch, + dir: packageDir, + makeDir: path.resolve(actualOutDir, 'make'), + targetPlatform: actualTargetPlatform, + }); + + outputs.push({ + artifacts, + packageJSON, + platform: actualTargetPlatform, + arch: targetArch, + }); + } catch (err) { + if (err instanceof Error) { + // eslint-disable-next-line no-throw-literal + throw { + message: `An error occured while making for target: ${maker.name}`, + stack: `${err.message}\n${err.stack}`, + }; + } else if (err) { + throw err; + } else { + throw new Error(`An unknown error occured while making for target: ${maker.name}`); + } } } - }); + ); } } diff --git a/packages/api/core/src/api/package.ts b/packages/api/core/src/api/package.ts index 6a55b640f0..f2610208fc 100644 --- a/packages/api/core/src/api/package.ts +++ b/packages/api/core/src/api/package.ts @@ -1,6 +1,6 @@ -import 'colors'; import { ora as realOra, fakeOra, OraImpl } from '@electron-forge/async-ora'; import { ForgeArch, ForgePlatform } from '@electron-forge/shared-types'; +import chalk from 'chalk'; import debug from 'debug'; import fs from 'fs-extra'; import { getHostArch } from '@electron/get'; @@ -82,7 +82,7 @@ export default async ({ }: PackageOptions): Promise => { const ora = interactive ? realOra : fakeOra; - let prepareSpinner = ora(`Preparing to Package Application for arch: ${(arch === 'all' ? 'ia32' : arch).cyan}`).start(); + let prepareSpinner = ora(`Preparing to Package Application for arch: ${chalk.cyan(arch === 'all' ? 'ia32' : arch)}`).start(); let prepareCounter = 0; const resolvedDir = await resolveDir(dir); @@ -108,7 +108,7 @@ export default async ({ if (packagerSpinner) { packagerSpinner.succeed(); prepareCounter += 1; - prepareSpinner = ora(`Preparing to Package Application for arch: ${(prepareCounter === 2 ? 'armv7l' : 'x64').cyan}`).start(); + prepareSpinner = ora(`Preparing to Package Application for arch: ${chalk.cyan(prepareCounter === 2 ? 'armv7l' : 'x64')}`).start(); } const bins = await glob(path.join(buildPath, '**/.bin/**/*')); for (const bin of bins) { @@ -183,7 +183,7 @@ export default async ({ // eslint-disable-next-line max-len warn( interactive, - 'Please set "version" or "config.forge.packagerConfig.appVersion" in your application\'s package.json so auto-updates work properly'.yellow + chalk.yellow('Please set "version" or "config.forge.packagerConfig.appVersion" in your application\'s package.json so auto-updates work properly') ); } diff --git a/packages/api/core/src/api/publish.ts b/packages/api/core/src/api/publish.ts index 30aa5f9b09..d62cf598ef 100644 --- a/packages/api/core/src/api/publish.ts +++ b/packages/api/core/src/api/publish.ts @@ -1,4 +1,3 @@ -import 'colors'; import { asyncOra } from '@electron-forge/async-ora'; import { IForgeResolvablePublisher, @@ -8,6 +7,8 @@ import { // ForgePlatform, } from '@electron-forge/shared-types'; import PublisherBase from '@electron-forge/publisher-base'; + +import chalk from 'chalk'; import debug from 'debug'; import fs from 'fs-extra'; import path from 'path'; @@ -169,7 +170,7 @@ const publish = async ({ const resolvablePublishTarget = publishTarget as IForgeResolvablePublisher; // eslint-disable-next-line @typescript-eslint/no-explicit-any let PublisherClass: any; - await asyncOra(`Resolving publish target: ${`${resolvablePublishTarget.name}`.cyan}`, async () => { + await asyncOra(`Resolving publish target: ${chalk.cyan(resolvablePublishTarget.name)}`, async () => { // eslint-disable-line no-loop-func PublisherClass = requireSearch(dir, [resolvablePublishTarget.name]); if (!PublisherClass) { diff --git a/packages/api/core/src/api/start.ts b/packages/api/core/src/api/start.ts index 1d70971c4a..34d0f982f8 100644 --- a/packages/api/core/src/api/start.ts +++ b/packages/api/core/src/api/start.ts @@ -1,5 +1,5 @@ -import 'colors'; import { asyncOra } from '@electron-forge/async-ora'; +import chalk from 'chalk'; import debug from 'debug'; import { ElectronProcess, ForgeArch, ForgePlatform, StartOptions } from '@electron-forge/shared-types'; import { spawn, SpawnOptions } from 'child_process'; @@ -142,7 +142,7 @@ export default async ({ process.stdin.on('data', async (data) => { if (data.toString().trim() === 'rs' && lastSpawned) { // eslint-disable-next-line no-console - console.info('\nRestarting App\n'.cyan); + console.info(chalk.cyan('\nRestarting App\n')); lastSpawned.restarted = true; lastSpawned.kill('SIGTERM'); lastSpawned.emit('restarted', await forgeSpawnWrapper()); diff --git a/packages/api/core/src/util/deprecate.ts b/packages/api/core/src/util/deprecate.ts index 24099e9bcf..5b493f1fdd 100644 --- a/packages/api/core/src/util/deprecate.ts +++ b/packages/api/core/src/util/deprecate.ts @@ -1,5 +1,5 @@ /* eslint "no-console": "off" */ -import 'colors'; +import chalk from 'chalk'; import logSymbols from 'log-symbols'; type Deprecation = { @@ -8,6 +8,6 @@ type Deprecation = { export default (what: string): Deprecation => ({ replaceWith: (replacement: string): void => { - console.warn(logSymbols.warning, `WARNING: ${what} is deprecated, please use ${replacement} instead`.yellow); + console.warn(logSymbols.warning, chalk.yellow(`WARNING: ${what} is deprecated, please use ${replacement} instead`)); }, }); diff --git a/packages/api/core/src/util/electron-executable.ts b/packages/api/core/src/util/electron-executable.ts index 48e98cbf1c..43a9cb5546 100644 --- a/packages/api/core/src/util/electron-executable.ts +++ b/packages/api/core/src/util/electron-executable.ts @@ -1,3 +1,4 @@ +import chalk from 'chalk'; import logSymbols from 'log-symbols'; import path from 'path'; @@ -20,7 +21,7 @@ export function pluginCompileExists(packageJSON: PackageJSON): boolean { if (Object.keys((packageJSON.dependencies as Dependencies) || {}).find(findPluginCompile)) { // eslint-disable-next-line no-console - console.warn(logSymbols.warning, `${pluginCompileName} was detected in dependencies, it should be in devDependencies`.yellow); + console.warn(logSymbols.warning, chalk.yellow(`${pluginCompileName} was detected in dependencies, it should be in devDependencies`)); return true; } @@ -33,8 +34,9 @@ export default async function locateElectronExecutable(dir: string, packageJSON: // eslint-disable-next-line no-console console.warn( logSymbols.warning, - 'WARNING: found electron-prebuilt-compile without the Electron Forge compile plugin. Please remove the deprecated electron-prebuilt-compile from your devDependencies.' - .yellow + chalk.yellow( + 'WARNING: found electron-prebuilt-compile without the Electron Forge compile plugin. Please remove the deprecated electron-prebuilt-compile from your devDependencies.' + ) ); electronModulePath = undefined; } diff --git a/packages/api/core/src/util/yarn-or-npm.ts b/packages/api/core/src/util/yarn-or-npm.ts index f2e3fcbfe7..a727e3317f 100644 --- a/packages/api/core/src/util/yarn-or-npm.ts +++ b/packages/api/core/src/util/yarn-or-npm.ts @@ -1,3 +1,4 @@ +import chalk from 'chalk'; import { CrossSpawnArgs, CrossSpawnOptions, spawn } from '@malept/cross-spawn-promise'; import logSymbols from 'log-symbols'; import yarnOrNpm from 'yarn-or-npm'; @@ -11,7 +12,7 @@ const safeYarnOrNpm = (): string => { default: if (process.env.NODE_INSTALLER) { // eslint-disable-next-line no-console - console.warn(`${logSymbols.warning} Unknown NODE_INSTALLER, using detected installer ${system}`.yellow); + console.warn(logSymbols.warning, chalk.yellow(`Unknown NODE_INSTALLER, using detected installer ${system}`)); } return system; } diff --git a/packages/api/core/test/slow/install_spec_slow.ts b/packages/api/core/test/slow/install_spec_slow.ts index e6e25e3342..d390e3de6a 100644 --- a/packages/api/core/test/slow/install_spec_slow.ts +++ b/packages/api/core/test/slow/install_spec_slow.ts @@ -1,3 +1,4 @@ +import chalk from 'chalk'; import { expect } from 'chai'; import fetchMock, { FetchMockSandbox } from 'fetch-mock'; import proxyquire from 'proxyquire'; @@ -91,7 +92,7 @@ describe('install', () => { }, ]); await expect(install({ chooseAsset, repo: 'f/g', interactive: false })).to.eventually.be.rejectedWith( - `Failed to find any installable assets for target platform: ${`${process.platform}`.cyan}` + `Failed to find any installable assets for target platform: ${chalk.cyan(process.platform)}` ); }); diff --git a/packages/maker/wix/package.json b/packages/maker/wix/package.json index 93206bf16d..4d47099490 100644 --- a/packages/maker/wix/package.json +++ b/packages/maker/wix/package.json @@ -17,7 +17,7 @@ "dependencies": { "@electron-forge/maker-base": "6.0.0-beta.61", "@electron-forge/shared-types": "6.0.0-beta.61", - "colors": "^1.4.0", + "chalk": "^4.0.0", "electron-wix-msi": "^3.0.6", "log-symbols": "^4.0.0", "parse-author": "^2.0.0" diff --git a/packages/maker/wix/src/MakerWix.ts b/packages/maker/wix/src/MakerWix.ts index 5c1e0d51d6..cd81f6e6c0 100644 --- a/packages/maker/wix/src/MakerWix.ts +++ b/packages/maker/wix/src/MakerWix.ts @@ -1,7 +1,7 @@ import MakerBase, { MakerOptions } from '@electron-forge/maker-base'; import { ForgePlatform } from '@electron-forge/shared-types'; -import 'colors'; +import chalk from 'chalk'; import logSymbols from 'log-symbols'; import path from 'path'; @@ -26,7 +26,10 @@ export default class MakerWix extends MakerBase { let { version } = packageJSON; if (version.includes('-')) { // eslint-disable-next-line no-console - console.warn(logSymbols.warning, 'WARNING: WiX distributables do not handle prerelease information in the app version, removing it from the MSI'.yellow); + console.warn( + logSymbols.warning, + chalk.yellow('WARNING: WiX distributables do not handle prerelease information in the app version, removing it from the MSI') + ); version = this.normalizeWindowsVersion(version); } diff --git a/packages/plugin/webpack/package.json b/packages/plugin/webpack/package.json index 3b75b73aa7..594d07a2e7 100644 --- a/packages/plugin/webpack/package.json +++ b/packages/plugin/webpack/package.json @@ -28,6 +28,7 @@ "@electron-forge/plugin-base": "6.0.0-beta.61", "@electron-forge/shared-types": "6.0.0-beta.61", "@electron-forge/web-multi-logger": "6.0.0-beta.61", + "chalk": "^4.0.0", "debug": "^4.3.1", "fs-extra": "^10.0.0", "global": "^4.3.2", diff --git a/packages/plugin/webpack/src/WebpackPlugin.ts b/packages/plugin/webpack/src/WebpackPlugin.ts index 950a212dc4..34606f867b 100644 --- a/packages/plugin/webpack/src/WebpackPlugin.ts +++ b/packages/plugin/webpack/src/WebpackPlugin.ts @@ -3,6 +3,8 @@ import { asyncOra } from '@electron-forge/async-ora'; import PluginBase from '@electron-forge/plugin-base'; import { ElectronProcess, ForgeArch, ForgeConfig, ForgeHookFn, ForgePlatform } from '@electron-forge/shared-types'; import Logger, { Tab } from '@electron-forge/web-multi-logger'; + +import chalk from 'chalk'; import debug from 'debug'; import fs from 'fs-extra'; import http from 'http'; @@ -169,7 +171,7 @@ export default class WebpackPlugin extends PluginBase { case 'postStart': return async (_config: ForgeConfig, child: ElectronProcess) => { if (!this.loggedOutputUrl) { - console.info(`\n\nWebpack Output Available: ${`http://localhost:${this.loggerPort}`.cyan}\n`); + console.info(`\n\nWebpack Output Available: ${chalk.cyan(`http://localhost:${this.loggerPort}`)}\n`); this.loggedOutputUrl = true; } d('hooking electron process exit'); @@ -194,9 +196,9 @@ export default class WebpackPlugin extends PluginBase { if (forgeConfig.packagerConfig.ignore) { if (typeof forgeConfig.packagerConfig.ignore !== 'function') { console.error( - `You have set packagerConfig.ignore, the Electron Forge webpack plugin normally sets this automatically. + chalk.red(`You have set packagerConfig.ignore, the Electron Forge webpack plugin normally sets this automatically. -Your packaged app may be larger than expected if you dont ignore everything other than the '.webpack' folder`.red +Your packaged app may be larger than expected if you dont ignore everything other than the '.webpack' folder`) ); } return forgeConfig; diff --git a/packages/utils/async-ora/package.json b/packages/utils/async-ora/package.json index e7909a17ed..5def51be83 100644 --- a/packages/utils/async-ora/package.json +++ b/packages/utils/async-ora/package.json @@ -17,7 +17,7 @@ "sinon": "^11.1.1" }, "dependencies": { - "colors": "^1.4.0", + "chalk": "^4.0.0", "debug": "^4.3.1", "log-symbols": "^4.0.0", "ora": "^5.0.0", diff --git a/packages/utils/async-ora/src/ora-handler.ts b/packages/utils/async-ora/src/ora-handler.ts index f841907772..0e3f54af77 100644 --- a/packages/utils/async-ora/src/ora-handler.ts +++ b/packages/utils/async-ora/src/ora-handler.ts @@ -1,5 +1,5 @@ /* eslint "no-console": "off" */ -import colors from 'colors'; +import chalk from 'chalk'; import ora from './ora'; export class OraImpl { @@ -47,12 +47,12 @@ const asyncOra: AsyncOraMethod = (initialOraValue, asyncFn, processExitFn = proc fnOra.fail(); if (asyncOra.interactive) { if (err && err.message && err.stack) { - console.error('\nAn unhandled error has occurred inside Forge:'.red); - console.error(colors.red(err.message)); - console.error(colors.red(err.stack)); + console.error(chalk.red('\nAn unhandled error has occurred inside Forge:')); + console.error(chalk.red(err.message)); + console.error(chalk.red(err.stack)); } else { - console.error('\nElectron Forge was terminated:'.red); - console.error(colors.red(typeof err === 'string' ? err : JSON.stringify(err))); + console.error(chalk.red('\nElectron Forge was terminated:')); + console.error(chalk.red(typeof err === 'string' ? err : JSON.stringify(err))); } processExitFn(1); // If the process is still alive we should continue because either diff --git a/packages/utils/async-ora/src/ora.ts b/packages/utils/async-ora/src/ora.ts index 169dd39d64..df292c4913 100644 --- a/packages/utils/async-ora/src/ora.ts +++ b/packages/utils/async-ora/src/ora.ts @@ -1,5 +1,5 @@ /* eslint "no-console": "off" */ -import 'colors'; +import chalk from 'chalk'; import debug from 'debug'; import 'log-symbols'; import realOra from 'ora'; @@ -12,14 +12,14 @@ const d = debug('electron-forge:async-ora'); const useFakeOra = Boolean(process.env.DEBUG && process.env.DEBUG.includes('electron-forge')); if (useFakeOra) { - console.warn('WARNING: DEBUG environment variable detected. Append the electron-forge:lifecycle namespace'.red); - console.warn('to the value of DEBUG in order to view progress indicators.'.red); + console.warn(chalk.red('WARNING: DEBUG environment variable detected. Append the electron-forge:lifecycle namespace')); + console.warn(chalk.red('to the value of DEBUG in order to view progress indicators.')); } export const fakeOra = (name: string): OraImpl => { let oraName = name; let startTime: number | null = null; - const timing = () => (startTime ? `-- after ${`${prettyMs(Date.now() - startTime)}`.cyan}` : null); + const timing = () => (startTime ? `-- after ${chalk.cyan(`${prettyMs(Date.now() - startTime)}`)}` : null); const fake: OraImpl = { start: () => { startTime = Date.now(); @@ -27,7 +27,7 @@ export const fakeOra = (name: string): OraImpl => { return fake; }, fail: () => { - d(`Process Failed: ${fake.text}`.red, timing()); + d(chalk.red(`Process Failed: ${fake.text}`), timing()); return fake; }, succeed: () => { diff --git a/packages/utils/types/package.json b/packages/utils/types/package.json index a5ae5f4671..91f0f39bc2 100644 --- a/packages/utils/types/package.json +++ b/packages/utils/types/package.json @@ -10,7 +10,7 @@ "dependencies": { "@electron-forge/async-ora": "6.0.0-beta.61", "electron-packager": "^15.4.0", - "electron-rebuild": "^3.2.2", + "electron-rebuild": "^3.2.6", "ora": "^5.0.0" }, "engines": { diff --git a/tools/bump.ts b/tools/bump.ts index 70a31e8d84..7940b67a61 100755 --- a/tools/bump.ts +++ b/tools/bump.ts @@ -1,6 +1,6 @@ #!node_modules/.bin/ts-node -import 'colors'; +import chalk from 'chalk'; import * as fs from 'fs-extra'; import path from 'path'; import { spawn } from '@malept/cross-spawn-promise'; @@ -20,7 +20,7 @@ async function git(...args: string[]): Promise { async function checkCleanWorkingDir(): Promise { if ((await git('status', '--short')) !== '') { - throw 'Your working directory is not clean, please ensure you have a clean working directory before version bumping'.red; + throw chalk.red('Your working directory is not clean, please ensure you have a clean working directory before version bumping'); } } @@ -38,13 +38,13 @@ async function main(): Promise { const version = process.argv[2]; if (!version) { - throw 'Must provide a version in argv[2]'.red; + throw chalk.red('Must provide a version in argv[2]'); } if (!semver.valid(version)) { - throw `Must provide a valid semver version in argv[2]. Got ${version}`.red; + throw chalk.red(`Must provide a valid semver version in argv[2]. Got ${version}`); } - console.info(`Setting version of all dependencies: ${version.cyan}`); + console.info(`Setting version of all dependencies: ${chalk.cyan(version)}`); const { version: lastVersion } = await fs.readJson(path.join(BASE_DIR, 'package.json')); const dirsToUpdate = [BASE_DIR]; diff --git a/tools/publish.js b/tools/publish.js index c59d41ec2b..a9c32bb7d1 100644 --- a/tools/publish.js +++ b/tools/publish.js @@ -1,4 +1,4 @@ -require('colors'); +const chalk = require('chalk'); const childProcess = require('child_process'); const fs = require('fs-extra'); const path = require('path'); @@ -20,7 +20,7 @@ const prepare = new Listr([ }) .toString() !== '' ) { - throw new Error('Your working directory is not clean, please ensure you have a clean working directory before publishing'.red); + throw new Error(chalk.red('Your working directory is not clean, please ensure you have a clean working directory before publishing')); } }, }, @@ -62,14 +62,14 @@ const publisher = new Listr([ // const isBeta = version.includes('beta'); const isBeta = false; return { - title: `Publishing: ${`${name}@${version}`.cyan} (beta=${isBeta ? 'true'.green : 'false'.red})`, + title: `Publishing: ${chalk.cyan(`${name}@${version}`)} (beta=${isBeta ? chalk.green('true') : chalk.red('false')})`, task: async () => { try { await spawn('npm', ['publish', '--access=public', ...(isBeta ? ['--tag=beta'] : []), `--otp=${ctx.otp}`], { cwd: dir, }); } catch (err) { - throw new Error(`Failed to publish ${`${name}@${version}`.cyan} \n${err.stderr.toString()}`); + throw new Error(`Failed to publish ${chalk.cyan(`${name}@${version}`)} \n${err.stderr.toString()}`); } }, }; diff --git a/tools/test-dist.ts b/tools/test-dist.ts index 7c3ea92080..db5afa9d4d 100644 --- a/tools/test-dist.ts +++ b/tools/test-dist.ts @@ -1,4 +1,4 @@ -import 'colors'; +import chalk from 'chalk'; import * as fs from 'fs-extra'; import * as path from 'path'; @@ -19,11 +19,11 @@ const PACKAGES_DIR = path.resolve(BASE_DIR, 'packages'); const pj = await fs.readJson(path.resolve(dir, 'package.json')); if (pj.name === '@electron-forge/cli') continue; if (!(await fs.pathExists(path.resolve(dir, pj.main)))) { - console.error(`${`[${pj.name}]`.cyan}:`, `Main entry not found (${pj.main})`.red); + console.error(`${chalk.cyan(`[${pj.name}]`)}:`, chalk.red(`Main entry not found (${pj.main})`)); bad = true; } if (!pj.typings || !(await fs.pathExists(path.resolve(dir, pj.typings)))) { - console.error(`${`[${pj.name}]`.cyan}:`, `Typings entry not found (${pj.typings})`.red); + console.error(`${chalk.cyan(`[${pj.name}]`)}:`, chalk.red(`Typings entry not found (${pj.typings})`)); bad = true; } } diff --git a/tools/update-dependencies.js b/tools/update-dependencies.js index 1e4b81372e..37bbb77386 100755 --- a/tools/update-dependencies.js +++ b/tools/update-dependencies.js @@ -7,6 +7,7 @@ const { spawn } = require('@malept/cross-spawn-promise'); const DO_NOT_UPGRADE = [ '@types/node-fetch', // No longer needed when node-fetch is upgraded to >= 3.0.0 '@typescript-eslint/eslint-plugin', // special case + 'chalk', // Requires ESM 'commander', // TODO: convert to yargs 'find-up', // Requires ESM 'log-symbols', // Requires ESM diff --git a/yarn.lock b/yarn.lock index 2660d7051d..49d5047d4a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1967,9 +1967,9 @@ fastq "^1.6.0" "@npmcli/fs@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@npmcli/fs/-/fs-1.0.0.tgz#589612cfad3a6ea0feafcb901d29c63fd52db09f" - integrity sha512-8ltnOpRR/oJbOp8vaGUnipOi3bqkcW+sLHFlyXIr08OGHmVJLB1Hn7QtGXbYcpVtH1gAYZTlmDXtE4YV0+AMMQ== + version "1.1.0" + resolved "https://registry.yarnpkg.com/@npmcli/fs/-/fs-1.1.0.tgz#bec1d1b89c170d40e1b73ad6c943b0b75e7d2951" + integrity sha512-VhP1qZLXcrXRIaPoqb4YA55JQxLNF3jNR4T55IdOJa3+IFJKNYHtPvtXx8slmeMavj37vCzCfrqQM1vWLsYKLA== dependencies: "@gar/promisify" "^1.0.1" semver "^7.3.5" @@ -2104,9 +2104,9 @@ integrity sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ== "@sindresorhus/is@^4.0.0": - version "4.2.0" - resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-4.2.0.tgz#667bfc6186ae7c9e0b45a08960c551437176e1ca" - integrity sha512-VkE3KLBmJwcCaVARtQpfuKcKv8gcBmUubrfHGF84dXuuW6jgsRYxPtzcIhPyK9WAPpRt2/xY6zkD9MnRaJzSyw== + version "4.2.1" + resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-4.2.1.tgz#b88b5724283db80b507cd612caee9a1947412a20" + integrity sha512-BrzrgtaqEre0qfvI8sMTaEvx+bayuhPmfe2rfeUGPPHYr/PLxCOqkOe4TQTDPb+qcqgNcsAtXV/Ew74mcDIE8w== "@sinonjs/commons@^1.6.0", "@sinonjs/commons@^1.7.0", "@sinonjs/commons@^1.8.3": version "1.8.3" @@ -2388,7 +2388,12 @@ "@types/node" "*" form-data "^3.0.0" -"@types/node@*", "@types/node@^16.7.3": +"@types/node@*": + version "17.0.8" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.8.tgz#50d680c8a8a78fe30abe6906453b21ad8ab0ad7b" + integrity sha512-YofkM6fGv4gDJq78g4j0mMuGMkZVxZDgtU0JRdx6FgiJDG+0fY0GKVolOV8WqVmEhLCXkQRjwDdKyPxJp/uucg== + +"@types/node@^16.7.3": version "16.11.1" resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.1.tgz#2e50a649a50fc403433a14f829eface1a3443e97" integrity sha512-PYGcJHL9mwl1Ek3PLiYgyEKtwTMmkMw4vbiyz/ps3pfdRYLVv+SN7qHVAImrjdAXxgluDEw6Ph4lyv+m9UpRmA== @@ -2780,9 +2785,9 @@ agent-base@6, agent-base@^6.0.2: debug "4" agentkeepalive@^4.1.3: - version "4.1.4" - resolved "https://registry.yarnpkg.com/agentkeepalive/-/agentkeepalive-4.1.4.tgz#d928028a4862cb11718e55227872e842a44c945b" - integrity sha512-+V/rGa3EuU74H6wR04plBb7Ks10FbtUQgRj/FQOG7uUIEuaINI+AiqJR1k6t3SVNs7o7ZjIdus6706qqzVq8jQ== + version "4.2.0" + resolved "https://registry.yarnpkg.com/agentkeepalive/-/agentkeepalive-4.2.0.tgz#616ce94ccb41d1a39a45d203d8076fe98713062d" + integrity sha512-0PhAp58jZNw13UJv7NVdTGb0ZcghHUb3DrZ046JiiJY/BOaTTpbwdHq2VObPCBV8M2GPh7sgrJ3AQ8Ey468LJw== dependencies: debug "^4.1.0" depd "^1.1.2" @@ -2929,11 +2934,24 @@ aproba@^1.0.3: resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== +"aproba@^1.0.3 || ^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/aproba/-/aproba-2.0.0.tgz#52520b8ae5b569215b354efc0caa3fe1e45a8adc" + integrity sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ== + archy@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/archy/-/archy-1.0.0.tgz#f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40" integrity sha1-+cjBN1fMHde8N5rHeyxipcKGjEA= +are-we-there-yet@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz#372e0e7bd279d8e94c653aaa1f67200884bf3e1c" + integrity sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw== + dependencies: + delegates "^1.0.0" + readable-stream "^3.6.0" + are-we-there-yet@~1.1.2: version "1.1.7" resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz#b15474a932adab4ff8a50d9adfa7e4e926f21146" @@ -3323,7 +3341,7 @@ bytes@3.1.0: resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg== -cacache@^15.0.5: +cacache@^15.2.0: version "15.3.0" resolved "https://registry.yarnpkg.com/cacache/-/cacache-15.3.0.tgz#dc85380fb2f556fe3dda4c719bfa0ec875a7f1eb" integrity sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ== @@ -3365,7 +3383,7 @@ cacheable-request@^6.0.0: normalize-url "^4.1.0" responselike "^1.0.2" -cacheable-request@^7.0.1: +cacheable-request@^7.0.1, cacheable-request@^7.0.2: version "7.0.2" resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-7.0.2.tgz#ea0d0b889364a25854757301ca12b2da77f91d27" integrity sha512-pouW8/FmiPQbuGpkXQ9BAPv/Mo5xDGANgSNXzTzJ8DrKGuXOssM4wIQRjfanNRh3Yu5cfYPvcorqbhg2KIJtew== @@ -3716,6 +3734,11 @@ color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== +color-support@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-support/-/color-support-1.1.3.tgz#93834379a1cc9a0c61f82f52f0d04322251bd5a2" + integrity sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg== + colorette@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.4.0.tgz#5190fbb87276259a86ad700bff2c6d6faa3fca40" @@ -3731,7 +3754,7 @@ colors@1.0.x: resolved "https://registry.yarnpkg.com/colors/-/colors-1.0.3.tgz#0433f44d809680fdeb60ed260f1b0c262e82a40b" integrity sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs= -colors@^1.1.2, colors@^1.3.3, colors@^1.4.0: +colors@^1.1.2, colors@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78" integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA== @@ -3811,7 +3834,7 @@ connect-history-api-fallback@^1.6.0: resolved "https://registry.yarnpkg.com/connect-history-api-fallback/-/connect-history-api-fallback-1.6.0.tgz#8b32089359308d111115d81cad3fceab888f97bc" integrity sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg== -console-control-strings@^1.0.0, console-control-strings@~1.1.0: +console-control-strings@^1.0.0, console-control-strings@^1.1.0, console-control-strings@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= @@ -3985,10 +4008,10 @@ debug@2.6.9, debug@^2.1.3, debug@^2.2.0, debug@^2.6.8, debug@^2.6.9: dependencies: ms "2.0.0" -debug@4, debug@4.3.2, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2: - version "4.3.2" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b" - integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw== +debug@4, debug@^4.1.0, debug@^4.1.1: + version "4.3.3" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.3.tgz#04266e0b70a98d4462e6e288e38259213332b664" + integrity sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q== dependencies: ms "2.1.2" @@ -3999,6 +4022,13 @@ debug@4.3.1: dependencies: ms "2.1.2" +debug@4.3.2, debug@^4.0.1, debug@^4.3.1, debug@^4.3.2: + version "4.3.2" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b" + integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw== + dependencies: + ms "2.1.2" + debug@^3.1.0, debug@^3.1.1, debug@^3.2.7: version "3.2.7" resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" @@ -4402,22 +4432,23 @@ electron-packager@^15.4.0: semver "^7.1.3" yargs-parser "^20.0.0" -electron-rebuild@^3.2.2: - version "3.2.3" - resolved "https://registry.yarnpkg.com/electron-rebuild/-/electron-rebuild-3.2.3.tgz#2c0b06b7b1a5240fec96f1d368d04222e2590c3d" - integrity sha512-9oxNmKlDCaf651c+yJWCDIBpF6A9aY+wQtasLEeR5AsPYPuOKEX6xHnC2+WgCLOC94JEpCZznecyC84fbwZq4A== +electron-rebuild@^3.2.6: + version "3.2.6" + resolved "https://registry.yarnpkg.com/electron-rebuild/-/electron-rebuild-3.2.6.tgz#d71b914b21822b0fc7222369935d6674c3342a54" + integrity sha512-oVAouqlW1IJivSKrw+ahTIGhLoH2GQiiIwPcZGAPt6ZnynsROG31jpSLDlE5veAiD91szbpaVT4qhU5oGbrsKA== dependencies: "@malept/cross-spawn-promise" "^2.0.0" - colors "^1.3.3" + chalk "^4.0.0" debug "^4.1.1" detect-libc "^1.0.3" fs-extra "^10.0.0" got "^11.7.0" lzma-native "^8.0.1" - node-abi "^2.19.2" + node-abi "^3.0.0" node-api-version "^0.1.4" - node-gyp "^8.1.0" + node-gyp "^8.4.0" ora "^5.1.0" + semver "^7.3.5" tar "^6.0.5" yargs "^17.0.1" @@ -5512,6 +5543,21 @@ gar@^1.0.4: resolved "https://registry.yarnpkg.com/gar/-/gar-1.0.4.tgz#f777bc7db425c0572fdeb52676172ca1ae9888b8" integrity sha512-w4n9cPWyP7aHxKxYHFQMegj7WIAsL/YX/C4Bs5Rr8s1H9M1rNtRWRsw+ovYMkXDQ5S4ZbYHsHAPmevPjPgw44w== +gauge@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/gauge/-/gauge-4.0.0.tgz#afba07aa0374a93c6219603b1fb83eaa2264d8f8" + integrity sha512-F8sU45yQpjQjxKkm1UOAhf0U/O0aFt//Fl7hsrNVto+patMHjs7dPI9mFOGUKbhrgKm0S3EjW3scMFuQmWSROw== + dependencies: + ansi-regex "^5.0.1" + aproba "^1.0.3 || ^2.0.0" + color-support "^1.1.2" + console-control-strings "^1.0.0" + has-unicode "^2.0.1" + signal-exit "^3.0.0" + string-width "^4.2.3" + strip-ansi "^6.0.1" + wide-align "^1.1.2" + gauge@~2.7.3: version "2.7.4" resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" @@ -5789,7 +5835,24 @@ globby@^11.0.1, globby@^11.0.3: merge2 "^1.3.0" slash "^3.0.0" -got@^11.7.0, got@^11.8.2: +got@^11.7.0: + version "11.8.3" + resolved "https://registry.yarnpkg.com/got/-/got-11.8.3.tgz#f496c8fdda5d729a90b4905d2b07dbd148170770" + integrity sha512-7gtQ5KiPh1RtGS9/Jbv1ofDpBFuq42gyfEib+ejaRBJuj/3tQFeR5+gw57e4ipaU8c/rCjvX6fkQz2lyDlGAOg== + dependencies: + "@sindresorhus/is" "^4.0.0" + "@szmarczak/http-timer" "^4.0.5" + "@types/cacheable-request" "^6.0.1" + "@types/responselike" "^1.0.0" + cacheable-lookup "^5.0.3" + cacheable-request "^7.0.2" + decompress-response "^6.0.0" + http2-wrapper "^1.0.0-beta.5.2" + lowercase-keys "^2.0.0" + p-cancelable "^2.0.0" + responselike "^2.0.0" + +got@^11.8.2: version "11.8.2" resolved "https://registry.yarnpkg.com/got/-/got-11.8.2.tgz#7abb3959ea28c31f3576f1576c1effce23f33599" integrity sha512-D0QywKgIe30ODs+fm8wMZiAcZjypcCodPNuMz5H9Mny7RJ+IjJ10BdmGW7OM7fHXP+O7r6ZwapQ/YQmMSvB0UQ== @@ -5823,11 +5886,16 @@ got@^9.6.0: to-readable-stream "^1.0.0" url-parse-lax "^3.0.0" -graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@^4.2.0, graceful-fs@^4.2.4, graceful-fs@^4.2.6: +graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@^4.2.0, graceful-fs@^4.2.4: version "4.2.8" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.8.tgz#e412b8d33f5e006593cbd3cee6df9f2cebbe802a" integrity sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg== +graceful-fs@^4.2.6: + version "4.2.9" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.9.tgz#041b05df45755e587a24942279b9d113146e1c96" + integrity sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ== + growl@1.10.5: version "1.10.5" resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" @@ -5885,7 +5953,7 @@ has-tostringtag@^1.0.0: dependencies: has-symbols "^1.0.2" -has-unicode@^2.0.0: +has-unicode@^2.0.0, has-unicode@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" integrity sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk= @@ -6814,9 +6882,9 @@ keyv@^3.0.0: json-buffer "3.0.0" keyv@^4.0.0: - version "4.0.3" - resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.0.3.tgz#4f3aa98de254803cafcd2896734108daa35e4254" - integrity sha512-zdGa2TOpSZPq5mU6iowDARnMBZgtCqJ11dJROFi6tg6kTn4nuUdU09lFyLFSaHrWqpIJ+EBq4E8/Dc0Vx5vLdA== + version "4.0.5" + resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.0.5.tgz#bb12b467aba372fab2a44d4420c00d3c4ebd484c" + integrity sha512-531pkGLqV3BMg0eDqqJFI0R1mkK1Nm5xIP2mM6keP5P8WfFtCkg2IOwplTUmlGoTgIg9yQYZ/kdihhz89XH3vA== dependencies: json-buffer "3.0.1" @@ -7174,13 +7242,13 @@ make-error@^1.1.1: resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== -make-fetch-happen@^8.0.14: - version "8.0.14" - resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-8.0.14.tgz#aaba73ae0ab5586ad8eaa68bd83332669393e222" - integrity sha512-EsS89h6l4vbfJEtBZnENTOFk8mCRpY5ru36Xe5bcX1KYIli2mkSHqoFsp5O1wMDvTJJzxe/4THpCTtygjeeGWQ== +make-fetch-happen@^9.1.0: + version "9.1.0" + resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-9.1.0.tgz#53085a09e7971433e6765f7971bf63f4e05cb968" + integrity sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg== dependencies: agentkeepalive "^4.1.3" - cacache "^15.0.5" + cacache "^15.2.0" http-cache-semantics "^4.1.0" http-proxy-agent "^4.0.1" https-proxy-agent "^5.0.0" @@ -7191,8 +7259,9 @@ make-fetch-happen@^8.0.14: minipass-fetch "^1.3.2" minipass-flush "^1.0.5" minipass-pipeline "^1.2.4" + negotiator "^0.6.2" promise-retry "^2.0.1" - socks-proxy-agent "^5.0.0" + socks-proxy-agent "^6.0.0" ssri "^8.0.0" map-age-cleaner@^0.1.1: @@ -7385,9 +7454,9 @@ minipass-sized@^1.0.3: minipass "^3.0.0" minipass@^3.0.0, minipass@^3.1.0, minipass@^3.1.1, minipass@^3.1.3: - version "3.1.5" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-3.1.5.tgz#71f6251b0a33a49c01b3cf97ff77eda030dff732" - integrity sha512-+8NzxD82XQoNKNrl1d/FSi+X8wAEWR+sbYAfIvub4Nz0d22plFG72CEVVaufV8PNf4qSslFTD8VMOxNVhHCjTw== + version "3.1.6" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-3.1.6.tgz#3b8150aa688a711a1521af5e8779c1d3bb4f45ee" + integrity sha512-rty5kpw9/z8SX9dmxblFA6edItUmwJgMeYDZRrwlIVN27i8gysGbznJwUggw2V/FVqFSDdWy040ZPS811DYAqQ== dependencies: yallist "^4.0.0" @@ -7556,7 +7625,7 @@ natural-compare@^1.4.0: resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= -negotiator@0.6.2: +negotiator@0.6.2, negotiator@^0.6.2: version "0.6.2" resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== @@ -7595,12 +7664,12 @@ no-case@^3.0.4: lower-case "^2.0.2" tslib "^2.0.3" -node-abi@^2.19.2: - version "2.30.1" - resolved "https://registry.yarnpkg.com/node-abi/-/node-abi-2.30.1.tgz#c437d4b1fe0e285aaf290d45b45d4d7afedac4cf" - integrity sha512-/2D0wOQPgaUWzVSVgRMx+trKJRC2UG4SUc4oCJoXx9Uxjtp0Vy3/kt7zcbxHF8+Z/pK3UloLWzBISg72brfy1w== +node-abi@^3.0.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/node-abi/-/node-abi-3.5.0.tgz#26e8b7b251c3260a5ac5ba5aef3b4345a0229248" + integrity sha512-LtHvNIBgOy5mO8mPEUtkCW/YCRWYEKshIvqhe1GHHyXEHEB5mgICyYnAcl4qan3uFeRROErKGzatFHPf6kDxWw== dependencies: - semver "^5.4.1" + semver "^7.3.5" node-addon-api@^3.1.0: version "3.2.1" @@ -7638,17 +7707,17 @@ node-gyp-build@^4.2.1: resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.3.0.tgz#9f256b03e5826150be39c764bf51e993946d71a3" integrity sha512-iWjXZvmboq0ja1pUGULQBexmxq8CV4xBhX7VDOTbL7ZR4FOowwY/VOtRxBN/yKxmdGoIp4j5ysNT4u3S2pDQ3Q== -node-gyp@^8.1.0: - version "8.2.0" - resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-8.2.0.tgz#ef509ccdf5cef3b4d93df0690b90aa55ff8c7977" - integrity sha512-KG8SdcoAnw2d6augGwl1kOayALUrXW/P2uOAm2J2+nmW/HjZo7y+8TDg7LejxbekOOSv3kzhq+NSUYkIDAX8eA== +node-gyp@^8.4.0: + version "8.4.1" + resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-8.4.1.tgz#3d49308fc31f768180957d6b5746845fbd429937" + integrity sha512-olTJRgUtAb/hOXG0E93wZDs5YiJlgbXxTwQAFHyNlRsXQnYzUaF2aGgujZbw+hR8aF4ZG/rST57bWMWD16jr9w== dependencies: env-paths "^2.2.0" glob "^7.1.4" graceful-fs "^4.2.6" - make-fetch-happen "^8.0.14" + make-fetch-happen "^9.1.0" nopt "^5.0.0" - npmlog "^4.1.2" + npmlog "^6.0.0" rimraf "^3.0.2" semver "^7.3.5" tar "^6.1.2" @@ -7740,6 +7809,16 @@ npmlog@^4.1.2: gauge "~2.7.3" set-blocking "~2.0.0" +npmlog@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-6.0.0.tgz#ba9ef39413c3d936ea91553db7be49c34ad0520c" + integrity sha512-03ppFRGlsyUaQFbGC2C8QWJN/C/K7PsfyD9aQdhVKAQIH4sQBc8WASqFBP7O+Ut4d2oo5LoeoboB3cGdBZSp6Q== + dependencies: + are-we-there-yet "^2.0.0" + console-control-strings "^1.1.0" + gauge "^4.0.0" + set-blocking "^2.0.0" + nth-check@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-2.0.1.tgz#2efe162f5c3da06a28959fbd3db75dbeea9f0fc2" @@ -9005,7 +9084,7 @@ semver-compare@^1.0.0: resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc" integrity sha1-De4hahyUGrN+nvsXiPavxf9VN/w= -"semver@2 || 3 || 4 || 5", semver@^5.4.1, semver@^5.5.0, semver@^5.6.0: +"semver@2 || 3 || 4 || 5", semver@^5.5.0, semver@^5.6.0: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== @@ -9154,7 +9233,12 @@ side-channel@^1.0.4: get-intrinsic "^1.0.2" object-inspect "^1.9.0" -signal-exit@^3.0.0, signal-exit@^3.0.2, signal-exit@^3.0.3: +signal-exit@^3.0.0, signal-exit@^3.0.2: + version "3.0.6" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.6.tgz#24e630c4b0f03fea446a2bd299e62b4a6ca8d0af" + integrity sha512-sDl4qMFpijcGw22U5w63KmD3cZJfBuFlVNbVMKje2keoKML7X2UzWbc4XrmEbDwg0NXJc3yv4/ox7b+JWb57kQ== + +signal-exit@^3.0.3: version "3.0.5" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.5.tgz#9e3e8cc0c75a99472b44321033a7702e7738252f" integrity sha512-KWcOiKeQj6ZyXx7zq4YxSMgHRlod4czeBQZrPb8OKcohcqAXShm7E20kEMle9WBt26hFcAf0qLOcp5zmY7kOqQ== @@ -9230,16 +9314,16 @@ sockjs@^0.3.21: uuid "^3.4.0" websocket-driver "^0.7.4" -socks-proxy-agent@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-5.0.1.tgz#032fb583048a29ebffec2e6a73fca0761f48177e" - integrity sha512-vZdmnjb9a2Tz6WEQVIurybSwElwPxMZaIc7PzqbJTrezcKNznv6giT7J7tZDZ1BojVaa1jvO/UiUdhDVB0ACoQ== +socks-proxy-agent@^6.0.0: + version "6.1.1" + resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-6.1.1.tgz#e664e8f1aaf4e1fb3df945f09e3d94f911137f87" + integrity sha512-t8J0kG3csjA4g6FTbsMOWws+7R7vuRC8aQ/wy3/1OWmsgwA68zs/+cExQ0koSitUDXqhufF/YJr9wtNMZHw5Ew== dependencies: agent-base "^6.0.2" - debug "4" - socks "^2.3.3" + debug "^4.3.1" + socks "^2.6.1" -socks@^2.3.3: +socks@^2.6.1: version "2.6.1" resolved "https://registry.yarnpkg.com/socks/-/socks-2.6.1.tgz#989e6534a07cf337deb1b1c94aaa44296520d30e" integrity sha512-kLQ9N5ucj8uIcxrDwjm0Jsqk06xdpBjGNQtpXy4Q8/QY2k+fY7nZH8CARy+hkbG+SGAovmzzuauCpBlb8FrnBA== @@ -10305,7 +10389,7 @@ wide-align@1.1.3: dependencies: string-width "^1.0.2 || 2" -wide-align@^1.1.0: +wide-align@^1.1.0, wide-align@^1.1.2: version "1.1.5" resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.5.tgz#df1d4c206854369ecf3c9a4898f1b23fbd9d15d3" integrity sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg== @@ -10478,6 +10562,11 @@ yargs-parser@^20.0.0, yargs-parser@^20.2.2: resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== +yargs-parser@^21.0.0: + version "21.0.0" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.0.0.tgz#a485d3966be4317426dd56bdb6a30131b281dc55" + integrity sha512-z9kApYUOCwoeZ78rfRYYWdiU/iNL6mwwYlkkZfJoyMR1xps+NEBX5X7XmRpxkZHhXJ6+Ey00IwKxBBSW9FIjyA== + yargs-unparser@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-2.0.0.tgz#f131f9226911ae5d9ad38c432fe809366c2325eb" @@ -10519,17 +10608,17 @@ yargs@^15.0.1, yargs@^15.0.2: yargs-parser "^18.1.2" yargs@^17.0.1: - version "17.2.1" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.2.1.tgz#e2c95b9796a0e1f7f3bf4427863b42e0418191ea" - integrity sha512-XfR8du6ua4K6uLGm5S6fA+FIJom/MdJcFNVY8geLlp2v8GYbOXD4EB1tPNZsRn4vBzKGMgb5DRZMeWuFc2GO8Q== + version "17.3.1" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.3.1.tgz#da56b28f32e2fd45aefb402ed9c26f42be4c07b9" + integrity sha512-WUANQeVgjLbNsEmGk20f+nlHgOqzRFpiGWVaBrYGYIGANIIu3lWjoyi0fNlFmJkvfhCZ6BXINe7/W2O2bV4iaA== dependencies: cliui "^7.0.2" escalade "^3.1.1" get-caller-file "^2.0.5" require-directory "^2.1.1" - string-width "^4.2.0" + string-width "^4.2.3" y18n "^5.0.5" - yargs-parser "^20.2.2" + yargs-parser "^21.0.0" yarn-or-npm@^3.0.1: version "3.0.1"