Skip to content

docs(site): render generated TypeDoc as the API reference (#3763)#3948

Merged
williamzujkowski merged 2 commits into
mainfrom
docs/3763-typedoc-website
Jun 18, 2026
Merged

docs(site): render generated TypeDoc as the API reference (#3763)#3948
williamzujkowski merged 2 commits into
mainfrom
docs/3763-typedoc-website

Conversation

@williamzujkowski

Copy link
Copy Markdown
Collaborator

Closes #3763 (epic #3532 item).

What

Wires the generated TypeDoc markdown (JSDoc → typedoc + typedoc-plugin-markdown, spike #3686) into the website as a dedicated, rendered API-reference section. The markdown generation already worked; the missing piece was the website wiring — an Astro content collection + a render route. Before this PR the generated docs/api/index.md was being silently absorbed into the docs collection and rendered under /docs/api/; now it has its own collection and /api/ section.

Collection + route wiring

  • api content collection (website/src/content.config.ts) — loads the committed generated markdown from docs/api via the glob loader, sharing the same frontmatter schema as docs.
  • website/src/pages/api/[...slug].astro — mirrors the docs route, rendering the collection through DocsLayout. The generated index page is mapped to the /api/ section root (slug undefined).
  • docs collection now excludes api/** (pattern: ['**/*.md', '!api/**']) so the API reference renders only under /api/, not duplicated under /docs/api/.
  • Added an API Reference link to the docs sidebar nav.

Frontmatter compatibility

Already solved at generation time by the spike: typedoc-plugin-frontmatter + the local scripts/typedoc-astro-title.mjs plugin inject title / description / tier into every generated page — exactly what the Astro collection schema (and the entry.data.title filter in the route) require. No post-processing needed.

One lint adjustment: lint-staged flagged the original import { z } from 'astro:content' + .passthrough() as deprecated (it only lints changed files). Switched to import { z } from 'astro/zod' + z.looseObject(...) per the rule.

Build wiring

docs:api:md runs as the website prebuild, so the markdown is regenerated before astro build. Generated output stays committed under docs/api/ — matching the existing convention (docs/api/ and docs/reference/* are both committed; .gitignore notes "TypeDoc output committed"). Regenerating produced only cosmetic formatting drift (quote style / indentation) in the committed docs/api/index.md.

Build verification

pnpm --filter nexus-agents-website buildgreen, 110 pages, /api/index.html generated, /docs/api/ correctly absent. astro check0 errors (one pre-existing unrelated hint in BaseLayout.astro). No package TS touched, so no tsc --noEmit needed.

Scope

The API surface stays scoped to the spike's single canonical entry point (src/core/result.ts → 9 exports, one page) rather than the full 8740-export surface. This proves the pipeline end-to-end and keeps the build fast; expanding typedoc.markdown.json entry points is a follow-up. No MCP tool / CLI command touched; inject-governance.ts / docs-check.yml / SKILL.md untouched.

🤖 Generated with Claude Code

Wire the generated TypeDoc markdown into the website as a dedicated,
rendered API-reference section.

- Add an `api` Astro content collection loading the committed generated
  markdown from docs/api, sharing the docs frontmatter schema.
- Add website/src/pages/api/[...slug].astro rendering the collection,
  mapping the generated `index` page to the /api/ section root.
- Exclude api/** from the `docs` collection so the API reference renders
  only under /api/ instead of being duplicated under /docs/api/.
- Run docs:api:md as the website prebuild so markdown is regenerated
  before astro build; add an API Reference nav link.

Frontmatter compatibility was already solved at generation time by the
existing typedoc-plugin-frontmatter + scripts/typedoc-astro-title.mjs.
Use astro/zod + looseObject (astro:content z export is deprecated).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…api (#3763)

The prebuild ran `docs:api:md` (typedoc) at website-build time, which type-checks
nexus-agents source and needs nexus-memory's dist declarations — unavailable in
the website's CI build (TS7016), breaking Build/Test/Consolidation-E2E. The API
markdown is committed under docs/api/, so the site renders it directly;
regeneration stays the `docs:api:md` script (decoupled from the site build).
Verified: website build green (110 pages, /api/ rendered).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@williamzujkowski williamzujkowski merged commit 5c12a37 into main Jun 18, 2026
42 checks passed
@williamzujkowski williamzujkowski deleted the docs/3763-typedoc-website branch June 18, 2026 05:04
@github-project-automation github-project-automation Bot moved this from Backlog to Done in nexus-agents project Jun 18, 2026
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.

docs-site: render generated TypeDoc markdown as the website API reference (Astro content collection)

1 participant