Repository navigation
docs(index): export the referenced types and name IndexStateRow so the API tier renders them - #199
Closed
laithalsaadoon wants to merge 1 commit into
Closed
laithalsaadoon wants to merge 1 commit into
laithalsaadoon wants to merge 1 commit into
Conversation
…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.
Contributor
Author
|
Local gate on |
This was referenced Oct 12, 2026
Contributor
Author
|
Closed in favor of #264, which consolidates the four API-tier PRs (#185 html document shapes, #186 the |
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Type-only and doc-comment-only changes in
packages/index/srcso TypeDoc can render@memhtml/indexfor the docs site's API tier. Four files, +15/-8. No runtime line changes, no tests touched.index.ts: addstypeexports for the five interfaces that exported signatures already reference:ArchivedMatch(SearchResult.archived),EmbedMissingOptions(IndexerShape.embedMissing),StoreChangedPath,StoreStatusEntry,StoreTreeEntry(StoreGitShape).index-state.ts:IndexStateRowbecomestype IndexStateRowShape = typeof IndexStateRow.Type; export interface IndexStateRow extends IndexStateRowShape {}, the pattern docs(html): name the six document shapes as interfaces so the API tier renders them #185 uses for the html shapes. Structurally identical; every import site compiles unchanged.database.ts:297,indexer.ts:44,104,155,195,225: six{@link}targets that are module-private (runMigrations), closure-local (truncateForRebuild) or not on the package surface (EMBED_PERSIST_SLICE) become code spans. No value export was widened to satisfy a link.Why
The next API-tier slice is
packages/index(170 exports). Probed with the typedoc CLI and the site's settled options, the package's own contribution was 12 warnings (5 referenced-but-unexported types, 7 unresolved links) and 1 MDX brace hit (readIndexState's return type,IndexStateRow | undefined, inlined as an escaped literal). With this change and #185 both in place the page renders 0 warnings and 0 hits; measured on a worktree at #185's head with@memhtml/htmlresolved from source (artifactslogstypedoc-index-probe.log,typedoc-index-brace.login the maintenance workspace). The remaining 13 hits under today's main are@memhtml/html'sMemoryDocalias inlined into thedoc:parameters of theproject.tsfunctions; #185 removes those and nothing inpackages/indexcan.This PR does not depend on #185: it compiles on
mainas is. The docs-site slice (astro.config.ts instance,api/index.mdrow, package README) follows as a separate PR once both are onmain.Boundary
Open-only: it touches
packages/index/src, so it waits for Laith even though every change is a type or a comment.tsc -p packages/index/tsconfig.check.jsonandbiome checkpass;mise run checkresult is in the first comment.