@sdsrs/code-graph 0.12.0 → 0.12.1
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.
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const test = require('node:test');
|
|
3
|
+
const assert = require('node:assert/strict');
|
|
4
|
+
const fs = require('fs');
|
|
5
|
+
const path = require('path');
|
|
6
|
+
const os = require('os');
|
|
7
|
+
const { spawnSync } = require('child_process');
|
|
8
|
+
|
|
9
|
+
const { findBinary } = require('./find-binary');
|
|
10
|
+
|
|
11
|
+
test('incremental-index bails silently when cwd is not a git repo', (t) => {
|
|
12
|
+
const bin = findBinary();
|
|
13
|
+
if (!bin) {
|
|
14
|
+
// Binary not built — skip rather than fail; matches session-init.test.js convention.
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const tmpRoot = fs.realpathSync(fs.mkdtempSync(path.join(os.tmpdir(), 'code-graph-no-git-')));
|
|
18
|
+
t.after(() => fs.rmSync(tmpRoot, { recursive: true, force: true }));
|
|
19
|
+
|
|
20
|
+
const result = spawnSync(bin, ['incremental-index', '--quiet'], {
|
|
21
|
+
cwd: tmpRoot,
|
|
22
|
+
timeout: 8000,
|
|
23
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
24
|
+
});
|
|
25
|
+
assert.equal(result.status, 0, `expected exit 0, got ${result.status}; stderr: ${result.stderr}`);
|
|
26
|
+
assert.equal(
|
|
27
|
+
fs.existsSync(path.join(tmpRoot, '.code-graph')),
|
|
28
|
+
false,
|
|
29
|
+
'.code-graph must not be created outside a git repo',
|
|
30
|
+
);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
test('incremental-index runs inside a minimal git repo without creating stray state', (t) => {
|
|
34
|
+
const bin = findBinary();
|
|
35
|
+
if (!bin) return;
|
|
36
|
+
const tmpRoot = fs.realpathSync(fs.mkdtempSync(path.join(os.tmpdir(), 'code-graph-git-')));
|
|
37
|
+
t.after(() => fs.rmSync(tmpRoot, { recursive: true, force: true }));
|
|
38
|
+
|
|
39
|
+
fs.mkdirSync(path.join(tmpRoot, '.git'));
|
|
40
|
+
const result = spawnSync(bin, ['incremental-index', '--quiet'], {
|
|
41
|
+
cwd: tmpRoot,
|
|
42
|
+
timeout: 8000,
|
|
43
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
44
|
+
});
|
|
45
|
+
assert.equal(result.status, 0, `expected exit 0, got ${result.status}; stderr: ${result.stderr}`);
|
|
46
|
+
// Index may or may not materialize for an empty repo; the contract is that the guard does NOT block this case.
|
|
47
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sdsrs/code-graph",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.1",
|
|
4
4
|
"description": "MCP server that indexes codebases into an AST knowledge graph with semantic search, call graph traversal, and HTTP route tracing",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
"node": ">=16"
|
|
35
35
|
},
|
|
36
36
|
"optionalDependencies": {
|
|
37
|
-
"@sdsrs/code-graph-linux-x64": "0.12.
|
|
38
|
-
"@sdsrs/code-graph-linux-arm64": "0.12.
|
|
39
|
-
"@sdsrs/code-graph-darwin-x64": "0.12.
|
|
40
|
-
"@sdsrs/code-graph-darwin-arm64": "0.12.
|
|
41
|
-
"@sdsrs/code-graph-win32-x64": "0.12.
|
|
37
|
+
"@sdsrs/code-graph-linux-x64": "0.12.1",
|
|
38
|
+
"@sdsrs/code-graph-linux-arm64": "0.12.1",
|
|
39
|
+
"@sdsrs/code-graph-darwin-x64": "0.12.1",
|
|
40
|
+
"@sdsrs/code-graph-darwin-arm64": "0.12.1",
|
|
41
|
+
"@sdsrs/code-graph-win32-x64": "0.12.1"
|
|
42
42
|
}
|
|
43
43
|
}
|