Skip to content

docs(site): add @memhtml/html to the API tier - #186

Closed
laithalsaadoon wants to merge 1 commit into
docs/html-doc-shapesfrom
docs/api-html
Closed

laithalsaadoon wants to merge 1 commit into
docs/html-doc-shapesfrom
docs/api-html

Conversation

@laithalsaadoon

Copy link
Copy Markdown
Contributor

Sixth slice of the generated API reference: @memhtml/html joins the tier at /api/html/. Documentation tooling and content only: one more starlightTypeDoc instance in apps/docs/astro.config.ts writing api/html/ from the package's single import path, a new packages/html/README.md that opens the generated page and maps every exported symbol to its module, a row in the tier index, and a sidebar group. No runtime, test or workflow file changes.

Base is docs/html-doc-shapes (#185): the page only renders brace-free once the six document shapes are interfaces. GitHub retargets this PR to main when #185 merges.

Measured on the branch

  • typedoc CLI over packages/html/src/index.ts: exit 0, 0 warnings, one page of 2746 lines, 0 escaped braces (7 hits and 6 unresolved {@link MemoryMetas.status} warnings on main, see docs(html): name the six document shapes as interfaces so the API tier renders them #185).
  • astro build: exit 0; brace probe over the built api/ tree: 0 hits; denylist scan of dist/: 0 files.
  • a11y: 33/33 tests with /api/html/ temporarily added to AUDITED_PAGES; Lighthouse: 15 reports (5 URLs x 3 runs) all assertions passing; /api/html/ performance/a11y/best-practices/SEO per run: 100/100/100/100, 99/100/100/100, 81/100/100/100 with /api/html/ temporarily added to lighthouserc.json. Both gate files restored before commit; the diff carries neither.
  • mise run check: exit 0, 68/68 tasks (on the third run; two earlier runs failed only apps/cli/tests/integrations.test.ts > integrations doctor > completes the live MCP handshake with no initialize result within 5000 ms, which also passes and fails alone on the same tree with no file change, so it is load-sensitive and unrelated to this diff).

Open question carried from #158

Whether /api/<package>/ pages should join AUDITED_PAGES permanently is still Laith's call; this PR proves the gates pass with the page in and leaves the lists as they were.

Sixth slice of the generated reference: one more starlightTypeDoc instance
writing api/html/ from the package's single import path, a package README
that opens the generated page and maps every exported symbol to its module,
a row in the tier index, and a sidebar group. Stacked on the document-shape
interfaces (docs/html-doc-shapes), without which the page renders seven
escaped braces.

Measured on the branch: typedoc CLI exit 0 with zero warnings and zero brace
hits, astro build exit 0, denylist scan of dist 0 files, a11y 33/33 and
Lighthouse 5 URLs x 3 runs green with /api/html/ temporarily in the gate
lists and then restored, mise run check 68/68.
@laithalsaadoon

Copy link
Copy Markdown
Contributor Author

Closed in favor of #264, which consolidates the four API-tier PRs (#185 html document shapes, #186 the @memhtml/html API page, #199 index types, #201 sleep types) into one branch built by merge commits from main a1c6913. The slice conflict on apps/docs/astro.config.ts and api/index.md was resolved by appending the html block after llm; the block is byte-identical to #186's. Gate 68/68, including the docs build that writes /api/html/ and the MDX brace probe. The branch here is kept, so this PR can be reopened if the parts should land apart.

laithalsaadoon added a commit that referenced this pull request Oct 20, 2026
… @memhtml/html to it (#264)

Three type-only edits under `packages/*/src` plus the `@memhtml/html` API page. No runtime line changes: the emitted JavaScript is identical.

What changes:
- `packages/html/src/document.ts`: the six document shapes (`MemoryMetas`, `MemoryLink`, `Facet`, `Citation`, `ArticleExtractions`, `MemoryDoc`) become interfaces that extend `typeof X.Type`, so the const and the interface merge under one name and every import site compiles unchanged.
- `@memhtml/html` API page: a `starlightTypeDoc` instance writes `/api/html/` from the package's single import path; a new `packages/html/README.md` opens the page; the tier index gains a row and the sidebar a group.
- `packages/index/src`: `type` exports for five interfaces that exported signatures already reference (`ArchivedMatch`, `EmbedMissingOptions`, `StoreChangedPath`, `StoreStatusEntry`, `StoreTreeEntry`); `IndexStateRow` becomes an interface the same way as the html shapes; six `{@link}`s to private names become code spans.

Why: typedoc expands a `typeof X.Type` alias inline wherever a signature uses it, and typedoc-plugin-markdown prints an inline object literal inside a type argument as escaped `\{` prose, which `apps/docs/tests/figures.test.ts` rejects. The interfaces and named types render as links instead. Measured with the typedoc CLI: html went from 7 brace hits and 6 warnings to 0 and 0; index from 12 warnings and 1 hit (plus 13 hits from html's aliases) to 0 and 0. With these on main, the index API page (`/api/index/`) can follow as a docs-only slice.

One caveat: an interface does not get the implicit index signature an object-literal type alias gets, so an out-of-tree consumer that assigned a `MemoryDoc` or an `IndexStateRow` to `Record<string, unknown>` would stop compiling. The workspace typecheck finds no such site.

Consolidates #185, #186, #199 and #201, closed in favor of this branch. The `packages/sleep` part of the original branch no longer applies: 0.16.0 removed that package.
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.

1 participant