gitnexus 1.6.2-rc.6 → 1.6.2-rc.8

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,6 +1,6 @@
1
1
  {
2
2
  "name": "gitnexus",
3
- "version": "1.6.2-rc.6",
3
+ "version": "1.6.2-rc.8",
4
4
  "description": "Graph-powered code intelligence for AI agents. Index any codebase, query via MCP or CLI.",
5
5
  "author": "Abhigyan Patwari",
6
6
  "license": "PolyForm-Noncommercial-1.0.0",
@@ -46,6 +46,7 @@
46
46
  "test:integration": "vitest run test/integration",
47
47
  "test:watch": "vitest",
48
48
  "test:coverage": "vitest run --coverage",
49
+ "preinstall": "node scripts/preinstall-cleanup.cjs",
49
50
  "postinstall": "node scripts/patch-tree-sitter-swift.cjs",
50
51
  "prepare": "node scripts/build.js",
51
52
  "prepack": "node scripts/build.js"
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Preinstall cleanup script.
4
+ *
5
+ * When upgrading gitnexus globally (`npm install -g gitnexus@<new>`),
6
+ * npm may fail with ENOTEMPTY because it cannot cleanly remove the
7
+ * `node_modules/` and `build/` directories that a *previous*
8
+ * installation's `file:` dependency resolution created inside
9
+ * `vendor/tree-sitter-proto/`.
10
+ *
11
+ * This script runs as a `preinstall` hook — before npm resolves
12
+ * dependencies — and removes those leftover directories so npm can
13
+ * proceed without errors.
14
+ *
15
+ * See: https://github.com/abhigyanpatwari/GitNexus/issues/836
16
+ */
17
+ const fs = require('fs');
18
+ const path = require('path');
19
+
20
+ const vendorDirs = [
21
+ path.join(__dirname, '..', 'vendor', 'tree-sitter-proto', 'node_modules'),
22
+ path.join(__dirname, '..', 'vendor', 'tree-sitter-proto', 'build'),
23
+ ];
24
+
25
+ for (const dir of vendorDirs) {
26
+ try {
27
+ if (fs.existsSync(dir)) {
28
+ fs.rmSync(dir, { recursive: true, force: true });
29
+ }
30
+ } catch (err) {
31
+ // Best-effort cleanup — warn but don't fail the install.
32
+ console.warn(`[preinstall] Could not remove ${dir}:`, err.message);
33
+ }
34
+ }