Skip to content

Commit a01e9d4

Browse files
authored
Merge pull request #846 from salesforcecli/feat/update-webapp-output-dir-description
@W-21182296 Clarify the information around "webapplications" folder + version bump
2 parents 271b6b3 + 1336da2 commit a01e9d4

4 files changed

Lines changed: 23 additions & 9 deletions

File tree

messages/webApplication.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,12 @@ Directory for saving the created files.
5050

5151
# flags.output-dir.description
5252

53-
The location can be an absolute path or relative to the current working directory. If not specified, the command reads your sfdx-project.json and defaults to the webapplications directory within your default package directory. When running outside a Salesforce DX project, defaults to the current directory.
53+
The location can be an absolute path or relative to the current working directory.
54+
55+
**Important:** The generator automatically ensures the output directory ends with "webapplications". If your specified path doesn't end with "webapplications", it's automatically appended. The web application is created at "<output-dir>/<webappname>".
56+
57+
**Examples:**
58+
- "--output-dir force-app/main/default" → Creates a web application at "force-app/main/default/webapplications/MyWebApp/"
59+
- "--output-dir force-app/main/default/webapplications" → Creates a web application at "force-app/main/default/webapplications/MyWebApp/" (no change)
60+
61+
If not specified, the command reads your sfdx-project.json and defaults to "webapplications" directory within your default package directory. When running outside a Salesforce DX project, defaults to the current directory.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"dependencies": {
1010
"@salesforce/core": "^8.25.1",
1111
"@salesforce/sf-plugins-core": "^12",
12-
"@salesforce/templates": "^65.5.8"
12+
"@salesforce/templates": "^65.5.9"
1313
},
1414
"devDependencies": {
1515
"@oclif/plugin-command-snapshot": "^5.3.8",

test/commands/template/generate/webapp/index.nut.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,15 @@ describe('template generate web application:', () => {
106106
expect(stderr).to.contain(nls.localize('DoubleUnderscoreError'));
107107
});
108108

109-
it('should throw error when output dir is not webapplications folder', () => {
110-
const stderr = execCmd('template generate webapp --name TestApp --output-dir /tmp/invalid').shellOutput.stderr;
111-
expect(stderr).to.contain(nls.localize('MissingWebApplicationsDir'));
109+
it('should auto-append webapplications folder when output dir does not end with webapplications', () => {
110+
const outputDir = path.join(session.project.dir, 'force-app', 'main', 'default', 'test-dir');
111+
const expectedOutputDir = path.join(outputDir, 'webapplications');
112+
execCmd(`template generate webapp --name TestApp --output-dir "${outputDir}"`, { ensureExitCode: 0 });
113+
assert.file([
114+
path.join(expectedOutputDir, 'TestApp', 'TestApp.webapplication-meta.xml'),
115+
path.join(expectedOutputDir, 'TestApp', 'src', 'index.html'),
116+
path.join(expectedOutputDir, 'TestApp', 'webapplication.json'),
117+
]);
112118
});
113119
});
114120
});

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1660,10 +1660,10 @@
16601660
cli-progress "^3.12.0"
16611661
terminal-link "^3.0.0"
16621662

1663-
"@salesforce/templates@^65.5.8":
1664-
version "65.5.8"
1665-
resolved "https://registry.yarnpkg.com/@salesforce/templates/-/templates-65.5.8.tgz#df9b87aca219005b6a0a4a56ae3b233e1e599449"
1666-
integrity sha512-LFmQ41bLav1TD9Y0nLSxnzGEThmDsMI7zGmRlXhHFrDjeUMcXaeYboN2q9UMtAKYHiSaUn54TTEh+0m5cVGHkw==
1663+
"@salesforce/templates@^65.5.9":
1664+
version "65.5.9"
1665+
resolved "https://registry.yarnpkg.com/@salesforce/templates/-/templates-65.5.9.tgz#42d75e0f81ab504f2a62b79eeeff6e635ba33c0d"
1666+
integrity sha512-t/DZHdb9WJUr87lxU9Lzu7bZa0uKAULRbjkLp2g2L9BtYgQNZTtcNUCH341oxJC+BHNsrGimQ9gkwvJpy9C5zg==
16671667
dependencies:
16681668
"@salesforce/kit" "^3.2.4"
16691669
ejs "^3.1.10"

0 commit comments

Comments
 (0)