Repository navigation
Render the API reference from TypeDoc output of the npm packages - #3
Merged
Merged
Conversation
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
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
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.
Summary
@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-apilists 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.llms.txtrender 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/*./api/<pkg>/(404 on GitHub Pages),{@link}anchors were lowercased, member links missed theirType-memberanchors, "Returns" showed raw{@linkcode}, and the Markdown endpoints linked a nonexistent/documentspath.@internaldeclarations are no longer listed.node:testasnpm testin CI, also crawling the*.md.htmlpages; the dead Denoscripts/build.tsis removed and the dev shell provides Node instead of Deno.vite.config.tskeeps Vite from resolvingtypedoc(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 docagainst 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 buildnpm test(62 links)tsc --noEmitreports nothing in the changed files@internalones), equal or more descriptions, parameters, and examples🤖 Generated with Claude Code
https://claude.ai/code/session_01N3xvJ1TaozjYSE6eoyo9mq