mirror of
https://github.com/vercel/chat.git
synced 2026-09-14 18:32:29 +08:00
1dff4515e2
## Summary Migrates `apps/docs` from locally-copied geistdocs runtime code to the published [`@vercel/geistdocs`](https://www.npmjs.com/package/@vercel/geistdocs) package (1.8.2), following the official [migration guide](https://preview.geistdocs.com/docs/migration). Net **−8,400 lines**. ### Package-backed now - Docs page + layouts: `createDocsPage`, `GeistdocsDocsLayout`, `GeistdocsHomeLayout` (JSON-LD + sr-only markdown hints preserved via `renderTop`) - Navbar (OSS product switcher via `navbarOssProducts`), footer, provider, search dialog, page actions (edit source, feedback, copy page, Ask AI, open-in-chat, scroll top) - `/api/search` → `createSearchRoute`, `/api/chat` → `createChatRoute` (AI SDK v6; AI Gateway default, optional `GEISTDOCS_CHAT_PROXY_URL`) - `llms.mdx` → `createDocsMarkdownRoute`, `sitemap.md` → `createSitemapMarkdownRoute` (now includes an **Adapters** section) - **New**: `/agents.md` via `createAgentsRoute`, backed by a new `agent` readiness config - `proxy.ts` → `createProxy` with explicit `markdownRoutes` for `/docs` → `llms.mdx` and `/adapters` → `adapters.mdx` (adds AI-agent UA rewrites) - CSS: `@vercel/geistdocs/styles.css` + slim local overrides (shadcn tokens for remaining `components/ui`, body tint, prose inline code, `#nd-*` tweaks); code blocks now use the geist Shiki theme - Icons/logos from `@vercel/geistdocs/assets/*`; feedback via the package action (same geistdocs.com endpoint + `siteId`) ### Kept local by design - Curated `/llms.txt` index + `/llms-full.txt` corpus — the published `AGENTS.md`/SKILL.md artifacts and integration tests reference this exact contract - The adapters section (README fetching, OG images, JSON-LD, feature matrices, `adapters.mdx` markdown route) — now rendered inside the package docs layout - RSS and OG image routes (app-owned per the migration guide) - Skipped `/.well-known/mcp.json`: no MCP servers configured, and the proxy matcher must keep excluding `.well-known` for the served agent-skills files ### Cleanup - Deleted local copies: `components/geistdocs/*` chrome, `components/ai-elements/*`, chat hooks/persistence, feedback server actions, unused shadcn primitives, geistcn logo/icon fallbacks covered by package assets - Removed 13 now-unused deps (`ai@5`, `@ai-sdk/react@2`, `dexie`, `jotai`, `cmdk`, `vaul`, `mermaid`, `nanoid`, `react-player`, `use-stick-to-bottom`, `@orama/tokenizers`, `dexie-react-hooks`, `next-themes`) - Updated `docs-llms.test.ts` proxy assertions to the `createProxy` markdown-route shape ### Behavior changes to be aware of - Code blocks use the geist Shiki theme instead of GitHub light/dark - Ask AI history is no longer persisted in IndexedDB (package owns the panel) - Adapters sidebar uses the standard geistdocs tree rendering instead of the bespoke grouped sidebar - Per-page markdown output appends the standard geistdocs footer links (`/sitemap.md`, `/llms.txt`, `/agents.md`) ## Test plan - `pnpm validate` green (knip + check + typecheck + test + build) - Smoke-tested against `next build && next start`: `/`, `/docs`, `/adapters`, `/agents.md`, `/llms.txt`, `/llms-full.txt`, `/sitemap.md`, page-level `.md` URLs for both docs and adapters, `Accept: text/markdown` negotiation, search API, JSON-LD, sr-only markdown hints, edit-source URLs (`apps/docs/content/docs/{path}`), OSS navbar, page actions - Verified compiled CSS chunks contain the home grid, Shiki palette, and geist utilities (note: stale turbopack dev caches from before this change can serve incomplete CSS — `rm -rf apps/docs/.next` fixes it) ## Checklist - [x] All commits are signed and verified - [x] All commits are signed off for the DCO (`git commit -s`) - [x] `pnpm validate` passes - [x] Changeset added (or N/A — docs app + tests only, no package behavior change) - [x] Documentation updated (or N/A) --------- Signed-off-by: molebox <rich@vercel.com>
50 lines
1.3 KiB
JSON
50 lines
1.3 KiB
JSON
{
|
|
"name": "docs",
|
|
"version": "0.5.0",
|
|
"private": true,
|
|
"scripts": {
|
|
"build": "next build",
|
|
"dev": "next dev",
|
|
"start": "next start",
|
|
"postinstall": "fumadocs-mdx",
|
|
"translate": "npx @vercel/geistdocs translate"
|
|
},
|
|
"dependencies": {
|
|
"@icons-pack/react-simple-icons": "^13.8.0",
|
|
"@streamdown/cjk": "^1.0.2",
|
|
"@streamdown/code": "^1.0.3",
|
|
"@vercel/analytics": "^1.6.1",
|
|
"@vercel/edge-config": "^1.4.3",
|
|
"@vercel/geistdocs": "1.10.0",
|
|
"@vercel/speed-insights": "^1.3.1",
|
|
"class-variance-authority": "^0.7.1",
|
|
"clsx": "^2.1.1",
|
|
"feed": "^5.1.0",
|
|
"fumadocs-core": "16.2.2",
|
|
"fumadocs-mdx": "14.0.4",
|
|
"fumadocs-ui": "16.2.2",
|
|
"lucide-react": "^0.555.0",
|
|
"motion": "^12.23.25",
|
|
"next": "16.2.6",
|
|
"radix-ui": "latest",
|
|
"react": "^19.2.3",
|
|
"react-dom": "^19.2.3",
|
|
"shiki": "^3.22.0",
|
|
"sonner": "^2.0.7",
|
|
"streamdown": "^2.3.0",
|
|
"tailwind-merge": "^3.4.0",
|
|
"zod": "^4.1.13"
|
|
},
|
|
"devDependencies": {
|
|
"@tailwindcss/postcss": "^4.1.17",
|
|
"@types/mdx": "^2.0.13",
|
|
"@types/node": "^25.3.2",
|
|
"@types/react": "^19.2.7",
|
|
"@types/react-dom": "^19.2.3",
|
|
"postcss": "^8.5.16",
|
|
"tailwindcss": "^4.1.17",
|
|
"tw-animate-css": "^1.4.0",
|
|
"typescript": "^5.9.3"
|
|
}
|
|
}
|