@pnpm/engine.runtime.commands 1100.0.16 → 1100.1.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/runtime/runtime.d.ts +1 -1
- package/lib/runtime/runtime.js +22 -0
- package/package.json +7 -7
package/lib/runtime/runtime.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Config } from '@pnpm/config.reader';
|
|
2
|
-
export type RuntimeCommandOptions = Pick<Config, 'bin' | 'dir' | 'global' | 'pnpmHomeDir'> & Partial<Pick<Config, 'storeDir' | 'cacheDir'>>;
|
|
2
|
+
export type RuntimeCommandOptions = Pick<Config, 'bin' | 'dir' | 'global' | 'pnpmHomeDir'> & Partial<Pick<Config, 'storeDir' | 'cacheDir' | 'saveDev' | 'saveProd'>>;
|
|
3
3
|
export declare const skipPackageManagerCheck = true;
|
|
4
4
|
export declare function rcOptionsTypes(): Record<string, unknown>;
|
|
5
5
|
export declare function cliOptionsTypes(): Record<string, unknown>;
|
package/lib/runtime/runtime.js
CHANGED
|
@@ -9,6 +9,8 @@ export function rcOptionsTypes() {
|
|
|
9
9
|
export function cliOptionsTypes() {
|
|
10
10
|
return {
|
|
11
11
|
global: Boolean,
|
|
12
|
+
'save-dev': Boolean,
|
|
13
|
+
'save-prod': Boolean,
|
|
12
14
|
};
|
|
13
15
|
}
|
|
14
16
|
export const commandNames = ['runtime', 'rt'];
|
|
@@ -33,11 +35,22 @@ export function help() {
|
|
|
33
35
|
name: '--global',
|
|
34
36
|
shortAlias: '-g',
|
|
35
37
|
},
|
|
38
|
+
{
|
|
39
|
+
description: 'Save the runtime to `devEngines.runtime`. This is the default',
|
|
40
|
+
name: '--save-dev',
|
|
41
|
+
shortAlias: '-D',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
description: 'Save the runtime to `engines.runtime`',
|
|
45
|
+
name: '--save-prod',
|
|
46
|
+
shortAlias: '-P',
|
|
47
|
+
},
|
|
36
48
|
],
|
|
37
49
|
},
|
|
38
50
|
],
|
|
39
51
|
url: docsUrl('runtime'),
|
|
40
52
|
usages: [
|
|
53
|
+
'pnpm runtime set node 22',
|
|
41
54
|
'pnpm runtime set node 22 -g',
|
|
42
55
|
'pnpm runtime set node lts -g',
|
|
43
56
|
'pnpm runtime set node rc/22 -g',
|
|
@@ -71,6 +84,15 @@ function runtimeSet(opts, params) {
|
|
|
71
84
|
}
|
|
72
85
|
const versionSpec = params[1]?.trim();
|
|
73
86
|
const args = ['add', `${runtimeName}@runtime:${versionSpec ?? ''}`];
|
|
87
|
+
// Default to `devEngines.runtime`; the manifest writer maps a
|
|
88
|
+
// `devDependencies.<runtime>: runtime:<version>` entry to it.
|
|
89
|
+
// `saveDev` wins over `saveProd` to match `getSaveType` precedence.
|
|
90
|
+
if (opts.saveDev || !opts.saveProd) {
|
|
91
|
+
args.push('--save-dev');
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
args.push('--save-prod');
|
|
95
|
+
}
|
|
74
96
|
if (opts.global) {
|
|
75
97
|
args.push('--global');
|
|
76
98
|
if (opts.bin)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnpm/engine.runtime.commands",
|
|
3
|
-
"version": "1100.0
|
|
3
|
+
"version": "1100.1.0",
|
|
4
4
|
"description": "pnpm commands for managing runtimes",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pnpm",
|
|
@@ -26,20 +26,20 @@
|
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"render-help": "^2.0.0",
|
|
29
|
-
"@pnpm/
|
|
30
|
-
"@pnpm/engine.runtime.node-resolver": "1101.1.0",
|
|
29
|
+
"@pnpm/cli.utils": "1101.0.8",
|
|
31
30
|
"@pnpm/error": "1100.0.0",
|
|
31
|
+
"@pnpm/config.reader": "1101.4.1",
|
|
32
32
|
"@pnpm/exec.pnpm-cli-runner": "1100.0.1",
|
|
33
|
-
"@pnpm/
|
|
34
|
-
"@pnpm/network.fetch": "1100.0.
|
|
33
|
+
"@pnpm/engine.runtime.node-resolver": "1101.1.2",
|
|
34
|
+
"@pnpm/network.fetch": "1100.0.7"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@pnpm/logger": "
|
|
37
|
+
"@pnpm/logger": "^1001.0.1"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@jest/globals": "30.3.0",
|
|
41
41
|
"cross-env": "^10.1.0",
|
|
42
|
-
"@pnpm/engine.runtime.commands": "1100.0
|
|
42
|
+
"@pnpm/engine.runtime.commands": "1100.1.0",
|
|
43
43
|
"@pnpm/logger": "1100.0.0"
|
|
44
44
|
},
|
|
45
45
|
"engines": {
|