gitnexus 1.6.13-rc.97 → 1.6.13-rc.98
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/node_modules/tree-sitter-c/package.json +1 -1
- package/node_modules/tree-sitter-cpp/package.json +1 -1
- package/node_modules/tree-sitter-java/package.json +1 -1
- package/node_modules/tree-sitter-php/package.json +1 -1
- package/node_modules/tree-sitter-ruby/package.json +1 -1
- package/node_modules/tree-sitter-rust/package.json +1 -1
- package/node_modules/tree-sitter-typescript/node_modules/tree-sitter-javascript/package.json +1 -1
- package/node_modules/tree-sitter-typescript/package.json +1 -1
- package/package.json +2 -2
- package/scripts/prepare-tree-sitter-bundle.cjs +29 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gitnexus",
|
|
3
|
-
"version": "1.6.13-rc.
|
|
3
|
+
"version": "1.6.13-rc.98",
|
|
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",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"test:coverage": "vitest run --coverage",
|
|
61
61
|
"test:cross-platform": "tsx scripts/run-cross-platform.ts",
|
|
62
62
|
"test:benchmarks": "node --import tsx scripts/run-benchmarks.ts",
|
|
63
|
-
"postinstall": "node scripts/build-tree-sitter-grammars.cjs",
|
|
63
|
+
"postinstall": "node scripts/prepare-tree-sitter-bundle.cjs && node scripts/build-tree-sitter-grammars.cjs",
|
|
64
64
|
"assert-publish-coverage": "node scripts/assert-publish-grammar-coverage.cjs",
|
|
65
65
|
"prepare": "node scripts/build.js",
|
|
66
66
|
"prepack": "node scripts/prepare-tree-sitter-bundle.cjs && node scripts/assert-publish-grammar-coverage.cjs && node scripts/assert-publish-fts-coverage.cjs && node scripts/build.js --web && node scripts/assert-web-assets.mjs web",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* Prepare the tested native parser
|
|
3
|
+
* Prepare the tested native parser dependencies for installation and publication.
|
|
4
4
|
*
|
|
5
5
|
* A dependency's npm overrides do not apply in a consumer project. Several
|
|
6
6
|
* ABI-compatible grammars still advertise older runtime peers, so bundling
|
|
@@ -11,6 +11,7 @@ const fs = require('node:fs');
|
|
|
11
11
|
const path = require('node:path');
|
|
12
12
|
|
|
13
13
|
const RUNTIME = '0.25.1';
|
|
14
|
+
// Upstream metadata is an input to validate, never the peer range we ship.
|
|
14
15
|
const AUDITED_PEERS = new Map([
|
|
15
16
|
['tree-sitter-c@0.23.6', '^0.22.1'],
|
|
16
17
|
['tree-sitter-cpp@0.23.4', '^0.21.1'],
|
|
@@ -46,29 +47,50 @@ function prepareTreeSitterBundle(packageRoot = path.resolve(__dirname, '..')) {
|
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
const patches = [];
|
|
50
|
+
const visited = new Set();
|
|
49
51
|
function visit(modules) {
|
|
50
52
|
if (!fs.existsSync(modules)) return;
|
|
53
|
+
modules = fs.realpathSync(modules);
|
|
54
|
+
if (visited.has(modules)) return;
|
|
55
|
+
visited.add(modules);
|
|
51
56
|
for (const entry of fs.readdirSync(modules, { withFileTypes: true })) {
|
|
52
|
-
if (
|
|
57
|
+
if (entry.name.startsWith('.')) continue;
|
|
53
58
|
const dir = path.join(modules, entry.name);
|
|
59
|
+
if (
|
|
60
|
+
!entry.isDirectory() &&
|
|
61
|
+
(!entry.isSymbolicLink() || !fs.statSync(dir, { throwIfNoEntry: false })?.isDirectory())
|
|
62
|
+
) {
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
54
65
|
if (entry.name.startsWith('@')) {
|
|
55
66
|
visit(dir);
|
|
56
67
|
continue;
|
|
57
68
|
}
|
|
58
|
-
const
|
|
69
|
+
const realDir = fs.realpathSync(dir);
|
|
70
|
+
if (visited.has(realDir)) continue;
|
|
71
|
+
visited.add(realDir);
|
|
72
|
+
const file = path.join(realDir, 'package.json');
|
|
59
73
|
if (fs.existsSync(file)) {
|
|
60
74
|
const pkg = readJson(file);
|
|
61
75
|
const original = AUDITED_PEERS.get(`${pkg.name}@${pkg.version}`);
|
|
62
76
|
if (original) {
|
|
63
|
-
|
|
64
|
-
|
|
77
|
+
// Also accept bundles prepared before peers were pinned exactly, so
|
|
78
|
+
// an existing checkout can migrate through ordinary npm install.
|
|
79
|
+
const accepted = [original, `${original} || ${RUNTIME}`, RUNTIME];
|
|
80
|
+
if (!accepted.includes(pkg.peerDependencies?.['tree-sitter'])) {
|
|
65
81
|
throw new Error(`Unexpected tree-sitter peer metadata for ${pkg.name}@${pkg.version}`);
|
|
66
82
|
}
|
|
67
|
-
pkg.peerDependencies['tree-sitter'] =
|
|
83
|
+
pkg.peerDependencies['tree-sitter'] = RUNTIME;
|
|
68
84
|
patches.push({ file, pkg });
|
|
69
85
|
}
|
|
70
86
|
}
|
|
71
|
-
visit(path.join(
|
|
87
|
+
visit(path.join(realDir, 'node_modules'));
|
|
88
|
+
// pnpm links packages into node_modules but places their dependencies
|
|
89
|
+
// beside the real package. Follow that container without traversing the
|
|
90
|
+
// entire virtual store; realpaths deduplicate aliases and break cycles.
|
|
91
|
+
let parent = path.dirname(realDir);
|
|
92
|
+
if (path.basename(parent).startsWith('@')) parent = path.dirname(parent);
|
|
93
|
+
if (path.basename(parent) === 'node_modules') visit(parent);
|
|
72
94
|
}
|
|
73
95
|
}
|
|
74
96
|
visit(modulesRoot);
|