From 75bdcbb853d0dfa634ee962e49b5364738b1a751 Mon Sep 17 00:00:00 2001 From: mshanemc Date: Wed, 3 Jan 2024 09:23:33 -0600 Subject: [PATCH 1/7] feat: remove deploy command, hooks --- messages/deploy.md | 90 ------ src/commands/deploy.ts | 229 --------------- src/configMeta.ts | 4 +- .../asyncDeployCancelResultFormatter.ts | 7 +- src/formatters/asyncDeployResultFormatter.ts | 6 +- src/hooks/deploy.ts | 18 -- src/utils/coverage.ts | 2 +- src/utils/flags.ts | 5 +- src/utils/metadataDeployer.ts | 265 ------------------ src/utils/previewOutput.ts | 4 +- src/utils/types.ts | 14 +- test/commands/deploy.nut.ts | 43 --- test/commands/deploy.test.ts | 56 ---- test/nuts/tracking/basics.nut.ts | 2 +- test/nuts/tracking/conflicts.nut.ts | 2 +- test/nuts/tracking/forceIgnore.nut.ts | 2 +- test/nuts/tracking/lwc.nut.ts | 2 +- test/nuts/tracking/remoteChanges.nut.ts | 2 +- 18 files changed, 19 insertions(+), 734 deletions(-) delete mode 100644 messages/deploy.md delete mode 100644 src/commands/deploy.ts delete mode 100644 src/hooks/deploy.ts delete mode 100644 src/utils/metadataDeployer.ts delete mode 100644 test/commands/deploy.nut.ts delete mode 100644 test/commands/deploy.test.ts diff --git a/messages/deploy.md b/messages/deploy.md deleted file mode 100644 index d04cd31b..00000000 --- a/messages/deploy.md +++ /dev/null @@ -1,90 +0,0 @@ -# summary - -Deploy a project interactively to any Salesforce environment. - -# description - -This command must be run from within a project. - -The command first analyzes your project, your active or logged-into environments, and local defaults to determine what to deploy and where to deploy it. The command then prompts you for information about this particular deployment and provides intelligent choices based on its analysis. - -For example, if your local project contains a source directory with metadata files in source format, the command asks if you want to deploy that Salesforce app to an org. The command lists your connected orgs and asks which one you want to deploy to. The list of orgs starts with scratch orgs, ordered by expiration date with the most recently created one first, and then Dev Hub and production orgs ordered by name. If the command finds Apex tests, it asks if you want to run them and at which level. - -The command stores your responses in the "deploy-options.json" file in your local project directory and uses them as defaults when you rerun the command. Specify --interactive to force the command to reprompt. - -Use this command for quick and simple deploys. For more complicated deployments, use the environment-specific commands, such as "<%= config.bin %> project deploy start", that provide additional flags. - -# examples - -- Deploy a project and use stored values from a previous command run: - - <%= config.bin %> <%= command.id %> - -- Reprompt for all deployment inputs: - - <%= config.bin %> <%= command.id %> --interactive - -# flags.interactive.summary - -Force the CLI to prompt for all deployment inputs. - -# errors.NoOrgsToSelect - -Can't find any active scratch orgs, Dev Hubs, or other orgs. -Either log into an org or create a scratch org, and then try again. - -# error.initialization - -One or more initialization steps failed. - -# error.initialization.title - -Initialization Failures. The following table describes each failure: - -# error.UserTerminatedDeployForExpiredOrg - -The target-org found in the configuration is expired. The user terminated the deploy. - -# warning.TargetOrgIsExpired - -The target-org, "%s", is expired. Do you want to pick another org? - -# AnalyzingProject - -Analyzing project - -# UsingOptionsFromFile - -Using options found in %s. - -# FoundNothingToDeploy - -Found nothing in the project to deploy. - -# NothingSelectedToDeploy - -Nothing was selected to deploy. - -# DeployOptionsSavedToFile - -Your deploy options have been saved to %s. - -# DeployOptionsIncludedInGitIgnore - -We added %s to the .gitignore for you. - -# DeployersHaveNonZeroExitCode - -One or more of the selected deployers exited with a non-zero exit code. - -# DeployerExitCode - -Deployer "%s" exited with code %d. - -# save.as.default - -Save username %s as default? - -# deprecation - -The top-level deploy command is deprecated. You should use `functions deploy` to deploy functions, and use `project deploy start` to deploy metadata to Salesforce orgs. diff --git a/src/commands/deploy.ts b/src/commands/deploy.ts deleted file mode 100644 index 32257a88..00000000 --- a/src/commands/deploy.ts +++ /dev/null @@ -1,229 +0,0 @@ -/* - * Copyright (c) 2021, 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 class-methods-use-this */ - -import { EOL } from 'node:os'; -import { writeFile, readFile } from 'node:fs/promises'; -import { existsSync } from 'node:fs'; -import { exec } from 'node:child_process'; - - -import { Hook } from '@oclif/core'; -import { Messages } from '@salesforce/core'; -import { Env, parseJsonMap } from '@salesforce/kit'; -import { - Deployable, - Deployer, - generateTableChoices, - Prompter, - SfCommand, - SfHook, - Flags, -} from '@salesforce/sf-plugins-core'; -import { DeployerResult } from '@salesforce/sf-plugins-core/lib/deployer.js'; - -Messages.importMessagesDirectoryFromMetaUrl(import.meta.url) - -const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy'); - -export const DEPLOY_OPTIONS_FILE = 'deploy-options.json'; - -export default class Deploy extends SfCommand { - public static readonly summary = messages.getMessage('summary'); - public static readonly description = messages.getMessage('description'); - public static readonly examples = messages.getMessages('examples'); - public static enableJsonFlag = false; - public static state = 'deprecated'; - public static readonly hidden = true; - public static deprecationOptions = { - version: '59.0', - message: messages.getMessage('deprecation'), - }; - - public static readonly flags = { - interactive: Flags.boolean({ - summary: messages.getMessage('flags.interactive.summary'), - }), - }; - - public async run(): Promise { - process.setMaxListeners(new Env().getNumber('SF_MAX_EVENT_LISTENERS') ?? 1000); - const { flags } = await this.parse(Deploy); - - flags.interactive = await this.isInteractive(flags.interactive); - const options = await this.readOptions(); - - this.log(messages.getMessage('AnalyzingProject')); - - if (!flags.interactive) { - this.log(messages.getMessage('UsingOptionsFromFile', [DEPLOY_OPTIONS_FILE])); - } - - const hookResults = await SfHook.run(this.config, 'sf:deploy', options); - - this.checkForHookFailures(hookResults); - - let deployers = hookResults.successes.flatMap((s) => s.result); - - if (deployers.length === 0) { - this.log(messages.getMessage('FoundNothingToDeploy')); - } else { - if (flags.interactive) { - deployers = await this.selectDeployers(deployers); - } else { - deployers = deployers.filter((d) => !!options[d.getName()]); - } - - if (deployers.length === 0) { - this.log(messages.getMessage('NothingSelectedToDeploy')); - } - - const deployOptions: Record = {}; - for (const deployer of deployers) { - const opts = options[deployer.getName()] ?? {}; - // setup must be done sequentially - // eslint-disable-next-line no-await-in-loop - deployOptions[deployer.getName()] = await deployer.setup(flags, opts); - } - - if (flags.interactive && (await this.askToSave())) { - await writeJson(DEPLOY_OPTIONS_FILE, deployOptions); - this.log(); - this.log(messages.getMessage('DeployOptionsSavedToFile', [DEPLOY_OPTIONS_FILE])); - if (await this.shouldCommit()) { - await this.commit(); - this.log(messages.getMessage('DeployOptionsIncludedInGitIgnore', [DEPLOY_OPTIONS_FILE])); - } - } - - const deployResults: Array<[Deployer, void | DeployerResult]> = []; - for (const deployer of deployers) { - // deployments must be done sequentially? - // eslint-disable-next-line no-await-in-loop - deployResults.push([deployer, await deployer.deploy()]); - } - if (deployResults.some(([, result]) => !!result && result.exitCode !== 0)) { - process.exitCode = 1; - this.warn(messages.getMessage('DeployersHaveNonZeroExitCode')); - deployResults - .filter(([, result]) => !!result && result.exitCode !== 0) - .forEach(([deployer, result]) => { - this.log( - messages.getMessage('DeployerExitCode', [deployer.getName(), result ? result.exitCode : 'unknown']) - ); - }); - } - } - } - - /** - * If the deploy file exists, we do not want the command to be interactive. But if the file - * does not exist then we want to force the command to be interactive. - */ - // this used to be async when it was using fs-extra. Presered public api - // eslint-disable-next-line @typescript-eslint/require-await - public async isInteractive(interactive: boolean): Promise { - if (interactive) return true; - const deployFileExists = existsSync(DEPLOY_OPTIONS_FILE); - return deployFileExists ? false : true; - } - - public async readOptions(): Promise> { - if (existsSync(DEPLOY_OPTIONS_FILE)) { - return parseJsonMap>(await readFile(DEPLOY_OPTIONS_FILE, 'utf8')); - } else { - return {}; - } - } - - public async commit(): Promise { - const gitignore = await readFile('.gitignore', 'utf-8'); - if (!gitignore.includes(DEPLOY_OPTIONS_FILE)) { - const addition = `${EOL}${EOL}# Deploy Options${EOL}${DEPLOY_OPTIONS_FILE}${EOL}`; - await writeFile('.gitignore', `${gitignore}${addition}`); - } - exec('git add .gitignore'); - exec(`git commit -am "Add ${DEPLOY_OPTIONS_FILE} to .gitignore"`); - } - - // this used to be async when it was using fs-extra. Presered public api - // eslint-disable-next-line @typescript-eslint/require-await - public async shouldCommit(): Promise { - return existsSync('.git') && existsSync('functions'); - } - - public async askToSave(): Promise { - const prompter = new Prompter(); - const { save } = await prompter.prompt<{ save: boolean }>({ - name: 'save', - message: 'Would you like to save these deploy options for future runs?', - type: 'confirm', - }); - return save; - } - - public async selectDeployers(deployers: Deployer[]): Promise { - const deployables: Deployable[] = deployers.reduce((x, y) => x.concat(y.deployables), []); - const columns = { name: 'APP OR PACKAGE', type: 'TYPE', path: 'PATH' }; - const options = deployables.map((deployable) => ({ - name: deployable.getName(), - type: deployable.getType(), - path: deployable.getPath(), - value: deployable, - })); - const prompter = new Prompter(); - const responses = await prompter.prompt<{ deployables: Deployable[] }>([ - { - name: 'deployables', - message: 'Select apps and packages to deploy:', - type: 'checkbox', - choices: generateTableChoices(columns, options), - }, - ]); - - const chosenDeployers: Map = new Map(); - for (const deployable of responses.deployables) { - const parent = deployable.getParent(); - if (chosenDeployers.has(parent)) { - const existing = chosenDeployers.get(parent) ?? []; - chosenDeployers.set(parent, [...existing, deployable]); - } else { - chosenDeployers.set(parent, [deployable]); - } - } - - const final: Deployer[] = []; - for (const [parent, children] of Array.from(chosenDeployers.entries())) { - parent.selectDeployables(children); - final.push(parent); - } - return final; - } - - public checkForHookFailures(hookResults: Hook.Result): void { - if (hookResults.failures?.length) { - // display a table of the errors encountered; Plugin Name, Error Message - const columns = { - errorName: { header: 'Error Name' }, - errorMessage: { header: 'Error Message' }, - }; - - const failureData = hookResults.failures.map((failure) => ({ - errorName: failure.error.name, - errorMessage: failure.error.message, - })); - this.styledHeader(messages.getMessage('error.initialization.title')); - this.table(failureData, columns, { 'no-truncate': true }); - const err = messages.createError('error.initialization'); - err.data = hookResults.failures; - throw err; - } - } -} - -export const writeJson = async (filename: string, data: Record): Promise => - writeFile(filename, JSON.stringify(data, null, 2)); diff --git a/src/configMeta.ts b/src/configMeta.ts index 823e2490..3c18b8f9 100644 --- a/src/configMeta.ts +++ b/src/configMeta.ts @@ -5,12 +5,10 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ - - import type { ConfigValue } from '@salesforce/core'; import { Messages } from '@salesforce/core/lib/messages.js'; -Messages.importMessagesDirectoryFromMetaUrl(import.meta.url) +Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'config'); export enum ConfigVars { diff --git a/src/formatters/asyncDeployCancelResultFormatter.ts b/src/formatters/asyncDeployCancelResultFormatter.ts index 409d1b42..acaad39f 100644 --- a/src/formatters/asyncDeployCancelResultFormatter.ts +++ b/src/formatters/asyncDeployCancelResultFormatter.ts @@ -5,13 +5,9 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ - import { ux } from '@oclif/core'; import { Messages } from '@salesforce/core'; import { AsyncDeployResultJson, DeployResultJson, Formatter } from '../utils/types.js'; -Messages.importMessagesDirectoryFromMetaUrl(import.meta.url) - -export const deployAsyncMessages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy.async'); export class AsyncDeployCancelResultFormatter implements Formatter { public constructor(private id: string, private bin: string) {} @@ -22,6 +18,9 @@ export class AsyncDeployCancelResultFormatter implements Formatter { public constructor(private id: string, private bin: string) {} @@ -21,6 +18,9 @@ export class AsyncDeployResultFormatter implements Formatter = async function () { - const project = await SfProject.resolve(); - const packageDirectories = project.getPackageDirectories(); - return [new MetadataDeployer(packageDirectories)]; -}; - -export default hook; diff --git a/src/utils/coverage.ts b/src/utils/coverage.ts index 2946054d..bdbb30bd 100644 --- a/src/utils/coverage.ts +++ b/src/utils/coverage.ts @@ -14,7 +14,7 @@ import { ApexCodeCoverageAggregate, ApexCodeCoverageAggregateRecord, } from '@salesforce/apex-node'; -import { Successes, Failures, CodeCoverage } from '@salesforce/source-deploy-retrieve'; +import type { Successes, Failures, CodeCoverage } from '@salesforce/source-deploy-retrieve'; import { ensureArray } from '@salesforce/kit'; import { StandardColors } from '@salesforce/sf-plugins-core'; diff --git a/src/utils/flags.ts b/src/utils/flags.ts index 1537f3e3..8734c3a1 100644 --- a/src/utils/flags.ts +++ b/src/utils/flags.ts @@ -11,7 +11,7 @@ import { Flags } from '@oclif/core'; import { Messages, Lifecycle } from '@salesforce/core'; import { PathInfo, TestLevel, reportsFormatters } from './types.js'; -Messages.importMessagesDirectoryFromMetaUrl(import.meta.url) +Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'validation'); const commonFlagMessages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'commonFlags'); @@ -109,12 +109,13 @@ export const coverageFormattersFlag = Flags.custom({ description: commonFlagMessages.getMessage('flags.coverage-formatters.description'), options: reportsFormatters, }); + /** * use when the old version allowed comma separated values, and the change is confusing enough to deserve a warning * Put this as the parse function, like the testsFlag above * */ -export const commaWarningForMultipleFlags = async (input: string, warningText: string): Promise => { +const commaWarningForMultipleFlags = async (input: string, warningText: string): Promise => { if (input.includes(',')) { await Lifecycle.getInstance().emitWarning(warningText); } diff --git a/src/utils/metadataDeployer.ts b/src/utils/metadataDeployer.ts deleted file mode 100644 index bbfbebe5..00000000 --- a/src/utils/metadataDeployer.ts +++ /dev/null @@ -1,265 +0,0 @@ -/* - * Copyright (c) 2021, 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 class-methods-use-this */ - - - -import { EOL } from 'node:os'; -import chalk from 'chalk'; -import { Duration } from '@salesforce/kit'; -import { - AuthInfo, - ConfigAggregator, - StateAggregator, - Messages, - NamedPackageDir, - OrgAuthorization, - OrgConfigProperties, - Org, -} from '@salesforce/core'; -import { Deployable, Deployer, DeployerResult, generateTableChoices } from '@salesforce/sf-plugins-core'; - -import { DeployResultFormatter } from '../formatters/deployResultFormatter.js'; -import { TestLevel } from './types.js'; -import { DeployProgress } from './progressBar.js'; -import { determineExitCode, executeDeploy, resolveApi } from './deploy.js'; - -Messages.importMessagesDirectoryFromMetaUrl(import.meta.url) -const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy'); - -type OrgAuthWithTimestamp = OrgAuthorization & { timestamp: Date }; - -const compareOrgs = (a: OrgAuthWithTimestamp, b: OrgAuthWithTimestamp): number => { - // scratch orgs before other orgs - if (a.isScratchOrg && !b.isScratchOrg) { - // all scratch orgs come before non-scratch orgs - return -1; - } else { - // sort scratch orgs by timestamp - descending - if (a.isScratchOrg && b.isScratchOrg) { - const aTimestamp = new Date(a.timestamp); - const bTimestamp = new Date(b.timestamp); - return bTimestamp.getTime() - aTimestamp.getTime(); - } - // dev hubs after scratch but before remaining orgs - if (a.isDevHub && !b.isScratchOrg && !b.isDevHub) { - return -1; - } - // not a scratch org and not a devhub means "other" sorts last - if (!a.isDevHub) { - return 1; - } - } - // orgs are equal by type - sort by name ascending - return a.username.localeCompare(b.username); -}; - -export interface MetadataDeployOptions extends Deployer.Options { - testLevel?: TestLevel; - username?: string; - directories?: string[]; -} - -export class DeployablePackage extends Deployable { - public constructor(public pkg: NamedPackageDir, private parent: Deployer) { - super(); - } - - public getName(): string { - return this.pkg.name; - } - - public getType(): string { - return 'Salesforce App'; - } - - public getPath(): string { - return this.pkg.path; - } - - public getParent(): Deployer { - return this.parent; - } -} - -export class MetadataDeployer extends Deployer { - public static NAME = 'Salesforce Apps'; - - public declare deployables: DeployablePackage[]; - private testLevel: TestLevel = TestLevel.NoTestRun; - private username!: string; - - public constructor(private packages: NamedPackageDir[]) { - super(); - this.deployables = this.packages.map((pkg) => new DeployablePackage(pkg, this)); - } - - public getName(): string { - return MetadataDeployer.NAME; - } - - public async setup(flags: Deployer.Flags, options: MetadataDeployOptions): Promise { - if (flags.interactive) { - this.testLevel = await this.promptForTestLevel(); - this.username = await this.promptForUsername(); - } else { - if (options.directories?.length) { - const directories = options.directories || []; - const selected = this.deployables.filter((d) => directories.includes(d.getPath())); - this.selectDeployables(selected); - } - this.testLevel = options.testLevel ?? (await this.promptForTestLevel()); - this.username = options.username ?? (await this.promptForUsername()); - } - - return { - testLevel: this.testLevel, - username: this.username, - apps: this.deployables.map((d) => d.getPath()), - }; - } - - public async deploy(): Promise { - const directories = this.deployables.map((d) => d.pkg.fullPath); - const name = this.deployables.map((p) => chalk.cyan.bold(p.getPath())).join(', '); - const api = await resolveApi(); - this.log(`${EOL}Deploying ${name} to ${this.username} using ${api} API`); - - const { deploy } = await executeDeploy( - { - 'target-org': this.username, - 'source-dir': directories, - 'test-level': this.testLevel, - api, - }, - undefined, - undefined, - undefined, - true - ); - - new DeployProgress(deploy).start(); - - const result = await deploy.pollStatus(500, Duration.minutes(33).seconds); - - const formatter = new DeployResultFormatter(result, { - 'test-level': this.testLevel, - verbose: false, - concise: false, - 'target-org': await Org.create({ aliasOrUsername: this.username }), - }); - formatter.display(); - const deployerResult: DeployerResult = { - exitCode: determineExitCode(result), - }; - return deployerResult as R; - } - - public async promptForUsername(): Promise { - const aliasOrUsername = ConfigAggregator.getValue(OrgConfigProperties.TARGET_ORG)?.value as string; - const stateAggregator = await StateAggregator.getInstance(); - await stateAggregator.orgs.readAll(); - const allAliases = stateAggregator.aliases.getAll(); - let targetOrgAuth: OrgAuthorization | undefined; - // make sure the "target-org" can be used in this deploy - if (aliasOrUsername) { - targetOrgAuth = ( - await AuthInfo.listAllAuthorizations( - (a) => (a.username === aliasOrUsername || a.aliases?.some((alias) => alias === aliasOrUsername)) ?? false - ) - ).find((a) => a); - if (targetOrgAuth) { - if (targetOrgAuth?.isExpired) { - const continueAnswer = await this.prompt<{ continue: boolean }>([ - { - name: 'continue', - type: 'confirm', - message: chalk.red(messages.getMessage('warning.TargetOrgIsExpired', [aliasOrUsername])), - }, - ]); - if (!continueAnswer.continue) { - throw messages.createError('error.UserTerminatedDeployForExpiredOrg'); - } - } else { - return stateAggregator.aliases.resolveUsername(aliasOrUsername); - } - } - } - - if (!aliasOrUsername || targetOrgAuth?.isExpired) { - const promises = ( - await AuthInfo.listAllAuthorizations((orgAuth) => !orgAuth.error && orgAuth.isExpired !== true) - ).map(async (orgAuth) => { - const stat = await stateAggregator.orgs.stat(orgAuth.username); - const timestamp = stat ? new Date(stat.mtimeMs) : new Date(); - return { ...orgAuth, timestamp }; - }); - - const authorizations = await Promise.all(promises); - if (authorizations.length > 0) { - const newestAuths = authorizations.sort(compareOrgs); - const options = newestAuths.map((auth) => ({ - name: auth.username, - aliases: Object.entries(allAliases) - .filter(([, usernameOrAlias]) => usernameOrAlias === auth.username) - .map(([alias]) => alias) - .join(', '), - isScratchOrg: auth.isScratchOrg ? 'Yes' : 'No', - value: auth.username, - })); - const columns = { name: 'Org', aliases: 'Aliases', isScratchOrg: 'Scratch Org' }; - const { username } = await this.prompt<{ username: string }>([ - { - name: 'username', - message: 'Select the org you want to deploy to:', - type: 'list', - choices: generateTableChoices(columns, options, false), - }, - ]); - if (targetOrgAuth?.isExpired) { - const setTargetOrg = await this.prompt<{ save: boolean }>([ - { - name: 'save', - type: 'confirm', - message: messages.getMessage('save.as.default', [username]), - }, - ]); - if (setTargetOrg.save) { - const authInfo = await AuthInfo.create({ username }); - await authInfo.setAsDefault({ org: true }); - } - } - return username; - } else { - throw messages.createError('errors.NoOrgsToSelect'); - } - } - throw new Error('Unexpected: You should not have arrived here.'); - } - - public async promptForTestLevel(): Promise { - const { testLevel } = await this.prompt<{ testLevel: TestLevel }>([ - { - name: 'testLevel', - message: 'Select the test level you would like to run:', - type: 'list', - loop: false, - pageSize: 4, - choices: [ - { name: "Don't run tests", value: TestLevel.NoTestRun, short: "Don't run tests" }, - { name: 'Run local tests', value: TestLevel.RunLocalTests, short: 'Run local tests' }, - { - name: 'Run all tests in environment', - value: TestLevel.RunAllTestsInOrg, - short: 'Run all tests in environment', - }, - ], - }, - ]); - return testLevel; - } -} diff --git a/src/utils/previewOutput.ts b/src/utils/previewOutput.ts index 0cd50a22..a6d862e6 100644 --- a/src/utils/previewOutput.ts +++ b/src/utils/previewOutput.ts @@ -24,7 +24,7 @@ import { filePathsFromMetadataComponent } from '@salesforce/source-deploy-retrie import { SourceTracking } from '@salesforce/source-tracking'; import { isSourceComponentWithXml } from './types.js'; -Messages.importMessagesDirectoryFromMetaUrl(import.meta.url) +Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'previewMessages'); type BaseOperation = 'deploy' | 'retrieve'; @@ -241,7 +241,7 @@ const printConflictsTable = (files: PreviewFile[]): void => { } }; -export const printIgnoredTable = (files: PreviewFile[], baseOperation: BaseOperation): void => { +const printIgnoredTable = (files: PreviewFile[], baseOperation: BaseOperation): void => { ux.log(); if (files.length === 0) { ux.log(chalk.dim(messages.getMessage('ignored.none'))); diff --git a/src/utils/types.ts b/src/utils/types.ts index 0e316ad6..2fedca92 100644 --- a/src/utils/types.ts +++ b/src/utils/types.ts @@ -16,7 +16,7 @@ import { FileResponseSuccess, } from '@salesforce/source-deploy-retrieve'; import { isObject } from '@salesforce/ts-types'; -import { DefaultReportOptions, CoverageReporterOptions } from '@salesforce/apex-node'; +import { DefaultReportOptions } from '@salesforce/apex-node'; export const reportsFormatters = Object.keys(DefaultReportOptions); @@ -57,18 +57,6 @@ export type ConvertResultJson = { location: string; }; -export interface DeleteFormatterOptions { - verbose?: boolean; - quiet?: boolean; - waitTime?: number; - concise?: boolean; - username?: string; - coverageOptions?: CoverageReporterOptions; - junitTestResults?: boolean; - resultsDir?: string; - testsRan?: boolean; -} - export type DeleteSourceJson = { deletedSource?: FileResponse[]; deployedSource: FileResponse[]; diff --git a/test/commands/deploy.nut.ts b/test/commands/deploy.nut.ts deleted file mode 100644 index 8e6ed314..00000000 --- a/test/commands/deploy.nut.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2020, 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 * as path from 'node:path'; -import { fileURLToPath } from 'node:url'; -import { SourceTestkit } from '@salesforce/source-testkit'; -import { writeJson } from '../../src/commands/deploy.js'; -import { TestLevel } from '../../src/utils/types.js'; -import { MetadataDeployer } from '../../src/utils/metadataDeployer.js'; - -describe('deploy NUTs', () => { - let testkit: SourceTestkit; - - before(async () => { - testkit = await SourceTestkit.create({ - repository: 'https://github.com/trailheadapps/dreamhouse-lwc.git', - nut: fileURLToPath(import.meta.url), - }); - }); - - after(async () => { - await testkit?.clean(); - }); - - describe('deploy-options.json', () => { - it('should deploy force-app', async () => { - const deployOptions = { - [MetadataDeployer.NAME]: { - testLevel: TestLevel.NoTestRun, - username: testkit.username, - apps: ['force-app'], - }, - }; - await writeJson(path.join(testkit.projectDir, 'deploy-options.json'), deployOptions); - await testkit.execute('deploy', { json: false }); - await testkit.expect.filesToBeDeployed(['force-app/**/*'], ['force-app/test/**/*']); - }); - }); -}); diff --git a/test/commands/deploy.test.ts b/test/commands/deploy.test.ts deleted file mode 100644 index 5de53559..00000000 --- a/test/commands/deploy.test.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2020, 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 class-methods-use-this */ - -import { expect } from 'chai'; -import { Hook } from '@oclif/core'; -import { Deployer } from '@salesforce/sf-plugins-core'; -import Deploy from '../../src/commands/deploy.js'; -import Result = Hook.Result; - -class TestDeploy extends Deploy { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - public constructor() { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - super([]); - } - public async run() {} - - public async styledHeader() {} - - public async table() {} -} - -describe('checkForHookFailures', () => { - it('should not throw when no hook failures', () => { - const testDeploy = new TestDeploy(); - testDeploy.checkForHookFailures({} as Result); - expect(testDeploy).to.be.ok; - }); - it('should throw when hook failures are present', () => { - const testDeploy = new TestDeploy(); - const shouldThrow = () => - testDeploy.checkForHookFailures({ - successes: [], - failures: [{ plugin: { name: 'foo' }, error: { name: 'fooerror', message: 'bad stuff happened' } }], - // plugin has a lot more properties this test omits. - } as unknown as Result); - expect(shouldThrow).to.throw(/One or more initialization steps failed./); - }); -}); - -/** - * Conversion of type '{ successes: never[]; failures: { plugin: { name: string; }; error: { name: string; message: string; }; }[]; }' to type 'Result' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. - Types of property 'failures' are incompatible. - Type '{ plugin: { name: string; }; error: { name: string; message: string; }; }[]' is not comparable to type '{ error: Error; plugin: Plugin; }[]'. - Type '{ plugin: { name: string; }; error: { name: string; message: string; }; }' is not comparable to type '{ error: Error; plugin: Plugin; }'. - Types of property 'plugin' are incompatible. - Type '{ name: string; }' is missing the following properties from type 'Plugin': _base, alias, version, pjson, and 9 more. - * - */ diff --git a/test/nuts/tracking/basics.nut.ts b/test/nuts/tracking/basics.nut.ts index eecea14c..388bbd93 100644 --- a/test/nuts/tracking/basics.nut.ts +++ b/test/nuts/tracking/basics.nut.ts @@ -10,7 +10,7 @@ import * as fs from 'node:fs'; import { expect, assert } from 'chai'; import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit'; import { ComponentStatus } from '@salesforce/source-deploy-retrieve'; -import { StatusResult } from '@salesforce/plugin-source/lib/formatters/source/statusFormatter.js'; +import type { StatusResult } from '@salesforce/plugin-source/lib/formatters/source/statusFormatter.js'; import { DeployResultJson, RetrieveResultJson, isSdrFailure } from '../../../src/utils/types.js'; import { PreviewResult } from '../../../src/utils/previewOutput.js'; import { eBikesDeployResultCount } from './constants.js'; diff --git a/test/nuts/tracking/conflicts.nut.ts b/test/nuts/tracking/conflicts.nut.ts index 6639fb6b..76865e71 100644 --- a/test/nuts/tracking/conflicts.nut.ts +++ b/test/nuts/tracking/conflicts.nut.ts @@ -12,7 +12,7 @@ import { expect } from 'chai'; import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit'; import { AuthInfo, Connection } from '@salesforce/core'; import { ComponentStatus } from '@salesforce/source-deploy-retrieve'; -import { StatusResult } from '@salesforce/plugin-source/lib/formatters/source/statusFormatter.js'; +import type { StatusResult } from '@salesforce/plugin-source/lib/formatters/source/statusFormatter.js'; import { DeployResultJson, RetrieveResultJson } from '../../../src/utils/types.js'; import { PreviewResult } from '../../../src/utils/previewOutput.js'; import { eBikesDeployResultCount } from './constants.js'; diff --git a/test/nuts/tracking/forceIgnore.nut.ts b/test/nuts/tracking/forceIgnore.nut.ts index 70005222..35e2de16 100644 --- a/test/nuts/tracking/forceIgnore.nut.ts +++ b/test/nuts/tracking/forceIgnore.nut.ts @@ -12,7 +12,7 @@ import { expect } from 'chai'; import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit'; import { AuthInfo, Connection } from '@salesforce/core'; import { ComponentStatus } from '@salesforce/source-deploy-retrieve'; -import { StatusResult } from '@salesforce/plugin-source/lib/formatters/source/statusFormatter.js'; +import type { StatusResult } from '@salesforce/plugin-source/lib/formatters/source/statusFormatter.js'; import { DeployResultJson, RetrieveResultJson } from '../../../src/utils/types.js'; import { PreviewResult } from '../../../src/utils/previewOutput.js'; diff --git a/test/nuts/tracking/lwc.nut.ts b/test/nuts/tracking/lwc.nut.ts index a525498a..25d188a1 100644 --- a/test/nuts/tracking/lwc.nut.ts +++ b/test/nuts/tracking/lwc.nut.ts @@ -9,7 +9,7 @@ import * as path from 'node:path'; import * as fs from 'node:fs'; import { assert, expect } from 'chai'; import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit'; -import { StatusResult } from '@salesforce/plugin-source/lib/formatters/source/statusFormatter.js'; +import type { StatusResult } from '@salesforce/plugin-source/lib/formatters/source/statusFormatter.js'; import { ComponentStatus } from '@salesforce/source-deploy-retrieve'; import { PreviewResult } from '../../../src/utils/previewOutput.js'; import { DeployResultJson } from '../../../src/utils/types.js'; diff --git a/test/nuts/tracking/remoteChanges.nut.ts b/test/nuts/tracking/remoteChanges.nut.ts index 89fa06e8..f47acb45 100644 --- a/test/nuts/tracking/remoteChanges.nut.ts +++ b/test/nuts/tracking/remoteChanges.nut.ts @@ -12,7 +12,7 @@ import { expect, assert } from 'chai'; import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit'; import { AuthInfo, Connection } from '@salesforce/core'; import { ComponentStatus, FileResponse } from '@salesforce/source-deploy-retrieve'; -import { StatusResult } from '@salesforce/plugin-source/lib/formatters/source/statusFormatter.js'; +import type { StatusResult } from '@salesforce/plugin-source/lib/formatters/source/statusFormatter.js'; import { PreviewResult, PreviewFile } from '../../../src/utils/previewOutput.js'; import { DeployResultJson, RetrieveResultJson } from '../../../src/utils/types.js'; import { eBikesDeployResultCount } from './constants.js'; From a436ea3efa003d28ac1ff826d92cdeebf183beb5 Mon Sep 17 00:00:00 2001 From: mshanemc Date: Wed, 3 Jan 2024 09:30:07 -0600 Subject: [PATCH 2/7] chore: remove pjson hooks --- package.json | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/package.json b/package.json index 66b6e041..c99dcff1 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@salesforce/plugin-deploy-retrieve", "description": "deploy and retrieve commands for sf", - "version": "2.2.12", + "version": "3.0.0", "author": "Salesforce", "bugs": "https://github.com/forcedotcom/cli/issues", "dependencies": { @@ -56,9 +56,6 @@ "commands": "./lib/commands", "topicSeparator": " ", "bin": "sf", - "hooks": { - "sf:deploy": "./lib/hooks/deploy" - }, "configMeta": "./lib/configMeta", "devPlugins": [ "@oclif/plugin-command-snapshot", From 14e5c62be743d505ce2298862534766b609e1f48 Mon Sep 17 00:00:00 2001 From: mshanemc Date: Wed, 3 Jan 2024 09:31:20 -0600 Subject: [PATCH 3/7] chore: schema, snapshots --- command-snapshot.json | 174 ++++++++++++++++++++---------------------- 1 file changed, 83 insertions(+), 91 deletions(-) diff --git a/command-snapshot.json b/command-snapshot.json index 11775805..fe02daf2 100644 --- a/command-snapshot.json +++ b/command-snapshot.json @@ -1,23 +1,17 @@ [ { - "command": "deploy", - "plugin": "@salesforce/plugin-deploy-retrieve", - "flags": ["interactive"], - "alias": [], - "flagChars": [], - "flagAliases": [] - }, - { - "command": "project:convert:mdapi", - "plugin": "@salesforce/plugin-deploy-retrieve", - "flags": ["api-version", "json", "loglevel", "manifest", "metadata", "metadata-dir", "output-dir", "root-dir"], "alias": ["force:mdapi:convert"], + "command": "project:convert:mdapi", + "flagAliases": ["apiversion", "metadatapath", "outputdir", "rootdir"], "flagChars": ["d", "m", "p", "r", "x"], - "flagAliases": ["apiversion", "metadatapath", "outputdir", "rootdir"] + "flags": ["api-version", "json", "loglevel", "manifest", "metadata", "metadata-dir", "output-dir", "root-dir"], + "plugin": "@salesforce/plugin-deploy-retrieve" }, { + "alias": ["force:source:convert"], "command": "project:convert:source", - "plugin": "@salesforce/plugin-deploy-retrieve", + "flagAliases": ["apiversion", "outputdir", "packagename", "rootdir", "sourcepath"], + "flagChars": ["d", "m", "n", "p", "r", "x"], "flags": [ "api-version", "json", @@ -29,13 +23,23 @@ "root-dir", "source-dir" ], - "alias": ["force:source:convert"], - "flagChars": ["d", "m", "n", "p", "r", "x"], - "flagAliases": ["apiversion", "outputdir", "packagename", "rootdir", "sourcepath"] + "plugin": "@salesforce/plugin-deploy-retrieve" }, { + "alias": ["force:source:delete"], "command": "project:delete:source", - "plugin": "@salesforce/plugin-deploy-retrieve", + "flagAliases": [ + "apiversion", + "checkonly", + "forceoverwrite", + "noprompt", + "sourcepath", + "targetusername", + "testlevel", + "tracksource", + "u" + ], + "flagChars": ["c", "f", "l", "m", "o", "p", "r", "t", "w"], "flags": [ "api-version", "check-only", @@ -52,63 +56,53 @@ "verbose", "wait" ], - "alias": ["force:source:delete"], - "flagChars": ["c", "f", "l", "m", "o", "p", "r", "t", "w"], - "flagAliases": [ - "apiversion", - "checkonly", - "forceoverwrite", - "noprompt", - "sourcepath", - "targetusername", - "testlevel", - "tracksource", - "u" - ] + "plugin": "@salesforce/plugin-deploy-retrieve" }, { - "command": "project:delete:tracking", - "plugin": "@salesforce/plugin-deploy-retrieve", - "flags": ["api-version", "json", "loglevel", "no-prompt", "target-org"], "alias": ["force:source:tracking:clear"], + "command": "project:delete:tracking", + "flagAliases": ["apiversion", "noprompt", "targetusername", "u"], "flagChars": ["o", "p"], - "flagAliases": ["apiversion", "noprompt", "targetusername", "u"] + "flags": ["api-version", "json", "loglevel", "no-prompt", "target-org"], + "plugin": "@salesforce/plugin-deploy-retrieve" }, { - "command": "project:deploy:cancel", - "plugin": "@salesforce/plugin-deploy-retrieve", - "flags": ["async", "job-id", "json", "use-most-recent", "wait"], "alias": ["deploy:metadata:cancel"], + "command": "project:deploy:cancel", + "flagAliases": [], "flagChars": ["i", "r", "w"], - "flagAliases": [] + "flags": ["async", "job-id", "json", "use-most-recent", "wait"], + "plugin": "@salesforce/plugin-deploy-retrieve" }, { - "command": "project:deploy:preview", - "plugin": "@salesforce/plugin-deploy-retrieve", - "flags": ["ignore-conflicts", "json", "manifest", "metadata", "source-dir", "target-org"], "alias": ["deploy:metadata:preview"], + "command": "project:deploy:preview", + "flagAliases": [], "flagChars": ["c", "d", "m", "o", "x"], - "flagAliases": [] + "flags": ["ignore-conflicts", "json", "manifest", "metadata", "source-dir", "target-org"], + "plugin": "@salesforce/plugin-deploy-retrieve" }, { - "command": "project:deploy:quick", - "plugin": "@salesforce/plugin-deploy-retrieve", - "flags": ["api-version", "async", "concise", "job-id", "json", "target-org", "use-most-recent", "verbose", "wait"], "alias": ["deploy:metadata:quick"], + "command": "project:deploy:quick", + "flagAliases": [], "flagChars": ["a", "i", "o", "r", "w"], - "flagAliases": [] + "flags": ["api-version", "async", "concise", "job-id", "json", "target-org", "use-most-recent", "verbose", "wait"], + "plugin": "@salesforce/plugin-deploy-retrieve" }, { - "command": "project:deploy:report", - "plugin": "@salesforce/plugin-deploy-retrieve", - "flags": ["coverage-formatters", "job-id", "json", "junit", "results-dir", "target-org", "use-most-recent", "wait"], "alias": ["deploy:metadata:report"], + "command": "project:deploy:report", + "flagAliases": [], "flagChars": ["i", "o", "r", "w"], - "flagAliases": [] + "flags": ["coverage-formatters", "job-id", "json", "junit", "results-dir", "target-org", "use-most-recent", "wait"], + "plugin": "@salesforce/plugin-deploy-retrieve" }, { + "alias": ["deploy:metadata:resume"], "command": "project:deploy:resume", - "plugin": "@salesforce/plugin-deploy-retrieve", + "flagAliases": [], + "flagChars": ["i", "r", "w"], "flags": [ "concise", "coverage-formatters", @@ -120,13 +114,13 @@ "verbose", "wait" ], - "alias": ["deploy:metadata:resume"], - "flagChars": ["i", "r", "w"], - "flagAliases": [] + "plugin": "@salesforce/plugin-deploy-retrieve" }, { + "alias": ["deploy:metadata"], "command": "project:deploy:start", - "plugin": "@salesforce/plugin-deploy-retrieve", + "flagAliases": [], + "flagChars": ["a", "c", "d", "g", "l", "m", "o", "r", "t", "w", "x"], "flags": [ "api-version", "async", @@ -153,13 +147,13 @@ "verbose", "wait" ], - "alias": ["deploy:metadata"], - "flagChars": ["a", "c", "d", "g", "l", "m", "o", "r", "t", "w", "x"], - "flagAliases": [] + "plugin": "@salesforce/plugin-deploy-retrieve" }, { + "alias": ["deploy:metadata:validate"], "command": "project:deploy:validate", - "plugin": "@salesforce/plugin-deploy-retrieve", + "flagAliases": [], + "flagChars": ["a", "d", "g", "l", "m", "o", "t", "w", "x"], "flags": [ "api-version", "async", @@ -183,13 +177,22 @@ "verbose", "wait" ], - "alias": ["deploy:metadata:validate"], - "flagChars": ["a", "d", "g", "l", "m", "o", "t", "w", "x"], - "flagAliases": [] + "plugin": "@salesforce/plugin-deploy-retrieve" }, { + "alias": ["force:source:manifest:create"], "command": "project:generate:manifest", - "plugin": "@salesforce/plugin-deploy-retrieve", + "flagAliases": [ + "apiversion", + "fromorg", + "includepackages", + "manifestname", + "manifesttype", + "o", + "outputdir", + "sourcepath" + ], + "flagChars": ["c", "d", "m", "n", "p", "t"], "flags": [ "api-version", "from-org", @@ -202,46 +205,37 @@ "source-dir", "type" ], - "alias": ["force:source:manifest:create"], - "flagChars": ["c", "d", "m", "n", "p", "t"], - "flagAliases": [ - "apiversion", - "fromorg", - "includepackages", - "manifestname", - "manifesttype", - "o", - "outputdir", - "sourcepath" - ] + "plugin": "@salesforce/plugin-deploy-retrieve" }, { - "command": "project:list:ignored", - "plugin": "@salesforce/plugin-deploy-retrieve", - "flags": ["json", "source-dir"], "alias": ["force:source:ignored:list"], + "command": "project:list:ignored", + "flagAliases": ["sourcepath"], "flagChars": ["p"], - "flagAliases": ["sourcepath"] + "flags": ["json", "source-dir"], + "plugin": "@salesforce/plugin-deploy-retrieve" }, { - "command": "project:reset:tracking", - "plugin": "@salesforce/plugin-deploy-retrieve", - "flags": ["api-version", "json", "loglevel", "no-prompt", "revision", "target-org"], "alias": ["force:source:tracking:reset"], + "command": "project:reset:tracking", + "flagAliases": ["apiversion", "noprompt", "targetusername", "u"], "flagChars": ["o", "p", "r"], - "flagAliases": ["apiversion", "noprompt", "targetusername", "u"] + "flags": ["api-version", "json", "loglevel", "no-prompt", "revision", "target-org"], + "plugin": "@salesforce/plugin-deploy-retrieve" }, { - "command": "project:retrieve:preview", - "plugin": "@salesforce/plugin-deploy-retrieve", - "flags": ["ignore-conflicts", "json", "target-org", "concise"], "alias": ["retrieve:metadata:preview"], + "command": "project:retrieve:preview", + "flagAliases": [], "flagChars": ["c", "o"], - "flagAliases": [] + "flags": ["concise", "ignore-conflicts", "json", "target-org"], + "plugin": "@salesforce/plugin-deploy-retrieve" }, { + "alias": ["retrieve:metadata"], "command": "project:retrieve:start", - "plugin": "@salesforce/plugin-deploy-retrieve", + "flagAliases": [], + "flagChars": ["a", "c", "d", "m", "n", "o", "r", "t", "w", "x", "z"], "flags": [ "api-version", "ignore-conflicts", @@ -258,8 +252,6 @@ "wait", "zip-file-name" ], - "alias": ["retrieve:metadata"], - "flagChars": ["a", "c", "d", "m", "n", "o", "r", "t", "w", "x", "z"], - "flagAliases": [] + "plugin": "@salesforce/plugin-deploy-retrieve" } ] From 49bf7f1f0218a5e75b4aa7f00c7d4264fb179fa7 Mon Sep 17 00:00:00 2001 From: mshanemc Date: Wed, 3 Jan 2024 09:40:26 -0600 Subject: [PATCH 4/7] chore: schema, links update --- CONTRIBUTING.md | 38 ----------- README.md | 2 - schemas/hooks/sf-deploy.json | 129 ----------------------------------- 3 files changed, 169 deletions(-) delete mode 100644 CONTRIBUTING.md delete mode 100644 schemas/hooks/sf-deploy.json diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index cb71291d..00000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,38 +0,0 @@ -# Add a new deploy command - -The deploy-retrieve plugin does not have any commands for deploying or or retrieving specific pieces of a salesforce project (e.g. metadata to a scratch or functions to a compute environment). Instead, we ask developers to create their own plugin with those commands. In order for the `deploy` or `retrieve` commands to know about the individual plugins, each plugin must implement an [oclif hook](https://oclif.io/docs/hooks) which returns [`Deployers`](https://github.com/salesforcecli/plugin-deploy-retrieve-utils/blob/main/src/deployer.ts) and `Retrievers`. - -This method allows developers to own their own plugins while also allowing a simple way for the overarching `project` topic to interact with those plugins. - -## Deploy - -To implement the oclif hook for the deploy commands, you must implement a `project:findDeployers` hook in your project. To do this you need to specify the location of the hook in your package.json and implement the hook. For example, in your package.json - -```json -"oclif": { - "hooks": { - "project:findDeployers": "./lib/hooks/findDeployers" - } -} -``` - -And then in your code, you'll have a `findDeployers.ts` file under the `hooks` directory. Here's an example of a very basic implementation: - -```typescript -// hooks/findDeployers.ts -import { Deployer, Options } from '@salesforce/plugin-deploy-retrieve-utils'; - -const hook = async function (options: Options): Promise { - return []; // return your Deployers here -}; - -export default hook; -``` - -### Deployers - -The [Deployer class](https://github.com/salesforcecli/plugin-deploy-retrieve-utils/blob/main/src/deployer.ts) is a simple interface for setting up and executing deploys. It has two primary methods, `setup` and `deploy`. - -The `setup` method allows developers to do any setup that's required before a deploy can be executed. This could be anything - in some cases you might need to prompt the user for additional information or in other cases you might need to do some environment setup. - -The `deploy` method is where you will write the code that executes the deploy. Again, developers have full autonomy over how this is implemented. diff --git a/README.md b/README.md index 00e119e2..d4e5710b 100644 --- a/README.md +++ b/README.md @@ -24,8 +24,6 @@ sf plugins:install plugin-deploy-retrieve@x.y.z 8. Sign CLA (see [CLA](#cla) below). 9. Send us a pull request when you are done. We'll review your code, suggest any needed changes, and merge it in. -To add a new project command see the [contributing guide](CONTRIBUTING.md) - ### CLA External contributors will be required to sign a Contributor's License diff --git a/schemas/hooks/sf-deploy.json b/schemas/hooks/sf-deploy.json deleted file mode 100644 index 2dc5fb68..00000000 --- a/schemas/hooks/sf-deploy.json +++ /dev/null @@ -1,129 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/MetadataDeployer", - "definitions": { - "MetadataDeployer": { - "type": "object", - "properties": { - "deployables": { - "type": "array", - "items": { - "$ref": "#/definitions/DeployablePackage" - }, - "description": "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." - } - }, - "required": ["deployables"], - "additionalProperties": false - }, - "DeployablePackage": { - "type": "object", - "properties": { - "pkg": { - "$ref": "#/definitions/NamedPackageDir" - } - }, - "required": ["pkg"], - "additionalProperties": false - }, - "NamedPackageDir": { - "type": "object", - "additionalProperties": false, - "properties": { - "name": { - "type": "string", - "description": "The [normalized](https://nodejs.org/api/path.html#path_path_normalize_path) path used as the package name." - }, - "fullPath": { - "type": "string", - "description": "The absolute path of the package." - }, - "ancestorId": { - "type": "string" - }, - "ancestorVersion": { - "type": "string" - }, - "default": { - "type": "boolean" - }, - "definitionFile": { - "type": "string" - }, - "dependencies": { - "type": "array", - "items": { - "$ref": "#/definitions/PackageDirDependency" - } - }, - "includeProfileUserLicenses": { - "type": "boolean" - }, - "package": { - "type": "string" - }, - "path": { - "type": "string" - }, - "postInstallScript": { - "type": "string" - }, - "postInstallUrl": { - "type": "string" - }, - "releaseNotesUrl": { - "type": "string" - }, - "scopeProfiles": { - "type": "boolean" - }, - "uninstallScript": { - "type": "string" - }, - "versionDescription": { - "type": "string" - }, - "versionName": { - "type": "string" - }, - "versionNumber": { - "type": "string" - }, - "unpackagedMetadata": { - "type": "object", - "properties": { - "path": { - "type": "string" - } - }, - "required": ["path"], - "additionalProperties": false - }, - "seedMetadata": { - "type": "object", - "properties": { - "path": { - "type": "string" - } - }, - "required": ["path"], - "additionalProperties": false - } - }, - "required": ["fullPath", "name", "path"] - }, - "PackageDirDependency": { - "type": "object", - "properties": { - "package": { - "type": "string" - }, - "versionNumber": { - "type": "string" - } - }, - "required": ["package"], - "additionalProperties": {} - } - } -} From 4570e7dbb74088e505d1cbb615746ff6e440b8bc Mon Sep 17 00:00:00 2001 From: mshanemc Date: Thu, 4 Jan 2024 10:06:30 -0600 Subject: [PATCH 5/7] style: formatting --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 50b29067..0bf42146 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@salesforce/plugin-deploy-retrieve", "description": "deploy and retrieve commands for sf", - "version""3.0.0", + "version": "3.0.0", "author": "Salesforce", "bugs": "https://github.com/forcedotcom/cli/issues", "dependencies": { @@ -248,4 +248,4 @@ }, "exports": "./lib/index.js", "type": "module" -} \ No newline at end of file +} From 9bc2da5c515e9103134d3202693f84bdb357c2ee Mon Sep 17 00:00:00 2001 From: mshanemc Date: Fri, 5 Jan 2024 08:48:06 -0600 Subject: [PATCH 6/7] feat: new inquirer --- package.json | 2 +- src/commands/project/convert/mdapi.ts | 4 +- src/commands/project/convert/source.ts | 4 +- src/commands/project/delete/source.ts | 4 +- src/commands/project/delete/tracking.ts | 8 +- src/commands/project/deploy/cancel.ts | 6 +- src/commands/project/deploy/preview.ts | 9 +- src/commands/project/deploy/quick.ts | 6 +- src/commands/project/deploy/start.ts | 5 +- src/commands/project/list/ignored.ts | 6 +- src/commands/project/reset/tracking.ts | 11 +- src/commands/project/retrieve/preview.ts | 9 +- src/commands/project/retrieve/start.ts | 4 +- yarn.lock | 131 +++++++++++++++++++---- 14 files changed, 148 insertions(+), 61 deletions(-) diff --git a/package.json b/package.json index 0bf42146..fe37032a 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "@salesforce/apex-node": "^3.0.1", "@salesforce/core": "^6.4.2", "@salesforce/kit": "^3.0.15", - "@salesforce/sf-plugins-core": "^5.0.13", + "@salesforce/sf-plugins-core": "5.0.14-dev.2", "@salesforce/source-deploy-retrieve": "^10.2.5", "@salesforce/source-tracking": "^5.1.3", "@salesforce/ts-types": "^2.0.9", diff --git a/src/commands/project/convert/mdapi.ts b/src/commands/project/convert/mdapi.ts index aef6ddc7..8eab40e3 100644 --- a/src/commands/project/convert/mdapi.ts +++ b/src/commands/project/convert/mdapi.ts @@ -26,7 +26,7 @@ import { Interfaces } from '@oclif/core'; import { ConvertMdapiJson } from '../../../utils/types.js'; import { MetadataConvertResultFormatter } from '../../../formatters/metadataConvertResultFormatter.js'; -Messages.importMessagesDirectoryFromMetaUrl(import.meta.url) +Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'convert.mdapi'); export interface EnsureFsFlagOptions { @@ -92,7 +92,7 @@ export class Mdapi extends SfCommand { protected async convert(): Promise { const [outputDir] = await Promise.all([ - resolveOutputDir(this.flags['output-dir'] ?? this.project.getDefaultPackage().path), + resolveOutputDir(this.flags['output-dir'] ?? this.project!.getDefaultPackage().path), resolveMetadataPaths(this.flags['metadata-dir'] ?? []), ]); diff --git a/src/commands/project/convert/source.ts b/src/commands/project/convert/source.ts index 1664e798..bf2137b0 100644 --- a/src/commands/project/convert/source.ts +++ b/src/commands/project/convert/source.ts @@ -27,7 +27,7 @@ import { getPackageDirs, getSourceApiVersion } from '../../../utils/project.js'; import { SourceConvertResultFormatter } from '../../../formatters/sourceConvertResultFormatter.js'; import { ConvertResultJson } from '../../../utils/types.js'; -Messages.importMessagesDirectoryFromMetaUrl(import.meta.url) +Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'convert.source'); export class Source extends SfCommand { @@ -112,7 +112,7 @@ export class Source extends SfCommand { // no options passed, convert the default package (usually force-app) if (!sourcepath && !metadata && !manifest && !rootdir) { - paths.push(this.project.getDefaultPackage().path); + paths.push(this.project!.getDefaultPackage().path); } this.componentSet = await ComponentSetBuilder.build({ diff --git a/src/commands/project/delete/source.ts b/src/commands/project/delete/source.ts index dc99f7a4..947d063b 100644 --- a/src/commands/project/delete/source.ts +++ b/src/commands/project/delete/source.ts @@ -157,7 +157,7 @@ export class Source extends SfCommand { protected async preChecks(): Promise { if (this.flags['track-source']) { - this.tracking = await SourceTracking.create({ org: this.org, project: this.project }); + this.tracking = await SourceTracking.create({ org: this.org, project: this.project! }); } if (!validateTests(this.flags['test-level'], this.flags.tests)) { @@ -471,7 +471,7 @@ export class Source extends SfCommand { ? messages.getMessage('areYouSureCheckOnly') : messages.getMessage('areYouSure') ); - return this.confirm(message.join('\n')); + return this.confirm({ message: message.join('\n') }); } return true; } diff --git a/src/commands/project/delete/tracking.ts b/src/commands/project/delete/tracking.ts index 3f42aa4d..4660b580 100644 --- a/src/commands/project/delete/tracking.ts +++ b/src/commands/project/delete/tracking.ts @@ -5,8 +5,6 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ - - import { Messages } from '@salesforce/core'; import chalk from 'chalk'; import { SourceTracking } from '@salesforce/source-tracking'; @@ -18,7 +16,7 @@ import { SfCommand, } from '@salesforce/sf-plugins-core'; -Messages.importMessagesDirectoryFromMetaUrl(import.meta.url) +Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'delete.tracking'); export type DeleteTrackingResult = { @@ -49,9 +47,9 @@ export class DeleteTracking extends SfCommand { const { flags } = await this.parse(DeleteTracking); let clearedFiles: string[] = []; - if (flags['no-prompt'] || (await this.confirm(chalk.dim(messages.getMessage('promptMessage'))))) { + if (flags['no-prompt'] || (await this.confirm({ message: chalk.dim(messages.getMessage('promptMessage')) }))) { const sourceTracking = await SourceTracking.create({ - project: this.project, + project: this.project!, org: flags['target-org'], }); clearedFiles = await Promise.all([sourceTracking.clearLocalTracking(), sourceTracking.clearRemoteTracking()]); diff --git a/src/commands/project/deploy/cancel.ts b/src/commands/project/deploy/cancel.ts index a2ea31df..20af243f 100644 --- a/src/commands/project/deploy/cancel.ts +++ b/src/commands/project/deploy/cancel.ts @@ -5,8 +5,6 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ - - import { Messages } from '@salesforce/core'; import { Duration } from '@salesforce/kit'; import { SfCommand, Flags } from '@salesforce/sf-plugins-core'; @@ -17,7 +15,7 @@ import { AsyncDeployCancelResultFormatter } from '../../../formatters/asyncDeplo import { DeployCancelResultFormatter } from '../../../formatters/deployCancelResultFormatter.js'; import { DeployResultJson } from '../../../utils/types.js'; -Messages.importMessagesDirectoryFromMetaUrl(import.meta.url) +Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy.metadata.cancel'); export default class DeployMetadataCancel extends SfCommand { @@ -96,7 +94,7 @@ export default class DeployMetadataCancel extends SfCommand { } } - protected catch(error: SfCommand.Error): Promise { + protected catch(error: SfCommand.Error): Promise { if (error.name.includes('INVALID_ID_FIELD')) { const err = messages.createError('error.CannotCancelDeploy'); return super.catch({ diff --git a/src/commands/project/deploy/preview.ts b/src/commands/project/deploy/preview.ts index a2cc1537..d39afcec 100644 --- a/src/commands/project/deploy/preview.ts +++ b/src/commands/project/deploy/preview.ts @@ -5,7 +5,6 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ - import { Messages } from '@salesforce/core'; import { SfCommand, Flags } from '@salesforce/sf-plugins-core'; import { SourceTracking } from '@salesforce/source-tracking'; @@ -13,7 +12,7 @@ import { ForceIgnore } from '@salesforce/source-deploy-retrieve'; import { buildComponentSet } from '../../../utils/deploy.js'; import { PreviewResult, printTables, compileResults, getConflictFiles } from '../../../utils/previewOutput.js'; -Messages.importMessagesDirectoryFromMetaUrl(import.meta.url) +Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy.metadata.preview'); const exclusiveFlags = ['manifest', 'source-dir', 'metadata']; @@ -64,7 +63,7 @@ export default class DeployMetadataPreview extends SfCommand { public async run(): Promise { const { flags } = await this.parse(DeployMetadataPreview); const deploySpecified = [flags.manifest, flags.metadata, flags['source-dir']].some((f) => f !== undefined); - const forceIgnore = ForceIgnore.findAndCreate(this.project.getDefaultPackage().path); + const forceIgnore = ForceIgnore.findAndCreate(this.project!.getDefaultPackage().path); // we'll need STL both to check conflicts and to get the list of local changes if no flags are provided const stl = @@ -72,7 +71,7 @@ export default class DeployMetadataPreview extends SfCommand { ? undefined : await SourceTracking.create({ org: flags['target-org'], - project: this.project, + project: this.project!, }); const [componentSet, filesWithConflicts] = await Promise.all([ @@ -82,7 +81,7 @@ export default class DeployMetadataPreview extends SfCommand { const output = compileResults({ componentSet, - projectPath: this.project.getPath(), + projectPath: this.project!.getPath(), filesWithConflicts, forceIgnore, baseOperation: 'deploy', diff --git a/src/commands/project/deploy/quick.ts b/src/commands/project/deploy/quick.ts index 1e67b186..6877259b 100644 --- a/src/commands/project/deploy/quick.ts +++ b/src/commands/project/deploy/quick.ts @@ -5,8 +5,6 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ - - import chalk from 'chalk'; import { Messages, Org } from '@salesforce/core'; import { SfCommand, toHelpSection, Flags } from '@salesforce/sf-plugins-core'; @@ -19,7 +17,7 @@ import { AsyncDeployResultFormatter } from '../../../formatters/asyncDeployResul import { DeployResultFormatter } from '../../../formatters/deployResultFormatter.js'; import { API, DeployResultJson } from '../../../utils/types.js'; -Messages.importMessagesDirectoryFromMetaUrl(import.meta.url) +Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy.metadata.quick'); export default class DeployMetadataQuick extends SfCommand { @@ -134,7 +132,7 @@ export default class DeployMetadataQuick extends SfCommand { return formatter.getJson(); } - protected catch(error: SfCommand.Error): Promise { + protected catch(error: SfCommand.Error): Promise { if (error.name.includes('INVALID_ID_FIELD')) { const err = messages.createError('error.CannotQuickDeploy'); return super.catch({ diff --git a/src/commands/project/deploy/start.ts b/src/commands/project/deploy/start.ts index 33977744..c6297396 100644 --- a/src/commands/project/deploy/start.ts +++ b/src/commands/project/deploy/start.ts @@ -5,7 +5,6 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ - import chalk from 'chalk'; import { EnvironmentVariable, Lifecycle, Messages, OrgConfigProperties, SfError } from '@salesforce/core'; import { DeployVersionData } from '@salesforce/source-deploy-retrieve'; @@ -24,7 +23,7 @@ import { coverageFormattersFlag, fileOrDirFlag, testLevelFlag, testsFlag } from import { writeConflictTable } from '../../../utils/conflicts.js'; import { getOptionalProject } from '../../../utils/project.js'; -Messages.importMessagesDirectoryFromMetaUrl(import.meta.url) +Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy.metadata'); const exclusiveFlags = ['manifest', 'source-dir', 'metadata', 'metadata-dir']; @@ -262,7 +261,7 @@ export default class DeployMetadata extends SfCommand { return formatter.getJson(); } - protected catch(error: Error | SfError): Promise { + protected catch(error: Error | SfError): Promise { if (error instanceof SourceConflictError && error.data) { if (!this.jsonEnabled()) { writeConflictTable(error.data); diff --git a/src/commands/project/list/ignored.ts b/src/commands/project/list/ignored.ts index 61e3f7e6..2c42438e 100644 --- a/src/commands/project/list/ignored.ts +++ b/src/commands/project/list/ignored.ts @@ -11,7 +11,7 @@ import { Messages, SfError } from '@salesforce/core'; import { ForceIgnore } from '@salesforce/source-deploy-retrieve'; import { SfCommand, Flags } from '@salesforce/sf-plugins-core'; -Messages.importMessagesDirectoryFromMetaUrl(import.meta.url) +Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'list.ignored'); export type SourceIgnoredResults = { @@ -43,10 +43,10 @@ export class Ignored extends SfCommand { public async run(): Promise { const flags = (await this.parse(Ignored)).flags; try { - this.forceIgnore = ForceIgnore.findAndCreate(this.project.getPath()); + this.forceIgnore = ForceIgnore.findAndCreate(this.project!.getPath()); const sourcepaths = flags['source-dir'] ? [flags['source-dir']] - : this.project.getUniquePackageDirectories().map((pDir) => pDir.path); + : this.project!.getUniquePackageDirectories().map((pDir) => pDir.path); const ignoredFiles = (await Promise.all(sourcepaths.map((sp) => this.statIgnored(sp.trim())))).flat(); diff --git a/src/commands/project/reset/tracking.ts b/src/commands/project/reset/tracking.ts index 65bdd7ac..89dd03eb 100644 --- a/src/commands/project/reset/tracking.ts +++ b/src/commands/project/reset/tracking.ts @@ -5,8 +5,6 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ - - import { Messages } from '@salesforce/core'; import { SourceTracking } from '@salesforce/source-tracking'; import { @@ -18,7 +16,7 @@ import { StandardColors, } from '@salesforce/sf-plugins-core'; -Messages.importMessagesDirectoryFromMetaUrl(import.meta.url) +Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'delete.tracking'); export type ResetTrackingResult = { @@ -55,9 +53,12 @@ export class ResetTracking extends SfCommand { public async run(): Promise { const { flags } = await this.parse(ResetTracking); - if (flags['no-prompt'] || (await this.confirm(StandardColors.info(messages.getMessage('promptMessage'))))) { + if ( + flags['no-prompt'] || + (await this.confirm({ message: StandardColors.info(messages.getMessage('promptMessage')) })) + ) { const sourceTracking = await SourceTracking.create({ - project: this.project, + project: this.project!, org: flags['target-org'], }); diff --git a/src/commands/project/retrieve/preview.ts b/src/commands/project/retrieve/preview.ts index 675d9c93..d884a418 100644 --- a/src/commands/project/retrieve/preview.ts +++ b/src/commands/project/retrieve/preview.ts @@ -5,14 +5,13 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ - import { Messages } from '@salesforce/core'; import { SfCommand, Flags } from '@salesforce/sf-plugins-core'; import { SourceTracking } from '@salesforce/source-tracking'; import { ForceIgnore } from '@salesforce/source-deploy-retrieve'; import { PreviewResult, printTables, compileResults, getConflictFiles } from '../../../utils/previewOutput.js'; -Messages.importMessagesDirectoryFromMetaUrl(import.meta.url) +Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'retrieve.metadata.preview'); export default class RetrieveMetadataPreview extends SfCommand { @@ -47,11 +46,11 @@ export default class RetrieveMetadataPreview extends SfCommand { const stl = await SourceTracking.create({ org: flags['target-org'], - project: this.project, + project: this.project!, ignoreConflicts: flags['ignore-conflicts'], }); - const forceIgnore = ForceIgnore.findAndCreate(this.project.getDefaultPackage().path); + const forceIgnore = ForceIgnore.findAndCreate(this.project!.getDefaultPackage().path); const [componentSet, filesWithConflicts, remoteDeletes] = await Promise.all([ stl.remoteNonDeletesAsComponentSet(), @@ -61,7 +60,7 @@ export default class RetrieveMetadataPreview extends SfCommand { const output = compileResults({ componentSet, - projectPath: this.project.getPath(), + projectPath: this.project!.getPath(), filesWithConflicts, forceIgnore, baseOperation: 'retrieve', diff --git a/src/commands/project/retrieve/start.ts b/src/commands/project/retrieve/start.ts index 8abc44f2..99374b56 100644 --- a/src/commands/project/retrieve/start.ts +++ b/src/commands/project/retrieve/start.ts @@ -36,7 +36,7 @@ import { RetrieveResultJson } from '../../../utils/types.js'; import { writeConflictTable } from '../../../utils/conflicts.js'; import { promisesQueue } from '../../../utils/promiseQueue.js'; -Messages.importMessagesDirectoryFromMetaUrl(import.meta.url) +Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'retrieve.start'); const mdTransferMessages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'metadata.transfer'); @@ -266,7 +266,7 @@ export default class RetrieveMetadata extends SfCommand { return formatter.getJson(); } - protected catch(error: Error | SfError): Promise { + protected catch(error: Error | SfError): Promise { if (!this.jsonEnabled() && error instanceof SourceConflictError && error.data) { writeConflictTable(error.data); // set the message and add plugin-specific actions diff --git a/yarn.lock b/yarn.lock index 589e89d6..eb627369 100644 --- a/yarn.lock +++ b/yarn.lock @@ -444,6 +444,59 @@ 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" @@ -780,10 +833,10 @@ wordwrap "^1.0.0" wrap-ansi "^7.0.0" -"@oclif/core@^3.0.4", "@oclif/core@^3.10.8", "@oclif/core@^3.11.0", "@oclif/core@^3.12.0", "@oclif/core@^3.15.0", "@oclif/core@^3.15.1", "@oclif/core@^3.3.1": - version "3.15.1" - resolved "https://registry.yarnpkg.com/@oclif/core/-/core-3.15.1.tgz#e03fa775d658e76056150ac0c7b8097b6f51ab9c" - integrity sha512-d4457zVo2agLoJG97CmdY6M3BeP5sogBP3BtP65hUvJH6wA6Us1hdY3UiPPtD/ZzZImq7cATVMABuCF9tM+rWA== +"@oclif/core@^3.0.4", "@oclif/core@^3.10.8", "@oclif/core@^3.11.0", "@oclif/core@^3.12.0", "@oclif/core@^3.15.0", "@oclif/core@^3.15.1", "@oclif/core@^3.16.0", "@oclif/core@^3.3.1": + 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" @@ -1116,7 +1169,20 @@ resolved "https://registry.yarnpkg.com/@salesforce/schemas/-/schemas-1.6.1.tgz#7d1c071e1e509ca9d2d8a6e48ac7447dd67a534d" integrity sha512-eVy947ZMxCJReKJdgfddUIsBIbPTa/i8RwQGwxq4/ss38H5sLOAeSTaun9V7HpJ1hkpDznWKfgzYvjsst9K6ig== -"@salesforce/sf-plugins-core@^5.0.1", "@salesforce/sf-plugins-core@^5.0.12", "@salesforce/sf-plugins-core@^5.0.13": +"@salesforce/sf-plugins-core@5.0.14-dev.2": + version "5.0.14-dev.2" + resolved "https://registry.yarnpkg.com/@salesforce/sf-plugins-core/-/sf-plugins-core-5.0.14-dev.2.tgz#a74908346427cf66d693a726ca3e0b928feebe61" + integrity sha512-tfA97vQkSQFMLotOUP+mytx4dE9Ifdt81nQeaa/TxujxPeuPvYiiYyg6YIaUedne8bKAeMy9G/m0wxXpWJaI8g== + dependencies: + "@inquirer/confirm" "^2.0.15" + "@inquirer/password" "^1.1.14" + "@oclif/core" "^3.16.0" + "@salesforce/core" "^6.4.2" + "@salesforce/kit" "^3.0.15" + "@salesforce/ts-types" "^2.0.9" + chalk "^5.3.0" + +"@salesforce/sf-plugins-core@^5.0.1", "@salesforce/sf-plugins-core@^5.0.12": version "5.0.13" resolved "https://registry.yarnpkg.com/@salesforce/sf-plugins-core/-/sf-plugins-core-5.0.13.tgz#f2941527d66ded5750a6646e146af047ab72acc9" integrity sha512-b5R8krKeOIkW0hPxvfpm8T5tCSyWW7MDERnJwm/FXq4ueUJsC1/TCWSscyVKPSZ0VRcEFbzOWKJvpV/omB1D9w== @@ -1474,10 +1540,19 @@ resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-10.0.6.tgz#818551d39113081048bdddbef96701b4e8bb9d1b" integrity sha512-dJvrYWxP/UcXm36Qn36fxhUKu8A/xMRXVT2cliFF1Z7UA9liG5Psj3ezNSZw+5puH2czDXRLcXQxf8JbJt0ejg== -"@types/node@*": - version "20.3.1" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.3.1.tgz#e8a83f1aa8b649377bb1fb5d7bac5cb90e784dfe" - integrity sha512-EhcH/wvidPy1WeML3TtYFGR83UzjxeWRen9V402T8aUGYsCHOmfoisV3ZSg03gAFIbLq8TnWOJ0f4cALtnSEUg== +"@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@*", "@types/node@^20.9.0": + version "20.10.6" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.10.6.tgz#a3ec84c22965802bf763da55b2394424f22bfbb5" + integrity sha512-Vac8H+NlRNNlAmDfGUP7b5h/KA+AtWIzuXy0E6OyP8f1tCLYAtPvKRRDJjAPqhpCb0t6U2j7/xqAuLEebW2kiw== + dependencies: + undici-types "~5.26.4" "@types/node@^12.19.9": version "12.20.55" @@ -1553,6 +1628,11 @@ "@types/expect" "^1.20.4" "@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" resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.11.0.tgz#52aae65174ff526576351f9ccd41cea01001463f" @@ -2531,10 +2611,10 @@ 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.5.0, 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-table@^0.3.1: version "0.3.11" @@ -2548,6 +2628,11 @@ cli-width@^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" @@ -3674,7 +3759,7 @@ faye@1.4.0, 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== @@ -5852,6 +5937,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" @@ -7174,6 +7264,11 @@ run-async@^2.0.0, 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" @@ -7399,10 +7494,10 @@ signal-exit@^3.0.0, signal-exit@^3.0.2, signal-exit@^3.0.3, signal-exit@^3.0.7: 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: - version "4.0.2" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.0.2.tgz#ff55bb1d9ff2114c13b400688fa544ac63c36967" - integrity sha512-MY2/qGx4enyjprQnFaZsHib3Yadh3IXyV2C321GY0pjGfVBu4un0uDJkwgdxqO+Rdx8JMT8IfJIRwbYVz3Ob3Q== +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== sigstore@^1.3.0: version "1.6.0" From 6f1e6f241112f2a5b913f289b4759c7eef0f2345 Mon Sep 17 00:00:00 2001 From: mshanemc Date: Fri, 5 Jan 2024 16:40:30 -0600 Subject: [PATCH 7/7] chore: current sf-plugins-core --- package.json | 2 +- yarn.lock | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index fe37032a..e4b49716 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "@salesforce/apex-node": "^3.0.1", "@salesforce/core": "^6.4.2", "@salesforce/kit": "^3.0.15", - "@salesforce/sf-plugins-core": "5.0.14-dev.2", + "@salesforce/sf-plugins-core": "^7.0.0", "@salesforce/source-deploy-retrieve": "^10.2.5", "@salesforce/source-tracking": "^5.1.3", "@salesforce/ts-types": "^2.0.9", diff --git a/yarn.lock b/yarn.lock index eb627369..eda2726e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1169,19 +1169,6 @@ resolved "https://registry.yarnpkg.com/@salesforce/schemas/-/schemas-1.6.1.tgz#7d1c071e1e509ca9d2d8a6e48ac7447dd67a534d" integrity sha512-eVy947ZMxCJReKJdgfddUIsBIbPTa/i8RwQGwxq4/ss38H5sLOAeSTaun9V7HpJ1hkpDznWKfgzYvjsst9K6ig== -"@salesforce/sf-plugins-core@5.0.14-dev.2": - version "5.0.14-dev.2" - resolved "https://registry.yarnpkg.com/@salesforce/sf-plugins-core/-/sf-plugins-core-5.0.14-dev.2.tgz#a74908346427cf66d693a726ca3e0b928feebe61" - integrity sha512-tfA97vQkSQFMLotOUP+mytx4dE9Ifdt81nQeaa/TxujxPeuPvYiiYyg6YIaUedne8bKAeMy9G/m0wxXpWJaI8g== - dependencies: - "@inquirer/confirm" "^2.0.15" - "@inquirer/password" "^1.1.14" - "@oclif/core" "^3.16.0" - "@salesforce/core" "^6.4.2" - "@salesforce/kit" "^3.0.15" - "@salesforce/ts-types" "^2.0.9" - chalk "^5.3.0" - "@salesforce/sf-plugins-core@^5.0.1", "@salesforce/sf-plugins-core@^5.0.12": version "5.0.13" resolved "https://registry.yarnpkg.com/@salesforce/sf-plugins-core/-/sf-plugins-core-5.0.13.tgz#f2941527d66ded5750a6646e146af047ab72acc9" @@ -1195,6 +1182,19 @@ chalk "^4" inquirer "^8.2.5" +"@salesforce/sf-plugins-core@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@salesforce/sf-plugins-core/-/sf-plugins-core-7.0.0.tgz#56cb4eaafcd04a183938d86c5e93323e037b15ab" + integrity sha512-vl53Ee0/eg9wgvtWro6kX82/943s28Hph/o3lTQk6URorfqMC+zH0RGKJj1X0VKeLhDSOCRYXqIu54jE8AZ/3g== + dependencies: + "@inquirer/confirm" "^2.0.15" + "@inquirer/password" "^1.1.14" + "@oclif/core" "^3.16.0" + "@salesforce/core" "^6.4.2" + "@salesforce/kit" "^3.0.15" + "@salesforce/ts-types" "^2.0.9" + chalk "^5.3.0" + "@salesforce/source-deploy-retrieve@^10.0.0", "@salesforce/source-deploy-retrieve@^10.2.1", "@salesforce/source-deploy-retrieve@^10.2.5": version "10.2.5" resolved "https://registry.yarnpkg.com/@salesforce/source-deploy-retrieve/-/source-deploy-retrieve-10.2.5.tgz#bd2037e28d17ff9bead321acedc63bafb05bd952"