@pnpm/engine.pm.commands 1101.0.0 → 1101.0.1
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/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/self-updater/installPnpm.d.ts +7 -0
- package/lib/self-updater/installPnpm.js +19 -10
- package/package.json +19 -18
package/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { selfUpdate } from './self-updater/index.js';
|
|
2
|
-
export { installPnpm, installPnpmToStore, linkExePlatformBinary } from './self-updater/installPnpm.js';
|
|
2
|
+
export { exePlatformPkgDirName, installPnpm, installPnpmToStore, linkExePlatformBinary } from './self-updater/installPnpm.js';
|
|
3
3
|
export { setup } from './setup/index.js';
|
|
4
4
|
export { withCmd } from './with/index.js';
|
package/lib/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { selfUpdate } from './self-updater/index.js';
|
|
2
|
-
export { installPnpm, installPnpmToStore, linkExePlatformBinary } from './self-updater/installPnpm.js';
|
|
2
|
+
export { exePlatformPkgDirName, installPnpm, installPnpmToStore, linkExePlatformBinary } from './self-updater/installPnpm.js';
|
|
3
3
|
export { setup } from './setup/index.js';
|
|
4
4
|
export { withCmd } from './with/index.js';
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -39,4 +39,11 @@ export declare function installPnpmToStore(pnpmVersion: string, opts: {
|
|
|
39
39
|
}): Promise<{
|
|
40
40
|
binDir: string;
|
|
41
41
|
}>;
|
|
42
|
+
/**
|
|
43
|
+
* Computes the scope-local directory name of the `@pnpm/exe` platform
|
|
44
|
+
* package for a given host: `exe.<platform>-<arch>[-musl]`. Pure so that the
|
|
45
|
+
* musl branch is unit-testable without mocking detect-libc or patching
|
|
46
|
+
* process.platform.
|
|
47
|
+
*/
|
|
48
|
+
export declare function exePlatformPkgDirName(platform: NodeJS.Platform, arch: string, libcFamily: string | null): string;
|
|
42
49
|
export declare function linkExePlatformBinary(installDir: string): void;
|
|
@@ -9,6 +9,7 @@ import { installGlobalPackages } from '@pnpm/global.commands';
|
|
|
9
9
|
import { cleanOrphanedInstallDirs, createGlobalCacheKey, createInstallDir, findGlobalPackage, getHashLink, } from '@pnpm/global.packages';
|
|
10
10
|
import { headlessInstall } from '@pnpm/installing.deps-restorer';
|
|
11
11
|
import { registerProject } from '@pnpm/store.controller';
|
|
12
|
+
import { familySync } from 'detect-libc';
|
|
12
13
|
import { symlinkDir } from 'symlink-dir';
|
|
13
14
|
// @pnpm/exe has platform-specific binaries, so its GVS hash must
|
|
14
15
|
// include ENGINE_NAME for correct per-platform resolution.
|
|
@@ -227,17 +228,25 @@ async function installFromResolution(installDir, opts, params) {
|
|
|
227
228
|
allowBuilds: {},
|
|
228
229
|
}, params);
|
|
229
230
|
}
|
|
230
|
-
|
|
231
|
+
/**
|
|
232
|
+
* Computes the scope-local directory name of the `@pnpm/exe` platform
|
|
233
|
+
* package for a given host: `exe.<platform>-<arch>[-musl]`. Pure so that the
|
|
234
|
+
* musl branch is unit-testable without mocking detect-libc or patching
|
|
235
|
+
* process.platform.
|
|
236
|
+
*/
|
|
237
|
+
export function exePlatformPkgDirName(platform, arch, libcFamily) {
|
|
238
|
+
const normalizedArch = platform === 'win32' && arch === 'ia32' ? 'x86' : arch;
|
|
239
|
+
const libcSuffix = platform === 'linux' && libcFamily === 'musl' ? '-musl' : '';
|
|
240
|
+
return `exe.${platform}-${normalizedArch}${libcSuffix}`;
|
|
241
|
+
}
|
|
242
|
+
// @pnpm/exe bundles Node.js via optional platform-specific packages
|
|
243
|
+
// (e.g. @pnpm/exe.darwin-arm64, @pnpm/exe.linux-x64-musl).
|
|
231
244
|
// Its postinstall script links the correct binary into the @pnpm/exe package dir.
|
|
232
245
|
// Since scripts are disabled during install (to support systems without Node.js),
|
|
233
246
|
// we replicate that linking here.
|
|
234
247
|
export function linkExePlatformBinary(installDir) {
|
|
235
|
-
const platform = process.platform
|
|
236
|
-
|
|
237
|
-
: process.platform === 'darwin'
|
|
238
|
-
? 'macos'
|
|
239
|
-
: process.platform;
|
|
240
|
-
const arch = platform === 'win' && process.arch === 'ia32' ? 'x86' : process.arch;
|
|
248
|
+
const platform = process.platform;
|
|
249
|
+
const pkgDirName = exePlatformPkgDirName(platform, process.arch, familySync());
|
|
241
250
|
const exePkgDir = path.join(installDir, 'node_modules', '@pnpm', 'exe');
|
|
242
251
|
if (!fs.existsSync(exePkgDir))
|
|
243
252
|
return;
|
|
@@ -245,14 +254,14 @@ export function linkExePlatformBinary(installDir) {
|
|
|
245
254
|
// to the top-level node_modules. It's a dependency of @pnpm/exe and lives as a
|
|
246
255
|
// sibling in the virtual store. Resolve through the @pnpm/exe symlink to find it.
|
|
247
256
|
const exeRealDir = fs.realpathSync(exePkgDir);
|
|
248
|
-
const platformPkgDir = path.join(path.dirname(exeRealDir),
|
|
249
|
-
const executable = platform === '
|
|
257
|
+
const platformPkgDir = path.join(path.dirname(exeRealDir), pkgDirName);
|
|
258
|
+
const executable = platform === 'win32' ? 'pnpm.exe' : 'pnpm';
|
|
250
259
|
const src = path.join(platformPkgDir, executable);
|
|
251
260
|
if (!fs.existsSync(src))
|
|
252
261
|
return;
|
|
253
262
|
const dest = path.join(exePkgDir, executable);
|
|
254
263
|
forceLink(src, dest);
|
|
255
|
-
if (platform === '
|
|
264
|
+
if (platform === 'win32') {
|
|
256
265
|
const exePkgJsonPath = path.join(exePkgDir, 'package.json');
|
|
257
266
|
const exePkg = JSON.parse(fs.readFileSync(exePkgJsonPath, 'utf8'));
|
|
258
267
|
exePkg.bin.pnpm = 'pnpm.exe';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnpm/engine.pm.commands",
|
|
3
|
-
"version": "1101.0.
|
|
3
|
+
"version": "1101.0.1",
|
|
4
4
|
"description": "pnpm commands for self-updating and setting up pnpm",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pnpm",
|
|
@@ -26,30 +26,31 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@pnpm/os.env.path-extender": "^3.0.0",
|
|
28
28
|
"cross-spawn": "^7.0.6",
|
|
29
|
+
"detect-libc": "^2.0.3",
|
|
29
30
|
"path-name": "^1.0.0",
|
|
30
31
|
"ramda": "npm:@pnpm/ramda@0.28.1",
|
|
31
32
|
"render-help": "^2.0.0",
|
|
32
33
|
"semver": "^7.7.2",
|
|
33
34
|
"symlink-dir": "^10.0.1",
|
|
34
35
|
"@pnpm/building.policy": "1100.0.1",
|
|
36
|
+
"@pnpm/cli.utils": "1101.0.0",
|
|
35
37
|
"@pnpm/bins.linker": "1100.0.2",
|
|
36
38
|
"@pnpm/cli.meta": "1100.0.1",
|
|
37
|
-
"@pnpm/cli.utils": "1101.0.0",
|
|
38
|
-
"@pnpm/config.reader": "1101.0.0",
|
|
39
|
-
"@pnpm/deps.graph-hasher": "1100.0.1",
|
|
40
39
|
"@pnpm/error": "1100.0.0",
|
|
41
|
-
"@pnpm/
|
|
42
|
-
"@pnpm/global.commands": "1100.0.
|
|
40
|
+
"@pnpm/deps.graph-hasher": "1100.1.0",
|
|
41
|
+
"@pnpm/global.commands": "1100.0.3",
|
|
43
42
|
"@pnpm/global.packages": "1100.0.1",
|
|
44
|
-
"@pnpm/
|
|
45
|
-
"@pnpm/installing.
|
|
46
|
-
"@pnpm/
|
|
43
|
+
"@pnpm/config.reader": "1101.1.0",
|
|
44
|
+
"@pnpm/installing.client": "1100.0.3",
|
|
45
|
+
"@pnpm/installing.deps-restorer": "1100.0.3",
|
|
46
|
+
"@pnpm/lockfile.types": "1100.0.2",
|
|
47
|
+
"@pnpm/installing.env-installer": "1100.1.1",
|
|
47
48
|
"@pnpm/shell.path": "1100.0.0",
|
|
48
|
-
"@pnpm/resolving.npm-resolver": "1100.0.1",
|
|
49
|
-
"@pnpm/store.connection-manager": "1100.0.2",
|
|
50
|
-
"@pnpm/store.controller": "1100.0.1",
|
|
51
49
|
"@pnpm/types": "1101.0.0",
|
|
52
|
-
"@pnpm/
|
|
50
|
+
"@pnpm/resolving.npm-resolver": "1100.1.0",
|
|
51
|
+
"@pnpm/workspace.project-manifest-reader": "1100.0.2",
|
|
52
|
+
"@pnpm/store.controller": "1100.0.2",
|
|
53
|
+
"@pnpm/store.connection-manager": "1100.0.3"
|
|
53
54
|
},
|
|
54
55
|
"peerDependencies": {
|
|
55
56
|
"@pnpm/logger": ">=1001.0.0 <1002.0.0"
|
|
@@ -59,12 +60,12 @@
|
|
|
59
60
|
"@types/cross-spawn": "^6.0.6",
|
|
60
61
|
"@types/ramda": "0.31.1",
|
|
61
62
|
"@types/semver": "7.7.1",
|
|
62
|
-
"@pnpm/constants": "1100.0.0",
|
|
63
|
-
"@pnpm/error": "1100.0.0",
|
|
64
63
|
"@pnpm/logger": "1100.0.0",
|
|
65
|
-
"@pnpm/
|
|
66
|
-
"@pnpm/
|
|
67
|
-
"@pnpm/
|
|
64
|
+
"@pnpm/error": "1100.0.0",
|
|
65
|
+
"@pnpm/constants": "1100.0.0",
|
|
66
|
+
"@pnpm/prepare": "1100.0.2",
|
|
67
|
+
"@pnpm/testing.mock-agent": "1100.0.1",
|
|
68
|
+
"@pnpm/engine.pm.commands": "1101.0.1"
|
|
68
69
|
},
|
|
69
70
|
"engines": {
|
|
70
71
|
"node": ">=22.13"
|