bincode-cli 1.0.2 → 1.0.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/bin/bincode +29 -25
  2. package/package.json +18 -18
package/bin/bincode CHANGED
@@ -1,12 +1,16 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const childProcess = require("child_process")
4
- const fs = require("fs")
5
- const path = require("path")
6
- const os = require("os")
3
+ import { spawnSync } from "child_process"
4
+ import { existsSync, realpathSync, readdirSync } from "fs"
5
+ import { dirname, join } from "path"
6
+ import { platform, arch } from "os"
7
+ import { fileURLToPath } from "url"
8
+
9
+ const __filename = fileURLToPath(import.meta.url)
10
+ const __dirname = dirname(__filename)
7
11
 
8
12
  function run(target) {
9
- const result = childProcess.spawnSync(target, process.argv.slice(2), {
13
+ const result = spawnSync(target, process.argv.slice(2), {
10
14
  stdio: "inherit",
11
15
  })
12
16
  if (result.error) {
@@ -22,8 +26,8 @@ if (envPath) {
22
26
  run(envPath)
23
27
  }
24
28
 
25
- const scriptPath = fs.realpathSync(__filename)
26
- const scriptDir = path.dirname(scriptPath)
29
+ const scriptPath = realpathSync(__filename)
30
+ const scriptDir = dirname(scriptPath)
27
31
 
28
32
  const platformMap = {
29
33
  darwin: "darwin",
@@ -36,48 +40,48 @@ const archMap = {
36
40
  arm: "arm",
37
41
  }
38
42
 
39
- let platform = platformMap[os.platform()]
40
- if (!platform) {
41
- platform = os.platform()
43
+ let platformName = platformMap[platform()]
44
+ if (!platformName) {
45
+ platformName = platform()
42
46
  }
43
- let arch = archMap[os.arch()]
44
- if (!arch) {
45
- arch = os.arch()
47
+ let archName = archMap[arch()]
48
+ if (!archName) {
49
+ archName = arch()
46
50
  }
47
- const base = "bincode-" + platform + "-" + arch
48
- const binary = platform === "windows" ? "bincode.exe" : "bincode"
51
+ const base = "bincode-cli-" + platformName + "-" + archName
52
+ const binary = platformName === "windows" ? "bincode.exe" : "bincode"
49
53
 
50
54
  function findBinary(startDir) {
51
55
  // First, try to find binary in local package binaries directory
52
- const localBinariesPath = path.join(startDir, "..", "binaries", base, "bin", binary)
53
- if (fs.existsSync(localBinariesPath)) {
56
+ const localBinariesPath = join(startDir, "..", "binaries", base, "bin", binary)
57
+ if (existsSync(localBinariesPath)) {
54
58
  return localBinariesPath
55
59
  }
56
60
 
57
61
  // Try baseline variant if available
58
62
  const baselineBase = base + "-baseline"
59
- const baselinePath = path.join(startDir, "..", "binaries", baselineBase, "bin", binary)
60
- if (fs.existsSync(baselinePath)) {
63
+ const baselinePath = join(startDir, "..", "binaries", baselineBase, "bin", binary)
64
+ if (existsSync(baselinePath)) {
61
65
  return baselinePath
62
66
  }
63
67
 
64
68
  // Fallback: search in node_modules (for backward compatibility)
65
69
  let current = startDir
66
70
  for (;;) {
67
- const modules = path.join(current, "node_modules")
68
- if (fs.existsSync(modules)) {
69
- const entries = fs.readdirSync(modules)
71
+ const modules = join(current, "node_modules")
72
+ if (existsSync(modules)) {
73
+ const entries = readdirSync(modules)
70
74
  for (const entry of entries) {
71
75
  if (!entry.startsWith(base)) {
72
76
  continue
73
77
  }
74
- const candidate = path.join(modules, entry, "bin", binary)
75
- if (fs.existsSync(candidate)) {
78
+ const candidate = join(modules, entry, "bin", binary)
79
+ if (existsSync(candidate)) {
76
80
  return candidate
77
81
  }
78
82
  }
79
83
  }
80
- const parent = path.dirname(current)
84
+ const parent = dirname(current)
81
85
  if (parent === current) {
82
86
  return
83
87
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "name": "bincode-cli",
5
5
  "type": "module",
6
6
  "private": false,
@@ -19,7 +19,7 @@
19
19
  "deploy": "echo 'Deploying application...' && bun run build && echo 'Deployment completed successfully'"
20
20
  },
21
21
  "bin": {
22
- "bincode": "./bin/bincode"
22
+ "bincode": "bin/bincode"
23
23
  },
24
24
  "files": [
25
25
  "bin",
@@ -46,13 +46,13 @@
46
46
  "@parcel/watcher-linux-x64-musl": "2.5.1",
47
47
  "@parcel/watcher-win32-x64": "2.5.1",
48
48
  "@standard-schema/spec": "1.0.0",
49
- "@tsconfig/bun": "1.0.9",
49
+ "@tsconfig/bun": "catalog:",
50
50
  "@types/babel__core": "7.20.5",
51
- "@types/bun": "1.3.4",
51
+ "@types/bun": "catalog:",
52
52
  "@types/turndown": "5.0.5",
53
53
  "@types/yargs": "17.0.33",
54
- "typescript": "5.8.2",
55
- "@typescript/native-preview": "7.0.0-dev.20251207.1",
54
+ "typescript": "catalog:",
55
+ "@typescript/native-preview": "catalog:",
56
56
  "vscode-languageserver-types": "3.17.5",
57
57
  "why-is-node-running": "3.2.2",
58
58
  "zod-to-json-schema": "3.24.5"
@@ -75,46 +75,46 @@
75
75
  "@ai-sdk/xai": "2.0.42",
76
76
  "@clack/prompts": "1.0.0-alpha.1",
77
77
  "@hono/standard-validator": "0.1.5",
78
- "@hono/zod-validator": "0.4.2",
78
+ "@hono/zod-validator": "catalog:",
79
79
  "@modelcontextprotocol/sdk": "1.15.1",
80
80
  "@octokit/graphql": "9.0.2",
81
- "@octokit/rest": "22.0.0",
82
- "@openauthjs/openauth": "0.0.0-20250322224806",
81
+ "@octokit/rest": "catalog:",
82
+ "@openauthjs/openauth": "catalog:",
83
83
  "@openrouter/ai-sdk-provider": "1.5.2",
84
84
  "@opentui/core": "0.1.63",
85
85
  "@opentui/solid": "0.1.63",
86
86
  "@parcel/watcher": "2.5.1",
87
- "@pierre/diffs": "1.0.2",
87
+ "@pierre/diffs": "catalog:",
88
88
  "@solid-primitives/event-bus": "1.1.2",
89
89
  "@standard-schema/spec": "1.0.0",
90
90
  "@zip.js/zip.js": "2.7.62",
91
- "ai": "5.0.97",
91
+ "ai": "catalog:",
92
92
  "bun-pty": "0.4.2",
93
93
  "chokidar": "4.0.3",
94
94
  "clipboardy": "4.0.0",
95
95
  "decimal.js": "10.5.0",
96
- "diff": "8.0.2",
96
+ "diff": "catalog:",
97
97
  "fuzzysort": "3.1.0",
98
98
  "gray-matter": "4.0.3",
99
- "hono": "4.10.7",
100
- "hono-openapi": "1.1.2",
99
+ "hono": "catalog:",
100
+ "hono-openapi": "catalog:",
101
101
  "ignore": "7.0.5",
102
102
  "jsonc-parser": "3.3.1",
103
103
  "minimatch": "10.0.3",
104
104
  "open": "10.1.2",
105
105
  "opentui-spinner": "0.0.6",
106
106
  "partial-json": "0.1.7",
107
- "remeda": "2.26.0",
108
- "solid-js": "1.9.10",
107
+ "remeda": "catalog:",
108
+ "solid-js": "catalog:",
109
109
  "strip-ansi": "7.1.2",
110
110
  "tree-sitter-bash": "0.25.0",
111
111
  "turndown": "7.2.0",
112
- "ulid": "3.0.1",
112
+ "ulid": "catalog:",
113
113
  "vscode-jsonrpc": "8.2.1",
114
114
  "web-tree-sitter": "0.25.10",
115
115
  "xdg-basedir": "5.1.0",
116
116
  "yargs": "18.0.0",
117
- "zod": "4.1.8",
117
+ "zod": "catalog:",
118
118
  "zod-to-json-schema": "3.24.5"
119
119
  }
120
120
  }