generate-cli-react
Version:
A simple React CLI for generating components.
21 lines (20 loc) • 1.27 kB
JavaScript
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
var commander_1 = require("commander");
var config_1 = __importDefault(require("./config"));
var generateComponent_1 = __importDefault(require("./generateComponent"));
module.exports = function (argv) {
commander_1.program
.command("component [component...]")
.option("-p, --path <path>", "The path where you want the component to be generated.", config_1.default.path)
.option("--withStyle", "Creates a stylesheet file with this component.", config_1.default.withStyle)
.option("--usePreprocessor <preprocessor>", "Creates a stylesheet file used a preprocessor such as scss with this component.", config_1.default.usePreprocessor)
.option("--useTypescript", "Creates the typescript component.", config_1.default.useTypescript)
.option("--useTest <test>", "Creates test file with library enzyme or testingLibrary with this component.", config_1.default.useTest)
.action(function (components, args) {
components.forEach(function (c) { return generateComponent_1.default(c, args); });
});
commander_1.program.parse(argv);
};
;