e5369f3a63
Replace the bespoke 16-section /docs page that pulled prose from
`messages/{locale}.json` with a build-time MDX renderer that reads the
canonical markdown in repo-root `docs/`. Each markdown file becomes
one section of the docs page, scrolled-to via the existing DocsShell
sidebar. Section data structure stays in `lib/docs-sections.ts` so the
sidebar / scroll-spy keeps working with no client changes.
Why this layout:
- One source of truth: `docs/guide/*.md`, `docs/reference/*.md`,
`docs/manifesto.md`. Edits land in one place; the website redeploys
pick them up automatically via the existing web-deploy workflow.
- Build-time only: `MDXRemote` is rendered inside an RSC and the page
is statically generated (`●` SSG). Cloudflare Workers serves the
rendered HTML; no MDX compiler runs at request time.
- next-intl unchanged for everything else: only the docs prose moves
out. `mobileHeader` and `searchPlaceholder` strings stay in
`messages/{locale}.json`; the 18 stale section keys are removed.
Files:
- web/lib/docs-sections.ts: 9 sections matching docs/ files, typed
`DocSection` with `{ id, title, file }`.
- web/lib/docs-source.ts: `loadDocSource(file)` reads
`<repo-root>/docs/<file>` at build time via `node:fs/promises`.
- web/components/docs/mdx-components.tsx: shadcn-styled overrides for
every markdown element (h1-h4, p, a, ul/ol/li, blockquote, code, pre,
table, hr, strong) so the rendered output matches the rest of the
site.
- web/app/[locale]/docs/page.tsx: rewritten as an async RSC that loads
every section's source in parallel and renders one MDXRemote per
section inside DocsShell.
- web/messages/{en,ja,ko,zh}.json: `docs` key trimmed from 20 entries
to 2 (mobileHeader, searchPlaceholder).
- web/package.json: + next-mdx-remote, + gray-matter.
Local verification: `bun run format:check`, `bun run lint`,
`bun run type-check`, `bun run build`, `bunx opennextjs-cloudflare
build` all pass; `/[locale]/docs` builds as static for all 4 locales
at 4.12 kB / 132 kB First Load.
61 lines
2.2 KiB
JSON
61 lines
2.2 KiB
JSON
{
|
|
"name": "oh-my-openagent-web",
|
|
"version": "0.1.0",
|
|
"private": true,
|
|
"scripts": {
|
|
"prebuild": "node ./scripts/prepare-build.mjs",
|
|
"dev": "next dev",
|
|
"build": "next build",
|
|
"start": "next start",
|
|
"lint": "eslint \"app/**/*.{ts,tsx}\" \"components/**/*.{ts,tsx}\" \"lib/**/*.{ts,tsx}\" \"e2e/**/*.{ts,tsx}\"",
|
|
"lint:fix": "eslint --fix \"app/**/*.{ts,tsx}\" \"components/**/*.{ts,tsx}\" \"lib/**/*.{ts,tsx}\" \"e2e/**/*.{ts,tsx}\"",
|
|
"format": "prettier --write \"**/*.{ts,tsx,js,jsx,json,css,md}\"",
|
|
"format:check": "prettier --check \"**/*.{ts,tsx,js,jsx,json,css,md}\"",
|
|
"type-check": "tsc --noEmit",
|
|
"test:e2e": "playwright test",
|
|
"test:e2e:ui": "playwright test --ui",
|
|
"test:e2e:headed": "playwright test --headed",
|
|
"preview": "node ./scripts/prepare-build.mjs && opennextjs-cloudflare build && opennextjs-cloudflare preview",
|
|
"deploy": "node ./scripts/prepare-build.mjs && opennextjs-cloudflare build && opennextjs-cloudflare deploy",
|
|
"cf-typegen": "wrangler types --env-interface CloudflareEnv cloudflare-env.d.ts"
|
|
},
|
|
"dependencies": {
|
|
"@radix-ui/react-accordion": "^1.2.12",
|
|
"@radix-ui/react-separator": "^1.1.8",
|
|
"@radix-ui/react-slot": "^1.2.4",
|
|
"class-variance-authority": "^0.7.1",
|
|
"clsx": "^2.1.1",
|
|
"geist": "^1.7.0",
|
|
"gray-matter": "^4.0.3",
|
|
"lucide-react": "0.577.0",
|
|
"motion": "^12.38.0",
|
|
"next": "15.5.18",
|
|
"next-intl": "^4.11.0",
|
|
"next-mdx-remote": "^6.0.0",
|
|
"react": "^19.2.6",
|
|
"react-dom": "^19.2.6",
|
|
"tailwind-merge": "^3.5.0",
|
|
"tailwindcss-animate": "^1.0.7"
|
|
},
|
|
"devDependencies": {
|
|
"@opennextjs/cloudflare": "^1.19.8",
|
|
"@playwright/test": "1.59.1",
|
|
"@tailwindcss/postcss": "4.2.4",
|
|
"@types/node": "^25.6.2",
|
|
"@types/react": "^19.2.14",
|
|
"@types/react-dom": "^19.2.3",
|
|
"eslint": "^10.3.0",
|
|
"eslint-config-next": "15.5.18",
|
|
"eslint-config-prettier": "10.1.8",
|
|
"eslint-plugin-prettier": "5.5.5",
|
|
"globals": "^17.6.0",
|
|
"postcss": "^8.5.14",
|
|
"prettier": "3.8.3",
|
|
"prettier-plugin-tailwindcss": "^0.8.0",
|
|
"tailwindcss": "4.2.4",
|
|
"typescript-eslint": "^8.59.2",
|
|
"typescript": "6.0.3",
|
|
"wrangler": "^4.90.0"
|
|
}
|
|
}
|