UNPKG

@craftnotion/init-project

Version:

A CLI tool to initialize a new project with AdonisJS, NextJS, NestJS, React Native, Strapi, TypeScript, Husky, Git-CZ and more.

49 lines (48 loc) 1.8 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const chalk_1 = __importDefault(require("chalk")); const inquirer_1 = __importDefault(require("inquirer")); const base_1 = require("../base"); class Expressjs extends base_1.Base { static supportedPackageManagers = ['npm', 'yarn']; node = '18.0.0'; constructor(data) { let { projectName } = data; super(`npx express-generator ${projectName}`); console.log(chalk_1.default.yellowBright('Please make sure you have python installed')); } async handle() { const { needView } = await inquirer_1.default.prompt({ type: 'confirm', name: 'needView', message: 'Do you need templating engine ?', default: true, }); if (needView) { const { view } = await inquirer_1.default.prompt([ { type: 'list', name: 'view', message: 'Select templating engine', choices: ['ejs', 'hbs', 'hjs', 'jade', 'pug', 'twig', 'vash'], default: 'ejs', }, ]); const { css } = await inquirer_1.default.prompt([ { type: 'list', name: 'css', message: 'Select templating engine', choices: ['css', 'less', 'sass', 'compass', 'stylus'], default: 'css', }, ]); this.updateCommand('alias', { css, view }); } await this.scaffold(); } } exports.default = Expressjs;