Skip to content

Commit 444b205

Browse files
committed
fix(node): commit generated loader so the npm package is usable
The published main package shipped without index.js/index.d.ts: they were gitignored and the publish job never re-runs `napi build`, so the package had no entrypoint and could not be imported. Commit the generated JS interface (regenerated for the scoped @nodedb-lab/code2graph name) and ignore only the per-platform *.node binaries. Verified: the package loads via the published platform binary and resolves a cross-file call edge.
1 parent 6a84ed7 commit 444b205

3 files changed

Lines changed: 620 additions & 2 deletions

File tree

bindings/node/.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
/target
22
node_modules/
33
*.node
4-
index.js
5-
index.d.ts
4+
# index.js + index.d.ts are the generated JS interface — they are COMMITTED
5+
# (regenerate with `npm run build` when the #[napi] API changes) so the
6+
# published main package ships its loader. Only the per-platform *.node binaries
7+
# are build artifacts.
68
npm-debug.log*
79
# napi-rs release scaffolding (generated by create-npm-dirs / artifacts)
810
npm/

bindings/node/index.d.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/* auto-generated by NAPI-RS */
2+
/* eslint-disable */
3+
/**
4+
* Resolve extracted facts into a code graph.
5+
*
6+
* `files` is a JS array of objects as returned by [`extract`]. `tier` selects
7+
* the resolver: `"name"` (default) uses Tier A (`NameOnly`); `"scope"` uses
8+
* Tier B (`Scoped`/`Exact`). Returns a JS object mirroring `CodeGraph`.
9+
*/
10+
export declare function buildGraph(files: any, tier?: string | undefined | null): any
11+
12+
/**
13+
* Extract symbols and references from a single source file.
14+
*
15+
* `file` is a project-relative path used to infer the language; `source` is
16+
* its contents. Returns a JS object mirroring `FileFacts`.
17+
*/
18+
export declare function extract(file: string, source: string): any
19+
20+
/**
21+
* Return the canonical language tag for a file path, or `null` if the
22+
* extension is not recognized (e.g. `"src/main.rs"` -> `"rust"`).
23+
*/
24+
export declare function languageOf(path: string): string | null

0 commit comments

Comments
 (0)