UNPKG

@omni-door/tpl-component-library-react

Version:
64 lines (63 loc) 1.94 kB
"use strict"; var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result["default"] = mod; return result; }; Object.defineProperty(exports, "__esModule", { value: true }); var path_1 = require("path"); var index_1 = __importStar(require("./index")); var args = process.argv.slice(2); if (args.length > 0) { if (args[0] === 'new' && args[1]) { // new template var options = { ts: true, test: true, componentName: 'Omni', stylesheet: 'scss', newPath: process.cwd(), md: 'md', hasStorybook: false, type: 'fc' }; for (var i = 1; i < args.length; i++) { var item = args[i]; var _a = item.split('='), k = _a[0], val = _a[1]; options[k] = val === 'true' ? true : val === 'false' ? false : val; } index_1.newTpl(options); } else if (args[0] === 'init') { // init var options = { strategy: 'stable', projectName: path_1.parse(process.cwd()).name, initPath: process.cwd(), devServer: 'docz', ts: true, test: false, eslint: true, commitlint: false, style: 'scss', stylelint: true, pkgtool: 'yarn' }; for (var i = 1; i < args.length; i++) { var item = args[i]; var _b = item.split('='), k = _b[0], val = _b[1]; options[k] = val === 'true' ? true : val === 'false' ? false : val; } index_1.default(options); } }