UNPKG

@mbc-cqrs-serverless/cli

Version:

a CLI to get started with MBC CQRS serverless framework

61 lines (60 loc) 1.69 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.schematics = void 0; exports.buildSchematicsListAsTable = buildSchematicsListAsTable; const chalk_1 = __importDefault(require("chalk")); const cli_table3_1 = __importDefault(require("cli-table3")); exports.schematics = [ { name: 'module', alias: 'mo', description: 'Create a module.', }, { name: 'controller', alias: 'co', description: 'Create a controller.', }, { name: 'service', alias: 'se', description: 'Create a service.', }, { name: 'entity', alias: 'en', description: 'Create a entity.', }, { name: 'dto', alias: 'dto', description: 'Create a dto.', }, ]; function buildSchematicsListAsTable() { const leftMargin = ' '; const tableConfig = { head: ['name', 'alias', 'description'], chars: { left: leftMargin.concat('│'), 'top-left': leftMargin.concat('┌'), 'bottom-left': leftMargin.concat('└'), mid: '', 'left-mid': '', 'mid-mid': '', 'right-mid': '', }, }; const table = new cli_table3_1.default(tableConfig); for (const schematic of exports.schematics) { table.push([ chalk_1.default.green(schematic.name), chalk_1.default.cyan(schematic.alias), schematic.description, ]); } return table.toString(); }