@pnpm/exec.build-commands
Version:
Commands for managing dependency builds
51 lines • 2.19 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.commandNames = void 0;
exports.help = help;
exports.cliOptionsTypes = cliOptionsTypes;
exports.rcOptionsTypes = rcOptionsTypes;
exports.handler = handler;
const render_help_1 = __importDefault(require("render-help"));
const getAutomaticallyIgnoredBuilds_js_1 = require("./getAutomaticallyIgnoredBuilds.js");
exports.commandNames = ['ignored-builds'];
function help() {
return (0, render_help_1.default)({
description: 'Print the list of packages with blocked build scripts',
usages: [],
});
}
function cliOptionsTypes() {
return {};
}
function rcOptionsTypes() {
return {};
}
async function handler(opts) {
const ignoredBuiltDependencies = opts.rootProjectManifest?.pnpm?.ignoredBuiltDependencies ?? [];
let { automaticallyIgnoredBuilds } = await (0, getAutomaticallyIgnoredBuilds_js_1.getAutomaticallyIgnoredBuilds)(opts);
if (automaticallyIgnoredBuilds) {
automaticallyIgnoredBuilds = automaticallyIgnoredBuilds
.filter((automaticallyIgnoredBuild) => !ignoredBuiltDependencies.includes(automaticallyIgnoredBuild));
}
let output = 'Automatically ignored builds during installation:\n';
if (automaticallyIgnoredBuilds == null) {
output += ' Cannot identify as no node_modules found';
}
else if (automaticallyIgnoredBuilds.length === 0) {
output += ' None';
}
else {
output += ` ${automaticallyIgnoredBuilds.join('\n ')}
hint: To allow the execution of build scripts for a package, add its name to "pnpm.onlyBuiltDependencies" in your "package.json", then run "pnpm rebuild".
hint: If you don't want to build a package, add it to the "pnpm.ignoredBuiltDependencies" list.`;
}
output += '\n';
if (ignoredBuiltDependencies.length) {
output += `\nExplicitly ignored package builds (via pnpm.ignoredBuiltDependencies):\n ${ignoredBuiltDependencies.join('\n ')}\n`;
}
return output;
}
//# sourceMappingURL=ignoredBuilds.js.map