@salesforce/templates 61.0.1 → 61.1.0
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/lib/generators/analyticsTemplateGenerator.d.ts +4 -4
- package/lib/generators/analyticsTemplateGenerator.js +20 -18
- package/lib/generators/analyticsTemplateGenerator.js.map +1 -1
- package/lib/generators/apexClassGenerator.d.ts +4 -4
- package/lib/generators/apexClassGenerator.js +12 -9
- package/lib/generators/apexClassGenerator.js.map +1 -1
- package/lib/generators/apexTriggerGenerator.d.ts +4 -4
- package/lib/generators/apexTriggerGenerator.js +12 -9
- package/lib/generators/apexTriggerGenerator.js.map +1 -1
- package/lib/generators/baseGenerator.d.ts +60 -0
- package/lib/generators/baseGenerator.js +204 -0
- package/lib/generators/baseGenerator.js.map +1 -0
- package/lib/generators/lightningAppGenerator.d.ts +4 -4
- package/lib/generators/lightningAppGenerator.js +23 -21
- package/lib/generators/lightningAppGenerator.js.map +1 -1
- package/lib/generators/lightningComponentGenerator.d.ts +4 -4
- package/lib/generators/lightningComponentGenerator.js +51 -48
- package/lib/generators/lightningComponentGenerator.js.map +1 -1
- package/lib/generators/lightningEventGenerator.d.ts +4 -4
- package/lib/generators/lightningEventGenerator.js +18 -16
- package/lib/generators/lightningEventGenerator.js.map +1 -1
- package/lib/generators/lightningInterfaceGenerator.d.ts +4 -4
- package/lib/generators/lightningInterfaceGenerator.js +17 -15
- package/lib/generators/lightningInterfaceGenerator.js.map +1 -1
- package/lib/generators/lightningTestGenerator.d.ts +4 -4
- package/lib/generators/lightningTestGenerator.js +18 -16
- package/lib/generators/lightningTestGenerator.js.map +1 -1
- package/lib/generators/projectGenerator.d.ts +4 -4
- package/lib/generators/projectGenerator.js +91 -88
- package/lib/generators/projectGenerator.js.map +1 -1
- package/lib/generators/staticResourceGenerator.d.ts +4 -4
- package/lib/generators/staticResourceGenerator.js +25 -22
- package/lib/generators/staticResourceGenerator.js.map +1 -1
- package/lib/generators/visualforceComponentGenerator.d.ts +4 -4
- package/lib/generators/visualforceComponentGenerator.js +12 -9
- package/lib/generators/visualforceComponentGenerator.js.map +1 -1
- package/lib/generators/visualforcePageGenerator.d.ts +4 -4
- package/lib/generators/visualforcePageGenerator.js +12 -9
- package/lib/generators/visualforcePageGenerator.js.map +1 -1
- package/lib/service/templateService.d.ts +6 -24
- package/lib/service/templateService.js +23 -99
- package/lib/service/templateService.js.map +1 -1
- package/lib/utils/index.d.ts +0 -3
- package/lib/utils/index.js +1 -5
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/types.d.ts +3 -7
- package/lib/utils/types.js +7 -1
- package/lib/utils/types.js.map +1 -1
- package/package.json +7 -12
- package/lib/generators/sfdxGenerator.d.ts +0 -32
- package/lib/generators/sfdxGenerator.js +0 -69
- package/lib/generators/sfdxGenerator.js.map +0 -1
- package/lib/utils/adapter.d.ts +0 -8
- package/lib/utils/adapter.js +0 -23
- package/lib/utils/adapter.js.map +0 -1
- package/lib/utils/logger.d.ts +0 -40
- package/lib/utils/logger.js +0 -130
- package/lib/utils/logger.js.map +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
3
4
|
/*
|
|
4
5
|
* Copyright (c) 2019, salesforce.com, inc.
|
|
5
6
|
* All rights reserved.
|
|
@@ -7,9 +8,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
8
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
8
9
|
*/
|
|
9
10
|
const fs = require("fs");
|
|
11
|
+
const promises_1 = require("node:fs/promises");
|
|
10
12
|
const path = require("path");
|
|
11
13
|
const utils_1 = require("../utils");
|
|
12
|
-
const
|
|
14
|
+
const baseGenerator_1 = require("./baseGenerator");
|
|
13
15
|
const GITIGNORE = 'gitignore';
|
|
14
16
|
const HUSKY_FOLDER = '.husky';
|
|
15
17
|
const huskyhookarray = ['pre-commit'];
|
|
@@ -38,109 +40,110 @@ const filestocopy = [
|
|
|
38
40
|
const emptyfolderarray = ['aura', 'lwc'];
|
|
39
41
|
const analyticsfolderarray = ['aura', 'classes', 'lwc', 'waveTemplates'];
|
|
40
42
|
const analyticsVscodeExt = 'salesforce.analyticsdx-vscode';
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
function extendJSON(filepath, replacer) {
|
|
44
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
45
|
+
const originalContent = JSON.parse(yield (0, promises_1.readFile)(filepath, 'utf8').catch(() => '{}'));
|
|
46
|
+
const newContent = JSON.stringify(originalContent, replacer, 2);
|
|
47
|
+
yield (0, promises_1.writeFile)(filepath, newContent);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
class ProjectGenerator extends baseGenerator_1.BaseGenerator {
|
|
51
|
+
constructor(options) {
|
|
52
|
+
super(options);
|
|
47
53
|
this.sourceRootWithPartialPath('project');
|
|
48
54
|
}
|
|
49
55
|
validateOptions() {
|
|
50
56
|
utils_1.CreateUtil.checkInputs(this.options.template);
|
|
51
57
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
if (template === 'standard') {
|
|
78
|
-
makeEmptyFolders(folderlayout, standardfolderarray);
|
|
79
|
-
// Add Husky directory and hooks
|
|
80
|
-
this._createHuskyConfig(path.join(this.outputdir, projectname));
|
|
81
|
-
for (const file of vscodearray) {
|
|
82
|
-
this.fs.copyTpl(this.templatePath(`${file}.json`), this.destinationPath(path.join(this.outputdir, projectname, '.vscode', `${file}.json`)), {});
|
|
58
|
+
generate() {
|
|
59
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
60
|
+
const { projectname, template, defaultpackagedir, manifest, ns, loginurl } = this.options;
|
|
61
|
+
const folderlayout = [
|
|
62
|
+
this.outputdir,
|
|
63
|
+
projectname,
|
|
64
|
+
defaultpackagedir,
|
|
65
|
+
'main',
|
|
66
|
+
'default',
|
|
67
|
+
];
|
|
68
|
+
const scratchDefFile = `${template}/ScratchDef.json`;
|
|
69
|
+
const manifestFile = `${template}/Manifest.xml`;
|
|
70
|
+
const soqlQueryFile = 'account.soql';
|
|
71
|
+
const anonApexFile = 'hello.apex';
|
|
72
|
+
yield this.render(this.templatePath(scratchDefFile), this.destinationPath(path.join(this.outputdir, projectname, 'config', 'project-scratch-def.json')), { company: (process.env.USER || 'Demo') + ' company' });
|
|
73
|
+
yield this.render(this.templatePath(`${template}/README.md`), this.destinationPath(path.join(this.outputdir, projectname, 'README.md')), {});
|
|
74
|
+
yield this.render(this.templatePath('sfdx-project.json'), this.destinationPath(path.join(this.outputdir, projectname, 'sfdx-project.json')), {
|
|
75
|
+
defaultpackagedir,
|
|
76
|
+
namespace: ns,
|
|
77
|
+
loginurl,
|
|
78
|
+
apiversion: this.apiversion,
|
|
79
|
+
name: projectname,
|
|
80
|
+
});
|
|
81
|
+
if (manifest === true) {
|
|
82
|
+
yield this.render(this.templatePath(manifestFile), this.destinationPath(path.join(this.outputdir, projectname, 'manifest', 'package.xml')), { apiversion: this.apiversion });
|
|
83
83
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
84
|
+
if (template === 'standard') {
|
|
85
|
+
yield makeEmptyFolders(folderlayout, standardfolderarray);
|
|
86
|
+
// Add Husky directory and hooks
|
|
87
|
+
this._createHuskyConfig(path.join(this.outputdir, projectname));
|
|
88
|
+
for (const file of vscodearray) {
|
|
89
|
+
yield this.render(this.templatePath(`${file}.json`), this.destinationPath(path.join(this.outputdir, projectname, '.vscode', `${file}.json`)), {});
|
|
90
|
+
}
|
|
91
|
+
yield this.render(this.templatePath('lwc.eslintrc.json'), this.destinationPath(path.join(...folderlayout, 'lwc', '.eslintrc.json')), {});
|
|
92
|
+
yield this.render(this.templatePath('aura.eslintrc.json'), this.destinationPath(path.join(...folderlayout, 'aura', '.eslintrc.json')), {});
|
|
93
|
+
yield this.render(this.templatePath(path.join(template, soqlQueryFile)), this.destinationPath(path.join(this.outputdir, projectname, 'scripts', 'soql', soqlQueryFile)), {});
|
|
94
|
+
yield this.render(this.templatePath(path.join(template, anonApexFile)), this.destinationPath(path.join(this.outputdir, projectname, 'scripts', 'apex', anonApexFile)), {});
|
|
95
|
+
for (const file of filestocopy) {
|
|
96
|
+
const out = file === GITIGNORE ? `.${file}` : file;
|
|
97
|
+
yield this.render(this.templatePath(file), this.destinationPath(path.join(this.outputdir, projectname, out)), {});
|
|
98
|
+
}
|
|
91
99
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
this.fs.copyTpl(this.templatePath('.forceignore'), this.destinationPath(path.join(this.outputdir, projectname, '.forceignore')), {});
|
|
96
|
-
}
|
|
97
|
-
if (template === 'analytics') {
|
|
98
|
-
makeEmptyFolders(folderlayout, analyticsfolderarray);
|
|
99
|
-
// Add Husky directory and hooks
|
|
100
|
-
this._createHuskyConfig(path.join(this.outputdir, projectname));
|
|
101
|
-
for (const file of vscodearray) {
|
|
102
|
-
this.fs.copyTpl(this.templatePath(`${file}.json`), this.destinationPath(path.join(this.outputdir, projectname, '.vscode', `${file}.json`)), {});
|
|
100
|
+
if (template === 'empty') {
|
|
101
|
+
yield makeEmptyFolders(folderlayout, emptyfolderarray);
|
|
102
|
+
yield this.render(this.templatePath('.forceignore'), this.destinationPath(path.join(this.outputdir, projectname, '.forceignore')), {});
|
|
103
103
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
104
|
+
if (template === 'analytics') {
|
|
105
|
+
yield makeEmptyFolders(folderlayout, analyticsfolderarray);
|
|
106
|
+
// Add Husky directory and hooks
|
|
107
|
+
this._createHuskyConfig(path.join(this.outputdir, projectname));
|
|
108
|
+
for (const file of vscodearray) {
|
|
109
|
+
yield this.render(this.templatePath(`${file}.json`), this.destinationPath(path.join(this.outputdir, projectname, '.vscode', `${file}.json`)), {});
|
|
110
|
+
}
|
|
111
|
+
// add the analytics vscode extension to the recommendations
|
|
112
|
+
yield extendJSON(path.join(this.outputdir, projectname, '.vscode', 'extensions.json'), (key, value) => {
|
|
113
|
+
if (key === 'recommendations' &&
|
|
114
|
+
Array.isArray(value) &&
|
|
115
|
+
!value.some((n) => n === analyticsVscodeExt)) {
|
|
116
|
+
value.push(analyticsVscodeExt);
|
|
117
|
+
}
|
|
118
|
+
return value;
|
|
119
|
+
});
|
|
120
|
+
yield this.render(this.templatePath('lwc.eslintrc.json'), this.destinationPath(path.join(...folderlayout, 'lwc', '.eslintrc.json')), {});
|
|
121
|
+
yield this.render(this.templatePath('aura.eslintrc.json'), this.destinationPath(path.join(...folderlayout, 'aura', '.eslintrc.json')), {});
|
|
122
|
+
for (const file of filestocopy) {
|
|
123
|
+
const out = file === GITIGNORE ? `.${file}` : file;
|
|
124
|
+
yield this.render(this.templatePath(file), this.destinationPath(path.join(this.outputdir, projectname, out)), {});
|
|
110
125
|
}
|
|
111
|
-
return value;
|
|
112
|
-
});
|
|
113
|
-
this.fs.copyTpl(this.templatePath('lwc.eslintrc.json'), this.destinationPath(path.join(...folderlayout, 'lwc', '.eslintrc.json')), {});
|
|
114
|
-
this.fs.copyTpl(this.templatePath('aura.eslintrc.json'), this.destinationPath(path.join(...folderlayout, 'aura', '.eslintrc.json')), {});
|
|
115
|
-
for (const file of filestocopy) {
|
|
116
|
-
const out = file === GITIGNORE ? `.${file}` : file;
|
|
117
|
-
this.fs.copyTpl(this.templatePath(file), this.destinationPath(path.join(this.outputdir, projectname, out)), {});
|
|
118
126
|
}
|
|
119
|
-
}
|
|
127
|
+
});
|
|
120
128
|
}
|
|
121
129
|
_createHuskyConfig(projectRootDir) {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
fs.
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
130
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
131
|
+
const huskyDirPath = path.join(projectRootDir, HUSKY_FOLDER);
|
|
132
|
+
if (!fs.existsSync(huskyDirPath)) {
|
|
133
|
+
fs.mkdirSync(huskyDirPath);
|
|
134
|
+
}
|
|
135
|
+
for (const file of huskyhookarray) {
|
|
136
|
+
yield this.render(this.templatePath(path.join(HUSKY_FOLDER, file)), this.destinationPath(path.join(huskyDirPath, file)), {});
|
|
137
|
+
}
|
|
138
|
+
});
|
|
129
139
|
}
|
|
130
140
|
}
|
|
131
141
|
exports.default = ProjectGenerator;
|
|
132
142
|
function makeEmptyFolders(toplevelfolders, metadatafolders) {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
fs.mkdirSync(path.join(oldfolder, folder));
|
|
143
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
144
|
+
for (const folder of metadatafolders) {
|
|
145
|
+
yield (0, promises_1.mkdir)(path.join(...toplevelfolders, folder), { recursive: true });
|
|
137
146
|
}
|
|
138
|
-
|
|
139
|
-
}
|
|
140
|
-
for (const newfolder of metadatafolders) {
|
|
141
|
-
if (!fs.existsSync(path.join(oldfolder, newfolder))) {
|
|
142
|
-
fs.mkdirSync(path.join(oldfolder, newfolder));
|
|
143
|
-
}
|
|
144
|
-
}
|
|
147
|
+
});
|
|
145
148
|
}
|
|
146
149
|
//# sourceMappingURL=projectGenerator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projectGenerator.js","sourceRoot":"","sources":["../../src/generators/projectGenerator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"projectGenerator.js","sourceRoot":"","sources":["../../src/generators/projectGenerator.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,yBAAyB;AACzB,+CAA8D;AAC9D,6BAA6B;AAC7B,oCAAsC;AAEtC,mDAAgD;AAEhD,MAAM,SAAS,GAAG,WAAW,CAAC;AAC9B,MAAM,YAAY,GAAG,QAAQ,CAAC;AAC9B,MAAM,cAAc,GAAG,CAAC,YAAY,CAAC,CAAC;AACtC,MAAM,WAAW,GAAG,CAAC,YAAY,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;AACzD,MAAM,mBAAmB,GAAG;IAC1B,cAAc;IACd,MAAM;IACN,SAAS;IACT,eAAe;IACf,YAAY;IACZ,SAAS;IACT,SAAS;IACT,gBAAgB;IAChB,iBAAiB;IACjB,MAAM;IACN,UAAU;CACX,CAAC;AACF,MAAM,WAAW,GAAG;IAClB,cAAc;IACd,SAAS;IACT,iBAAiB;IACjB,aAAa;IACb,gBAAgB;IAChB,cAAc;CACf,CAAC;AACF,MAAM,gBAAgB,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAEzC,MAAM,oBAAoB,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC;AACzE,MAAM,kBAAkB,GAAG,+BAA+B,CAAC;AAE3D,SAAe,UAAU,CACvB,QAAgB,EAChB,QAAsD;;QAEtD,MAAM,eAAe,GAAG,IAAI,CAAC,KAAK,CAChC,MAAM,IAAA,mBAAQ,EAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CACnD,CAAC;QAEF,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,eAAe,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;QAChE,MAAM,IAAA,oBAAS,EA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C,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC,EAChD,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC,EACnD,EAAE,CACH,CAAC;YACJ,CAAC;QACH,CAAC;KAAA;CACF;AAlND,mCAkNC;AAED,SAAe,gBAAgB,CAC7B,eAAyB,EACzB,eAAyB;;QAEzB,KAAK,MAAM,MAAM,IAAI,eAAe,EAAE,CAAC;YACrC,MAAM,IAAA,gBAAK,EAAC,IAAI,CAAC,IAAI,CAAC,GAAG,eAAe,EAAE,MAAM,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC1E,CAAC;IACH,CAAC;CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StaticResourceOptions } from '../utils/types';
|
|
2
|
-
import {
|
|
3
|
-
export default class StaticResourceGenerator extends
|
|
4
|
-
constructor(
|
|
2
|
+
import { BaseGenerator } from './baseGenerator';
|
|
3
|
+
export default class StaticResourceGenerator extends BaseGenerator<StaticResourceOptions> {
|
|
4
|
+
constructor(options: StaticResourceOptions);
|
|
5
5
|
validateOptions(): void;
|
|
6
|
-
|
|
6
|
+
generate(): Promise<void>;
|
|
7
7
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
3
4
|
/*
|
|
4
5
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
5
6
|
* All rights reserved.
|
|
@@ -10,12 +11,11 @@ const mime_types_1 = require("mime-types");
|
|
|
10
11
|
const path = require("path");
|
|
11
12
|
const i18n_1 = require("../i18n");
|
|
12
13
|
const utils_1 = require("../utils");
|
|
13
|
-
const
|
|
14
|
+
const baseGenerator_1 = require("./baseGenerator");
|
|
14
15
|
const EXTENSION_TEMPLATES = ['js', 'css', 'json', 'txt'];
|
|
15
|
-
class StaticResourceGenerator extends
|
|
16
|
-
constructor(
|
|
17
|
-
super(
|
|
18
|
-
this.sourceRootWithPartialPath('staticresource');
|
|
16
|
+
class StaticResourceGenerator extends baseGenerator_1.BaseGenerator {
|
|
17
|
+
constructor(options) {
|
|
18
|
+
super(options);
|
|
19
19
|
}
|
|
20
20
|
validateOptions() {
|
|
21
21
|
utils_1.CreateUtil.checkInputs(this.options.resourcename);
|
|
@@ -23,23 +23,26 @@ class StaticResourceGenerator extends sfdxGenerator_1.SfdxGenerator {
|
|
|
23
23
|
throw new Error(i18n_1.nls.localize('InvalidMimeType'));
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
26
|
+
generate() {
|
|
27
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
const { resourcename, contenttype } = this.options;
|
|
29
|
+
this.sourceRootWithPartialPath('staticresource');
|
|
30
|
+
const ext = (0, mime_types_1.extension)(contenttype);
|
|
31
|
+
if (ext && EXTENSION_TEMPLATES.includes(ext)) {
|
|
32
|
+
// For types that we have default file, write that (js, css, txt, json)
|
|
33
|
+
yield this.render(this.templatePath(`empty.${ext}`), this.destinationPath(path.join(this.outputdir, `${resourcename}.${ext}`)), {});
|
|
34
|
+
}
|
|
35
|
+
else if (ext === 'zip') {
|
|
36
|
+
// For zip files, write an empty js file in a folder
|
|
37
|
+
yield this.render(this.templatePath('_gitkeep'), this.destinationPath(path.join(this.outputdir, resourcename, '.gitkeep')), {});
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
// For all other mime types write a generic .resource file
|
|
41
|
+
yield this.render(this.templatePath('empty.resource'), this.destinationPath(path.join(this.outputdir, `${resourcename}.resource`)), {});
|
|
42
|
+
}
|
|
43
|
+
yield this.render(this.templatePath('_staticresource.resource-meta.xml'), this.destinationPath(path.join(this.outputdir, `${resourcename}.resource-meta.xml`)), {
|
|
44
|
+
contentType: contenttype,
|
|
45
|
+
});
|
|
43
46
|
});
|
|
44
47
|
}
|
|
45
48
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"staticResourceGenerator.js","sourceRoot":"","sources":["../../src/generators/staticResourceGenerator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"staticResourceGenerator.js","sourceRoot":"","sources":["../../src/generators/staticResourceGenerator.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,2CAAuC;AACvC,6BAA6B;AAC7B,kCAA8B;AAC9B,oCAAsC;AAEtC,mDAAgD;AAEhD,MAAM,mBAAmB,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAEzD,MAAqB,uBAAwB,SAAQ,6BAAoC;IACvF,YAAY,OAA8B;QACxC,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;IAEM,eAAe;QACpB,kBAAU,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;QAElD,IAAI,CAAC,IAAA,sBAAS,EAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,WAAW,EAAE,CAAC,EAAE,CAAC;YACvD,MAAM,IAAI,KAAK,CAAC,UAAG,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC,CAAC;QACnD,CAAC;IACH,CAAC;IAEY,QAAQ;;YACnB,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC;YACnD,IAAI,CAAC,yBAAyB,CAAC,gBAAgB,CAAC,CAAC;YAEjD,MAAM,GAAG,GAAG,IAAA,sBAAS,EAAC,WAAW,CAAC,CAAC;YAEnC,IAAI,GAAG,IAAI,mBAAmB,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC7C,uEAAuE;gBACvE,MAAM,IAAI,CAAC,MAAM,CACf,IAAI,CAAC,YAAY,CAAC,SAAS,GAAG,EAAE,CAAC,EACjC,IAAI,CAAC,eAAe,CAClB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,YAAY,IAAI,GAAG,EAAE,CAAC,CACpD,EACD,EAAE,CACH,CAAC;YACJ,CAAC;iBAAM,IAAI,GAAG,KAAK,KAAK,EAAE,CAAC;gBACzB,oDAAoD;gBACpD,MAAM,IAAI,CAAC,MAAM,CACf,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,EAC7B,IAAI,CAAC,eAAe,CAClB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,EAAE,UAAU,CAAC,CACpD,EACD,EAAE,CACH,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,0DAA0D;gBAC1D,MAAM,IAAI,CAAC,MAAM,CACf,IAAI,CAAC,YAAY,CAAC,gBAAgB,CAAC,EACnC,IAAI,CAAC,eAAe,CAClB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,YAAY,WAAW,CAAC,CACtD,EACD,EAAE,CACH,CAAC;YACJ,CAAC;YAED,MAAM,IAAI,CAAC,MAAM,CACf,IAAI,CAAC,YAAY,CAAC,mCAAmC,CAAC,EACtD,IAAI,CAAC,eAAe,CAClB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,YAAY,oBAAoB,CAAC,CAC/D,EACD;gBACE,WAAW,EAAE,WAAW;aACzB,CACF,CAAC;QACJ,CAAC;KAAA;CACF;AA1DD,0CA0DC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VisualforceComponentOptions } from '../utils/types';
|
|
2
|
-
import {
|
|
3
|
-
export default class VisualforceComponentGenerator extends
|
|
4
|
-
constructor(
|
|
2
|
+
import { BaseGenerator } from './baseGenerator';
|
|
3
|
+
export default class VisualforceComponentGenerator extends BaseGenerator<VisualforceComponentOptions> {
|
|
4
|
+
constructor(options: VisualforceComponentOptions);
|
|
5
5
|
validateOptions(): void;
|
|
6
|
-
|
|
6
|
+
generate(): Promise<void>;
|
|
7
7
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
3
4
|
/*
|
|
4
5
|
* Copyright (c) 2019, salesforce.com, inc.
|
|
5
6
|
* All rights reserved.
|
|
@@ -8,20 +9,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
8
9
|
*/
|
|
9
10
|
const path = require("path");
|
|
10
11
|
const utils_1 = require("../utils");
|
|
11
|
-
const
|
|
12
|
-
class VisualforceComponentGenerator extends
|
|
13
|
-
constructor(
|
|
14
|
-
super(
|
|
15
|
-
this.sourceRootWithPartialPath('visualforcecomponent');
|
|
12
|
+
const baseGenerator_1 = require("./baseGenerator");
|
|
13
|
+
class VisualforceComponentGenerator extends baseGenerator_1.BaseGenerator {
|
|
14
|
+
constructor(options) {
|
|
15
|
+
super(options);
|
|
16
16
|
}
|
|
17
17
|
validateOptions() {
|
|
18
18
|
utils_1.CreateUtil.checkInputs(this.options.componentname);
|
|
19
19
|
utils_1.CreateUtil.checkInputs(this.options.template);
|
|
20
20
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
this.
|
|
21
|
+
generate() {
|
|
22
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
const { template, label, componentname } = this.options;
|
|
24
|
+
this.sourceRootWithPartialPath('visualforcecomponent');
|
|
25
|
+
yield this.render(this.templatePath(`${template}.component`), this.destinationPath(path.join(this.outputdir, `${componentname}.component`)), {}),
|
|
26
|
+
yield this.render(this.templatePath('_component.component-meta.xml'), this.destinationPath(path.join(this.outputdir, `${componentname}.component-meta.xml`)), { vfLabel: label, apiVersion: this.apiversion });
|
|
27
|
+
});
|
|
25
28
|
}
|
|
26
29
|
}
|
|
27
30
|
exports.default = VisualforceComponentGenerator;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visualforceComponentGenerator.js","sourceRoot":"","sources":["../../src/generators/visualforceComponentGenerator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"visualforceComponentGenerator.js","sourceRoot":"","sources":["../../src/generators/visualforceComponentGenerator.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,6BAA6B;AAC7B,oCAAsC;AAEtC,mDAAgD;AAEhD,MAAqB,6BAA8B,SAAQ,6BAA0C;IACnG,YAAY,OAAoC;QAC9C,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;IAEM,eAAe;QACpB,kBAAU,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;QACnD,kBAAU,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAChD,CAAC;IAEY,QAAQ;;YACnB,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,aAAa,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC;YACxD,IAAI,CAAC,yBAAyB,CAAC,sBAAsB,CAAC,CAAC;YAEvD,MAAM,IAAI,CAAC,MAAM,CACf,IAAI,CAAC,YAAY,CAAC,GAAG,QAAQ,YAAY,CAAC,EAC1C,IAAI,CAAC,eAAe,CAClB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,aAAa,YAAY,CAAC,CACxD,EACD,EAAE,CACH;gBACC,MAAM,IAAI,CAAC,MAAM,CACf,IAAI,CAAC,YAAY,CAAC,+BAA+B,CAAC,EAClD,IAAI,CAAC,eAAe,CAClB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,aAAa,qBAAqB,CAAC,CACjE,EACD,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,CAChD,CAAC;QACN,CAAC;KAAA;CACF;AA7BD,gDA6BC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VisualforcePageOptions } from '../utils/types';
|
|
2
|
-
import {
|
|
3
|
-
export default class VisualforcePageGenerator extends
|
|
4
|
-
constructor(
|
|
2
|
+
import { BaseGenerator } from './baseGenerator';
|
|
3
|
+
export default class VisualforcePageGenerator extends BaseGenerator<VisualforcePageOptions> {
|
|
4
|
+
constructor(options: VisualforcePageOptions);
|
|
5
5
|
validateOptions(): void;
|
|
6
|
-
|
|
6
|
+
generate(): Promise<void>;
|
|
7
7
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
3
4
|
/*
|
|
4
5
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
5
6
|
* All rights reserved.
|
|
@@ -8,20 +9,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
8
9
|
*/
|
|
9
10
|
const path = require("path");
|
|
10
11
|
const utils_1 = require("../utils");
|
|
11
|
-
const
|
|
12
|
-
class VisualforcePageGenerator extends
|
|
13
|
-
constructor(
|
|
14
|
-
super(
|
|
15
|
-
this.sourceRootWithPartialPath('visualforcepage');
|
|
12
|
+
const baseGenerator_1 = require("./baseGenerator");
|
|
13
|
+
class VisualforcePageGenerator extends baseGenerator_1.BaseGenerator {
|
|
14
|
+
constructor(options) {
|
|
15
|
+
super(options);
|
|
16
16
|
}
|
|
17
17
|
validateOptions() {
|
|
18
18
|
utils_1.CreateUtil.checkInputs(this.options.pagename);
|
|
19
19
|
utils_1.CreateUtil.checkInputs(this.options.template);
|
|
20
20
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
generate() {
|
|
22
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
const { template, label, pagename } = this.options;
|
|
24
|
+
this.sourceRootWithPartialPath('visualforcepage');
|
|
25
|
+
yield this.render(this.templatePath(`${template}.page`), this.destinationPath(path.join(this.outputdir, `${pagename}.page`)), {});
|
|
26
|
+
yield this.render(this.templatePath('_page.page-meta.xml'), this.destinationPath(path.join(this.outputdir, `${pagename}.page-meta.xml`)), { vfLabel: label, apiVersion: this.apiversion });
|
|
27
|
+
});
|
|
25
28
|
}
|
|
26
29
|
}
|
|
27
30
|
exports.default = VisualforcePageGenerator;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visualforcePageGenerator.js","sourceRoot":"","sources":["../../src/generators/visualforcePageGenerator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"visualforcePageGenerator.js","sourceRoot":"","sources":["../../src/generators/visualforcePageGenerator.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,6BAA6B;AAC7B,oCAAsC;AAEtC,mDAAgD;AAEhD,MAAqB,wBAAyB,SAAQ,6BAAqC;IACzF,YAAY,OAA+B;QACzC,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;IAEM,eAAe;QACpB,kBAAU,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC9C,kBAAU,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAChD,CAAC;IAEY,QAAQ;;YACnB,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC;YACnD,IAAI,CAAC,yBAAyB,CAAC,iBAAiB,CAAC,CAAC;YAElD,MAAM,IAAI,CAAC,MAAM,CACf,IAAI,CAAC,YAAY,CAAC,GAAG,QAAQ,OAAO,CAAC,EACrC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,QAAQ,OAAO,CAAC,CAAC,EACnE,EAAE,CACH,CAAC;YACF,MAAM,IAAI,CAAC,MAAM,CACf,IAAI,CAAC,YAAY,CAAC,qBAAqB,CAAC,EACxC,IAAI,CAAC,eAAe,CAClB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,QAAQ,gBAAgB,CAAC,CACvD,EACD,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,CAChD,CAAC;QACJ,CAAC;KAAA;CACF;AA3BD,2CA2BC"}
|
|
@@ -1,30 +1,26 @@
|
|
|
1
|
-
import { CreateOutput, TemplateOptions, TemplateType } from '../utils/types';
|
|
1
|
+
import { type CreateOutput, type TemplateOptions, TemplateType } from '../utils/types';
|
|
2
|
+
export declare function importGenerator(templateType: TemplateType): Promise<any>;
|
|
2
3
|
/**
|
|
3
4
|
* Template Service
|
|
4
5
|
*/
|
|
5
6
|
export declare class TemplateService {
|
|
6
7
|
private static instance;
|
|
7
|
-
private
|
|
8
|
-
private env;
|
|
8
|
+
private _cwd;
|
|
9
9
|
constructor(cwd?: string);
|
|
10
10
|
/**
|
|
11
11
|
* Get an instance of TemplateService
|
|
12
|
-
* @param cwd cwd of current
|
|
12
|
+
* @param cwd cwd of current environment. CLI: don't need to set explicitly. VS Code: it's typically the root workspace path
|
|
13
13
|
*/
|
|
14
14
|
static getInstance(cwd?: string): TemplateService;
|
|
15
15
|
/**
|
|
16
|
-
* Getting cwd of current
|
|
16
|
+
* Getting cwd of current environment
|
|
17
17
|
*/
|
|
18
18
|
get cwd(): string;
|
|
19
19
|
/**
|
|
20
|
-
* Setting cwd of current
|
|
20
|
+
* Setting cwd of current environment
|
|
21
21
|
* In VS Code, it's typically the root workspace path
|
|
22
22
|
*/
|
|
23
23
|
set cwd(cwd: string);
|
|
24
|
-
/**
|
|
25
|
-
* Look up package version of @salesforce/templates package to supply a default API version
|
|
26
|
-
*/
|
|
27
|
-
static getDefaultApiVersion(): string;
|
|
28
24
|
/**
|
|
29
25
|
* Create using templates
|
|
30
26
|
* @param templateType template type
|
|
@@ -32,18 +28,4 @@ export declare class TemplateService {
|
|
|
32
28
|
* @param customTemplatesRootPathOrGitRepo custom templates root path or git repo. If not specified, use built-in templates
|
|
33
29
|
*/
|
|
34
30
|
create<TOptions extends TemplateOptions>(templateType: TemplateType, templateOptions: TOptions, customTemplatesRootPathOrGitRepo?: string): Promise<CreateOutput>;
|
|
35
|
-
/**
|
|
36
|
-
* Local custom templates path set by user
|
|
37
|
-
* or set to a local cache of a git repo.
|
|
38
|
-
* Used by the generators.
|
|
39
|
-
*/
|
|
40
|
-
customTemplatesRootPath?: string;
|
|
41
|
-
private resetEnv;
|
|
42
|
-
/**
|
|
43
|
-
* Set custom templates root path or git repo.
|
|
44
|
-
* Throws an error if local path doesn't exist or cannot reach git repo.
|
|
45
|
-
* @param customTemplatesRootPathOrGitRepo custom templates root path or git repo
|
|
46
|
-
* @param forceLoadingRemoteRepo by default do not reload remote repo if the repo is already downloaded
|
|
47
|
-
*/
|
|
48
|
-
setCustomTemplatesRootPathOrGitRepo(pathOrRepoUri?: string, forceLoadingRemoteRepo?: boolean): Promise<void>;
|
|
49
31
|
}
|