@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.
- package/LICENSE.txt +1 -1
- package/lib/commands/analytics/generate/template.d.ts +16 -0
- package/lib/commands/analytics/generate/template.js +53 -0
- package/lib/commands/analytics/generate/template.js.map +1 -0
- package/lib/commands/apex/generate/class.d.ts +17 -0
- package/lib/commands/apex/generate/class.js +65 -0
- package/lib/commands/apex/generate/class.js.map +1 -0
- package/lib/commands/apex/generate/trigger.d.ts +19 -0
- package/lib/commands/apex/generate/trigger.js +86 -0
- package/lib/commands/apex/generate/trigger.js.map +1 -0
- package/lib/commands/lightning/generate/app.d.ts +18 -0
- package/lib/commands/lightning/generate/app.js +68 -0
- package/lib/commands/lightning/generate/app.js.map +1 -0
- package/lib/commands/lightning/generate/component.d.ts +19 -0
- package/lib/commands/lightning/generate/component.js +75 -0
- package/lib/commands/lightning/generate/component.js.map +1 -0
- package/lib/commands/lightning/generate/event.d.ts +18 -0
- package/lib/commands/lightning/generate/event.js +68 -0
- package/lib/commands/lightning/generate/event.js.map +1 -0
- package/lib/commands/lightning/generate/interface.d.ts +18 -0
- package/lib/commands/lightning/generate/interface.js +68 -0
- package/lib/commands/lightning/generate/interface.js.map +1 -0
- package/lib/commands/lightning/generate/test.d.ts +18 -0
- package/lib/commands/lightning/generate/test.js +68 -0
- package/lib/commands/lightning/generate/test.js.map +1 -0
- package/lib/commands/project/generate.d.ts +20 -0
- package/lib/commands/project/generate.js +93 -0
- package/lib/commands/project/generate.js.map +1 -0
- package/lib/commands/static-resource/generate.d.ts +17 -0
- package/lib/commands/static-resource/generate.js +64 -0
- package/lib/commands/static-resource/generate.js.map +1 -0
- package/lib/commands/visualforce/generate/component.d.ts +18 -0
- package/lib/commands/visualforce/generate/component.js +73 -0
- package/lib/commands/visualforce/generate/component.js.map +1 -0
- package/lib/commands/visualforce/generate/page.d.ts +18 -0
- package/lib/commands/visualforce/generate/page.js +75 -0
- package/lib/commands/visualforce/generate/page.js.map +1 -0
- package/lib/utils/flags.d.ts +3 -0
- package/lib/utils/flags.js +36 -0
- package/lib/utils/flags.js.map +1 -0
- package/lib/utils/templateCommand.d.ts +58 -14
- package/lib/utils/templateCommand.js +42 -82
- package/lib/utils/templateCommand.js.map +1 -1
- package/messages/analyticsTemplate.md +17 -0
- package/messages/apexClass.md +25 -0
- package/messages/apexTrigger.md +40 -0
- package/messages/lightning.md +27 -0
- package/messages/lightningApp.md +9 -0
- package/messages/lightningCmp.md +31 -0
- package/messages/lightningEvent.md +9 -0
- package/messages/lightningInterface.md +9 -0
- package/messages/lightningTest.md +21 -0
- package/messages/messages.md +43 -0
- package/messages/project.md +87 -0
- package/messages/staticResource.md +37 -0
- package/messages/vf.md +39 -0
- package/oclif.manifest.json +1190 -1
- package/package.json +174 -96
- package/lib/commands/force/analytics/template/create.d.ts +0 -15
- package/lib/commands/force/analytics/template/create.js +0 -42
- package/lib/commands/force/analytics/template/create.js.map +0 -1
- package/lib/commands/force/apex/class/create.d.ts +0 -16
- package/lib/commands/force/apex/class/create.js +0 -52
- package/lib/commands/force/apex/class/create.js.map +0 -1
- package/lib/commands/force/apex/trigger/create.d.ts +0 -18
- package/lib/commands/force/apex/trigger/create.js +0 -74
- package/lib/commands/force/apex/trigger/create.js.map +0 -1
- package/lib/commands/force/lightning/app/create.d.ts +0 -17
- package/lib/commands/force/lightning/app/create.js +0 -58
- package/lib/commands/force/lightning/app/create.js.map +0 -1
- package/lib/commands/force/lightning/component/create.d.ts +0 -18
- package/lib/commands/force/lightning/component/create.js +0 -67
- package/lib/commands/force/lightning/component/create.js.map +0 -1
- package/lib/commands/force/lightning/event/create.d.ts +0 -17
- package/lib/commands/force/lightning/event/create.js +0 -58
- package/lib/commands/force/lightning/event/create.js.map +0 -1
- package/lib/commands/force/lightning/interface/create.d.ts +0 -17
- package/lib/commands/force/lightning/interface/create.js +0 -58
- package/lib/commands/force/lightning/interface/create.js.map +0 -1
- package/lib/commands/force/lightning/test/create.d.ts +0 -16
- package/lib/commands/force/lightning/test/create.js +0 -56
- package/lib/commands/force/lightning/test/create.js.map +0 -1
- package/lib/commands/force/project/create.d.ts +0 -19
- package/lib/commands/force/project/create.js +0 -78
- package/lib/commands/force/project/create.js.map +0 -1
- package/lib/commands/force/staticresource/create.d.ts +0 -16
- package/lib/commands/force/staticresource/create.js +0 -49
- package/lib/commands/force/staticresource/create.js.map +0 -1
- package/lib/commands/force/visualforce/component/create.d.ts +0 -17
- package/lib/commands/force/visualforce/component/create.js +0 -59
- package/lib/commands/force/visualforce/component/create.js.map +0 -1
- package/lib/commands/force/visualforce/page/create.d.ts +0 -17
- package/lib/commands/force/visualforce/page/create.js +0 -59
- package/lib/commands/force/visualforce/page/create.js.map +0 -1
- package/lib/utils/index.d.ts +0 -2
- package/lib/utils/index.js +0 -14
- package/lib/utils/index.js.map +0 -1
- package/lib/utils/messageUtil.d.ts +0 -33
- package/lib/utils/messageUtil.js +0 -59
- package/lib/utils/messageUtil.js.map +0 -1
- package/messages/messages.json +0 -87
- package/yarn.lock +0 -9362
|
@@ -1,15 +1,59 @@
|
|
|
1
|
-
import {
|
|
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
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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.
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
-
|
|
69
|
-
|
|
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.
|
|
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;
|
|
1
|
+
{"version":3,"file":"templateCommand.js","sourceRoot":"","sources":["../../src/utils/templateCommand.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;AAEH,6BAA6B;AAE7B,2CAAmF;AACnF,qDAAsE;AACtE,2DAAwE;AACxE,6CAA6C;AAe7C,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,8BAA8B,EAAE,UAAU,CAAC,CAAC;AAwDnF,SAAsB,YAAY,CAAC,EAAE,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAmB;;;QACpF,IAAI,SAAS,EAAE;YACb,MAAM,2BAAe,CAAC,WAAW,EAAE,CAAC,mCAAmC,CAAC,SAAS,CAAC,CAAC;SACpF;QAED,MAAM,OAAO,GAAG,IAAI,6BAAqB,EAAE,CAAC;QAC5C,oFAAoF;QACpF,MAAM,GAAG,GAAG,MAAM,CAAC,SAAS,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;QAC5D,GAAG,CAAC,YAAY,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;QAEzC,MAAM,GAAG,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;QACjC,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,MAAA,IAAI,CAAC,SAAS,mCAAI,GAAG,CAAC,CAAC;QAEtD,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,iBAAiB,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QAC5D,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,CAAC;QAChC,OAAO,IAAA,iBAAS,EAAC,OAAO,EAAE,SAAS,CAAC,CAAC;;CACtC;AAhBD,oCAgBC;AAEM,MAAM,kBAAkB,GAAG,CAAC,gBAAkC,EAAsB,EAAE;IAC3F,IAAI;QACF,uIAAuI;QACvI,MAAM,yBAAyB,GAAG,gBAAgB,CAAC,gBAAgB,CACjE,0BAAmB,CAAC,6BAA6B,CACxC,CAAC;QACZ,OAAO,yBAAyB,CAAC;KAClC;IAAC,OAAO,GAAG,EAAE;QACZ,OAAO,SAAS,CAAC;KAClB;AACH,CAAC,CAAC;AAVW,QAAA,kBAAkB,sBAU7B;AAEF,oBAAoB;AACb,MAAM,SAAS,GAAG,CAAC,OAA8B,EAAE,SAAiB,EAAgB,EAAE;IAC3F,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,CAAC;IACjD,MAAM,SAAS,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
|