Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions messages/project.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ The analytics template provides similar files and the force-app/main/default/wav

The reactinternalapp and reactexternalapp templates provide React-based project scaffolding for internal and external UI bundle use cases.

The angularinternalapp and angularexternalapp templates provide Angular-based project scaffolding for internal and external UI bundle use cases.

The agent template provides project scaffolding for building Agentforce agents and includes a sample agent called Local Info Agent.

# flags.namespace.summary
Expand Down
4 changes: 2 additions & 2 deletions src/commands/template/generate/project/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default class Project extends SfCommand<CreateOutput> {
summary: messages.getMessage('flags.template.summary'),
description: messages.getMessage('flags.template.description'),
default: 'standard',
options: ['standard', 'empty', 'analytics', 'reactinternalapp', 'reactexternalapp', 'agent'] as const,
options: ['standard', 'empty', 'analytics', 'reactinternalapp', 'reactexternalapp', 'angularinternalapp', 'angularexternalapp', 'agent'] as const,
})(),
'output-dir': outputDirFlag,
namespace: Flags.string({
Expand Down Expand Up @@ -81,7 +81,7 @@ export default class Project extends SfCommand<CreateOutput> {
outputdir: flags['output-dir'],
manifest: flags.manifest,
loginurl: flags['login-url'],
template: flags.template,
template: flags.template as ProjectOptions['template'],
// namespace is a reserved keyword for the generator
ns: flags.namespace,
defaultpackagedir: flags['default-package-dir'],
Expand Down
44 changes: 44 additions & 0 deletions test/commands/template/generate/project/index.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,50 @@ describe('template generate project:', () => {
assert.fileContent(uiBundleMetaPath, alphanumericName);
});

it('should create project with angularexternalapp template', () => {
const projectName = 'angular-externalapp-test';
const alphanumericName = 'angularexternalapptest';
execCmd(`template generate project --projectname ${projectName} --template angularexternalapp`, {
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 uiBundleMetaPath = path.join(
projectDir,
'force-app',
'main',
'default',
'uiBundles',
alphanumericName,
`${alphanumericName}.uibundle-meta.xml`
);
assert.file([uiBundleMetaPath]);
assert.fileContent(uiBundleMetaPath, alphanumericName);
});

it('should create project with angularinternalapp template', () => {
const projectName = 'angular-internalapp-test';
const alphanumericName = 'angularinternalapptest';
execCmd(`template generate project --projectname ${projectName} --template angularinternalapp`, {
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 uiBundleMetaPath = path.join(
projectDir,
'force-app',
'main',
'default',
'uiBundles',
alphanumericName,
`${alphanumericName}.uibundle-meta.xml`
);
assert.file([uiBundleMetaPath]);
assert.fileContent(uiBundleMetaPath, alphanumericName);
});

it('should create project with agent template', () => {
execCmd('template generate project --projectname agent1 --template agent --manifest', {
ensureExitCode: 0,
Expand Down
Loading