@pnpm/exe 12.0.0-alpha.9 → 12.0.0-beta.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/install.js +24 -0
- package/package.json +10 -10
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,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnpm/exe",
|
|
3
|
-
"
|
|
3
|
+
"version": "12.0.0-beta.1",
|
|
4
|
+
"description": "Fast, disk space efficient package manager",
|
|
4
5
|
"keywords": [
|
|
5
6
|
"pnpm",
|
|
6
7
|
"package manager",
|
|
@@ -31,16 +32,15 @@
|
|
|
31
32
|
"pnx",
|
|
32
33
|
"install.js"
|
|
33
34
|
],
|
|
34
|
-
"version": "12.0.0-alpha.9",
|
|
35
35
|
"optionalDependencies": {
|
|
36
|
-
"@pnpm/exe.win32-x64": "12.0.0-
|
|
37
|
-
"@pnpm/exe.win32-arm64": "12.0.0-
|
|
38
|
-
"@pnpm/exe.darwin-x64": "12.0.0-
|
|
39
|
-
"@pnpm/exe.darwin-arm64": "12.0.0-
|
|
40
|
-
"@pnpm/exe.linux-x64": "12.0.0-
|
|
41
|
-
"@pnpm/exe.linux-arm64": "12.0.0-
|
|
42
|
-
"@pnpm/exe.linux-x64-musl": "12.0.0-
|
|
43
|
-
"@pnpm/exe.linux-arm64-musl": "12.0.0-
|
|
36
|
+
"@pnpm/exe.win32-x64": "12.0.0-beta.1",
|
|
37
|
+
"@pnpm/exe.win32-arm64": "12.0.0-beta.1",
|
|
38
|
+
"@pnpm/exe.darwin-x64": "12.0.0-beta.1",
|
|
39
|
+
"@pnpm/exe.darwin-arm64": "12.0.0-beta.1",
|
|
40
|
+
"@pnpm/exe.linux-x64": "12.0.0-beta.1",
|
|
41
|
+
"@pnpm/exe.linux-arm64": "12.0.0-beta.1",
|
|
42
|
+
"@pnpm/exe.linux-x64-musl": "12.0.0-beta.1",
|
|
43
|
+
"@pnpm/exe.linux-arm64-musl": "12.0.0-beta.1"
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|
|
46
46
|
"preinstall": "node install.js"
|