Releases: stainless-code/codemap
v0.2.2
Patch Changes
5f65c33Thanks @SutuSebastian! - Use vendor-neutral.mdextension for agent rules in templates; Cursor integration remaps to.mdcat wiring timecodemap agents initnow writes.mdrule files to.agents/rules/(plain Markdown with YAML frontmatter)- Cursor target automatically renames rules to
.mdc(required for frontmatter parsing); all other targets (Windsurf, Continue, Cline, Amazon Q) keep.md SKILL.mdnow includesnameanddescriptionfrontmatter per the Agent Skills spec
v0.2.1
Patch Changes
7f663beThanks @SutuSebastian! - Sync bundled agent rule template with schema v2: addtype_members,calls, anddoc_commenttrigger patterns and query rows. Add golden scenarios and fixture coverage for both new tables.
v0.2.0
Minor Changes
- #19
53b2c52Thanks @SutuSebastian! - Richer symbol metadata: generics, return types, JSDoc, type members, const values, symbol nesting, call graph- Signatures now include generic type parameters, return type annotations, and heritage clauses (extends/implements)
- New
doc_commentcolumn on symbols extracts leading JSDoc comments - New
type_memberstable indexes properties and methods of interfaces and object-literal types - New
valuecolumn on symbols captures const literal values (strings, numbers, booleans, null) - New
parent_namecolumn on symbols tracks scope nesting; class methods/properties/getters extracted as individual symbols - New
callstable tracks function-scoped call edges withcaller_scopefor qualified disambiguation (deduped per file) - Enum members extracted into
memberscolumn as JSON - Performance: cached scope strings, hoisted hot-path regex, batch deletes, reduced redundant I/O, BATCH_SIZE 100→500
- SCHEMA_VERSION bumped to 2
v0.1.9
Patch Changes
- #17
e962326Thanks @SutuSebastian! - Fix incremental detection reporting unchanged files as "changed" on every run when the working tree has uncommitted modifications.getChangedFilesnow compares content hashes against the index before including candidates, so only truly modified files enter the indexing pipeline.
v0.1.8
Patch Changes
-
#15
f2362f9Thanks @SutuSebastian! - Fix three HIGH-severity bugs found via cross-audit triangulation, plus performance and docs improvements.Bug fixes
- Add missing
onerrorhandler on Bun Worker — prevents silent promise hang when a parse worker crashes - Require JSX return or hook usage for component detection — eliminates false positives (e.g.
FormatCurrency()in.tsxfiles no longer indexed as a component) - Include previously-indexed files in incremental and
--filesmodes — custom-extension files indexed during--fullno longer silently go stale
Performance
- Batch CSS imports instead of inserting one-at-a-time (both full-rebuild and incremental paths)
- Add
Map<string, Statement>cache forbetter-sqlite3run()/query()— avoids ~2,000+ redundantprepare()calls on large projects - Hoist
inner.query()inwrap()to prepare once per call instead of per.get()/.all() - Skip
PRAGMA optimizeoncloseDbfor read-only query paths
Docs
- Fix Wyhash → SHA-256 in architecture.md and SKILL.md (3 locations)
- Correct
symbols.kindvalues (variable→const,type_alias→type) andexports.kindvalues - Clarify
Database.query()caching is Bun-only; Node statement cache via wrapper - Update architecture.md: component heuristic, statement cache,
closeDbreadonly, incremental/--filescustom extensions - Update benchmark.md and golden-queries.md for enriched fixture
Testing
- Enrich
fixtures/minimal/to cover all 10 indexed tables (CSS module,@keyframes,@import, non-component PascalCase export, FIXME marker) - Add 7 new golden scenarios (exports, css_variables, css_classes, css_keyframes, css_imports, markers-all-kinds, components-no-false-positives)
Cleanup
- Remove unused
analyzeDependencies: truefrom CSS parser - Deduplicate
fetchTableStats(was duplicated acrossindex-engine.tsandrun-index.ts) - Remove dead
eslint-disable-next-linedirectives (oxlint doesn't enforce those rules) - Fix
SCHEMA_VERSIONcomment (said "2", value is1)
- Add missing
v0.1.7
Patch Changes
- #13
13a2c14Thanks @SutuSebastian! - Replacefast-globwithtinyglobbyfor Node include globs. Smaller dependency footprint;expandDirectories: falsekeeps matching aligned with the previous behavior.
v0.1.6
Patch Changes
ca4b47aThanks @SutuSebastian! - Shipped agent rules and skills now lead withcodemap query --json(optional table output when--jsonis omitted). Addbun run benchmark:queryto compareconsole.tablevs JSON stdout size, plus integration tests for--jsonvs default output when.codemap.dbis present. README anddocs/(includingbenchmark.md§ Query stdout) updated to match.
v0.1.5
Patch Changes
-
#10
9d37bd5Thanks @SutuSebastian! - Agent templates (templates/agents/)- Align
codemap.mdcandskills/codemap/SKILL.mdwith the currentcodemap query --jsoncontract (bootstrap / DB / SQL failures,process.exitCode). - SKILL:
QUERY_RECIPES-aligned fan-out SQL examples and bundled-recipe determinism note.
- Align
v0.1.4
Patch Changes
-
#8
889ed5bThanks @SutuSebastian! - Query CLI-
codemap query --json: print a JSON array of result rows to stdout (and{"error":"…"}on SQL errors) for agents and automation. Document that the query subcommand does not cap rows — use SQLLIMITfor bounded results. Update bundled agent rule and skill with--jsonpreference, verbatim structural answers, and generic SQL recipes (fan-out + sample targets). -
codemap query --recipe <id>for bundled read-only SQL so agents can run common structural queries without embedding SQL on the command line.--jsonworks with recipes the same way as ad-hoc SQL. Bundled ids include dependencyfan-out/fan-out-sample/fan-out-sample-json(JSON1json_group_array) /fan-in, indexindex-summary,files-largest, Reactcomponents-by-hooks(comma-based hook count, no JSON1), andmarkers-by-kind. The benchmark suite uses thefan-outrecipe SQL for an indexed-path scenario; docs clarify that recipes add no extra query cost vs pasting the same SQL. -
Recipe discovery (no index / DB):
codemap query --recipes-jsonprints all bundled recipes (id,description,sql) as JSON.codemap query --print-sql <id>prints one recipe’s SQL.listQueryRecipeCatalog()insrc/cli/query-recipes.tsis the single derived view ofQUERY_RECIPESfor the JSON output.
Golden tests
bun run test:golden: indexfixtures/minimal, run scenarios fromfixtures/golden/scenarios.json, and compare query JSON tofixtures/golden/minimal/. Usebun scripts/query-golden.ts --updateafter intentional fixture or schema changes. Documented in benchmark.md and CONTRIBUTING.
Query robustness
- With
--json,{"error":"…"}is printed for invalid SQL, database open failures, andcodemap querybootstrap failures (config / resolver setup), not only bad SQL. The CLI setsprocess.exitCodeinstead ofprocess.exitso piped stdout is not cut off mid-stream.
Benchmark &
CODEMAP_BENCHMARK_CONFIG- Each
indexedSqlin custom scenario JSON is validated as a single read-onlySELECT(orWITH…SELECT) — DDL/DML andRETURNINGare rejected before execution. - Config file paths are resolved from
process.cwd()(see benchmark.md).traditional.regexstrings are developer-controlled (local JSON);filesmode compiles the regex once per scenario. - Overlapping globs in the traditional path are deduplicated so Files read / Bytes read count each path once.
- The default components in
shop/scenario uses aLIKEfilter aligned with the traditional globs undercomponents/shop/(*.tsx and *.jsx, matchingcomponentsrows from the parser) and avoids unrelated paths such asworkshop.
Recipes (determinism)
- Bundled recipe SQL adds stable secondary
ORDER BYcolumns (and orders innerLIMITsamples) so--recipe/--jsonoutput does not vary on aggregate ties.
External QA
bun run qa:external:--max-filesand--max-symbolsmust be positive integers (invalid values throw before indexing).
-
v0.1.3
Patch Changes
- #6
ad29694Thanks @SutuSebastian! - Align shipped agent templates with the published CLI (codemap,npx @stainless-code/codemap, …). Keep this repository’s.agents/rule and skill dev-oriented (bun src/index.ts). Remove the redundantagents-first-conventiontemplate. Document the dev vstemplates/agents/split intemplates/agents/README.mdanddocs/agents.md.