Repository navigation
Conversation
VitePress containers become GitHub alerts, code group wrappers go (adjacent code blocks are tabs in doc-kit), code block titles become `displayName`s, and pages with components become MDX. Links to headings use doc-kit's anchors. Assisted-by: Claude Opus 5.5 <[email protected]>
The JSDoc comments and the option docs they include are rendered into the API reference: their VitePress containers become GitHub alerts and their code block titles `displayName`s, and separate adjacent code blocks get a comment between them, as doc-kit shows adjacent code blocks as tabs. Assisted-by: Claude Opus 5.5 <[email protected]>
doc-kit drops the dot from the heading's anchor: #import-meta is #importmeta. Assisted-by: Claude Opus 5.5 <[email protected]>
The layouts (documentation, home, 404), the home page and the API reference's sidebar and index, built on @voidzero-dev/doc-kit-theme, which holds the VoidZero styles and components. The navigation is data, in VitePress' themeConfig shape (navigation.json). Assisted-by: Claude Opus 5.5 <[email protected]>
doc-kit replaces VitePress, configured in doc-kit.config.mjs; the API reference is generated by TypeDoc with doc-kit's TypeDoc plugin (typedoc.config.mjs). The scripts are plain: `reference`, `build`, `dev` (TypeDoc and doc-kit in watch mode, served by `serve`) and `preview`. doc-kit comes from a clone next to this repository, at the top of the stack of pull requests adding what the site needs (nodejs/doc-kit#1127), until they are released. Assisted-by: Claude Opus 5.5 <[email protected]>
knip entries, editor settings, format ignores, the root docs scripts and the deploy workflow's reference fingerprint follow the new layout. Assisted-by: Claude Opus 5.5 <[email protected]>
Assisted-by: Claude Opus 5.5 <[email protected]>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Author
The example had no tsconfig, so type-aware lint checked its TSX with default options. With React's types installed (they come with the docs' UI components, as optional peers of Radix UI), `React.JSX` started resolving and its JSX failed to type-check. The tsconfig extends the root one, which only loads Node's types, and preserves JSX for the bundler. Assisted-by: Claude Opus 5.5 <[email protected]>
Each entry point TypeDoc documents is named with `@module` after the path it's imported from (`rolldown/utils`), which the reference shows on exports the main entry point lacks. The main one is merged into the project with `@mergeModuleWith <project>`, so its exports keep URLs of their own (`Function.build`), and the lint config allows that tag. Assisted-by: Claude Opus 5.5 <[email protected]>
A linked package keeps its own dependencies, so the docs loaded a second TypeDoc next to the plugin's, and the plugin's router, which extends TypeDoc's, wrote no pages. TypeDoc now comes from the linked plugin, until doc-kit is released. Assisted-by: Claude Opus 5.5 <[email protected]>
The plugin now builds on TypeDoc's router and options (nodejs/doc-kit#1125). The config uses `docKit`, TypeDoc's `basePath` for source links, and `docKitUrlAdapter` to keep rolldown.rs' URLs (`Interface.Plugin`, `InputOptions.input`), so every existing link and redirect still works. Plugin hooks get the signatures of `FunctionPluginHooks` from a small TypeDoc plugin, as `Plugin` types them as `ObjectHook<…>`, and the sidebar reads the new page list. Assisted-by: Claude Opus 5.5 <[email protected]>
Author
|
Despite being a nice PoC, the VoidZero team let me know that migrating away from VitePress would be complicated. Closing this PR and hopefully in the future it gets adopted :) |
Collaborator
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.
Important
This is a proof of concept, not ready to merge. It depends on doc-kit pieces that aren't released yet, so CI will fail until they are (
pnpm-workspace.yamlpoints@doc-kit/*at a local clone).Description
This PR migrates rolldown.rs from VitePress to doc-kit, keeping the site looking and behaving the same, URLs and anchors included.
Why doc-kit
doc-kit is the documentation generator behind the Node.js API docs, and it's built around one thing: the experience of reading and writing API documentation. VitePress is a great general-purpose site generator, but an API reference on top of it is something we bolt on ourselves (TypeDoc → Markdown → custom components). doc-kit understands APIs natively:
@doc-kit/typedoc, the reference comes straight from Rolldown's TypeScript sources and JSDoc, and is just more doc-kit Markdown next to the guides: same components, search, navigation andllms.txt.llms-full.txtsupport) benefit everyone, and vice versa.What it depends on
It needs a few counterparts, which are up for review:
@doc-kit/typedoc, a TypeDoc plugin writing the API reference as doc-kit Markdowndotcode blocks as Graphviz diagramsllms-full.txtovflowd/voidzero-dev-doc-kit-theme: the VoidZero design (styles and components) for doc-kit, installed from Git at a commit. It's a temporary home, meant to move under@voidzero-devif this goes anywhere. The VoidZero fonts and brand assets are VoidZero's: the theme takes them from@voidzero-dev/vitepress-themerather than copying them.Screenshots
Before is rolldown.rs, after is this branch (1440×900).
build()treeshakeoptionWhere doc-kit shines
The API pages are where the difference shows the most: doc-kit renders signatures, typed parameter tables with their return values, stability indices, source links and events natively, and options are documented once and linked everywhere else.
InputOptions(now a linked list of options instead of ~1,460 lines repeating their docs)checksoption, with its nested optionsthis.resolve()in the plugin contextRolldownWatcherevents (doc-kitEvent:entries)What changed
typedoc,doc-kit generateandservecalls.docs/typedoc.config.mjs), using doc-kit's own signatures, typed lists, stability and source links. Options are documented once, on their own page, and listed with a link everywhere else: before, each input option's docs were repeated on four pages (Interface.InputOptions,RolldownOptions,WatchOptionswere ~1,460 lines each, now ~40).displayNamecode block titles, adjacent code blocks as tabs.dotblocks rendered by doc-kit, with light and dark colors. The two hook graphs were converted from their custom DSL, with the legend as a Graphviz table.llms.txt, each page's.mdandllms-full.txtare still served, now generated by doc-kit.docs/navigation.json, in VitePress'themeConfigshape (nav,sidebar,socialLinks,footer,editLink)./reference/Interface.Plugin#load): 0 broken internal links out of 58,227 across 277 pages.Build performance
Clean builds, three alternating runs each, on the same
maincommit (6fbe999), medians:xychart-beta title "Clean docs build (seconds)" x-axis ["Reference (VitePress)", "Reference (doc-kit)", "Site (VitePress)", "Site (doc-kit)", "Total (VitePress)", "Total (doc-kit)"] y-axis "Seconds" 0 --> 10 bar [1.45, 1.60, 6.00, 7.52, 7.45, 9.12]main)Being honest here: doc-kit is ~22% slower end to end right now (the recent
vite-plusv1 update made the VitePress build quite a bit faster). Most of doc-kit's time is itsjsx-aststage (~5.3s of the site build), so we plan to improve that and the TypeDoc plugin on the doc-kit side, and maybe move doc-kit's bundling to Vite+.Trade-offs
git log.#import-metais now#importmeta) land at the top of the page. Links within the site are updated.Validation
To run it locally, clone doc-kit next to this repository, at the top of the stack:
Then:
Checked: format, lint and knip pass, every internal link and anchor resolves, and pages were compared with rolldown.rs side by side (light and dark).