claude-ide-bridge 2.22.5 → 2.22.7

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/dist/index.js CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-ide-bridge",
3
- "version": "2.22.5",
3
+ "version": "2.22.7",
4
4
  "description": "Standalone MCP bridge for Claude Code IDE integration with any editor — 136+ tools for LSP, debugging, terminals, Git, GitHub, and more",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -52,6 +52,7 @@
52
52
  "scripts/install-extension.sh",
53
53
  "scripts/gen-mcp-config.sh",
54
54
  "scripts/mcp-stdio-shim.cjs",
55
+ "scripts/postinstall.mjs",
55
56
  "scripts/start-vps.sh",
56
57
  "templates",
57
58
  "LICENSE",
@@ -61,7 +62,7 @@
61
62
  "node": ">=20.0.0"
62
63
  },
63
64
  "scripts": {
64
- "build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc",
65
+ "build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc && node scripts/postinstall.mjs",
65
66
  "dev": "tsx src/index.ts",
66
67
  "start": "node dist/index.js",
67
68
  "test": "vitest run",
@@ -0,0 +1,68 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * postinstall.mjs — wire up optional local binaries into node_modules/.bin
4
+ * so that probeAll() can discover them via the standard local-bin lookup.
5
+ *
6
+ * Currently handles:
7
+ * @vscode/ripgrep → node_modules/.bin/rg
8
+ */
9
+
10
+ import {
11
+ chmodSync,
12
+ existsSync,
13
+ mkdirSync,
14
+ symlinkSync,
15
+ unlinkSync,
16
+ } from "node:fs";
17
+ import { createRequire } from "node:module";
18
+ import path from "node:path";
19
+ import { fileURLToPath } from "node:url";
20
+
21
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
22
+ const root = path.join(__dirname, "..");
23
+ const binDir = path.join(root, "node_modules", ".bin");
24
+ const require = createRequire(import.meta.url);
25
+
26
+ function linkBin(pkgName, binaryName, linkName = binaryName) {
27
+ try {
28
+ const pkg = require(`${pkgName}/package.json`);
29
+ // Try common binary locations
30
+ const candidates = [
31
+ path.join(root, "node_modules", pkgName, "bin", binaryName),
32
+ path.join(root, "node_modules", pkgName, binaryName),
33
+ ];
34
+ // Also check the package's bin field
35
+ if (pkg.bin) {
36
+ const binEntry =
37
+ typeof pkg.bin === "string" ? pkg.bin : pkg.bin[binaryName];
38
+ if (binEntry) {
39
+ candidates.unshift(path.join(root, "node_modules", pkgName, binEntry));
40
+ }
41
+ }
42
+ const src = candidates.find(existsSync);
43
+ if (!src) {
44
+ console.log(` skip ${linkName}: ${pkgName} binary not found`);
45
+ return;
46
+ }
47
+ mkdirSync(binDir, { recursive: true });
48
+ const dest = path.join(binDir, linkName);
49
+ if (existsSync(dest)) {
50
+ unlinkSync(dest);
51
+ }
52
+ symlinkSync(src, dest);
53
+ console.log(` linked ${linkName} → ${path.relative(root, src)}`);
54
+ } catch {
55
+ // Package not installed — silently skip
56
+ }
57
+ }
58
+
59
+ // Ensure the CLI entry point is executable (npm unpack strips +x on some systems)
60
+ try {
61
+ chmodSync(path.join(root, "dist", "index.js"), 0o755);
62
+ } catch {
63
+ // Non-POSIX systems (Windows) — silently skip
64
+ }
65
+
66
+ console.log("[postinstall] Linking optional local binaries...");
67
+ linkBin("@vscode/ripgrep", "rg");
68
+ console.log("[postinstall] Done.");