diff --git a/README.md b/README.md index d7f7f9b2..d1e15e0f 100644 --- a/README.md +++ b/README.md @@ -151,7 +151,7 @@ USAGE | -m ] FLAGS - -d, --output-dir= [default: metadataPackage_1708974940174] Output directory to store the Metadata + -d, --output-dir= [default: metadataPackage_1709056694984] Output directory to store the Metadata API–formatted files in. -m, --metadata=... Metadata component names to convert. -n, --package-name= Name of the package to associate with the metadata-formatted files. @@ -1534,7 +1534,9 @@ FLAG DESCRIPTIONS If the target directory matches one of the package directories in your sfdx-project.json file, the command fails. Running the command multiple times with the same target adds new files and overwrites existing files. - -w, --wait= Number of minutes to wait for the command to complete and display results to the terminal window. + -w, --wait= + + Number of minutes to wait for the command to complete and display results to the terminal window. If the command continues to run after the wait period, the CLI returns control of the terminal window to you. diff --git a/messages/metadata.transfer.md b/messages/metadata.transfer.md index ec620743..0a81367b 100644 --- a/messages/metadata.transfer.md +++ b/messages/metadata.transfer.md @@ -10,7 +10,7 @@ In Progress Succeeded -# Cancelled +# Canceled Canceled diff --git a/src/commands/project/deploy/validate.ts b/src/commands/project/deploy/validate.ts index e7f416b6..579b2303 100644 --- a/src/commands/project/deploy/validate.ts +++ b/src/commands/project/deploy/validate.ts @@ -6,7 +6,6 @@ */ import * as os from 'node:os'; - import chalk from 'chalk'; import { EnvironmentVariable, Lifecycle, Messages, OrgConfigProperties, SfError } from '@salesforce/core'; import { CodeCoverageWarnings, DeployVersionData, RequestStatus } from '@salesforce/source-deploy-retrieve'; @@ -21,7 +20,7 @@ import { DEPLOY_STATUS_CODES_DESCRIPTIONS } from '../../../utils/errorCodes.js'; import { ConfigVars } from '../../../configMeta.js'; import { coverageFormattersFlag, fileOrDirFlag, testLevelFlag, testsFlag } from '../../../utils/flags.js'; -Messages.importMessagesDirectoryFromMetaUrl(import.meta.url) +Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy.metadata.validate'); const deployMessages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy.metadata'); diff --git a/src/commands/project/generate/manifest.ts b/src/commands/project/generate/manifest.ts index 6df6eeef..e9faa261 100644 --- a/src/commands/project/generate/manifest.ts +++ b/src/commands/project/generate/manifest.ts @@ -18,7 +18,7 @@ import { } from '@salesforce/sf-plugins-core'; import { getPackageDirs, getSourceApiVersion } from '../../../utils/project.js'; -Messages.importMessagesDirectoryFromMetaUrl(import.meta.url) +Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'manifest.generate'); const manifestTypes = { diff --git a/src/formatters/metadataRetrieveResultFormatter.ts b/src/formatters/metadataRetrieveResultFormatter.ts index 592a1ee8..dfc43893 100644 --- a/src/formatters/metadataRetrieveResultFormatter.ts +++ b/src/formatters/metadataRetrieveResultFormatter.ts @@ -12,7 +12,7 @@ import { Messages } from '@salesforce/core'; import { Formatter, MetadataRetrieveResultJson } from '../utils/types.js'; import { sortFileResponses, asRelativePaths } from '../utils/output.js'; -Messages.importMessagesDirectoryFromMetaUrl(import.meta.url) +Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); export const retrieveMessages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'retrieve.start'); export class MetadataRetrieveResultFormatter implements Formatter { diff --git a/src/formatters/sourceConvertResultFormatter.ts b/src/formatters/sourceConvertResultFormatter.ts index dd471227..13298d1e 100644 --- a/src/formatters/sourceConvertResultFormatter.ts +++ b/src/formatters/sourceConvertResultFormatter.ts @@ -11,7 +11,7 @@ import { ConvertResult } from '@salesforce/source-deploy-retrieve'; import { SfError, Messages } from '@salesforce/core'; import { ConvertResultJson, Formatter } from '../utils/types.js'; -Messages.importMessagesDirectoryFromMetaUrl(import.meta.url) +Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); export const convertMessages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'convert.source'); export class SourceConvertResultFormatter implements Formatter { diff --git a/src/utils/errorCodes.ts b/src/utils/errorCodes.ts index 011c4dce..d3a2d90a 100644 --- a/src/utils/errorCodes.ts +++ b/src/utils/errorCodes.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 { Messages } from '@salesforce/core'; import { RequestStatus } from '@salesforce/source-deploy-retrieve'; -Messages.importMessagesDirectoryFromMetaUrl(import.meta.url) +Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'errorCodes'); export const DEPLOY_STATUS_CODES = new Map([ diff --git a/src/utils/progressBar.ts b/src/utils/progressBar.ts index 90995392..b6fd77c7 100644 --- a/src/utils/progressBar.ts +++ b/src/utils/progressBar.ts @@ -5,13 +5,13 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ - import { envVars as env, EnvironmentVariable, Lifecycle, Messages } from '@salesforce/core'; import { MetadataApiDeploy, MetadataApiDeployStatus } from '@salesforce/source-deploy-retrieve'; import { Progress } from '@salesforce/sf-plugins-core'; import { SourceMemberPollingEvent } from '@salesforce/source-tracking'; +import { ux } from '@oclif/core'; -Messages.importMessagesDirectoryFromMetaUrl(import.meta.url) +Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); const mdTransferMessages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'metadata.transfer'); const showBar = Boolean( @@ -84,7 +84,14 @@ export class DeployProgress extends Progress { testInfo, }); } else { - this.update(0, { errorInfo, testInfo, status: mdTransferMessages.getMessage(data.status) ?? 'Waiting' }); + let status; + try { + status = mdTransferMessages.getMessage(data.status); + } catch (e) { + ux.debug(`data.status message lookup failed for: ${data.status}`); + status = 'Waiting'; + } + this.update(0, { errorInfo, testInfo, status }); } } } diff --git a/test/commands/deploy/start.test.ts b/test/commands/deploy/start.test.ts index fc41723d..7d50824a 100644 --- a/test/commands/deploy/start.test.ts +++ b/test/commands/deploy/start.test.ts @@ -5,15 +5,13 @@ * 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 { MockTestOrgData, TestContext } from '@salesforce/core/lib/testSetup.js'; import { stubSfCommandUx } from '@salesforce/sf-plugins-core'; import { Messages } from '@salesforce/core'; import DeployMetadata from '../../../src/commands/project/deploy/start.js'; -Messages.importMessagesDirectoryFromMetaUrl(import.meta.url) +Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy.metadata'); describe('project deploy start', () => {