Skip to content

Reference

There is no root export. Every entry point is a subpath, so an import always names the file it came from.

SubpathEnvironmentContents
@waveso/docs/nextNodecreateDocsRoute, createDocsSitemap, createDocsRedirects
@waveso/docs/sourceNodecreateDocsSource, resolveDocsConfig
@waveso/docs/renderNodecreateDocsRenderer, resolveMarkdownLink
@waveso/docs/highlighterNodecreateDocsHighlighter, DEFAULT_DOCS_LANGS, DEFAULT_DOCS_THEMES
@waveso/docs/search-indexNodeextractSearchRecords, buildSearchIndex
@waveso/docs/frontmatterAnydocFrontmatterSchema, parseFrontmatter, z
@waveso/docs/errorsAnyDocsErrorCode, DocsError, isDocsError, DOCS_ERROR_PREFIX
@waveso/docs/typesAnyEvery shared type. Type-only
@waveso/docs/react/*Browser + RSCNine components, one per subpath
@waveso/docs/styles.cssThe stylesheet

The Node-only subpaths carry "browser": null, so importing one from client code fails with a located module not found rather than resolving.

That is about weight, not about node:fs. render, highlighter and search-index require no Node builtins at all — the pipeline runs wherever JavaScript does, and Shiki is loaded through its JavaScript regex engine rather than WASM on purpose. What a bundler would do with them is succeed, and ship unified and every Shiki grammar to a reader.

createDocsRoute

OptionDefault
contentDirRequired. Resolved against process.cwd()
basePath/docsWhere the routes are mounted
siteUrlMakes canonicals absolute. Must be an absolute URL
includeDraftsfalsedraft: true pages join the routes
titleHeadingtrueEmit an h1 from the frontmatter title
frontmatterSchemabuilt-inAny Standard Schema. Extend, do not replace
remarkPlugins[]Before link resolution
rehypePlugins[]After heading ids, before Shiki
miniSearchOptions{}Forwarded to the dialog automatically
components{}Merged over the built-in element map
excludeLangs[]Fences to route past the highlighter

docs.Layout

Five props, and a test fails when someone adds a sixth.

PropTypeDefault
childrenReactNodeThe page
titleReactNodeBrand, at the header start
actionsReactNodeHeader end, after search
searchboolean | DocsSearchPropstrueThe trigger; an object configures the dialog
labelsDocsLabelsEnglishThe four strings the shell renders itself

Everything else a docs shell gets asked for is already reachable. An announcement banner renders above docs.Layout in your own layout, because it does not own <body>. A content footer goes inside children. Sidebar links, social icons and separators are DocNavNodes authored in meta.json.

What it costs

At most
Everything the quick start ships, gzipped13.0 KB
Search dialog and router wiring9.0 KB
Navigation: sidebar and mobile drawer2.2 KB
Table of contents0.9 KB
Copy-button runtime0.9 KB
hast over the wire vs HTML, prose page1.20×
Highlighting vs no highlighting2.00×

Every one is a ceiling pnpm size fails the build over, in CI and again in prepublishOnly.

Requirements

Node.js≥ 22.12.0
React19
Next.js16 (optional peer)
Module formatESM only
TypeScript5.9+

ESM-only is forced rather than chosen: unified and the entire remark-* / rehype-* lineage are "type": "module" with no CJS build, so a dual output would resolve to nothing.