UNPKG

@practica/create-node-app

Version:

Create Node.js app that is packed with best practices AND strive for simplicity

34 lines (33 loc) 1.76 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.startAppGenerator = void 0; const commander_1 = require("commander"); const interactive_cli_1 = require("./interactive-cli"); const non_interactive_cli_1 = require("./non-interactive-cli"); const package_json_1 = require("../../../package.json"); function startAppGenerator() { commander_1.program .name("Practice - Best Practices Generator") .description("Generate best practices for your project") .version(package_json_1.version); commander_1.program .command("interactive") .description("Open an interactive UI for customization") .action((str, options) => { (0, interactive_cli_1.renderWizard)(); }); commander_1.program .command("immediate") .description("Generates code using flags (a non-interactive CLI)") .option("-id, --install-dependencies", "Whether to install dependencies") .option("-td, --target-directory <type>", "Tha path to where the app should be installed") .option("-an, --app-name <type>", "The name of the app which will get used for the root folder name, package.json. and others", "default-app-name") .option("-wf, --web-framework <type>", "The web framework to use, currently 'express' or 'fastify'", "fastify") .option("-o, --orm <type>", "The Type of ORM to use, currently 'sequelize' or 'prisma'", "sequelize") .option("-ov, --override-if-exists", "If set to true, the existing generated app will be overriden") .action((options) => { (0, non_interactive_cli_1.handleNonInteractiveCommand)(options); }); commander_1.program.parse(); } exports.startAppGenerator = startAppGenerator;