UNPKG

simba-cli

Version:

A simple CLI to handle most basic and everyday usage cli command wishes

81 lines (79 loc) 2.58 kB
#! /usr/bin/env node "use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const log_1 = require("./log"); const yargs_1 = __importDefault(require("yargs")); const generate_1 = require("./generate"); const set_1 = require("./set"); const options = yargs_1.default .usage(`Usage: simba generate <schematics> <name> [options] schematics: widget (alias: w) Generates a Flutter/Dart widget component (alias c) Generates an angular component with all the default props and content class (alias cl) Generates a JavaScript/Typescript class module (alias m) Generates a node.js module with controller, service, route and validator function (alias fn) Generates a JavaScript/Typescript function name: The name to assign newly generated schematic \n\n `) .usage(`Usage: simba env <project> [options] project: The name/ID of project to be updated \n\n `) .option('st', { alias: 'stateful', describe: 'Used to generate a stateful schematic like a Stateful Widget', type: 'boolean', demandOption: false }) .option('js', { alias: 'javascript', describe: 'Used to generate a schematic for JavaScript instead of the default Typescript', type: 'boolean', demandOption: false }) .options('exp', { alias: 'export', describe: 'Add the export keyword to the generated schematic', type: 'boolean', demandOption: false, }) .option('hks', { alias: 'hooks', describe: 'Used to include the lifecycle hooks of a generated schematics', type: 'boolean', demandOption: false }) .option('h', { alias: 'help', describe: 'Show helpful info about this cli', type: 'boolean', demandOption: false }) .argv; (function () { const args = options._; switch (args[0]) { case 'g': case 'generate': { (0, generate_1.generateSchematic)(args[1], args[2]); break; } case 'env': { (0, set_1.setProjectEnvironment)(args[1]); break; } // case undefined: { // welcomeText(); // break; // } default: { log_1.Log.error('Invalid or unspecified command!'); log_1.Log.log('Run `simba --help` command for instructions or check our docs at https://embyconcept.com to learn more.\n\n\n'); } } })(); //# sourceMappingURL=simba.js.map