bincode-dev 0.0.21 → 0.0.23

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/bincode CHANGED
@@ -30,7 +30,7 @@ function run(target) {
30
30
  // Ensure this package variant uses its own config/data directories.
31
31
  if (!env.BINCODE_APP_ID) env.BINCODE_APP_ID = "bincode-dev"
32
32
  // Provide package-level defaults, but never override user-provided env vars.
33
- // bincode-ai -> staging (requested) -- mirror the same defaults for testing
33
+ // bincode -> staging (requested) -- mirror the same defaults for testing
34
34
  if (!env.BINERIC_API_URL) env.BINERIC_API_URL = "https://stagingapi.bineric.com/api/v1/ai"
35
35
  if (!env.BINERIC_FRONTEND_URL) env.BINERIC_FRONTEND_URL = "https://stagingplatform.bineric.com"
36
36
 
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "bincode-dev",
3
- "version": "0.0.21",
3
+ "version": "0.0.23",
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.21",
10
- "bincode-dev-darwin-x64": "0.0.21",
11
- "bincode-dev-linux-x64": "0.0.21",
12
- "bincode-dev-windows-x64": "0.0.21"
9
+ "bincode-dev-darwin-arm64": "0.0.23",
10
+ "bincode-dev-darwin-x64": "0.0.23",
11
+ "bincode-dev-linux-x64": "0.0.23",
12
+ "bincode-dev-windows-x64": "0.0.23"
13
13
  },
14
14
  "scripts": {
15
15
  "build": "bun script/build.ts",
@@ -1,15 +1,17 @@
1
1
  /**
2
- * Generates per-platform npm packages that contain ONLY the native bincode binary.
2
+ * Generates per-platform npm packages that contain the native bincode binary and app dist.
3
3
  *
4
4
  * Why:
5
5
  * - Keeps the main `bincode-dev` package small.
6
6
  * - Lets users run `npm i bincode-dev` on mac/linux/windows and get the right binary via optionalDependencies.
7
+ * - Includes app/dist so the web console works when installed via platform packages.
7
8
  *
8
9
  * Expected input:
9
10
  * - `publish-bincode-dev/dist/opencode-<platform>-<arch>/bin/(bincode|bincode.exe)` exists (copied from packages/opencode/dist).
11
+ * - `publish-bincode-dev/app/dist` exists (copied from packages/app/dist).
10
12
  *
11
13
  * Output:
12
- * - `publish-bincode-dev/platform-packages/<pkgName>/{package.json,README.md,bin/*}`
14
+ * - `publish-bincode-dev/platform-packages/<pkgName>/{package.json,README.md,bin/*,app/dist/*}`
13
15
  */
14
16
  const fs = require("fs")
15
17
  const path = require("path")
@@ -35,6 +37,20 @@ function writeJson(p, obj) {
35
37
  fs.writeFileSync(p, JSON.stringify(obj, null, 2) + "\n")
36
38
  }
37
39
 
40
+ function copyRecursive(src, dest) {
41
+ mkdirp(path.dirname(dest))
42
+ const stat = fs.statSync(src)
43
+ if (stat.isDirectory()) {
44
+ mkdirp(dest)
45
+ const entries = fs.readdirSync(src)
46
+ for (const entry of entries) {
47
+ copyRecursive(path.join(src, entry), path.join(dest, entry))
48
+ }
49
+ } else {
50
+ fs.copyFileSync(src, dest)
51
+ }
52
+ }
53
+
38
54
  /** @type {Array<{pkg:string, opencodeDistDir:string, os:string, cpu:string, binName:string}>} */
39
55
  const targets = [
40
56
  {
@@ -69,9 +85,16 @@ const targets = [
69
85
 
70
86
  const distRoot = path.join(root, "dist")
71
87
  const pkgsRoot = path.join(root, "platform-packages")
88
+ const appDistSource = path.join(root, "app", "dist")
72
89
 
73
90
  mkdirp(pkgsRoot)
74
91
 
92
+ // Check if app/dist exists
93
+ if (!fs.existsSync(appDistSource)) {
94
+ console.error(`[prepare-platform-packages] Warning: app/dist not found at ${appDistSource}`)
95
+ console.error(`[prepare-platform-packages] Web console may not work in installed packages`)
96
+ }
97
+
75
98
  for (const t of targets) {
76
99
  const sourceBin = path.join(distRoot, t.opencodeDistDir, "bin", t.binName)
77
100
  if (!fs.existsSync(sourceBin)) {
@@ -96,6 +119,14 @@ for (const t of targets) {
96
119
  }
97
120
  }
98
121
 
122
+ // Copy app/dist directory if it exists
123
+ const outAppDist = path.join(outDir, "app", "dist")
124
+ if (fs.existsSync(appDistSource)) {
125
+ rmrf(outAppDist)
126
+ copyRecursive(appDistSource, outAppDist)
127
+ console.log(`[prepare-platform-packages] Copied app/dist to ${t.pkg}`)
128
+ }
129
+
99
130
  writeJson(path.join(outDir, "package.json"), {
100
131
  name: t.pkg,
101
132
  version,
@@ -103,7 +134,7 @@ for (const t of targets) {
103
134
  license: mainPkg.license || "MIT",
104
135
  os: [t.os],
105
136
  cpu: [t.cpu],
106
- files: ["bin"],
137
+ files: ["bin", "app/dist"],
107
138
  })
108
139
 
109
140
  fs.writeFileSync(