@pnpm/pacquet 0.11.2 → 0.11.3

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.
Files changed (2) hide show
  1. package/bin/pacquet +28 -4
  2. package/package.json +9 -7
package/bin/pacquet CHANGED
@@ -11,12 +11,18 @@ const PLATFORMS = {
11
11
  arm64: "@pacquet/darwin-arm64/pacquet",
12
12
  },
13
13
  linux: {
14
- x64: "@pacquet/linux-x64/pacquet",
15
- arm64: "@pacquet/linux-arm64/pacquet",
14
+ x64: {
15
+ glibc: "@pacquet/linux-x64/pacquet",
16
+ musl: "@pacquet/linux-x64-musl/pacquet",
17
+ },
18
+ arm64: {
19
+ glibc: "@pacquet/linux-arm64/pacquet",
20
+ musl: "@pacquet/linux-arm64-musl/pacquet",
21
+ },
16
22
  },
17
23
  };
18
24
 
19
- const binPath = PLATFORMS?.[platform]?.[arch];
25
+ const binPath = getBinPath();
20
26
  if (binPath) {
21
27
  const result = require("child_process").spawnSync(
22
28
  require.resolve(binPath),
@@ -46,6 +52,24 @@ if (binPath) {
46
52
  process.exitCode = 1;
47
53
  }
48
54
 
55
+ function getBinPath() {
56
+ const platformEntry = PLATFORMS?.[platform]?.[arch];
57
+
58
+ if (platformEntry == null || typeof platformEntry === "string") {
59
+ return platformEntry;
60
+ }
61
+
62
+ return platformEntry[detectLinuxLibc()];
63
+ }
64
+
65
+ function detectLinuxLibc() {
66
+ if (platform !== "linux") {
67
+ return null;
68
+ }
69
+
70
+ return process.report.getReport().header.glibcVersionRuntime ? "glibc" : "musl";
71
+ }
72
+
49
73
  /**
50
74
  * NPM, Yarn, and other package manager set the `npm_config_user_agent`. It has the following format:
51
75
  *
@@ -63,4 +87,4 @@ function detectPackageManager() {
63
87
  }
64
88
 
65
89
  return userAgent.split(" ")[0];
66
- }
90
+ }
package/package.json CHANGED
@@ -22,14 +22,16 @@
22
22
  "files": [
23
23
  "bin/pacquet"
24
24
  ],
25
- "version": "0.11.2",
25
+ "version": "0.11.3",
26
26
  "optionalDependencies": {
27
- "@pacquet/win32-x64": "0.11.2",
28
- "@pacquet/win32-arm64": "0.11.2",
29
- "@pacquet/darwin-x64": "0.11.2",
30
- "@pacquet/darwin-arm64": "0.11.2",
31
- "@pacquet/linux-x64": "0.11.2",
32
- "@pacquet/linux-arm64": "0.11.2"
27
+ "@pacquet/win32-x64": "0.11.3",
28
+ "@pacquet/win32-arm64": "0.11.3",
29
+ "@pacquet/darwin-x64": "0.11.3",
30
+ "@pacquet/darwin-arm64": "0.11.3",
31
+ "@pacquet/linux-x64": "0.11.3",
32
+ "@pacquet/linux-arm64": "0.11.3",
33
+ "@pacquet/linux-x64-musl": "0.11.3",
34
+ "@pacquet/linux-arm64-musl": "0.11.3"
33
35
  },
34
36
  "bin": {
35
37
  "pacquet": "bin/pacquet"