Skip to content

Commit

Permalink
fix: sfdx create project (with manifest) to sf
Browse files Browse the repository at this point in the history
  • Loading branch information
CristiCanizales committed Dec 27, 2023
1 parent 369750b commit 6e6e616
Show file tree
Hide file tree
Showing 19 changed files with 145 additions and 168 deletions.
32 changes: 16 additions & 16 deletions docs/_articles/en/lwc/linting.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Linting provides errors about malformed code while you edit. VS Code enforces Sa

### For a New Project

If you create an SFDX project using the `sfdx force:project:create` command, your project contains a `package.json` file with the ESLint plugin already included.
If you create an SFDX project using the `sfdx project:generate` command, your project contains a `package.json` file with the ESLint plugin already included.

1. To install the ESLint plugin and other dependencies, run `npm install` in your project directory.

Expand All @@ -25,17 +25,17 @@ If you create an SFDX project using the `sfdx force:project:create` command, you

1. Verify that your project has a `package.json` with these configurations. If your `package.json` doesn't have the configurations, run `npm install eslint @salesforce/eslint-config-lwc --save-dev`.

```json
"scripts": {
"lint": "npm run lint:lwc",
"lint:lwc": "eslint force-app/main/default/lwc"
}
```json
"scripts": {
"lint": "npm run lint:lwc",
"lint:lwc": "eslint force-app/main/default/lwc"
}

"devDependencies" {
"@salesforce/eslint-config-lwc": "3.4.0",
"eslint": "^5.16.0"
}
```
"devDependencies" {
"@salesforce/eslint-config-lwc": "3.4.0",
"eslint": "^5.16.0"
}
```

2. If your project doesn't have the [`package.json`](https://github.com/forcedotcom/salesforcedx-templates/blob/master/src/templates/project/package.json) file, copy it and add it to your project directory.

Expand All @@ -51,22 +51,22 @@ If you create an SFDX project using the `sfdx force:project:create` command, you

ESLint includes three configuration levels. The default level is `@salesforce/eslint-config-lwc/recommended`.

To change the configuration level, edit this line in the `.eslintrc.json`
To change the configuration level, edit this line in the `.eslintrc.json`

```json
{
"extends": ["@salesforce/eslint-config-lwc/recommended"]
"extends": ["@salesforce/eslint-config-lwc/recommended"]
}
```

- `@salesforce/eslint-config-lwc/base`
This configuration prevents common pitfalls with Lightning Web Components and enforces other Salesforce platform restrictions.
This configuration prevents common pitfalls with Lightning Web Components and enforces other Salesforce platform restrictions.

- `@salesforce/eslint-config-lwc/recommended`
This configuration prevents common Javascript pitfalls and enforces all best practices.
This configuration prevents common Javascript pitfalls and enforces all best practices.

- `@salesforce/eslint-config-lwc/extended`
This configuration restricts the use of some Javascript language features that are sometimes slow in older browsers, such as IE11. To support new Javascript syntax and language features on an older browser, the Lightning Web Components compiler transforms the Lightning Web Components modules.
This configuration restricts the use of some Javascript language features that are sometimes slow in older browsers, such as IE11. To support new Javascript syntax and language features on an older browser, the Lightning Web Components compiler transforms the Lightning Web Components modules.

For more details on the linting rules and using them individually, see the [ESLint Plugin](https://github.com/salesforce/eslint-plugin-lwc) Github repository.

Expand Down
2 changes: 1 addition & 1 deletion docs/_articles/en/source-control/source-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Follow these steps to convert the project from metadata to source format, withou

1. Create a temporary SFDX project outside of the Git repo. This temporary project has the structure and a configuration file as required by a Salesforce project.

`$ sfdx force:project:create -n tempproj`
`$ sfdx project:generate -n tempproj`

1. Convert the project in metadata into a temporary project.

Expand Down
2 changes: 1 addition & 1 deletion docs/_articles/ja/lwc/linting.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ SSL のサポートを含めてビルドされた Node.js の [Active LTS リリ

### 新しいプロジェクト

SFDX プロジェクトを、`sfdx force:project:create (SFDX: プロジェクトを作成)` コマンドで作成した場合、そのプロジェクトに含まれる `package.json` ファイルにはすでに ESLint のプラグインが含まれています。
SFDX プロジェクトを、`sfdx project:generate (SFDX: プロジェクトを作成)` コマンドで作成した場合、そのプロジェクトに含まれる `package.json` ファイルにはすでに ESLint のプラグインが含まれています。

1. ESLint プラグインと他の依存関係をインストールするには、プロジェクトのディレクトリで `npm install` を実行します。

Expand Down
2 changes: 1 addition & 1 deletion docs/_articles/ja/source-control/source-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Force.com IDE ではメタデータ形式を使用していたため、VS Code

1. Git リポジトリの外で一時的な SFDX プロジェクトを作成します。この一時的なプロジェクトには Salesforce のプロジェクトで必要とされるディレクトリ構造や設定ファイルがあります。

`$ sfdx force:project:create -n tempproj`
`$ sfdx project:generate -n tempproj`

2. メタデータ内のプロジェクトを一時的なプロジェクトに変換します。

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ describe.skip('Interactive debugger adapter - integration', () => {
let apexClassUri: string;

beforeAll(async () => {
// Create SFDX project
// Generate SF project
projectPath = path.join(process.cwd(), PROJECT_NAME);
console.log(`projectPath: ${projectPath}`);
await util.createSFDXProject(PROJECT_NAME);
await util.generateSFProject(PROJECT_NAME);
// Create scratch org with Debug Apex enabled
util.addFeatureToScratchOrgConfig(PROJECT_NAME, 'DebugApex');
apexClassUri = Uri.file(
Expand Down
6 changes: 3 additions & 3 deletions packages/salesforcedx-test-utils-vscode/src/orgUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ import * as util from 'util';
import { Uri } from 'vscode';

// Used only for CI purposes. Must call delete if you call create
export const createSFDXProject = async (projectName: string): Promise<void> => {
export const generateSFProject = async (projectName: string): Promise<void> => {
const execution = new CliCommandExecutor(
new SfdxCommandBuilder()
.withArg('force:project:create')
.withFlag('--projectname', projectName)
.withArg('project:generate')
.withFlag('--name', projectName)
.withJson()
.build(),
{ cwd: process.cwd() }
Expand Down
16 changes: 8 additions & 8 deletions packages/salesforcedx-vscode-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@
},
"activationEvents": [
"workspaceContains:sfdx-project.json",
"onCommand:sfdx.force.project.create",
"onCommand:sfdx.force.project.with.manifest.create",
"onCommand:sfdx.project.generate",
"onCommand:sfdx.project.generate.with.manifest",
"onCommand:sfdx.debug.isv.bootstrap"
],
"main": "./out/src",
Expand Down Expand Up @@ -456,11 +456,11 @@
"when": "sfdx:project_opened && editorHasSelection"
},
{
"command": "sfdx.force.project.create",
"command": "sfdx.project.generate",
"when": "!sfdx:internal_dev"
},
{
"command": "sfdx.force.project.with.manifest.create",
"command": "sfdx.project.generate.with.manifest",
"when": "!sfdx:internal_dev"
},
{
Expand Down Expand Up @@ -779,12 +779,12 @@
"title": "%data_query_selection_text%"
},
{
"command": "sfdx.force.project.create",
"title": "%force_project_create_text%"
"command": "sfdx.project.generate",
"title": "%project_generate_text%"
},
{
"command": "sfdx.force.project.with.manifest.create",
"title": "%force_project_with_manifest_create_text%"
"command": "sfdx.project.generate.with.manifest",
"title": "%project_generate_with_manifest_text%"
},
{
"command": "sfdx.force.apex.trigger.create",
Expand Down
4 changes: 2 additions & 2 deletions packages/salesforcedx-vscode-core/package.nls.ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
"data_query_selection_text": "SFDX: 現在選択されているテキストを使用して SOQL クエリを実行",
"force_package_install_text": "SFDX: パッケージをインストール",
"core_settings_title": "Salesforce 機能のプレビュー",
"force_project_create_text": "SFDX: プロジェクトを作成",
"force_project_with_manifest_create_text": "SFDX: マニフェストファイルを使用してプロジェクトを作成",
"project_generate_text": "SFDX: プロジェクトを作成",
"project_generate_with_manifest_text": "SFDX: マニフェストファイルを使用してプロジェクトを作成",
"force_apex_trigger_create_text": "SFDX: Apex トリガを作成",
"show_cli_success_msg_description": "VS Code のコマンドパレットを使用して実行されたSalesforce CLI コマンドのステータスメッセージを、ポップアップで表示か (true)、ステータスバーに表示か (false) を指定します。",
"start_apex_debug_logging": "SFDX: Replay Debugger 用の Apex デバッグログを有効化",
Expand Down
4 changes: 2 additions & 2 deletions packages/salesforcedx-vscode-core/package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
"data_query_selection_text": "SFDX: Execute SOQL Query with Currently Selected Text",
"force_package_install_text": "SFDX: Install Package",
"core_settings_title": "Salesforce Core Configuration",
"force_project_create_text": "SFDX: Create Project",
"force_project_with_manifest_create_text": "SFDX: Create Project with Manifest",
"project_generate_text": "SFDX: Create Project",
"project_generate_with_manifest_text": "SFDX: Create Project with Manifest",
"force_apex_trigger_create_text": "SFDX: Create Apex Trigger",
"show_cli_success_msg_description": "Specifies whether status messages for Salesforce CLI commands run using the VS Code command palette will appear as pop-up information messages (true) or as status bar messages (false).",
"start_apex_debug_logging": "SFDX: Turn On Apex Debug Log for Replay Debugger",
Expand Down
28 changes: 14 additions & 14 deletions packages/salesforcedx-vscode-core/src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ export {
orgLoginWebDevHub
} from './auth/orgLoginWebDevHub';
export { OrgLogoutAll, orgLogoutAll, orgLogoutDefault } from './auth/orgLogout';
export { ConfigList, configList } from './configList';
export { ConfigSetExecutor, configSet } from './configSet';
export { dataQuery } from './dataQuery';
export {
DebuggerSessionDetachExecutor,
Expand All @@ -48,8 +50,6 @@ export {
ManifestChecker,
deleteSource
} from './deleteSource';
export { ConfigList, configList } from './configList';
export { ConfigSetExecutor, configSet } from './configSet';
export { forceCreateManifest } from './forceCreateManifest';
export {
ForceDescribeMetadataExecutor,
Expand All @@ -72,17 +72,6 @@ export {
SelectPackageID,
forcePackageInstall
} from './forcePackageInstall';
export {
PathExistsChecker,
ProjectNameAndPathAndTemplate,
ProjectTemplateItem,
SelectProjectFolder,
SelectProjectName,
SelectProjectTemplate,
forceProjectWithManifestCreate,
forceSfdxProjectCreate,
projectTemplateEnum
} from './forceProjectCreate';
export {
ForceRefreshSObjectsExecutor,
checkSObjectsAndRefresh,
Expand Down Expand Up @@ -123,6 +112,17 @@ export {
getExecutor,
orgOpen
} from './orgOpen';
export {
PathExistsChecker,
ProjectNameAndPathAndTemplate,
ProjectTemplateItem,
SelectProjectFolder,
SelectProjectName,
SelectProjectTemplate,
projectGenerateWithManifest,
projectTemplateEnum,
sfProjectGenerate
} from './projectGenerate';
export {
viewAllChanges,
viewLocalChanges,
Expand All @@ -146,8 +146,8 @@ export {
export {
forceAnalyticsTemplateCreate,
forceApexClassCreate,
forceApexUnitClassCreate,
forceApexTriggerCreate,
forceApexUnitClassCreate,
forceInternalLightningAppCreate,
forceInternalLightningComponentCreate,
forceInternalLightningEventCreate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {
ProjectNameAndPathAndTemplate,
SelectProjectFolder,
SelectProjectName
} from '../forceProjectCreate';
} from '../projectGenerate';
import {
CompositeParametersGatherer,
EmptyPreChecker,
Expand Down Expand Up @@ -89,9 +89,7 @@ export class IsvDebugBootstrapExecutor extends SfdxCommandletExecutor<{}> {

public buildConfigureProjectCommand(data: IsvDebugBootstrapConfig): Command {
return new SfdxCommandBuilder()
.withDescription(
nls.localize('isv_debug_bootstrap_configure_project')
)
.withDescription(nls.localize('isv_debug_bootstrap_configure_project'))
.withArg('config:set')
.withArg(`org-isv-debugger-sid=${data.sessionId}`)
.withArg(`org-isv-debugger-url=${data.loginUrl}`)
Expand All @@ -105,9 +103,7 @@ export class IsvDebugBootstrapExecutor extends SfdxCommandletExecutor<{}> {
): Command {
return new SfdxCommandBuilder()
.withDescription(
nls.localize(
'isv_debug_bootstrap_configure_project_retrieve_namespace'
)
nls.localize('isv_debug_bootstrap_configure_project_retrieve_namespace')
)
.withArg('data:query')
.withFlag('--query', 'SELECT NamespacePrefix FROM Organization LIMIT 1')
Expand Down Expand Up @@ -135,9 +131,7 @@ export class IsvDebugBootstrapExecutor extends SfdxCommandletExecutor<{}> {

public buildRetrieveOrgSourceCommand(data: IsvDebugBootstrapConfig): Command {
return new SfdxCommandBuilder()
.withDescription(
nls.localize('isv_debug_bootstrap_retrieve_org_source')
)
.withDescription(nls.localize('isv_debug_bootstrap_retrieve_org_source'))
.withArg('project:retrieve:start')
.withFlag('--manifest', this.relativeApexPackageXmlPath)
.withFlag('--target-org', data.sessionId)
Expand Down Expand Up @@ -165,10 +159,7 @@ export class IsvDebugBootstrapExecutor extends SfdxCommandletExecutor<{}> {
): Command {
return new SfdxCommandBuilder()
.withDescription(
nls.localize(
'isv_debug_bootstrap_retrieve_package_source',
packageName
)
nls.localize('isv_debug_bootstrap_retrieve_package_source', packageName)
)
.withArg('project:retrieve:start')
.withFlag('--package-name', packageName)
Expand Down Expand Up @@ -321,10 +312,7 @@ export class IsvDebugBootstrapExecutor extends SfdxCommandletExecutor<{}> {
// TODO: what if packageNames.length is 0?
for (const packageName of packageNames) {
await this.executeCommand(
this.buildRetrievePackageSourceCommand(
response.data,
packageName
),
this.buildRetrievePackageSourceCommand(response.data, packageName),
{ cwd: projectPath },
cancellationTokenSource,
cancellationToken
Expand Down Expand Up @@ -449,13 +437,13 @@ export class IsvDebugBootstrapExecutor extends SfdxCommandletExecutor<{}> {
execution: CommandExecution,
cancellationTokenSource: vscode.CancellationTokenSource,
cancellationToken: vscode.CancellationToken
/* eslint-enable @typescript-eslint/no-unused-vars */
/* eslint-enable @typescript-eslint/no-unused-vars */
) {
channelService.streamCommandOutput(execution);
channelService.showChannelOutput();
notificationService.reportExecutionError(
execution.command.toString(),
(execution.stderrSubject as any) as Observable<Error | undefined>
execution.stderrSubject as any as Observable<Error | undefined>
);
ProgressNotification.show(execution, cancellationTokenSource);
taskViewService.addCommandExecution(execution, cancellationTokenSource);
Expand Down
Loading

0 comments on commit 6e6e616

Please sign in to comment.