Skip to content

Latest commit

 

History

History
68 lines (50 loc) · 5.1 KB

README.md

File metadata and controls

68 lines (50 loc) · 5.1 KB

docs-engine

The rendering engine behind Coder's documentation: the renderer, remark/rehype transforms, theme, and framework-agnostic UI components, published as a set of @coder/* packages.

Documentation content lives in coder/coder under docs/. This repository is the engine that renders that content, not the content itself.

Status

Work in progress. The engine is implemented across the eight @coder/* packages below, each with its own tests. The source is available under the terms in LICENSE. The engine is not supported for uses outside of building Coder's documentation. Nothing here is published to npm. To report a vulnerability, see SECURITY.md.

Packages

This is a pnpm + Turborepo monorepo.

Package Responsibility
@coder/docs-config Typed configuration schema and shared content contracts
@coder/docs-sources Versions/content providers (git refs and a local tree)
@coder/docs-transforms remark/rehype plugins and pure content transforms
@coder/docs-build The docs sync: materializes a provider DocSource as a Fumadocs content tree
@coder/docs-ui Framework-agnostic React components (MDX map, OS-aware tabs, brand mark)
@coder/docs-theme Fumadocs token overrides and brand CSS (CSS-only)
@coder/docs-next Fumadocs App Router (Next.js) adapter
@coder/docs-manifest Version manifest: Global Config item schemas, /versions.json assembly, request routing, write client

Workspace dependencies: docs-sources and docs-transforms depend on docs-config; docs-build depends on docs-config and docs-transforms; docs-next depends on docs-config and docs-ui; docs-manifest depends on docs-config. The other packages have no workspace dependencies. Refer to ARCHITECTURE.md for the package graph, the three build targets, the content pipeline, and the recorded design decisions.

Development

Requires Node 24 and pnpm for the workspace; the released packages and the offline kit support Node 22.12 and later.

pnpm install
pnpm build      # turbo run build
pnpm typecheck  # turbo run typecheck
pnpm test       # turbo run test
pnpm lint       # oxlint and oxfmt --check
pnpm format     # oxfmt

Vercel projects

The docs run on two Vercel projects on the codercom team.

Project Builds Serves Previews
coder-docs apps/router from Git on main only (Root Directory apps/router), with ROUTER_BASE_PATH=/docs and DOCS_ANALYTICS=1 coder-docs.coderite.app/docs, from its own manifest and archive stores, behind coder.com's /docs rewrite Behind Vercel login: router previews from router-pr-preview.yml, and docs-site previews prebuilt by docs-pr-preview.yml
coder-docs-pr-preview Nothing from this repository; coder/coder's own workflows deploy prebuilt output No production site Public coder/coder pull request previews only

The retired /beta-docs site's project, coder-docs-router, is deleted after this repository stops referring to it; see "Retiring the beta site" in apps/docs/README.md. coder.com answers /beta-docs paths with a 308 to the same path under /docs.

apps/docs is never built by Vercel: the publisher builds each version in GitHub Actions and uploads it to the archive the router serves.

Remote cache

Preview builds cannot write to the remote cache, so a preview artifact cannot become a production input. Each app's vercel.json runs turbo with --cache=local:rw,remote:rw only when VERCEL_ENV is production, and remote:r (read-only) otherwise. Artifact signing (remoteCache.signature) was evaluated and rejected: its HMAC key is shared by every environment that uses the cache, so a preview build holding the key could sign artifacts that production accepts. The app build and typecheck tasks (@coder/docs-site#build, @coder/offlinedocs#build, and their #typecheck counterparts) are deliberately uncacheable ("cache": false in turbo.json): they consume the docs corpus fetched by the uncacheable sync task in the same run, and Turbo hashes inputs before dependencies execute, so a cached run could silently replay (or skip checking) a stale corpus on deploy.