tamim-cli
Version:
A CLI tool for generating module boilerplate code including routes, controllers, services, and more
34 lines (33 loc) • 1.52 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const commander_1 = require("commander");
const addFile_js_1 = __importDefault(require("./commands/addFile.js"));
const createModule_js_1 = require("./commands/createModule.js");
const newApp_js_1 = __importDefault(require("./commands/newApp.js"));
process.stdin.isTTY = false;
process.stdout.isTTY = false;
if (process.argv.toString().includes("--help") ||
process.argv.toString().includes("-h")) {
commander_1.program.outputHelp();
}
commander_1.program
.command("create <name> <fields...>")
.description("Create a new module with specified fields. For example tamim create moduleName field1:string field2:number field5:ref=>Model field6:array=>string field7:array=>ref=>Model")
.option("-s, --skip <files...>", "Skip file from Module")
.option("-a, --add <files...>", "Add functionality in Module")
.action((name, fields, options) => {
(0, createModule_js_1.createModule)(name, fields, options);
});
commander_1.program
.command("add <moduleFiles...>")
.description("Add a new file to the module. For example tamim add moduleName:fileType ")
.action(addFile_js_1.default);
commander_1.program
.command("create-new-app")
.description("Create a new app")
.action(newApp_js_1.default);
commander_1.program.parse(process.argv);