@synsci/openscience 1.2.1 → 1.2.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.
- package/bin/openscience +2 -2
- package/package.json +17 -12
- package/preinstall.mjs +22 -0
package/bin/openscience
CHANGED
|
@@ -59,7 +59,7 @@ const archMap = { x64: "x64", arm64: "arm64", arm: "arm" }
|
|
|
59
59
|
const platform = platformMap[os.platform()] || os.platform()
|
|
60
60
|
const arch = archMap[os.arch()] || os.arch()
|
|
61
61
|
const base = "openscience-" + platform + "-" + arch
|
|
62
|
-
const scopedBase = "
|
|
62
|
+
const scopedBase = "openscience-" + platform + "-" + arch
|
|
63
63
|
|
|
64
64
|
// 2. Search this install's node_modules for the matching platform package.
|
|
65
65
|
// This must come before ~/.openscience or Homebrew fallbacks; otherwise an npm
|
|
@@ -77,7 +77,7 @@ while (true) {
|
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
// Check scoped packages (@synsci/openscience-darwin-arm64)
|
|
80
|
-
const scoped = path.join(modules, "@
|
|
80
|
+
const scoped = path.join(modules, "@synsci")
|
|
81
81
|
if (fs.existsSync(scoped)) {
|
|
82
82
|
const scopedEntries = fs.readdirSync(scoped)
|
|
83
83
|
for (const entry of scopedEntries) {
|
package/package.json
CHANGED
|
@@ -4,20 +4,25 @@
|
|
|
4
4
|
"openscience": "./bin/openscience"
|
|
5
5
|
},
|
|
6
6
|
"scripts": {
|
|
7
|
+
"preinstall": "node ./preinstall.mjs || exit 0",
|
|
7
8
|
"postinstall": "bun ./postinstall.mjs || node ./postinstall.mjs"
|
|
8
9
|
},
|
|
9
|
-
"version": "1.2.
|
|
10
|
+
"version": "1.2.3",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/synthetic-sciences/openscience.git"
|
|
14
|
+
},
|
|
10
15
|
"optionalDependencies": {
|
|
11
|
-
"@synsci/openscience-linux-x64-baseline
|
|
12
|
-
"@synsci/openscience-
|
|
13
|
-
"@synsci/openscience-linux-x64
|
|
14
|
-
"@synsci/openscience-
|
|
15
|
-
"@synsci/openscience-
|
|
16
|
-
"@synsci/openscience-darwin-x64
|
|
17
|
-
"@synsci/openscience-linux-x64-musl": "1.2.
|
|
18
|
-
"@synsci/openscience-
|
|
19
|
-
"@synsci/openscience-linux-arm64": "1.2.
|
|
20
|
-
"@synsci/openscience-windows-x64": "1.2.
|
|
21
|
-
"@synsci/openscience-
|
|
16
|
+
"@synsci/openscience-linux-x64-baseline": "1.2.3",
|
|
17
|
+
"@synsci/openscience-linux-arm64": "1.2.3",
|
|
18
|
+
"@synsci/openscience-linux-x64": "1.2.3",
|
|
19
|
+
"@synsci/openscience-windows-x64": "1.2.3",
|
|
20
|
+
"@synsci/openscience-darwin-arm64": "1.2.3",
|
|
21
|
+
"@synsci/openscience-darwin-x64": "1.2.3",
|
|
22
|
+
"@synsci/openscience-linux-x64-baseline-musl": "1.2.3",
|
|
23
|
+
"@synsci/openscience-linux-x64-musl": "1.2.3",
|
|
24
|
+
"@synsci/openscience-linux-arm64-musl": "1.2.3",
|
|
25
|
+
"@synsci/openscience-windows-x64-baseline": "1.2.3",
|
|
26
|
+
"@synsci/openscience-darwin-x64-baseline": "1.2.3"
|
|
22
27
|
}
|
|
23
28
|
}
|
package/preinstall.mjs
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// Best-effort guard for GLOBAL installs only: the deprecated @synsci/cli
|
|
4
|
+
// package links the same `openscience` bin, and npm refuses to overwrite a
|
|
5
|
+
// bin file owned by another package (EEXIST) — which dead-ends upgrades.
|
|
6
|
+
// Remove the stale package before ours is linked.
|
|
7
|
+
//
|
|
8
|
+
// This must NEVER fail the install: npm policies that block nested npm calls
|
|
9
|
+
// (or script execution entirely) make this best-effort. The `npx synsci`
|
|
10
|
+
// launcher and the openscience.sh/install script handle the conflict
|
|
11
|
+
// deterministically.
|
|
12
|
+
|
|
13
|
+
import { execSync } from "child_process"
|
|
14
|
+
|
|
15
|
+
try {
|
|
16
|
+
if (process.env.npm_config_global === "true" || process.env.npm_config_global === "1") {
|
|
17
|
+
execSync("npm rm -g @synsci/cli", { stdio: "ignore", timeout: 60000 })
|
|
18
|
+
}
|
|
19
|
+
} catch {
|
|
20
|
+
// swallow everything — the install must proceed
|
|
21
|
+
}
|
|
22
|
+
process.exit(0)
|