Repository navigation
docs(api): name the html and index shapes the API tier needs, and add @memhtml/html to it (open-only) - #264
Conversation
…r renders them
MemoryMetas, MemoryLink, Facet, Citation, ArticleExtractions and MemoryDoc
were `export type X = typeof X.Type` aliases. TypeDoc expanded each inline
wherever a signature used it, and typedoc-plugin-markdown rendered the nested
literals as escaped braces (7 hits across metaPairs, serializeMemory and
parseMemory) that the figures probe rejects; the 6 {@link MemoryMetas.status}
references also failed to resolve against the const. As interfaces extending
the same Schema.Struct type the const and the type merge under one name, every
import site compiles unchanged, and the page renders 0 hits and 0 warnings.
Type-only; no runtime line changes. mise run check 68/68.
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.
…e API tier renders them TypeDoc over packages/index/src/index.ts reported twelve warnings and one brace hit of its own (the rest belong to @memhtml/html's aliases and go away with #185). Five interfaces were referenced from exported signatures but not exported themselves (ArchivedMatch, EmbedMissingOptions, StoreChangedPath, StoreStatusEntry, StoreTreeEntry): they join the package's type exports. Six {@link}s pointed at module-private or closure-local names (runMigrations, truncateForRebuild x4, EMBED_PERSIST_SLICE) that no reader can follow: they become code spans. IndexStateRow was `export type X = typeof X.Type`, which TypeDoc inlines as a literal in readIndexState's return type; as an interface extending the same Schema.Struct type it renders as a linked reference, the pattern #185 uses for the html shapes. Type-only and doc-comment-only; no runtime line changes. tsc and biome pass on the package.
…the API tier renders them
Type-only and doc-comment changes under packages/sleep/src, found by running the typedoc CLI over
src/index.ts with the settled apps/docs options (15 warnings, 1 MDX brace hit before; 0 and 0 after).
- `mineAllBands` returned an inline `{ mined, deepMined }` literal inside `Effect<...>`, which
typedoc-plugin-markdown renders as escaped brace prose (the one brace hit). It now returns the
exported interface `MinedBandCounts`, re-exported through phases/index.ts. Same shape, same fields.
- `CandidateEntityLike` (consolidator.ts) and `EntityClaim` (sql.ts) were referenced by exported
signatures but not re-exported from index.ts; both are now `export type` members.
- Fourteen `{@link}` targets that resolve to private names, or to nothing (`manifestRowsFor` never
existed under that name; the grouper is the trace-consolidation phase; `STANCE_CONFIDENCE_FLOOR` is
`EDGE_CONFIDENCE_FLOOR`), are now code spans, matching the treatment in #170 and #199.
No runtime behavior changes; no test touched. Open-only: adds public type names under packages/*/src.
0.16.0 removed packages/sleep, so this merge drops the branch's edits to its eleven files and keeps main's deletion. The html shapes, the index type exports and the @memhtml/html API instance merge unchanged.
|
Merged
Still open-only: it adds public names under |
… API doc-shapes branch
|
Merged
Still open-only: it adds public names under |
…o the API doc-shapes branch # Conflicts: # apps/docs/astro.config.ts # apps/docs/src/content/docs/api/index.md
|
Merged main (8df19f6) into this branch as 4e3fbea, a signed merge commit. Main had gained the |
Open for review, not for an automatic merge: three of its four parts are type-only edits under
packages/*/src, which sit outside the maintenance job's merge authority even though no runtime line changes. This PR consolidates #185, #186, #199 and #201 into one branch; those four are closed in favor of it, and their bodies keep the probe details.What changes
packages/html/src/document.tsMemoryMetas,MemoryLink,Facet,Citation,ArticleExtractions,MemoryDoc) become interfaces that extendtypeof X.Type, so the const and the interface merge under one name and every import site compiles unchanged.@memhtml/htmlAPI pagestarlightTypeDocinstance writes/api/html/from the package's single import path; a newpackages/html/README.mdopens the page; the tier index gains a row and the sidebar a group.packages/index/srctypeexports for five interfaces that exported signatures already reference (ArchivedMatch,EmbedMissingOptions,StoreChangedPath,StoreStatusEntry,StoreTreeEntry);IndexStateRowbecomes an interface the same way as the html shapes; six{@link}s to private names become code spans.packages/sleep/srcmineAllBandsreturns the new exported interfaceMinedBandCounts(same fields) instead of an inline literal;CandidateEntityLikeandEntityClaimare re-exported; fourteen{@link}s to private or missing names become code spans.Why
typedoc expands a
typeof X.Typealias inline wherever a signature uses it, and typedoc-plugin-markdown prints an inline object literal inside a type argument as escaped\{prose, whichapps/docs/tests/figures.test.tsrejects. The interfaces and named types render as links instead. Measured with the typedoc CLI when each part was opened: 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; sleep from 15 warnings and 1 hit to 0 and 0.With all four on main, the index and sleep API pages (
/api/index/,/api/sleep/) can follow as docs-only slices.One caveat to weigh
An interface does not get the implicit index signature an object-literal type alias gets, so an out-of-tree consumer that assigned a
MemoryDocor anIndexStateRowtoRecord<string, unknown>would stop compiling. The workspace typecheck finds no such site.How the branch was built
Branched from main a1c6913, then merge commits of
docs/html-doc-shapes,docs/index-doc-shapesanddocs/sleep-doc-shapes(clean) and ofdocs/api-html. The last conflicted onapps/docs/astro.config.tsandapps/docs/src/content/docs/api/index.md, the usual slice conflict where two branches each append a plugin instance, a sidebar group and a table row after thellmones. It was resolved by keeping main's file and appending #186'shtmlblock, group and row after thellmones; thehtmlplugin block is byte-identical to #186's.Verified
mise run checkon 3dd743a: 68/68 in 478 s, including the docs build that now writes/api/html/, the MDX brace probe over the generated pages, the link checks and the a11y and Lighthouse tiers.