Repository navigation
docs(site): add @memhtml/traces to the API tier and give the tier one directory per package - #164
Conversation
… directory per package Second TSDoc slice. starlight-typedoc refuses a plugin instance whose output nests inside another's, so the flat api/ layout could never hold a second package: the contracts pages move to api/contracts/, traces lands at api/traces/, and an authored api/index.md is the tier's index (.gitignore now ignores api/*/ only). The sidebar's API group is an Overview link plus one autogenerated group per package. packages/traces/README.md is new and opens /api/traces/. Proven locally: astro build, 0 MDX-brace hits on every generated page, cspell 0, docs vitest 146/146, test:a11y 39/39 and test:budget on /api/ and /api/traces/ with temporary reverted gate edits, mise run check green.
There was a problem hiding this comment.
🟡 Changes recommended
The new API index page contains a factual contradiction about “nothing here is written by hand/committed” despite the page itself being authored and tracked.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Extends the docs site’s generated API tier to support multiple workspace packages by moving to a one-directory-per-package layout, and adds the first additional package (@memhtml/traces) to the published API reference.
Changes:
- Split the API tier output into per-package directories (
/api/contracts/,/api/traces/) and add an authored/api/index page. - Add a second
starlightTypeDocinstance for@memhtml/tracesand update the sidebar to group API pages by package. - Adjust
.gitignoreso only generated per-package API directories are ignored, while the authored API index remains tracked.
File summaries
| File | Description |
|---|---|
| packages/traces/README.md | Adds the package README used as the generated API overview content for @memhtml/traces. |
| apps/docs/src/content/docs/api/index.md | Introduces an authored /api/ landing page for the API tier. |
| apps/docs/astro.config.ts | Reconfigures API generation output paths and adds the @memhtml/traces TypeDoc generation + sidebar grouping. |
| .gitignore | Narrows the ignore rule to only ignore generated api/*/ directories, keeping api/index.md tracked. |
Review details
- Files reviewed: 3/4 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| description: The generated reference for the workspace packages, one directory per package and one page per module, built from the TSDoc in the source on every site build. | ||
| --- | ||
|
|
||
| The pages under this heading are generated from the TSDoc on each package's exported surface. Nothing here is written by hand and nothing here is committed: `starlight-typedoc` regenerates the whole tier on every `astro check` and `astro build`, so a page always describes the source at the commit the site was built from. When a signature on a page and a signature in the source disagree, the source is newer and the site is behind. |
There was a problem hiding this comment.
Agreed, the sentence contradicted the page it sat on. Reworded in 6230496: the paragraph now says that every page below the index is generated and that the index is the tier's one authored page, and it names the api/<package>/ directories as the gitignored, uncommitted part. mise run format:md and mise run check were re-run on the branch (64/64, 2m54s).
Third slice of the generated reference, after contracts (#158) and traces (#164): one more starlightTypeDoc instance writing api/eval/ from the package's single import path, a package README that opens the generated page and maps each exported symbol to its module, a row in the tier index, and a sidebar group. Measured on the branch: typedoc CLI exit 0 with one warning (AccessSpec referenced by CorpusSpec.access but not exported from index.ts, recorded in the config comment and left to the source), brace probe 0 hits over api/, astro build exit 0, a11y 33/33 and Lighthouse 5 URLs x 3 runs green with /api/eval/ temporarily in the gate lists and then restored, mise run check 64/64.
Maintenance run 2026-09-08 (Bonk, on Laith's standing authority for TSDoc generation wiring inside apps/docs and for package documentation). Second slice of the API tier, per the widening plan:
@memhtml/traces, the smallest package by exported surface after@memhtml/contractsthat renders brace-free (46 exports, one import path;@memhtml/storewas measured too and has one inherited-constructor block the plugin renders as escaped prose, so it waits).What changes
/api/contracts/(the six pages that were at/api/) and/api/traces/(one page), with an authored/api/index page inapps/docs/src/content/docs/api/index.md.starlight-typedocrefuses a second plugin instance whoseoutputnests inside another's (isSameOrNestedDirectoryin itsindex.ts), so a flatapi/could never hold a second package. URLs under/api/contracts/are new; the old/api/types/and siblings are gone. This is the first day the old URLs would have been linkable, and nothing authored in the repo links to them..gitignorenarrowsapps/docs/src/content/docs/api/toapps/docs/src/content/docs/api/*/, so the generated directories stay untracked and the authored index is tracked.apps/docs/astro.config.ts: the contracts instance moves tooutput: "api/contracts"; a second instance for traces (entryPoints: packages/traces/src/index.ts,tsconfig: packages/traces/tsconfig.json,readme: packages/traces/README.md,output: "api/traces") repeats the same TypeDoc options; the sidebar's API group becomes an Overview link plus one autogenerated group per package (a labelled group needsitems: [{ autogenerate }]on this Starlight).packages/traces/README.mdis new. It opens without an h1 (Starlight renders the frontmatter title) and is the opening of/api/traces/.No test, runtime, workflow or script file changes.
Verification (local, at the head of this branch)
astro buildapi/contracts/{index,edges,errors,paths,slug,types}.mdandapi/traces/index.mdtests/mdx-braces.ts'smdxExpressions) over every generated pagecspelloversrc/content/**test:a11ywith/api/and/api/traces/TEMPORARILY added toAUDITED_PAGES(reverted before commit)test:budgetwith the same two URLs TEMPORARILY added tolighthouserc.json(reverted before commit)mise run checkmise run format:md; a first attempt failed onlylint:mdon the two new unformatted Markdown files)The two open questions from #158 stand and now read against the new paths: whether
/api/contracts/types/(or/api/) joinsAUDITED_PAGESpermanently, and whether to bring back "Defined in" lines. Both are Laith's call.