UNPKG

@mongez/gnz

Version:

Generator Z, the next generation of scaffolding tools.

17 lines (16 loc) 1.13 kB
'use strict';var commander=require('commander'),path=require('path'),index=require('../../index.js'),main=require('../../../../main.js');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var path__default=/*#__PURE__*/_interopDefault(path);const newReactComponentCommand = new commander.Command("react:component") .arguments("<name>") .option("-p, --path <path>", "Path to save the component to") .option("-m, --memo <memo>", "Whether to use memo or not") .option("-f, --ref <forwardRef>", "Whether to use forwardRef or not") .option("-i, --index <withIndex>", "Whether to generate an index file or not") .action(async (name, options) => { const { memo, ref, index: index$1, path } = options; await main.gnz.execute(index.generateReactComponent.execute({ name, saveTo: path__default.default.resolve(process.cwd(), path || ""), forwardRef: ref && ref !== "false", memo: memo !== "false", withIndex: index$1 !== "false", })); });exports.newReactComponentCommand=newReactComponentCommand;//# sourceMappingURL=newReactComponentCommand.js.map