Skip to content

docs(site): add @memhtml/traces to the API tier and give the tier one directory per package - #164

Merged
laithalsaadoon merged 2 commits into
mainfrom
docs/typedoc-traces
Sep 8, 2026
Merged

laithalsaadoon merged 2 commits into
mainfrom
docs/typedoc-traces

Conversation

@laithalsaadoon

Copy link
Copy Markdown
Contributor

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/contracts that renders brace-free (46 exports, one import path; @memhtml/store was measured too and has one inherited-constructor block the plugin renders as escaped prose, so it waits).

What changes

  • The API tier becomes one directory per package: /api/contracts/ (the six pages that were at /api/) and /api/traces/ (one page), with an authored /api/ index page in apps/docs/src/content/docs/api/index.md. starlight-typedoc refuses a second plugin instance whose output nests inside another's (isSameOrNestedDirectory in its index.ts), so a flat api/ 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.
  • .gitignore narrows apps/docs/src/content/docs/api/ to apps/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 to output: "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 needs items: [{ autogenerate }] on this Starlight).
  • packages/traces/README.md is 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)

Check Result
astro build exit 0; generates api/contracts/{index,edges,errors,paths,slug,types}.md and api/traces/index.md
MDX-brace probe (tests/mdx-braces.ts's mdxExpressions) over every generated page 0 hits
cspell over src/content/** 49 files, 0 issues
apps/docs vitest tier 146/146
test:a11y with /api/ and /api/traces/ TEMPORARILY added to AUDITED_PAGES (reverted before commit) exit 0, 39/39 across 2 files (a11y and layout stability), up from 33 on the four standing pages
test:budget with the same two URLs TEMPORARILY added to lighthouserc.json (reverted before commit) exit 0, 6 URLs x 3 runs, no assertion failures against the performance 0.9 / accessibility 0.95 / best-practices 0.95 / SEO thresholds
mise run check exit 0, 64/64 tasks, 2m59s (after mise run format:md; a first attempt failed only lint:md on 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/) joins AUDITED_PAGES permanently, and whether to bring back "Defined in" lines. Both are Laith's call.

… 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.
Copilot AI lite review requested due to automatic review settings September 8, 2026 07:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 starlightTypeDoc instance for @memhtml/traces and update the sidebar to group API pages by package.
  • Adjust .gitignore so 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.

Comment thread apps/docs/src/content/docs/api/index.md Outdated
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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

@laithalsaadoon
laithalsaadoon merged commit cd5bc4b into main Sep 8, 2026
11 checks passed
@laithalsaadoon
laithalsaadoon deleted the docs/typedoc-traces branch September 8, 2026 07:57
laithalsaadoon added a commit that referenced this pull request Sep 9, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants