UNPKG

@yolkai/nx-workspace

Version:

Extensible Dev Tools for Monorepos

36 lines (35 loc) 1.43 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const commonCommands = ['build', 'test', 'lint', 'e2e', 'deploy']; function getCommand(cliCommand, isYarn, task) { const args = Object.entries(task.overrides || {}) .map(([prop, value]) => `--${prop}=${value}`) .join(' '); if (commonCommands.includes(task.target.target)) { const config = task.target.configuration ? `--configuration ${task.target.configuration} ` : ''; return `${cliCommand}${isYarn ? '' : ' --'} ${task.target.target} ${task.target.project} ${config} ${args}`.trim(); } else { const config = task.target.configuration ? `:${task.target.configuration} ` : ''; return `${cliCommand}${isYarn ? '' : ' --'} run ${task.target.project}:${task.target.target}${config} ${args}`.trim(); } } exports.getCommand = getCommand; function getOutputs(p, task) { const architect = p[task.target.project].data.architect[task.target.target]; let opts = architect.options || {}; if (architect.configurations && architect.configurations[task.target.configuration]) { opts = Object.assign({}, opts, architect.configurations[task.target.configuration]); } let outputs = []; if (opts.outputPath) { outputs.push(opts.outputPath); } return outputs; } exports.getOutputs = getOutputs;