UNPKG

@salesforce/templates

Version:

Salesforce JS library for templates

31 lines 1.49 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); /* * Copyright (c) 2019, 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 VisualforceComponentGenerator extends baseGenerator_1.BaseGenerator { constructor(options) { super(options); } validateOptions() { utils_1.CreateUtil.checkInputs(this.options.componentname); utils_1.CreateUtil.checkInputs(this.options.template); } generate() { return tslib_1.__awaiter(this, void 0, void 0, function* () { const { template, label, componentname } = this.options; this.sourceRootWithPartialPath('visualforcecomponent'); yield this.render(this.templatePath(`${template}.component`), this.destinationPath(path.join(this.outputdir, `${componentname}.component`)), {}), yield this.render(this.templatePath('_component.component-meta.xml'), this.destinationPath(path.join(this.outputdir, `${componentname}.component-meta.xml`)), { vfLabel: label, apiVersion: this.apiversion }); }); } } exports.default = VisualforceComponentGenerator; //# sourceMappingURL=visualforceComponentGenerator.js.map