UNPKG

@nstudio/angular

Version:

Angular Plugin for xplat

27 lines (26 loc) 1.07 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = default_1; const xplat_1 = require("@nstudio/xplat"); const xplat_utils_1 = require("@nstudio/xplat-utils"); const applitools_1 = require("./applitools"); const schematics_1 = require("@angular-devkit/schematics"); const supportedHelpers = { applitools: applitools_1.config, }; function default_1(options) { if (!options.name) { throw new schematics_1.SchematicsException((0, xplat_1.missingArgument)('name', 'Provide the name of the helper to generate.', 'nx g @nstudio/angular:helpers applitools --target=web-myapp')); } const helperChain = []; const helpers = options.name.split(','); for (const helper of helpers) { if (supportedHelpers[helper]) { (0, xplat_1.buildHelperChain)(helper, options, supportedHelpers[helper], helperChain); } else { helperChain.push((0, schematics_1.noop)()); } } return (0, schematics_1.chain)([(0, xplat_utils_1.prerun)(options), ...helperChain]); }