@pnpm/tools.plugin-commands-self-updater 1000.1.32 → 1000.1.34
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/installPnpmToTools.js +20 -5
- package/lib/installPnpmToTools.js.map +1 -1
- package/package.json +13 -11
|
@@ -11,9 +11,12 @@ const exec_pnpm_cli_runner_1 = require("@pnpm/exec.pnpm-cli-runner");
|
|
|
11
11
|
const tools_path_1 = require("@pnpm/tools.path");
|
|
12
12
|
const rimraf_1 = require("@zkochan/rimraf");
|
|
13
13
|
const path_temp_1 = require("path-temp");
|
|
14
|
-
const
|
|
14
|
+
const semver_1 = __importDefault(require("semver"));
|
|
15
|
+
const symlink_dir_1 = __importDefault(require("symlink-dir"));
|
|
15
16
|
async function installPnpmToTools(pnpmVersion, opts) {
|
|
16
|
-
|
|
17
|
+
// We have moved pnpm to esm and that prevents us from using pkg to bundle pnpm to an executable.
|
|
18
|
+
// Related issue: https://github.com/yao-pkg/pkg/issues/16
|
|
19
|
+
const currentPkgName = semver_1.default.gt(pnpmVersion, '11.0.0-alpha') ? 'pnpm' : (0, cli_meta_1.getCurrentPackageName)();
|
|
17
20
|
const dir = (0, tools_path_1.getToolDirPath)({
|
|
18
21
|
pnpmHomeDir: opts.pnpmHomeDir,
|
|
19
22
|
tool: {
|
|
@@ -36,7 +39,7 @@ async function installPnpmToTools(pnpmVersion, opts) {
|
|
|
36
39
|
try {
|
|
37
40
|
// The reason we don't just run add.handler is that at this point we might have settings from local config files
|
|
38
41
|
// that we don't want to use while installing the pnpm CLI.
|
|
39
|
-
|
|
42
|
+
const command = [
|
|
40
43
|
'add',
|
|
41
44
|
`${currentPkgName}@${pnpmVersion}`,
|
|
42
45
|
'--loglevel=error',
|
|
@@ -46,8 +49,20 @@ async function installPnpmToTools(pnpmVersion, opts) {
|
|
|
46
49
|
// which breaks the junctions on Windows.
|
|
47
50
|
'--config.node-linker=hoisted',
|
|
48
51
|
'--config.bin=bin',
|
|
49
|
-
]
|
|
50
|
-
|
|
52
|
+
];
|
|
53
|
+
// Respect user's registry configuration when installing pnpm itself.
|
|
54
|
+
// This is important when the user has configured a custom registry (e.g., a mirror)
|
|
55
|
+
// in their .npmrc file, as the temporary directory is outside the project and won't
|
|
56
|
+
// automatically pick up the project's .npmrc configuration.
|
|
57
|
+
if (opts.registries?.default) {
|
|
58
|
+
command.push(`--config.registry=${opts.registries.default}`);
|
|
59
|
+
}
|
|
60
|
+
(0, exec_pnpm_cli_runner_1.runPnpmCli)(command, { cwd: stage });
|
|
61
|
+
// We need the operation of installing pnpm to be atomic.
|
|
62
|
+
// However, we cannot use a rename as that breaks the command shim created for pnpm.
|
|
63
|
+
// Hence, we use a symlink.
|
|
64
|
+
// In future we may switch back to rename if we will move Node.js out of the pnpm subdirectory.
|
|
65
|
+
symlink_dir_1.default.sync(stage, dir);
|
|
51
66
|
}
|
|
52
67
|
catch (err) {
|
|
53
68
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installPnpmToTools.js","sourceRoot":"","sources":["../src/installPnpmToTools.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"installPnpmToTools.js","sourceRoot":"","sources":["../src/installPnpmToTools.ts"],"names":[],"mappings":";;;;;AAiBA,gDA8DC;AA/ED,4CAAmB;AACnB,gDAAuB;AACvB,6CAAsD;AACtD,qEAAuD;AACvD,iDAAiD;AACjD,4CAAgD;AAChD,yCAAoD;AACpD,oDAA2B;AAC3B,8DAAoC;AAS7B,KAAK,UAAU,kBAAkB,CAAE,WAAmB,EAAE,IAA8B;IAC3F,iGAAiG;IACjG,0DAA0D;IAC1D,MAAM,cAAc,GAAG,gBAAM,CAAC,EAAE,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAA,gCAAqB,GAAE,CAAA;IAChG,MAAM,GAAG,GAAG,IAAA,2BAAc,EAAC;QACzB,WAAW,EAA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K,EAAE,GAAG,CAAC,CAAA;IAC7B,CAAC;IAAC,OAAO,GAAY,EAAE,CAAC;QACtB,IAAI,CAAC;YACH,IAAA,aAAM,EAAC,KAAK,CAAC,CAAA;QACf,CAAC;QAAC,MAAM,CAAC,CAAA,CAAC,CAAC,+BAA+B;QAC1C,MAAM,GAAG,CAAA;IACX,CAAC;IACD,OAAO;QACL,cAAc;QACd,OAAO,EAAE,GAAG;QACZ,MAAM;KACP,CAAA;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnpm/tools.plugin-commands-self-updater",
|
|
3
|
-
"version": "1000.1.
|
|
3
|
+
"version": "1000.1.34",
|
|
4
4
|
"description": "A command for updating pnpm itself",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pnpm",
|
|
@@ -27,16 +27,17 @@
|
|
|
27
27
|
"@zkochan/rimraf": "^3.0.2",
|
|
28
28
|
"path-temp": "^2.1.0",
|
|
29
29
|
"ramda": "npm:@pnpm/ramda@0.28.1",
|
|
30
|
-
"rename-overwrite": "^6.0.2",
|
|
31
30
|
"render-help": "^1.0.3",
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"@pnpm/
|
|
35
|
-
"@pnpm/
|
|
36
|
-
"@pnpm/
|
|
37
|
-
"@pnpm/link-bins": "1000.3.0",
|
|
31
|
+
"semver": "^7.7.1",
|
|
32
|
+
"symlink-dir": "^6.0.5",
|
|
33
|
+
"@pnpm/cli-meta": "1000.0.13",
|
|
34
|
+
"@pnpm/cli-utils": "1001.2.11",
|
|
35
|
+
"@pnpm/config": "1004.6.1",
|
|
38
36
|
"@pnpm/exec.pnpm-cli-runner": "1000.0.1",
|
|
39
|
-
"@pnpm/
|
|
37
|
+
"@pnpm/client": "1001.1.7",
|
|
38
|
+
"@pnpm/link-bins": "1000.3.1",
|
|
39
|
+
"@pnpm/read-project-manifest": "1001.2.1",
|
|
40
|
+
"@pnpm/error": "1000.0.5",
|
|
40
41
|
"@pnpm/tools.path": "1000.0.0"
|
|
41
42
|
},
|
|
42
43
|
"peerDependencies": {
|
|
@@ -46,11 +47,12 @@
|
|
|
46
47
|
"@jest/globals": "29.7.0",
|
|
47
48
|
"@types/cross-spawn": "^6.0.6",
|
|
48
49
|
"@types/ramda": "0.29.12",
|
|
50
|
+
"@types/semver": "7.5.3",
|
|
49
51
|
"cross-spawn": "^7.0.6",
|
|
50
52
|
"nock": "13.3.4",
|
|
51
|
-
"@pnpm/prepare": "1000.0.5",
|
|
52
53
|
"@pnpm/env.path": "1000.0.0",
|
|
53
|
-
"@pnpm/
|
|
54
|
+
"@pnpm/prepare": "1000.0.7",
|
|
55
|
+
"@pnpm/tools.plugin-commands-self-updater": "1000.1.34"
|
|
54
56
|
},
|
|
55
57
|
"engines": {
|
|
56
58
|
"node": ">=18.12"
|