@salesforce/templates
Version:
Salesforce JS library for templates
31 lines • 1.42 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
/*
* Copyright (c) 2020, salesforce.com, inc.
* All rights reserved.
* Licensed under the BSD 3-Clause license.
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
const path = require("path");
const utils_1 = require("../utils");
const baseGenerator_1 = require("./baseGenerator");
class VisualforcePageGenerator extends baseGenerator_1.BaseGenerator {
constructor(options) {
super(options);
}
validateOptions() {
utils_1.CreateUtil.checkInputs(this.options.pagename);
utils_1.CreateUtil.checkInputs(this.options.template);
}
generate() {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
const { template, label, pagename } = this.options;
this.sourceRootWithPartialPath('visualforcepage');
yield this.render(this.templatePath(`${template}.page`), this.destinationPath(path.join(this.outputdir, `${pagename}.page`)), {});
yield this.render(this.templatePath('_page.page-meta.xml'), this.destinationPath(path.join(this.outputdir, `${pagename}.page-meta.xml`)), { vfLabel: label, apiVersion: this.apiversion });
});
}
}
exports.default = VisualforcePageGenerator;
//# sourceMappingURL=visualforcePageGenerator.js.map
;