@salesforce/plugin-templates 55.3.1 → 55.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/LICENSE.txt +1 -1
  2. package/lib/commands/analytics/generate/template.d.ts +16 -0
  3. package/lib/commands/analytics/generate/template.js +53 -0
  4. package/lib/commands/analytics/generate/template.js.map +1 -0
  5. package/lib/commands/apex/generate/class.d.ts +17 -0
  6. package/lib/commands/apex/generate/class.js +65 -0
  7. package/lib/commands/apex/generate/class.js.map +1 -0
  8. package/lib/commands/apex/generate/trigger.d.ts +19 -0
  9. package/lib/commands/apex/generate/trigger.js +86 -0
  10. package/lib/commands/apex/generate/trigger.js.map +1 -0
  11. package/lib/commands/lightning/generate/app.d.ts +18 -0
  12. package/lib/commands/lightning/generate/app.js +68 -0
  13. package/lib/commands/lightning/generate/app.js.map +1 -0
  14. package/lib/commands/lightning/generate/component.d.ts +19 -0
  15. package/lib/commands/lightning/generate/component.js +75 -0
  16. package/lib/commands/lightning/generate/component.js.map +1 -0
  17. package/lib/commands/lightning/generate/event.d.ts +18 -0
  18. package/lib/commands/lightning/generate/event.js +68 -0
  19. package/lib/commands/lightning/generate/event.js.map +1 -0
  20. package/lib/commands/lightning/generate/interface.d.ts +18 -0
  21. package/lib/commands/lightning/generate/interface.js +68 -0
  22. package/lib/commands/lightning/generate/interface.js.map +1 -0
  23. package/lib/commands/lightning/generate/test.d.ts +18 -0
  24. package/lib/commands/lightning/generate/test.js +68 -0
  25. package/lib/commands/lightning/generate/test.js.map +1 -0
  26. package/lib/commands/project/generate.d.ts +20 -0
  27. package/lib/commands/project/generate.js +93 -0
  28. package/lib/commands/project/generate.js.map +1 -0
  29. package/lib/commands/static-resource/generate.d.ts +17 -0
  30. package/lib/commands/static-resource/generate.js +64 -0
  31. package/lib/commands/static-resource/generate.js.map +1 -0
  32. package/lib/commands/visualforce/generate/component.d.ts +18 -0
  33. package/lib/commands/visualforce/generate/component.js +73 -0
  34. package/lib/commands/visualforce/generate/component.js.map +1 -0
  35. package/lib/commands/visualforce/generate/page.d.ts +18 -0
  36. package/lib/commands/visualforce/generate/page.js +75 -0
  37. package/lib/commands/visualforce/generate/page.js.map +1 -0
  38. package/lib/utils/flags.d.ts +3 -0
  39. package/lib/utils/flags.js +36 -0
  40. package/lib/utils/flags.js.map +1 -0
  41. package/lib/utils/templateCommand.d.ts +58 -14
  42. package/lib/utils/templateCommand.js +42 -82
  43. package/lib/utils/templateCommand.js.map +1 -1
  44. package/messages/analyticsTemplate.md +17 -0
  45. package/messages/apexClass.md +25 -0
  46. package/messages/apexTrigger.md +40 -0
  47. package/messages/lightning.md +27 -0
  48. package/messages/lightningApp.md +9 -0
  49. package/messages/lightningCmp.md +31 -0
  50. package/messages/lightningEvent.md +9 -0
  51. package/messages/lightningInterface.md +9 -0
  52. package/messages/lightningTest.md +21 -0
  53. package/messages/messages.md +43 -0
  54. package/messages/project.md +87 -0
  55. package/messages/staticResource.md +37 -0
  56. package/messages/vf.md +39 -0
  57. package/oclif.manifest.json +1190 -1
  58. package/package.json +174 -96
  59. package/lib/commands/force/analytics/template/create.d.ts +0 -15
  60. package/lib/commands/force/analytics/template/create.js +0 -42
  61. package/lib/commands/force/analytics/template/create.js.map +0 -1
  62. package/lib/commands/force/apex/class/create.d.ts +0 -16
  63. package/lib/commands/force/apex/class/create.js +0 -52
  64. package/lib/commands/force/apex/class/create.js.map +0 -1
  65. package/lib/commands/force/apex/trigger/create.d.ts +0 -18
  66. package/lib/commands/force/apex/trigger/create.js +0 -74
  67. package/lib/commands/force/apex/trigger/create.js.map +0 -1
  68. package/lib/commands/force/lightning/app/create.d.ts +0 -17
  69. package/lib/commands/force/lightning/app/create.js +0 -58
  70. package/lib/commands/force/lightning/app/create.js.map +0 -1
  71. package/lib/commands/force/lightning/component/create.d.ts +0 -18
  72. package/lib/commands/force/lightning/component/create.js +0 -67
  73. package/lib/commands/force/lightning/component/create.js.map +0 -1
  74. package/lib/commands/force/lightning/event/create.d.ts +0 -17
  75. package/lib/commands/force/lightning/event/create.js +0 -58
  76. package/lib/commands/force/lightning/event/create.js.map +0 -1
  77. package/lib/commands/force/lightning/interface/create.d.ts +0 -17
  78. package/lib/commands/force/lightning/interface/create.js +0 -58
  79. package/lib/commands/force/lightning/interface/create.js.map +0 -1
  80. package/lib/commands/force/lightning/test/create.d.ts +0 -16
  81. package/lib/commands/force/lightning/test/create.js +0 -56
  82. package/lib/commands/force/lightning/test/create.js.map +0 -1
  83. package/lib/commands/force/project/create.d.ts +0 -19
  84. package/lib/commands/force/project/create.js +0 -78
  85. package/lib/commands/force/project/create.js.map +0 -1
  86. package/lib/commands/force/staticresource/create.d.ts +0 -16
  87. package/lib/commands/force/staticresource/create.js +0 -49
  88. package/lib/commands/force/staticresource/create.js.map +0 -1
  89. package/lib/commands/force/visualforce/component/create.d.ts +0 -17
  90. package/lib/commands/force/visualforce/component/create.js +0 -59
  91. package/lib/commands/force/visualforce/component/create.js.map +0 -1
  92. package/lib/commands/force/visualforce/page/create.d.ts +0 -17
  93. package/lib/commands/force/visualforce/page/create.js +0 -59
  94. package/lib/commands/force/visualforce/page/create.js.map +0 -1
  95. package/lib/utils/index.d.ts +0 -2
  96. package/lib/utils/index.js +0 -14
  97. package/lib/utils/index.js.map +0 -1
  98. package/lib/utils/messageUtil.d.ts +0 -33
  99. package/lib/utils/messageUtil.js +0 -59
  100. package/lib/utils/messageUtil.js.map +0 -1
  101. package/messages/messages.json +0 -87
  102. package/yarn.lock +0 -9362
@@ -1,15 +1,59 @@
1
- import { SfdxCommand } from '@salesforce/command';
1
+ import { Ux } from '@salesforce/sf-plugins-core';
2
+ import { ConfigAggregator } from '@salesforce/core';
3
+ import { CreateOutput } from '@salesforce/templates';
2
4
  import { ForceGeneratorAdapter } from '@salesforce/templates/lib/utils';
3
- import { CreateOutput } from '@salesforce/templates/lib/utils/types';
4
- import { AnyJson } from '@salesforce/ts-types';
5
- import * as yeomanGenerator from 'yeoman-generator';
6
- export declare abstract class TemplateCommand extends SfdxCommand {
7
- private static aggregator?;
8
- static buildJson(adapter: ForceGeneratorAdapter, targetDir: string): CreateOutput;
9
- static getDefaultApiVersion(): string;
10
- static getApiVersion(): Promise<string>;
11
- static getCustomTemplates(): Promise<string | undefined>;
12
- private static getConfigAggregator;
13
- runGenerator(generator: yeomanGenerator.GeneratorConstructor): Promise<{}>;
14
- abstract run(): Promise<AnyJson>;
15
- }
5
+ import VisualforceComponentGenerator from '@salesforce/templates/lib/generators/visualforceComponentGenerator';
6
+ import VisualforcePageGenerator from '@salesforce/templates/lib/generators/visualforcePageGenerator';
7
+ import ApexClassGenerator from '@salesforce/templates/lib/generators/apexClassGenerator';
8
+ import LightningTestGenerator from '@salesforce/templates/lib/generators/lightningTestGenerator';
9
+ import StaticResourceGenerator from '@salesforce/templates/lib/generators/staticResourceGenerator';
10
+ import ProjectGenerator from '@salesforce/templates/lib/generators/projectGenerator';
11
+ import LightningInterfaceGenerator from '@salesforce/templates/lib/generators/lightningInterfaceGenerator';
12
+ import LightningAppGenerator from '@salesforce/templates/lib/generators/lightningAppGenerator';
13
+ import LightningEventGenerator from '@salesforce/templates/lib/generators/lightningEventGenerator';
14
+ import AnalyticsTemplateGenerator from '@salesforce/templates/lib/generators/analyticsTemplateGenerator';
15
+ import LightningComponentGenerator from '@salesforce/templates/lib/generators/lightningComponentGenerator';
16
+ import ApexTriggerGenerator from '@salesforce/templates/lib/generators/apexTriggerGenerator';
17
+ export type generatorInputs = {
18
+ ux: Ux;
19
+ templates?: string;
20
+ } & ({
21
+ generator: typeof VisualforcePageGenerator;
22
+ opts: typeof VisualforcePageGenerator.prototype.options;
23
+ } | {
24
+ generator: typeof ApexClassGenerator;
25
+ opts: typeof ApexClassGenerator.prototype.options;
26
+ } | {
27
+ generator: typeof ApexTriggerGenerator;
28
+ opts: typeof ApexTriggerGenerator.prototype.options;
29
+ } | {
30
+ generator: typeof VisualforceComponentGenerator;
31
+ opts: typeof VisualforceComponentGenerator.prototype.options;
32
+ } | {
33
+ generator: typeof LightningTestGenerator;
34
+ opts: typeof LightningTestGenerator.prototype.options;
35
+ } | {
36
+ generator: typeof StaticResourceGenerator;
37
+ opts: typeof StaticResourceGenerator.prototype.options;
38
+ } | {
39
+ generator: typeof ProjectGenerator;
40
+ opts: typeof ProjectGenerator.prototype.options;
41
+ } | {
42
+ generator: typeof LightningInterfaceGenerator;
43
+ opts: typeof LightningInterfaceGenerator.prototype.options;
44
+ } | {
45
+ generator: typeof LightningAppGenerator;
46
+ opts: typeof LightningAppGenerator.prototype.options;
47
+ } | {
48
+ generator: typeof LightningEventGenerator;
49
+ opts: typeof LightningEventGenerator.prototype.options;
50
+ } | {
51
+ generator: typeof AnalyticsTemplateGenerator;
52
+ opts: typeof AnalyticsTemplateGenerator.prototype.options;
53
+ } | {
54
+ generator: typeof LightningComponentGenerator;
55
+ opts: typeof LightningComponentGenerator.prototype.options;
56
+ });
57
+ export declare function runGenerator({ ux, templates, generator, opts }: generatorInputs): Promise<CreateOutput>;
58
+ export declare const getCustomTemplates: (configAggregator: ConfigAggregator) => string | undefined;
59
+ export declare const buildJson: (adapter: ForceGeneratorAdapter, targetDir: string) => CreateOutput;
@@ -6,94 +6,54 @@
6
6
  * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
7
7
  */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.TemplateCommand = void 0;
9
+ exports.buildJson = exports.getCustomTemplates = exports.runGenerator = void 0;
10
10
  const tslib_1 = require("tslib");
11
11
  const path = require("path");
12
- const command_1 = require("@salesforce/command");
13
12
  const core_1 = require("@salesforce/core");
14
13
  const templates_1 = require("@salesforce/templates");
15
14
  const utils_1 = require("@salesforce/templates/lib/utils");
16
15
  const yeoman = require("yeoman-environment");
17
- const messageUtil_1 = require("./messageUtil");
18
- class TemplateCommand extends command_1.SfdxCommand {
19
- static buildJson(adapter, targetDir) {
20
- const cleanOutput = adapter.log.getCleanOutput();
21
- const rawOutput = `target dir = ${targetDir}\n${adapter.log.getOutput()}`;
22
- const output = {
23
- outputDir: targetDir,
24
- created: cleanOutput,
25
- rawOutput,
26
- };
27
- return output;
28
- }
29
- static getDefaultApiVersion() {
30
- const packageJsonPath = path.join('..', '..', 'package.json');
31
- // eslint-disable-next-line
32
- const versionTrimmed = require(packageJsonPath).version.trim();
33
- return `${versionTrimmed.split('.')[0]}.0`;
34
- }
35
- static getApiVersion() {
36
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
37
- try {
38
- const aggregator = yield TemplateCommand.getConfigAggregator();
39
- const apiVersionFromConfig = aggregator.getPropertyValue(core_1.SfdxPropertyKeys.API_VERSION);
40
- return apiVersionFromConfig || TemplateCommand.getDefaultApiVersion();
41
- }
42
- catch (err) {
43
- return TemplateCommand.getDefaultApiVersion();
44
- }
45
- });
46
- }
47
- static getCustomTemplates() {
48
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
49
- try {
50
- const aggregator = yield TemplateCommand.getConfigAggregator();
51
- // we're still accessing the old `customOrgMetadataTemplates` key, but this is deprecated and we'll use the new key to access the value
52
- const customTemplatesFromConfig = aggregator.getPropertyValue(core_1.OrgConfigProperties.ORG_CUSTOM_METADATA_TEMPLATES);
53
- return customTemplatesFromConfig;
54
- }
55
- catch (err) {
56
- return undefined;
57
- }
58
- });
59
- }
60
- static getConfigAggregator() {
61
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
62
- if (!TemplateCommand.aggregator) {
63
- TemplateCommand.aggregator = yield core_1.ConfigAggregator.create();
64
- }
65
- return TemplateCommand.aggregator;
66
- });
16
+ core_1.Messages.importMessagesDirectory(__dirname);
17
+ const messages = core_1.Messages.loadMessages('@salesforce/plugin-templates', 'messages');
18
+ function runGenerator({ ux, templates, generator, opts }) {
19
+ var _a;
20
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
21
+ if (templates) {
22
+ yield templates_1.TemplateService.getInstance().setCustomTemplatesRootPathOrGitRepo(templates);
23
+ }
24
+ const adapter = new utils_1.ForceGeneratorAdapter();
25
+ // @ts-expect-error the adapter doesn't fully implement the yeoman adapter interface
26
+ const env = yeoman.createEnv(undefined, undefined, adapter);
27
+ env.registerStub(generator, 'generator');
28
+ yield env.run('generator', opts);
29
+ const targetDir = path.resolve((_a = opts.outputdir) !== null && _a !== void 0 ? _a : '.');
30
+ ux.log(messages.getMessage('TargetDirOutput', [targetDir]));
31
+ ux.log(adapter.log.getOutput());
32
+ return (0, exports.buildJson)(adapter, targetDir);
33
+ });
34
+ }
35
+ exports.runGenerator = runGenerator;
36
+ const getCustomTemplates = (configAggregator) => {
37
+ try {
38
+ // we're still accessing the old `customOrgMetadataTemplates` key, but this is deprecated and we'll use the new key to access the value
39
+ const customTemplatesFromConfig = configAggregator.getPropertyValue(core_1.OrgConfigProperties.ORG_CUSTOM_METADATA_TEMPLATES);
40
+ return customTemplatesFromConfig;
67
41
  }
68
- // eslint-disable-next-line
69
- runGenerator(generator) {
70
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
71
- // Can't specify a default value the normal way for apiversion, so set it here
72
- if (!this.flags.apiversion) {
73
- this.flags.apiversion = yield TemplateCommand.getApiVersion();
74
- }
75
- const customTemplates = yield TemplateCommand.getCustomTemplates();
76
- if (customTemplates) {
77
- yield templates_1.TemplateService.getInstance().setCustomTemplatesRootPathOrGitRepo(customTemplates);
78
- }
79
- const adapter = new utils_1.ForceGeneratorAdapter();
80
- // @ts-ignore
81
- const env = yeoman.createEnv(undefined, undefined, adapter);
82
- env.registerStub(generator, 'generator');
83
- // @ts-ignore env.run should have a callback param. This should all go away if switched to lib implementation
84
- const result = yield env.run('generator', this.flags);
85
- // eslint-disable-next-line
86
- const targetDir = path.resolve(this.flags.outputdir);
87
- if (this.flags.json) {
88
- return TemplateCommand.buildJson(adapter, targetDir);
89
- }
90
- else {
91
- this.log(messageUtil_1.MessageUtil.get('TargetDirOutput', [targetDir]));
92
- this.log(adapter.log.getOutput());
93
- return {};
94
- }
95
- });
42
+ catch (err) {
43
+ return undefined;
96
44
  }
97
- }
98
- exports.TemplateCommand = TemplateCommand;
45
+ };
46
+ exports.getCustomTemplates = getCustomTemplates;
47
+ // exported for test
48
+ const buildJson = (adapter, targetDir) => {
49
+ const cleanOutput = adapter.log.getCleanOutput();
50
+ const rawOutput = `target dir = ${targetDir}\n${adapter.log.getOutput()}`;
51
+ const output = {
52
+ outputDir: targetDir,
53
+ created: cleanOutput,
54
+ rawOutput,
55
+ };
56
+ return output;
57
+ };
58
+ exports.buildJson = buildJson;
99
59
  //# sourceMappingURL=templateCommand.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"templateCommand.js","sourceRoot":"","sources":["../../src/utils/templateCommand.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;AAEH,6BAA6B;AAC7B,iDAAkD;AAClD,2CAA2F;AAC3F,qDAAwD;AACxD,2DAAwE;AAGxE,6CAA6C;AAG7C,+CAA4C;AAC5C,MAAsB,eAAgB,SAAQ,qBAAW;IAGhD,MAAM,CAAC,SAAS,CAAC,OAA8B,EAAE,SAAiB;QACvE,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,CAAC;QACjD,MAAM,SAAS,GAAG,gBAAgB,SAAS,KAAK,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,EAAE,CAAC;QAC1E,MAAM,MAAM,GAAG;YACb,SAAS,EAAE,SAAS;YACpB,OAAO,EAAE,WAAW;YACpB,SAAS;SACV,CAAC;QACF,OAAO,MAAM,CAAC;IAChB,CAAC;IAEM,MAAM,CAAC,oBAAoB;QAChC,MAAM,eAAe,GAAW,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;QACtE,2BAA2B;QAC3B,MAAM,cAAc,GAAW,OAAO,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;QACvE,OAAO,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,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AAS,GAAG,gBAAgB,SAAS,KAAK,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,EAAE,CAAC;IAC1E,MAAM,MAAM,GAAG;QACb,SAAS,EAAE,SAAS;QACpB,OAAO,EAAE,WAAW;QACpB,SAAS;KACV,CAAC;IACF,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AATW,QAAA,SAAS,aASpB"}
@@ -0,0 +1,17 @@
1
+ # summary
2
+
3
+ Generate a simple Analytics template.
4
+
5
+ # description
6
+
7
+ The metadata files associated with the Analytics template must be contained in a parent directory called "waveTemplates" in your package directory. Either run this command from an existing directory of this name, or use the --output-dir flag to generate one or point to an existing one.
8
+
9
+ # flags.name.summary
10
+
11
+ Name of the Analytics template.
12
+
13
+ # examples
14
+
15
+ - Generate the metadata files for a simple Analytics template file called myTemplate in the force-app/main/default/waveTemplates directory:
16
+
17
+ <%= config.bin %> <%= command.id %> --name myTemplate --output-dir force-app/main/default/waveTemplates
@@ -0,0 +1,25 @@
1
+ # summary
2
+
3
+ Generate an Apex class.
4
+
5
+ # description
6
+
7
+ Generates the Apex *.cls file and associated metadata file. These files must be contained in a parent directory called "classes" in your package directory. Either run this command from an existing directory of this name, or use the --output-dir flag to generate one or point to an existing one.
8
+
9
+ # flags.name.summary
10
+
11
+ Name of the generated Apex class.
12
+
13
+ # flags.name.description
14
+
15
+ The name can be up to 40 characters and must start with a letter.
16
+
17
+ # examples
18
+
19
+ - Generate two metadata files associated with the MyClass Apex class (MyClass.cls and MyClass.cls-meta.xml) in the current directory:
20
+
21
+ <%= config.bin %> <%= command.id %> --name MyClass
22
+
23
+ - Similar to previous example, but generates the files in the "force-app/main/default/classes" directory:
24
+
25
+ <%= config.bin %> <%= command.id %> --name MyClass --output-dir force-app/main/default/classes
@@ -0,0 +1,40 @@
1
+ # summary
2
+
3
+ Generate an Apex trigger.
4
+
5
+ # description
6
+
7
+ Generates the Apex trigger *.trigger file and associated metadata file. These files must be contained in a parent directory called "triggers" in your package directory. Either run this command from an existing directory of this name, or use the --output-dir flag to generate one or point to an existing one.
8
+
9
+ If you don't specify the --sobject flag, the .trigger file contains the generic placeholder SOBJECT; replace it with the Salesforce object you want to generate a trigger for. If you don't specify --event, "before insert" is used.
10
+
11
+ # flags.event
12
+
13
+ Events that fire the trigger.
14
+
15
+ # flags.name
16
+
17
+ Name of the generated Apex trigger
18
+
19
+ # flags.name.description
20
+
21
+ The name can be up to 40 characters and must start with a letter.
22
+
23
+ # flags.sobject
24
+
25
+ Salesforce object to generate a trigger on.
26
+
27
+ # examples
28
+
29
+ - Generate two files associated with the MyTrigger Apex trigger (MyTrigger.trigger and MyTrigger.trigger-meta.xml) in the current directory:
30
+
31
+ <%= config.bin %> <%= command.id %> --name MyTrigger
32
+
33
+ - Similar to the previous example, but generate the files in the "force-app/main/default/triggers" directory:
34
+
35
+ <%= config.bin %> <%= command.id %> --name MyTrigger --output-dir force-app/main/default/triggers
36
+
37
+ - Generate files for a trigger that fires on the Account object before and after an insert:
38
+
39
+ <%= config.bin %> <%= command.id %> --name MyTrigger --sobject Account --event "before insert,after insert"
40
+
@@ -0,0 +1,27 @@
1
+ # summary
2
+
3
+ Generate a Lightning %s.
4
+
5
+ # description
6
+
7
+ Generates a Lightning %s bundle in the specified directory or the current working directory. The bundle consists of multiple files in a folder with the designated name.
8
+
9
+ # flags.name
10
+
11
+ Name of the generated Lightning %s.
12
+
13
+ # flags.name.description
14
+
15
+ The name can be up to 40 characters and must start with a letter.
16
+
17
+ # flags.internal
18
+
19
+ Generate lightning bundles without creating a -meta.xml file.
20
+
21
+ # flags.template
22
+
23
+ Template to use for file creation.
24
+
25
+ # flags.template.description
26
+
27
+ Supplied parameter values or default values are filled into a copy of the template.
@@ -0,0 +1,9 @@
1
+ # examples
2
+
3
+ - Generate the metadata files for a Lightning app bundle called "myapp" in the current directory:
4
+
5
+ <%= config.bin %> <%= command.id %> --name myapp
6
+
7
+ - Similar to the previous example, but generate the files in the "force-app/main/default/aura" directory:
8
+
9
+ <%= config.bin %> <%= command.id %> --name myapp --output-dir force-app/main/default/aura
@@ -0,0 +1,31 @@
1
+ # examples
2
+
3
+ - Generate the metadata files for an Aura component bundle in the current directory:
4
+
5
+ <%= config.bin %> <%= command.id %> --name mycomponent
6
+
7
+ - Generate a Lightning web component bundle in the current directory:
8
+
9
+ <%= config.bin %> <%= command.id %> --name mycomponent --type lwc
10
+
11
+ - Generate an Aura component bundle in the "force-app/main/default/aura" directory:
12
+
13
+ <%= config.bin %> <%= command.id %> --name mycomponent --output-dir force-app/main/default/aura
14
+
15
+ - Generate a Lightning web component bundle in the "force-app/main/default/lwc" directory:
16
+
17
+ <%= config.bin %> <%= command.id %> --name mycomponent --type lwc --output-dir force-app/main/default/lwc
18
+
19
+ # summary
20
+
21
+ Generate a bundle for an Aura component or a Lightning web component.
22
+
23
+ # description
24
+
25
+ Generates the bundle in the specified directory or the current working directory. The bundle consists of multiple files in a directory with the designated name. Lightning web components are contained in the directory with name "lwc", Aura components in "aura".
26
+
27
+ To generate a Lightning web component, pass "--type lwc" to the command. If you don’t specify --type, Salesforce CLI generates an Aura component by default.
28
+
29
+ # flags.type
30
+
31
+ Type of the component bundle.
@@ -0,0 +1,9 @@
1
+ # examples
2
+
3
+ - Generate the metadata files for a Lightning event bundle called "myevent" in the current directory:
4
+
5
+ <%= config.bin %> <%= command.id %> --name myevent
6
+
7
+ - Similar to previous example, but generate the files in the "force-app/main/default/aura" directory:
8
+
9
+ <%= config.bin %> <%= command.id %> --name myevent --output-dir force-app/main/default/aura
@@ -0,0 +1,9 @@
1
+ # examples
2
+
3
+ - Generate the metadata files for a Lightning interface bundle called "myinterface" in the current directory:
4
+
5
+ <%= config.bin %> <%= command.id %> --name myinterface
6
+
7
+ - Similar to the previous example but generate the files in the "force-app/main/default/aura" directory:
8
+
9
+ <%= config.bin %> <%= command.id %> --name myinterface --output-dir force-app/main/default/aura
@@ -0,0 +1,21 @@
1
+ # examples
2
+
3
+ - Generate the metadata files for the Lightning test called MyLightningTest in the current directory:
4
+
5
+ <%= config.bin %> <%= command.id %> --name MyLightningTest
6
+
7
+ - Similar to the previous example but generate the files in the "force-app/main/default/lightningTests" directory:
8
+
9
+ <%= config.bin %> <%= command.id %> --name MyLightningTest --output-dir force-app/main/default/lightningTests
10
+
11
+ # summary
12
+
13
+ Generate a Lightning test.
14
+
15
+ # description
16
+
17
+ Generates the test in the specified directory or the current working directory. The .resource file and associated metadata file are generated.
18
+
19
+ # flags.name.description
20
+
21
+ Name of the new Lightning test; can be up to 40 characters and must start with a letter.
@@ -0,0 +1,43 @@
1
+ # flags.outputdir
2
+
3
+ Directory for saving the created files.
4
+
5
+ # flags.outputdir.description
6
+
7
+ The location can be an absolute path or relative to the current working directory. The default is the current directory.
8
+
9
+ # flags.outputdirLighting.description
10
+
11
+ If you don’t specify an outputdir, we create a subfolder in your current working directory with the name of your bundle. For example, if the current working directory is force-app and your Lightning bundle is called myBundle, we create force-app/myBundle/ to store the files in the bundle.
12
+
13
+ # flags.template
14
+
15
+ Template to use for file creation.
16
+
17
+ # flags.template.description
18
+
19
+ Supplied parameter values or default values are filled into a copy of the template.
20
+
21
+ # TargetDirOutput
22
+
23
+ target dir = %s
24
+
25
+ # MissingAuraFolder
26
+
27
+ Lightning bundles must have a parent folder named 'aura'.
28
+
29
+ # MissingLightningComponentTemplate
30
+
31
+ Template %s not available for component type %s.
32
+
33
+ # MissingLWCFolder
34
+
35
+ Lightning bundles must have a parent folder named 'lwc'.
36
+
37
+ # InvalidTemplate
38
+
39
+ Expected --template=foo to be one of:
40
+
41
+ # StandardReadMe
42
+
43
+ Now that you’ve created a Salesforce DX project, what’s next?
@@ -0,0 +1,87 @@
1
+ # summary
2
+
3
+ Generate a Salesforce DX project.
4
+
5
+ # description
6
+
7
+ A Salesforce DX project has a specific structure and a configuration file (sfdx-project.json) that identifies the directory as a Salesforce DX project. This command generates the necessary configuration files and directories to get you started.
8
+
9
+ By default, the generated sfdx-project.json file sets the sourceApiVersion property to the default API version currently used by Salesforce CLI. To specify a different version, set the apiVersion configuration variable. For example: "sf config set apiVersion=57.0 --global".
10
+
11
+ # examples
12
+
13
+ - Generate a project called "mywork":
14
+
15
+ <%= config.bin %> <%= command.id %> --name mywork
16
+
17
+ - Similar to previous example, but generate the files in a directory called "myapp":
18
+
19
+ <%= config.bin %> <%= command.id %> --name mywork --default-package-dir myapp
20
+
21
+ - Similar to prevoius example, but also generate a default package.xml manifest file:
22
+
23
+ <%= config.bin %> <%= command.id %> --name mywork --default-package-dir myapp --manifest
24
+
25
+ - Generate a project with the minimum files and directories:
26
+
27
+ <%= config.bin %> <%= command.id %> --name mywork --template empty
28
+
29
+ # flags.name
30
+
31
+ Name of the generated project.
32
+
33
+ # flags.name.description
34
+
35
+ Generates a project directory with this name; any valid directory name is accepted. Also sets the "name" property in the sfdx-project.json file to this name.
36
+
37
+ # flags.template
38
+
39
+ Template to use for project creation.
40
+
41
+ # flags.template.description
42
+
43
+ The template determines the sample configuration files and directories that this command generates. For example, the empty template provides these files and directory to get you started.
44
+
45
+ - .forceignore
46
+ - config/project-scratch-def.json
47
+ - sfdx-project.json
48
+ - package.json
49
+ - force-app (basic source directory structure)
50
+
51
+ The standard template provides a complete force-app directory structure so you know where to put your source. It also provides additional files and scripts, especially useful when using Salesforce Extensions for VS Code. For example:
52
+
53
+ - .gitignore: Use Git for version control.
54
+ - .prettierrc and .prettierignore: Use Prettier to format your Aura components.
55
+ - .vscode/extensions.json: When launched, Visual Studio Code, prompts you to install the recommended extensions for your project.
56
+ - .vscode/launch.json: Configures Replay Debugger.
57
+ - .vscode/settings.json: Additional configuration settings.
58
+
59
+ The analytics template provides similar files and the force-app/main/default/waveTemplates directory.
60
+
61
+ # flags.namespace
62
+
63
+ Namespace associated with this project and any connected scratch orgs.
64
+
65
+ # flags.packagedir
66
+
67
+ Default package directory name.
68
+
69
+ # flags.packagedir.description
70
+
71
+ Metadata items such as classes and Lightning bundles are placed inside this folder.
72
+
73
+ # flags.manifest
74
+
75
+ Generate a manifest (package.xml) for change-set based development.
76
+
77
+ # flags.manifest.description
78
+
79
+ Generates a default manifest (package.xml) for fetching Apex, Visualforce, Lightning components, and static resources.
80
+
81
+ # flags.loginurl
82
+
83
+ Salesforce instance login URL.
84
+
85
+ # flags.loginurl.description
86
+
87
+ Normally defaults to https://login.salesforce.com.
@@ -0,0 +1,37 @@
1
+ # summary
2
+
3
+ Generate a static resource.
4
+
5
+ # description
6
+
7
+ Generates the metadata resource file in the specified directory or the current working directory. Static resource files must be contained in a parent directory called "staticresources" in your package directory. Either run this command from an existing directory of this name, or use the --output-dir flag to create one or point to an existing one.
8
+
9
+ # examples
10
+
11
+ - Generate the metadata file for a static resource called MyResource in the current directory:
12
+
13
+ <%= config.bin %> <%= command.id %> --name MyResource
14
+
15
+ - Similar to previous example, but specifies a MIME type of application/json:
16
+
17
+ <%= config.bin %> <%= command.id %> --name MyResource --type application/json
18
+
19
+ - Generate the resource file in the "force-app/main/default/staticresources" directory:
20
+
21
+ <%= config.bin %> <%= command.id %> --name MyResource --output-dir force-app/main/default/staticresources
22
+
23
+ # flags.name.summary
24
+
25
+ Name of the generated static resource.
26
+
27
+ # flags.name.description
28
+
29
+ This name can contain only underscores and alphanumeric characters, and must be unique in your org. It must begin with a letter, not include spaces, not end with an underscore, and not contain two consecutive underscores.
30
+
31
+ # flags.type.summary
32
+
33
+ Content type (mime type) of the generated static resource.
34
+
35
+ # flags.type.description
36
+
37
+ Must be a valid MIME type such as application/json, application/javascript, application/zip, text/plain, text/css, etc.
package/messages/vf.md ADDED
@@ -0,0 +1,39 @@
1
+ # summary
2
+
3
+ Generate a Visualforce %s.
4
+
5
+ # description
6
+
7
+ The command generates the .%s file and associated metadata file in the specified directory or the current working directory by default.
8
+
9
+ # flags.name
10
+
11
+ Name of the generated Visualforce %s.
12
+
13
+ # flags.name.description
14
+
15
+ The name can be up to 40 characters and must start with a letter.
16
+
17
+ # flags.label
18
+
19
+ Visualforce %s label.
20
+
21
+ # examples.component
22
+
23
+ - Generate the metadata files for a Visualforce component in the current directory:
24
+
25
+ <%= config.bin %> <%= command.id %> --name mycomponent --label mylabel
26
+
27
+ - Similar to previous example, but generate the files in the directory "force-app/main/default/components":
28
+
29
+ <%= config.bin %> <%= command.id %> --name mycomponent --label mylabel --output-dir components
30
+
31
+ # examples.page
32
+
33
+ - Generate the metadata files for a Visualforce page in the current directory:
34
+
35
+ <%= config.bin %> <%= command.id %> --name mypage --label mylabel
36
+
37
+ - Similar to previous example, but generate the files in the directory "force-app/main/default/pages":
38
+
39
+ <%= config.bin %> <%= command.id %> --name mypage --label mylabel --output-dir pages