Skip to content

Commit 6ffdc19

Browse files
authored
Merge pull request #840 from salesforcecli/sl/W-21163895
feat: move existing templates-W-21163895
2 parents 4706828 + 1c6cc56 commit 6ffdc19

24 files changed

Lines changed: 266 additions & 237 deletions

File tree

command-snapshot.json

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,79 @@
11
[
22
{
3-
"alias": ["force:analytics:template:create"],
4-
"command": "analytics:generate:template",
3+
"alias": ["force:analytics:template:create", "analytics:generate:template"],
4+
"command": "template:generate:analytics:template",
55
"flagAliases": ["apiversion", "outputdir", "templatename"],
66
"flagChars": ["d", "n"],
77
"flags": ["api-version", "flags-dir", "json", "loglevel", "name", "output-dir"],
88
"plugin": "@salesforce/plugin-templates"
99
},
1010
{
11-
"alias": ["force:lightning:app:create"],
12-
"command": "lightning:generate:app",
11+
"alias": ["force:apex:class:create", "apex:generate:class"],
12+
"command": "template:generate:apex:class",
13+
"flagAliases": ["apiversion", "classname", "outputdir"],
14+
"flagChars": ["d", "n", "t"],
15+
"flags": ["api-version", "flags-dir", "json", "loglevel", "name", "output-dir", "template"],
16+
"plugin": "@salesforce/plugin-templates"
17+
},
18+
{
19+
"alias": ["force:apex:trigger:create", "apex:generate:trigger"],
20+
"command": "template:generate:apex:trigger",
21+
"flagAliases": ["apiversion", "outputdir", "triggerevents", "triggername"],
22+
"flagChars": ["d", "e", "n", "s", "t"],
23+
"flags": ["api-version", "event", "flags-dir", "json", "loglevel", "name", "output-dir", "sobject", "template"],
24+
"plugin": "@salesforce/plugin-templates"
25+
},
26+
{
27+
"alias": [],
28+
"command": "template:generate:digital-experience:site",
29+
"flagAliases": [],
30+
"flagChars": ["d", "e", "n", "o", "p", "t"],
31+
"flags": ["admin-email", "flags-dir", "json", "name", "output-dir", "target-org", "template", "url-path-prefix"],
32+
"plugin": "@salesforce/plugin-templates"
33+
},
34+
{
35+
"alias": ["force:lightning:app:create", "lightning:generate:app"],
36+
"command": "template:generate:lightning:app",
1337
"flagAliases": ["apiversion", "appname", "outputdir"],
1438
"flagChars": ["d", "i", "n", "t"],
1539
"flags": ["api-version", "flags-dir", "internal", "json", "loglevel", "name", "output-dir", "template"],
1640
"plugin": "@salesforce/plugin-templates"
1741
},
1842
{
19-
"alias": ["force:lightning:component:create"],
20-
"command": "lightning:generate:component",
43+
"alias": ["force:lightning:component:create", "lightning:generate:component"],
44+
"command": "template:generate:lightning:component",
2145
"flagAliases": ["apiversion", "componentname", "outputdir"],
2246
"flagChars": ["d", "i", "n", "t"],
2347
"flags": ["api-version", "flags-dir", "internal", "json", "loglevel", "name", "output-dir", "template", "type"],
2448
"plugin": "@salesforce/plugin-templates"
2549
},
2650
{
27-
"alias": ["force:lightning:event:create"],
28-
"command": "lightning:generate:event",
51+
"alias": ["force:lightning:event:create", "lightning:generate:event"],
52+
"command": "template:generate:lightning:event",
2953
"flagAliases": ["apiversion", "eventname", "outputdir"],
3054
"flagChars": ["d", "i", "n", "t"],
3155
"flags": ["api-version", "flags-dir", "internal", "json", "loglevel", "name", "output-dir", "template"],
3256
"plugin": "@salesforce/plugin-templates"
3357
},
3458
{
35-
"alias": ["force:lightning:interface:create"],
36-
"command": "lightning:generate:interface",
59+
"alias": ["force:lightning:interface:create", "lightning:generate:interface"],
60+
"command": "template:generate:lightning:interface",
3761
"flagAliases": ["apiversion", "interfacename", "outputdir"],
3862
"flagChars": ["d", "i", "n", "t"],
3963
"flags": ["api-version", "flags-dir", "internal", "json", "loglevel", "name", "output-dir", "template"],
4064
"plugin": "@salesforce/plugin-templates"
4165
},
4266
{
43-
"alias": ["force:lightning:test:create"],
44-
"command": "lightning:generate:test",
67+
"alias": ["force:lightning:test:create", "lightning:generate:test"],
68+
"command": "template:generate:lightning:test",
4569
"flagAliases": ["apiversion", "outputdir", "testname"],
4670
"flagChars": ["d", "i", "n", "t"],
4771
"flags": ["api-version", "flags-dir", "internal", "json", "loglevel", "name", "output-dir", "template"],
4872
"plugin": "@salesforce/plugin-templates"
4973
},
5074
{
51-
"alias": ["force:project:create"],
52-
"command": "project:generate",
75+
"alias": ["force:project:create", "project:generate"],
76+
"command": "template:generate:project",
5377
"flagAliases": ["defaultpackagedir", "loginurl", "outputdir", "projectname"],
5478
"flagChars": ["d", "l", "n", "p", "s", "t", "x"],
5579
"flags": [
@@ -68,56 +92,32 @@
6892
"plugin": "@salesforce/plugin-templates"
6993
},
7094
{
71-
"alias": ["force:staticresource:create"],
72-
"command": "static-resource:generate",
95+
"alias": ["force:staticresource:create", "static-resource:generate"],
96+
"command": "template:generate:static-resource",
7397
"flagAliases": ["apiversion", "contenttype", "outputdir", "resourcename"],
7498
"flagChars": ["d", "n"],
7599
"flags": ["api-version", "flags-dir", "json", "loglevel", "name", "output-dir", "type"],
76100
"plugin": "@salesforce/plugin-templates"
77101
},
78102
{
79-
"alias": ["force:apex:class:create", "apex:generate:class"],
80-
"command": "template:generate:apex:class",
81-
"flagAliases": ["apiversion", "classname", "outputdir"],
82-
"flagChars": ["d", "n", "t"],
83-
"flags": ["api-version", "flags-dir", "json", "loglevel", "name", "output-dir", "template"],
84-
"plugin": "@salesforce/plugin-templates"
85-
},
86-
{
87-
"alias": ["force:apex:trigger:create", "apex:generate:trigger"],
88-
"command": "template:generate:apex:trigger",
89-
"flagAliases": ["apiversion", "outputdir", "triggerevents", "triggername"],
90-
"flagChars": ["d", "e", "n", "s", "t"],
91-
"flags": ["api-version", "event", "flags-dir", "json", "loglevel", "name", "output-dir", "sobject", "template"],
92-
"plugin": "@salesforce/plugin-templates"
93-
},
94-
{
95-
"alias": [],
96-
"command": "template:generate:digital-experience:site",
97-
"flagAliases": [],
98-
"flagChars": ["d", "n", "p", "e", "o", "t"],
99-
"flags": ["flags-dir", "json", "name", "output-dir", "url-path-prefix", "admin-email", "target-org", "template"],
100-
"plugin": "@salesforce/plugin-templates"
101-
},
102-
{
103-
"alias": ["force:visualforce:component:create"],
104-
"command": "visualforce:generate:component",
103+
"alias": ["force:visualforce:component:create", "visualforce:generate:component"],
104+
"command": "template:generate:visualforce:component",
105105
"flagAliases": ["apiversion", "componentname", "outputdir"],
106106
"flagChars": ["d", "l", "n", "t"],
107107
"flags": ["api-version", "flags-dir", "json", "label", "loglevel", "name", "output-dir", "template"],
108108
"plugin": "@salesforce/plugin-templates"
109109
},
110110
{
111-
"alias": ["force:visualforce:page:create"],
112-
"command": "visualforce:generate:page",
111+
"alias": ["force:visualforce:page:create", "visualforce:generate:page"],
112+
"command": "template:generate:visualforce:page",
113113
"flagAliases": ["apiversion", "outputdir", "pagename"],
114114
"flagChars": ["d", "l", "n", "t"],
115115
"flags": ["api-version", "flags-dir", "json", "label", "loglevel", "name", "output-dir", "template"],
116116
"plugin": "@salesforce/plugin-templates"
117117
},
118118
{
119-
"alias": [],
120-
"command": "webapp:generate",
119+
"alias": ["webapp:generate"],
120+
"command": "template:generate:webapp",
121121
"flagAliases": [],
122122
"flagChars": ["d", "l", "n", "t"],
123123
"flags": ["api-version", "flags-dir", "json", "label", "name", "output-dir", "template"],

package.json

Lines changed: 18 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -52,49 +52,35 @@
5252
"@salesforce/plugin-settings"
5353
],
5454
"topics": {
55-
"analytics": {
56-
"external": true,
57-
"description": "Work with analytics assets.",
58-
"subtopics": {
59-
"generate": {
60-
"description": "Create analytics templates."
61-
}
62-
}
63-
},
64-
"lightning": {
65-
"description": "Work with Lightning Web and Aura components.",
66-
"external": true,
67-
"subtopics": {
68-
"generate": {
69-
"description": "Create LWC and Aura components and associated metadata."
70-
}
71-
}
72-
},
73-
"project": {
74-
"description": "Work with projects, such as deploy and retrieve metadata."
75-
},
76-
"visualforce": {
77-
"description": "Work with Visualforce components.",
78-
"subtopics": {
79-
"generate": {
80-
"description": "Create a Visualforce page or component."
81-
}
82-
}
83-
},
84-
"static-resource": {
85-
"description": "Work with static resources."
86-
},
8755
"template": {
8856
"description": "Collection of Salesforce templates.",
8957
"subtopics": {
9058
"generate": {
9159
"description": "Use a Salesforce template to generate local files.",
9260
"subtopics": {
61+
"analytics": {
62+
"description": "Create analytics templates."
63+
},
9364
"apex": {
9465
"description": "Create an apex class or trigger."
9566
},
9667
"digital-experience": {
9768
"description": "Create a Digital Experience site."
69+
},
70+
"lightning": {
71+
"description": "Create LWC and Aura components and associated metadata."
72+
},
73+
"project": {
74+
"description": "Work with projects, such as deploy and retrieve metadata."
75+
},
76+
"static-resource": {
77+
"description": "Work with static resources."
78+
},
79+
"visualforce": {
80+
"description": "Create a visualforce page or component."
81+
},
82+
"webapp": {
83+
"description": "Create a web application."
9884
}
9985
}
10086
}

src/commands/analytics/generate/template.ts renamed to src/commands/template/generate/analytics/template.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@
88
import { Flags, loglevel, orgApiVersionFlagWithDeprecations, SfCommand, Ux } from '@salesforce/sf-plugins-core';
99
import { Messages } from '@salesforce/core';
1010
import { AnalyticsTemplateOptions, CreateOutput, TemplateType } from '@salesforce/templates';
11-
import { getCustomTemplates, runGenerator } from '../../../utils/templateCommand.js';
12-
import { outputDirFlag } from '../../../utils/flags.js';
11+
import { getCustomTemplates, runGenerator } from '../../../../utils/templateCommand.js';
12+
import { outputDirFlag } from '../../../../utils/flags.js';
1313

1414
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
1515
const messages = Messages.loadMessages('@salesforce/plugin-templates', 'analyticsTemplate');
1616
export default class AnalyticsTemplate extends SfCommand<CreateOutput> {
1717
public static readonly examples = messages.getMessages('examples');
1818
public static readonly summary = messages.getMessage('summary');
1919
public static readonly description = messages.getMessage('description');
20-
public static readonly aliases = ['force:analytics:template:create'];
20+
public static readonly aliases = ['force:analytics:template:create', 'analytics generate template'];
2121
public static readonly deprecateAliases = true;
2222
public static readonly flags = {
2323
'output-dir': outputDirFlag,

src/commands/lightning/generate/app.ts renamed to src/commands/template/generate/lightning/app.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import { Flags, loglevel, orgApiVersionFlagWithDeprecations, SfCommand, Ux } fro
99
import { CreateOutput, LightningAppOptions, TemplateType } from '@salesforce/templates';
1010
import { CreateUtil } from '@salesforce/templates/lib/utils/index.js';
1111
import { Messages } from '@salesforce/core';
12-
import { getCustomTemplates, runGenerator } from '../../../utils/templateCommand.js';
13-
import { internalFlag, outputDirFlagLightning } from '../../../utils/flags.js';
12+
import { getCustomTemplates, runGenerator } from '../../../../utils/templateCommand.js';
13+
import { internalFlag, outputDirFlagLightning } from '../../../../utils/flags.js';
1414

1515
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
1616
const lightningCommonMessages = Messages.loadMessages('@salesforce/plugin-templates', 'lightning');
@@ -22,7 +22,7 @@ export default class LightningApp extends SfCommand<CreateOutput> {
2222
public static readonly summary = lightningCommonMessages.getMessage('summary', [BUNDLE_TYPE]);
2323
public static readonly description = lightningCommonMessages.getMessage('description', [BUNDLE_TYPE]);
2424
public static readonly examples = lightningAppMessages.getMessages('examples');
25-
public static readonly aliases = ['force:lightning:app:create'];
25+
public static readonly aliases = ['force:lightning:app:create', 'lightning:generate:app'];
2626
public static readonly deprecateAliases = true;
2727
public static readonly flags = {
2828
name: Flags.string({

src/commands/lightning/generate/component.ts renamed to src/commands/template/generate/lightning/component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
import { Flags, loglevel, orgApiVersionFlagWithDeprecations, SfCommand, Ux } from '@salesforce/sf-plugins-core';
1111
import { CreateOutput, LightningComponentOptions, TemplateType } from '@salesforce/templates';
1212
import { Messages } from '@salesforce/core';
13-
import { getCustomTemplates, runGenerator } from '../../../utils/templateCommand.js';
14-
import { internalFlag, outputDirFlagLightning } from '../../../utils/flags.js';
13+
import { getCustomTemplates, runGenerator } from '../../../../utils/templateCommand.js';
14+
import { internalFlag, outputDirFlagLightning } from '../../../../utils/flags.js';
1515
const BUNDLE_TYPE = 'Component';
1616

1717
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
@@ -21,7 +21,7 @@ export default class LightningComponent extends SfCommand<CreateOutput> {
2121
public static readonly summary = messages.getMessage('summary');
2222
public static readonly description = messages.getMessage('description');
2323
public static readonly examples = messages.getMessages('examples');
24-
public static readonly aliases = ['force:lightning:component:create'];
24+
public static readonly aliases = ['force:lightning:component:create', 'lightning:generate:component'];
2525
public static readonly deprecateAliases = true;
2626
public static readonly flags = {
2727
name: Flags.string({

src/commands/lightning/generate/event.ts renamed to src/commands/template/generate/lightning/event.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import { Flags, loglevel, orgApiVersionFlagWithDeprecations, SfCommand, Ux } fro
99
import { CreateOutput, LightningEventOptions, TemplateType } from '@salesforce/templates';
1010
import { CreateUtil } from '@salesforce/templates/lib/utils/index.js';
1111
import { Messages } from '@salesforce/core';
12-
import { getCustomTemplates, runGenerator } from '../../../utils/templateCommand.js';
13-
import { internalFlag, outputDirFlagLightning } from '../../../utils/flags.js';
12+
import { getCustomTemplates, runGenerator } from '../../../../utils/templateCommand.js';
13+
import { internalFlag, outputDirFlagLightning } from '../../../../utils/flags.js';
1414
const lightningEventFileSuffix = /.evt$/;
1515
const BUNDLE_TYPE = 'Event';
1616

@@ -23,7 +23,7 @@ export default class LightningEvent extends SfCommand<CreateOutput> {
2323
public static readonly summary = lightningCommon.getMessage('summary', [BUNDLE_TYPE]);
2424
public static readonly description = lightningCommon.getMessage('description', [BUNDLE_TYPE]);
2525
public static readonly examples = messages.getMessages('examples');
26-
public static readonly aliases = ['force:lightning:event:create'];
26+
public static readonly aliases = ['force:lightning:event:create', 'lightning:generate:event'];
2727
public static readonly deprecateAliases = true;
2828
public static readonly flags = {
2929
name: Flags.string({

src/commands/lightning/generate/interface.ts renamed to src/commands/template/generate/lightning/interface.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import { Flags, loglevel, orgApiVersionFlagWithDeprecations, SfCommand, Ux } fro
99
import { CreateOutput, LightningInterfaceOptions, TemplateType } from '@salesforce/templates';
1010
import { CreateUtil } from '@salesforce/templates/lib/utils/index.js';
1111
import { Messages } from '@salesforce/core';
12-
import { getCustomTemplates, runGenerator } from '../../../utils/templateCommand.js';
13-
import { internalFlag, outputDirFlagLightning } from '../../../utils/flags.js';
12+
import { getCustomTemplates, runGenerator } from '../../../../utils/templateCommand.js';
13+
import { internalFlag, outputDirFlagLightning } from '../../../../utils/flags.js';
1414
const lightningInterfaceFileSuffix = /.intf$/;
1515
const BUNDLE_TYPE = 'Interface';
1616

@@ -22,7 +22,7 @@ export default class LightningInterface extends SfCommand<CreateOutput> {
2222
public static readonly summary = lightningCommon.getMessage('summary', [BUNDLE_TYPE]);
2323
public static readonly description = lightningCommon.getMessage('description', [BUNDLE_TYPE]);
2424
public static readonly examples = messages.getMessages('examples');
25-
public static readonly aliases = ['force:lightning:interface:create'];
25+
public static readonly aliases = ['force:lightning:interface:create', 'lightning:generate:interface'];
2626
public static readonly deprecateAliases = true;
2727
public static readonly flags = {
2828
name: Flags.string({

src/commands/lightning/generate/test.ts renamed to src/commands/template/generate/lightning/test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import { Flags, loglevel, SfCommand, orgApiVersionFlagWithDeprecations, Ux } fro
99
import { CreateOutput, LightningTestOptions, TemplateType } from '@salesforce/templates';
1010
import { CreateUtil } from '@salesforce/templates/lib/utils/index.js';
1111
import { Messages } from '@salesforce/core';
12-
import { getCustomTemplates, runGenerator } from '../../../utils/templateCommand.js';
13-
import { internalFlag, outputDirFlagLightning } from '../../../utils/flags.js';
12+
import { getCustomTemplates, runGenerator } from '../../../../utils/templateCommand.js';
13+
import { internalFlag, outputDirFlagLightning } from '../../../../utils/flags.js';
1414
const lightningTestFileSuffix = /.resource$/;
1515

1616
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
@@ -20,7 +20,7 @@ export default class LightningTest extends SfCommand<CreateOutput> {
2020
public static readonly summary = messages.getMessage('summary');
2121
public static readonly description = messages.getMessage('description');
2222
public static readonly examples = messages.getMessages('examples');
23-
public static readonly aliases = ['force:lightning:test:create'];
23+
public static readonly aliases = ['force:lightning:test:create', 'lightning:generate:test'];
2424
public static readonly deprecateAliases = true;
2525
public static readonly flags = {
2626
name: Flags.string({

src/commands/project/generate.ts renamed to src/commands/template/generate/project/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@
88
import { Flags, loglevel, SfCommand, Ux } from '@salesforce/sf-plugins-core';
99
import { CreateOutput, ProjectOptions, TemplateType } from '@salesforce/templates';
1010
import { Messages } from '@salesforce/core';
11-
import { getCustomTemplates, runGenerator } from '../../utils/templateCommand.js';
12-
import { outputDirFlag } from '../../utils/flags.js';
11+
import { getCustomTemplates, runGenerator } from '../../../../utils/templateCommand.js';
12+
import { outputDirFlag } from '../../../../utils/flags.js';
1313

1414
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
1515
const messages = Messages.loadMessages('@salesforce/plugin-templates', 'project');
1616
export default class Project extends SfCommand<CreateOutput> {
1717
public static readonly summary = messages.getMessage('summary');
1818
public static readonly description = messages.getMessage('description');
1919
public static readonly examples = messages.getMessages('examples');
20-
public static readonly aliases = ['force:project:create'];
20+
public static readonly aliases = ['force:project:create', 'project:generate'];
2121
public static readonly deprecateAliases = true;
2222
public static readonly flags = {
2323
name: Flags.string({

src/commands/static-resource/generate.ts renamed to src/commands/template/generate/static-resource/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@
88
import { Flags, loglevel, orgApiVersionFlagWithDeprecations, SfCommand, Ux } from '@salesforce/sf-plugins-core';
99
import { CreateOutput, StaticResourceOptions, TemplateType } from '@salesforce/templates';
1010
import { Messages } from '@salesforce/core';
11-
import { outputDirFlag } from '../../utils/flags.js';
12-
import { getCustomTemplates, runGenerator } from '../../utils/templateCommand.js';
11+
import { outputDirFlag } from '../../../../utils/flags.js';
12+
import { getCustomTemplates, runGenerator } from '../../../../utils/templateCommand.js';
1313

1414
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
1515
const messages = Messages.loadMessages('@salesforce/plugin-templates', 'staticResource');
1616
export default class StaticResource extends SfCommand<CreateOutput> {
1717
public static readonly summary = messages.getMessage('summary');
1818
public static readonly description = messages.getMessage('description');
1919
public static readonly examples = messages.getMessages('examples');
20-
public static readonly aliases = ['force:staticresource:create'];
20+
public static readonly aliases = ['force:staticresource:create', 'static-resource:generate'];
2121
public static readonly deprecateAliases = true;
2222
public static readonly flags = {
2323
name: Flags.string({

0 commit comments

Comments
 (0)