bincode-dev 0.0.18 → 0.0.19

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/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "bincode-dev",
3
- "version": "0.0.18",
3
+ "version": "0.0.19",
4
4
  "description": "Bincode: AI-powered development CLI (dev/test version, not affiliated with opencode)",
5
5
  "bin": {
6
6
  "bincode": "./bin/bincode"
7
7
  },
8
8
  "optionalDependencies": {
9
- "bincode-dev-darwin-arm64": "0.0.18",
10
- "bincode-dev-darwin-x64": "0.0.18",
11
- "bincode-dev-linux-x64": "0.0.18",
12
- "bincode-dev-windows-x64": "0.0.18"
9
+ "bincode-dev-darwin-arm64": "0.0.19",
10
+ "bincode-dev-darwin-x64": "0.0.19",
11
+ "bincode-dev-linux-x64": "0.0.19",
12
+ "bincode-dev-windows-x64": "0.0.19"
13
13
  },
14
14
  "scripts": {
15
15
  "build": "bun script/build.ts",
@@ -1,14 +1,8 @@
1
1
  /**
2
- * Ensures the correct platform binary package is present after installation.
2
+ * Self-heal install: ensure the correct platform binary package exists.
3
3
  *
4
- * Why:
5
- * - Some npm setups may skip optionalDependencies, especially in global installs.
6
- * - We want `npm i(-g) bincode-dev` to "just work" without manual platform package install.
7
- *
8
- * Approach:
9
- * - Detect the expected platform package name from os/arch.
10
- * - If not present, run `npm install --no-save <pkg>@<version>` with cwd at this package root.
11
- * This installs into `bincode-dev/node_modules`, which `require.resolve()` can find.
4
+ * Some npm setups (especially global installs) may skip optionalDependencies.
5
+ * We still want `npm i(-g) bincode-dev` to work without manual platform installs.
12
6
  */
13
7
  const childProcess = require("child_process")
14
8
  const fs = require("fs")
@@ -29,10 +23,8 @@ const targetPkgMap = {
29
23
  "win32:x64": "bincode-dev-windows-x64",
30
24
  }
31
25
 
32
- const key = `${platform}:${arch}`
33
- const targetPkg = targetPkgMap[key]
34
-
35
- if (!targetPkg) process.exit(0)
26
+ const targetPkg = targetPkgMap[`${platform}:${arch}`]
27
+ if (!targetPkg || !version) process.exit(0)
36
28
 
37
29
  function isInstalled() {
38
30
  try {
@@ -43,24 +35,12 @@ function isInstalled() {
43
35
  }
44
36
  }
45
37
 
46
- if (isInstalled()) {
47
- process.exit(0)
48
- }
38
+ if (isInstalled()) process.exit(0)
49
39
 
50
- // If scripts are disabled (ignore-scripts), this file won't run at all.
51
- // If npm isn't available, we can't self-heal.
52
40
  const npmCmd = process.platform === "win32" ? "npm.cmd" : "npm"
41
+ const args = ["install", "--no-save", "--no-audit", "--no-fund", `${targetPkg}@${version}`]
53
42
 
54
- const args = ["install", "--no-save", "--silent", "--no-audit", "--no-fund", `${targetPkg}@${version}`]
55
- const res = childProcess.spawnSync(npmCmd, args, {
56
- cwd: root,
57
- stdio: "inherit",
58
- env: process.env,
59
- })
60
-
61
- if (res.status !== 0) {
62
- // Don't hard-fail install; wrapper will print a clearer message on execution.
63
- process.exit(0)
64
- }
43
+ // Install into bincode-dev's own node_modules so `require.resolve()` works reliably.
44
+ childProcess.spawnSync(npmCmd, args, { cwd: root, stdio: "inherit", env: process.env })
65
45
 
66
46