Skip to content

Render the API reference from TypeDoc output of the npm packages - #3

Merged
lambdalisue merged 3 commits into
mainfrom
docs/npm-link
Oct 11, 2026
Merged

lambdalisue merged 3 commits into
mainfrom
docs/npm-link

Conversation

@lambdalisue

@lambdalisue lambdalisue commented Oct 10, 2026 •

Copy link
Copy Markdown
Member

Summary

  • API pages link to the @probitas-test/<name> package on npm ("View on npm") ahead of "View on JSR", and the JSR link points at the mirror's own name (@probitas/<name>).
  • npm run generate-api lists the packages of the npm organization, installs them, and runs TypeDoc on each package's published sources; data/api/ now holds TypeDoc's JSON (regenerated here from the current releases) and is replaced only after every package converted.
  • The API pages, the Markdown endpoints, and llms.txt render the TypeDoc model: overloads from a function's signatures, accessors as read-only properties, object-literal aliases with their members, and one type tokenizer (parenthesizing by precedence) behind signatures, inline types, and the related-type links. Packages are named @probitas-test/*.
  • Fixes links that were broken on the live site: cross-package type links went to /api/<pkg>/ (404 on GitHub Pages), {@link} anchors were lowercased, member links missed their Type-member anchors, "Returns" showed raw {@linkcode}, and the Markdown endpoints linked a nonexistent /documents path. @internal declarations are no longer listed.
  • The link checker runs on node:test as npm test in CI, also crawling the *.md.html pages; the dead Deno scripts/build.ts is removed and the dev shell provides Node instead of Deno.
  • vite.config.ts keeps Vite from resolving typedoc (imported for types only), because HonoX's island detection walks type imports too and stalled the build parsing TypeScript.

Why

Probitas 2 installs from npm, but the API pages linked only to JSR, and their data came from deno doc against the JSR packages, which needed Deno 2.6 specifically (newer releases emit a schema the site could not render). Generating from the npm packages with TypeDoc removes the last Deno and JSR dependency of the site and keeps the reference in step with what users install.

The module docs rendered on the pages lead with npm once probitas-test/probitas-packages#31 and probitas-test/probitas#123 are released; the API data needs regenerating after those releases.

Test Plan

  • npm run build
  • npm test (62 links)
  • tsc --noEmit reports nothing in the changed files
  • Compared each package page with the live site: same exports (minus @internal ones), equal or more descriptions, parameters, and examples
  • Checked builder, client-redis, and probitas pages in a browser (classes, overloads, members)

🤖 Generated with Claude Code

https://claude.ai/code/session_01N3xvJ1TaozjYSE6eoyo9mq

API pages linked only to JSR, so every package read as JSR-first even
though Probitas 2 installs from npm. They now link to the
@probitas-test package on npm ahead of the JSR link.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N3xvJ1TaozjYSE6eoyo9mq
Copilot AI balanced review requested due to automatic review settings October 10, 2026 18:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

lambdalisue and others added 2 commits October 11, 2026 12:06
The link checker needed Deno (std modules from JSR and deno_dom), so it
never ran in CI, and it only crawled llms.txt: the Markdown pages are
written as *.md.html, and their *.md links resolved to no file even
though GitHub Pages serves them.

It now runs on node:test as `npm test` after the build, crawls the
*.md.html pages as Markdown, and resolves a link the way GitHub Pages
does, falling back to <path>.html. scripts/build.ts, a Deno build script
for an entry point that no longer exists, goes away.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N3xvJ1TaozjYSE6eoyo9mq
…ckages

The API data came from `deno doc` run against the JSR packages, so
regenerating it needed Deno, and specifically Deno 2.6: newer releases
emit a schema the site cannot render. It also tied the reference to the
JSR mirror while Probitas 2 installs from npm.

The generator now lists the packages of the npm organization, installs
them, and runs TypeDoc on each package's published sources, writing
TypeDoc's JSON to data/api/ (replaced only once every package
converted). The pages render that model directly: overloads come from a
function's signatures, accessors read as properties, object-literal
aliases list their members, and type formatting goes through one
tokenizer that also yields the type references, parenthesizing by
precedence. Pages name the packages @probitas-test/* and link the JSR
mirror under its own name.

Rendering from TypeDoc also fixes links that were broken on the live
site: cross-package type links pointed at /api/<pkg>/ (a 404 on GitHub
Pages), {@link} anchors were lowercased, member links missed their
Type-member anchors, and the Markdown endpoints linked a /documents
path that does not exist. @internal declarations are no longer listed.

HonoX walks every import of app files, type imports included, to find
islands; following `typedoc` parsed all of TypeScript and stalled the
build, so Vite treats `typedoc` as external.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N3xvJ1TaozjYSE6eoyo9mq
@lambdalisue lambdalisue changed the title Link each API page to its npm package first Render the API reference from TypeDoc output of the npm packages Oct 11, 2026
@lambdalisue
lambdalisue merged commit 71cf8a2 into main Oct 11, 2026
2 checks passed
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