UNPKG

@salesforce/templates

Version:

Salesforce JS library for templates

28 lines 1.36 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /* * 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 sfdxGenerator_1 = require("./sfdxGenerator"); class VisualforceComponentGenerator extends sfdxGenerator_1.SfdxGenerator { constructor(args, options) { super(args, options); this.sourceRootWithPartialPath('visualforcecomponent'); } validateOptions() { utils_1.CreateUtil.checkInputs(this.options.componentname); utils_1.CreateUtil.checkInputs(this.options.template); } writing() { const { template, label, componentname } = this.options; this.fs.copyTpl(this.templatePath(`${template}.component`), this.destinationPath(path.join(this.outputdir, `${componentname}.component`)), {}), this.fs.copyTpl(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