@pnpm/releasing.commands 1100.1.0 → 1100.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/pack-app/packApp.d.ts +2 -2
- package/lib/pack-app/packApp.js +31 -11
- package/package.json +25 -25
|
@@ -7,7 +7,7 @@ export declare function help(): string;
|
|
|
7
7
|
export type PackAppOptions = Pick<Config, 'dir' | 'pnpmHomeDir'> & Partial<Pick<Config, 'ca' | 'cert' | 'configByUri' | 'httpProxy' | 'httpsProxy' | 'key' | 'localAddress' | 'nodeDownloadMirrors' | 'noProxy' | 'strictSsl' | 'userAgent'>> & {
|
|
8
8
|
entry?: string;
|
|
9
9
|
target?: string | string[];
|
|
10
|
-
|
|
10
|
+
runtime?: string;
|
|
11
11
|
outputDir?: string;
|
|
12
12
|
outputName?: string;
|
|
13
13
|
};
|
|
@@ -16,7 +16,7 @@ export declare function handler(opts: PackAppOptions, params: string[]): Promise
|
|
|
16
16
|
export interface ProjectAppConfig {
|
|
17
17
|
entry?: string;
|
|
18
18
|
targets?: string[];
|
|
19
|
-
|
|
19
|
+
runtime?: string;
|
|
20
20
|
outputDir?: string;
|
|
21
21
|
outputName?: string;
|
|
22
22
|
}
|
package/lib/pack-app/packApp.js
CHANGED
|
@@ -30,7 +30,7 @@ export function cliOptionsTypes() {
|
|
|
30
30
|
return {
|
|
31
31
|
entry: String,
|
|
32
32
|
target: [String, Array],
|
|
33
|
-
|
|
33
|
+
runtime: String,
|
|
34
34
|
'output-dir': String,
|
|
35
35
|
'output-name': String,
|
|
36
36
|
};
|
|
@@ -47,13 +47,13 @@ export function help() {
|
|
|
47
47
|
'the injection. The running Node.js is used when it is new enough; otherwise, the ' +
|
|
48
48
|
`latest Node.js v${MIN_BUILDER_VERSION.major}.${MIN_BUILDER_VERSION.minor}+ in the ` +
|
|
49
49
|
`v${MIN_BUILDER_VERSION.major}.x line is downloaded automatically.\n\n` +
|
|
50
|
-
'Defaults for --entry, --target, --
|
|
50
|
+
'Defaults for --entry, --target, --runtime, --output-dir, and --output-name can be ' +
|
|
51
51
|
'set in the package.json under "pnpm.app". CLI flags override the config; --target entirely ' +
|
|
52
52
|
'replaces the configured list so you can narrow it at invocation time.',
|
|
53
53
|
url: docsUrl('pack-app'),
|
|
54
54
|
usages: [
|
|
55
55
|
'pnpm pack-app --entry dist/index.cjs --target linux-x64 --target win32-x64',
|
|
56
|
-
'pnpm pack-app --entry dist/index.cjs --target linux-x64-musl --node
|
|
56
|
+
'pnpm pack-app --entry dist/index.cjs --target linux-x64-musl --runtime node@22',
|
|
57
57
|
],
|
|
58
58
|
descriptionLists: [
|
|
59
59
|
{
|
|
@@ -69,9 +69,10 @@ export function help() {
|
|
|
69
69
|
shortAlias: '-t',
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
|
-
description: '
|
|
72
|
+
description: 'Runtime to embed in the output executables, as a "<name>@<version>" spec ' +
|
|
73
|
+
'(e.g. "node@22", "node@22.0.0", "node@lts"). Only "node" is supported today. ' +
|
|
73
74
|
'Defaults to the running Node.js version.',
|
|
74
|
-
name: '--
|
|
75
|
+
name: '--runtime',
|
|
75
76
|
},
|
|
76
77
|
{
|
|
77
78
|
description: 'Output directory for the built executables. Defaults to "dist-app".',
|
|
@@ -115,10 +116,14 @@ export async function handler(opts, params) {
|
|
|
115
116
|
throw new PnpmError('PACK_APP_MISSING_TARGET', `"pnpm pack-app" requires at least one target — pass --target <triplet> or set "pnpm.app.targets" in package.json. Supported: ${SUPPORTED_TARGETS}`);
|
|
116
117
|
}
|
|
117
118
|
const targets = rawTargets.map(parseTarget);
|
|
119
|
+
// Parse the runtime before output-name derivation and any network work so
|
|
120
|
+
// that a malformed --runtime fails fast with a clear error instead of being
|
|
121
|
+
// masked by later problems (missing package.json name, registry lookup, etc.).
|
|
122
|
+
const runtimeSpec = opts.runtime ?? project.app?.runtime ?? `node@${process.version.slice(1)}`;
|
|
123
|
+
const { version: requestedNodeSpec } = parseRuntime(runtimeSpec);
|
|
118
124
|
const outputDir = path.resolve(opts.dir, opts.outputDir ?? project.app?.outputDir ?? 'dist-app');
|
|
119
125
|
await mkdir(outputDir, { recursive: true });
|
|
120
126
|
const outputName = validateOutputName(opts.outputName ?? project.app?.outputName ?? deriveOutputNameFromPackage(project, opts.dir));
|
|
121
|
-
const requestedNodeSpec = opts.nodeVersion ?? project.app?.nodeVersion ?? process.version.slice(1);
|
|
122
127
|
const fetch = createFetchFromRegistry(opts);
|
|
123
128
|
const buildRoot = path.join(opts.pnpmHomeDir, 'pack-app');
|
|
124
129
|
const builderBin = await resolveBuilderBinary({ fetch, nodeDownloadMirrors: opts.nodeDownloadMirrors, buildRoot });
|
|
@@ -270,6 +275,21 @@ function parseTarget(raw) {
|
|
|
270
275
|
}
|
|
271
276
|
return { raw, platform, arch, libc: libc || undefined };
|
|
272
277
|
}
|
|
278
|
+
// Runtime spec is "<name>@<version>". Only "node" is supported today; the
|
|
279
|
+
// prefix is kept so future runtimes (bun, deno) can share the same flag
|
|
280
|
+
// without a breaking change. Reading the runtime name rather than a bare
|
|
281
|
+
// version also avoids shadowing pnpm's global `node-version` rc setting,
|
|
282
|
+
// whose value would otherwise leak into Config['nodeVersion'] and override
|
|
283
|
+
// `pnpm.app.runtime`.
|
|
284
|
+
const SUPPORTED_RUNTIMES = ['node'];
|
|
285
|
+
const RUNTIME_PATTERN = /^(node)@(.+)$/;
|
|
286
|
+
function parseRuntime(spec) {
|
|
287
|
+
const match = RUNTIME_PATTERN.exec(spec);
|
|
288
|
+
if (!match) {
|
|
289
|
+
throw new PnpmError('PACK_APP_INVALID_RUNTIME', `Invalid runtime "${spec}". Expected format: <name>@<version> (supported runtimes: ${SUPPORTED_RUNTIMES.join(', ')}; e.g. "node@22.0.0", "node@lts").`);
|
|
290
|
+
}
|
|
291
|
+
return { name: match[1], version: match[2] };
|
|
292
|
+
}
|
|
273
293
|
// Characters that Win32 rejects in filenames, plus NUL. Path separators are
|
|
274
294
|
// checked separately via `path.basename` so the message is crisp.
|
|
275
295
|
const INVALID_FILENAME_CHARS = /[<>:"|?*\0]/;
|
|
@@ -319,7 +339,7 @@ async function readProjectAppConfig(dir) {
|
|
|
319
339
|
return { name, app: validateAppConfig(appField) };
|
|
320
340
|
}
|
|
321
341
|
function validateAppConfig(raw) {
|
|
322
|
-
const known = new Set(['entry', 'targets', '
|
|
342
|
+
const known = new Set(['entry', 'targets', 'runtime', 'outputDir', 'outputName']);
|
|
323
343
|
for (const key of Object.keys(raw)) {
|
|
324
344
|
if (!known.has(key)) {
|
|
325
345
|
throw new PnpmError('PACK_APP_INVALID_CONFIG', `Unknown "pnpm.app.${key}" setting in package.json. Allowed keys: ${Array.from(known).join(', ')}.`);
|
|
@@ -338,11 +358,11 @@ function validateAppConfig(raw) {
|
|
|
338
358
|
}
|
|
339
359
|
config.targets = raw.targets;
|
|
340
360
|
}
|
|
341
|
-
if (raw.
|
|
342
|
-
if (typeof raw.
|
|
343
|
-
throw new PnpmError('PACK_APP_INVALID_CONFIG', '"pnpm.app.
|
|
361
|
+
if (raw.runtime != null) {
|
|
362
|
+
if (typeof raw.runtime !== 'string') {
|
|
363
|
+
throw new PnpmError('PACK_APP_INVALID_CONFIG', '"pnpm.app.runtime" must be a string.');
|
|
344
364
|
}
|
|
345
|
-
config.
|
|
365
|
+
config.runtime = raw.runtime;
|
|
346
366
|
}
|
|
347
367
|
if (raw.outputDir != null) {
|
|
348
368
|
if (typeof raw.outputDir !== 'string') {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnpm/releasing.commands",
|
|
3
|
-
"version": "1100.
|
|
3
|
+
"version": "1100.2.0",
|
|
4
4
|
"description": "Commands for deploy, pack, and publish",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pnpm",
|
|
@@ -48,34 +48,34 @@
|
|
|
48
48
|
"write-json-file": "^7.0.0",
|
|
49
49
|
"write-yaml-file": "^6.0.0",
|
|
50
50
|
"@pnpm/bins.resolver": "1100.0.1",
|
|
51
|
+
"@pnpm/catalogs.types": "1100.0.0",
|
|
51
52
|
"@pnpm/cli.utils": "1101.0.0",
|
|
52
53
|
"@pnpm/cli.common-cli-options-help": "1100.0.0",
|
|
53
54
|
"@pnpm/config.pick-registry-for-package": "1100.0.1",
|
|
55
|
+
"@pnpm/config.reader": "1101.1.1",
|
|
56
|
+
"@pnpm/deps.path": "1100.0.1",
|
|
57
|
+
"@pnpm/engine.runtime.commands": "1100.0.4",
|
|
54
58
|
"@pnpm/constants": "1100.0.0",
|
|
55
|
-
"@pnpm/engine.runtime.node-resolver": "
|
|
59
|
+
"@pnpm/engine.runtime.node-resolver": "1101.0.0",
|
|
56
60
|
"@pnpm/error": "1100.0.0",
|
|
57
|
-
"@pnpm/
|
|
61
|
+
"@pnpm/exec.lifecycle": "1100.0.4",
|
|
58
62
|
"@pnpm/exec.pnpm-cli-runner": "1100.0.0",
|
|
59
|
-
"@pnpm/
|
|
60
|
-
"@pnpm/
|
|
61
|
-
"@pnpm/installing.client": "1100.0.3",
|
|
62
|
-
"@pnpm/fs.is-empty-dir-or-nothing": "1100.0.0",
|
|
63
|
+
"@pnpm/fetching.directory-fetcher": "1100.0.4",
|
|
64
|
+
"@pnpm/fs.indexed-pkg-importer": "1100.0.3",
|
|
63
65
|
"@pnpm/fs.packlist": "1100.0.0",
|
|
64
|
-
"@pnpm/
|
|
65
|
-
"@pnpm/fs.
|
|
66
|
-
"@pnpm/
|
|
66
|
+
"@pnpm/installing.client": "1100.0.4",
|
|
67
|
+
"@pnpm/fs.is-empty-dir-or-nothing": "1100.0.0",
|
|
68
|
+
"@pnpm/installing.commands": "1100.1.2",
|
|
67
69
|
"@pnpm/lockfile.types": "1100.0.2",
|
|
68
|
-
"@pnpm/network.
|
|
70
|
+
"@pnpm/network.fetch": "1100.0.1",
|
|
69
71
|
"@pnpm/network.git-utils": "1100.0.0",
|
|
72
|
+
"@pnpm/lockfile.fs": "1100.0.3",
|
|
70
73
|
"@pnpm/releasing.exportable-manifest": "1100.0.2",
|
|
71
|
-
"@pnpm/
|
|
74
|
+
"@pnpm/network.web-auth": "1101.0.0",
|
|
72
75
|
"@pnpm/resolving.resolver-base": "1100.1.0",
|
|
73
|
-
"@pnpm/
|
|
74
|
-
"@pnpm/workspace.projects-filter": "1100.0.
|
|
75
|
-
"@pnpm/workspace.projects-sorter": "1100.0.1"
|
|
76
|
-
"@pnpm/network.fetch": "1100.0.1",
|
|
77
|
-
"@pnpm/config.reader": "1101.1.0",
|
|
78
|
-
"@pnpm/installing.commands": "1100.1.1"
|
|
76
|
+
"@pnpm/types": "1101.0.0",
|
|
77
|
+
"@pnpm/workspace.projects-filter": "1100.0.4",
|
|
78
|
+
"@pnpm/workspace.projects-sorter": "1100.0.1"
|
|
79
79
|
},
|
|
80
80
|
"peerDependencies": {
|
|
81
81
|
"@pnpm/logger": ">=1001.0.0 <1002.0.0"
|
|
@@ -98,15 +98,15 @@
|
|
|
98
98
|
"load-json-file": "^7.0.1",
|
|
99
99
|
"tar": "^7.5.10",
|
|
100
100
|
"write-yaml-file": "^6.0.0",
|
|
101
|
-
"@pnpm/
|
|
102
|
-
"@pnpm/prepare": "1100.0.2",
|
|
103
|
-
"@pnpm/assert-project": "1100.0.2",
|
|
104
|
-
"@pnpm/releasing.commands": "1100.1.0",
|
|
101
|
+
"@pnpm/assert-project": "1100.0.3",
|
|
105
102
|
"@pnpm/logger": "1100.0.0",
|
|
106
|
-
"@pnpm/test-fixtures": "1100.0.0",
|
|
107
|
-
"@pnpm/testing.command-defaults": "1100.0.1",
|
|
108
103
|
"@pnpm/catalogs.config": "1100.0.0",
|
|
109
|
-
"@pnpm/
|
|
104
|
+
"@pnpm/prepare": "1100.0.3",
|
|
105
|
+
"@pnpm/hooks.pnpmfile": "1100.0.3",
|
|
106
|
+
"@pnpm/testing.command-defaults": "1100.0.1",
|
|
107
|
+
"@pnpm/test-ipc-server": "1100.0.0",
|
|
108
|
+
"@pnpm/releasing.commands": "1100.2.0",
|
|
109
|
+
"@pnpm/test-fixtures": "1100.0.0"
|
|
110
110
|
},
|
|
111
111
|
"engines": {
|
|
112
112
|
"node": ">=22.13"
|