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.

37 lines (36 loc) 1.3 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const inquirer_1 = __importDefault(require("inquirer")); const base_1 = require("../base"); const index_1 = require("../../functions/index"); class Nestjs extends base_1.Base { static supportedPackageManagers = ['npm', 'yarn', 'pnpm']; node = '16.0.0'; packageManager; /** * Base command for nestjs */ constructor(data) { let { packageManager = 'npm', projectName } = data; super(`nest new ${projectName} --package-manager=${packageManager}`); this.packageManager = packageManager; } async handle() { const { strictMode } = await inquirer_1.default.prompt([ { type: 'confirm', name: 'strictMode', message: 'Enables strict mode in TypeScript.', default: false, }, ]); strictMode && this.updateCommand('flag', '-strict'); //In case of nest js checking for nest cli and installing (0, index_1.isNestCliInstalled)(this.packageManager); this.scaffold(); } } exports.default = Nestjs;