UNPKG

vtex

Version:

The platform for e-commerce apps

30 lines (29 loc) 1.27 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); const chalk_1 = tslib_1.__importDefault(require("chalk")); const api_1 = require("../../api"); const logger_1 = tslib_1.__importDefault(require("../../api/logger")); const setupTooling_1 = require("./setupTooling"); const setupTSConfig_1 = require("./setupTSConfig"); const setupTypings_1 = require("./setupTypings"); exports.default = async (opts) => { const all = opts.all || (!opts.tooling && !opts.typings && !opts.tsconfig); const tooling = opts.tooling || all; const typings = opts.typings || all; const tsconfig = opts.tsconfig || all; const ignoreLinked = opts.i || opts['ignore-linked']; if (ignoreLinked && !(all || typings)) { logger_1.default.error(chalk_1.default `The flag {bold --ignore-linked (-i)} can only be used when {bold --typings} or {bold --all} are also used`); } const manifest = await api_1.ManifestEditor.getManifestEditor(); if (tooling) { setupTooling_1.setupTooling(manifest); } if (tsconfig) { await setupTSConfig_1.setupTSConfig(manifest, opts.tsconfig); } if (typings) { await setupTypings_1.setupTypings(manifest, ignoreLinked); } };