From 7b88b6ef2a69fc9a17fb80e72fcfb7a073a2dab6 Mon Sep 17 00:00:00 2001 From: k-j-kim Date: Tue, 24 Feb 2026 22:37:40 -0800 Subject: [PATCH 1/4] feat: adding webapp project generate --- messages/project.md | 2 ++ package.json | 2 +- src/commands/template/generate/project/index.ts | 2 +- yarn.lock | 12 ++++++------ 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/messages/project.md b/messages/project.md index bf525165..3d905059 100644 --- a/messages/project.md +++ b/messages/project.md @@ -58,6 +58,8 @@ The standard template provides a complete force-app directory structure so you k The analytics template provides similar files and the force-app/main/default/waveTemplates directory. +The react-b2e and react-b2x templates provide React-based project scaffolding for B2E and B2X web application use cases. + # flags.namespace.summary Namespace associated with this project and any connected scratch orgs. diff --git a/package.json b/package.json index 21b401cf..e83d91b8 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "dependencies": { "@salesforce/core": "^8.26.2", "@salesforce/sf-plugins-core": "^12", - "@salesforce/templates": "^65.5.11" + "@salesforce/templates": "^66.2.0" }, "devDependencies": { "@oclif/plugin-command-snapshot": "^5.3.9", diff --git a/src/commands/template/generate/project/index.ts b/src/commands/template/generate/project/index.ts index f8bc66bd..cef7667b 100644 --- a/src/commands/template/generate/project/index.ts +++ b/src/commands/template/generate/project/index.ts @@ -33,7 +33,7 @@ export default class Project extends SfCommand { summary: messages.getMessage('flags.template.summary'), description: messages.getMessage('flags.template.description'), default: 'standard', - options: ['standard', 'empty', 'analytics'] as const, + options: ['standard', 'empty', 'analytics', 'react-b2e', 'react-b2x'] as const, })(), 'output-dir': outputDirFlag, namespace: Flags.string({ diff --git a/yarn.lock b/yarn.lock index 4484e1bf..e25ae04b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1953,10 +1953,10 @@ cli-progress "^3.12.0" terminal-link "^3.0.0" -"@salesforce/templates@^65.5.11": - version "65.5.11" - resolved "https://registry.yarnpkg.com/@salesforce/templates/-/templates-65.5.11.tgz#cdc4cce1e4dcab0c8884d0711d10644bd0a9d007" - integrity sha512-dBw3MCnzCrpQNIXaxkFj8ZYU+4yx+uxpoWiDnCS/wqN3I9GaHOOni0UgtrCFTdHIhQP2a4EW+mcbwF9DLQAU4Q== +"@salesforce/templates@^66.2.0": + version "66.2.0" + resolved "https://registry.yarnpkg.com/@salesforce/templates/-/templates-66.2.0.tgz#8959b18a89a9b5679f0e5eb1e36cbddd25924da5" + integrity sha512-hOZZUQ2NDR+Z3Ew8m+l21z2zI3yj1rC3WIO4sx4ici8ZXoCNLUEzC0ea6NkJ8g9hIUB1CNBswZizGRjafNN8jA== dependencies: "@salesforce/kit" "^3.2.4" ejs "^3.1.10" @@ -1964,7 +1964,7 @@ hpagent "^1.2.0" mime-types "^3.0.2" proxy-from-env "^1.1.0" - tar "^7.5.8" + tar "^7.5.9" tslib "^2.8.1" "@salesforce/ts-types@^2.0.11", "@salesforce/ts-types@^2.0.12": @@ -7738,7 +7738,7 @@ supports-preserve-symlinks-flag@^1.0.0: resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz" integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== -tar@^7.5.8: +tar@^7.5.9: version "7.5.9" resolved "https://registry.yarnpkg.com/tar/-/tar-7.5.9.tgz#817ac12a54bc4362c51340875b8985d7dc9724b8" integrity sha512-BTLcK0xsDh2+PUe9F6c2TlRp4zOOBMTkoQHQIWSIzI0R7KG46uEwq4OPk2W7bZcprBMsuaeFsqwYr7pjh6CuHg== From 826ee896b01c52e7d3646e77fabd2a10f27dc794 Mon Sep 17 00:00:00 2001 From: k-j-kim Date: Tue, 24 Feb 2026 22:45:58 -0800 Subject: [PATCH 2/4] test: adding a test for react project generation --- .../template/generate/project/index.nut.ts | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/test/commands/template/generate/project/index.nut.ts b/test/commands/template/generate/project/index.nut.ts index 4d71ef9d..fae8ede0 100644 --- a/test/commands/template/generate/project/index.nut.ts +++ b/test/commands/template/generate/project/index.nut.ts @@ -231,6 +231,48 @@ describe('template generate project:', () => { assert.file([path.join(session.project.dir, 'analytics1', 'eslint.config.js')]); assert.file([path.join(session.project.dir, 'analytics1', 'eslint.config.js')]); }); + + it('should create project with react-b2e template', () => { + const projectName = 'reactb2etest'; + execCmd(`template generate project --projectname ${projectName} --template react-b2e`, { + ensureExitCode: 0, + }); + const projectDir = path.join(session.project.dir, projectName); + assert.file([path.join(projectDir, 'sfdx-project.json')]); + assert.fileContent(path.join(projectDir, 'sfdx-project.json'), 'sourceApiVersion'); + const webappMetaPath = path.join( + projectDir, + 'force-app', + 'main', + 'default', + 'webapplications', + projectName, + `${projectName}.webapplication-meta.xml` + ); + assert.file([webappMetaPath]); + assert.fileContent(webappMetaPath, projectName); + }); + + it('should create project with react-b2x template', () => { + const projectName = 'reactb2xtest'; + execCmd(`template generate project --projectname ${projectName} --template react-b2x`, { + ensureExitCode: 0, + }); + const projectDir = path.join(session.project.dir, projectName); + assert.file([path.join(projectDir, 'sfdx-project.json')]); + assert.fileContent(path.join(projectDir, 'sfdx-project.json'), 'sourceApiVersion'); + const webappMetaPath = path.join( + projectDir, + 'force-app', + 'main', + 'default', + 'webapplications', + projectName, + `${projectName}.webapplication-meta.xml` + ); + assert.file([webappMetaPath]); + assert.fileContent(webappMetaPath, projectName); + }); }); describe('project creation failures', () => { From 434e8d7b4d70e92b3eb2f68bb3bcb9b98b01d54a Mon Sep 17 00:00:00 2001 From: k-j-kim Date: Wed, 25 Feb 2026 21:16:11 -0800 Subject: [PATCH 3/4] fix: updating template type names --- messages/project.md | 2 +- src/commands/template/generate/project/index.ts | 2 +- test/commands/template/generate/project/index.nut.ts | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/messages/project.md b/messages/project.md index 3d905059..9dfef1b3 100644 --- a/messages/project.md +++ b/messages/project.md @@ -58,7 +58,7 @@ The standard template provides a complete force-app directory structure so you k The analytics template provides similar files and the force-app/main/default/waveTemplates directory. -The react-b2e and react-b2x templates provide React-based project scaffolding for B2E and B2X web application use cases. +The reactb2e and reactb2x templates provide React-based project scaffolding for B2E and B2X web application use cases. # flags.namespace.summary diff --git a/src/commands/template/generate/project/index.ts b/src/commands/template/generate/project/index.ts index cef7667b..ea6bbd04 100644 --- a/src/commands/template/generate/project/index.ts +++ b/src/commands/template/generate/project/index.ts @@ -33,7 +33,7 @@ export default class Project extends SfCommand { summary: messages.getMessage('flags.template.summary'), description: messages.getMessage('flags.template.description'), default: 'standard', - options: ['standard', 'empty', 'analytics', 'react-b2e', 'react-b2x'] as const, + options: ['standard', 'empty', 'analytics', 'reactb2e', 'reactb2x'] as const, })(), 'output-dir': outputDirFlag, namespace: Flags.string({ diff --git a/test/commands/template/generate/project/index.nut.ts b/test/commands/template/generate/project/index.nut.ts index fae8ede0..3c7ba978 100644 --- a/test/commands/template/generate/project/index.nut.ts +++ b/test/commands/template/generate/project/index.nut.ts @@ -232,9 +232,9 @@ describe('template generate project:', () => { assert.file([path.join(session.project.dir, 'analytics1', 'eslint.config.js')]); }); - it('should create project with react-b2e template', () => { + it('should create project with reactb2e template', () => { const projectName = 'reactb2etest'; - execCmd(`template generate project --projectname ${projectName} --template react-b2e`, { + execCmd(`template generate project --projectname ${projectName} --template reactb2e`, { ensureExitCode: 0, }); const projectDir = path.join(session.project.dir, projectName); @@ -253,9 +253,9 @@ describe('template generate project:', () => { assert.fileContent(webappMetaPath, projectName); }); - it('should create project with react-b2x template', () => { + it('should create project with reactb2x template', () => { const projectName = 'reactb2xtest'; - execCmd(`template generate project --projectname ${projectName} --template react-b2x`, { + execCmd(`template generate project --projectname ${projectName} --template reactb2x`, { ensureExitCode: 0, }); const projectDir = path.join(session.project.dir, projectName); From 1746e8eac02f8d6655eaf8bb4a799ba0a1657c66 Mon Sep 17 00:00:00 2001 From: k-j-kim Date: Wed, 25 Feb 2026 21:23:49 -0800 Subject: [PATCH 4/4] test: updating test to reflect the rename and alphanumeric conversion --- .../template/generate/project/index.nut.ts | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/test/commands/template/generate/project/index.nut.ts b/test/commands/template/generate/project/index.nut.ts index 3c7ba978..efb9bce0 100644 --- a/test/commands/template/generate/project/index.nut.ts +++ b/test/commands/template/generate/project/index.nut.ts @@ -233,7 +233,8 @@ describe('template generate project:', () => { }); it('should create project with reactb2e template', () => { - const projectName = 'reactb2etest'; + const projectName = 'react-b2e-test'; + const alphanumericName = 'reactb2etest'; execCmd(`template generate project --projectname ${projectName} --template reactb2e`, { ensureExitCode: 0, }); @@ -246,15 +247,16 @@ describe('template generate project:', () => { 'main', 'default', 'webapplications', - projectName, - `${projectName}.webapplication-meta.xml` + alphanumericName, + `${alphanumericName}.webapplication-meta.xml` ); assert.file([webappMetaPath]); - assert.fileContent(webappMetaPath, projectName); + assert.fileContent(webappMetaPath, alphanumericName); }); it('should create project with reactb2x template', () => { - const projectName = 'reactb2xtest'; + const projectName = 'react-b2x-test'; + const alphanumericName = 'reactb2xtest'; execCmd(`template generate project --projectname ${projectName} --template reactb2x`, { ensureExitCode: 0, }); @@ -267,11 +269,11 @@ describe('template generate project:', () => { 'main', 'default', 'webapplications', - projectName, - `${projectName}.webapplication-meta.xml` + alphanumericName, + `${alphanumericName}.webapplication-meta.xml` ); assert.file([webappMetaPath]); - assert.fileContent(webappMetaPath, projectName); + assert.fileContent(webappMetaPath, alphanumericName); }); });