@synsci/openscience 1.2.2 → 1.2.4

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/package.json +17 -12
  2. package/preinstall.mjs +22 -0
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.2",
10
+ "version": "1.2.4",
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-musl": "1.2.2",
12
- "@synsci/openscience-windows-x64-baseline": "1.2.2",
13
- "@synsci/openscience-linux-x64-baseline": "1.2.2",
14
- "@synsci/openscience-darwin-x64": "1.2.2",
15
- "@synsci/openscience-linux-arm64-musl": "1.2.2",
16
- "@synsci/openscience-darwin-x64-baseline": "1.2.2",
17
- "@synsci/openscience-linux-x64-musl": "1.2.2",
18
- "@synsci/openscience-darwin-arm64": "1.2.2",
19
- "@synsci/openscience-linux-arm64": "1.2.2",
20
- "@synsci/openscience-windows-x64": "1.2.2",
21
- "@synsci/openscience-linux-x64": "1.2.2"
16
+ "@synsci/openscience-linux-x64-baseline": "1.2.4",
17
+ "@synsci/openscience-linux-arm64": "1.2.4",
18
+ "@synsci/openscience-linux-x64": "1.2.4",
19
+ "@synsci/openscience-windows-x64": "1.2.4",
20
+ "@synsci/openscience-darwin-arm64": "1.2.4",
21
+ "@synsci/openscience-darwin-x64": "1.2.4",
22
+ "@synsci/openscience-linux-x64-baseline-musl": "1.2.4",
23
+ "@synsci/openscience-linux-x64-musl": "1.2.4",
24
+ "@synsci/openscience-linux-arm64-musl": "1.2.4",
25
+ "@synsci/openscience-windows-x64-baseline": "1.2.4",
26
+ "@synsci/openscience-darwin-x64-baseline": "1.2.4"
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)