mirror of
https://github.com/hanzoai/turborepo.git
synced 2026-10-30 19:44:51 +00:00
## Description Migrates `apps/docs` from locally-vendored geistdocs components 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). Site-specific content, routes, and product UI stay local as thin package-backed adapters. **~127 files, +2.2k/−14.4k lines** (net −12.2k). ### Adopted from the package - Docs page via `createDocsPage` (MobileDocsBar, page actions, built-in feedback with `siteId: "turborepo"`) - Docs/home layouts, provider (search dialog, Ask AI shell, toaster), OSS-variant navbar - Search + Ask AI chat routes (AI SDK v6; optional `GEISTDOCS_CHAT_PROXY_URL` proxy mode) - Markdown surfaces: per-page `llms.mdx`, `sitemap.md`, **new `agents.md`** (with a new agent-readiness config in `geistdocs.tsx`) - `createProxy`: markdown negotiation, `.md` URL rewrites, **new AI-agent UA rewrites**, md-tracking aligned to the package event shape - MDX component defaults + design tokens via package `styles.css` - GitHub edit links now point at the monorepo path (`apps/docs/content/docs/{path}`) ### Kept custom (deliberate deviations) - **Curated `/llms.txt` index + `/llms-full.txt`** — the package route is a full corpus, which would change the public contract - **HMAC-signed OG images** (injected via the `metadata` callback), OG routes, rss/feed.xml, robots, Redis crawler sitemap, binaries/version + remote-cache APIs - **Four-column footer** (Fides "Cookie Preferences" link; the package footer is a slim bar without link sections) - `VersionWarning` banner via the package `sidebarTop` slot; `RemoteCacheCounter` moved from TOC header to page-action extras (no TOC-header hook exists) - `PackageManagerTabs`, reactflow diagram system, heading-badge rehype pipeline, shiki notation transformers - Blog / showcase / homepage / devtools / extra / openapi sections unchanged ### Version alignment - `next` 16.2.9 → **16.2.6** (the package peer-pins next exactly) - `fumadocs-core`/`ui` → **16.2.2**, `fumadocs-mdx` → **14.0.4** (package pins) - `fumadocs-openapi` → **10.2.7** (10.3+ peers fumadocs ^16.5, incompatible) - Removed ~20 dependencies owned by deleted vendored code (`ai@5`, `@ai-sdk/react@2`, dexie, jotai, streamdown, cmdk, vaul, recharts, …) ### Repo-level change - **`.npmrc`: added `hoist-pattern[]=tailwindcss`** — this repo's explicit hoist list disables pnpm's default hoisting, which broke the package CSS's internal `@import "tailwindcss"` resolution. ### Palette translation The package remaps Tailwind's default `gray`/`blue`/`red`/`green`/… scales to Geist `--ds-*` tokens (much lighter at the same step). Site components written against Tailwind defaults (blog back-link/dates, version banner, devtools error banner, green file trees) were translated to the equivalent Geist steps; `dark:` variants dropped since Geist tokens are theme-aware. ### Behavior changes to review - Ask AI: history no longer persisted in IndexedDB; the hand-rolled Upstash rate limiting on `/api/chat` is gone (package gateway route has none) - Navbar is the package OSS variant (Vercel OSS products dropdown; no Turborepo logo asset exists upstream yet) - Sidebar is the generic package renderer; shadcn radius scale shifted slightly to the package's fixed scale - Generated `agents.md` describes `/llms.txt` as a full-content surface, though this site keeps it as an index ## Testing Instructions ```sh cd apps/docs fnm use 24 rm -rf .next OG_IMAGE_SECRET=local-dev-secret pnpm dev ``` Verified locally (node 24): `check-types` (TS6), `check-openapi`, full `next build` + `next start`; curled `/docs`, `/docs.md`, `Accept: text/markdown` negotiation, agent-UA rewrite, `/llms.txt` (still the index), `/llms-full.txt`, `/sitemap.md`, `/agents.md`, search API, blog, showcase, terms, devtools, openapi; HTML greps confirm page actions, signed `og:image`, markdown alternates, edit-source URLs, and RemoteCacheCounter. `check-links` flags 2 pre-existing broken content links (zero content changes in this PR). --------- Co-authored-by: Anthony Shew <[email protected]>
125 lines
3.9 KiB
TypeScript
125 lines
3.9 KiB
TypeScript
import type { GeistdocsAgentReadinessConfig } from "@vercel/geistdocs/config";
|
|
import {
|
|
TurborepoLogo,
|
|
TurborepoWordmarkDark,
|
|
TurborepoWordmarkLight
|
|
} from "@/components/logos";
|
|
|
|
export const Logo = () => (
|
|
<>
|
|
{/* Logo icon only on screens <= 480px and between 768px-940px */}
|
|
<TurborepoLogo className="block h-6 w-auto min-[481px]:hidden min-[768px]:block min-[941px]:hidden" />
|
|
{/* Wordmark on screens 481px-767px and > 940px */}
|
|
<TurborepoWordmarkDark className="hidden h-6 w-auto dark:min-[481px]:block dark:min-[768px]:hidden dark:min-[941px]:block" />
|
|
<TurborepoWordmarkLight className="hidden h-6 w-auto min-[481px]:block dark:min-[481px]:hidden min-[768px]:hidden min-[941px]:block dark:min-[941px]:hidden" />
|
|
</>
|
|
);
|
|
|
|
export const github = {
|
|
branch: "main",
|
|
editPath: "apps/docs/content/docs/{path}",
|
|
owner: "vercel",
|
|
repo: "turborepo"
|
|
};
|
|
|
|
export const nav = [
|
|
{
|
|
label: "Docs",
|
|
href: "/docs"
|
|
},
|
|
{
|
|
label: "Blog",
|
|
href: "/blog"
|
|
},
|
|
{
|
|
label: "Showcase",
|
|
href: "/showcase"
|
|
},
|
|
{
|
|
label: "Enterprise",
|
|
href: "https://vercel.com/contact/sales?utm_source=turborepo.dev&utm_medium=referral&utm_campaign=header-enterpriseLink"
|
|
}
|
|
];
|
|
|
|
export const footerLinks = {
|
|
resources: [
|
|
{ href: "/blog", label: "Blog" },
|
|
{ href: "https://github.com/vercel/turborepo/releases", label: "Releases" },
|
|
{ href: "/docs", label: "Docs" }
|
|
],
|
|
community: [
|
|
{ href: "https://github.com/vercel/turborepo", label: "GitHub" },
|
|
{ href: "https://community.vercel.com/tag/turborepo", label: "Community" },
|
|
{ href: "https://bsky.app/profile/turborepo.dev", label: "Bluesky" },
|
|
{ href: "https://x.com/turborepo", label: "X" }
|
|
],
|
|
company: [
|
|
{ href: "https://vercel.com/about", label: "About" },
|
|
{ href: "https://vercel.com/oss", label: "Open source" }
|
|
],
|
|
legal: [
|
|
{ href: "https://vercel.com/legal/privacy-policy", label: "Privacy" },
|
|
{ href: "/terms", label: "Terms" },
|
|
{ href: "/governance", label: "Governance" },
|
|
{ href: "/docs/telemetry", label: "Telemetry" },
|
|
{ href: "#", label: "Cookie Preferences", id: "fides-modal-link" }
|
|
]
|
|
};
|
|
|
|
export const suggestions = [
|
|
"What is Turborepo?",
|
|
"How do I set up a monorepo with Turborepo?",
|
|
"What is Remote Caching?",
|
|
"How do I configure tasks in turbo.json?"
|
|
];
|
|
|
|
export const title = "Turborepo Documentation";
|
|
|
|
export const prompt = `You are a helpful assistant specializing in answering questions about Turborepo, a high-performance build system for JavaScript and TypeScript monorepos. You help users understand caching, task configuration, and monorepo best practices. Be concise.`;
|
|
|
|
export const agent = {
|
|
product: {
|
|
name: "Turborepo",
|
|
description:
|
|
"Turborepo is a high-performance build system for JavaScript and TypeScript monorepos, written in Rust. It provides incremental task running, local and remote caching, and parallel execution.",
|
|
category: "Build system",
|
|
audience: [
|
|
"JavaScript and TypeScript developers",
|
|
"Monorepo maintainers",
|
|
"Platform and developer experience teams"
|
|
],
|
|
useCases: [
|
|
"Run tasks across a monorepo with caching and parallelism",
|
|
"Share build caches locally and remotely (Remote Caching)",
|
|
"Configure task pipelines in turbo.json",
|
|
"Prune monorepos for lightweight deploys"
|
|
]
|
|
},
|
|
links: [
|
|
{
|
|
label: "Turborepo source",
|
|
href: `https://github.com/${github.owner}/${github.repo}`,
|
|
description: "Source repository for Turborepo"
|
|
},
|
|
{
|
|
label: "Releases",
|
|
href: `https://github.com/${github.owner}/${github.repo}/releases`,
|
|
description: "Turborepo release notes and changelogs"
|
|
}
|
|
]
|
|
} satisfies GeistdocsAgentReadinessConfig;
|
|
|
|
export const translations = {
|
|
en: {
|
|
displayName: "English"
|
|
},
|
|
cn: {
|
|
displayName: "Chinese",
|
|
search: "搜尋文檔"
|
|
}
|
|
};
|
|
|
|
export const basePath: string | undefined = undefined;
|
|
|
|
export const siteId: string | undefined = "turborepo";
|