@maxgfr/codeindex 2.8.0 → 2.8.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.
- package/README.md +16 -3
- package/package.json +1 -1
- package/scripts/engine.d.mts +2 -1
- package/scripts/engine.mjs +3 -2
- package/src/render/scip.ts +6 -1
- package/src/types.ts +1 -1
package/README.md
CHANGED
|
@@ -59,9 +59,9 @@ import { scanRepo, ENGINE_VERSION } from "@maxgfr/codeindex";
|
|
|
59
59
|
const scan = scanRepo("/path/to/repo");
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
The CLI ships in the same package
|
|
63
|
-
Skills should still prefer vendoring: it keeps their own
|
|
64
|
-
pinned to an exact commit without an npm dependency.
|
|
62
|
+
The CLI ships in the same package — see **Use as a CLI** below for the global
|
|
63
|
+
install command. Skills should still prefer vendoring: it keeps their own
|
|
64
|
+
bundle single-file and pinned to an exact commit without an npm dependency.
|
|
65
65
|
|
|
66
66
|
## Use as a CLI
|
|
67
67
|
|
|
@@ -99,6 +99,19 @@ into their own CLIs); `cli.mjs` is the thin standalone CLI/MCP wrapper.
|
|
|
99
99
|
`buildGraph`/`buildIndexArtifacts` accept `meta: { version, schemaVersion }` so
|
|
100
100
|
a consumer can stamp its own identity into artifacts it persists.
|
|
101
101
|
|
|
102
|
+
## Benchmarks
|
|
103
|
+
|
|
104
|
+
Measured against 01x-in/codeindex, universal-ctags and scip-typescript with a
|
|
105
|
+
reproducible harness (`scripts/bench/`); full methodology, fairness notes and
|
|
106
|
+
all scenarios in [BENCHMARKS.md](./BENCHMARKS.md).
|
|
107
|
+
|
|
108
|
+
| Metric | codeindex | Context |
|
|
109
|
+
| --- | --- | --- |
|
|
110
|
+
| `socialgouv/code-du-travail-numerique` — cold index | 1,746 ms | vs ctags 371 ms, 01x init 13,409 ms |
|
|
111
|
+
| `socialgouv/code-du-travail-numerique` — warm rerun | 339 ms | |
|
|
112
|
+
| `vercel/next.js` — cold index | 9,398 ms | vs ctags 3,431 ms |
|
|
113
|
+
| `socialgouv/code-du-travail-numerique` — token ratio (measured) | 32.9× | structured index vs raw grep, single-symbol lookup |
|
|
114
|
+
|
|
102
115
|
## Development
|
|
103
116
|
|
|
104
117
|
```sh
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maxgfr/codeindex",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.1",
|
|
4
4
|
"description": "Self-contained, deterministic repo-indexing engine: walk + language detection + symbol/import extraction (tree-sitter AST with regex fallback) + import resolution + typed cross-file link-graph + analytics. Ships as a single zero-dependency engine.mjs that consumer tools vendor.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"packageManager": "pnpm@10.33.0",
|
package/scripts/engine.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const ENGINE_VERSION = "2.8.
|
|
1
|
+
declare const ENGINE_VERSION = "2.8.1";
|
|
2
2
|
declare const SCHEMA_VERSION = 4;
|
|
3
3
|
declare const EXTRACTOR_VERSION = 6;
|
|
4
4
|
type FileKind = "code" | "doc" | "config" | "asset" | "other";
|
|
@@ -417,6 +417,7 @@ declare function renderGraphJson(graph: Graph): string;
|
|
|
417
417
|
|
|
418
418
|
interface RenderScipOptions {
|
|
419
419
|
projectRoot?: string;
|
|
420
|
+
toolVersion?: string;
|
|
420
421
|
}
|
|
421
422
|
declare function renderScip(scan: RepoScan, opts?: RenderScipOptions): Uint8Array;
|
|
422
423
|
|
package/scripts/engine.mjs
CHANGED
|
@@ -14,7 +14,7 @@ var ENGINE_VERSION, SCHEMA_VERSION, EXTRACTOR_VERSION;
|
|
|
14
14
|
var init_types = __esm({
|
|
15
15
|
"src/types.ts"() {
|
|
16
16
|
"use strict";
|
|
17
|
-
ENGINE_VERSION = "2.8.
|
|
17
|
+
ENGINE_VERSION = "2.8.1";
|
|
18
18
|
SCHEMA_VERSION = 4;
|
|
19
19
|
EXTRACTOR_VERSION = 6;
|
|
20
20
|
}
|
|
@@ -10434,6 +10434,7 @@ function findWord(line, name2) {
|
|
|
10434
10434
|
}
|
|
10435
10435
|
function renderScip(scan2, opts = {}) {
|
|
10436
10436
|
const projectRoot = opts.projectRoot ?? "file://" + scan2.root.replace(/\\/g, "/");
|
|
10437
|
+
const toolVersion = opts.toolVersion ?? ENGINE_VERSION;
|
|
10437
10438
|
const docs = scan2.files.filter((f) => f.kind === "code" && f.symbols.length > 0);
|
|
10438
10439
|
const docDefs = /* @__PURE__ */ new Map();
|
|
10439
10440
|
const defByName = /* @__PURE__ */ new Map();
|
|
@@ -10514,7 +10515,7 @@ function renderScip(scan2, opts = {}) {
|
|
|
10514
10515
|
}
|
|
10515
10516
|
const toolInfo = [];
|
|
10516
10517
|
pushString(toolInfo, F_TOOL_NAME, "codeindex");
|
|
10517
|
-
pushString(toolInfo, F_TOOL_VERSION,
|
|
10518
|
+
pushString(toolInfo, F_TOOL_VERSION, toolVersion);
|
|
10518
10519
|
const metadata2 = [];
|
|
10519
10520
|
pushLenDelim(metadata2, F_META_TOOL_INFO, toolInfo);
|
|
10520
10521
|
pushString(metadata2, F_META_PROJECT_ROOT, projectRoot);
|
package/src/render/scip.ts
CHANGED
|
@@ -24,6 +24,10 @@ export interface RenderScipOptions {
|
|
|
24
24
|
// Overridable so a build is byte-reproducible regardless of the machine's
|
|
25
25
|
// checkout path; defaults to `file://` + the posix repo root.
|
|
26
26
|
projectRoot?: string;
|
|
27
|
+
// Metadata.tool_info.version. Overridable so a byte-golden fixture can pin a
|
|
28
|
+
// fixed string and stay stable across ENGINE_VERSION release bumps; defaults
|
|
29
|
+
// to the live ENGINE_VERSION (the CLI never overrides this — no flag for it).
|
|
30
|
+
toolVersion?: string;
|
|
27
31
|
}
|
|
28
32
|
|
|
29
33
|
// ---------------------------------------------------------------------------
|
|
@@ -246,6 +250,7 @@ interface DefEntry {
|
|
|
246
250
|
// ---------------------------------------------------------------------------
|
|
247
251
|
export function renderScip(scan: RepoScan, opts: RenderScipOptions = {}): Uint8Array {
|
|
248
252
|
const projectRoot = opts.projectRoot ?? "file://" + scan.root.replace(/\\/g, "/");
|
|
253
|
+
const toolVersion = opts.toolVersion ?? ENGINE_VERSION;
|
|
249
254
|
|
|
250
255
|
// One Document per `code` file that declares ≥1 symbol, in scan order (already
|
|
251
256
|
// sorted by rel).
|
|
@@ -353,7 +358,7 @@ export function renderScip(scan: RepoScan, opts: RenderScipOptions = {}): Uint8A
|
|
|
353
358
|
// Metadata { tool_info, project_root, text_document_encoding }.
|
|
354
359
|
const toolInfo: Bytes = [];
|
|
355
360
|
pushString(toolInfo, F_TOOL_NAME, "codeindex");
|
|
356
|
-
pushString(toolInfo, F_TOOL_VERSION,
|
|
361
|
+
pushString(toolInfo, F_TOOL_VERSION, toolVersion);
|
|
357
362
|
|
|
358
363
|
const metadata: Bytes = [];
|
|
359
364
|
pushLenDelim(metadata, F_META_TOOL_INFO, toolInfo);
|
package/src/types.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Single source of truth for the engine version the bundle reports. Kept in
|
|
2
2
|
// lockstep with package.json by the release pipeline. Do not edit by hand
|
|
3
3
|
// outside a release.
|
|
4
|
-
export const ENGINE_VERSION = "2.8.
|
|
4
|
+
export const ENGINE_VERSION = "2.8.1";
|
|
5
5
|
|
|
6
6
|
// Bumped whenever the on-disk artifact shape changes, so a consumer can reject
|
|
7
7
|
// an index written by an incompatible engine instead of misreading it. The
|