@pnpm/exe 12.0.0-alpha.1 → 12.0.0-alpha.10

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/install.js +24 -0
  2. package/package.json +11 -11
package/install.js CHANGED
@@ -47,6 +47,13 @@ const BIN_NAMES = ['pnpm', 'pn', 'pnpx', 'pnx']
47
47
  setup()
48
48
 
49
49
  function setup () {
50
+ // The committed manifest has no `optionalDependencies`; generate-packages.mjs
51
+ // adds them at release time. Without them this is the monorepo checkout, where
52
+ // the wrapper is a workspace package and there is no native binary to link.
53
+ if (readOwnManifest().optionalDependencies == null) {
54
+ return
55
+ }
56
+
50
57
  const candidates = getBinCandidates()
51
58
  if (candidates.length === 0) {
52
59
  fail(`pnpm does not ship a prebuilt binary for ${platform}-${arch}.`)
@@ -139,6 +146,23 @@ function fail (message) {
139
146
  process.exit(1)
140
147
  }
141
148
 
149
+ // A successful read with no optionalDependencies is the dev checkout (setup
150
+ // no-ops there); a read/parse failure is a corrupt published package and must
151
+ // not be silently swallowed into that same no-op path.
152
+ function readOwnManifest () {
153
+ const manifestPath = path.join(ownDir, 'package.json')
154
+ let manifest
155
+ try {
156
+ manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8'))
157
+ } catch (err) {
158
+ throw new Error(`Failed to read ${manifestPath}: ${err.message}`)
159
+ }
160
+ if (typeof manifest !== 'object' || manifest == null || Array.isArray(manifest)) {
161
+ throw new Error(`Expected ${manifestPath} to contain a JSON object`)
162
+ }
163
+ return manifest
164
+ }
165
+
142
166
  /**
143
167
  * Native binary specifiers to try, most-preferred first; empty when the host is
144
168
  * unsupported. The linux glibc/musl pair is ordered by detected libc, which
package/package.json CHANGED
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "name": "@pnpm/exe",
3
+ "version": "12.0.0-alpha.10",
3
4
  "description": "Fast, disk space efficient package manager — the Rust port of pnpm (alpha, not production-ready)",
4
5
  "keywords": [
5
6
  "pnpm",
@@ -7,12 +8,12 @@
7
8
  "rust"
8
9
  ],
9
10
  "license": "MIT",
10
- "homepage": "https://github.com/pnpm/pnpm/tree/main/pacquet",
11
+ "homepage": "https://github.com/pnpm/pnpm/tree/main/pnpm",
11
12
  "bugs": "https://github.com/pnpm/pnpm/issues",
12
13
  "repository": {
13
14
  "type": "git",
14
15
  "url": "https://github.com/pnpm/pnpm",
15
- "directory": "pacquet/npm/pnpm-exe"
16
+ "directory": "pnpm/npm/pnpm-exe"
16
17
  },
17
18
  "bin": {
18
19
  "pnpm": "pnpm",
@@ -31,16 +32,15 @@
31
32
  "pnx",
32
33
  "install.js"
33
34
  ],
34
- "version": "12.0.0-alpha.1",
35
35
  "optionalDependencies": {
36
- "@pnpm/exe.win32-x64": "12.0.0-alpha.1",
37
- "@pnpm/exe.win32-arm64": "12.0.0-alpha.1",
38
- "@pnpm/exe.darwin-x64": "12.0.0-alpha.1",
39
- "@pnpm/exe.darwin-arm64": "12.0.0-alpha.1",
40
- "@pnpm/exe.linux-x64": "12.0.0-alpha.1",
41
- "@pnpm/exe.linux-arm64": "12.0.0-alpha.1",
42
- "@pnpm/exe.linux-x64-musl": "12.0.0-alpha.1",
43
- "@pnpm/exe.linux-arm64-musl": "12.0.0-alpha.1"
36
+ "@pnpm/exe.win32-x64": "12.0.0-alpha.10",
37
+ "@pnpm/exe.win32-arm64": "12.0.0-alpha.10",
38
+ "@pnpm/exe.darwin-x64": "12.0.0-alpha.10",
39
+ "@pnpm/exe.darwin-arm64": "12.0.0-alpha.10",
40
+ "@pnpm/exe.linux-x64": "12.0.0-alpha.10",
41
+ "@pnpm/exe.linux-arm64": "12.0.0-alpha.10",
42
+ "@pnpm/exe.linux-x64-musl": "12.0.0-alpha.10",
43
+ "@pnpm/exe.linux-arm64-musl": "12.0.0-alpha.10"
44
44
  },
45
45
  "scripts": {
46
46
  "preinstall": "node install.js"