From 9a89ae761661599d055c830066c959d171e6921d Mon Sep 17 00:00:00 2001 From: mshanemc Date: Wed, 3 Jan 2024 09:08:23 -0600 Subject: [PATCH 01/16] feat!: use current inquirer BREAKING CHANGE: ESM-only BREAKING CHANGE: removes cross-cloud hooks (deployer, deauthorizer, etc) BREAKING CHANGE: removes Prompter module BREAKING CHANGE: remove option to barrel-import from Ux --- .mocharc.json | 5 +- LICENSE.txt | 2 +- README.md | 6 +- package.json | 39 +- src/compatibility.ts | 6 +- src/deauthorizer.ts | 50 -- src/deployer.ts | 110 ---- src/errorFormatting.ts | 56 ++ src/exported.ts | 41 +- src/flags/duration.ts | 2 +- src/flags/flags.ts | 30 ++ src/flags/orgApiVersion.ts | 2 +- src/flags/orgFlags.ts | 2 +- src/flags/salesforceId.ts | 2 +- src/hooks.ts | 57 -- src/prompts.ts | 45 ++ src/sfCommand.ts | 228 ++------ src/sfCommandNamespace.ts | 32 ++ src/stubUx.ts | 10 +- src/types/index.ts | 137 ----- src/util.ts | 8 +- src/ux/base.ts | 2 +- src/ux/index.ts | 12 - src/ux/progress.ts | 2 +- src/ux/prompter.ts | 132 ----- src/ux/spinner.ts | 2 +- src/ux/standardColors.ts | 15 + src/ux/ux.ts | 7 +- test/tsconfig.json | 2 +- test/unit/flags/apiVersion.test.ts | 6 +- test/unit/flags/duration.test.ts | 4 +- test/unit/flags/id.test.ts | 4 +- test/unit/flags/orgFlags.test.ts | 6 +- test/unit/sfCommand.test.ts | 7 +- test/unit/stubUx.test.ts | 4 +- test/unit/util.test.ts | 4 +- test/unit/ux/progress.test.ts | 4 +- test/unit/ux/prompter.test.ts | 49 -- test/unit/ux/spinner.test.ts | 4 +- test/unit/ux/ux.test.ts | 4 +- tsconfig.json | 2 +- yarn.lock | 816 ++++++++++++++++------------- 42 files changed, 768 insertions(+), 1190 deletions(-) delete mode 100644 src/deauthorizer.ts delete mode 100644 src/deployer.ts create mode 100644 src/errorFormatting.ts create mode 100644 src/flags/flags.ts delete mode 100644 src/hooks.ts create mode 100644 src/prompts.ts create mode 100644 src/sfCommandNamespace.ts delete mode 100644 src/types/index.ts delete mode 100644 src/ux/index.ts delete mode 100644 src/ux/prompter.ts create mode 100644 src/ux/standardColors.ts delete mode 100644 test/unit/ux/prompter.test.ts diff --git a/.mocharc.json b/.mocharc.json index 02d8c6c8..814da5d4 100644 --- a/.mocharc.json +++ b/.mocharc.json @@ -1,8 +1,9 @@ { - "require": "test/init.js, ts-node/register, source-map-support/register", + "require": "ts-node/register", "watch-extensions": ["ts", "md"], "watch-files": ["src", "test", "messages"], "recursive": true, "reporter": "spec", - "timeout": 5000 + "timeout": 5000, + "node-option": ["loader=ts-node/esm"] } diff --git a/LICENSE.txt b/LICENSE.txt index f2cee7bb..6cfd8734 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,4 +1,4 @@ -Copyright (c) 2023, Salesforce.com, Inc. +Copyright (c) 2024, Salesforce.com, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/README.md b/README.md index bb4b040a..134f8c7e 100644 --- a/README.md +++ b/README.md @@ -17,9 +17,7 @@ The SfCommand abstract class extends [@oclif/core's Command class](https://githu - Enables additional help sections to the standard oclif command help output - Provides access to the [cli-ux cli actions](https://github.com/oclif/cli-ux#cliaction). This avoids having to import that interface from cli-ux and manually handling the `--json` flag. -## Prompter Class - -A general purpose class that prompts a user for information. See [inquirer NPM Module](https://www.npmjs.com/package/inquirer) for more information. +## Prompts ## Flags @@ -29,7 +27,7 @@ Flags is a convenience reference to [@oclif/core#Flags](https://github.com/oclif These flags can be imported into a command and used like any other flag. See code examples in the links -- [orgApiVersionFlag](src/flags/apiVersion.ts) +- [orgApiVersionFlag](src/flags/orgApiVersion.ts) - specifies a Salesforce API version. - reads from Config (if available) - validates version is still active diff --git a/package.json b/package.json index 44610cb9..a9d875c7 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "description": "Utils for writing Salesforce CLI plugins", "main": "lib/exported", "types": "lib/exported.d.ts", + "type": "module", "license": "BSD-3-Clause", "scripts": { "build": "wireit", @@ -12,6 +13,7 @@ "compile": "wireit", "docs": "sf-docs", "format": "wireit", + "link-check": "wireit", "lint": "wireit", "lint-fix": "yarn sf-lint --fix", "postcompile": "tsc -p test", @@ -20,6 +22,13 @@ "test": "wireit", "test:only": "wireit" }, + "exports": { + "./SfCommand": "./lib/SfCommand.js", + "./Flags": "./lib/flags/flags.js", + "./Ux": "./lib/ux/ux.js", + "./StandardColors": "./lib/ux/standardColors.js", + ".": "./lib/exported.js" + }, "repository": "salesforcecli/sf-plugins-core", "bugs": { "url": "https://github.com/salesforcecli/sf-plugins-core/issues" @@ -34,22 +43,20 @@ "node": ">=18.0.0" }, "dependencies": { + "@inquirer/confirm": "^2.0.15", + "@inquirer/password": "^1.1.14", "@oclif/core": "^3.14.1", - "@salesforce/core": "^6.2.2", + "@salesforce/core": "^6.4.1", "@salesforce/kit": "^3.0.15", "@salesforce/ts-types": "^2.0.9", - "@types/inquirer": "^8.2.3", - "chalk": "^4", - "inquirer": "^8.2.5" + "chalk": "^5.3.0" }, "devDependencies": { - "@oclif/test": "^3.1.3", - "@salesforce/dev-scripts": "^7.1.1", - "eslint-plugin-sf-plugin": "^1.16.15", - "shelljs": "0.8.5", - "strip-ansi": "6.0.1", + "@inquirer/type": "^1.1.5", + "@salesforce/dev-scripts": "^8.1.2", + "eslint-plugin-sf-plugin": "^1.17.0", "ts-node": "^10.9.2", - "typescript": "^4.9.5" + "typescript": "^5.3.3" }, "publishConfig": { "access": "public" @@ -107,7 +114,8 @@ "test": { "dependencies": [ "test:only", - "test:compile" + "test:compile", + "link-check" ] }, "test:only": { @@ -124,6 +132,15 @@ ".nycrc" ], "output": [] + }, + "link-check": { + "command": "node -e \"process.exit(process.env.CI ? 0 : 1)\" || linkinator \"**/*.md\" --skip \"CHANGELOG.md|node_modules|test/|confluence.internal.salesforce.com|%s\" --markdown --retry --directory-listing --verbosity error", + "files": [ + "./*.md", + "./!(CHANGELOG).md", + "messages/**/*.md" + ], + "output": [] } } } diff --git a/src/compatibility.ts b/src/compatibility.ts index 36841afd..19bef633 100644 --- a/src/compatibility.ts +++ b/src/compatibility.ts @@ -7,8 +7,8 @@ import { Flags } from '@oclif/core'; import { Lifecycle, Messages } from '@salesforce/core'; -import { orgApiVersionFlag } from './flags/orgApiVersion'; -import { optionalHubFlag, optionalOrgFlag, requiredHubFlag, requiredOrgFlag } from './flags/orgFlags'; +import { orgApiVersionFlag } from './flags/orgApiVersion.js'; +import { optionalHubFlag, optionalOrgFlag, requiredHubFlag, requiredOrgFlag } from './flags/orgFlags.js'; /** * Adds an alias for the deprecated sfdx-style "apiversion" and provides a warning if it is used @@ -31,7 +31,7 @@ export const orgApiVersionFlagWithDeprecations = orgApiVersionFlag({ deprecateAliases: true, }); -Messages.importMessagesDirectory(__dirname); +Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); const messages = Messages.loadMessages('@salesforce/sf-plugins-core', 'messages'); /** * Use only for commands that maintain sfdx compatibility. diff --git a/src/deauthorizer.ts b/src/deauthorizer.ts deleted file mode 100644 index 393c7791..00000000 --- a/src/deauthorizer.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2022, salesforce.com, inc. - * All rights reserved. - * Licensed under the BSD 3-Clause license. - * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause - */ - -import { JsonMap } from '@salesforce/ts-types'; - -/** - * The Deauthorizer is an abstract class that is used to implement a concrete implementation of deauthorizing an environment. - */ -export abstract class Deauthorizer { - public async removeAll(): Promise { - const result = { - successes: [], - failures: [], - } as Deauthorizer.Result; - - const environments = await this.find(); - for (const id of Object.keys(environments)) { - try { - // avoid configFile collision bug - // eslint-disable-next-line no-await-in-loop - await this.remove(id); - result.successes.push(id); - } catch { - result.failures.push(id); - } - } - return result; - } - - /** - * This method should return a list of all the environments a deauthorizer could deauthorize. - */ - public abstract find(): Promise>; - - /** - * This method should deauthorize an environment. - */ - public abstract remove(id: string): Promise; -} - -export namespace Deauthorizer { - export type Result = { - successes: string[]; - failures: string[]; - }; -} diff --git a/src/deployer.ts b/src/deployer.ts deleted file mode 100644 index b713f231..00000000 --- a/src/deployer.ts +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) 2022, salesforce.com, inc. - * All rights reserved. - * Licensed under the BSD 3-Clause license. - * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause - */ -/* eslint-disable @typescript-eslint/explicit-member-accessibility */ - -import { EventEmitter } from 'node:events'; -import { AnyJson, JsonMap } from '@salesforce/ts-types'; -import { QuestionCollection, Answers } from 'inquirer'; -import { ux } from '@oclif/core'; -import { Prompter } from './ux'; - -export type DeployerResult = { - exitCode: number; -}; - -export abstract class Deployable { - abstract getName(): string; - abstract getType(): string; - abstract getPath(): string; - abstract getParent(): Deployer; -} - -/** - * Interface for deploying Deployables. - */ -export abstract class Deployer extends EventEmitter { - /** - * Deployables are individual pieces that can be deployed on their own. For example, - * each package in a salesforce project is considered a deployable that can be deployed - * on its own. - */ - public deployables: Deployable[] = []; - private prompter = new Prompter(); - - /** - * Method for displaying deploy progress to the user - */ - // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function, class-methods-use-this - public progress(current: number, total: number, message: string): void {} - - /** - * Log messages to the console - */ - // eslint-disable-next-line class-methods-use-this - public log(msg?: string | undefined, ...args: string[]): void { - ux.log(msg, ...args); - } - - /** - * Prompt user for additional information - */ - public async prompt(questions: QuestionCollection, initialAnswers?: Partial): Promise { - const answers = await this.prompter.prompt(questions, initialAnswers); - return answers; - } - - /** - * Overwrite the deployables property on the class. - */ - public selectDeployables(deployables: Deployable[]): void { - this.deployables = Object.assign([], deployables); - } - - /** - * The human readable name of the deployer - */ - public abstract getName(): string; - - /** - * Perform any initialization or setup. This is the time to prompt the - * user for any needed information. - * - * If options are passed it, it should use those instead of prompting the for the passed in information - * - * Uses the returned dictionary as the information to store in the deploy-options.json file. - */ - public abstract setup(flags: Deployer.Flags, options: Deployer.Options): Promise; - - /** - * Deploy the app. - */ - public abstract deploy(): Promise; -} - -export namespace Deployer { - export type Flags = { - interactive: boolean; - }; - - /** - * This interface represents the aggregation of all deployer options, e.g. - * - * @example - * ``` - * { - * 'Salesforce Apps': { - * testLevel: 'RunLocalTests', - * apps: ['force-app'], - * }, - * 'Salesforce Functions': { username: 'user@salesforce.com' }, - * } - * ``` - */ - export type Options = JsonMap & { - [key: string]: T | undefined; - }; -} diff --git a/src/errorFormatting.ts b/src/errorFormatting.ts new file mode 100644 index 00000000..d4609a75 --- /dev/null +++ b/src/errorFormatting.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2023, salesforce.com, inc. + * All rights reserved. + * Licensed under the BSD 3-Clause license. + * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause + */ + +import { Mode, Messages, envVars } from '@salesforce/core'; +import chalk from 'chalk'; +import { StandardColors } from './exported.js'; +import { SfCommand } from './sfCommandNamespace.js'; + +Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); +const messages = Messages.loadMessages('@salesforce/sf-plugins-core', 'messages'); + +/** + * Format errors and actions for human consumption. Adds 'Error ():', + * When there are actions, we add 'Try this:' in blue + * followed by each action in red on its own line. + * If Error.code is present it is output last in parentheses + * + * @returns {string} Returns decorated messages. + */ + +/** + * Utility function to format actions lines + * + * @param actions + * @param options + * @private + */ +export const formatActions = ( + actions: string[], + options: { actionColor: typeof chalk } = { actionColor: StandardColors.info } +): string[] => + actions.length + ? [ + `\n${StandardColors.info(messages.getMessage('actions.tryThis'))}\n`, + ...actions.map((a) => `${options.actionColor(a)}`), + ] + : []; + +export const formatError = (error: SfCommand.Error): string => + [ + `${formatErrorPrefix(error)} ${error.message}`, + ...formatActions(error.actions ?? []), + error.stack && envVars.getString('SF_ENV') === Mode.DEVELOPMENT + ? StandardColors.info(`\n*** Internal Diagnostic ***\n\n${error.stack}\n******\n`) + : [], + ].join('\n'); + +const formatErrorPrefix = (error: SfCommand.Error): string => + `${StandardColors.error(messages.getMessage('error.prefix', [formatErrorCode(error)]))}`; + +const formatErrorCode = (error: SfCommand.Error): string => + typeof error.code === 'string' || typeof error.code === 'number' ? ` (${error.code})` : ''; diff --git a/src/exported.ts b/src/exported.ts index 6b906215..c2392aa8 100644 --- a/src/exported.ts +++ b/src/exported.ts @@ -5,36 +5,13 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { Flags as OclifFlags } from '@oclif/core'; +export { toHelpSection, parseVarArgs } from './util.js'; +export { Progress } from './ux/progress.js'; +export { Spinner } from './ux/spinner.js'; +export { Ux } from './ux/ux.js'; +export { StandardColors } from './ux/standardColors.js'; -export { toHelpSection, parseVarArgs } from './util'; -export { Deployable, Deployer, DeployerResult } from './deployer'; -export { Deauthorizer } from './deauthorizer'; -export { Progress, Prompter, generateTableChoices, Ux, Spinner, Separator } from './ux'; -export { SfHook } from './hooks'; -export * from './types'; -export { SfCommand, SfCommandInterface, StandardColors } from './sfCommand'; -export * from './compatibility'; -export * from './stubUx'; -// custom flags -import { requiredOrgFlag, requiredHubFlag, optionalOrgFlag, optionalHubFlag } from './flags/orgFlags'; -import { salesforceIdFlag } from './flags/salesforceId'; -import { orgApiVersionFlag } from './flags/orgApiVersion'; -import { durationFlag } from './flags/duration'; - -export const Flags = { - boolean: OclifFlags.boolean, - directory: OclifFlags.directory, - file: OclifFlags.file, - integer: OclifFlags.integer, - string: OclifFlags.string, - url: OclifFlags.url, - custom: OclifFlags.custom, - duration: durationFlag, - salesforceId: salesforceIdFlag, - orgApiVersion: orgApiVersionFlag, - requiredOrg: requiredOrgFlag, - requiredHub: requiredHubFlag, - optionalOrg: optionalOrgFlag, - optionalHub: optionalHubFlag, -}; +export { SfCommand, SfCommandInterface } from './sfCommand.js'; +export * from './compatibility.js'; +export * from './stubUx.js'; +export { Flags } from './flags/flags.js'; diff --git a/src/flags/duration.ts b/src/flags/duration.ts index aa9c0f78..7cf1a4a9 100644 --- a/src/flags/duration.ts +++ b/src/flags/duration.ts @@ -8,7 +8,7 @@ import { Flags } from '@oclif/core'; import { Messages } from '@salesforce/core'; import { Duration } from '@salesforce/kit'; -Messages.importMessagesDirectory(__dirname); +Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); const messages = Messages.loadMessages('@salesforce/sf-plugins-core', 'messages'); type DurationUnit = Lowercase; diff --git a/src/flags/flags.ts b/src/flags/flags.ts new file mode 100644 index 00000000..480837b4 --- /dev/null +++ b/src/flags/flags.ts @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2023, salesforce.com, inc. + * All rights reserved. + * Licensed under the BSD 3-Clause license. + * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause + */ +import { Flags as OclifFlags } from '@oclif/core'; + +// custom flags +import { requiredOrgFlag, requiredHubFlag, optionalOrgFlag, optionalHubFlag } from './orgFlags.js'; +import { salesforceIdFlag } from './salesforceId.js'; +import { orgApiVersionFlag } from './orgApiVersion.js'; +import { durationFlag } from './duration.js'; + +export const Flags = { + boolean: OclifFlags.boolean, + directory: OclifFlags.directory, + file: OclifFlags.file, + integer: OclifFlags.integer, + string: OclifFlags.string, + url: OclifFlags.url, + custom: OclifFlags.custom, + duration: durationFlag, + salesforceId: salesforceIdFlag, + orgApiVersion: orgApiVersionFlag, + requiredOrg: requiredOrgFlag, + requiredHub: requiredHubFlag, + optionalOrg: optionalOrgFlag, + optionalHub: optionalHubFlag, +}; diff --git a/src/flags/orgApiVersion.ts b/src/flags/orgApiVersion.ts index 4811e284..56cf1305 100644 --- a/src/flags/orgApiVersion.ts +++ b/src/flags/orgApiVersion.ts @@ -7,7 +7,7 @@ import { Flags } from '@oclif/core'; import { Messages, Lifecycle, OrgConfigProperties, validateApiVersion } from '@salesforce/core'; -Messages.importMessagesDirectory(__dirname); +Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); const messages = Messages.loadMessages('@salesforce/sf-plugins-core', 'messages'); // versions below this are retired diff --git a/src/flags/orgFlags.ts b/src/flags/orgFlags.ts index b0981a6f..5a70d286 100644 --- a/src/flags/orgFlags.ts +++ b/src/flags/orgFlags.ts @@ -7,7 +7,7 @@ import { Flags } from '@oclif/core'; import { ConfigAggregator, Messages, Org, OrgConfigProperties } from '@salesforce/core'; -Messages.importMessagesDirectory(__dirname); +Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); const messages = Messages.loadMessages('@salesforce/sf-plugins-core', 'messages'); export async function maybeGetOrg(input: string): Promise; diff --git a/src/flags/salesforceId.ts b/src/flags/salesforceId.ts index 1c569537..92671a8b 100644 --- a/src/flags/salesforceId.ts +++ b/src/flags/salesforceId.ts @@ -7,7 +7,7 @@ import { Flags } from '@oclif/core'; import { Messages, validateSalesforceId } from '@salesforce/core'; -Messages.importMessagesDirectory(__dirname); +Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); const messages = Messages.loadMessages('@salesforce/sf-plugins-core', 'messages'); export type IdFlagConfig = { diff --git a/src/hooks.ts b/src/hooks.ts deleted file mode 100644 index ee80274f..00000000 --- a/src/hooks.ts +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2022, salesforce.com, inc. - * All rights reserved. - * Licensed under the BSD 3-Clause license. - * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause - */ - -import { Config } from '@oclif/core/lib/interfaces/config'; -import { Hook, Hooks } from '@oclif/core/lib/interfaces/hooks'; -import { Duration, env } from '@salesforce/kit'; -import { ux } from '@oclif/core'; -import { Deployer } from './deployer'; -import { EnvList, EnvDisplay, JsonObject, Deploy, Login, Logout } from './types'; -import { Deauthorizer } from './deauthorizer'; - -/** - * Interface that defines the well known Unified CLI command hooks. - */ -interface SfHooks extends Hooks { - 'sf:env:list': EnvList.HookMeta; - 'sf:env:display': EnvDisplay.HookMeta; - 'sf:deploy': Deploy.HookMeta; - 'sf:login': Login.HookMeta; - 'sf:logout': Logout.HookMeta; -} - -type GenericHook = Hook>; - -/** - * Class that provides a static method to run a pre-defined sf hook. See {@link SfHooks}. - */ -export class SfHook { - /** - * Executes a well known Unified CLI hook. See {@link SfHooks}. - */ - public static async run( - config: Config, - hookName: T, - options: SfHooks[T]['options'] = {} - ): Promise> { - const timeout = Duration.milliseconds(env.getNumber('SF_HOOK_TIMEOUT_MS') ?? 5000); - const results = await config.runHook(hookName, options, timeout.milliseconds, true); - results.failures.forEach((failure) => { - ux.debug(`Failed to run ${hookName} hook for ${failure.plugin.name}`); - ux.debug(failure.error.toString()); - }); - return results; - } -} - -export namespace SfHook { - export type EnvList = GenericHook<'sf:env:list', T>; - export type EnvDisplay = GenericHook<'sf:env:display', T>; - export type Deploy = GenericHook<'sf:deploy', T>; - export type Login = Hook<'sf:login', SfHooks>; - export type Logout = Hook<'sf:logout', SfHooks>; -} diff --git a/src/prompts.ts b/src/prompts.ts new file mode 100644 index 00000000..b3c0dc71 --- /dev/null +++ b/src/prompts.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2023, salesforce.com, inc. + * All rights reserved. + * Licensed under the BSD 3-Clause license. + * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause + */ + +import { setTimeout } from 'node:timers/promises'; +import { SfError } from '@salesforce/core'; +import { CancelablePromise } from '@inquirer/type'; + +export type PromptInputs = { + /** text to display. Do not include a question mark */ + message: string; + /** after this many ms, the prompt will time out. If a default value is provided, the default will be used. Otherwise the prompt will throw an error */ + ms?: number; + /** + * default value to offer to the user. Will be used if the user does not respond within the timeout period. + */ + defaultAnswer?: T; +}; + +export const confirm = async ({ + message, + ms = 10_000, + defaultAnswer = false, +}: PromptInputs): Promise => { + const promptConfirm = (await import('@inquirer/confirm')).default; + const answer = promptConfirm({ message, default: defaultAnswer }); + return Promise.race([answer, handleTimeout(answer, ms, defaultAnswer)]); +}; + +export const secretPrompt = async ({ message, ms = 60_000 }: PromptInputs): Promise => { + const promptSecret = (await import('@inquirer/password')).default; + const answer = promptSecret({ message }); + return Promise.race([answer, handleTimeout(answer, ms)]); +}; + +const handleTimeout = async (answer: CancelablePromise, ms: number, defaultAnswer?: T): Promise => { + await setTimeout(ms); + answer.cancel(); + + if (typeof defaultAnswer !== 'undefined') return defaultAnswer; + throw new SfError('Prompt timed out.'); +}; diff --git a/src/sfCommand.ts b/src/sfCommand.ts index 2e375c0b..5fc1a5a6 100644 --- a/src/sfCommand.ts +++ b/src/sfCommand.ts @@ -4,24 +4,28 @@ * Licensed under the BSD 3-Clause license. * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import * as os from 'node:os'; -import { ux, Command, Config, HelpSection } from '@oclif/core'; +import os from 'node:os'; +import { Command, Config, HelpSection } from '@oclif/core'; import { envVars, Messages, SfProject, - StructuredMessage, Lifecycle, - Mode, EnvironmentVariable, SfError, ConfigAggregator, } from '@salesforce/core'; -import { AnyJson } from '@salesforce/ts-types'; -import * as chalk from 'chalk'; -import { Progress, Prompter, Spinner, Ux } from './ux'; - -Messages.importMessagesDirectory(__dirname); +import type { AnyJson } from '@salesforce/ts-types'; +import { Progress } from './ux/progress.js'; +import { Spinner } from './ux/spinner.js'; +import { Ux } from './ux/ux.js'; +import { SfCommand as ns } from './sfCommandNamespace.js'; +import { formatActions, formatError } from './errorFormatting.js'; +import { StandardColors } from './ux/standardColors.js'; +import { confirm, secretPrompt, PromptInputs } from './prompts.js'; +import { removeEmpty } from './util.js'; + +Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); const messages = Messages.loadMessages('@salesforce/sf-plugins-core', 'messages'); export interface SfCommandInterface extends Command.Class { @@ -30,13 +34,6 @@ export interface SfCommandInterface extends Command.Class { errorCodes?: HelpSection; } -export const StandardColors = { - error: chalk.bold.red, - warning: chalk.bold.yellow, - info: chalk.dim, - success: chalk.bold.green, -}; - /** * A base command that provided common functionality for all sf commands. * Functionality includes: @@ -70,7 +67,6 @@ export const StandardColors = { */ export abstract class SfCommand extends Command { - public static SF_ENV = 'SF_ENV'; public static enableJsonFlag = true; /** * Add a CONFIGURATION VARIABLES section to the help output. @@ -124,21 +120,6 @@ export abstract class SfCommand extends Command { */ public static errorCodes?: HelpSection; - /** - * Flags that you can use for manipulating tables. - * - * @example - * ``` - * import { SfCommand } from '@salesforce/sf-plugins-core'; - * export default class MyCommand extends SfCommand { - * public static flags = { - * ...SfCommand.tableFags, - * 'my-flags: flags.string({ char: 'm', description: 'my flag' }), - * } - * } - * ``` - */ - public static tableFlags = ux.table.flags; /** * Set to true if the command must be executed inside a Salesforce project directory. * @@ -157,16 +138,15 @@ export abstract class SfCommand extends Command { * Add a progress bar to the console. {@link Progress} */ public progress: Progress; - public project!: SfProject; + public project?: SfProject; /** * ConfigAggregator instance for accessing global and local configuration. */ public configAggregator!: ConfigAggregator; - private warnings: SfCommand.Warning[] = []; + private warnings: ns.Warning[] = []; private ux: Ux; - private prompter: Prompter; private lifecycle: Lifecycle; public constructor(argv: string[], config: Config) { @@ -176,7 +156,6 @@ export abstract class SfCommand extends Command { this.ux.outputEnabled && envVars.getBoolean(EnvironmentVariable.SF_USE_PROGRESS_BAR, true) ); this.spinner = this.ux.spinner; - this.prompter = this.ux.prompter; this.lifecycle = Lifecycle.getInstance(); } @@ -208,15 +187,14 @@ export abstract class SfCommand extends Command { * * @param input {@link SfCommand.Warning} The message to log. */ - public warn(input: SfCommand.Warning): SfCommand.Warning { - const colorizedArgs: string[] = []; + public warn(input: ns.Warning): ns.Warning { this.warnings.push(input); const message = typeof input === 'string' ? input : input.message; - colorizedArgs.push(`${StandardColors.warning(messages.getMessage('warning.prefix'))} ${message}`); - colorizedArgs.push( - ...this.formatActions(typeof input === 'string' ? [] : input.actions ?? [], { actionColor: StandardColors.info }) - ); + const colorizedArgs = [ + `${StandardColors.warning(messages.getMessage('warning.prefix'))} ${message}`, + ...formatActions(typeof input === 'string' ? [] : input.actions ?? [], { actionColor: StandardColors.info }), + ]; this.logToStderr(colorizedArgs.join(os.EOL)); return input; @@ -227,16 +205,14 @@ export abstract class SfCommand extends Command { * * @param input {@link SfCommand.Info} The message to log. */ - public info(input: SfCommand.Info): void { - const colorizedArgs: string[] = []; + public info(input: ns.Info): void { const message = typeof input === 'string' ? input : input.message; - - colorizedArgs.push(`${StandardColors.info(message)}`); - colorizedArgs.push( - ...this.formatActions(typeof input === 'string' ? [] : input.actions ?? [], { actionColor: StandardColors.info }) + this.log( + [ + `${StandardColors.info(message)}`, + ...formatActions(typeof input === 'string' ? [] : input.actions ?? [], { actionColor: StandardColors.info }), + ].join(os.EOL) ); - - this.log(colorizedArgs.join(os.EOL)); } /** @@ -303,46 +279,32 @@ export abstract class SfCommand extends Command { } /** - * Prompt user for information. See https://www.npmjs.com/package/inquirer for more. + * Prompt user for yes/no confirmation. + * Avoid calling in --json scenarios and always provide a `--no-prompt` option for scripting * - * This will NOT be automatically suppressed when the --json flag is present since we assume - * that any command that prompts the user for required information will not also support the --json flag. - * - * If you need to conditionally suppress prompts to support json output, then do the following: + * @param message text to display. Do not include a question mark. + * @param ms milliseconds to wait for user input. Defaults to 60s. Will throw an error when timeout is reached. * - * @example - * if (!this.jsonEnabled()) { - * await this.prompt(); - * } */ - public async prompt( - questions: Prompter.Questions, - initialAnswers?: Partial - ): Promise { - return this.prompter.prompt(questions, initialAnswers); + + // eslint-disable-next-line class-methods-use-this + public async secretPrompt({ message, ms = 60_000 }: PromptInputs): Promise { + return secretPrompt({ message, ms }); } /** - * Simplified prompt for single-question confirmation. Times out and throws after 10s + * Prompt user for yes/no confirmation. + * Avoid calling in --json scenarios and always provide a `--no-prompt` option for scripting + * + * @param message text to display. Do not include a question mark or Y/N. + * @param ms milliseconds to wait for user input. Defaults to 10s. Will use the default value when timeout is reached. + * @param defaultAnswer boolean to set the default answer to. Defaults to false. * - * @param message text to display. Do not include a question mark. - * @param ms milliseconds to wait for user input. Defaults to 10s. - * @param defaultAnswer boolean to set the default answer to. Defaults to true. - * @return true if the user confirms, false if they do not. */ - public async confirm(message: string, ms = 10000, defaultAnswer = true): Promise { - return this.prompter.confirm(message, ms, defaultAnswer); - } - /** - * Prompt user for information with a timeout (in milliseconds). See https://www.npmjs.com/package/inquirer for more. - */ - public async timedPrompt( - questions: Prompter.Questions, - ms = 10_000, - initialAnswers?: Partial - ): Promise { - return this.prompter.timedPrompt(questions, ms, initialAnswers); + // eslint-disable-next-line class-methods-use-this + public async confirm({ message, ms = 10_000, defaultAnswer = false }: PromptInputs): Promise { + return confirm({ message, ms, defaultAnswer }); } public async _run(): Promise { @@ -354,7 +316,7 @@ export abstract class SfCommand extends Command { [this.configAggregator, this.project] = await Promise.all([ ConfigAggregator.create(), - ...(this.statics.requiresProject ? [this.assignProject()] : []), + ...(this.statics.requiresProject ? [assignProject()] : []), ]); if (this.statics.state === 'beta') { @@ -390,7 +352,7 @@ export abstract class SfCommand extends Command { /** * Wrap the command result into the standardized JSON structure. */ - protected toSuccessJson(result: T): SfCommand.Json { + protected toSuccessJson(result: T): ns.Json { return { status: process.exitCode ?? 0, result, @@ -401,27 +363,15 @@ export abstract class SfCommand extends Command { /** * Wrap the command error into the standardized JSON structure. */ - protected toErrorJson(error: SfCommand.Error): SfCommand.Error { + protected toErrorJson(error: ns.Error): ns.Error { return { ...error, warnings: this.warnings, }; } - // eslint-disable-next-line class-methods-use-this - protected async assignProject(): Promise { - try { - return await SfProject.resolve(); - } catch (err) { - if (err instanceof Error && err.name === 'InvalidProjectWorkspaceError') { - throw messages.createError('errors.RequiresProject'); - } - throw err; - } - } - // eslint-disable-next-line @typescript-eslint/require-await - protected async catch(error: Error | SfError | SfCommand.Error): Promise { + protected async catch(error: Error | SfError | ns.Error): Promise { // stop any spinners to prevent it from unintentionally swallowing output. // If there is an active spinner, it'll say "Error" instead of "Done" this.spinner.stop(StandardColors.error('Error')); @@ -442,7 +392,7 @@ export abstract class SfCommand extends Command { }); // Create printable error object - const sfCommandError: SfCommand.Error = { + const sfCommandError: ns.Error = { ...sfErrorProperties, ...{ message: error.message, @@ -456,7 +406,7 @@ export abstract class SfCommand extends Command { if (this.jsonEnabled()) { this.logJson(this.toErrorJson(sfCommandError)); } else { - this.logToStderr(this.formatError(sfCommandError)); + this.logToStderr(formatError(sfCommandError)); } // Create SfError that can be thrown @@ -488,78 +438,16 @@ export abstract class SfCommand extends Command { throw err; } - /** - * Format errors and actions for human consumption. Adds 'Error ():', - * When there are actions, we add 'Try this:' in blue - * followed by each action in red on its own line. - * If Error.code is present it is output last in parentheses - * - * @returns {string} Returns decorated messages. - */ - protected formatError(error: SfCommand.Error): string { - const colorizedArgs: string[] = []; - const errorCode = typeof error.code === 'string' || typeof error.code === 'number' ? ` (${error.code})` : ''; - const errorPrefix = `${StandardColors.error(messages.getMessage('error.prefix', [errorCode]))}`; - colorizedArgs.push(`${errorPrefix} ${error.message}`); - colorizedArgs.push(...this.formatActions(error.actions ?? [])); - if (error.stack && envVars.getString(SfCommand.SF_ENV) === Mode.DEVELOPMENT) { - colorizedArgs.push(StandardColors.info(`\n*** Internal Diagnostic ***\n\n${error.stack}\n******\n`)); - } - return colorizedArgs.join('\n'); - } - - /** - * Utility function to format actions lines - * - * @param actions - * @param options - * @private - */ - // eslint-disable-next-line class-methods-use-this - private formatActions( - actions: string[], - options: { actionColor: chalk.Chalk } = { actionColor: StandardColors.info } - ): string[] { - const colorizedArgs: string[] = []; - // Format any actions. - if (actions?.length) { - colorizedArgs.push(`\n${StandardColors.info(messages.getMessage('actions.tryThis'))}\n`); - actions.forEach((action) => { - colorizedArgs.push(`${options.actionColor(action)}`); - }); - } - return colorizedArgs; - } - public abstract run(): Promise; } -export namespace SfCommand { - export type Info = StructuredMessage | string; - export type Warning = StructuredMessage | string; - - export interface Json { - status: number; - result: T; - warnings?: Warning[]; - } - - export interface Error { - status: number; - name: string; - message: string; - stack: string | undefined; - warnings?: Warning[]; - actions?: string[]; - code?: unknown; - exitCode?: number; - data?: unknown; - context?: string; - commandName?: string; +const assignProject = async (): Promise => { + try { + return await SfProject.resolve(); + } catch (err) { + if (err instanceof Error && err.name === 'InvalidProjectWorkspaceError') { + throw messages.createError('errors.RequiresProject'); + } + throw err; } -} - -function removeEmpty(obj: Record): Record { - // eslint-disable-next-line @typescript-eslint/no-unused-vars - return Object.fromEntries(Object.entries(obj).filter(([_, v]) => v != null)); -} +}; diff --git a/src/sfCommandNamespace.ts b/src/sfCommandNamespace.ts new file mode 100644 index 00000000..7f297f77 --- /dev/null +++ b/src/sfCommandNamespace.ts @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2023, salesforce.com, inc. + * All rights reserved. + * Licensed under the BSD 3-Clause license. + * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause + */ +import { StructuredMessage } from '@salesforce/core'; + +export namespace SfCommand { + export type Info = StructuredMessage | string; + export type Warning = StructuredMessage | string; + + export interface Json { + status: number; + result: T; + warnings?: Warning[]; + } + + export interface Error { + status: number; + name: string; + message: string; + stack: string | undefined; + warnings?: Warning[]; + actions?: string[]; + code?: unknown; + exitCode?: number; + data?: unknown; + context?: string; + commandName?: string; + } +} diff --git a/src/stubUx.ts b/src/stubUx.ts index 1cc95528..57b102d0 100644 --- a/src/stubUx.ts +++ b/src/stubUx.ts @@ -7,8 +7,9 @@ /* eslint-disable @typescript-eslint/explicit-function-return-type */ import { SinonSandbox } from 'sinon'; -import { SfCommand } from './sfCommand'; -import { Prompter, Spinner, Ux } from './ux'; +import { SfCommand } from './sfCommand.js'; +import { Spinner } from './ux/spinner.js'; +import { Ux } from './ux/ux.js'; /** * Stub methods on the Ux class. @@ -117,8 +118,7 @@ export function stubSpinner(sandbox: SinonSandbox) { */ export function stubPrompter(sandbox: SinonSandbox) { return { - prompt: sandbox.stub(Prompter.prototype, 'prompt'), - confirm: sandbox.stub(Prompter.prototype, 'confirm'), - timedPrompt: sandbox.stub(Prompter.prototype, 'timedPrompt'), + prompt: sandbox.stub(SfCommand.prototype, 'secretPrompt'), + confirm: sandbox.stub(SfCommand.prototype, 'confirm'), }; } diff --git a/src/types/index.ts b/src/types/index.ts deleted file mode 100644 index 41b7a769..00000000 --- a/src/types/index.ts +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (c) 2022, salesforce.com, inc. - * All rights reserved. - * Licensed under the BSD 3-Clause license. - * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause - */ - -import { Deauthorizer } from '../deauthorizer'; -import { Deployer } from '../deployer'; - -export type JsonObject = { - [key: string]: string | string[] | number | number[] | boolean | boolean[] | null | undefined; -}; - -/** - * By default `sf env display` will display every key/value returned by the hook. - * It will also Title Case every key for readability. To overwrite this behavior, - * you can specify how a key should be displayed to the user. - * - * @example - * - * ``` - * { data: { theURL: 'https://example.com' } } - * // Renders as: - * Key Value - * ------- ------------------- - * The URL https://example.com - * ``` - * - * @example - * - * ``` - * { - * data: { theURL: 'https://example.com' } - * keys: { theURL: 'Url' }, - * } - * // Renders as: - * Key Value - * --- ------------------- - * Url https://example.com - *``` - * If no environment matches the provided targetEnv, then return null in the data field. - * - * @example - * ``` - * { data: null } - * ``` - */ -export namespace EnvDisplay { - type Keys = Record; - - export type HookMeta = { - options: { targetEnv: string }; - return: { data: T | null; keys?: Keys }; - }; -} - -/** - * By default `sf env list` will render a table with all the data provided by the hook. - * The columns of the table are derived from the keys of the provided data. These column - * headers are Title Cased for readability. To overwrite a column name specify it with - * the `keys` property. - * - * @example - * - * ``` - * { - * title: 'My Envs', - * data: [{ username: 'foo', theURL: 'https://example.com' }] - * } - * // Renders as: - * My Envs - * ================================ - * | Username | The URL - * | foo | https://example.com - *``` - * - * @example - * - * ``` - * { - * data: [{ username: 'foo', theURL: 'https://example.com' }] - * keys: { theURL: 'Url', username: 'Name' }, - * } - * - * // Renders as: - * My Envs - * ============================ - * | Name | Url - * | foo | https://example.com - * - *``` - */ -export namespace EnvList { - export enum EnvType { - 'salesforceOrgs' = 'salesforceOrgs', - 'scratchOrgs' = 'scratchOrgs', - 'computeEnvs' = 'computeEnvs', - } - - export type Table = { - type: EnvType | string; - data: T[]; - keys?: Record; - title: string; - }; - - type Options = { - all: boolean; - }; - - export type HookMeta = { - options: Options; - return: Array>; - }; -} - -export namespace Deploy { - export type HookMeta = { - options: Record; - return: T[]; - }; -} - -export namespace Login { - export type HookMeta = { - options: Record; - return: void; - }; -} - -export namespace Logout { - export type HookMeta = { - options: Record; - return: T; - }; -} diff --git a/src/util.ts b/src/util.ts index 4e5babe3..82e463b6 100644 --- a/src/util.ts +++ b/src/util.ts @@ -16,9 +16,6 @@ import { } from '@salesforce/core'; import { HelpSection, HelpSectionKeyValueTable } from '@oclif/core'; -Messages.importMessagesDirectory(__dirname); -const messages = Messages.loadMessages('@salesforce/sf-plugins-core', 'messages'); - /** * Function to build a help section for command help. * Takes a string to be used as section header text and an array of enums @@ -73,6 +70,9 @@ export function parseVarArgs(args: Record, argv: string[]): Rec return { [varargs[0]]: varargs[1] }; } + Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); + const messages = Messages.loadMessages('@salesforce/sf-plugins-core', 'messages'); + // Ensure that all args are in the right format (e.g. key=value key1=value1) varargs.forEach((arg) => { const split = arg.split('='); @@ -92,3 +92,5 @@ export function parseVarArgs(args: Record, argv: string[]): Rec return final; } +export const removeEmpty = (obj: Record): Record => + Object.fromEntries(Object.entries(obj).filter(([, v]) => v != null)); diff --git a/src/ux/base.ts b/src/ux/base.ts index 96473d56..2e6786c7 100644 --- a/src/ux/base.ts +++ b/src/ux/base.ts @@ -5,7 +5,7 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { AnyFunction } from '@salesforce/ts-types'; +import type { AnyFunction } from '@salesforce/ts-types'; export class UxBase { public constructor(public readonly outputEnabled: boolean) {} diff --git a/src/ux/index.ts b/src/ux/index.ts deleted file mode 100644 index a8e0e81f..00000000 --- a/src/ux/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright (c) 2022, salesforce.com, inc. - * All rights reserved. - * Licensed under the BSD 3-Clause license. - * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause - */ - -export { UxBase } from './base'; -export { Ux } from './ux'; -export { Progress } from './progress'; -export { Prompter, generateTableChoices, Separator } from './prompter'; -export { Spinner } from './spinner'; diff --git a/src/ux/progress.ts b/src/ux/progress.ts index e134438a..c575f3ca 100644 --- a/src/ux/progress.ts +++ b/src/ux/progress.ts @@ -7,7 +7,7 @@ import * as util from 'node:util'; import { ux } from '@oclif/core'; -import { UxBase } from '.'; +import { UxBase } from './base.js'; /** * Class for display a progress bar to the console. Will automatically be suppressed if the --json flag is present. diff --git a/src/ux/prompter.ts b/src/ux/prompter.ts deleted file mode 100644 index 3bfd2def..00000000 --- a/src/ux/prompter.ts +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright (c) 2022, salesforce.com, inc. - * All rights reserved. - * Licensed under the BSD 3-Clause license. - * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause - */ - -import { prompt, QuestionCollection, Separator, ChoiceOptions, ChoiceBase } from 'inquirer'; -import { Dictionary, Nullable, ensureString } from '@salesforce/ts-types'; -import { ux } from '@oclif/core'; - -export class Prompter { - /** - * Prompt user for information. See https://www.npmjs.com/package/inquirer for more. - */ - // eslint-disable-next-line class-methods-use-this - public async prompt( - questions: Prompter.Questions, - initialAnswers?: Partial - ): Promise { - const answers = await prompt(questions, initialAnswers); - return answers; - } - - /** - * Prompt user for information with a timeout (in milliseconds). See https://www.npmjs.com/package/inquirer for more. - */ - // eslint-disable-next-line class-methods-use-this - public async timedPrompt( - questions: Prompter.Questions, - ms = 10000, - initialAnswers?: Partial - ): Promise { - let id: NodeJS.Timeout; - const thePrompt = prompt(questions, initialAnswers); - const timeout = new Promise((_, reject) => { - id = setTimeout(() => { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-expect-error - // eslint-disable-next-line @typescript-eslint/no-unsafe-call - thePrompt.ui['activePrompt'].done(); - ux.log(); - reject(new Error(`Timed out after ${ms} ms.`)); - }, ms).unref(); - }); - - return Promise.race([timeout, thePrompt]).then((result) => { - clearTimeout(id); - return result as T; - }); - } - - /** - * Simplified prompt for single-question confirmation. Times out and throws after 10s - * - * @param message text to display. Do not include a question mark. - * @param ms milliseconds to wait for user input. Defaults to 10s. - * @param defaultAnswer default answer for the prompt. Defaults to true. Pass in `false` to require a positive response. - * @return true if the user confirms, false if they do not. - */ - public async confirm(message: string, ms = 10000, defaultAnswer = true): Promise { - const { confirmed } = await this.timedPrompt<{ confirmed: boolean }>( - [ - { - name: 'confirmed', - message, - type: 'confirm', - default: defaultAnswer, - }, - ], - ms - ); - return confirmed; - } -} - -export namespace Prompter { - export type Answers> = T & Record; - export type Questions = QuestionCollection; -} - -/** - * Generate a formatted table for list and checkbox prompts - * - * Each option should contain the same keys as specified in columns. - * - * @example - * ``` - * const columns = { name: 'Name', type: 'Type', path: 'Path' }; - * const options = [{ name: 'foo', type: 'org', path: '/path/to/foo/' }]; - * generateTableChoices(columns, options); - * ``` - */ -export function generateTableChoices( - columns: Dictionary, - choices: Array | T>>, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - padForCheckbox = true -): ChoiceBase[] { - const columnEntries = Object.entries(columns); - const columnLengths = columnEntries.map( - ([key, value]) => - Math.max( - ensureString(value).length, - ...choices.map( - (option) => - ensureString(option[key], `Type ${typeof option[key]} for ${key} in ${Object.keys(option).join(', ')}`) - .length - ) - ) + 1 - ); - - const choicesOptions: ChoiceBase[] = [ - new Separator( - `${padForCheckbox ? ' '.repeat(2) : ''}${columnEntries - .map(([, value], index) => value?.padEnd(columnLengths[index], ' ')) - .join('')}` - ), - ]; - - for (const meta of choices) { - const name = columnEntries - .map(([key], index) => ensureString(meta[key]).padEnd(columnLengths[index], ' ')) - .join(''); - const choice: ChoiceOptions = { name, value: meta.value, short: ensureString(meta.name) }; - choicesOptions.push(choice); - } - - return choicesOptions; -} - -export { Separator }; diff --git a/src/ux/spinner.ts b/src/ux/spinner.ts index 074357a7..28dc89b5 100644 --- a/src/ux/spinner.ts +++ b/src/ux/spinner.ts @@ -6,7 +6,7 @@ */ import { ux } from '@oclif/core'; -import { UxBase } from '.'; +import { UxBase } from './base.js'; /** * This class is a light wrapper around ux.action that allows us to diff --git a/src/ux/standardColors.ts b/src/ux/standardColors.ts new file mode 100644 index 00000000..08d254c8 --- /dev/null +++ b/src/ux/standardColors.ts @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2023, salesforce.com, inc. + * All rights reserved. + * Licensed under the BSD 3-Clause license. + * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause + */ + +import chalk from 'chalk'; + +export const StandardColors = { + error: chalk.bold.red, + warning: chalk.bold.yellow, + info: chalk.dim, + success: chalk.bold.green, +}; diff --git a/src/ux/ux.ts b/src/ux/ux.ts index 23953838..bfaa9ac1 100644 --- a/src/ux/ux.ts +++ b/src/ux/ux.ts @@ -7,9 +7,8 @@ import { ux } from '@oclif/core'; import { AnyJson } from '@salesforce/ts-types'; -import { UxBase } from './base'; -import { Prompter } from './prompter'; -import { Spinner } from './spinner'; +import { UxBase } from './base.js'; +import { Spinner } from './spinner.js'; /** * UX methods for plugins. Automatically suppress console output if outputEnabled is set to false. @@ -29,14 +28,12 @@ import { Spinner } from './spinner'; */ export class Ux extends UxBase { public readonly spinner: Spinner; - public readonly prompter: Prompter; public readonly outputEnabled: boolean; public constructor({ jsonEnabled } = { jsonEnabled: false }) { super(!jsonEnabled); this.outputEnabled = !jsonEnabled; this.spinner = new Spinner(this.outputEnabled); - this.prompter = new Prompter(); } /** diff --git a/test/tsconfig.json b/test/tsconfig.json index 270e87bc..069e5027 100644 --- a/test/tsconfig.json +++ b/test/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "@salesforce/dev-config/tsconfig-test-strict", + "extends": "@salesforce/dev-config/tsconfig-test-strict-esm", "include": ["unit/**/*.ts", "../node_modules/@types/**/*.d.ts"], "compilerOptions": { "noEmit": true, diff --git a/test/unit/flags/apiVersion.test.ts b/test/unit/flags/apiVersion.test.ts index 7be44607..bf8a070e 100644 --- a/test/unit/flags/apiVersion.test.ts +++ b/test/unit/flags/apiVersion.test.ts @@ -7,15 +7,15 @@ import { expect } from 'chai'; import { Parser } from '@oclif/core'; import { Lifecycle, Messages } from '@salesforce/core'; -import * as sinon from 'sinon'; +import sinon from 'sinon'; import { orgApiVersionFlag, minValidApiVersion, maxDeprecated, maxDeprecatedUrl, -} from '../../../src/flags/orgApiVersion'; +} from '../../../src/flags/orgApiVersion.js'; -Messages.importMessagesDirectory(__dirname); +Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); const messages = Messages.loadMessages('@salesforce/sf-plugins-core', 'messages'); describe('fs flags', () => { diff --git a/test/unit/flags/duration.test.ts b/test/unit/flags/duration.test.ts index 19aea059..88111b9e 100644 --- a/test/unit/flags/duration.test.ts +++ b/test/unit/flags/duration.test.ts @@ -9,9 +9,9 @@ import { Parser } from '@oclif/core'; import { Messages } from '@salesforce/core'; import { expect } from 'chai'; import { Duration } from '@salesforce/kit'; -import { durationFlag } from '../../../src/flags/duration'; +import { durationFlag } from '../../../src/flags/duration.js'; -Messages.importMessagesDirectory(__dirname); +Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); const messages = Messages.loadMessages('@salesforce/sf-plugins-core', 'messages'); describe('duration flag', () => { diff --git a/test/unit/flags/id.test.ts b/test/unit/flags/id.test.ts index 9f2b6beb..4fbd3eed 100644 --- a/test/unit/flags/id.test.ts +++ b/test/unit/flags/id.test.ts @@ -7,9 +7,9 @@ import { expect } from 'chai'; import { Parser } from '@oclif/core'; import { Messages } from '@salesforce/core'; -import { salesforceIdFlag } from '../../../src/flags/salesforceId'; +import { salesforceIdFlag } from '../../../src/flags/salesforceId.js'; -Messages.importMessagesDirectory(__dirname); +Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); const messages = Messages.loadMessages('@salesforce/sf-plugins-core', 'messages'); describe('id flag', () => { diff --git a/test/unit/flags/orgFlags.test.ts b/test/unit/flags/orgFlags.test.ts index fceec24f..8c71b273 100644 --- a/test/unit/flags/orgFlags.test.ts +++ b/test/unit/flags/orgFlags.test.ts @@ -4,10 +4,10 @@ * Licensed under the BSD 3-Clause license. * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { Org, SfError, OrgConfigProperties } from '@salesforce/core'; -import { MockTestOrgData, shouldThrow, TestContext } from '@salesforce/core/lib/testSetup'; import { assert, expect, config } from 'chai'; -import { getHubOrThrow, getOrgOrThrow, maybeGetHub, maybeGetOrg } from '../../../src/flags/orgFlags'; +import { Org, SfError, OrgConfigProperties } from '@salesforce/core'; +import { MockTestOrgData, shouldThrow, TestContext } from '@salesforce/core/lib/testSetup.js'; +import { getHubOrThrow, getOrgOrThrow, maybeGetHub, maybeGetOrg } from '../../../src/flags/orgFlags.js'; config.truncateThreshold = 0; diff --git a/test/unit/sfCommand.test.ts b/test/unit/sfCommand.test.ts index 733c9ccd..68a699f4 100644 --- a/test/unit/sfCommand.test.ts +++ b/test/unit/sfCommand.test.ts @@ -6,12 +6,13 @@ */ import { Flags } from '@oclif/core'; import { Lifecycle } from '@salesforce/core'; -import { TestContext } from '@salesforce/core/lib/testSetup'; +import { TestContext } from '@salesforce/core/lib/testSetup.js'; import { assert, expect } from 'chai'; import { SfError } from '@salesforce/core'; import { Config } from '@oclif/core/lib/interfaces'; -import { SfCommand, StandardColors } from '../../src/sfCommand'; -import { stubSfCommandUx, stubSpinner } from '../../src/stubUx'; +import { SfCommand } from '../../src/sfCommand.js'; +import { StandardColors } from '../../src/ux/standardColors.js'; +import { stubSfCommandUx, stubSpinner } from '../../src/stubUx.js'; class TestCommand extends SfCommand { public static readonly flags = { actions: Flags.boolean({ char: 'a', description: 'show actions' }), diff --git a/test/unit/stubUx.test.ts b/test/unit/stubUx.test.ts index 90b6d3b1..8b51a151 100644 --- a/test/unit/stubUx.test.ts +++ b/test/unit/stubUx.test.ts @@ -6,9 +6,9 @@ */ import { Interfaces } from '@oclif/core'; import { expect } from 'chai'; -import { TestContext } from '@salesforce/core/lib/testSetup'; +import { TestContext } from '@salesforce/core/lib/testSetup.js'; import { Lifecycle } from '@salesforce/core'; -import { stubUx, stubSfCommandUx, SfCommand, Ux, stubSpinner, Flags } from '../../src/exported'; +import { stubUx, stubSfCommandUx, SfCommand, Ux, stubSpinner, Flags } from '../../src/exported.js'; const TABLE_DATA = Array.from({ length: 10 }).fill({ id: '123', name: 'foo', value: 'bar' }) as Array< Record diff --git a/test/unit/util.test.ts b/test/unit/util.test.ts index 9aecd3e0..a117894e 100644 --- a/test/unit/util.test.ts +++ b/test/unit/util.test.ts @@ -15,9 +15,9 @@ import { SFDX_ALLOWED_PROPERTIES, Messages, } from '@salesforce/core'; -import { parseVarArgs, toHelpSection } from '../../src/util'; +import { parseVarArgs, toHelpSection } from '../../src/util.js'; -Messages.importMessagesDirectory(__dirname); +Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); const messages = Messages.loadMessages('@salesforce/sf-plugins-core', 'messages'); describe('toHelpSection', () => { diff --git a/test/unit/ux/progress.test.ts b/test/unit/ux/progress.test.ts index 2edbbca5..272952d8 100644 --- a/test/unit/ux/progress.test.ts +++ b/test/unit/ux/progress.test.ts @@ -5,8 +5,8 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ import { expect } from 'chai'; -import * as sinon from 'sinon'; -import { Progress } from '../../../src/ux'; +import sinon from 'sinon'; +import { Progress } from '../../../src/ux/progress.js'; describe('Progress', () => { let sandbox: sinon.SinonSandbox; diff --git a/test/unit/ux/prompter.test.ts b/test/unit/ux/prompter.test.ts deleted file mode 100644 index ab78f421..00000000 --- a/test/unit/ux/prompter.test.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2022, salesforce.com, inc. - * All rights reserved. - * Licensed under the BSD 3-Clause license. - * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause - */ -import { expect } from 'chai'; -import stripAnsi = require('strip-ansi'); -import { Separator } from 'inquirer'; -import { generateTableChoices } from '../../../src/ux'; - -describe('generateTableChoices', () => { - const columns = { - name: 'APP OR PACKAGE', - type: 'TYPE', - path: 'PATH', - }; - const choices = [ - { - name: 'force-app', - type: 'org', - path: 'force-app', - value: 'force-app', - }, - { - name: 'my-app', - type: 'a-long-org', - path: 'my-app', - value: 'my-app', - }, - ]; - it('should generate a formatted table of choices', () => { - const tableChoices = generateTableChoices(columns, choices); - expect(tableChoices[0]).to.be.instanceof(Separator); - const separator = tableChoices[0] as typeof Separator; - expect(stripAnsi(separator.toString())).to.be.equal(' APP OR PACKAGE TYPE PATH '); - expect(tableChoices[1]).to.have.property('name').and.equal('force-app org force-app '); - expect(tableChoices[2]).to.have.property('name').and.equal('my-app a-long-org my-app '); - }); - - it('should generate a formatted table of choices without checkbox padding', () => { - const tableChoices = generateTableChoices(columns, choices, false); - expect(tableChoices[0]).to.be.instanceof(Separator); - const separator = tableChoices[0] as typeof Separator; - expect(stripAnsi(separator.toString())).to.be.equal('APP OR PACKAGE TYPE PATH '); - expect(tableChoices[1]).to.have.property('name').and.equal('force-app org force-app '); - expect(tableChoices[2]).to.have.property('name').and.equal('my-app a-long-org my-app '); - }); -}); diff --git a/test/unit/ux/spinner.test.ts b/test/unit/ux/spinner.test.ts index 786076fb..4f9c6ec0 100644 --- a/test/unit/ux/spinner.test.ts +++ b/test/unit/ux/spinner.test.ts @@ -5,9 +5,9 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ import { expect } from 'chai'; -import * as sinon from 'sinon'; +import sinon from 'sinon'; import { ux } from '@oclif/core'; -import { Spinner } from '../../../src/ux'; +import { Spinner } from '../../../src/ux/spinner.js'; describe('Spinner', () => { let sandbox: sinon.SinonSandbox; diff --git a/test/unit/ux/ux.test.ts b/test/unit/ux/ux.test.ts index 13f08c09..ff70c3cf 100644 --- a/test/unit/ux/ux.test.ts +++ b/test/unit/ux/ux.test.ts @@ -6,9 +6,9 @@ */ import { expect } from 'chai'; -import * as sinon from 'sinon'; +import sinon from 'sinon'; import { ux as coreUx } from '@oclif/core'; -import { Ux } from '../../../src/ux'; +import { Ux } from '../../../src/ux/ux.js'; describe('Ux', () => { let sandbox: sinon.SinonSandbox; diff --git a/tsconfig.json b/tsconfig.json index 22456944..7aa5fb68 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "@salesforce/dev-config/tsconfig-strict", + "extends": "@salesforce/dev-config/tsconfig-strict-esm", "compilerOptions": { "outDir": "./lib", "declarationMap": true, diff --git a/yarn.lock b/yarn.lock index 002d7929..f19598e2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -224,12 +224,12 @@ resolve-global "1.0.0" yargs "^17.0.0" -"@commitlint/config-conventional@^17.1.0": - version "17.6.7" - resolved "https://registry.yarnpkg.com/@commitlint/config-conventional/-/config-conventional-17.6.7.tgz#8469d977def36148615e9516b1a521e38ca27ddd" - integrity sha512-4oTpEUC0HRM54QRHBPMOJW1pETp7usxXn9RuNYNWHcmu8wi1mpws95hvS20u2n6HtIkTn0jfn7vHioCm4AGUTw== +"@commitlint/config-conventional@^17.8.1": + version "17.8.1" + resolved "https://registry.yarnpkg.com/@commitlint/config-conventional/-/config-conventional-17.8.1.tgz#e5bcf0cfec8da7ac50bc04dc92e0a4ea74964ce0" + integrity sha512-NxCOHx1kgneig3VLauWJcDWS40DVjg7nKOpBEEK9E5fjJpQqLCilcnKkIIjdBH98kEO1q3NpE5NSrZ2kl/QGJg== dependencies: - conventional-changelog-conventionalcommits "^5.0.0" + conventional-changelog-conventionalcommits "^6.1.0" "@commitlint/config-validator@^17.6.7": version "17.6.7" @@ -436,6 +436,71 @@ resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-2.0.1.tgz#e5211452df060fa8522b55c7b3c0c4d1981cb044" integrity sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw== +"@inquirer/confirm@^2.0.15": + version "2.0.15" + resolved "https://registry.yarnpkg.com/@inquirer/confirm/-/confirm-2.0.15.tgz#b5512ed190efd8c5b96e0969115756b48546ab36" + integrity sha512-hj8Q/z7sQXsF0DSpLQZVDhWYGN6KLM/gNjjqGkpKwBzljbQofGjn0ueHADy4HUY+OqDHmXuwk/bY+tZyIuuB0w== + dependencies: + "@inquirer/core" "^5.1.1" + "@inquirer/type" "^1.1.5" + chalk "^4.1.2" + +"@inquirer/core@^5.1.1": + version "5.1.1" + resolved "https://registry.yarnpkg.com/@inquirer/core/-/core-5.1.1.tgz#849d4846aea68371c133df6ec9059f5e5bd30d30" + integrity sha512-IuJyZQUg75+L5AmopgnzxYrgcU6PJKL0hoIs332G1Gv55CnmZrhG6BzNOeZ5sOsTi1YCGOopw4rYICv74ejMFg== + dependencies: + "@inquirer/type" "^1.1.5" + "@types/mute-stream" "^0.0.4" + "@types/node" "^20.9.0" + "@types/wrap-ansi" "^3.0.0" + ansi-escapes "^4.3.2" + chalk "^4.1.2" + cli-spinners "^2.9.1" + cli-width "^4.1.0" + figures "^3.2.0" + mute-stream "^1.0.0" + run-async "^3.0.0" + signal-exit "^4.1.0" + strip-ansi "^6.0.1" + wrap-ansi "^6.2.0" + +"@inquirer/input@^1.2.14": + version "1.2.14" + resolved "https://registry.yarnpkg.com/@inquirer/input/-/input-1.2.14.tgz#8951867618bb5cd16dd096e02404eec225a92207" + integrity sha512-tISLGpUKXixIQue7jypNEShrdzJoLvEvZOJ4QRsw5XTfrIYfoWFqAjMQLerGs9CzR86yAI89JR6snHmKwnNddw== + dependencies: + "@inquirer/core" "^5.1.1" + "@inquirer/type" "^1.1.5" + chalk "^4.1.2" + +"@inquirer/password@^1.1.14": + version "1.1.14" + resolved "https://registry.yarnpkg.com/@inquirer/password/-/password-1.1.14.tgz#c1fc139efe84a38986870a1bcf80718050f82bbf" + integrity sha512-vL2BFxfMo8EvuGuZYlryiyAB3XsgtbxOcFs4H9WI9szAS/VZCAwdVqs8rqEeaAf/GV/eZOghIOYxvD91IsRWSg== + dependencies: + "@inquirer/input" "^1.2.14" + "@inquirer/type" "^1.1.5" + ansi-escapes "^4.3.2" + chalk "^4.1.2" + +"@inquirer/type@^1.1.5": + version "1.1.5" + resolved "https://registry.yarnpkg.com/@inquirer/type/-/type-1.1.5.tgz#b8c171f755859c8159b10e41e1e3a88f0ca99d7f" + integrity sha512-wmwHvHozpPo4IZkkNtbYenem/0wnfI6hvOcGKmPEa0DwuaH5XUQzFqy6OpEpjEegZMhYIk8HDYITI16BPLtrRA== + +"@isaacs/cliui@^8.0.2": + version "8.0.2" + resolved "https://registry.yarnpkg.com/@isaacs/cliui/-/cliui-8.0.2.tgz#b37667b7bc181c168782259bab42474fbf52b550" + integrity sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA== + dependencies: + string-width "^5.1.2" + string-width-cjs "npm:string-width@^4.2.0" + strip-ansi "^7.0.1" + strip-ansi-cjs "npm:strip-ansi@^6.0.1" + wrap-ansi "^8.1.0" + wrap-ansi-cjs "npm:wrap-ansi@^7.0.0" + "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" @@ -523,7 +588,7 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@oclif/core@^3.12.0", "@oclif/core@^3.14.1": +"@oclif/core@^3.14.1": version "3.14.1" resolved "https://registry.yarnpkg.com/@oclif/core/-/core-3.14.1.tgz#634fc96124068e47b720d62f3b278d818a07495e" integrity sha512-HLFL2s45DFdqYI2CFjVS/CIQ4cQ4yZqH0XqO9nnwcRWYboz2rEW/vLmidjIYGDjh6xA/k5psiAL3O1KEjqSHuQ== @@ -556,43 +621,15 @@ wordwrap "^1.0.0" wrap-ansi "^7.0.0" -"@oclif/test@^3.1.3": - version "3.1.3" - resolved "https://registry.yarnpkg.com/@oclif/test/-/test-3.1.3.tgz#42d98e3e2c29a3340dedd7eab7c0a7e392c2f3cf" - integrity sha512-p4Z+SpGSW6pw/QQrQwVuG8eOuZtUl/hxh2rgaOkDfxWipb6FVNa08kzuE70rYaIDIq/9SFglcOb9YQmOXv2MEA== - dependencies: - "@oclif/core" "^3.12.0" - chai "^4.3.10" - fancy-test "^3.0.1" - -"@salesforce/core@^5.3.20": - version "5.3.20" - resolved "https://registry.yarnpkg.com/@salesforce/core/-/core-5.3.20.tgz#4e934d4551bb70423cb1c4115615bc41cffca41e" - integrity sha512-y+O6O2c8OYFDrAy2qsG+pAcNxoyL14nmBXcBRRcYA7Huj8ikK+aLJK84PuVAYdQz+hNwImQF+69IWtDkpK4Irg== - dependencies: - "@salesforce/kit" "^3.0.15" - "@salesforce/schemas" "^1.6.1" - "@salesforce/ts-types" "^2.0.9" - "@types/semver" "^7.5.4" - ajv "^8.12.0" - change-case "^4.1.2" - faye "^1.4.0" - form-data "^4.0.0" - js2xmlparser "^4.0.1" - jsforce "^2.0.0-beta.28" - jsonwebtoken "9.0.2" - jszip "3.10.1" - pino "^8.16.0" - pino-abstract-transport "^1.0.0" - pino-pretty "^10.2.3" - proper-lockfile "^4.1.2" - semver "^7.5.4" - ts-retry-promise "^0.7.1" +"@pkgjs/parseargs@^0.11.0": + version "0.11.0" + resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" + integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg== -"@salesforce/core@^6.2.2": - version "6.2.2" - resolved "https://registry.yarnpkg.com/@salesforce/core/-/core-6.2.2.tgz#c390c7c407e8916ad85a3e300d9d9e4fecfba207" - integrity sha512-R2ptk/+KSWDJOqdInxfzPTLF3V//vFtD4vQcjWIK9NaGCCq4ZwiF2gMpkBcKgDQneLUmva2NcmnzF3c51zQp5A== +"@salesforce/core@^6.4.0", "@salesforce/core@^6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@salesforce/core/-/core-6.4.1.tgz#27edd083b62ee96d6270b60da6dfb959bff1a0a5" + integrity sha512-Bn/Pox5JLeVBg35zgSmtNU+f9wdOaa7a/hmCIvQibci1dpKtLGUmSpdHibWR6zHag8ZoRkueea7zuqEjYzECyA== dependencies: "@salesforce/kit" "^3.0.15" "@salesforce/schemas" "^1.6.1" @@ -618,17 +655,17 @@ resolved "https://registry.yarnpkg.com/@salesforce/dev-config/-/dev-config-4.1.0.tgz#e529576466d074e7a5f1441236510fef123da01e" integrity sha512-2iDDepiIwjXHS5IVY7pwv8jMo4xWosJ7p/UTj+lllpB/gnJiYLhjJPE4Z3FCGFKyvfg5jGaimCd8Ca6bLGsCQA== -"@salesforce/dev-scripts@^7.1.1": - version "7.1.1" - resolved "https://registry.yarnpkg.com/@salesforce/dev-scripts/-/dev-scripts-7.1.1.tgz#549b58fb7e8c2410ce594c46f780a0907618f19f" - integrity sha512-6SL+QDOMZCnmU4Lu2ZCjqsMRcHw96mnjUOPE7b2HcfmfPo2a/hAYUtv8v7UsZ/+3UPbSf+XsLJfUsF15QIUWrg== +"@salesforce/dev-scripts@^8.1.2": + version "8.1.2" + resolved "https://registry.yarnpkg.com/@salesforce/dev-scripts/-/dev-scripts-8.1.2.tgz#ec3e528328fe7c7b8b312688e970ea258913980b" + integrity sha512-DQscqQPMuj2b1D8sfh77zAKQVEuo0SQ05XlFSbVKgvxO/yPrSpUK0LgHsbyG4Js88TWBqsf4K7mkdaryukSnSA== dependencies: "@commitlint/cli" "^17.1.2" - "@commitlint/config-conventional" "^17.1.0" + "@commitlint/config-conventional" "^17.8.1" "@salesforce/dev-config" "^4.1.0" "@salesforce/prettier-config" "^0.0.3" "@types/chai" "^4.3.10" - "@types/mocha" "^10.0.4" + "@types/mocha" "^10.0.6" "@types/node" "^18" "@types/sinon" "^10.0.20" chai "^4.3.10" @@ -636,6 +673,7 @@ cosmiconfig "^7.0.0" eslint-config-salesforce-typescript "^3.0.5" husky "^7.0.4" + linkinator "^6.0.2" mocha "^10.2.0" nyc "^15.1.0" prettier "^2.8.8" @@ -643,7 +681,7 @@ shelljs "^0.8.5" sinon "10.0.0" source-map-support "^0.5.21" - ts-node "^10.9.1" + ts-node "^10.9.2" typedoc "^0.25.3" typedoc-plugin-missing-exports "0.23.0" typescript "^4.9.5" @@ -681,27 +719,6 @@ dependencies: type-detect "4.0.8" -"@sinonjs/commons@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-2.0.0.tgz#fd4ca5b063554307e8327b4564bd56d3b73924a3" - integrity sha512-uLa0j859mMrg2slwQYdO/AkrOfmH+X6LTVmNTS9CqexuE2IvVORIkSpJLqePAbEnKJ77aMmCwr1NUZ57120Xcg== - dependencies: - type-detect "4.0.8" - -"@sinonjs/commons@^3.0.0": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-3.0.0.tgz#beb434fe875d965265e04722ccfc21df7f755d72" - integrity sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA== - dependencies: - type-detect "4.0.8" - -"@sinonjs/fake-timers@^10.0.2", "@sinonjs/fake-timers@^10.3.0": - version "10.3.0" - resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz#55fdff1ecab9f354019129daf4df0dd4d923ea66" - integrity sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA== - dependencies: - "@sinonjs/commons" "^3.0.0" - "@sinonjs/fake-timers@^6.0.0", "@sinonjs/fake-timers@^6.0.1": version "6.0.1" resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-6.0.1.tgz#293674fccb3262ac782c7aadfdeca86b10c75c40" @@ -718,15 +735,6 @@ lodash.get "^4.4.2" type-detect "^4.0.8" -"@sinonjs/samsam@^8.0.0": - version "8.0.0" - resolved "https://registry.yarnpkg.com/@sinonjs/samsam/-/samsam-8.0.0.tgz#0d488c91efb3fa1442e26abea81759dfc8b5ac60" - integrity sha512-Bp8KUVlLp8ibJZrnvq2foVhP0IVX2CIprMJPK0vqGqgrDa0OHVKeZyBykqskkrdxV6yKBPmGasO8LVjAKR3Gew== - dependencies: - "@sinonjs/commons" "^2.0.0" - lodash.get "^4.4.2" - type-detect "^4.0.8" - "@sinonjs/text-encoding@^0.7.1": version "0.7.2" resolved "https://registry.yarnpkg.com/@sinonjs/text-encoding/-/text-encoding-0.7.2.tgz#5981a8db18b56ba38ef0efb7d995b12aa7b51918" @@ -752,20 +760,12 @@ resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.4.tgz#0b92dcc0cc1c81f6f306a381f28e31b1a56536e9" integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA== -"@types/chai@*", "@types/chai@^4.3.10": +"@types/chai@^4.3.10": version "4.3.10" resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.3.10.tgz#2ad2959d1767edee5b0e4efb1a0cd2b500747317" integrity sha512-of+ICnbqjmFCiixUnqRulbylyXQrPqIGf/B3Jax1wIF3DvSheysQxAWvqHhZiW3IQrycvokcLcFQlveGp+vyNg== -"@types/inquirer@^8.2.3": - version "8.2.6" - resolved "https://registry.yarnpkg.com/@types/inquirer/-/inquirer-8.2.6.tgz#abd41a5fb689c7f1acb12933d787d4262a02a0ab" - integrity sha512-3uT88kxg8lNzY8ay2ZjP44DKcRaTGztqeIvN2zHvhzIBH/uAPaL75aBtdNRKbA7xXoMbBt5kX0M00VKAnfOYlA== - dependencies: - "@types/through" "*" - rxjs "^7.2.0" - -"@types/json-schema@^7.0.12", "@types/json-schema@^7.0.9": +"@types/json-schema@^7.0.12": version "7.0.15" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== @@ -775,11 +775,6 @@ resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ== -"@types/lodash@*": - version "4.14.196" - resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.196.tgz#a7c3d6fc52d8d71328b764e28e080b4169ec7a95" - integrity sha512-22y3o88f4a94mKljsZcanlNWPzO0uBsBdzLAngf2tp533LzZcQzb6+eZPJ+vCTt+bqF2XnvT9gejTLsAcJAJyQ== - "@types/minimatch@^3.0.3": version "3.0.5" resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.5.tgz#1001cc5e6a3704b83c236027e77f2f58ea010f40" @@ -790,10 +785,17 @@ resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.2.tgz#ee771e2ba4b3dc5b372935d549fd9617bf345b8c" integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ== -"@types/mocha@^10.0.4": - version "10.0.4" - resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-10.0.4.tgz#b5331955ebca216604691fd4fcd2dbdc2bd559a4" - integrity sha512-xKU7bUjiFTIttpWaIZ9qvgg+22O1nmbA+HRxdlR+u6TWsGfmFdXrheJoK4fFxrHNVIOBDvDNKZG+LYBpMHpX3w== +"@types/mocha@^10.0.6": + version "10.0.6" + resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-10.0.6.tgz#818551d39113081048bdddbef96701b4e8bb9d1b" + integrity sha512-dJvrYWxP/UcXm36Qn36fxhUKu8A/xMRXVT2cliFF1Z7UA9liG5Psj3ezNSZw+5puH2czDXRLcXQxf8JbJt0ejg== + +"@types/mute-stream@^0.0.4": + version "0.0.4" + resolved "https://registry.yarnpkg.com/@types/mute-stream/-/mute-stream-0.0.4.tgz#77208e56a08767af6c5e1237be8888e2f255c478" + integrity sha512-CPM9nzrCPPJHQNA9keH9CVkVI+WR5kMa+7XEs5jcGQ0VoAGnLv242w8lIVgwAEfmE4oufJRaTc9PNLQl0ioAow== + dependencies: + "@types/node" "*" "@types/node@*": version "20.4.7" @@ -812,6 +814,13 @@ dependencies: undici-types "~5.26.4" +"@types/node@^20.9.0": + version "20.10.4" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.10.4.tgz#b246fd84d55d5b1b71bf51f964bd514409347198" + integrity sha512-D08YG6rr8X90YB56tSIuBaddy/UXAA9RKJoFvrsnogAum/0pmjkgi4+2nx96A330FmioegBWmEYQ+syqCFaveg== + dependencies: + undici-types "~5.26.4" + "@types/normalize-package-data@^2.4.0": version "2.4.1" resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz#d3357479a0fdfdd5907fe67e17e0a85c906e1301" @@ -822,12 +831,12 @@ resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0" integrity sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA== -"@types/semver@^7.3.12", "@types/semver@^7.5.0", "@types/semver@^7.5.4", "@types/semver@^7.5.6": +"@types/semver@^7.5.0", "@types/semver@^7.5.6": version "7.5.6" resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.6.tgz#c65b2bfce1bec346582c07724e3f8c1017a20339" integrity sha512-dn1l8LaMea/IjDoHNd9J52uBbInB796CDffS6VdIxvqYCPSG0V0DzHp76GpaWnlhg88uYyPbXCDIowa86ybd5A== -"@types/sinon@*", "@types/sinon@^10.0.20": +"@types/sinon@^10.0.20": version "10.0.20" resolved "https://registry.yarnpkg.com/@types/sinon/-/sinon-10.0.20.tgz#f1585debf4c0d99f9938f4111e5479fb74865146" integrity sha512-2APKKruFNCAZgx3daAyACGzWuJ028VVCUDk6o2rw/Z4PXT0ogwdV4KUegW0MwVs0Zu59auPXbbuBJHF12Sx1Eg== @@ -839,12 +848,10 @@ resolved "https://registry.yarnpkg.com/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.2.tgz#bf2e02a3dbd4aecaf95942ecd99b7402e03fad5e" integrity sha512-9GcLXF0/v3t80caGs5p2rRfkB+a8VBGLJZVih6CNFkx8IZ994wiKKLSRs9nuFwk1HevWs/1mnUmkApGrSGsShA== -"@types/through@*": - version "0.0.30" - resolved "https://registry.yarnpkg.com/@types/through/-/through-0.0.30.tgz#e0e42ce77e897bd6aead6f6ea62aeb135b8a3895" - integrity sha512-FvnCJljyxhPM3gkRgWmxmDZyAQSiBQQWLI0A0VFL0K7W1oRUrPJSqNO0NvTnLkBcotdlp3lKvaT0JrnyRDkzOg== - dependencies: - "@types/node" "*" +"@types/wrap-ansi@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@types/wrap-ansi/-/wrap-ansi-3.0.0.tgz#18b97a972f94f60a679fd5c796d96421b9abb9fd" + integrity sha512-ltIpx+kM7g/MLRZfkbL7EsCEjfzCcScLpkg37eXEtx5kmrAKBkTJwd1GIAjDSL8wTpM6Hzn5YO4pSb91BEwu1g== "@typescript-eslint/eslint-plugin@^6.10.0": version "6.11.0" @@ -874,14 +881,6 @@ "@typescript-eslint/visitor-keys" "6.11.0" debug "^4.3.4" -"@typescript-eslint/scope-manager@5.62.0": - version "5.62.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz#d9457ccc6a0b8d6b37d0eb252a23022478c5460c" - integrity sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w== - dependencies: - "@typescript-eslint/types" "5.62.0" - "@typescript-eslint/visitor-keys" "5.62.0" - "@typescript-eslint/scope-manager@6.11.0": version "6.11.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.11.0.tgz#621f603537c89f4d105733d949aa4d55eee5cea8" @@ -890,6 +889,14 @@ "@typescript-eslint/types" "6.11.0" "@typescript-eslint/visitor-keys" "6.11.0" +"@typescript-eslint/scope-manager@6.14.0": + version "6.14.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.14.0.tgz#53d24363fdb5ee0d1d8cda4ed5e5321272ab3d48" + integrity sha512-VT7CFWHbZipPncAZtuALr9y3EuzY1b1t1AEkIq2bTXUPKw+pHoXflGNG5L+Gv6nKul1cz1VH8fz16IThIU0tdg== + dependencies: + "@typescript-eslint/types" "6.14.0" + "@typescript-eslint/visitor-keys" "6.14.0" + "@typescript-eslint/type-utils@6.11.0": version "6.11.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-6.11.0.tgz#d0b8b1ab6c26b974dbf91de1ebc5b11fea24e0d1" @@ -900,28 +907,15 @@ debug "^4.3.4" ts-api-utils "^1.0.1" -"@typescript-eslint/types@5.62.0": - version "5.62.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.62.0.tgz#258607e60effa309f067608931c3df6fed41fd2f" - integrity sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ== - "@typescript-eslint/types@6.11.0": version "6.11.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.11.0.tgz#8ad3aa000cbf4bdc4dcceed96e9b577f15e0bf53" integrity sha512-ZbEzuD4DwEJxwPqhv3QULlRj8KYTAnNsXxmfuUXFCxZmO6CF2gM/y+ugBSAQhrqaJL3M+oe4owdWunaHM6beqA== -"@typescript-eslint/typescript-estree@5.62.0": - version "5.62.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz#7d17794b77fabcac615d6a48fb143330d962eb9b" - integrity sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA== - dependencies: - "@typescript-eslint/types" "5.62.0" - "@typescript-eslint/visitor-keys" "5.62.0" - debug "^4.3.4" - globby "^11.1.0" - is-glob "^4.0.3" - semver "^7.3.7" - tsutils "^3.21.0" +"@typescript-eslint/types@6.14.0": + version "6.14.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.14.0.tgz#935307f7a931016b7a5eb25d494ea3e1f613e929" + integrity sha512-uty9H2K4Xs8E47z3SnXEPRNDfsis8JO27amp2GNCnzGETEW3yTqEIVg5+AI7U276oGF/tw6ZA+UesxeQ104ceA== "@typescript-eslint/typescript-estree@6.11.0": version "6.11.0" @@ -936,6 +930,19 @@ semver "^7.5.4" ts-api-utils "^1.0.1" +"@typescript-eslint/typescript-estree@6.14.0": + version "6.14.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.14.0.tgz#90c7ddd45cd22139adf3d4577580d04c9189ac13" + integrity sha512-yPkaLwK0yH2mZKFE/bXkPAkkFgOv15GJAUzgUVonAbv0Hr4PK/N2yaA/4XQbTZQdygiDkpt5DkxPELqHguNvyw== + dependencies: + "@typescript-eslint/types" "6.14.0" + "@typescript-eslint/visitor-keys" "6.14.0" + debug "^4.3.4" + globby "^11.1.0" + is-glob "^4.0.3" + semver "^7.5.4" + ts-api-utils "^1.0.1" + "@typescript-eslint/utils@6.11.0": version "6.11.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.11.0.tgz#11374f59ef4cea50857b1303477c08aafa2ca604" @@ -949,27 +956,18 @@ "@typescript-eslint/typescript-estree" "6.11.0" semver "^7.5.4" -"@typescript-eslint/utils@^5.59.11": - version "5.62.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.62.0.tgz#141e809c71636e4a75daa39faed2fb5f4b10df86" - integrity sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ== +"@typescript-eslint/utils@^6.13.2": + version "6.14.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.14.0.tgz#856a9e274367d99ffbd39c48128b93a86c4261e3" + integrity sha512-XwRTnbvRr7Ey9a1NT6jqdKX8y/atWG+8fAIu3z73HSP8h06i3r/ClMhmaF/RGWGW1tHJEwij1uEg2GbEmPYvYg== dependencies: - "@eslint-community/eslint-utils" "^4.2.0" - "@types/json-schema" "^7.0.9" - "@types/semver" "^7.3.12" - "@typescript-eslint/scope-manager" "5.62.0" - "@typescript-eslint/types" "5.62.0" - "@typescript-eslint/typescript-estree" "5.62.0" - eslint-scope "^5.1.1" - semver "^7.3.7" - -"@typescript-eslint/visitor-keys@5.62.0": - version "5.62.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz#2174011917ce582875954ffe2f6912d5931e353e" - integrity sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw== - dependencies: - "@typescript-eslint/types" "5.62.0" - eslint-visitor-keys "^3.3.0" + "@eslint-community/eslint-utils" "^4.4.0" + "@types/json-schema" "^7.0.12" + "@types/semver" "^7.5.0" + "@typescript-eslint/scope-manager" "6.14.0" + "@typescript-eslint/types" "6.14.0" + "@typescript-eslint/typescript-estree" "6.14.0" + semver "^7.5.4" "@typescript-eslint/visitor-keys@6.11.0": version "6.11.0" @@ -979,6 +977,14 @@ "@typescript-eslint/types" "6.11.0" eslint-visitor-keys "^3.4.1" +"@typescript-eslint/visitor-keys@6.14.0": + version "6.14.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.14.0.tgz#1d1d486581819287de824a56c22f32543561138e" + integrity sha512-fB5cw6GRhJUz03MrROVuj5Zm/Q+XWlVdIsFj+Zb1Hvqouc8t+XP2H5y53QYU/MGtd2dPg6/vJJlhoX3xc2ehfw== + dependencies: + "@typescript-eslint/types" "6.14.0" + eslint-visitor-keys "^3.4.1" + "@ungap/structured-clone@^1.2.0": version "1.2.0" resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.0.tgz#756641adb587851b5ccb3e095daf27ae581c8406" @@ -1021,6 +1027,13 @@ agent-base@6: dependencies: debug "4" +agent-base@^7.0.2: + version "7.1.0" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-7.1.0.tgz#536802b76bc0b34aa50195eb2442276d613e3434" + integrity sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg== + dependencies: + debug "^4.3.4" + aggregate-error@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-3.1.0.tgz#92670ff50f5359bdb7a3e0d40d0ec30c5737687a" @@ -1066,6 +1079,11 @@ ansi-regex@^5.0.1: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== +ansi-regex@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-6.0.1.tgz#3183e38fae9a65d7cb5e53945cd5897d0260a06a" + integrity sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA== + ansi-sequence-parser@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/ansi-sequence-parser/-/ansi-sequence-parser-1.1.1.tgz#e0aa1cdcbc8f8bb0b5bca625aac41f5f056973cf" @@ -1085,6 +1103,11 @@ ansi-styles@^4.0.0, ansi-styles@^4.1.0, ansi-styles@^4.3.0: dependencies: color-convert "^2.0.1" +ansi-styles@^6.1.0: + version "6.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-6.2.1.tgz#0e62320cf99c21afff3b3012192546aacbfb05c5" + integrity sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug== + ansicolors@~0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/ansicolors/-/ansicolors-0.3.2.tgz#665597de86a9ffe3aa9bfbe6cae5c6ea426b4979" @@ -1275,15 +1298,6 @@ binary-extensions@^2.0.0: resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== -bl@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/bl/-/bl-4.1.0.tgz#451535264182bec2fbbc83a62ab98cf11d9f7b3a" - integrity sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w== - dependencies: - buffer "^5.5.0" - inherits "^2.0.4" - readable-stream "^3.4.0" - brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" @@ -1331,14 +1345,6 @@ buffer-from@^1.0.0: resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== -buffer@^5.5.0: - version "5.7.1" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" - integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== - dependencies: - base64-js "^1.3.1" - ieee754 "^1.1.13" - buffer@^6.0.3: version "6.0.3" resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" @@ -1455,7 +1461,7 @@ chalk@^3.0.0: ansi-styles "^4.1.0" supports-color "^7.1.0" -chalk@^4, chalk@^4.0.0, chalk@^4.0.2, chalk@^4.1.0, chalk@^4.1.1, chalk@^4.1.2: +chalk@^4.0.0, chalk@^4.0.2, chalk@^4.1.0, chalk@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== @@ -1463,6 +1469,11 @@ chalk@^4, chalk@^4.0.0, chalk@^4.0.2, chalk@^4.1.0, chalk@^4.1.1, chalk@^4.1.2: ansi-styles "^4.1.0" supports-color "^7.1.0" +chalk@^5.0.0, chalk@^5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.3.0.tgz#67c20a7ebef70e7f3970a01f90fa210cb6860385" + integrity sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w== + change-case@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/change-case/-/change-case-4.1.2.tgz#fedfc5f136045e2398c0410ee441f95704641e12" @@ -1546,16 +1557,21 @@ cli-progress@^3.12.0: dependencies: string-width "^4.2.3" -cli-spinners@^2.5.0: - version "2.9.0" - resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.9.0.tgz#5881d0ad96381e117bbe07ad91f2008fe6ffd8db" - integrity sha512-4/aL9X3Wh0yiMQlE+eeRhWP6vclO3QRtw1JHKIT0FFUs5FjpFmESqtMvYZ0+lbzBw900b95mS0hohy+qn2VK/g== +cli-spinners@^2.9.1: + version "2.9.2" + resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.9.2.tgz#1773a8f4b9c4d6ac31563df53b3fc1d79462fe41" + integrity sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg== cli-width@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-3.0.0.tgz#a2f48437a2caa9a22436e794bf071ec9e61cedf6" integrity sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw== +cli-width@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-4.1.0.tgz#42daac41d3c254ef38ad8ac037672130173691c5" + integrity sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ== + cliui@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/cliui/-/cliui-6.0.0.tgz#511d702c0c4e41ca156d7d0e96021f23e13225b1" @@ -1583,11 +1599,6 @@ cliui@^8.0.1: strip-ansi "^6.0.1" wrap-ansi "^7.0.0" -clone@^1.0.2: - version "1.0.4" - resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" - integrity sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg== - color-convert@^1.9.0: version "1.9.3" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" @@ -1685,14 +1696,12 @@ conventional-changelog-angular@^5.0.11: compare-func "^2.0.0" q "^1.5.1" -conventional-changelog-conventionalcommits@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-5.0.0.tgz#41bdce54eb65a848a4a3ffdca93e92fa22b64a86" - integrity sha512-lCDbA+ZqVFQGUj7h9QBKoIpLhl8iihkO0nCTyRNzuXtcd7ubODpYB04IFy31JloiJgG0Uovu8ot8oxRzn7Nwtw== +conventional-changelog-conventionalcommits@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-6.1.0.tgz#3bad05f4eea64e423d3d90fc50c17d2c8cf17652" + integrity sha512-3cS3GEtR78zTfMzk0AizXKKIdN4OvSh7ibNz6/DPbhWWQu7LqE/8+/GqSodV+sywUR2gpJAdP/1JFf4XtN7Zpw== dependencies: compare-func "^2.0.0" - lodash "^4.17.15" - q "^1.5.1" conventional-commits-parser@^3.2.2: version "3.2.4" @@ -1844,13 +1853,6 @@ default-require-extensions@^3.0.0: dependencies: strip-bom "^4.0.0" -defaults@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/defaults/-/defaults-1.0.4.tgz#b0b02062c1e2aa62ff5d9528f0f98baa90978d7a" - integrity sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A== - dependencies: - clone "^1.0.2" - define-data-property@^1.0.1, define-data-property@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.1.tgz#c35f7cd0ab09883480d12ac5cb213715587800b3" @@ -1883,11 +1885,6 @@ diff@^4.0.1, diff@^4.0.2: resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== -diff@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-5.1.0.tgz#bc52d298c5ea8df9194800224445ed43ffc87e40" - integrity sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw== - dir-glob@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" @@ -1909,6 +1906,36 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" +dom-serializer@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-2.0.0.tgz#e41b802e1eedf9f6cae183ce5e622d789d7d8e53" + integrity sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg== + dependencies: + domelementtype "^2.3.0" + domhandler "^5.0.2" + entities "^4.2.0" + +domelementtype@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.3.0.tgz#5c45e8e869952626331d7aab326d01daf65d589d" + integrity sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw== + +domhandler@^5.0.2, domhandler@^5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-5.0.3.tgz#cc385f7f751f1d1fc650c21374804254538c7d31" + integrity sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w== + dependencies: + domelementtype "^2.3.0" + +domutils@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/domutils/-/domutils-3.1.0.tgz#c47f551278d3dc4b0b1ab8cbb42d751a6f0d824e" + integrity sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA== + dependencies: + dom-serializer "^2.0.0" + domelementtype "^2.3.0" + domhandler "^5.0.3" + dot-case@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/dot-case/-/dot-case-3.0.4.tgz#9b2b670d00a431667a8a75ba29cd1b98809ce751" @@ -1924,6 +1951,11 @@ dot-prop@^5.1.0: dependencies: is-obj "^2.0.0" +eastasianwidth@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" + integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== + ecdsa-sig-formatter@1.0.11: version "1.0.11" resolved "https://registry.yarnpkg.com/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz#ae0f0fa2d85045ef14a817daa3ce9acd0489e5bf" @@ -1948,6 +1980,11 @@ emoji-regex@^8.0.0: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== +emoji-regex@^9.2.2: + version "9.2.2" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72" + integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg== + end-of-stream@^1.1.0: version "1.4.4" resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" @@ -1955,6 +1992,11 @@ end-of-stream@^1.1.0: dependencies: once "^1.4.0" +entities@^4.2.0, entities@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48" + integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw== + error-ex@^1.3.1: version "1.3.2" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" @@ -2042,6 +2084,11 @@ escalade@^3.1.1: resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== +escape-html@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" + integrity sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow== + escape-string-regexp@4.0.0, escape-string-regexp@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" @@ -2142,13 +2189,13 @@ eslint-plugin-jsdoc@^46.9.0: semver "^7.5.4" spdx-expression-parse "^3.0.1" -eslint-plugin-sf-plugin@^1.16.15: - version "1.16.15" - resolved "https://registry.yarnpkg.com/eslint-plugin-sf-plugin/-/eslint-plugin-sf-plugin-1.16.15.tgz#99d0b522bb7eebefc8e456aa4b725f6fbbf2fa01" - integrity sha512-Vog0xc8DwLOCoPbwFx9GxaXHqpG0FvlpITkGzp//SdjcV7wqVW4CT76JES8IGenGv6mAecW5VqSyQzsIHFZGew== +eslint-plugin-sf-plugin@^1.17.0: + version "1.17.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-sf-plugin/-/eslint-plugin-sf-plugin-1.17.0.tgz#9a7e81cb63bc6f36aae7c7797f95e2179def7fd3" + integrity sha512-grW7leP0FJbKQZgDjBZanLSTYrus0itKaEmoflEuqTZSyqH4feP53rHby5ysbOnw9OvgZfuq9NSc0a/CzcIbtQ== dependencies: - "@salesforce/core" "^5.3.20" - "@typescript-eslint/utils" "^5.59.11" + "@salesforce/core" "^6.4.0" + "@typescript-eslint/utils" "^6.13.2" eslint-plugin-unicorn@^49.0.0: version "49.0.0" @@ -2170,14 +2217,6 @@ eslint-plugin-unicorn@^49.0.0: semver "^7.5.4" strip-indent "^3.0.0" -eslint-scope@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" - integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== - dependencies: - esrecurse "^4.3.0" - estraverse "^4.1.1" - eslint-scope@^7.2.2: version "7.2.2" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.2.2.tgz#deb4f92563390f32006894af62a22dba1c46423f" @@ -2263,11 +2302,6 @@ esrecurse@^4.3.0: dependencies: estraverse "^5.2.0" -estraverse@^4.1.1: - version "4.3.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" - integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== - estraverse@^5.1.0, estraverse@^5.2.0: version "5.3.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" @@ -2318,6 +2352,11 @@ execa@^5.0.0: signal-exit "^3.0.3" strip-final-newline "^2.0.0" +extend@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" + integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== + external-editor@^3.0.3: version "3.1.0" resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495" @@ -2327,21 +2366,6 @@ external-editor@^3.0.3: iconv-lite "^0.4.24" tmp "^0.0.33" -fancy-test@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/fancy-test/-/fancy-test-3.0.1.tgz#8b19ed4ccc8b0625475eabf36fd743e1d0168abb" - integrity sha512-Ke1IFOGEBxP2dNg0X7ZYPUSwKSRr5GNn3xM/2DpHkP86riF3MFDpesXJuD1TGm7gcfwBtYpuSzuw3m704bThVg== - dependencies: - "@types/chai" "*" - "@types/lodash" "*" - "@types/node" "*" - "@types/sinon" "*" - lodash "^4.17.13" - mock-stdin "^1.0.0" - nock "^13.3.3" - sinon "^16.0.0" - stdout-stderr "^0.1.9" - fast-copy@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/fast-copy/-/fast-copy-3.0.1.tgz#9e89ef498b8c04c1cd76b33b8e14271658a732aa" @@ -2409,7 +2433,7 @@ faye@^1.4.0: tough-cookie "*" tunnel-agent "*" -figures@^3.0.0: +figures@^3.0.0, figures@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/figures/-/figures-3.2.0.tgz#625c18bd293c604dc4a8ddb2febf0c88341746af" integrity sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg== @@ -2495,6 +2519,14 @@ foreground-child@^2.0.0: cross-spawn "^7.0.0" signal-exit "^3.0.2" +foreground-child@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/foreground-child/-/foreground-child-3.1.1.tgz#1d173e776d75d2772fed08efe4a0de1ea1b12d0d" + integrity sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg== + dependencies: + cross-spawn "^7.0.0" + signal-exit "^4.0.1" + form-data@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" @@ -2557,6 +2589,16 @@ functions-have-names@^1.2.3: resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== +gaxios@^6.0.0: + version "6.1.1" + resolved "https://registry.yarnpkg.com/gaxios/-/gaxios-6.1.1.tgz#549629f86a13e756b900f9ff7c94624670102938" + integrity sha512-bw8smrX+XlAoo9o1JAksBwX+hi/RG15J+NTSxmNPIclKC3ZVK6C2afwY8OSdRvOK0+ZLecUJYtj2MmjOt3Dm0w== + dependencies: + extend "^3.0.2" + https-proxy-agent "^7.0.1" + is-stream "^2.0.0" + node-fetch "^2.6.9" + gensync@^1.0.0-beta.2: version "1.0.0-beta.2" resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" @@ -2644,6 +2686,17 @@ glob@7.2.0: once "^1.3.0" path-is-absolute "^1.0.0" +glob@^10.3.10: + version "10.3.10" + resolved "https://registry.yarnpkg.com/glob/-/glob-10.3.10.tgz#0351ebb809fd187fe421ab96af83d3a70715df4b" + integrity sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g== + dependencies: + foreground-child "^3.1.0" + jackspeak "^2.3.5" + minimatch "^9.0.1" + minipass "^5.0.0 || ^6.0.2 || ^7.0.0" + path-scurry "^1.10.1" + glob@^7.0.0, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6: version "7.2.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" @@ -2826,6 +2879,16 @@ html-escaper@^2.0.0: resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== +htmlparser2@^9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-9.0.0.tgz#e431142b7eeb1d91672742dea48af8ac7140cddb" + integrity sha512-uxbSI98wmFT/G4P2zXx4OVx04qWUmyFPrD2/CNepa2Zo3GPNaCaaxElDgwUrwYWkK1nr9fft0Ya8dws8coDLLQ== + dependencies: + domelementtype "^2.3.0" + domhandler "^5.0.3" + domutils "^3.1.0" + entities "^4.5.0" + http-parser-js@>=0.5.1: version "0.5.8" resolved "https://registry.yarnpkg.com/http-parser-js/-/http-parser-js-0.5.8.tgz#af23090d9ac4e24573de6f6aecc9d84a48bf20e3" @@ -2839,6 +2902,14 @@ https-proxy-agent@^5.0.0: agent-base "6" debug "4" +https-proxy-agent@^7.0.1: + version "7.0.2" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-7.0.2.tgz#e2645b846b90e96c6e6f347fb5b2e41f1590b09b" + integrity sha512-NmLNjm6ucYwtcUmL7JQC1ZQ57LmHP4lT15FQ8D61nak1rO6DH+fz5qNK2Ap5UN4ZapYICE3/0KodcLYSPsPbaA== + dependencies: + agent-base "^7.0.2" + debug "4" + human-signals@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3" @@ -2866,7 +2937,7 @@ iconv-lite@^0.4.24: dependencies: safer-buffer ">= 2.1.2 < 3" -ieee754@^1.1.13, ieee754@^1.2.1: +ieee754@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== @@ -2907,7 +2978,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.3: +inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.3: version "2.0.4" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== @@ -2936,27 +3007,6 @@ inquirer@^7.0.0: strip-ansi "^6.0.0" through "^2.3.6" -inquirer@^8.2.5: - version "8.2.6" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-8.2.6.tgz#733b74888195d8d400a67ac332011b5fae5ea562" - integrity sha512-M1WuAmb7pn9zdFRtQYk26ZBoY043Sse0wVDdk4Bppr+JOXyQYybdtvK+l9wUibhtjdjvtoiNy8tk+EgsYIUqKg== - dependencies: - ansi-escapes "^4.2.1" - chalk "^4.1.1" - cli-cursor "^3.1.0" - cli-width "^3.0.0" - external-editor "^3.0.3" - figures "^3.0.0" - lodash "^4.17.21" - mute-stream "0.0.8" - ora "^5.4.1" - run-async "^2.4.0" - rxjs "^7.5.5" - string-width "^4.1.0" - strip-ansi "^6.0.0" - through "^2.3.6" - wrap-ansi "^6.0.1" - internal-slot@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.5.tgz#f2a2ee21f668f8627a4667f309dc0f4fb6674986" @@ -3060,11 +3110,6 @@ is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: dependencies: is-extglob "^2.1.1" -is-interactive@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-interactive/-/is-interactive-1.0.0.tgz#cea6e6ae5c870a7b0a0004070b7b587e0252912e" - integrity sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w== - is-negative-zero@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.2.tgz#7bf6f03a28003b8b3965de3ac26f664d765f3150" @@ -3259,6 +3304,15 @@ istanbul-reports@^3.0.2: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" +jackspeak@^2.3.5: + version "2.3.6" + resolved "https://registry.yarnpkg.com/jackspeak/-/jackspeak-2.3.6.tgz#647ecc472238aee4b06ac0e461acc21a8c505ca8" + integrity sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ== + dependencies: + "@isaacs/cliui" "^8.0.2" + optionalDependencies: + "@pkgjs/parseargs" "^0.11.0" + jake@^10.8.5: version "10.8.7" resolved "https://registry.yarnpkg.com/jake/-/jake-10.8.7.tgz#63a32821177940c33f356e0ba44ff9d34e1c7d8f" @@ -3321,7 +3375,7 @@ jsesc@~0.5.0: resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" integrity sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA== -jsforce@^2.0.0-beta.28, jsforce@^2.0.0-beta.29: +jsforce@^2.0.0-beta.29: version "2.0.0-beta.29" resolved "https://registry.yarnpkg.com/jsforce/-/jsforce-2.0.0-beta.29.tgz#0b59b026eb0b90dfb199a53656af32a4c8acc48f" integrity sha512-Fq7xjOYOikyozZZDQNTfzsAdhcO0rUXwtavsjM+cCYUFiCMVOJJavgco303zOsJk3v8sdAYnGgHyKckLIhnyAg== @@ -3367,11 +3421,6 @@ json-stable-stringify-without-jsonify@^1.0.1: resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== -json-stringify-safe@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" - integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA== - json5@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.2.tgz#63d98d60f21b313b77c4d6da18bfa69d80e1d593" @@ -3483,6 +3532,22 @@ lines-and-columns@^1.1.6: resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== +linkinator@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/linkinator/-/linkinator-6.0.2.tgz#6a33df3372894a2fa3b25f80f2cd5e6bb9f73e7d" + integrity sha512-28eiQVzGwaCvVUb/cxii5jraWZYUv5n2Q5CaSRUH9oGDo1Jr8GcREnpw/0IfJ5YTRoIt9/ihra2lG8yqCN292g== + dependencies: + chalk "^5.0.0" + escape-html "^1.0.3" + gaxios "^6.0.0" + glob "^10.3.10" + htmlparser2 "^9.0.0" + marked "^10.0.0" + meow "^12.0.1" + mime "^3.0.0" + server-destroy "^1.0.1" + srcset "^5.0.0" + locate-path@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" @@ -3587,12 +3652,12 @@ lodash.upperfirst@^4.3.1: resolved "https://registry.yarnpkg.com/lodash.upperfirst/-/lodash.upperfirst-4.3.1.tgz#1365edf431480481ef0d1c68957a5ed99d49f7ce" integrity sha512-sReKOYJIJf74dhJONhU4e0/shzi1trVbSWDOhKYE5XV2O+H7Sb2Dihwuc7xWxVl+DgFPyTqIN3zMfT9cq5iWDg== -lodash@^4.17.13, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.21: +lodash@^4.17.15, lodash@^4.17.19: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== -log-symbols@4.1.0, log-symbols@^4.1.0: +log-symbols@4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== @@ -3628,6 +3693,11 @@ lru-cache@^6.0.0: dependencies: yallist "^4.0.0" +"lru-cache@^9.1.1 || ^10.0.0": + version "10.1.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.1.0.tgz#2098d41c2dc56500e6c88584aa656c84de7d0484" + integrity sha512-/1clY/ui8CzjKFyjdvwPWJUYKiFVXG2I2cY0ssG7h4+hwk+XOIX7ZSG9Q7TW8TW3Kp3BUSqgFWBLgL4PJ+Blag== + lunr@^2.3.9: version "2.3.9" resolved "https://registry.yarnpkg.com/lunr/-/lunr-2.3.9.tgz#18b123142832337dd6e964df1a5a7707b25d35e1" @@ -3662,11 +3732,21 @@ map-obj@^4.0.0: resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-4.3.0.tgz#9304f906e93faae70880da102a9f1df0ea8bb05a" integrity sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ== +marked@^10.0.0: + version "10.0.0" + resolved "https://registry.yarnpkg.com/marked/-/marked-10.0.0.tgz#7fe1805bb908433d760e2de0fcc8841a2b2d745c" + integrity sha512-YiGcYcWj50YrwBgNzFoYhQ1hT6GmQbFG8SksnYJX1z4BXTHSOrz1GB5/Jm2yQvMg4nN1FHP4M6r03R10KrVUiA== + marked@^4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/marked/-/marked-4.3.0.tgz#796362821b019f734054582038b116481b456cf3" integrity sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A== +meow@^12.0.1: + version "12.1.1" + resolved "https://registry.yarnpkg.com/meow/-/meow-12.1.1.tgz#e558dddbab12477b69b2e9a2728c327f191bace6" + integrity sha512-BhXM0Au22RwUneMPwSCnyhTOizdWoIEPU9sp0Aqa1PnDMR5Wv2FGXYDjuzJEIX+Eo2Rb8xuYe5jrnm5QowQFkw== + meow@^8.0.0: version "8.1.2" resolved "https://registry.yarnpkg.com/meow/-/meow-8.1.2.tgz#bcbe45bda0ee1729d350c03cffc8395a36c4e897" @@ -3714,6 +3794,11 @@ mime-types@^2.1.12: dependencies: mime-db "1.52.0" +mime@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/mime/-/mime-3.0.0.tgz#b374550dca3a0c18443b0c950a6a58f1931cf7a7" + integrity sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A== + mimic-fn@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" @@ -3745,7 +3830,7 @@ minimatch@^5.0.1: dependencies: brace-expansion "^2.0.1" -minimatch@^9.0.3: +minimatch@^9.0.1, minimatch@^9.0.3: version "9.0.3" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.3.tgz#a6e00c3de44c3a542bfaae70abfc22420a6da825" integrity sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg== @@ -3766,6 +3851,11 @@ minimist@^1.2.0, minimist@^1.2.6: resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== +"minipass@^5.0.0 || ^6.0.2 || ^7.0.0": + version "7.0.4" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-7.0.4.tgz#dbce03740f50a4786ba994c1fb908844d27b038c" + integrity sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ== + mocha@^10.2.0: version "10.2.0" resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.2.0.tgz#1fd4a7c32ba5ac372e03a17eef435bd00e5c68b8" @@ -3793,11 +3883,6 @@ mocha@^10.2.0: yargs-parser "20.2.4" yargs-unparser "2.0.0" -mock-stdin@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/mock-stdin/-/mock-stdin-1.0.0.tgz#efcfaf4b18077e14541742fd758b9cae4e5365ea" - integrity sha512-tukRdb9Beu27t6dN+XztSRHq9J0B/CoAOySGzHfn8UTfmqipA5yNT/sDUEyYdAV3Hpka6Wx6kOMxuObdOex60Q== - mri@^1.1.5: version "1.2.0" resolved "https://registry.yarnpkg.com/mri/-/mri-1.2.0.tgz#6721480fec2a11a4889861115a48b6cbe7cc8f0b" @@ -3837,6 +3922,11 @@ mute-stream@0.0.8: resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== +mute-stream@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-1.0.0.tgz#e31bd9fe62f0aed23520aa4324ea6671531e013e" + integrity sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA== + nanoid@3.3.3: version "3.3.3" resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.3.tgz#fd8e8b7aa761fe807dba2d1b98fb7241bb724a25" @@ -3863,17 +3953,6 @@ nise@^4.1.0: just-extend "^4.0.2" path-to-regexp "^1.7.0" -nise@^5.1.4: - version "5.1.5" - resolved "https://registry.yarnpkg.com/nise/-/nise-5.1.5.tgz#f2aef9536280b6c18940e32ba1fbdc770b8964ee" - integrity sha512-VJuPIfUFaXNRzETTQEEItTOP8Y171ijr+JLq42wHes3DiryR8vT+1TXQW/Rx8JNUhyYYWyIvjXTU6dOhJcs9Nw== - dependencies: - "@sinonjs/commons" "^2.0.0" - "@sinonjs/fake-timers" "^10.0.2" - "@sinonjs/text-encoding" "^0.7.1" - just-extend "^4.0.2" - path-to-regexp "^1.7.0" - no-case@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/no-case/-/no-case-3.0.4.tgz#d361fd5c9800f558551a8369fc0dcd4662b6124d" @@ -3882,20 +3961,10 @@ no-case@^3.0.4: lower-case "^2.0.2" tslib "^2.0.3" -nock@^13.3.3: - version "13.3.3" - resolved "https://registry.yarnpkg.com/nock/-/nock-13.3.3.tgz#179759c07d3f88ad3e794ace885629c1adfd3fe7" - integrity sha512-z+KUlILy9SK/RjpeXDiDUEAq4T94ADPHE3qaRkf66mpEhzc/ytOMm3Bwdrbq6k1tMWkbdujiKim3G2tfQARuJw== - dependencies: - debug "^4.1.0" - json-stringify-safe "^5.0.1" - lodash "^4.17.21" - propagate "^2.0.0" - -node-fetch@^2.6.1: - version "2.6.12" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.12.tgz#02eb8e22074018e3d5a83016649d04df0e348fba" - integrity sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g== +node-fetch@^2.6.1, node-fetch@^2.6.9: + version "2.7.0" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" + integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== dependencies: whatwg-url "^5.0.0" @@ -4068,21 +4137,6 @@ optionator@^0.9.3: prelude-ls "^1.2.1" type-check "^0.4.0" -ora@^5.4.1: - version "5.4.1" - resolved "https://registry.yarnpkg.com/ora/-/ora-5.4.1.tgz#1b2678426af4ac4a509008e5e4ac9e9959db9e18" - integrity sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ== - dependencies: - bl "^4.1.0" - chalk "^4.1.0" - cli-cursor "^3.1.0" - cli-spinners "^2.5.0" - is-interactive "^1.0.0" - is-unicode-supported "^0.1.0" - log-symbols "^4.1.0" - strip-ansi "^6.0.0" - wcwidth "^1.0.1" - os-tmpdir@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" @@ -4212,6 +4266,14 @@ path-parse@^1.0.7: resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== +path-scurry@^1.10.1: + version "1.10.1" + resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-1.10.1.tgz#9ba6bf5aa8500fe9fd67df4f0d9483b2b0bfc698" + integrity sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ== + dependencies: + lru-cache "^9.1.1 || ^10.0.0" + minipass "^5.0.0 || ^6.0.2 || ^7.0.0" + path-to-regexp@^1.7.0: version "1.8.0" resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-1.8.0.tgz#887b3ba9d84393e87a0a0b9f4cb756198b53548a" @@ -4272,7 +4334,7 @@ pino-std-serializers@^6.0.0: resolved "https://registry.yarnpkg.com/pino-std-serializers/-/pino-std-serializers-6.2.2.tgz#d9a9b5f2b9a402486a5fc4db0a737570a860aab3" integrity sha512-cHjPPsE+vhj/tnhCy/wiMh3M3z3h/j15zHQX+S9GkTBgqJuTuJzYJ4gUyACLhDaJ7kk9ba9iRDmbH2tJU03OiA== -pino@^8.16.0, pino@^8.16.2: +pino@^8.16.2: version "8.16.2" resolved "https://registry.yarnpkg.com/pino/-/pino-8.16.2.tgz#7a906f2d9a8c5b4c57412c9ca95d6820bd2090cd" integrity sha512-2advCDGVEvkKu9TTVSa/kWW7Z3htI/sBKEZpqiHk6ive0i/7f5b1rsU8jn0aimxqfnSz5bj/nOYkwhBUn5xxvg== @@ -4345,11 +4407,6 @@ process@^0.11.10: resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" integrity sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A== -propagate@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/propagate/-/propagate-2.0.1.tgz#40cdedab18085c792334e64f0ac17256d38f9a45" - integrity sha512-vGrhOavPSTz4QVNuBNdcNXePNdNMaO1xj9yBeH1ScQPjk/rhg9sSlCXPhMkFuaNNW/syTvYqsnbIJxMBfRbbag== - proper-lockfile@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/proper-lockfile/-/proper-lockfile-4.1.2.tgz#c8b9de2af6b2f1601067f98e01ac66baa223141f" @@ -4604,6 +4661,11 @@ run-async@^2.4.0: resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.1.tgz#8440eccf99ea3e70bd409d49aab88e10c189a455" integrity sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ== +run-async@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/run-async/-/run-async-3.0.0.tgz#42a432f6d76c689522058984384df28be379daad" + integrity sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q== + run-parallel@^1.1.9: version "1.2.0" resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" @@ -4618,13 +4680,6 @@ rxjs@^6.6.0: dependencies: tslib "^1.9.0" -rxjs@^7.2.0, rxjs@^7.5.5: - version "7.8.1" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.8.1.tgz#6f6f3d99ea8044291efd92e7c7fcf562c4057543" - integrity sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg== - dependencies: - tslib "^2.1.0" - safe-array-concat@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/safe-array-concat/-/safe-array-concat-1.0.1.tgz#91686a63ce3adbea14d61b14c99572a8ff84754c" @@ -4691,7 +4746,7 @@ semver@^6.0.0, semver@^6.3.0, semver@^6.3.1: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== -semver@^7.3.4, semver@^7.3.7, semver@^7.5.3, semver@^7.5.4: +semver@^7.3.4, semver@^7.5.3, semver@^7.5.4: version "7.5.4" resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== @@ -4719,6 +4774,11 @@ serialize-javascript@6.0.0: dependencies: randombytes "^2.1.0" +server-destroy@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/server-destroy/-/server-destroy-1.0.1.tgz#f13bf928e42b9c3e79383e61cc3998b5d14e6cdd" + integrity sha512-rb+9B5YBIEzYcD6x2VKidaa+cqYBJQKnU4oe4E3ANwRRN56yk/ua1YCJT1n21NTS8w6CcOclAKNP3PhdCXKYtQ== + set-blocking@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" @@ -4760,7 +4820,7 @@ shebang-regex@^3.0.0: resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== -shelljs@0.8.5, shelljs@^0.8.5: +shelljs@^0.8.5: version "0.8.5" resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.5.tgz#de055408d8361bed66c669d2f000538ced8ee20c" integrity sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow== @@ -4793,6 +4853,11 @@ signal-exit@^3.0.2, signal-exit@^3.0.3: resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== +signal-exit@^4.0.1, signal-exit@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.1.0.tgz#952188c1cbd546070e2dd20d0f41c0ae0530cb04" + integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw== + simple-swizzle@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/simple-swizzle/-/simple-swizzle-0.2.2.tgz#a4da6b635ffcccca33f70d17cb92592de95e557a" @@ -4812,18 +4877,6 @@ sinon@10.0.0: nise "^4.1.0" supports-color "^7.1.0" -sinon@^16.0.0: - version "16.1.3" - resolved "https://registry.yarnpkg.com/sinon/-/sinon-16.1.3.tgz#b760ddafe785356e2847502657b4a0da5501fba8" - integrity sha512-mjnWWeyxcAf9nC0bXcPmiDut+oE8HYridTNzBbF98AYVLmWwGRp2ISEpyhYflG1ifILT+eNn3BmKUJPxjXUPlA== - dependencies: - "@sinonjs/commons" "^3.0.0" - "@sinonjs/fake-timers" "^10.3.0" - "@sinonjs/samsam" "^8.0.0" - diff "^5.1.0" - nise "^5.1.4" - supports-color "^7.2.0" - slash@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" @@ -4921,15 +4974,12 @@ sprintf-js@~1.0.2: resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g== -stdout-stderr@^0.1.9: - version "0.1.13" - resolved "https://registry.yarnpkg.com/stdout-stderr/-/stdout-stderr-0.1.13.tgz#54e3450f3d4c54086a49c0c7f8786a44d1844b6f" - integrity sha512-Xnt9/HHHYfjZ7NeQLvuQDyL1LnbsbddgMFKCuaQKwGCdJm8LnstZIXop+uOY36UR1UXXoHXfMbC1KlVdVd2JLA== - dependencies: - debug "^4.1.1" - strip-ansi "^6.0.0" +srcset@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/srcset/-/srcset-5.0.0.tgz#9df6c3961b5b44a02532ce6ae4544832609e2e3f" + integrity sha512-SqEZaAEhe0A6ETEa9O1IhSPC7MdvehZtCnTR0AftXk3QhY2UNgb+NApFOUPZILXk/YTDfFxMTNJOBpzrJsEdIA== -string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -4938,6 +4988,15 @@ string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2 is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" +string-width@^5.0.1, string-width@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" + integrity sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA== + dependencies: + eastasianwidth "^0.2.0" + emoji-regex "^9.2.2" + strip-ansi "^7.0.1" + string.prototype.trim@^1.2.8: version "1.2.8" resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.8.tgz#f9ac6f8af4bd55ddfa8895e6aea92a96395393bd" @@ -4979,13 +5038,20 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -strip-ansi@6.0.1, strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== dependencies: ansi-regex "^5.0.1" +strip-ansi@^7.0.1: + version "7.1.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" + integrity sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ== + dependencies: + ansi-regex "^6.0.1" + strip-bom@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" @@ -5027,7 +5093,7 @@ supports-color@^5.3.0: dependencies: has-flag "^3.0.0" -supports-color@^7.0.0, supports-color@^7.1.0, supports-color@^7.2.0: +supports-color@^7.0.0, supports-color@^7.1.0: version "7.2.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== @@ -5129,7 +5195,7 @@ ts-api-utils@^1.0.1: resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-1.0.3.tgz#f12c1c781d04427313dbac808f453f050e54a331" integrity sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg== -ts-node@^10.8.1, ts-node@^10.9.1, ts-node@^10.9.2: +ts-node@^10.8.1, ts-node@^10.9.2: version "10.9.2" resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.2.tgz#70f021c9e185bccdca820e26dc413805c101c71f" integrity sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ== @@ -5168,23 +5234,16 @@ tsconfig-paths@^3.14.2: minimist "^1.2.6" strip-bom "^3.0.0" -tslib@^1.8.1, tslib@^1.9.0: +tslib@^1.9.0: version "1.14.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2.0.3, tslib@^2.1.0, tslib@^2.6.2: +tslib@^2.0.3, tslib@^2.6.2: version "2.6.2" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== -tsutils@^3.21.0: - version "3.21.0" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623" - integrity sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA== - dependencies: - tslib "^1.8.1" - tunnel-agent@*: version "0.6.0" resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" @@ -5300,6 +5359,11 @@ typescript@^4.9.5: resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== +typescript@^5.3.3: + version "5.3.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.3.3.tgz#b3ce6ba258e72e6305ba66f5c9b452aaee3ffe37" + integrity sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw== + unbox-primitive@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.2.tgz#29032021057d5e6cdbd08c5129c226dff8ed6f9e" @@ -5400,13 +5464,6 @@ vscode-textmate@^8.0.0: resolved "https://registry.yarnpkg.com/vscode-textmate/-/vscode-textmate-8.0.0.tgz#2c7a3b1163ef0441097e0b5d6389cd5504b59e5d" integrity sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg== -wcwidth@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" - integrity sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg== - dependencies: - defaults "^1.0.3" - webidl-conversions@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" @@ -5496,24 +5553,33 @@ workerpool@6.2.1: resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343" integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw== -wrap-ansi@^6.0.1, wrap-ansi@^6.2.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" - integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA== +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== dependencies: ansi-styles "^4.0.0" string-width "^4.1.0" strip-ansi "^6.0.0" -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== +wrap-ansi@^6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" + integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA== dependencies: ansi-styles "^4.0.0" string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" + integrity sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ== + dependencies: + ansi-styles "^6.1.0" + string-width "^5.0.1" + strip-ansi "^7.0.1" + wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" From 9e8bf67394ffd3c10e64ab2479b631d92d58f617 Mon Sep 17 00:00:00 2001 From: mshanemc Date: Wed, 3 Jan 2024 11:04:49 -0600 Subject: [PATCH 02/16] refactor: changes from live code review with Mike --- src/flags/flags.ts | 1 + src/sfCommand.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/flags/flags.ts b/src/flags/flags.ts index 480837b4..e3ac6ffa 100644 --- a/src/flags/flags.ts +++ b/src/flags/flags.ts @@ -18,6 +18,7 @@ export const Flags = { file: OclifFlags.file, integer: OclifFlags.integer, string: OclifFlags.string, + option: OclifFlags.option, url: OclifFlags.url, custom: OclifFlags.custom, duration: durationFlag, diff --git a/src/sfCommand.ts b/src/sfCommand.ts index 5fc1a5a6..f0746527 100644 --- a/src/sfCommand.ts +++ b/src/sfCommand.ts @@ -371,7 +371,7 @@ export abstract class SfCommand extends Command { } // eslint-disable-next-line @typescript-eslint/require-await - protected async catch(error: Error | SfError | ns.Error): Promise { + protected async catch(error: Error | SfError | ns.Error): Promise { // stop any spinners to prevent it from unintentionally swallowing output. // If there is an active spinner, it'll say "Error" instead of "Done" this.spinner.stop(StandardColors.error('Error')); From e4a4e2c5d49d8628e1dcf4b34ea9917a959e956f Mon Sep 17 00:00:00 2001 From: mshanemc Date: Wed, 3 Jan 2024 11:12:13 -0600 Subject: [PATCH 03/16] chore: bump oclif/core --- package.json | 2 +- yarn.lock | 42 ++++++++++++++++-------------------------- 2 files changed, 17 insertions(+), 27 deletions(-) diff --git a/package.json b/package.json index a9d875c7..da97994d 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "dependencies": { "@inquirer/confirm": "^2.0.15", "@inquirer/password": "^1.1.14", - "@oclif/core": "^3.14.1", + "@oclif/core": "^3.16.0", "@salesforce/core": "^6.4.1", "@salesforce/kit": "^3.0.15", "@salesforce/ts-types": "^2.0.9", diff --git a/yarn.lock b/yarn.lock index f19598e2..2986f386 100644 --- a/yarn.lock +++ b/yarn.lock @@ -588,10 +588,10 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@oclif/core@^3.14.1": - version "3.14.1" - resolved "https://registry.yarnpkg.com/@oclif/core/-/core-3.14.1.tgz#634fc96124068e47b720d62f3b278d818a07495e" - integrity sha512-HLFL2s45DFdqYI2CFjVS/CIQ4cQ4yZqH0XqO9nnwcRWYboz2rEW/vLmidjIYGDjh6xA/k5psiAL3O1KEjqSHuQ== +"@oclif/core@^3.16.0": + version "3.16.0" + resolved "https://registry.yarnpkg.com/@oclif/core/-/core-3.16.0.tgz#682657cb5e4a3262a47e26e0c8a7bf0343acaf76" + integrity sha512-/PIz+udzb59XE8O/bQvqlCtXy6RByEHH0KsrAJNa/ZrqtdsLmeDNJcHdgygFHx+nz+PYMoUzsyzJMau++EDNoQ== dependencies: ansi-escapes "^4.3.2" ansi-styles "^4.3.0" @@ -610,7 +610,7 @@ js-yaml "^3.14.1" natural-orderby "^2.0.3" object-treeify "^1.1.33" - password-prompt "^1.1.2" + password-prompt "^1.1.3" slice-ansi "^4.0.0" string-width "^4.2.3" strip-ansi "^6.0.1" @@ -797,10 +797,12 @@ dependencies: "@types/node" "*" -"@types/node@*": - version "20.4.7" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.4.7.tgz#74d323a93f1391a63477b27b9aec56669c98b2ab" - integrity sha512-bUBrPjEry2QUTsnuEjzjbS7voGWCc30W0qzgMf90GPeDGFRakvrz47ju+oqDAKCXLUCe39u57/ORMl/O/04/9g== +"@types/node@*", "@types/node@^20.9.0": + version "20.10.4" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.10.4.tgz#b246fd84d55d5b1b71bf51f964bd514409347198" + integrity sha512-D08YG6rr8X90YB56tSIuBaddy/UXAA9RKJoFvrsnogAum/0pmjkgi4+2nx96A330FmioegBWmEYQ+syqCFaveg== + dependencies: + undici-types "~5.26.4" "@types/node@^12.19.9": version "12.20.55" @@ -814,13 +816,6 @@ dependencies: undici-types "~5.26.4" -"@types/node@^20.9.0": - version "20.10.4" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.10.4.tgz#b246fd84d55d5b1b71bf51f964bd514409347198" - integrity sha512-D08YG6rr8X90YB56tSIuBaddy/UXAA9RKJoFvrsnogAum/0pmjkgi4+2nx96A330FmioegBWmEYQ+syqCFaveg== - dependencies: - undici-types "~5.26.4" - "@types/normalize-package-data@^2.4.0": version "2.4.1" resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz#d3357479a0fdfdd5907fe67e17e0a85c906e1301" @@ -4230,7 +4225,7 @@ pascal-case@^3.1.2: no-case "^3.0.4" tslib "^2.0.3" -password-prompt@^1.1.2: +password-prompt@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/password-prompt/-/password-prompt-1.1.3.tgz#05e539f4e7ca4d6c865d479313f10eb9db63ee5f" integrity sha512-HkrjG2aJlvF0t2BMH0e2LB/EHf3Lcq3fNMzy4GYHcQblAvOl+QQji1Lx7WRBMqpVK8p+KR7bCg7oqAMXtdgqyw== @@ -5349,21 +5344,16 @@ typedoc@^0.25.3: minimatch "^9.0.3" shiki "^0.14.1" -"typescript@^4.6.4 || ^5.0.0": - version "5.1.6" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.1.6.tgz#02f8ac202b6dad2c0dd5e0913745b47a37998274" - integrity sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA== +"typescript@^4.6.4 || ^5.0.0", typescript@^5.3.3: + version "5.3.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.3.3.tgz#b3ce6ba258e72e6305ba66f5c9b452aaee3ffe37" + integrity sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw== typescript@^4.9.5: version "4.9.5" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== -typescript@^5.3.3: - version "5.3.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.3.3.tgz#b3ce6ba258e72e6305ba66f5c9b452aaee3ffe37" - integrity sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw== - unbox-primitive@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.2.tgz#29032021057d5e6cdbd08c5129c226dff8ed6f9e" From c85d1941970f34de5a107e39d50bb03fda012e8b Mon Sep 17 00:00:00 2001 From: mshanemc Date: Thu, 4 Jan 2024 08:07:28 -0600 Subject: [PATCH 04/16] refactor: handing process error from QA --- src/errorFormatting.ts | 2 +- src/prompts.ts | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/errorFormatting.ts b/src/errorFormatting.ts index d4609a75..8841fd7a 100644 --- a/src/errorFormatting.ts +++ b/src/errorFormatting.ts @@ -31,7 +31,7 @@ const messages = Messages.loadMessages('@salesforce/sf-plugins-core', 'messages' */ export const formatActions = ( actions: string[], - options: { actionColor: typeof chalk } = { actionColor: StandardColors.info } + options: { actionColor: chalk.Chalk } = { actionColor: StandardColors.info } ): string[] => actions.length ? [ diff --git a/src/prompts.ts b/src/prompts.ts index b3c0dc71..b96a03b4 100644 --- a/src/prompts.ts +++ b/src/prompts.ts @@ -36,10 +36,9 @@ export const secretPrompt = async ({ message, ms = 60_000 }: PromptInputs(answer: CancelablePromise, ms: number, defaultAnswer?: T): Promise => { - await setTimeout(ms); - answer.cancel(); - - if (typeof defaultAnswer !== 'undefined') return defaultAnswer; - throw new SfError('Prompt timed out.'); -}; +const handleTimeout = async (answer: CancelablePromise, ms: number, defaultAnswer?: T): Promise => + setTimeout(ms, undefined, { ref: false }).then(() => { + answer.cancel(); + if (typeof defaultAnswer !== 'undefined') return defaultAnswer; + throw new SfError('Prompt timed out.'); + }); From 2f411ecf796500bce58fc95fa1f6a8cd391eadf4 Mon Sep 17 00:00:00 2001 From: mshanemc Date: Thu, 4 Jan 2024 08:07:58 -0600 Subject: [PATCH 05/16] refactor: rename prompt stub for consistency --- src/stubUx.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stubUx.ts b/src/stubUx.ts index 57b102d0..7985c369 100644 --- a/src/stubUx.ts +++ b/src/stubUx.ts @@ -118,7 +118,7 @@ export function stubSpinner(sandbox: SinonSandbox) { */ export function stubPrompter(sandbox: SinonSandbox) { return { - prompt: sandbox.stub(SfCommand.prototype, 'secretPrompt'), + secret: sandbox.stub(SfCommand.prototype, 'secretPrompt'), confirm: sandbox.stub(SfCommand.prototype, 'confirm'), }; } From d5b3ebc8b90fbccb16cad3374f8c7250e0528050 Mon Sep 17 00:00:00 2001 From: mshanemc Date: Thu, 4 Jan 2024 09:35:00 -0600 Subject: [PATCH 06/16] docs: prompts --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 134f8c7e..2e3b0a16 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,7 @@ The SfCommand abstract class extends [@oclif/core's Command class](https://githu - Provides functions that help place success messages, warnings and errors into the correct location in JSON results - Enables additional help sections to the standard oclif command help output - Provides access to the [cli-ux cli actions](https://github.com/oclif/cli-ux#cliaction). This avoids having to import that interface from cli-ux and manually handling the `--json` flag. - -## Prompts +- Provides simple, stubbable prompts for confirmation and secrets ## Flags From bd20e601a385d3ef70e93989e692db1f0933982a Mon Sep 17 00:00:00 2001 From: mshanemc Date: Thu, 4 Jan 2024 09:45:49 -0600 Subject: [PATCH 07/16] chore: correct chalk types for esm/v5 --- src/errorFormatting.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/errorFormatting.ts b/src/errorFormatting.ts index 8841fd7a..1d2a8f92 100644 --- a/src/errorFormatting.ts +++ b/src/errorFormatting.ts @@ -6,8 +6,8 @@ */ import { Mode, Messages, envVars } from '@salesforce/core'; -import chalk from 'chalk'; -import { StandardColors } from './exported.js'; +import type { ChalkInstance } from 'chalk'; +import { StandardColors } from './ux/standardColors.js'; import { SfCommand } from './sfCommandNamespace.js'; Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); @@ -31,7 +31,7 @@ const messages = Messages.loadMessages('@salesforce/sf-plugins-core', 'messages' */ export const formatActions = ( actions: string[], - options: { actionColor: chalk.Chalk } = { actionColor: StandardColors.info } + options: { actionColor: ChalkInstance } = { actionColor: StandardColors.info } ): string[] => actions.length ? [ From 1c12937b515edd1d852171345e1619d794e28ffa Mon Sep 17 00:00:00 2001 From: svc-cli-bot Date: Thu, 4 Jan 2024 17:27:51 +0000 Subject: [PATCH 08/16] chore(release): 5.0.14-dev.0 [skip ci] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 63a326f7..d6ccadc4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@salesforce/sf-plugins-core", - "version": "5.0.13", + "version": "5.0.14-dev.0", "description": "Utils for writing Salesforce CLI plugins", "main": "lib/exported", "types": "lib/exported.d.ts", From ff536d3e21d783c92ef89619d63f240f9263d344 Mon Sep 17 00:00:00 2001 From: mshanemc Date: Thu, 4 Jan 2024 14:08:24 -0600 Subject: [PATCH 09/16] refactor: move prompts to ux and export --- src/exported.ts | 1 + src/sfCommand.ts | 2 +- src/{ => ux}/prompts.ts | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) rename src/{ => ux}/prompts.ts (97%) diff --git a/src/exported.ts b/src/exported.ts index c2392aa8..b2343008 100644 --- a/src/exported.ts +++ b/src/exported.ts @@ -15,3 +15,4 @@ export { SfCommand, SfCommandInterface } from './sfCommand.js'; export * from './compatibility.js'; export * from './stubUx.js'; export { Flags } from './flags/flags.js'; +export { prompts } from './ux/prompts.js'; diff --git a/src/sfCommand.ts b/src/sfCommand.ts index f0746527..46f20d87 100644 --- a/src/sfCommand.ts +++ b/src/sfCommand.ts @@ -22,7 +22,7 @@ import { Ux } from './ux/ux.js'; import { SfCommand as ns } from './sfCommandNamespace.js'; import { formatActions, formatError } from './errorFormatting.js'; import { StandardColors } from './ux/standardColors.js'; -import { confirm, secretPrompt, PromptInputs } from './prompts.js'; +import { confirm, secretPrompt, PromptInputs } from './ux/prompts.js'; import { removeEmpty } from './util.js'; Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); diff --git a/src/prompts.ts b/src/ux/prompts.ts similarity index 97% rename from src/prompts.ts rename to src/ux/prompts.ts index b96a03b4..f1c251a0 100644 --- a/src/prompts.ts +++ b/src/ux/prompts.ts @@ -42,3 +42,5 @@ const handleTimeout = async (answer: CancelablePromise, ms: number, defaul if (typeof defaultAnswer !== 'undefined') return defaultAnswer; throw new SfError('Prompt timed out.'); }); + +export const prompts = { confirm, secretPrompt }; From 15376ff9abb72d489eaa186f1b31baf31136f4d8 Mon Sep 17 00:00:00 2001 From: mshanemc Date: Thu, 4 Jan 2024 14:10:08 -0600 Subject: [PATCH 10/16] test: add plugin-settings for xnuts --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index df4c3c15..b65150fb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -57,6 +57,7 @@ jobs: - plugin-signups - plugin-templates - plugin-custom-metadata + - plugin-settings - plugin-community - plugin-user os: From ed623829088df7bd2681d8d7a9a6eb58f961fbd2 Mon Sep 17 00:00:00 2001 From: svc-cli-bot Date: Thu, 4 Jan 2024 20:14:22 +0000 Subject: [PATCH 11/16] chore(release): 5.0.14-dev.1 [skip ci] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d6ccadc4..ba0ff68a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@salesforce/sf-plugins-core", - "version": "5.0.14-dev.0", + "version": "5.0.14-dev.1", "description": "Utils for writing Salesforce CLI plugins", "main": "lib/exported", "types": "lib/exported.d.ts", From a5b4416355a8047ff09b5b20fd2ea0e045a0c3af Mon Sep 17 00:00:00 2001 From: mshanemc Date: Thu, 4 Jan 2024 16:50:16 -0600 Subject: [PATCH 12/16] refactor: restore exported namespace merge --- src/errorFormatting.ts | 8 ++++---- src/sfCommand.ts | 29 +++++++++++++++++++++-------- src/sfCommandNamespace.ts | 32 -------------------------------- src/types.ts | 22 ++++++++++++++++++++++ 4 files changed, 47 insertions(+), 44 deletions(-) delete mode 100644 src/sfCommandNamespace.ts create mode 100644 src/types.ts diff --git a/src/errorFormatting.ts b/src/errorFormatting.ts index 1d2a8f92..1573299e 100644 --- a/src/errorFormatting.ts +++ b/src/errorFormatting.ts @@ -8,7 +8,7 @@ import { Mode, Messages, envVars } from '@salesforce/core'; import type { ChalkInstance } from 'chalk'; import { StandardColors } from './ux/standardColors.js'; -import { SfCommand } from './sfCommandNamespace.js'; +import { SfCommandError } from './types.js'; Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); const messages = Messages.loadMessages('@salesforce/sf-plugins-core', 'messages'); @@ -40,7 +40,7 @@ export const formatActions = ( ] : []; -export const formatError = (error: SfCommand.Error): string => +export const formatError = (error: SfCommandError): string => [ `${formatErrorPrefix(error)} ${error.message}`, ...formatActions(error.actions ?? []), @@ -49,8 +49,8 @@ export const formatError = (error: SfCommand.Error): string => : [], ].join('\n'); -const formatErrorPrefix = (error: SfCommand.Error): string => +const formatErrorPrefix = (error: SfCommandError): string => `${StandardColors.error(messages.getMessage('error.prefix', [formatErrorCode(error)]))}`; -const formatErrorCode = (error: SfCommand.Error): string => +const formatErrorCode = (error: SfCommandError): string => typeof error.code === 'string' || typeof error.code === 'number' ? ` (${error.code})` : ''; diff --git a/src/sfCommand.ts b/src/sfCommand.ts index 46f20d87..280c84cc 100644 --- a/src/sfCommand.ts +++ b/src/sfCommand.ts @@ -14,12 +14,13 @@ import { EnvironmentVariable, SfError, ConfigAggregator, + StructuredMessage, } from '@salesforce/core'; import type { AnyJson } from '@salesforce/ts-types'; import { Progress } from './ux/progress.js'; import { Spinner } from './ux/spinner.js'; import { Ux } from './ux/ux.js'; -import { SfCommand as ns } from './sfCommandNamespace.js'; +import { SfCommandError } from './types.js'; import { formatActions, formatError } from './errorFormatting.js'; import { StandardColors } from './ux/standardColors.js'; import { confirm, secretPrompt, PromptInputs } from './ux/prompts.js'; @@ -145,7 +146,7 @@ export abstract class SfCommand extends Command { */ public configAggregator!: ConfigAggregator; - private warnings: ns.Warning[] = []; + private warnings: SfCommand.Warning[] = []; private ux: Ux; private lifecycle: Lifecycle; @@ -187,7 +188,7 @@ export abstract class SfCommand extends Command { * * @param input {@link SfCommand.Warning} The message to log. */ - public warn(input: ns.Warning): ns.Warning { + public warn(input: SfCommand.Warning): SfCommand.Warning { this.warnings.push(input); const message = typeof input === 'string' ? input : input.message; @@ -205,7 +206,7 @@ export abstract class SfCommand extends Command { * * @param input {@link SfCommand.Info} The message to log. */ - public info(input: ns.Info): void { + public info(input: SfCommand.Info): void { const message = typeof input === 'string' ? input : input.message; this.log( [ @@ -352,7 +353,7 @@ export abstract class SfCommand extends Command { /** * Wrap the command result into the standardized JSON structure. */ - protected toSuccessJson(result: T): ns.Json { + protected toSuccessJson(result: T): SfCommand.Json { return { status: process.exitCode ?? 0, result, @@ -363,7 +364,7 @@ export abstract class SfCommand extends Command { /** * Wrap the command error into the standardized JSON structure. */ - protected toErrorJson(error: ns.Error): ns.Error { + protected toErrorJson(error: SfCommand.Error): SfCommand.Error { return { ...error, warnings: this.warnings, @@ -371,7 +372,7 @@ export abstract class SfCommand extends Command { } // eslint-disable-next-line @typescript-eslint/require-await - protected async catch(error: Error | SfError | ns.Error): Promise { + protected async catch(error: Error | SfError | SfCommand.Error): Promise { // stop any spinners to prevent it from unintentionally swallowing output. // If there is an active spinner, it'll say "Error" instead of "Done" this.spinner.stop(StandardColors.error('Error')); @@ -392,7 +393,7 @@ export abstract class SfCommand extends Command { }); // Create printable error object - const sfCommandError: ns.Error = { + const sfCommandError: SfCommand.Error = { ...sfErrorProperties, ...{ message: error.message, @@ -451,3 +452,15 @@ const assignProject = async (): Promise => { throw err; } }; + +export namespace SfCommand { + export type Info = StructuredMessage | string; + export type Warning = StructuredMessage | string; + + export interface Json { + status: number; + result: T; + warnings?: Warning[]; + } + export type Error = SfCommandError; +} diff --git a/src/sfCommandNamespace.ts b/src/sfCommandNamespace.ts deleted file mode 100644 index 7f297f77..00000000 --- a/src/sfCommandNamespace.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2023, salesforce.com, inc. - * All rights reserved. - * Licensed under the BSD 3-Clause license. - * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause - */ -import { StructuredMessage } from '@salesforce/core'; - -export namespace SfCommand { - export type Info = StructuredMessage | string; - export type Warning = StructuredMessage | string; - - export interface Json { - status: number; - result: T; - warnings?: Warning[]; - } - - export interface Error { - status: number; - name: string; - message: string; - stack: string | undefined; - warnings?: Warning[]; - actions?: string[]; - code?: unknown; - exitCode?: number; - data?: unknown; - context?: string; - commandName?: string; - } -} diff --git a/src/types.ts b/src/types.ts new file mode 100644 index 00000000..d172a396 --- /dev/null +++ b/src/types.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2023, salesforce.com, inc. + * All rights reserved. + * Licensed under the BSD 3-Clause license. + * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause + */ +import { StructuredMessage } from '@salesforce/core'; + +// a standlone type here to avoid circular dependencies +export interface SfCommandError { + status: number; + name: string; + message: string; + stack: string | undefined; + warnings?: Array; + actions?: string[]; + code?: unknown; + exitCode?: number; + data?: unknown; + context?: string; + commandName?: string; +} From 7395ec57d2426b4ffcd9945c293407c2881b78d5 Mon Sep 17 00:00:00 2001 From: svc-cli-bot Date: Thu, 4 Jan 2024 23:12:18 +0000 Subject: [PATCH 13/16] chore(release): 5.0.14-dev.2 [skip ci] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ba0ff68a..e199dcd5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@salesforce/sf-plugins-core", - "version": "5.0.14-dev.1", + "version": "5.0.14-dev.2", "description": "Utils for writing Salesforce CLI plugins", "main": "lib/exported", "types": "lib/exported.d.ts", From 5dc9b0ada770538cefb54ed3343d80147a283a69 Mon Sep 17 00:00:00 2001 From: mshanemc Date: Fri, 5 Jan 2024 08:47:24 -0600 Subject: [PATCH 14/16] docs: migration doc --- MIGRATING_V5-V6.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 MIGRATING_V5-V6.md diff --git a/MIGRATING_V5-V6.md b/MIGRATING_V5-V6.md new file mode 100644 index 00000000..4ec34676 --- /dev/null +++ b/MIGRATING_V5-V6.md @@ -0,0 +1,45 @@ +# Migrating from v5 to v6 + +## ESM + +v6 is ESM-only, which can't be consumed by plugins written in cjs. Salesforce-owned plugins are ESM now and you can use them as a guide for the necessary changes. + +## Prompts + +This library uses [`inquirer`](https://github.com/SBoudrias/Inquirer.js) for interactivity. Inquirer made some large changes, including its own ESM rewrite. To take advantage of its improved performance and smaller dependency, we've upgraded. + +The API is completely different, resulting in changes to sf-plugins-core. The new philopsophy is + +1. provide limited, simplified prompts for common use cases +1. plugins that need more advanced propting should import the parts of inquirer that they need + +### Changes + +The `Prompter`` class is removed. + +SfCommand contains two prompt methods + +1. `confirm` provides boolean confirmation prompts +1. `secretPrompt` takes masked string input from the user + +Unlike then inquirer base prompts (`confirm` and `password`, respectively) these have a built-in default timeout. Both take an object parameter that lets you change the timeout (confirm previously took a series of parameters) + +These methods are also built into the `stubPrompter` method for simplified test stubbing. + +If your command relies heavily on the old inquirer/prompt structure, it's possible to import that as a dependency. + +### Reorganized exports + +There are more "standalone" exports available. See package.json#exports for options that don't invole importing the entire library. + +Also removed is the "barrel of Ux". Import what you need. + +## Breaking type changes + +### SfCommand.project + +Project was typed as an `SfProject` but could be undefined when `requiresProject` wasn't set to true on a command. It's now typed as `SfProject | undefined`. If your command sets `requiresProject = true` you can safely assert `this.project!`. + +### SfCommand.catch + +Catch was previously typed to return an error, but it always threw the error. It's now properly typed as `never`. If you extended `catch`, your method should also return `never`. From f837e6507bb36fbc29b025398c70faaa7889f9b8 Mon Sep 17 00:00:00 2001 From: mshanemc Date: Fri, 5 Jan 2024 15:23:01 -0600 Subject: [PATCH 15/16] docs: pr feedback --- MIGRATING_V5-V6.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/MIGRATING_V5-V6.md b/MIGRATING_V5-V6.md index 4ec34676..c35e7cdd 100644 --- a/MIGRATING_V5-V6.md +++ b/MIGRATING_V5-V6.md @@ -11,18 +11,18 @@ This library uses [`inquirer`](https://github.com/SBoudrias/Inquirer.js) for int The API is completely different, resulting in changes to sf-plugins-core. The new philopsophy is 1. provide limited, simplified prompts for common use cases -1. plugins that need more advanced propting should import the parts of inquirer that they need +2. plugins that need more advanced propting should import the parts of inquirer that they need ### Changes -The `Prompter`` class is removed. +The `Prompter` class is removed. SfCommand contains two prompt methods 1. `confirm` provides boolean confirmation prompts -1. `secretPrompt` takes masked string input from the user +2. `secretPrompt` takes masked string input from the user -Unlike then inquirer base prompts (`confirm` and `password`, respectively) these have a built-in default timeout. Both take an object parameter that lets you change the timeout (confirm previously took a series of parameters) +Unlike the inquirer base prompts (`confirm` and `password`, respectively) these have a built-in default timeout. Both take an object parameter that lets you change the timeout (confirm previously took a series of parameters) These methods are also built into the `stubPrompter` method for simplified test stubbing. From 59de89d4b29bfa85dc181606e7eacf2288f3f26c Mon Sep 17 00:00:00 2001 From: mshanemc Date: Fri, 5 Jan 2024 15:23:45 -0600 Subject: [PATCH 16/16] chore: set major version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e199dcd5..e68554c4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@salesforce/sf-plugins-core", - "version": "5.0.14-dev.2", + "version": "6.0.0", "description": "Utils for writing Salesforce CLI plugins", "main": "lib/exported", "types": "lib/exported.d.ts",