UNPKG

1.38 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.handler = exports.help = exports.commandNames = exports.cliOptionsTypes = exports.rcOptionsTypes = void 0;
4const config_1 = require("@pnpm/config");
5const run_npm_1 = require("@pnpm/run-npm");
6const R = require("ramda");
7const renderHelp = require("render-help");
8const publish_1 = require("./publish");
9function rcOptionsTypes() {
10 return {
11 ...cliOptionsTypes(),
12 ...R.pick([
13 'npm-path',
14 ], config_1.types),
15 };
16}
17exports.rcOptionsTypes = rcOptionsTypes;
18function cliOptionsTypes() {
19 return {};
20}
21exports.cliOptionsTypes = cliOptionsTypes;
22exports.commandNames = ['pack'];
23function help() {
24 return renderHelp({
25 description: 'Creates a compressed gzip archive of package dependencies.',
26 usages: ['pnpm pack'],
27 });
28}
29exports.help = help;
30async function handler(opts) {
31 let _status;
32 await publish_1.fakeRegularManifest({
33 dir: opts.dir,
34 engineStrict: opts.engineStrict,
35 workspaceDir: opts.workspaceDir || opts.dir,
36 }, async () => {
37 const { status } = await run_npm_1.default(opts.npmPath, ['pack', ...opts.argv.original.slice(1)]);
38 _status = status;
39 });
40 if (_status !== 0) {
41 process.exit(_status);
42 }
43}
44exports.handler = handler;
45//# sourceMappingURL=pack.js.map
\No newline at end of file