-
Notifications
You must be signed in to change notification settings - Fork 1.5k
chore: migrate offlinedocs to Fumadocs (render parity, single version) [DOCS-593] #27390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
nickvigilante
wants to merge
38
commits into
main
from
vigilante/docs-593-migrate-offlinedocs-to-fumadocs-phase-1-render-parity-single
Closed
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
5ca7a61
chore(offlinedocs): migrate to Fumadocs (render parity, single version)
nickvigilante ba2c2b4
fix(offlinedocs): align pnpm overrides with the workspace root
nickvigilante 2cf1792
fix(offlinedocs): address review feedback on the Fumadocs migration
nickvigilante f0a1084
fix(offlinedocs): label the homepage "Home" instead of a second "About"
nickvigilante 7237493
feat(offlinedocs): add external-link and OS-switcher icons
nickvigilante b68e8ab
fix(offlinedocs): run the dev server on port 26337 instead of 3000
nickvigilante 43b7bcd
feat(offlinedocs): add offline client-side search
nickvigilante 6dda772
fix(offlinedocs): reconcile pnpm lockfile with manifest
nickvigilante 88f4f30
fix(offlinedocs): remove dead code and no-op config
nickvigilante 6e4ef61
fix(offlinedocs): keep OS tab sets from rendering empty
nickvigilante 120173a
feat(offlinedocs): align docs theme with Coder product
chrifro 2ff9c8a
fix(offlinedocs): wrap a long import in os-tab.tsx for prettier
nickvigilante c8dd97a
fix(offlinedocs): address review feedback and flatten the TOC rail
nickvigilante 9718b6e
fix(offlinedocs): fail sync on unresolved inter-doc links and fix sty…
nickvigilante 6970933
test(offlinedocs): add mdx-plugin tests, drop lucide-react, guard images
nickvigilante f94d4c5
docs(offlinedocs): document the details-accordion close-delimiter lim…
nickvigilante 44da36d
fix(offlinedocs): address round-4 review of the Fumadocs migration
nickvigilante b554386
docs(offlinedocs): clarify config comments and add file docstrings
nickvigilante ca6cf72
offlinedocs: address round-5 review findings (frontmatter titles, inl…
nickvigilante 9417b0b
offlinedocs: parse frontmatter with fumadocs-core to fix escaped quotes
nickvigilante 53585fa
offlinedocs: address round-7 review nits (CRF-51/53/54/55/56/57)
nickvigilante 02fc424
offlinedocs: clear stale .source in sync so lint/build regenerate types
nickvigilante 3498c96
test(offlinedocs): make OSTab first-visit seeding test able to fail
nickvigilante c33cd5c
offlinedocs: address round-8 review findings (CRF-58/59/61/62)
nickvigilante 10049d6
docs(offlinedocs): document intentional strictness of callout MARKER …
nickvigilante 28dca13
docs(offlinedocs): pin CRF-58 autolink branches and trim duplicated c…
nickvigilante 0b48ffd
fix(offlinedocs): guard against empty .source generation before tsc
nickvigilante 90d913f
fix(offlinedocs): run .source guard after next typegen
nickvigilante df499fe
docs(offlinedocs): drop monitoring.md corpus edit from the migration PR
nickvigilante 1022fef
revert(offlinedocs): restore Fumadocs default on-this-page TOC rail
nickvigilante 526816a
docs(offlinedocs): document the stale-service-worker unclickable-UI g…
nickvigilante 4252203
test(offlinedocs): lock in homepage title-less frontmatter stripping
nickvigilante 756a998
perf(offlinedocs): convert supergraphic brand images to webp
nickvigilante 19a498b
fix(offlinedocs): remove duplicate sidebar scrollbar
nickvigilante 54a1d3b
refactor(offlinedocs): convert pure route builders to map/filter/reduce
nickvigilante 9a532ca
docs(offlinedocs): move route-logic narrative to a README, trim comments
nickvigilante 071be8e
docs(offlinedocs): trim transform.mjs comments to match routes.mjs
nickvigilante b837a0d
fix(offlinedocs): keep Reference last in the sidebar
nickvigilante File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
This file was deleted.
Oops, something went wrong.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,6 @@ | ||
| **/pnpm-lock.yaml | ||
| .next/ | ||
| out/ | ||
| .source/ | ||
| content/docs/ | ||
| public/images/ |
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| // Next.js configuration for the offlinedocs static export. It wires the Fumadocs | ||
| // MDX plugin into the build (createMDX/withMDX) and produces the | ||
| // coder_docs_<version>.tgz artifact the release pipeline ships for offline use. | ||
| // Each build setting is documented at its field below. | ||
|
|
||
| import { createMDX } from "fumadocs-mdx/next"; | ||
|
nickvigilante marked this conversation as resolved.
|
||
|
|
||
| const withMDX = createMDX(); | ||
|
|
||
| /** @type {import('next').NextConfig} */ | ||
| const config = { | ||
| // Pin the workspace root to this folder. offlinedocs has its own | ||
| // package.json + lockfile inside the coder/coder repo, and Next would | ||
| // otherwise infer the repo root (which also has a lockfile) as the root. | ||
| turbopack: { | ||
| root: import.meta.dirname, | ||
| }, | ||
| // Emit a fully static site into out/ so the docs bundle is self-contained | ||
| // and can be served by any static file host with no Node server. This is | ||
| // what the release pipeline tars into coder_docs_<version>.tgz for | ||
| // offline/airgapped use. | ||
| // | ||
| // Only export for production builds (`next build`). Under `output: export` | ||
| // Next installs an optional catch-all route that rejects any path | ||
| // generateStaticParams did not prerender. In dev that turns incidental | ||
| // requests into hard errors instead of clean 404s - most notably a stale | ||
| // /serviceWorker.js still registered at the dev origin by a prior site (a | ||
| // local coder server or the old offlinedocs, both of which used :3000), | ||
| // plus favicon probes and similar. When next dev errors on those, the page | ||
| // renders but never becomes interactive; the symptom reported in UAT was | ||
| // "nothing in the UI is clickable" (OS tabs, theme toggle, etc.). Gating | ||
| // export to production keeps next dev on Next's normal server (clean 404s), | ||
| // so local dev stays interactive, while next build still produces the full | ||
| // static export. | ||
| // | ||
| // Running the docs anywhere: if a machine shows a dead or unclickable page | ||
| // from an earlier session, a stale service worker is cached - unregister it | ||
| // (DevTools > Application > Service workers > Unregister) and hard-reload. | ||
| // The dev server also runs on :26337 (see the package.json scripts), not | ||
| // :3000, to stay off that shared origin. | ||
|
Comment on lines
+18
to
+40
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yap yap yap yap yaaaaaap |
||
| output: process.env.NODE_ENV === "production" ? "export" : undefined, | ||
| // Canonical URLs end in a slash and every route is emitted as | ||
| // <route>/index.html, which is what a plain static file server expects. | ||
| trailingSlash: true, | ||
| // Doc images are copied into the bundle (refer to scripts/sync-docs.mjs) | ||
| // and served as-is; next/image optimization needs a running server, | ||
| // which a static export does not have. | ||
| images: { | ||
| unoptimized: true, | ||
| }, | ||
| }; | ||
|
|
||
| export default withMDX(config); | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,60 +1,51 @@ | ||
| { | ||
|
nickvigilante marked this conversation as resolved.
|
||
| "name": "coder-docs-generator", | ||
| "private": true, | ||
| "description": "Generates the self-contained, offline Coder documentation bundle from the coder/coder docs corpus using Fumadocs.", | ||
|
nickvigilante marked this conversation as resolved.
|
||
| "scripts": { | ||
| "dev": "pnpm copy-images && next dev", | ||
| "sync": "node scripts/sync-docs.mjs", | ||
| "dev": "pnpm sync && next dev -p 26337", | ||
| "build": "next build", | ||
| "start": "next start", | ||
| "export": "pnpm copy-images && next build", | ||
| "copy-images": "sh ./scripts/copyImages.sh", | ||
| "export": "pnpm sync && next build", | ||
| "postinstall": "fumadocs-mdx", | ||
| "lint": "pnpm run lint:types", | ||
| "lint:types": "tsc --noEmit", | ||
| "format": "prettier --cache --write './**/*.{css,html,js,json,jsx,md,ts,tsx,yaml,yml}'", | ||
| "format:check": "prettier --cache --check './**/*.{css,html,js,json,jsx,md,ts,tsx,yaml,yml}'" | ||
| "lint:types": "pnpm sync && fumadocs-mdx && next typegen && node scripts/ensure-source.mjs && tsc --noEmit", | ||
| "format": "prettier --cache --write './**/*.{css,js,jsx,json,mjs,ts,tsx,yaml,yml}'", | ||
| "format:check": "prettier --cache --check './**/*.{css,js,jsx,json,mjs,ts,tsx,yaml,yml}'", | ||
| "test": "node --test 'scripts/**/*.test.mjs' && node --import tsx --test 'src/mdx-plugins/**/*.test.ts' && node --import tsx --import ./test/jsdom-setup.mjs --test 'src/components/**/*.test.tsx'" | ||
| }, | ||
| "dependencies": { | ||
| "@chakra-ui/react": "2.10.10", | ||
| "@emotion/react": "11.14.0", | ||
| "@emotion/styled": "11.14.1", | ||
| "archiver": "8.0.0", | ||
| "framer-motion": "^10.18.0", | ||
| "front-matter": "4.0.2", | ||
| "lodash": "4.18.1", | ||
| "next": "15.5.23", | ||
| "react": "18.3.1", | ||
| "react-dom": "18.3.1", | ||
| "react-icons": "5.7.0", | ||
| "react-markdown": "10.1.0", | ||
| "rehype-raw": "7.0.0", | ||
| "remark-gfm": "4.0.1", | ||
| "sanitize-html": "2.17.6" | ||
| "@fontsource-variable/geist": "5.3.0", | ||
| "@fontsource-variable/geist-mono": "5.3.0", | ||
| "@phosphor-icons/react": "2.1.10", | ||
| "fumadocs-core": "16.10.5", | ||
| "fumadocs-mdx": "15.0.12", | ||
| "fumadocs-ui": "16.10.5", | ||
| "next": "16.2.9", | ||
| "react": "19.2.7", | ||
| "react-dom": "19.2.7", | ||
| "rehype-raw": "7.0.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@types/lodash": "4.17.25", | ||
| "@tailwindcss/postcss": "4.3.1", | ||
| "@types/mdx": "2.0.14", | ||
| "@types/node": "22.20.1", | ||
| "@types/react": "18.3.12", | ||
| "@types/react-dom": "18.3.1", | ||
| "@types/sanitize-html": "2.16.1", | ||
| "eslint": "8.57.1", | ||
| "eslint-config-next": "14.2.35", | ||
| "prettier": "3.9.6", | ||
| "@types/react": "19.2.17", | ||
| "@types/react-dom": "19.2.3", | ||
| "jsdom": "25.0.1", | ||
| "postcss": "8.5.15", | ||
| "prettier": "3.9.4", | ||
| "tailwindcss": "4.3.1", | ||
| "tsx": "4.23.12", | ||
| "typescript": "6.0.3" | ||
| }, | ||
| "engines": { | ||
| "npm": ">=9.0.0 <10.0.0", | ||
| "node": ">=22.0.0 <25.0.0" | ||
| }, | ||
| "pnpm": { | ||
| "overrides": { | ||
|
nickvigilante marked this conversation as resolved.
|
||
| "@babel/runtime": "7.26.10", | ||
| "brace-expansion": "1.1.13", | ||
| "minimatch": "5.1.8", | ||
| "glob@>=10": "10.5.0", | ||
| "postcss": "8.5.10", | ||
| "js-yaml": "3.14.2", | ||
| "yaml": "1.10.3", | ||
| "flatted": "3.4.2", | ||
| "mdast-util-to-hast": "13.2.1" | ||
| "picomatch": "2.3.2", | ||
| "js-yaml": "4.1.1" | ||
| } | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.