bincode-dev 0.0.18 → 0.0.20

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/README.md CHANGED
@@ -1,53 +1 @@
1
1
  # bincode-dev
2
-
3
- Dev/test build of the Bineric AI-powered development CLI (not affiliated with `opencode`).
4
-
5
- ## Install
6
-
7
- ```bash
8
- npm i -g bincode-dev
9
- ```
10
-
11
- ## Usage
12
-
13
- ```bash
14
- bincode
15
- ```
16
-
17
- Login:
18
-
19
- ```bash
20
- bincode login
21
- ```
22
-
23
- ## Publishing (multi-platform, small main package)
24
-
25
- `bincode-dev` is a small wrapper package. The native binaries are published as per-platform optional dependency packages:
26
-
27
- - `bincode-dev-darwin-arm64`
28
- - `bincode-dev-darwin-x64`
29
- - `bincode-dev-linux-x64`
30
- - `bincode-dev-windows-x64`
31
-
32
- Build + publish from repo root (example using WSL):
33
-
34
- ```bash
35
- # Build web console
36
- cd /mnt/e/bineric-ai/bincode
37
- bun run --cwd packages/app build
38
-
39
- # Build opencode binaries and copy them into publish-bincode-dev/dist
40
- cd /mnt/e/bineric-ai/bincode/publish-bincode-dev
41
- bun run build
42
-
43
- # Generate platform packages from publish-bincode-dev/dist
44
- npm run prepare:platform-packages
45
-
46
- # Publish platform packages first (same version as bincode-dev)
47
- for d in platform-packages/*; do (cd "$d" && npm publish --access public); done
48
-
49
- # Publish the small wrapper package last
50
- npm publish --access public
51
- ```
52
-
53
-
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "bincode-dev",
3
- "version": "0.0.18",
3
+ "version": "0.0.20",
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.20",
10
+ "bincode-dev-darwin-x64": "0.0.20",
11
+ "bincode-dev-linux-x64": "0.0.20",
12
+ "bincode-dev-windows-x64": "0.0.20"
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