diff --git a/packages/salesforcedx-vscode-core/package.json b/packages/salesforcedx-vscode-core/package.json index c1493b2f84..49034d42b9 100644 --- a/packages/salesforcedx-vscode-core/package.json +++ b/packages/salesforcedx-vscode-core/package.json @@ -221,7 +221,7 @@ "when": "sfdx:project_opened && resourceLangId == 'forcesourcemanifest'" }, { - "command": "sfdx.force.source.delete.current.file", + "command": "sfdx.delete.source.current.file", "when": "sfdx:project_opened && resourceLangId != 'forcesourcemanifest'" }, { @@ -319,7 +319,7 @@ "when": "sfdx:project_opened && resourceLangId == 'forcesourcemanifest'" }, { - "command": "sfdx.force.source.delete", + "command": "sfdx.delete.source", "when": "sfdx:project_opened && resourceLangId != 'forcesourcemanifest'" }, { @@ -513,7 +513,7 @@ "when": "sfdx:project_opened && resourceLangId == 'forcesourcemanifest'" }, { - "command": "sfdx.force.source.delete", + "command": "sfdx.delete.source", "when": "false" }, { @@ -529,7 +529,7 @@ "when": "sfdx:project_opened" }, { - "command": "sfdx.force.source.delete.current.file", + "command": "sfdx.delete.source.current.file", "when": "sfdx:project_opened && resourceLangId != 'forcesourcemanifest' && editorIsOpen" }, { @@ -828,12 +828,12 @@ "title": "%force_source_deploy_in_manifest_text%" }, { - "command": "sfdx.force.source.delete", - "title": "%force_source_delete_text%" + "command": "sfdx.delete.source", + "title": "%delete_source_text%" }, { - "command": "sfdx.force.source.delete.current.file", - "title": "%force_source_delete_this_source_text%" + "command": "sfdx.delete.source.current.file", + "title": "%delete_source_this_source_text%" }, { "command": "sfdx.force.set.default.org", diff --git a/packages/salesforcedx-vscode-core/package.nls.ja.json b/packages/salesforcedx-vscode-core/package.nls.ja.json index b7cbfcf6c5..0f4bb39d06 100644 --- a/packages/salesforcedx-vscode-core/package.nls.ja.json +++ b/packages/salesforcedx-vscode-core/package.nls.ja.json @@ -57,8 +57,8 @@ "force_source_deploy_text": "SFDX: 組織へソースをデプロイ", "force_source_deploy_this_source_text": "SFDX: このソースを組織へデプロイ", "force_source_deploy_in_manifest_text": "SFDX: マニフェストファイルのソースを組織へデプロイ", - "force_source_delete_text": "SFDX: プロジェクトおよび組織から削除", - "force_source_delete_this_source_text": "SFDX: このソースをプロジェクトと組織から削除", + "delete_source_text": "SFDX: プロジェクトおよび組織から削除", + "delete_source_this_source_text": "SFDX: このソースをプロジェクトと組織から削除", "force_config_set_org_text": "SFDX: デフォルトの組織を設定", "refresh_types_text": "メタデータ型を更新", "refresh_components_text": "コンポーネントを更新", diff --git a/packages/salesforcedx-vscode-core/package.nls.json b/packages/salesforcedx-vscode-core/package.nls.json index b041ee66f1..32d674fe91 100644 --- a/packages/salesforcedx-vscode-core/package.nls.json +++ b/packages/salesforcedx-vscode-core/package.nls.json @@ -61,8 +61,8 @@ "force_source_deploy_text": "SFDX: Deploy Source to Org", "force_source_deploy_this_source_text": "SFDX: Deploy This Source to Org", "force_source_deploy_in_manifest_text": "SFDX: Deploy Source in Manifest to Org", - "force_source_delete_text": "SFDX: Delete from Project and Org", - "force_source_delete_this_source_text": "SFDX: Delete This from Project and Org", + "delete_source_text": "SFDX: Delete from Project and Org", + "delete_source_this_source_text": "SFDX: Delete This from Project and Org", "force_config_set_org_text": "SFDX: Set a Default Org", "refresh_types_text": "Refresh Types", "refresh_components_text": "Refresh Components", diff --git a/packages/salesforcedx-vscode-core/src/commands/forceSourceDelete.ts b/packages/salesforcedx-vscode-core/src/commands/deleteSource.ts similarity index 85% rename from packages/salesforcedx-vscode-core/src/commands/forceSourceDelete.ts rename to packages/salesforcedx-vscode-core/src/commands/deleteSource.ts index 31f1de09b3..a66ea334ec 100644 --- a/packages/salesforcedx-vscode-core/src/commands/forceSourceDelete.ts +++ b/packages/salesforcedx-vscode-core/src/commands/deleteSource.ts @@ -27,7 +27,7 @@ import { workspaceUtils } from '../util'; import { SfdxCommandlet } from './util/sfdxCommandlet'; import { SfdxCommandletExecutor } from './util/sfdxCommandletExecutor'; -export class ForceSourceDeleteExecutor extends SfdxCommandletExecutor<{ +export class DeleteSourceExecutor extends SfdxCommandletExecutor<{ filePath: string; }> { private isSourceTracked: boolean; @@ -38,13 +38,13 @@ export class ForceSourceDeleteExecutor extends SfdxCommandletExecutor<{ } public build(data: { filePath: string }): Command { const commandBuilder = new SfdxCommandBuilder() - .withDescription(nls.localize('force_source_delete_text')) - .withArg('force:source:delete') + .withDescription(nls.localize('delete_source_text')) + .withArg('project:delete:source') .withLogName('force_source_delete') - .withFlag('--sourcepath', data.filePath) - .withArg('--noprompt'); + .withFlag('--source-dir', data.filePath) + .withArg('--no-prompt'); if (this.isSourceTracked) { - commandBuilder.args.push('--tracksource'); + commandBuilder.args.push('--track-source'); } return commandBuilder.build(); } @@ -64,7 +64,7 @@ export class ManifestChecker implements PreconditionChecker { const isManifestFile = this.explorerPath.includes(manifestPath); if (isManifestFile) { notificationService.showErrorMessage( - nls.localize('force_source_delete_manifest_unsupported_message') + nls.localize('delete_source_manifest_unsupported_message') ); return false; } @@ -87,7 +87,7 @@ export class ConfirmationAndSourcePathGatherer public async gather(): Promise< CancelResponse | ContinueResponse<{ filePath: string }> > { - const prompt = nls.localize('force_source_delete_confirmation_message'); + const prompt = nls.localize('delete_source_confirmation_message'); const response = await vscode.window.showInformationMessage( prompt, this.PROCEED, @@ -100,7 +100,7 @@ export class ConfirmationAndSourcePathGatherer } } -export async function forceSourceDelete(sourceUri: vscode.Uri) { +export async function deleteSource(sourceUri: vscode.Uri) { let isSourceTracked: boolean = false; const orgType = await workspaceContextUtils.getWorkspaceOrgType(); if (orgType === OrgType.SourceTracked) { @@ -112,7 +112,7 @@ export async function forceSourceDelete(sourceUri: vscode.Uri) { sourceUri = editor.document.uri; } else { const errorMessage = nls.localize( - 'force_source_delete_select_file_or_directory' + 'delete_source_select_file_or_directory' ); telemetryService.sendException('force_source_delete', errorMessage); notificationService.showErrorMessage(errorMessage); @@ -125,7 +125,7 @@ export async function forceSourceDelete(sourceUri: vscode.Uri) { const commandlet = new SfdxCommandlet( manifestChecker, new ConfirmationAndSourcePathGatherer(sourceUri), - new ForceSourceDeleteExecutor(isSourceTracked) + new DeleteSourceExecutor(isSourceTracked) ); await commandlet.run(); } diff --git a/packages/salesforcedx-vscode-core/src/commands/index.ts b/packages/salesforcedx-vscode-core/src/commands/index.ts index ba44befd44..5e6b3bd6ef 100644 --- a/packages/salesforcedx-vscode-core/src/commands/index.ts +++ b/packages/salesforcedx-vscode-core/src/commands/index.ts @@ -46,11 +46,11 @@ export { getExecutor } from './orgOpen'; export { - forceSourceDelete, + deleteSource, ConfirmationAndSourcePathGatherer, - ForceSourceDeleteExecutor, + DeleteSourceExecutor, ManifestChecker -} from './forceSourceDelete'; +} from './deleteSource'; export { forceSourceDeployManifest } from './forceSourceDeployManifest'; export { forceSourceDeploySourcePaths, diff --git a/packages/salesforcedx-vscode-core/src/index.ts b/packages/salesforcedx-vscode-core/src/index.ts index 5cb6890725..4711939532 100644 --- a/packages/salesforcedx-vscode-core/src/index.ts +++ b/packages/salesforcedx-vscode-core/src/index.ts @@ -15,6 +15,7 @@ import * as vscode from 'vscode'; import { channelService } from './channels'; import { checkSObjectsAndRefresh, + deleteSource, forceAliasList, forceAnalyticsTemplateCreate, forceApexClassCreate, @@ -52,7 +53,6 @@ import { forceRefreshSObjects, forceRenameLightningComponent, forceSfdxProjectCreate, - forceSourceDelete, forceSourceDeployManifest, forceSourceDeploySourcePaths, forceSourceDiff, @@ -155,13 +155,13 @@ function registerCommands( forceOrgCreate ); const orgOpenCmd = vscode.commands.registerCommand(ORG_OPEN_COMMAND, orgOpen); - const forceSourceDeleteCmd = vscode.commands.registerCommand( - 'sfdx.force.source.delete', - forceSourceDelete + const deleteSourceCmd = vscode.commands.registerCommand( + 'sfdx.delete.source', + deleteSource ); - const forceSourceDeleteCurrentFileCmd = vscode.commands.registerCommand( - 'sfdx.force.source.delete.current.file', - forceSourceDelete + const deleteSourceCurrentFileCmd = vscode.commands.registerCommand( + 'sfdx.delete.source.current.file', + deleteSource ); const forceSourceDeployCurrentSourceFileCmd = vscode.commands.registerCommand( 'sfdx.force.source.deploy.current.source.file', @@ -415,8 +415,8 @@ function registerCommands( forceOrgDeleteDefaultCmd, forceOrgDeleteUsernameCmd, forceRefreshSObjectsCmd, - forceSourceDeleteCmd, - forceSourceDeleteCurrentFileCmd, + deleteSourceCmd, + deleteSourceCurrentFileCmd, forceSourceDeployCurrentSourceFileCmd, forceSourceDeployInManifestCmd, forceSourceDeployMultipleSourcePathsCmd, diff --git a/packages/salesforcedx-vscode-core/src/messages/i18n.ja.ts b/packages/salesforcedx-vscode-core/src/messages/i18n.ja.ts index 0b762d3e8a..2279554b6d 100644 --- a/packages/salesforcedx-vscode-core/src/messages/i18n.ja.ts +++ b/packages/salesforcedx-vscode-core/src/messages/i18n.ja.ts @@ -103,12 +103,12 @@ export const messages = { 'ソースファイルかディレクトリ上でのみ SFDX: 組織からソースを取得 を実行できます。', force_source_retrieve_select_manifest: 'マニフェストファイル上でのみ SFDX: マニフェストのソースを組織から取得 を実行できます。', - force_source_delete_text: 'SFDX: プロジェクトおよび組織から削除', - force_source_delete_manifest_unsupported_message: + delete_source_text: 'SFDX: プロジェクトおよび組織から削除', + delete_source_manifest_unsupported_message: 'SFDX: 組織およびプロジェクトから削除 はマニフェストファイルでサポートされていません。削除するソースファイルやディレクトリを選択してください。', - force_source_delete_select_file_or_directory: + delete_source_select_file_or_directory: 'ソースファイルかディレクトリ上でのみ SFDX: プロジェクトおよび組織から削除 を実行できます。', - force_source_delete_confirmation_message: + delete_source_confirmation_message: 'ソースファイルを削除すると、コンピュータからファイルが削除され、デフォルトの組織から対応するメタデータが取り除かれます。このソースをプロジェクトおよび組織から削除してもよろしいですか?', confirm_delete_source_button_text: 'ソースを削除', cancel_delete_source_button_text: 'キャンセル', diff --git a/packages/salesforcedx-vscode-core/src/messages/i18n.ts b/packages/salesforcedx-vscode-core/src/messages/i18n.ts index c39637564b..df1557dd62 100644 --- a/packages/salesforcedx-vscode-core/src/messages/i18n.ts +++ b/packages/salesforcedx-vscode-core/src/messages/i18n.ts @@ -120,12 +120,12 @@ export const messages = { 'You can run SFDX: Retrieve Source from Org only on a source file or directory.', force_source_retrieve_select_manifest: 'You can run SFDX: Retrieve Source in Manifest from Org only on a manifest file.', - force_source_delete_text: 'SFDX: Delete from Project and Org', - force_source_delete_manifest_unsupported_message: + delete_source_text: 'SFDX: Delete from Project and Org', + delete_source_manifest_unsupported_message: 'SFDX: Delete from Project and Org is not supported for manifest files. Select a source file or directory to delete.', - force_source_delete_select_file_or_directory: + delete_source_select_file_or_directory: 'You can run SFDX: Delete from Project and Org only on a source file or directory.', - force_source_delete_confirmation_message: + delete_source_confirmation_message: 'Deleting source files deletes the files from your computer and removes the corresponding metadata from your default org. Are you sure you want to delete this source from your project and your org?', confirm_delete_source_button_text: 'Delete Source', cancel_delete_source_button_text: 'Cancel', diff --git a/packages/salesforcedx-vscode-core/test/jest/commands/delete/forceSourceDelete.test.ts b/packages/salesforcedx-vscode-core/test/jest/commands/delete/deleteSource.test.ts similarity index 51% rename from packages/salesforcedx-vscode-core/test/jest/commands/delete/forceSourceDelete.test.ts rename to packages/salesforcedx-vscode-core/test/jest/commands/delete/deleteSource.test.ts index bf7af92cc6..5f942fed05 100644 --- a/packages/salesforcedx-vscode-core/test/jest/commands/delete/forceSourceDelete.test.ts +++ b/packages/salesforcedx-vscode-core/test/jest/commands/delete/deleteSource.test.ts @@ -6,27 +6,27 @@ */ import * as path from 'path'; -import { ForceSourceDeleteExecutor } from '../../../../src/commands'; +import { DeleteSourceExecutor } from '../../../../src/commands'; -describe('Force Source Delete', () => { +describe('Project Delete Source', () => { let isSourceTracked: boolean; const sourcePath: string = path.join('example', 'path'); - it('Should build the source delete command with --tracksource flag when connected to a source-tracked org', () => { + it('Should build the delete source command with --track-source flag when connected to a source-tracked org', () => { isSourceTracked = true; - const executor = new ForceSourceDeleteExecutor(isSourceTracked); + const executor = new DeleteSourceExecutor(isSourceTracked); const sourceDeleteCommand = executor.build({ filePath: sourcePath }); expect(sourceDeleteCommand.toCommand()).toEqual( - `sfdx force:source:delete --sourcepath ${sourcePath} --noprompt --tracksource` + `sfdx project:delete:source --source-dir ${sourcePath} --no-prompt --track-source` ); }); - it('Should build the source delete command without --tracksource flag when connected to a non-source-tracked org', () => { + it('Should build the delete source command without --track-source flag when connected to a non-source-tracked org', () => { isSourceTracked = false; - const executor = new ForceSourceDeleteExecutor(isSourceTracked); + const executor = new DeleteSourceExecutor(isSourceTracked); const sourceDeleteCommand = executor.build({ filePath: sourcePath }); expect(sourceDeleteCommand.toCommand()).toEqual( - `sfdx force:source:delete --sourcepath ${sourcePath} --noprompt` + `sfdx project:delete:source --source-dir ${sourcePath} --no-prompt` ); }); }); diff --git a/packages/salesforcedx-vscode-core/test/vscode-integration/commands/forceSourceDelete.test.ts b/packages/salesforcedx-vscode-core/test/vscode-integration/commands/deleteSource.test.ts similarity index 100% rename from packages/salesforcedx-vscode-core/test/vscode-integration/commands/forceSourceDelete.test.ts rename to packages/salesforcedx-vscode-core/test/vscode-integration/commands/deleteSource.test.ts