@salesforce/plugin-templates 56.2.14 → 56.3.1
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/README.md +12 -12
- package/lib/commands/analytics/generate/template.js +2 -2
- package/lib/commands/analytics/generate/template.js.map +1 -1
- package/lib/commands/apex/generate/class.js +2 -2
- package/lib/commands/apex/generate/class.js.map +1 -1
- package/lib/commands/apex/generate/trigger.js +10 -9
- package/lib/commands/apex/generate/trigger.js.map +1 -1
- package/lib/commands/lightning/generate/app.js +2 -2
- package/lib/commands/lightning/generate/app.js.map +1 -1
- package/lib/commands/lightning/generate/component.js +2 -2
- package/lib/commands/lightning/generate/component.js.map +1 -1
- package/lib/commands/lightning/generate/event.js +2 -2
- package/lib/commands/lightning/generate/event.js.map +1 -1
- package/lib/commands/lightning/generate/interface.js +2 -2
- package/lib/commands/lightning/generate/interface.js.map +1 -1
- package/lib/commands/lightning/generate/test.js +2 -2
- package/lib/commands/lightning/generate/test.js.map +1 -1
- package/lib/commands/project/generate.d.ts +1 -1
- package/lib/commands/project/generate.js +2 -2
- package/lib/commands/project/generate.js.map +1 -1
- package/lib/commands/static-resource/generate.js +2 -2
- package/lib/commands/static-resource/generate.js.map +1 -1
- package/lib/commands/visualforce/generate/component.js +2 -2
- package/lib/commands/visualforce/generate/component.js.map +1 -1
- package/lib/commands/visualforce/generate/page.js +2 -3
- package/lib/commands/visualforce/generate/page.js.map +1 -1
- package/lib/utils/templateCommand.d.ts +6 -54
- package/lib/utils/templateCommand.js +6 -30
- package/lib/utils/templateCommand.js.map +1 -1
- package/oclif.manifest.json +374 -374
- package/package.json +9 -14
|
@@ -4,27 +4,13 @@
|
|
|
4
4
|
* Licensed under the BSD 3-Clause license.
|
|
5
5
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
6
6
|
*/
|
|
7
|
-
import
|
|
8
|
-
import { Messages, OrgConfigProperties } from '@salesforce/core';
|
|
7
|
+
import { OrgConfigProperties } from '@salesforce/core';
|
|
9
8
|
import { TemplateService } from '@salesforce/templates';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
if (templates) {
|
|
16
|
-
await TemplateService.getInstance().setCustomTemplatesRootPathOrGitRepo(templates);
|
|
17
|
-
}
|
|
18
|
-
const adapter = new ForceGeneratorAdapter();
|
|
19
|
-
// @ts-expect-error the adapter doesn't fully implement the yeoman adapter interface
|
|
20
|
-
const env = yeoman.createEnv(undefined, undefined, adapter);
|
|
21
|
-
// @ts-ignore - access the default via the .default because of how we have to import everything above
|
|
22
|
-
env.registerStub(generator.default, 'generator');
|
|
23
|
-
await env.run('generator', opts);
|
|
24
|
-
const targetDir = path.resolve(opts.outputdir ?? '.');
|
|
25
|
-
ux.log(messages.getMessage('TargetDirOutput', [targetDir]));
|
|
26
|
-
ux.log(adapter.log.getOutput());
|
|
27
|
-
return buildJson(adapter, targetDir);
|
|
9
|
+
export async function runGenerator({ ux, templates, templateType, opts }) {
|
|
10
|
+
const templateService = TemplateService.getInstance();
|
|
11
|
+
const result = await templateService.create(templateType, opts, templates);
|
|
12
|
+
ux.log(result.rawOutput);
|
|
13
|
+
return result;
|
|
28
14
|
}
|
|
29
15
|
export const getCustomTemplates = (configAggregator) => {
|
|
30
16
|
try {
|
|
@@ -35,14 +21,4 @@ export const getCustomTemplates = (configAggregator) => {
|
|
|
35
21
|
return undefined;
|
|
36
22
|
}
|
|
37
23
|
};
|
|
38
|
-
// exported for test
|
|
39
|
-
export const buildJson = (adapter, targetDir) => {
|
|
40
|
-
const cleanOutput = adapter.log.getCleanOutput();
|
|
41
|
-
const rawOutput = `target dir = ${targetDir}\n${adapter.log.getOutput()}`;
|
|
42
|
-
return {
|
|
43
|
-
outputDir: targetDir,
|
|
44
|
-
created: cleanOutput,
|
|
45
|
-
rawOutput,
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
24
|
//# sourceMappingURL=templateCommand.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templateCommand.js","sourceRoot":"","sources":["../../src/utils/templateCommand.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"templateCommand.js","sourceRoot":"","sources":["../../src/utils/templateCommand.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAoB,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,EAAiC,eAAe,EAAgB,MAAM,uBAAuB,CAAC;AASrG,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,EAAE,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,IAAI,EAAmB;IACvF,MAAM,eAAe,GAAG,eAAe,CAAC,WAAW,EAAE,CAAC;IACtD,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,MAAM,CAAC,YAAY,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;IAC3E,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACzB,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,gBAAkC,EAAsB,EAAE;IAC3F,IAAI,CAAC;QACH,uIAAuI;QACvI,OAAO,gBAAgB,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,6BAA6B,CAAW,CAAC;IACxG,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC,CAAC"}
|