@pnpm/plugin-commands-publishing
Version:
The pack and publish commands of pnpm
45 lines • 1.38 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.handler = exports.help = exports.commandNames = exports.cliOptionsTypes = exports.rcOptionsTypes = void 0;
const config_1 = require("@pnpm/config");
const run_npm_1 = require("@pnpm/run-npm");
const R = require("ramda");
const renderHelp = require("render-help");
const publish_1 = require("./publish");
function rcOptionsTypes() {
return {
...cliOptionsTypes(),
...R.pick([
'npm-path',
], config_1.types),
};
}
exports.rcOptionsTypes = rcOptionsTypes;
function cliOptionsTypes() {
return {};
}
exports.cliOptionsTypes = cliOptionsTypes;
exports.commandNames = ['pack'];
function help() {
return renderHelp({
description: 'Creates a compressed gzip archive of package dependencies.',
usages: ['pnpm pack'],
});
}
exports.help = help;
async function handler(opts) {
let _status;
await publish_1.fakeRegularManifest({
dir: opts.dir,
engineStrict: opts.engineStrict,
workspaceDir: opts.workspaceDir || opts.dir,
}, async () => {
const { status } = await run_npm_1.default(opts.npmPath, ['pack', ...opts.argv.original.slice(1)]);
_status = status;
});
if (_status !== 0) {
process.exit(_status);
}
}
exports.handler = handler;
//# sourceMappingURL=pack.js.map