@pnpm/engine.runtime.commands 1100.1.7 → 1100.1.9
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/runtime/runtime.js +14 -0
- package/package.json +7 -6
package/lib/runtime/runtime.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { docsUrl } from '@pnpm/cli.utils';
|
|
2
2
|
import { PnpmError } from '@pnpm/error';
|
|
3
3
|
import { runPnpmCli } from '@pnpm/exec.pnpm-cli-runner';
|
|
4
|
+
import { isRuntimeAlias, RUNTIME_NAMES } from '@pnpm/types';
|
|
4
5
|
import { renderHelp } from 'render-help';
|
|
5
6
|
export const skipPackageManagerCheck = true;
|
|
6
7
|
export function rcOptionsTypes() {
|
|
@@ -82,7 +83,20 @@ function runtimeSet(opts, params) {
|
|
|
82
83
|
if (!runtimeName) {
|
|
83
84
|
throw new PnpmError('MISSING_RUNTIME_NAME', '"pnpm runtime set <name> <version>" requires a runtime name (e.g. node, deno, bun)');
|
|
84
85
|
}
|
|
86
|
+
// The runtime name is interpolated into an `add` selector, so reject
|
|
87
|
+
// anything that isn't a known runtime before it can be misread as a
|
|
88
|
+
// comma-separated package list or a local path by the install pipeline.
|
|
89
|
+
if (!isRuntimeAlias(runtimeName)) {
|
|
90
|
+
throw new PnpmError('INVALID_RUNTIME_NAME', `"${runtimeName}" is not a supported runtime. Supported runtimes are: ${RUNTIME_NAMES.join(', ')}`);
|
|
91
|
+
}
|
|
85
92
|
const versionSpec = params[1]?.trim();
|
|
93
|
+
// The version is interpolated into the same selector, which the global-add
|
|
94
|
+
// pipeline splits on commas. Reject a comma so `runtime set node 22,evil -g`
|
|
95
|
+
// can't smuggle in a second install target. No valid runtime version
|
|
96
|
+
// (semver, dist-tag, channel) contains one.
|
|
97
|
+
if (versionSpec?.includes(',')) {
|
|
98
|
+
throw new PnpmError('INVALID_RUNTIME_VERSION', `Invalid runtime version "${versionSpec}": a version cannot contain a comma`);
|
|
99
|
+
}
|
|
86
100
|
const args = ['add', `${runtimeName}@runtime:${versionSpec ?? ''}`];
|
|
87
101
|
// Default to `devEngines.runtime`; the manifest writer maps a
|
|
88
102
|
// `devDependencies.<runtime>: runtime:<version>` entry to it.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnpm/engine.runtime.commands",
|
|
3
|
-
"version": "1100.1.
|
|
3
|
+
"version": "1100.1.9",
|
|
4
4
|
"description": "pnpm commands for managing runtimes",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pnpm",
|
|
@@ -29,12 +29,13 @@
|
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"render-help": "^2.0.0",
|
|
32
|
+
"@pnpm/config.reader": "1101.11.1",
|
|
32
33
|
"@pnpm/cli.utils": "1101.0.13",
|
|
33
|
-
"@pnpm/
|
|
34
|
-
"@pnpm/engine.runtime.node-resolver": "1101.1.9",
|
|
34
|
+
"@pnpm/engine.runtime.node-resolver": "1101.1.11",
|
|
35
35
|
"@pnpm/error": "1100.0.1",
|
|
36
|
+
"@pnpm/network.fetch": "1100.1.4",
|
|
36
37
|
"@pnpm/exec.pnpm-cli-runner": "1100.0.1",
|
|
37
|
-
"@pnpm/
|
|
38
|
+
"@pnpm/types": "1101.3.2"
|
|
38
39
|
},
|
|
39
40
|
"peerDependencies": {
|
|
40
41
|
"@pnpm/logger": "^1100.0.0"
|
|
@@ -42,8 +43,8 @@
|
|
|
42
43
|
"devDependencies": {
|
|
43
44
|
"@jest/globals": "30.4.1",
|
|
44
45
|
"cross-env": "^10.1.0",
|
|
45
|
-
"@pnpm/
|
|
46
|
-
"@pnpm/
|
|
46
|
+
"@pnpm/engine.runtime.commands": "1100.1.9",
|
|
47
|
+
"@pnpm/logger": "1100.0.0"
|
|
47
48
|
},
|
|
48
49
|
"engines": {
|
|
49
50
|
"node": ">=22.13"
|