From ed9348cd5846bce0eb38970b96f5edc45f22c5aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristina=20Ca=C3=B1izales?= <113132642+CristiCanizales@users.noreply.github.com> Date: Fri, 23 Feb 2024 22:54:41 +0000 Subject: [PATCH] fix: deploy and retrieve from sfdx to sf (#5451) * fix: deploy and retrieve from sfdx to sf * chore: update tests names --------- Co-authored-by: Daphne Yang <139700604+daphne-sfdc@users.noreply.github.com> --- .../salesforcedx-vscode-core/package.json | 74 +++++++-------- .../package.nls.ja.json | 16 ++-- .../salesforcedx-vscode-core/package.nls.json | 16 ++-- ...rceDeployManifest.ts => deployManifest.ts} | 30 ++---- ...eploySourcePath.ts => deploySourcePath.ts} | 22 ++--- .../src/commands/index.ts | 14 +-- ...etrieveManifest.ts => retrieveManifest.ts} | 32 ++----- .../componentNodeDescriber.ts | 0 .../index.ts | 2 +- .../libraryRetrieveSourcePathExecutor.ts | 11 +-- .../nodeDescriber.ts | 0 .../retrieveComponent.ts} | 7 +- .../retrieveDescriber.ts | 0 .../retrieveDescriberFactory.ts | 0 .../retrieveMetadataTrigger.ts | 0 .../typeNodeDescriber.ts | 0 ...eveSourcePath.ts => retrieveSourcePath.ts} | 32 +++---- .../src/commands/util/parameterGatherers.ts | 24 +++-- .../src/conflict/conflictNode.ts | 2 +- .../src/conflict/index.ts | 10 +- .../src/conflict/messages.ts | 4 +- .../salesforcedx-vscode-core/src/index.ts | 95 +++++++++---------- .../src/messages/i18n.ja.ts | 16 ++-- .../src/messages/i18n.ts | 16 ++-- .../src/orgBrowser/nodeTypes.ts | 2 +- .../src/services/sdr/componentSetUtils.ts | 17 ++-- .../src/settings/pushOrDeployOnSave.ts | 2 +- .../test/jest/commands/deployExecutor.test.ts | 10 +- .../test/jest/conflict/messages.test.ts | 4 +- ...anifest.test.ts => deployManifest.test.ts} | 6 +- ...ePath.test.ts => deploySourcePath.test.ts} | 31 ++---- .../commands/orgDisplay.test.ts | 2 +- ...ifest.test.ts => retrieveManifest.test.ts} | 6 +- .../describers.test.ts | 2 +- .../retrieveComponent.test.ts} | 6 +- ...ath.test.ts => retrieveSourcePath.test.ts} | 26 ++--- .../commands/sourceDiff.test.ts | 6 +- .../settings/pushOrDeployOnSave.test.ts | 2 +- 38 files changed, 237 insertions(+), 308 deletions(-) rename packages/salesforcedx-vscode-core/src/commands/{forceSourceDeployManifest.ts => deployManifest.ts} (75%) rename packages/salesforcedx-vscode-core/src/commands/{forceSourceDeploySourcePath.ts => deploySourcePath.ts} (86%) rename packages/salesforcedx-vscode-core/src/commands/{forceSourceRetrieveManifest.ts => retrieveManifest.ts} (71%) rename packages/salesforcedx-vscode-core/src/commands/{forceSourceRetrieveMetadata => retrieveMetadata}/componentNodeDescriber.ts (100%) rename packages/salesforcedx-vscode-core/src/commands/{forceSourceRetrieveMetadata => retrieveMetadata}/index.ts (86%) rename packages/salesforcedx-vscode-core/src/commands/{forceSourceRetrieveMetadata => retrieveMetadata}/libraryRetrieveSourcePathExecutor.ts (92%) rename packages/salesforcedx-vscode-core/src/commands/{forceSourceRetrieveMetadata => retrieveMetadata}/nodeDescriber.ts (100%) rename packages/salesforcedx-vscode-core/src/commands/{forceSourceRetrieveMetadata/forceSourceRetrieveCmp.ts => retrieveMetadata/retrieveComponent.ts} (89%) rename packages/salesforcedx-vscode-core/src/commands/{forceSourceRetrieveMetadata => retrieveMetadata}/retrieveDescriber.ts (100%) rename packages/salesforcedx-vscode-core/src/commands/{forceSourceRetrieveMetadata => retrieveMetadata}/retrieveDescriberFactory.ts (100%) rename packages/salesforcedx-vscode-core/src/commands/{forceSourceRetrieveMetadata => retrieveMetadata}/retrieveMetadataTrigger.ts (100%) rename packages/salesforcedx-vscode-core/src/commands/{forceSourceRetrieveMetadata => retrieveMetadata}/typeNodeDescriber.ts (100%) rename packages/salesforcedx-vscode-core/src/commands/{forceSourceRetrieveSourcePath.ts => retrieveSourcePath.ts} (82%) rename packages/salesforcedx-vscode-core/test/vscode-integration/commands/{forceSourceDeployManifest.test.ts => deployManifest.test.ts} (92%) rename packages/salesforcedx-vscode-core/test/vscode-integration/commands/{forceSourceDeploySourcePath.test.ts => deploySourcePath.test.ts} (92%) rename packages/salesforcedx-vscode-core/test/vscode-integration/commands/{forceSourceRetrieveManifest.test.ts => retrieveManifest.test.ts} (92%) rename packages/salesforcedx-vscode-core/test/vscode-integration/commands/{forceSourceRetrieveMetadata => retrieveMetadata}/describers.test.ts (98%) rename packages/salesforcedx-vscode-core/test/vscode-integration/commands/{forceSourceRetrieveMetadata/forceSourceRetrieveCmp.test.ts => retrieveMetadata/retrieveComponent.test.ts} (97%) rename packages/salesforcedx-vscode-core/test/vscode-integration/commands/{forceSourceRetrieveSourcePath.test.ts => retrieveSourcePath.test.ts} (93%) diff --git a/packages/salesforcedx-vscode-core/package.json b/packages/salesforcedx-vscode-core/package.json index 344f7d1d25..5966c75a37 100644 --- a/packages/salesforcedx-vscode-core/package.json +++ b/packages/salesforcedx-vscode-core/package.json @@ -188,36 +188,36 @@ "group": "inline" }, { - "command": "sfdx.force.source.retrieve.open.component", + "command": "sfdx.retrieve.open.component", "when": "view == metadata && viewItem == component", "group": "inline" }, { - "command": "sfdx.force.source.retrieve.component", + "command": "sfdx.retrieve.component", "when": "view == metadata && viewItem =~ /(type|component|folder)/", "group": "inline" }, { - "command": "sfdx.force.conflict.open", + "command": "sfdx.conflict.open", "when": "view == conflicts && viewItem == conflict-actions", "group": "inline" } ], "editor/context": [ { - "command": "sfdx.force.source.retrieve.current.source.file", + "command": "sfdx.retrieve.current.source.file", "when": "sfdx:project_opened && resourceLangId != 'forcesourcemanifest' && sfdx:has_default_username" }, { - "command": "sfdx.force.source.retrieve.in.manifest", + "command": "sfdx.retrieve.in.manifest", "when": "sfdx:project_opened && resourceLangId == 'forcesourcemanifest' && sfdx:has_default_username" }, { - "command": "sfdx.force.source.deploy.current.source.file", + "command": "sfdx.deploy.current.source.file", "when": "sfdx:project_opened && resourceLangId != 'forcesourcemanifest' && sfdx:has_default_username" }, { - "command": "sfdx.force.source.deploy.in.manifest", + "command": "sfdx.deploy.in.manifest", "when": "sfdx:project_opened && resourceLangId == 'forcesourcemanifest' && sfdx:has_default_username" }, { @@ -307,19 +307,19 @@ "when": "!explorerResourceIsFolder && sfdx:project_opened && resourceLangId != 'forcesourcemanifest' && sfdx:has_default_username" }, { - "command": "sfdx.force.source.retrieve.source.path", + "command": "sfdx.retrieve.source.path", "when": "sfdx:project_opened && resourceLangId != 'forcesourcemanifest' && sfdx:has_default_username" }, { - "command": "sfdx.force.source.retrieve.in.manifest", + "command": "sfdx.retrieve.in.manifest", "when": "sfdx:project_opened && resourceLangId == 'forcesourcemanifest' && sfdx:has_default_username" }, { - "command": "sfdx.force.source.deploy.source.path", + "command": "sfdx.deploy.source.path", "when": "sfdx:project_opened && resourceLangId != 'forcesourcemanifest' && sfdx:has_default_username" }, { - "command": "sfdx.force.source.deploy.in.manifest", + "command": "sfdx.deploy.in.manifest", "when": "sfdx:project_opened && resourceLangId == 'forcesourcemanifest' && sfdx:has_default_username" }, { @@ -485,35 +485,35 @@ "when": "!sfdx:internal_dev" }, { - "command": "sfdx.force.source.retrieve.component", + "command": "sfdx.retrieve.component", "when": "false" }, { - "command": "sfdx.force.source.retrieve.open.component", + "command": "sfdx.retrieve.open.component", "when": "false" }, { - "command": "sfdx.force.source.retrieve.source.path", + "command": "sfdx.retrieve.source.path", "when": "false" }, { - "command": "sfdx.force.source.deploy.source.path", + "command": "sfdx.deploy.source.path", "when": "false" }, { - "command": "sfdx.force.source.retrieve.current.source.file", + "command": "sfdx.retrieve.current.source.file", "when": "sfdx:project_opened && resourceLangId != 'forcesourcemanifest' && editorIsOpen && sfdx:has_default_username" }, { - "command": "sfdx.force.source.retrieve.in.manifest", + "command": "sfdx.retrieve.in.manifest", "when": "sfdx:project_opened && resourceLangId == 'forcesourcemanifest' && sfdx:has_default_username" }, { - "command": "sfdx.force.source.deploy.current.source.file", + "command": "sfdx.deploy.current.source.file", "when": "sfdx:project_opened && resourceLangId != 'forcesourcemanifest' && editorIsOpen && sfdx:has_default_username" }, { - "command": "sfdx.force.source.deploy.in.manifest", + "command": "sfdx.deploy.in.manifest", "when": "sfdx:project_opened && resourceLangId == 'forcesourcemanifest' && sfdx:has_default_username" }, { @@ -593,7 +593,7 @@ "when": "false" }, { - "command": "sfdx.force.conflict.open", + "command": "sfdx.conflict.open", "when": "false" }, { @@ -800,28 +800,28 @@ "title": "%isv_bootstrap_command_text%" }, { - "command": "sfdx.force.source.retrieve.source.path", - "title": "%force_source_retrieve_text%" + "command": "sfdx.retrieve.source.path", + "title": "%retrieve_text%" }, { - "command": "sfdx.force.source.retrieve.current.source.file", - "title": "%force_source_retrieve_this_source_text%" + "command": "sfdx.retrieve.current.source.file", + "title": "%retrieve_this_source_text%" }, { - "command": "sfdx.force.source.retrieve.in.manifest", - "title": "%force_source_retrieve_in_manifest_text%" + "command": "sfdx.retrieve.in.manifest", + "title": "%retrieve_in_manifest_text%" }, { - "command": "sfdx.force.source.deploy.source.path", - "title": "%force_source_deploy_text%" + "command": "sfdx.deploy.source.path", + "title": "%deploy_text%" }, { - "command": "sfdx.force.source.deploy.current.source.file", - "title": "%force_source_deploy_this_source_text%" + "command": "sfdx.deploy.current.source.file", + "title": "%deploy_this_source_text%" }, { - "command": "sfdx.force.source.deploy.in.manifest", - "title": "%force_source_deploy_in_manifest_text%" + "command": "sfdx.deploy.in.manifest", + "title": "%deploy_in_manifest_text%" }, { "command": "sfdx.delete.source", @@ -864,16 +864,16 @@ } }, { - "command": "sfdx.force.source.retrieve.component", - "title": "%force_source_retrieve_display_text%", + "command": "sfdx.retrieve.component", + "title": "%retrieve_display_text%", "icon": { "light": "resources/light/retrieve.svg", "dark": "resources/dark/retrieve.svg" } }, { - "command": "sfdx.force.source.retrieve.open.component", - "title": "%force_source_retrieve_and_open_display_text%", + "command": "sfdx.retrieve.open.component", + "title": "%retrieve_and_open_display_text%", "icon": { "light": "resources/light/code.svg", "dark": "resources/dark/code.svg" @@ -892,7 +892,7 @@ "title": "%diff_folder_against_org%" }, { - "command": "sfdx.force.conflict.open", + "command": "sfdx.conflict.open", "title": "%conflict_detect_open_file%", "icon": { "light": "resources/light/go-to-file.svg", diff --git a/packages/salesforcedx-vscode-core/package.nls.ja.json b/packages/salesforcedx-vscode-core/package.nls.ja.json index bc9fdb1aab..2909efdb59 100644 --- a/packages/salesforcedx-vscode-core/package.nls.ja.json +++ b/packages/salesforcedx-vscode-core/package.nls.ja.json @@ -23,14 +23,14 @@ "force_manifest_editor_show_text": "SFDX: パッケージマニフェストエディタを表示", "package_install_text": "SFDX: パッケージをインストール", "sobjects_refresh": "SFDX: SObject 定義を更新", - "force_source_deploy_in_manifest_text": "SFDX: マニフェストファイルのソースを組織へデプロイ", - "force_source_deploy_text": "SFDX: 組織へソースをデプロイ", - "force_source_deploy_this_source_text": "SFDX: このソースを組織へデプロイ", - "force_source_retrieve_and_open_display_text": "ソースを取得して開く", - "force_source_retrieve_display_text": "組織からソースを取得", - "force_source_retrieve_in_manifest_text": "SFDX: マニフェストファイルのソースを組織から取得", - "force_source_retrieve_text": "SFDX: 組織からソースを取得", - "force_source_retrieve_this_source_text": "SFDX: このソースを組織から取得", + "deploy_in_manifest_text": "SFDX: マニフェストファイルのソースを組織へデプロイ", + "deploy_text": "SFDX: 組織へソースをデプロイ", + "deploy_this_source_text": "SFDX: このソースを組織へデプロイ", + "retrieve_and_open_display_text": "ソースを取得して開く", + "retrieve_display_text": "組織からソースを取得", + "retrieve_in_manifest_text": "SFDX: マニフェストファイルのソースを組織から取得", + "retrieve_text": "SFDX: 組織からソースを取得", + "retrieve_this_source_text": "SFDX: このソースを組織から取得", "view_local_changes_text": "SFDX: ローカルの変更を表示", "view_remote_changes_text": "SFDX: デフォルトのスクラッチ組織内の変更を表示", "view_all_changes_text": "SFDX: すべての変更を表示 (ローカルとデフォルトのスクラッチ組織内)", diff --git a/packages/salesforcedx-vscode-core/package.nls.json b/packages/salesforcedx-vscode-core/package.nls.json index c420ab4142..91bfaab826 100644 --- a/packages/salesforcedx-vscode-core/package.nls.json +++ b/packages/salesforcedx-vscode-core/package.nls.json @@ -22,14 +22,14 @@ "enable_source_tracking_for_deploy_and_retrieve": "Specifies whether source-tracking is enabled for deploy or retrieve operations in a source-tracked org. Disable source-tracking if you are experiencing performance issues using deploy or retrieve commands on your source-tracked orgs.", "force_lightning_lwc_test_create_text": "SFDX: Create Lightning Web Component Test", "force_manifest_editor_show_text": "SFDX: Show Package Manifest Editor", - "force_source_deploy_in_manifest_text": "SFDX: Deploy Source in Manifest to Org", - "force_source_deploy_text": "SFDX: Deploy Source to Org", - "force_source_deploy_this_source_text": "SFDX: Deploy This Source to Org", - "force_source_retrieve_and_open_display_text": "Retrieve and Open Source", - "force_source_retrieve_display_text": "Retrieve Source from Org", - "force_source_retrieve_in_manifest_text": "SFDX: Retrieve Source in Manifest from Org", - "force_source_retrieve_text": "SFDX: Retrieve Source from Org", - "force_source_retrieve_this_source_text": "SFDX: Retrieve This Source from Org", + "deploy_in_manifest_text": "SFDX: Deploy Source in Manifest to Org", + "deploy_text": "SFDX: Deploy Source to Org", + "deploy_this_source_text": "SFDX: Deploy This Source to Org", + "retrieve_and_open_display_text": "Retrieve and Open Source", + "retrieve_display_text": "Retrieve Source from Org", + "retrieve_in_manifest_text": "SFDX: Retrieve Source in Manifest from Org", + "retrieve_text": "SFDX: Retrieve Source from Org", + "retrieve_this_source_text": "SFDX: Retrieve This Source from Org", "ignore_conflicts_on_push_description": "Specifies whether to always use --ignore-conflicts when you run project:deploy:start on save", "isv_bootstrap_command_text": "SFDX: Create and Set Up Project for ISV Debugging", "launch_apex_replay_debugger_with_current_file": "SFDX: Launch Apex Replay Debugger with Current File", diff --git a/packages/salesforcedx-vscode-core/src/commands/forceSourceDeployManifest.ts b/packages/salesforcedx-vscode-core/src/commands/deployManifest.ts similarity index 75% rename from packages/salesforcedx-vscode-core/src/commands/forceSourceDeployManifest.ts rename to packages/salesforcedx-vscode-core/src/commands/deployManifest.ts index 8dfb44bdac..64e8e4f17b 100644 --- a/packages/salesforcedx-vscode-core/src/commands/forceSourceDeployManifest.ts +++ b/packages/salesforcedx-vscode-core/src/commands/deployManifest.ts @@ -17,20 +17,11 @@ import { SfdxPackageDirectories } from '../sfdxProject'; import { telemetryService } from '../telemetry'; import { workspaceUtils } from '../util'; import { DeployExecutor } from './baseDeployRetrieve'; -import { - FilePathGatherer, - SfdxCommandlet, - SfdxWorkspaceChecker -} from './util'; +import { FilePathGatherer, SfdxCommandlet, SfdxWorkspaceChecker } from './util'; -export class LibrarySourceDeployManifestExecutor extends DeployExecutor< - string -> { +export class LibraryDeployManifestExecutor extends DeployExecutor { constructor() { - super( - nls.localize('force_source_deploy_text'), - 'force_source_deploy_with_manifest_beta' - ); + super(nls.localize('deploy_text'), 'deploy_with_manifest_beta'); } protected async getComponents( @@ -51,17 +42,14 @@ export class LibrarySourceDeployManifestExecutor extends DeployExecutor< } } -export async function forceSourceDeployManifest(manifestUri: vscode.Uri) { +export async function deployManifest(manifestUri: vscode.Uri) { if (!manifestUri) { const editor = vscode.window.activeTextEditor; if (editor && editor.document.languageId === 'forcesourcemanifest') { manifestUri = editor.document.uri; } else { - const errorMessage = nls.localize('force_source_deploy_select_manifest'); - telemetryService.sendException( - 'force_source_deploy_with_manifest', - errorMessage - ); + const errorMessage = nls.localize('deploy_select_manifest'); + telemetryService.sendException('deploy_with_manifest', errorMessage); notificationService.showErrorMessage(errorMessage); channelService.appendLine(errorMessage); channelService.showChannelOutput(); @@ -69,15 +57,13 @@ export async function forceSourceDeployManifest(manifestUri: vscode.Uri) { } } - const messages = getConflictMessagesFor( - 'force_source_deploy_with_manifest_beta' - ); + const messages = getConflictMessagesFor('deploy_with_manifest_beta'); if (messages) { const commandlet = new SfdxCommandlet( new SfdxWorkspaceChecker(), new FilePathGatherer(manifestUri), - new LibrarySourceDeployManifestExecutor(), + new LibraryDeployManifestExecutor(), new TimestampConflictChecker(true, messages) ); await commandlet.run(); diff --git a/packages/salesforcedx-vscode-core/src/commands/forceSourceDeploySourcePath.ts b/packages/salesforcedx-vscode-core/src/commands/deploySourcePath.ts similarity index 86% rename from packages/salesforcedx-vscode-core/src/commands/forceSourceDeploySourcePath.ts rename to packages/salesforcedx-vscode-core/src/commands/deploySourcePath.ts index 6ba29e116e..8c08bdc036 100644 --- a/packages/salesforcedx-vscode-core/src/commands/forceSourceDeploySourcePath.ts +++ b/packages/salesforcedx-vscode-core/src/commands/deploySourcePath.ts @@ -13,7 +13,7 @@ import { nls } from '../messages'; import { notificationService } from '../notifications'; import { telemetryService } from '../telemetry'; import { DeployExecutor } from './baseDeployRetrieve'; -import { SourcePathChecker } from './forceSourceRetrieveSourcePath'; +import { SourcePathChecker } from './retrieveSourcePath'; import { LibraryPathsGatherer, SfdxCommandlet, @@ -24,10 +24,7 @@ import { TimestampConflictChecker } from './util/timestampConflictChecker'; export class LibraryDeploySourcePathExecutor extends DeployExecutor { constructor() { - super( - nls.localize('force_source_deploy_text'), - 'force_source_deploy_with_sourcepath_beta' - ); + super(nls.localize('deploy_text'), 'deploy_with_sourcepath_beta'); } public async getComponents( @@ -41,7 +38,7 @@ export class LibraryDeploySourcePathExecutor extends DeployExecutor { } } -export const forceSourceDeploySourcePaths = async ( +export const deploySourcePaths = async ( sourceUri: vscode.Uri | vscode.Uri[] | undefined, uris: vscode.Uri[] | undefined ) => { @@ -74,9 +71,7 @@ export const forceSourceDeploySourcePaths = async ( } } - const messages = getConflictMessagesFor( - 'force_source_deploy_with_sourcepath_beta' - ); + const messages = getConflictMessagesFor('deploy_with_sourcepath_beta'); if (messages) { const commandlet = new SfdxCommandlet( @@ -99,13 +94,8 @@ export const getUriFromActiveEditor = (): vscode.Uri | undefined => { return editor.document.uri; } - const errorMessage = nls.localize( - 'force_source_deploy_select_file_or_directory' - ); - telemetryService.sendException( - 'force_source_deploy_with_sourcepath', - errorMessage - ); + const errorMessage = nls.localize('deploy_select_file_or_directory'); + telemetryService.sendException('deploy_with_sourcepath', errorMessage); notificationService.showErrorMessage(errorMessage); channelService.appendLine(errorMessage); channelService.showChannelOutput(); diff --git a/packages/salesforcedx-vscode-core/src/commands/index.ts b/packages/salesforcedx-vscode-core/src/commands/index.ts index 06e9496754..ef0fe77c70 100644 --- a/packages/salesforcedx-vscode-core/src/commands/index.ts +++ b/packages/salesforcedx-vscode-core/src/commands/index.ts @@ -66,19 +66,19 @@ export { initSObjectDefinitions } from './refreshSObjects'; export { renameLightningComponent } from './renameLightningComponent'; -export { forceSourceDeployManifest } from './forceSourceDeployManifest'; +export { deployManifest } from './deployManifest'; export { LibraryDeploySourcePathExecutor, - forceSourceDeploySourcePaths -} from './forceSourceDeploySourcePath'; + deploySourcePaths +} from './deploySourcePath'; export { sourceDiff, sourceFolderDiff, handleCacheResults } from './sourceDiff'; -export { forceSourceRetrieveManifest } from './forceSourceRetrieveManifest'; -export { forceSourceRetrieveCmp } from './forceSourceRetrieveMetadata'; +export { retrieveManifest } from './retrieveManifest'; +export { retrieveComponent } from './retrieveMetadata'; export { LibraryRetrieveSourcePathExecutor, SourcePathChecker, - forceSourceRetrieveSourcePaths -} from './forceSourceRetrieveSourcePath'; + retrieveSourcePaths +} from './retrieveSourcePath'; export { openDocumentation } from './openDocumentation'; export { AliasGatherer, OrgCreateExecutor, orgCreate } from './orgCreate'; export { orgDelete } from './orgDelete'; diff --git a/packages/salesforcedx-vscode-core/src/commands/forceSourceRetrieveManifest.ts b/packages/salesforcedx-vscode-core/src/commands/retrieveManifest.ts similarity index 71% rename from packages/salesforcedx-vscode-core/src/commands/forceSourceRetrieveManifest.ts rename to packages/salesforcedx-vscode-core/src/commands/retrieveManifest.ts index 0a690dac3e..84178d98e4 100644 --- a/packages/salesforcedx-vscode-core/src/commands/forceSourceRetrieveManifest.ts +++ b/packages/salesforcedx-vscode-core/src/commands/retrieveManifest.ts @@ -15,20 +15,11 @@ import { SfdxPackageDirectories } from '../sfdxProject'; import { telemetryService } from '../telemetry'; import { workspaceUtils } from '../util'; import { RetrieveExecutor } from './baseDeployRetrieve'; -import { - FilePathGatherer, - SfdxCommandlet, - SfdxWorkspaceChecker -} from './util'; +import { FilePathGatherer, SfdxCommandlet, SfdxWorkspaceChecker } from './util'; -export class LibrarySourceRetrieveManifestExecutor extends RetrieveExecutor< - string -> { +export class LibraryRetrieveManifestExecutor extends RetrieveExecutor { constructor() { - super( - nls.localize('force_source_retrieve_text'), - 'force_source_retrieve_with_manifest_beta' - ); + super(nls.localize('retrieve_text'), 'retrieve_with_manifest_beta'); } protected async getComponents( @@ -36,7 +27,9 @@ export class LibrarySourceRetrieveManifestExecutor extends RetrieveExecutor< ): Promise { const packageDirs = await SfdxPackageDirectories.getPackageDirectoryPaths(); const rootWorkspacePath = workspaceUtils.getRootWorkspacePath(); - const resolveSourcePaths = packageDirs.map(packageDir => join(rootWorkspacePath, packageDir)); + const resolveSourcePaths = packageDirs.map(packageDir => + join(rootWorkspacePath, packageDir) + ); const componentSet = await ComponentSet.fromManifest({ manifestPath: response.data, @@ -48,19 +41,14 @@ export class LibrarySourceRetrieveManifestExecutor extends RetrieveExecutor< } } -export async function forceSourceRetrieveManifest(explorerPath: vscode.Uri) { +export async function retrieveManifest(explorerPath: vscode.Uri) { if (!explorerPath) { const editor = vscode.window.activeTextEditor; if (editor && editor.document.languageId === 'forcesourcemanifest') { explorerPath = editor.document.uri; } else { - const errorMessage = nls.localize( - 'force_source_retrieve_select_manifest' - ); - telemetryService.sendException( - 'force_source_retrieve_with_manifest', - errorMessage - ); + const errorMessage = nls.localize('retrieve_select_manifest'); + telemetryService.sendException('retrieve_with_manifest', errorMessage); notificationService.showErrorMessage(errorMessage); channelService.appendLine(errorMessage); channelService.showChannelOutput(); @@ -71,7 +59,7 @@ export async function forceSourceRetrieveManifest(explorerPath: vscode.Uri) { const commandlet = new SfdxCommandlet( new SfdxWorkspaceChecker(), new FilePathGatherer(explorerPath), - new LibrarySourceRetrieveManifestExecutor() + new LibraryRetrieveManifestExecutor() ); await commandlet.run(); } diff --git a/packages/salesforcedx-vscode-core/src/commands/forceSourceRetrieveMetadata/componentNodeDescriber.ts b/packages/salesforcedx-vscode-core/src/commands/retrieveMetadata/componentNodeDescriber.ts similarity index 100% rename from packages/salesforcedx-vscode-core/src/commands/forceSourceRetrieveMetadata/componentNodeDescriber.ts rename to packages/salesforcedx-vscode-core/src/commands/retrieveMetadata/componentNodeDescriber.ts diff --git a/packages/salesforcedx-vscode-core/src/commands/forceSourceRetrieveMetadata/index.ts b/packages/salesforcedx-vscode-core/src/commands/retrieveMetadata/index.ts similarity index 86% rename from packages/salesforcedx-vscode-core/src/commands/forceSourceRetrieveMetadata/index.ts rename to packages/salesforcedx-vscode-core/src/commands/retrieveMetadata/index.ts index 142f448daa..2f71149e1c 100644 --- a/packages/salesforcedx-vscode-core/src/commands/forceSourceRetrieveMetadata/index.ts +++ b/packages/salesforcedx-vscode-core/src/commands/retrieveMetadata/index.ts @@ -4,7 +4,7 @@ * 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 { forceSourceRetrieveCmp } from './forceSourceRetrieveCmp'; +export { retrieveComponent } from './retrieveComponent'; export { RetrieveDescriber } from './retrieveDescriber'; export { RetrieveDescriberFactory } from './retrieveDescriberFactory'; export { RetrieveMetadataTrigger } from './retrieveMetadataTrigger'; diff --git a/packages/salesforcedx-vscode-core/src/commands/forceSourceRetrieveMetadata/libraryRetrieveSourcePathExecutor.ts b/packages/salesforcedx-vscode-core/src/commands/retrieveMetadata/libraryRetrieveSourcePathExecutor.ts similarity index 92% rename from packages/salesforcedx-vscode-core/src/commands/forceSourceRetrieveMetadata/libraryRetrieveSourcePathExecutor.ts rename to packages/salesforcedx-vscode-core/src/commands/retrieveMetadata/libraryRetrieveSourcePathExecutor.ts index 16bd23fa54..261e7c0732 100644 --- a/packages/salesforcedx-vscode-core/src/commands/forceSourceRetrieveMetadata/libraryRetrieveSourcePathExecutor.ts +++ b/packages/salesforcedx-vscode-core/src/commands/retrieveMetadata/libraryRetrieveSourcePathExecutor.ts @@ -11,7 +11,8 @@ import { } from '@salesforce/salesforcedx-utils-vscode'; import { ComponentSet, - RetrieveResult} from '@salesforce/source-deploy-retrieve'; + RetrieveResult +} from '@salesforce/source-deploy-retrieve'; import { ComponentLike } from '@salesforce/source-deploy-retrieve/lib/src/resolve/types'; import * as path from 'path'; import * as vscode from 'vscode'; @@ -26,10 +27,7 @@ export class LibraryRetrieveSourcePathExecutor extends RetrieveExecutor< private openAfterRetrieve: boolean; constructor(openAfterRetrieve = false) { - super( - nls.localize('force_source_retrieve_text'), - 'force_source_retrieve_beta' - ); + super(nls.localize('retrieve_text'), 'retrieve_beta'); this.openAfterRetrieve = openAfterRetrieve; } @@ -39,7 +37,8 @@ export class LibraryRetrieveSourcePathExecutor extends RetrieveExecutor< const toRetrieve = new ComponentSet( response.data.map(lc => ({ fullName: lc.fileName, type: lc.type })) ); - const packageDirs = await SfdxPackageDirectories.getPackageDirectoryFullPaths(); + const packageDirs = + await SfdxPackageDirectories.getPackageDirectoryFullPaths(); const localSourceComponents = ComponentSet.fromSource({ fsPaths: packageDirs, include: toRetrieve diff --git a/packages/salesforcedx-vscode-core/src/commands/forceSourceRetrieveMetadata/nodeDescriber.ts b/packages/salesforcedx-vscode-core/src/commands/retrieveMetadata/nodeDescriber.ts similarity index 100% rename from packages/salesforcedx-vscode-core/src/commands/forceSourceRetrieveMetadata/nodeDescriber.ts rename to packages/salesforcedx-vscode-core/src/commands/retrieveMetadata/nodeDescriber.ts diff --git a/packages/salesforcedx-vscode-core/src/commands/forceSourceRetrieveMetadata/forceSourceRetrieveCmp.ts b/packages/salesforcedx-vscode-core/src/commands/retrieveMetadata/retrieveComponent.ts similarity index 89% rename from packages/salesforcedx-vscode-core/src/commands/forceSourceRetrieveMetadata/forceSourceRetrieveCmp.ts rename to packages/salesforcedx-vscode-core/src/commands/retrieveMetadata/retrieveComponent.ts index aa22d832bb..62a601a8f9 100644 --- a/packages/salesforcedx-vscode-core/src/commands/forceSourceRetrieveMetadata/forceSourceRetrieveCmp.ts +++ b/packages/salesforcedx-vscode-core/src/commands/retrieveMetadata/retrieveComponent.ts @@ -5,16 +5,13 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { - SfdxCommandlet, - SfdxWorkspaceChecker -} from '../util'; +import { SfdxCommandlet, SfdxWorkspaceChecker } from '../util'; import { OverwriteComponentPrompt } from '../util/overwriteComponentPrompt'; import { RetrieveComponentOutputGatherer } from '../util/parameterGatherers'; import { LibraryRetrieveSourcePathExecutor } from './libraryRetrieveSourcePathExecutor'; import { RetrieveMetadataTrigger } from './retrieveMetadataTrigger'; -export async function forceSourceRetrieveCmp( +export async function retrieveComponent( trigger: RetrieveMetadataTrigger, openAfterRetrieve: boolean = false ) { diff --git a/packages/salesforcedx-vscode-core/src/commands/forceSourceRetrieveMetadata/retrieveDescriber.ts b/packages/salesforcedx-vscode-core/src/commands/retrieveMetadata/retrieveDescriber.ts similarity index 100% rename from packages/salesforcedx-vscode-core/src/commands/forceSourceRetrieveMetadata/retrieveDescriber.ts rename to packages/salesforcedx-vscode-core/src/commands/retrieveMetadata/retrieveDescriber.ts diff --git a/packages/salesforcedx-vscode-core/src/commands/forceSourceRetrieveMetadata/retrieveDescriberFactory.ts b/packages/salesforcedx-vscode-core/src/commands/retrieveMetadata/retrieveDescriberFactory.ts similarity index 100% rename from packages/salesforcedx-vscode-core/src/commands/forceSourceRetrieveMetadata/retrieveDescriberFactory.ts rename to packages/salesforcedx-vscode-core/src/commands/retrieveMetadata/retrieveDescriberFactory.ts diff --git a/packages/salesforcedx-vscode-core/src/commands/forceSourceRetrieveMetadata/retrieveMetadataTrigger.ts b/packages/salesforcedx-vscode-core/src/commands/retrieveMetadata/retrieveMetadataTrigger.ts similarity index 100% rename from packages/salesforcedx-vscode-core/src/commands/forceSourceRetrieveMetadata/retrieveMetadataTrigger.ts rename to packages/salesforcedx-vscode-core/src/commands/retrieveMetadata/retrieveMetadataTrigger.ts diff --git a/packages/salesforcedx-vscode-core/src/commands/forceSourceRetrieveMetadata/typeNodeDescriber.ts b/packages/salesforcedx-vscode-core/src/commands/retrieveMetadata/typeNodeDescriber.ts similarity index 100% rename from packages/salesforcedx-vscode-core/src/commands/forceSourceRetrieveMetadata/typeNodeDescriber.ts rename to packages/salesforcedx-vscode-core/src/commands/retrieveMetadata/typeNodeDescriber.ts diff --git a/packages/salesforcedx-vscode-core/src/commands/forceSourceRetrieveSourcePath.ts b/packages/salesforcedx-vscode-core/src/commands/retrieveSourcePath.ts similarity index 82% rename from packages/salesforcedx-vscode-core/src/commands/forceSourceRetrieveSourcePath.ts rename to packages/salesforcedx-vscode-core/src/commands/retrieveSourcePath.ts index ac83e5eea0..847d5b1c9a 100644 --- a/packages/salesforcedx-vscode-core/src/commands/forceSourceRetrieveSourcePath.ts +++ b/packages/salesforcedx-vscode-core/src/commands/retrieveSourcePath.ts @@ -27,10 +27,7 @@ export class LibraryRetrieveSourcePathExecutor extends RetrieveExecutor< string[] > { constructor() { - super( - nls.localize('force_source_retrieve_text'), - 'force_source_retrieve_with_sourcepath_beta' - ); + super(nls.localize('retrieve_text'), 'retrieve_with_sourcepath_beta'); } public async getComponents( @@ -52,9 +49,8 @@ export class SourcePathChecker implements PostconditionChecker { const sourcePaths = inputs.data; try { for (const sourcePath of sourcePaths) { - const isInSfdxPackageDirectory = await SfdxPackageDirectories.isInPackageDirectory( - sourcePath - ); + const isInSfdxPackageDirectory = + await SfdxPackageDirectories.isInPackageDirectory(sourcePath); if (!isInSfdxPackageDirectory) { throw nls.localize( @@ -66,18 +62,17 @@ export class SourcePathChecker implements PostconditionChecker { return inputs; } catch (error) { telemetryService.sendException( - 'force_source_retrieve_with_sourcepath', - `Error while parsing package directories. ${error instanceof Error ? error.message : JSON.stringify(error)}` + 'retrieve_with_sourcepath', + `Error while parsing package directories. ${ + error instanceof Error ? error.message : JSON.stringify(error) + }` ); } const errorMessage = nls.localize( 'error_source_path_not_in_package_directory_text' ); - telemetryService.sendException( - 'force_source_retrieve_with_sourcepath', - errorMessage - ); + telemetryService.sendException('retrieve_with_sourcepath', errorMessage); notificationService.showErrorMessage(errorMessage); channelService.appendLine(errorMessage); channelService.showChannelOutput(); @@ -86,7 +81,7 @@ export class SourcePathChecker implements PostconditionChecker { } } -export const forceSourceRetrieveSourcePaths = async ( +export const retrieveSourcePaths = async ( sourceUri: vscode.Uri | undefined, uris: vscode.Uri[] | undefined ) => { @@ -130,13 +125,8 @@ export const getUriFromActiveEditor = (): vscode.Uri | undefined => { return editor.document.uri; } - const errorMessage = nls.localize( - 'force_source_retrieve_select_file_or_directory' - ); - telemetryService.sendException( - 'force_source_retrieve_with_sourcepath', - errorMessage - ); + const errorMessage = nls.localize('retrieve_select_file_or_directory'); + telemetryService.sendException('retrieve_with_sourcepath', errorMessage); notificationService.showErrorMessage(errorMessage); channelService.appendLine(errorMessage); channelService.showChannelOutput(); diff --git a/packages/salesforcedx-vscode-core/src/commands/util/parameterGatherers.ts b/packages/salesforcedx-vscode-core/src/commands/util/parameterGatherers.ts index acc974a105..c02ff9eac4 100644 --- a/packages/salesforcedx-vscode-core/src/commands/util/parameterGatherers.ts +++ b/packages/salesforcedx-vscode-core/src/commands/util/parameterGatherers.ts @@ -17,7 +17,7 @@ import * as vscode from 'vscode'; import { nls } from '../../messages'; import { SfdxPackageDirectories } from '../../sfdxProject'; import { workspaceUtils } from '../../util'; -import { RetrieveDescriber } from '../forceSourceRetrieveMetadata'; +import { RetrieveDescriber } from '../retrieveMetadata'; export const CONTINUE = 'CONTINUE'; export const CANCEL = 'CANCEL'; @@ -118,7 +118,8 @@ export class FileSelector implements ParametersGatherer { } export class SelectFileName - implements ParametersGatherer<{ fileName: string }> { + implements ParametersGatherer<{ fileName: string }> +{ private maxFileNameLength: number; constructor(maxFileNameLength?: number) { @@ -149,7 +150,8 @@ export class SelectFileName } export class SelectUsername - implements ParametersGatherer<{ username: string }> { + implements ParametersGatherer<{ username: string }> +{ public async gather(): Promise< CancelResponse | ContinueResponse<{ username: string }> > { @@ -180,7 +182,8 @@ export class DemoModePromptGatherer implements ParametersGatherer<{}> { } export class SelectLwcComponentDir - implements ParametersGatherer<{ fileName: string; outputdir: string }> { + implements ParametersGatherer<{ fileName: string; outputdir: string }> +{ public async gather(): Promise< CancelResponse | ContinueResponse<{ fileName: string; outputdir: string }> > { @@ -248,7 +251,8 @@ export class SelectLwcComponentDir } export class SelectOutputDir - implements ParametersGatherer<{ outputdir: string }> { + implements ParametersGatherer<{ outputdir: string }> +{ private typeDir: string; private typeDirRequired: boolean | undefined; public static readonly defaultOutput = path.join('main', 'default'); @@ -340,7 +344,8 @@ export class SimpleGatherer implements ParametersGatherer { } export class RetrieveComponentOutputGatherer - implements ParametersGatherer { + implements ParametersGatherer +{ private describer: RetrieveDescriber; constructor(describer: RetrieveDescriber) { @@ -363,14 +368,17 @@ export class MetadataTypeGatherer extends SimpleGatherer<{ type: string }> { } } -export class ApexTestTemplateGatherer extends SimpleGatherer<{ template: string }> { +export class ApexTestTemplateGatherer extends SimpleGatherer<{ + template: string; +}> { constructor(template: string) { super({ template }); } } export class PromptConfirmGatherer - implements ParametersGatherer<{ choice: string }> { + implements ParametersGatherer<{ choice: string }> +{ private question: string; constructor(question: string) { diff --git a/packages/salesforcedx-vscode-core/src/conflict/conflictNode.ts b/packages/salesforcedx-vscode-core/src/conflict/conflictNode.ts index d058412da1..6bb03c2c7b 100644 --- a/packages/salesforcedx-vscode-core/src/conflict/conflictNode.ts +++ b/packages/salesforcedx-vscode-core/src/conflict/conflictNode.ts @@ -86,7 +86,7 @@ export class ConflictFileNode extends ConflictNode { this.contextValue = 'conflict-actions'; this.command = { title: nls.localize('conflict_detect_diff_command_title'), - command: 'sfdx.force.conflict.diff', + command: 'sfdx.conflict.diff', arguments: [this._conflict] }; } diff --git a/packages/salesforcedx-vscode-core/src/conflict/index.ts b/packages/salesforcedx-vscode-core/src/conflict/index.ts index e7c4f1bb21..80d1414903 100644 --- a/packages/salesforcedx-vscode-core/src/conflict/index.ts +++ b/packages/salesforcedx-vscode-core/src/conflict/index.ts @@ -39,15 +39,11 @@ export function registerConflictView(): Disposable { const viewItems: Disposable[] = []; viewItems.push( - commands.registerCommand('sfdx.force.conflict.diff', entry => - conflictDiff(entry) - ) + commands.registerCommand('sfdx.conflict.diff', entry => conflictDiff(entry)) ); viewItems.push( - commands.registerCommand('sfdx.force.conflict.open', entry => - openResource(entry) - ) + commands.registerCommand('sfdx.conflict.open', entry => openResource(entry)) ); return Disposable.from(...viewItems); @@ -70,6 +66,6 @@ function openResource(node: ConflictNode) { const file = node.conflict; if (file) { const local = Uri.file(path.join(file.localPath, file.localRelPath)); - window.showTextDocument(local).then(() => { }); + window.showTextDocument(local).then(() => {}); } } diff --git a/packages/salesforcedx-vscode-core/src/conflict/messages.ts b/packages/salesforcedx-vscode-core/src/conflict/messages.ts index 0dfb5535fe..237d373bf2 100644 --- a/packages/salesforcedx-vscode-core/src/conflict/messages.ts +++ b/packages/salesforcedx-vscode-core/src/conflict/messages.ts @@ -13,7 +13,7 @@ export function getConflictMessagesFor( const warningMessageKey = 'conflict_detect_conflicts_during_deploy'; const messagesByLogName: Map = new Map([ [ - 'force_source_deploy_with_sourcepath_beta', + 'deploy_with_sourcepath_beta', { warningMessageKey, commandHint: inputs => { @@ -34,7 +34,7 @@ export function getConflictMessagesFor( } ], [ - 'force_source_deploy_with_manifest_beta', + 'deploy_with_manifest_beta', { warningMessageKey, commandHint: input => { diff --git a/packages/salesforcedx-vscode-core/src/index.ts b/packages/salesforcedx-vscode-core/src/index.ts index 7df09e7948..d18eadc65a 100644 --- a/packages/salesforcedx-vscode-core/src/index.ts +++ b/packages/salesforcedx-vscode-core/src/index.ts @@ -29,19 +29,9 @@ import { dataQuery, debuggerStop, deleteSource, - orgLoginAccessToken, - projectGenerateManifest, + deployManifest, + deploySourcePaths, forceLightningLwcTestCreate, - packageInstall, - refreshSObjects, - renameLightningComponent, - forceSourceDeployManifest, - forceSourceDeploySourcePaths, - sourceDiff, - sourceFolderDiff, - forceSourceRetrieveCmp, - forceSourceRetrieveManifest, - forceSourceRetrieveSourcePaths, initSObjectDefinitions, internalLightningGenerateApp, internalLightningGenerateAuraComponent, @@ -58,15 +48,25 @@ import { orgDelete, orgDisplay, orgList, + orgLoginAccessToken, orgLoginWeb, orgLoginWebDevHub, orgLogoutAll, orgLogoutDefault, orgOpen, + packageInstall, projectDeployStart, + projectGenerateManifest, projectGenerateWithManifest, projectRetrieveStart, + refreshSObjects, + renameLightningComponent, + retrieveComponent, + retrieveManifest, + retrieveSourcePaths, sfProjectGenerate, + sourceDiff, + sourceFolderDiff, startApexDebugLogging, stopApexDebugLogging, taskStop, @@ -77,8 +77,8 @@ import { visualforceGenerateComponent, visualforceGeneratePage } from './commands'; -import { RetrieveMetadataTrigger } from './commands/forceSourceRetrieveMetadata'; import { isvDebugBootstrap } from './commands/isvdebugging'; +import { RetrieveMetadataTrigger } from './commands/retrieveMetadata'; import { getUserId } from './commands/startApexDebugLogging'; import { CompositeParametersGatherer, @@ -173,22 +173,21 @@ function registerCommands( 'sfdx.delete.source.current.file', deleteSource ); - const forceSourceDeployCurrentSourceFileCmd = vscode.commands.registerCommand( - 'sfdx.force.source.deploy.current.source.file', - forceSourceDeploySourcePaths + const deployCurrentSourceFileCmd = vscode.commands.registerCommand( + 'sfdx.deploy.current.source.file', + deploySourcePaths ); - const forceSourceDeployInManifestCmd = vscode.commands.registerCommand( - 'sfdx.force.source.deploy.in.manifest', - forceSourceDeployManifest + const deployInManifestCmd = vscode.commands.registerCommand( + 'sfdx.deploy.in.manifest', + deployManifest ); - const forceSourceDeployMultipleSourcePathsCmd = - vscode.commands.registerCommand( - 'sfdx.force.source.deploy.multiple.source.paths', - forceSourceDeploySourcePaths - ); - const forceSourceDeploySourcePathCmd = vscode.commands.registerCommand( - 'sfdx.force.source.deploy.source.path', - forceSourceDeploySourcePaths + const deployMultipleSourcePathsCmd = vscode.commands.registerCommand( + 'sfdx.deploy.multiple.source.paths', + deploySourcePaths + ); + const deploySourcePathCmd = vscode.commands.registerCommand( + 'sfdx.deploy.source.path', + deploySourcePaths ); const projectRetrieveStartCmd = vscode.commands.registerCommand( 'sfdx.project.retrieve.start', @@ -209,17 +208,17 @@ function registerCommands( projectDeployStart, flagIgnoreConflicts ); - const forceSourceRetrieveCmd = vscode.commands.registerCommand( - 'sfdx.force.source.retrieve.source.path', - forceSourceRetrieveSourcePaths + const retrieveCmd = vscode.commands.registerCommand( + 'sfdx.retrieve.source.path', + retrieveSourcePaths ); - const forceSourceRetrieveCurrentFileCmd = vscode.commands.registerCommand( - 'sfdx.force.source.retrieve.current.source.file', - forceSourceRetrieveSourcePaths + const retrieveCurrentFileCmd = vscode.commands.registerCommand( + 'sfdx.retrieve.current.source.file', + retrieveSourcePaths ); - const forceSourceRetrieveInManifestCmd = vscode.commands.registerCommand( - 'sfdx.force.source.retrieve.in.manifest', - forceSourceRetrieveManifest + const retrieveInManifestCmd = vscode.commands.registerCommand( + 'sfdx.retrieve.in.manifest', + retrieveManifest ); const forceSourceStatusCmd = vscode.commands.registerCommand( 'sfdx.view.all.changes', @@ -402,17 +401,17 @@ function registerCommands( forceRefreshSObjectsCmd, deleteSourceCmd, deleteSourceCurrentFileCmd, - forceSourceDeployCurrentSourceFileCmd, - forceSourceDeployInManifestCmd, - forceSourceDeployMultipleSourcePathsCmd, - forceSourceDeploySourcePathCmd, + deployCurrentSourceFileCmd, + deployInManifestCmd, + deployMultipleSourcePathsCmd, + deploySourcePathCmd, projectDeployStartCmd, projectDeployStartIgnoreConflictsCmd, projectRetrieveStartCmd, projectRetrieveStartIgnoreConflictsCmd, - forceSourceRetrieveCmd, - forceSourceRetrieveCurrentFileCmd, - forceSourceRetrieveInManifestCmd, + retrieveCmd, + retrieveCurrentFileCmd, + retrieveInManifestCmd, forceSourceStatusCmd, forceSourceStatusLocalCmd, forceSourceStatusRemoteCmd, @@ -517,16 +516,16 @@ async function setupOrgBrowser( ); vscode.commands.registerCommand( - 'sfdx.force.source.retrieve.component', + 'sfdx.retrieve.component', async (trigger: RetrieveMetadataTrigger) => { - await forceSourceRetrieveCmp(trigger); + await retrieveComponent(trigger); } ); vscode.commands.registerCommand( - 'sfdx.force.source.retrieve.open.component', + 'sfdx.retrieve.open.component', async (trigger: RetrieveMetadataTrigger) => { - await forceSourceRetrieveCmp(trigger, true); + await retrieveComponent(trigger, true); } ); @@ -779,4 +778,4 @@ export function showErrorNotification(type: string, args: any[]) { export function showWarningNotification(type: string, args: any[]) { const showMessage = nls.localize(type, ...args); vscode.window.showWarningMessage(showMessage); -} \ No newline at end of file +} diff --git a/packages/salesforcedx-vscode-core/src/messages/i18n.ja.ts b/packages/salesforcedx-vscode-core/src/messages/i18n.ja.ts index 9fc531cb8c..4f07a8e24a 100644 --- a/packages/salesforcedx-vscode-core/src/messages/i18n.ja.ts +++ b/packages/salesforcedx-vscode-core/src/messages/i18n.ja.ts @@ -90,17 +90,17 @@ export const messages = { project_deploy_start_ignore_conflicts_default_org_text: 'SFDX: Push Source to Default Org and Ignore Conflicts', - force_source_deploy_text: 'SFDX: 組織へソースをデプロイ', - force_source_deploy_select_file_or_directory: + deploy_text: 'SFDX: 組織へソースをデプロイ', + deploy_select_file_or_directory: 'ソースファイルかディレクトリ上でのみ SFDX: 組織へソースをデプロイ を実行できます。', - force_source_deploy_select_manifest: + deploy_select_manifest: 'マニフェストファイル上でのみ SFDX マニフェストのソースを組織へデプロイ を実行できます。', - force_source_retrieve_text: 'SFDX: 組織からソースを取得', - force_source_retrieve_display_text: 'SFDX: 組織からソースを取得', - force_source_retrieve_and_open_display_text: 'Retrieve and Open Source', - force_source_retrieve_select_file_or_directory: + retrieve_text: 'SFDX: 組織からソースを取得', + retrieve_display_text: 'SFDX: 組織からソースを取得', + retrieve_and_open_display_text: 'Retrieve and Open Source', + retrieve_select_file_or_directory: 'ソースファイルかディレクトリ上でのみ SFDX: 組織からソースを取得 を実行できます。', - force_source_retrieve_select_manifest: + retrieve_select_manifest: 'マニフェストファイル上でのみ SFDX: マニフェストのソースを組織から取得 を実行できます。', delete_source_text: 'SFDX: プロジェクトおよび組織から削除', delete_source_manifest_unsupported_message: diff --git a/packages/salesforcedx-vscode-core/src/messages/i18n.ts b/packages/salesforcedx-vscode-core/src/messages/i18n.ts index 26bd6d09f4..35760fd480 100644 --- a/packages/salesforcedx-vscode-core/src/messages/i18n.ts +++ b/packages/salesforcedx-vscode-core/src/messages/i18n.ts @@ -106,17 +106,17 @@ export const messages = { project_deploy_start_ignore_conflicts_default_org_text: 'SFDX: Push Source to Default Org and Ignore Conflicts', view_all_changes_text: 'View All Changes (Local and in Default Org)', - force_source_deploy_text: 'SFDX: Deploy Source to Org', - force_source_deploy_select_file_or_directory: + deploy_text: 'SFDX: Deploy Source to Org', + deploy_select_file_or_directory: 'You can run SFDX: Deploy Source to Org only on a source file or directory.', - force_source_deploy_select_manifest: + deploy_select_manifest: 'You can run SFDX: Deploy Source in Manifest to Org only on a manifest file.', - force_source_retrieve_text: 'SFDX: Retrieve Source from Org', - force_source_retrieve_display_text: 'Retrieve Source from Org', - force_source_retrieve_and_open_display_text: 'Retrieve and Open Source', - force_source_retrieve_select_file_or_directory: + retrieve_text: 'SFDX: Retrieve Source from Org', + retrieve_display_text: 'Retrieve Source from Org', + retrieve_and_open_display_text: 'Retrieve and Open Source', + retrieve_select_file_or_directory: 'You can run SFDX: Retrieve Source from Org only on a source file or directory.', - force_source_retrieve_select_manifest: + retrieve_select_manifest: 'You can run SFDX: Retrieve Source in Manifest from Org only on a manifest file.', delete_source_text: 'SFDX: Delete from Project and Org', delete_source_manifest_unsupported_message: diff --git a/packages/salesforcedx-vscode-core/src/orgBrowser/nodeTypes.ts b/packages/salesforcedx-vscode-core/src/orgBrowser/nodeTypes.ts index 8f70cbda47..78cd8d1b78 100644 --- a/packages/salesforcedx-vscode-core/src/orgBrowser/nodeTypes.ts +++ b/packages/salesforcedx-vscode-core/src/orgBrowser/nodeTypes.ts @@ -9,7 +9,7 @@ import { RetrieveDescriber, RetrieveDescriberFactory, RetrieveMetadataTrigger -} from '../commands/forceSourceRetrieveMetadata'; +} from '../commands/retrieveMetadata'; import { nls } from '../messages'; import { MetadataObject } from './metadataType'; diff --git a/packages/salesforcedx-vscode-core/src/services/sdr/componentSetUtils.ts b/packages/salesforcedx-vscode-core/src/services/sdr/componentSetUtils.ts index c32025bf0d..1a8b0165f7 100644 --- a/packages/salesforcedx-vscode-core/src/services/sdr/componentSetUtils.ts +++ b/packages/salesforcedx-vscode-core/src/services/sdr/componentSetUtils.ts @@ -18,7 +18,8 @@ async function setApiVersion(componentSet: ComponentSet): Promise { // Check the SFDX configuration to see if there is an overridden api version. // Project level local sfdx-config takes precedence over global sfdx-config at system level. - const userConfiguredApiVersion = await ConfigUtil.getUserConfiguredApiVersion(); + const userConfiguredApiVersion = + await ConfigUtil.getUserConfiguredApiVersion(); if (userConfiguredApiVersion) { componentSet.apiVersion = userConfiguredApiVersion; return; @@ -26,9 +27,10 @@ async function setApiVersion(componentSet: ComponentSet): Promise { // If no user-configured API Version is present, then get the version from the org. const orgApiVersion = await componentSetUtils.getOrgApiVersion(); - componentSet.apiVersion = orgApiVersion && orgApiVersion.length > 0 - ? orgApiVersion - : componentSet.apiVersion; + componentSet.apiVersion = + orgApiVersion && orgApiVersion.length > 0 + ? orgApiVersion + : componentSet.apiVersion; } async function setSourceApiVersion(componentSet: ComponentSet): Promise { @@ -37,8 +39,8 @@ async function setSourceApiVersion(componentSet: ComponentSet): Promise { // Work in Salesforce CLI" doc. // https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_apiversion.htm - // First, look for sourceApiVersion in a manifest file. When LibrarySourceRetrieveManifestExecutor.getComponents() - // is called, or LibrarySourceDeployManifestExecutor.getComponents() is called, ComponentSet.fromManifest() + // First, look for sourceApiVersion in a manifest file. When LibraryRetrieveManifestExecutor.getComponents() + // is called, or LibraryDeployManifestExecutor.getComponents() is called, ComponentSet.fromManifest() // is called and the component set returned usually has the sourceApiVersion set... if (componentSet.sourceApiVersion) { // ...and at this point there is nothing else left to do. @@ -46,7 +48,8 @@ async function setSourceApiVersion(componentSet: ComponentSet): Promise { } // Next, attempt to get sourceApiVersion from sfdx-project.json... - let sourceApiVersion = await SfdxProjectConfig.getValue('sourceApiVersion'); + let sourceApiVersion = + await SfdxProjectConfig.getValue('sourceApiVersion'); if (!sourceApiVersion) { // ...and if sourceApiVersion isn't defined, attempt to get the value from the config aggregator. sourceApiVersion = (await ConfigUtil.getUserConfiguredApiVersion())!; diff --git a/packages/salesforcedx-vscode-core/src/settings/pushOrDeployOnSave.ts b/packages/salesforcedx-vscode-core/src/settings/pushOrDeployOnSave.ts index 873b48e5bd..71337b6061 100644 --- a/packages/salesforcedx-vscode-core/src/settings/pushOrDeployOnSave.ts +++ b/packages/salesforcedx-vscode-core/src/settings/pushOrDeployOnSave.ts @@ -68,7 +68,7 @@ export class DeployQueue { private async executeDeployCommand(toDeploy: vscode.Uri[]) { vscode.commands.executeCommand( - 'sfdx.force.source.deploy.multiple.source.paths', + 'sfdx.deploy.multiple.source.paths', toDeploy ); } diff --git a/packages/salesforcedx-vscode-core/test/jest/commands/deployExecutor.test.ts b/packages/salesforcedx-vscode-core/test/jest/commands/deployExecutor.test.ts index 94f2098284..7a42e38cb3 100644 --- a/packages/salesforcedx-vscode-core/test/jest/commands/deployExecutor.test.ts +++ b/packages/salesforcedx-vscode-core/test/jest/commands/deployExecutor.test.ts @@ -119,7 +119,7 @@ describe('Deploy Executor', () => { .mockResolvedValue({ pollStatus: jest.fn() } as any); const executor = new TestDeployExecutor( 'testDeploy', - 'force_source_deploy_with_sourcepath_beta' + 'deploy_with_sourcepath_beta' ); (executor as any).setupCancellation = jest.fn(); @@ -150,7 +150,7 @@ describe('Deploy Executor', () => { .mockResolvedValue({ pollStatus: jest.fn() } as any); const executor = new TestDeployExecutor( 'testDeploy', - 'force_source_deploy_with_sourcepath_beta' + 'deploy_with_sourcepath_beta' ); (executor as any).setupCancellation = jest.fn(); @@ -176,7 +176,7 @@ describe('Deploy Executor', () => { DeployRetrieveExecutor.errorCollection = MockErrorCollection as any; const executor = new TestDeployExecutor( 'testDeploy', - 'force_source_deploy_with_sourcepath_beta' + 'deploy_with_sourcepath_beta' ); // Act @@ -241,7 +241,7 @@ describe('Deploy Executor', () => { const executor = new TestDeployExecutor( 'testDeploy', - 'force_source_deploy_with_sourcepath_beta' + 'deploy_with_sourcepath_beta' ); // Act @@ -276,7 +276,7 @@ describe('Deploy Executor', () => { .mockImplementation(jest.fn()); const executor = new TestDeployExecutor( 'testDeploy', - 'force_source_deploy_with_sourcepath_beta' + 'deploy_with_sourcepath_beta' ); // Act diff --git a/packages/salesforcedx-vscode-core/test/jest/conflict/messages.test.ts b/packages/salesforcedx-vscode-core/test/jest/conflict/messages.test.ts index be1094d664..dcdf4197a6 100644 --- a/packages/salesforcedx-vscode-core/test/jest/conflict/messages.test.ts +++ b/packages/salesforcedx-vscode-core/test/jest/conflict/messages.test.ts @@ -12,7 +12,7 @@ describe('messages', () => { it('should return --sourcepath command hint when deploy with source path is being run', () => { const bPath = 'b/path'; const conflictMessages = getConflictMessagesFor( - 'force_source_deploy_with_sourcepath_beta' + 'deploy_with_sourcepath_beta' ); const commandHint = conflictMessages?.commandHint([aPath, bPath]); @@ -24,7 +24,7 @@ describe('messages', () => { it('should return --manifest command hint when deploy with manifest is being run', () => { const conflictMessages = getConflictMessagesFor( - 'force_source_deploy_with_manifest_beta' + 'deploy_with_manifest_beta' ); const commandHint = conflictMessages?.commandHint(aPath); diff --git a/packages/salesforcedx-vscode-core/test/vscode-integration/commands/forceSourceDeployManifest.test.ts b/packages/salesforcedx-vscode-core/test/vscode-integration/commands/deployManifest.test.ts similarity index 92% rename from packages/salesforcedx-vscode-core/test/vscode-integration/commands/forceSourceDeployManifest.test.ts rename to packages/salesforcedx-vscode-core/test/vscode-integration/commands/deployManifest.test.ts index 38f17c9b61..46c0b75c48 100644 --- a/packages/salesforcedx-vscode-core/test/vscode-integration/commands/forceSourceDeployManifest.test.ts +++ b/packages/salesforcedx-vscode-core/test/vscode-integration/commands/deployManifest.test.ts @@ -17,7 +17,7 @@ import { ComponentSet } from '@salesforce/source-deploy-retrieve'; import { expect } from 'chai'; import * as path from 'path'; import { SinonStub } from 'sinon'; -import { LibrarySourceDeployManifestExecutor } from '../../../src/commands/forceSourceDeployManifest'; +import { LibraryDeployManifestExecutor } from '../../../src/commands/deployManifest'; import { WorkspaceContext } from '../../../src/context'; import { SfdxPackageDirectories } from '../../../src/sfdxProject'; import { workspaceUtils } from '../../../src/util'; @@ -25,7 +25,7 @@ import { workspaceUtils } from '../../../src/util'; const $$ = instantiateContext(); const env = $$.SANDBOX; -describe('Force Source Deploy Using Manifest Option', () => { +describe('Deploy Using Manifest Option', () => { beforeEach(() => { stubContext($$); }); @@ -46,7 +46,7 @@ describe('Force Source Deploy Using Manifest Option', () => { let deployStub: SinonStub; let pollStatusStub: SinonStub; - const executor = new LibrarySourceDeployManifestExecutor(); + const executor = new LibraryDeployManifestExecutor(); beforeEach(async () => { const testData = new MockTestOrgData(); diff --git a/packages/salesforcedx-vscode-core/test/vscode-integration/commands/forceSourceDeploySourcePath.test.ts b/packages/salesforcedx-vscode-core/test/vscode-integration/commands/deploySourcePath.test.ts similarity index 92% rename from packages/salesforcedx-vscode-core/test/vscode-integration/commands/forceSourceDeploySourcePath.test.ts rename to packages/salesforcedx-vscode-core/test/vscode-integration/commands/deploySourcePath.test.ts index a3ebc2a463..909e4d2732 100644 --- a/packages/salesforcedx-vscode-core/test/vscode-integration/commands/forceSourceDeploySourcePath.test.ts +++ b/packages/salesforcedx-vscode-core/test/vscode-integration/commands/deploySourcePath.test.ts @@ -26,7 +26,7 @@ import * as path from 'path'; import { SinonStub } from 'sinon'; import * as vscode from 'vscode'; import { LibraryDeploySourcePathExecutor } from '../../../src/commands'; -import * as forceSourceDeploySourcePath from '../../../src/commands/forceSourceDeploySourcePath'; +import * as deploySourcePath from '../../../src/commands/deploySourcePath'; import { TimestampConflictChecker } from '../../../src/commands/util/timestampConflictChecker'; import { WorkspaceContext } from '../../../src/context'; import { @@ -38,7 +38,7 @@ import { workspaceUtils } from '../../../src/util'; const $$ = instantiateContext(); const sb = $$.SANDBOX; -describe('Force Source Deploy Using Sourcepath Option', () => { +describe('Deploy Using Sourcepath Option', () => { afterEach(() => { restoreContext($$); }); @@ -158,10 +158,7 @@ describe('Force Source Deploy Using Sourcepath Option', () => { path.sep + filePath3 ]); - await forceSourceDeploySourcePath.forceSourceDeploySourcePaths( - uris[0], - uris - ); + await deploySourcePath.deploySourcePaths(uris[0], uris); expect(timestampConflictCheckerCheckStub.called).to.equal(true); const continueResponse = timestampConflictCheckerCheckStub @@ -193,10 +190,7 @@ describe('Force Source Deploy Using Sourcepath Option', () => { .stub(fileUtils, 'flushFilePaths') .returns([path.sep + filePath1]); - await forceSourceDeploySourcePath.forceSourceDeploySourcePaths( - uris[0], - uris - ); + await deploySourcePath.deploySourcePaths(uris[0], uris); expect(timestampConflictCheckerCheckStub.called).to.equal(true); const continueResponse = timestampConflictCheckerCheckStub @@ -229,10 +223,7 @@ describe('Force Source Deploy Using Sourcepath Option', () => { .stub(fileUtils, 'flushFilePaths') .returns([path.sep + filePath1]); - await forceSourceDeploySourcePath.forceSourceDeploySourcePaths( - uris[0], - undefined - ); + await deploySourcePath.deploySourcePaths(uris[0], undefined); expect(timestampConflictCheckerCheckStub.called).to.equal(true); const continueResponse = timestampConflictCheckerCheckStub @@ -267,16 +258,13 @@ describe('Force Source Deploy Using Sourcepath Option', () => { .stub(SfdxPackageDirectories, 'isInPackageDirectory') .returns(true); const getUriFromActiveEditorStub = sb - .stub(forceSourceDeploySourcePath, 'getUriFromActiveEditor') + .stub(deploySourcePath, 'getUriFromActiveEditor') .returns(filePath1); const flushFilePathsStub = sb .stub(fileUtils, 'flushFilePaths') .returns([undefined]); - await forceSourceDeploySourcePath.forceSourceDeploySourcePaths( - sourceUri, - uris - ); + await deploySourcePath.deploySourcePaths(sourceUri, uris); expect(getUriFromActiveEditorStub.called).to.equal(true); @@ -310,10 +298,7 @@ describe('Force Source Deploy Using Sourcepath Option', () => { .stub(fileUtils, 'flushFilePaths') .returns([path.sep + filePath1]); - await forceSourceDeploySourcePath.forceSourceDeploySourcePaths( - sourceUris, - uris - ); + await deploySourcePath.deploySourcePaths(sourceUris, uris); expect(timestampConflictCheckerCheckStub.called).to.equal(true); const continueResponse = timestampConflictCheckerCheckStub diff --git a/packages/salesforcedx-vscode-core/test/vscode-integration/commands/orgDisplay.test.ts b/packages/salesforcedx-vscode-core/test/vscode-integration/commands/orgDisplay.test.ts index dc57caabf8..eba58fd299 100644 --- a/packages/salesforcedx-vscode-core/test/vscode-integration/commands/orgDisplay.test.ts +++ b/packages/salesforcedx-vscode-core/test/vscode-integration/commands/orgDisplay.test.ts @@ -10,7 +10,7 @@ import { OrgDisplay } from '../../../src/commands'; import { nls } from '../../../src/messages'; // tslint:disable:no-unused-expression -describe('Force Source Status', () => { +describe('Status', () => { it('Should build the source command no flag', async () => { const orgDisplay = new OrgDisplay(); const displayCommand = orgDisplay.build({}); diff --git a/packages/salesforcedx-vscode-core/test/vscode-integration/commands/forceSourceRetrieveManifest.test.ts b/packages/salesforcedx-vscode-core/test/vscode-integration/commands/retrieveManifest.test.ts similarity index 92% rename from packages/salesforcedx-vscode-core/test/vscode-integration/commands/forceSourceRetrieveManifest.test.ts rename to packages/salesforcedx-vscode-core/test/vscode-integration/commands/retrieveManifest.test.ts index 80f0824055..c1c5d8bb5a 100644 --- a/packages/salesforcedx-vscode-core/test/vscode-integration/commands/forceSourceRetrieveManifest.test.ts +++ b/packages/salesforcedx-vscode-core/test/vscode-integration/commands/retrieveManifest.test.ts @@ -16,7 +16,7 @@ import { ComponentSet } from '@salesforce/source-deploy-retrieve'; import { expect } from 'chai'; import * as path from 'path'; import { SinonStub } from 'sinon'; -import { LibrarySourceRetrieveManifestExecutor } from '../../../src/commands/forceSourceRetrieveManifest'; +import { LibraryRetrieveManifestExecutor } from '../../../src/commands/retrieveManifest'; import { WorkspaceContext } from '../../../src/context'; import { SfdxPackageDirectories } from '../../../src/sfdxProject'; import { workspaceUtils } from '../../../src/util'; @@ -24,7 +24,7 @@ import { workspaceUtils } from '../../../src/util'; const $$ = instantiateContext(); const env = $$.SANDBOX; -describe('Force Source Retrieve with Manifest Option', () => { +describe('Retrieve with Manifest Option', () => { beforeEach(() => { env.stub(SourceTrackingService, 'getSourceTracking'); env.stub(SourceTrackingService, 'updateSourceTrackingAfterRetrieve'); @@ -49,7 +49,7 @@ describe('Force Source Retrieve with Manifest Option', () => { let retrieveStub: SinonStub; let pollStatusStub: SinonStub; - const executor = new LibrarySourceRetrieveManifestExecutor(); + const executor = new LibraryRetrieveManifestExecutor(); beforeEach(async () => { const testData = new MockTestOrgData(); diff --git a/packages/salesforcedx-vscode-core/test/vscode-integration/commands/forceSourceRetrieveMetadata/describers.test.ts b/packages/salesforcedx-vscode-core/test/vscode-integration/commands/retrieveMetadata/describers.test.ts similarity index 98% rename from packages/salesforcedx-vscode-core/test/vscode-integration/commands/forceSourceRetrieveMetadata/describers.test.ts rename to packages/salesforcedx-vscode-core/test/vscode-integration/commands/retrieveMetadata/describers.test.ts index 3bad853594..79cd219807 100644 --- a/packages/salesforcedx-vscode-core/test/vscode-integration/commands/forceSourceRetrieveMetadata/describers.test.ts +++ b/packages/salesforcedx-vscode-core/test/vscode-integration/commands/retrieveMetadata/describers.test.ts @@ -8,7 +8,7 @@ import { LocalComponent } from '@salesforce/salesforcedx-utils-vscode'; import { expect } from 'chai'; import { normalize } from 'path'; import { createSandbox, SinonSandbox, SinonStub } from 'sinon'; -import { RetrieveDescriberFactory } from '../../../../src/commands/forceSourceRetrieveMetadata'; +import { RetrieveDescriberFactory } from '../../../../src/commands/retrieveMetadata'; import { BrowserNode, NodeType, orgBrowser } from '../../../../src/orgBrowser'; import { SfdxPackageDirectories } from '../../../../src/sfdxProject'; diff --git a/packages/salesforcedx-vscode-core/test/vscode-integration/commands/forceSourceRetrieveMetadata/forceSourceRetrieveCmp.test.ts b/packages/salesforcedx-vscode-core/test/vscode-integration/commands/retrieveMetadata/retrieveComponent.test.ts similarity index 97% rename from packages/salesforcedx-vscode-core/test/vscode-integration/commands/forceSourceRetrieveMetadata/forceSourceRetrieveCmp.test.ts rename to packages/salesforcedx-vscode-core/test/vscode-integration/commands/retrieveMetadata/retrieveComponent.test.ts index 304ce893c5..ecce80cd10 100644 --- a/packages/salesforcedx-vscode-core/test/vscode-integration/commands/forceSourceRetrieveMetadata/forceSourceRetrieveCmp.test.ts +++ b/packages/salesforcedx-vscode-core/test/vscode-integration/commands/retrieveMetadata/retrieveComponent.test.ts @@ -32,8 +32,8 @@ import { expect } from 'chai'; import * as path from 'path'; import { SinonStub } from 'sinon'; import * as vscode from 'vscode'; -import { RetrieveDescriber } from '../../../../src/commands/forceSourceRetrieveMetadata'; -import { LibraryRetrieveSourcePathExecutor } from '../../../../src/commands/forceSourceRetrieveMetadata/libraryRetrieveSourcePathExecutor'; +import { RetrieveDescriber } from '../../../../src/commands/retrieveMetadata'; +import { LibraryRetrieveSourcePathExecutor } from '../../../../src/commands/retrieveMetadata/libraryRetrieveSourcePathExecutor'; import { WorkspaceContext } from '../../../../src/context'; import { SfdxPackageDirectories } from '../../../../src/sfdxProject'; import { workspaceUtils } from '../../../../src/util'; @@ -51,7 +51,7 @@ class TestDescriber implements RetrieveDescriber { } } -describe('Force Source Retrieve Component(s)', () => { +describe('Retrieve Component(s)', () => { describe('Library Executor', () => { const testData = new MockTestOrgData(); const defaultPackageDir = 'test-app'; diff --git a/packages/salesforcedx-vscode-core/test/vscode-integration/commands/forceSourceRetrieveSourcePath.test.ts b/packages/salesforcedx-vscode-core/test/vscode-integration/commands/retrieveSourcePath.test.ts similarity index 93% rename from packages/salesforcedx-vscode-core/test/vscode-integration/commands/forceSourceRetrieveSourcePath.test.ts rename to packages/salesforcedx-vscode-core/test/vscode-integration/commands/retrieveSourcePath.test.ts index e7eaa7a001..fa32697b30 100644 --- a/packages/salesforcedx-vscode-core/test/vscode-integration/commands/forceSourceRetrieveSourcePath.test.ts +++ b/packages/salesforcedx-vscode-core/test/vscode-integration/commands/retrieveSourcePath.test.ts @@ -32,7 +32,7 @@ import { LibraryRetrieveSourcePathExecutor, SourcePathChecker } from '../../../src/commands'; -import * as forceSourceRetrieveSourcePath from '../../../src/commands/forceSourceRetrieveSourcePath'; +import * as retrieveSourcePath from '../../../src/commands/retrieveSourcePath'; import { WorkspaceContext } from '../../../src/context'; import { nls } from '../../../src/messages'; import { notificationService } from '../../../src/notifications'; @@ -45,7 +45,7 @@ import { workspaceUtils } from '../../../src/util'; const $$ = instantiateContext(); const sb = $$.SANDBOX; -describe('Force Source Retrieve with Sourcepath Option', () => { +describe('Retrieve with Sourcepath Option', () => { beforeEach(() => { stubContext($$); }); @@ -148,10 +148,7 @@ describe('Force Source Retrieve with Sourcepath Option', () => { path.sep + filePath3 ]); - await forceSourceRetrieveSourcePath.forceSourceRetrieveSourcePaths( - uris[0], - uris - ); + await retrieveSourcePath.retrieveSourcePaths(uris[0], uris); expect(sourcePathCheckerCheckStub.called).to.equal(true); const continueResponse = sourcePathCheckerCheckStub @@ -180,10 +177,7 @@ describe('Force Source Retrieve with Sourcepath Option', () => { .stub(fileUtils, 'flushFilePaths') .returns([path.sep + filePath1]); - await forceSourceRetrieveSourcePath.forceSourceRetrieveSourcePaths( - uris[0], - uris - ); + await retrieveSourcePath.retrieveSourcePaths(uris[0], uris); expect(sourcePathCheckerCheckStub.called).to.equal(true); const continueResponse = sourcePathCheckerCheckStub @@ -212,10 +206,7 @@ describe('Force Source Retrieve with Sourcepath Option', () => { .stub(fileUtils, 'flushFilePaths') .returns([path.sep + filePath1]); - await forceSourceRetrieveSourcePath.forceSourceRetrieveSourcePaths( - uris[0], - undefined - ); + await retrieveSourcePath.retrieveSourcePaths(uris[0], undefined); expect(sourcePathCheckerCheckStub.called).to.equal(true); const continueResponse = sourcePathCheckerCheckStub @@ -246,16 +237,13 @@ describe('Force Source Retrieve with Sourcepath Option', () => { data: filePaths }); const getUriFromActiveEditorStub = sb - .stub(forceSourceRetrieveSourcePath, 'getUriFromActiveEditor') + .stub(retrieveSourcePath, 'getUriFromActiveEditor') .returns(filePath1); const flushFilePathsStub = sb .stub(fileUtils, 'flushFilePaths') .returns([undefined]); - await forceSourceRetrieveSourcePath.forceSourceRetrieveSourcePaths( - sourceUri, - uris - ); + await retrieveSourcePath.retrieveSourcePaths(sourceUri, uris); expect(getUriFromActiveEditorStub.called).to.equal(true); diff --git a/packages/salesforcedx-vscode-core/test/vscode-integration/commands/sourceDiff.test.ts b/packages/salesforcedx-vscode-core/test/vscode-integration/commands/sourceDiff.test.ts index f53383f423..cad5e2d8c5 100644 --- a/packages/salesforcedx-vscode-core/test/vscode-integration/commands/sourceDiff.test.ts +++ b/packages/salesforcedx-vscode-core/test/vscode-integration/commands/sourceDiff.test.ts @@ -36,8 +36,8 @@ import { telemetryService } from '../../../src/telemetry'; const sandbox = createSandbox(); -describe('Force Source Diff', () => { - describe('Force Source File Diff', () => { +describe('Diff', () => { + describe('File Diff', () => { const mockAlias = 'vscodeOrg'; const mockUsername = 'admin@ut-sandbox.org'; const mockFilePath = path.join( @@ -190,7 +190,7 @@ describe('Force Source Diff', () => { }); }); - describe('Force Source Folder Diff', () => { + describe('Folder Diff', () => { let notificationStub: SinonStub; let diffOneFileStub: SinonSpy; let diffFolderStub: SinonSpy; diff --git a/packages/salesforcedx-vscode-core/test/vscode-integration/settings/pushOrDeployOnSave.test.ts b/packages/salesforcedx-vscode-core/test/vscode-integration/settings/pushOrDeployOnSave.test.ts index 30334e478e..ebcd77f694 100644 --- a/packages/salesforcedx-vscode-core/test/vscode-integration/settings/pushOrDeployOnSave.test.ts +++ b/packages/salesforcedx-vscode-core/test/vscode-integration/settings/pushOrDeployOnSave.test.ts @@ -236,7 +236,7 @@ describe('Push or Deploy on Save', () => { expect(executeCommandStub.calledOnce).to.be.true; expect(executeCommandStub.getCall(0).args[0]).to.eql( - 'sfdx.force.source.deploy.multiple.source.paths' + 'sfdx.deploy.multiple.source.paths' ); expect(showErrorMessageStub.calledOnce).to.be.false; expect(appendLineStub.calledOnce).to.be.false;