Skip to content

feat(website): generate API reference with the TypeScript 7.1 API - #346

Draft
jbergstroem wants to merge 2 commits into
mainfrom
jbergstroem/chore/typescript-7-1-beta
Draft

jbergstroem wants to merge 2 commits into
mainfrom
jbergstroem/chore/typescript-7-1-beta

Conversation

@jbergstroem

@jbergstroem jbergstroem commented Oct 24, 2026 •

Copy link
Copy Markdown
Owner

Why

The API reference was written by hand in each package README and could drift from the code. TypeScript 7.1 adds a programmatic compiler API, so the reference can be generated from the exported types and JSDoc that already exist in the source.

What

  • Bump typescript to 7.1.0-beta. Build, typecheck, lint and tests pass unchanged, and the emitted .d.ts files are identical to 7.0.2.
  • Add website/lib/api-docs.ts, a build step that reads each public package through typescript/async and extracts every export: kind, declaration, description, parameters, returns, throws and examples. Public packages are the non-private ones with an index.ts at their root (core, js, sql, time-resolver; 51 exports).
  • Write two outputs from the same data: an HTML reference at /api/ (linked from the home page footer) and a plain-text version at llms/api.txt (linked from llms.txt).
  • Class output lists only public, own members and shows extends. The printer's redundant | undefined after optional parameters is removed.
  • The dev server serves directory indexes (/api/) and also watches packages/, so a JSDoc change rebuilds the docs.
  • Move the shared CSS build into html.ts.

Notes

  • Written with Claude Code (Claude Sonnet 5.5) at my direction.
  • This depends on a beta. The typescript/async API may change before 7.1 is stable, which is why this is a draft. The version bump is its own commit and can be split out or held.
  • typescript/sync crashes under Bun because it uses the Node-only stdout._handle.fd. typescript/async works under Bun and Node, so the generator uses the async API.
  • The website build goes from about 13ms to about 200ms, mostly type extraction.
  • The llms/api.txt file is run through oxfmt like the other llms files, which changes quote style and rewraps long unions. The HTML keeps the source as written.

Closes #105

jbergstroem and others added 2 commits October 24, 2026 15:15
Try the 7.1 beta, which adds the programmatic API (typescript/async,
typescript/ast and others). The existing build, typecheck, lint and
tests pass unchanged, and the emitted declaration files are identical
to 7.0.2.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Add a build step that reads the exports and JSDoc of each public
package through the TypeScript 7.1 compiler API and writes two outputs:
an HTML reference at /api/ and a plain-text version at llms/api.txt,
linked from llms.txt. Public packages are the non-private ones with an
index.ts at their root. The async API is used because typescript/sync
depends on Node internals and does not run under Bun.

The dev server now serves directory indexes and also watches the
packages, so a JSDoc change rebuilds the docs. The shared CSS build
moves into html.ts.

Closes #105

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
pr-346 — 093d4e34 Deployed Oct 24, 2026 by github-actions[bot]
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.

Automate api docs

1 participant