@vercel/geistdocs 1.25.1-canary.c58830e → 1.25.1-canary.e20ff18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +1 -1
- package/dist/components/blockquote.js +1 -1
- package/dist/components/callout.d.ts +13 -10
- package/dist/components/callout.d.ts.map +1 -1
- package/dist/components/callout.js +6 -6
- package/dist/components/code-block-tabs.d.ts.map +1 -1
- package/dist/components/code-block-tabs.js +3 -1
- package/dist/components/code-block.d.ts.map +1 -1
- package/dist/components/code-block.js +1 -1
- package/dist/components/command-prompt.d.ts.map +1 -1
- package/dist/components/command-prompt.js +15 -22
- package/dist/components/copy-prompt.d.ts +2 -1
- package/dist/components/copy-prompt.d.ts.map +1 -1
- package/dist/components/copy-prompt.js +2 -2
- package/dist/components/heading.d.ts +7 -0
- package/dist/components/heading.d.ts.map +1 -0
- package/dist/components/heading.js +14 -0
- package/dist/components/table.d.ts +3 -0
- package/dist/components/table.d.ts.map +1 -0
- package/dist/components/table.js +3 -0
- package/dist/controls.d.ts.map +1 -1
- package/dist/controls.js +4 -3
- package/dist/internal/chat/activity.d.ts +20 -0
- package/dist/internal/chat/activity.d.ts.map +1 -0
- package/dist/internal/chat/activity.js +43 -0
- package/dist/internal/chat/context.d.ts +2 -0
- package/dist/internal/chat/context.d.ts.map +1 -1
- package/dist/internal/chat/context.js +24 -3
- package/dist/internal/chat/dots-spinner.d.ts.map +1 -1
- package/dist/internal/chat/dots-spinner.js +15 -9
- package/dist/internal/chat/loading-skeleton.d.ts +7 -0
- package/dist/internal/chat/loading-skeleton.d.ts.map +1 -0
- package/dist/internal/chat/loading-skeleton.js +46 -0
- package/dist/internal/chat/message-metadata.d.ts.map +1 -1
- package/dist/internal/chat/message-metadata.js +15 -30
- package/dist/internal/chat/message-sources.d.ts +3 -0
- package/dist/internal/chat/message-sources.d.ts.map +1 -0
- package/dist/internal/chat/message-sources.js +23 -0
- package/dist/internal/chat/message.d.ts.map +1 -1
- package/dist/internal/chat/message.js +57 -5
- package/dist/internal/chat/shell.d.ts.map +1 -1
- package/dist/internal/chat/shell.js +17 -17
- package/dist/internal/chat/source-chunks.d.ts +9 -0
- package/dist/internal/chat/source-chunks.d.ts.map +1 -0
- package/dist/internal/chat/source-chunks.js +7 -0
- package/dist/internal/chat/sources.d.ts.map +1 -1
- package/dist/internal/chat/sources.js +4 -1
- package/dist/internal/mousedown-navigation-utils.d.ts +5 -0
- package/dist/internal/mousedown-navigation-utils.d.ts.map +1 -0
- package/dist/internal/mousedown-navigation-utils.js +95 -0
- package/dist/internal/mousedown-navigation.d.ts +10 -0
- package/dist/internal/mousedown-navigation.d.ts.map +1 -0
- package/dist/internal/mousedown-navigation.js +42 -0
- package/dist/internal/navbar/desktop-menu.js +1 -1
- package/dist/internal/navbar/mobile-menu.d.ts.map +1 -1
- package/dist/internal/navbar/mobile-menu.js +8 -13
- package/dist/internal/navbar/navbar-shell.d.ts.map +1 -1
- package/dist/internal/navbar/navbar-shell.js +2 -1
- package/dist/internal/page-actions-client.d.ts.map +1 -1
- package/dist/internal/page-actions-client.js +36 -32
- package/dist/internal/provider-client.d.ts.map +1 -1
- package/dist/internal/provider-client.js +29 -5
- package/dist/internal/search.d.ts.map +1 -1
- package/dist/internal/search.js +1 -1
- package/dist/internal/sidebar-responsive.d.ts +0 -1
- package/dist/internal/sidebar-responsive.d.ts.map +1 -1
- package/dist/internal/sidebar-responsive.js +0 -9
- package/dist/internal/sidebar-tree.d.ts.map +1 -1
- package/dist/internal/sidebar-tree.js +6 -1
- package/dist/internal/sidebar.d.ts.map +1 -1
- package/dist/internal/sidebar.js +78 -49
- package/dist/internal/table-of-contents.d.ts.map +1 -1
- package/dist/internal/table-of-contents.js +1 -1
- package/dist/internal/toc-items.d.ts.map +1 -1
- package/dist/internal/toc-items.js +16 -6
- package/dist/internal/ui/dropdown-menu.js +6 -6
- package/dist/internal/ui/navigation-menu.js +2 -2
- package/dist/internal/use-mobile.d.ts.map +1 -1
- package/dist/internal/use-mobile.js +2 -12
- package/dist/layout.d.ts +1 -0
- package/dist/layout.d.ts.map +1 -1
- package/dist/layout.js +2 -0
- package/dist/mdx.d.ts.map +1 -1
- package/dist/mdx.js +11 -4
- package/dist/pages/docs.d.ts.map +1 -1
- package/dist/pages/docs.js +8 -5
- package/dist/routes/chat.d.ts +1 -1
- package/dist/routes/chat.d.ts.map +1 -1
- package/dist/routes/chat.js +31 -14
- package/dist/versions.js +2 -2
- package/docs/agents.md +4 -3
- package/docs/llms.txt +297 -34
- package/docs/manifest.json +12 -3
- package/docs/pages/ask-ai.md +2 -2
- package/docs/pages/deployment.md +30 -5
- package/docs/pages/getting-started.md +38 -12
- package/docs/pages/guides/nested-navigation.md +1 -1
- package/docs/pages/md.md +1 -1
- package/docs/pages/migration-2.md +106 -0
- package/docs/pages/migration.md +5 -2
- package/docs/pages/syntax.md +106 -8
- package/docs/sitemap.md +3 -2
- package/package.json +3 -3
- package/template/app/[lang]/layout.tsx +4 -0
- package/template/app/styles/geistdocs.css +1 -1
- package/template/components/ui/button.tsx +1 -1
- package/template/content/docs/ask-ai.cn.mdx +2 -2
- package/template/content/docs/ask-ai.mdx +2 -2
- package/template/content/docs/deployment.mdx +31 -6
- package/template/content/docs/getting-started.mdx +39 -13
- package/template/content/docs/guides/nested-navigation.mdx +1 -1
- package/template/content/docs/md.mdx +1 -1
- package/template/content/docs/meta.json +1 -0
- package/template/content/docs/migration-2.mdx +106 -0
- package/template/content/docs/migration.mdx +5 -1
- package/template/content/docs/syntax.mdx +112 -8
- package/template/package.json +2 -2
- package/theme.css +39 -101
|
@@ -10,41 +10,49 @@ related:
|
|
|
10
10
|
- /docs/deployment
|
|
11
11
|
---
|
|
12
12
|
|
|
13
|
-
Create a Geistdocs site with the package CLI, then
|
|
13
|
+
Create a new Geistdocs 2.0 site with the package CLI, then customize its identity, content, and navigation. If you already have a documentation site, use [Migrate to Geistdocs](/docs/migration) or [Migrate 1.x → 2.0](/docs/migration-2) instead.
|
|
14
14
|
|
|
15
|
-
<CopyPrompt text="Create a Geistdocs project with pnpm dlx @vercel/geistdocs init --name my-docs.
|
|
16
|
-
Create a Geistdocs project with `pnpm dlx @vercel/geistdocs init --name my-docs`.
|
|
15
|
+
<CopyPrompt text="Create a new Geistdocs project with pnpm dlx @vercel/geistdocs@latest init --name my-docs. Confirm Node.js 20.9 or later, pnpm, Git, and npm access to the @vercel scope are available first. Then run pnpm dev and help me customize geistdocs.tsx, content/docs/index.mdx, and content/docs/meta.json. Keep the generated route, source, Geistcn, and Next.js integrations package-backed.">
|
|
16
|
+
Create a new Geistdocs project with `pnpm dlx @vercel/geistdocs@latest init --name my-docs`. Confirm the prerequisites, run `pnpm dev`, and help me customize `geistdocs.tsx`, `content/docs/index.mdx`, and `content/docs/meta.json`. Keep the generated integrations package-backed.
|
|
17
17
|
</CopyPrompt>
|
|
18
18
|
|
|
19
19
|
## Prerequisites
|
|
20
20
|
|
|
21
21
|
Before you begin, install:
|
|
22
22
|
|
|
23
|
-
- Node.js
|
|
24
|
-
- pnpm
|
|
23
|
+
- Node.js 20.9 or later
|
|
24
|
+
- pnpm
|
|
25
25
|
- Git
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
The CLI always uses pnpm to install the generated project's dependencies.
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
## Authenticate package access
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
Geistdocs 2.0 depends on restricted `@vercel/geistcn` and `@vercel/geistcn-assets` packages. Configure your user-level `~/.npmrc` before running the CLI:
|
|
32
|
+
|
|
33
|
+
```ini title="~/.npmrc"
|
|
34
|
+
@vercel:registry=https://registry.npmjs.org/
|
|
35
|
+
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
|
|
36
|
+
always-auth=true
|
|
33
37
|
```
|
|
34
38
|
|
|
35
|
-
|
|
39
|
+
Set `NPM_TOKEN` from an approved internal source. Never put the token value in `.npmrc`, an `.env` file, shell history, or Git. See [Deploy to Vercel](/docs/deployment#configure-private-package-access) for automated installs.
|
|
40
|
+
|
|
41
|
+
## Create a project
|
|
42
|
+
|
|
43
|
+
Run the Geistdocs CLI from an empty parent folder:
|
|
36
44
|
|
|
37
45
|
```bash title="Terminal"
|
|
38
|
-
|
|
46
|
+
pnpm dlx @vercel/geistdocs@latest init --name my-docs
|
|
39
47
|
```
|
|
40
48
|
|
|
41
49
|
The CLI copies the template bundled in the package, rewrites the generated app to depend on the same `@vercel/geistdocs` version, installs dependencies, copies `.env.example` to `.env.local`, and initializes Git.
|
|
42
50
|
|
|
43
51
|
## Understand generated dependencies
|
|
44
52
|
|
|
45
|
-
Generated projects
|
|
53
|
+
Generated projects pin the resolved `@vercel/geistdocs` version and include its matching Geistcn dependencies, AI SDK v6, and `@ai-sdk/react` v3. The template already configures styles, fonts, Cache Components, Partial Prefetching, source adapters, search, Ask AI, and agent-readable routes.
|
|
46
54
|
|
|
47
|
-
|
|
55
|
+
Keep those integrations package-backed. Update Geistdocs instead of copying package internals into the app.
|
|
48
56
|
|
|
49
57
|
## Start the development server
|
|
50
58
|
|
|
@@ -57,6 +65,14 @@ pnpm dev
|
|
|
57
65
|
|
|
58
66
|
Open `http://localhost:3000` in your browser.
|
|
59
67
|
|
|
68
|
+
Start with these files:
|
|
69
|
+
|
|
70
|
+
- `geistdocs.tsx` for the site title, logo, navigation, repository, and AI prompt.
|
|
71
|
+
- `content/docs/index.mdx` for the documentation overview.
|
|
72
|
+
- `content/docs/meta.json` for sidebar order and groups.
|
|
73
|
+
|
|
74
|
+
Only customize `components/geistdocs/*`, `lib/geistdocs/*`, or route adapters when the generated defaults do not fit your site.
|
|
75
|
+
|
|
60
76
|
## Edit your first page
|
|
61
77
|
|
|
62
78
|
Docs live in `content/docs`. Edit the overview page:
|
|
@@ -114,3 +130,13 @@ pnpm exec geistdocs update
|
|
|
114
130
|
```
|
|
115
131
|
|
|
116
132
|
Review and test dependency changes before committing.
|
|
133
|
+
|
|
134
|
+
## Verify and deploy
|
|
135
|
+
|
|
136
|
+
Run a production build before publishing:
|
|
137
|
+
|
|
138
|
+
```bash title="Terminal"
|
|
139
|
+
pnpm build
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Then follow [Deploy to Vercel](/docs/deployment), including private package access and environment-variable setup.
|
|
@@ -197,7 +197,7 @@ Geistdocs applies a color for each method:
|
|
|
197
197
|
| `PUT`, `PATCH` | Amber |
|
|
198
198
|
| `DEL`, `DELETE` | Red |
|
|
199
199
|
|
|
200
|
-
Method matching is case-sensitive, so use uppercase labels. `DEL` and `DELETE` render the same red badge, so prefer `DEL` when you want a narrower badge.
|
|
200
|
+
Method matching is case-sensitive, so use uppercase labels. `DEL` and `DELETE` render the same red badge, so prefer `DEL` when you want a narrower badge. `New` renders as a low-contrast blue badge; other labels, such as `Beta`, use the default neutral badge. Badge colors adapt to light and dark themes automatically.
|
|
201
201
|
|
|
202
202
|
## Add links to the navigation
|
|
203
203
|
|
|
@@ -37,7 +37,7 @@ The `.mdx` version returns:
|
|
|
37
37
|
|
|
38
38
|
For a docs section mounted at `/docs`, the section root remains `/docs.md`. For a source mounted at the app root with `baseUrl: "/"`, Geistdocs uses `/index.md` for the root page. If Next.js has `basePath: "/docs"`, that public root Markdown URL is `/docs/index.md`.
|
|
39
39
|
|
|
40
|
-
Copy Page, View as Markdown, and the `text/markdown` metadata alternate all use the same package resolver. Use `createDocsPage({ getMarkdownUrl })` only when the deployment needs a different public contract.
|
|
40
|
+
Copy Page, View as Markdown, and the `text/markdown` metadata alternate all use the same package resolver. View as Markdown opens the resolved `.md` URL in a new tab from a button, which keeps the URL shareable without adding an anchor to the page. Use `createDocsPage({ getMarkdownUrl })` only when the deployment needs a different public contract.
|
|
41
41
|
|
|
42
42
|
## Use cases
|
|
43
43
|
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Migrate from Geistdocs 1.x to 2.0
|
|
3
|
+
navTitle: Migrate 1.x → 2.0
|
|
4
|
+
badge: New
|
|
5
|
+
description: Upgrade imports, dependencies, and routing without copying Geistdocs internals
|
|
6
|
+
type: guide
|
|
7
|
+
summary: A concise, agent-friendly checklist for upgrading an existing Geistdocs 1.x site to 2.0.
|
|
8
|
+
related:
|
|
9
|
+
- /docs/migration
|
|
10
|
+
- /docs/configuration
|
|
11
|
+
- /docs/versioned-docs
|
|
12
|
+
- /docs/proxy
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
Use this guide only for a site already running Geistdocs 1.x. Geistdocs 2.0 moves shared UI primitives and assets to Geistcn; its package-backed page, source, search, chat, proxy, and agent-readable route APIs remain the preferred integration.
|
|
16
|
+
|
|
17
|
+
<CopyPrompt text="Upgrade this Geistdocs site from 1.x to 2.0. Inspect package.json, next.config.ts, source.config.ts, the root layout, lib/geistdocs, proxy.ts, and all imports from @vercel/geistdocs/components or @vercel/geistdocs/assets. Upgrade the dependencies, replace removed generic component imports with @vercel/geistcn/components/*, replace icon and logo imports with @vercel/geistcn-assets, keep Geistdocs-specific components and all route adapters package-backed, enable cacheComponents and partialPrefetching, apply geistFontClasses once, and preserve app-local paths when basePath is configured. If the site has versions, use createVersionedSources and pass collectVersionSwitchPaths to the version selector. Run install, typecheck, and build, then verify HTML, Markdown, search, Ask AI, and version fallbacks. Do not copy package internals into the app.">
|
|
18
|
+
Upgrade this Geistdocs site from 1.x to 2.0. Inspect `package.json`, `next.config.ts`, `source.config.ts`, the root layout, `lib/geistdocs`, `proxy.ts`, and all imports from `@vercel/geistdocs/components` or `@vercel/geistdocs/assets`. Upgrade the dependencies, replace removed generic component imports with Geistcn, keep Geistdocs-specific components and route adapters package-backed, and verify every public surface. Do not copy package internals into the app.
|
|
19
|
+
</CopyPrompt>
|
|
20
|
+
|
|
21
|
+
## 1. Upgrade dependencies
|
|
22
|
+
|
|
23
|
+
```bash title="Terminal"
|
|
24
|
+
pnpm add --save-exact @vercel/geistdocs@2 @vercel/geistcn@1.0.3 @vercel/geistcn-assets@2.0.1 next@16.3.3 react@19.2.3 react-dom@19.2.3
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Geistdocs requires Node.js 20.9 or later. If the app directly uses Ask AI dependencies, use AI SDK v6 and `@ai-sdk/react` v3. Migrate unrelated AI features separately instead of forking Geistdocs chat code.
|
|
28
|
+
|
|
29
|
+
## 2. Replace removed imports
|
|
30
|
+
|
|
31
|
+
| Geistdocs 1.x import | Geistdocs 2.0 replacement |
|
|
32
|
+
| --- | --- |
|
|
33
|
+
| `badge`, `button`, `dialog`, `drawer`, `input`, `kbd`, `separator`, `sheet`, `spinner`, `textarea`, `theme-switcher`, or `tooltip` | Import the matching component from `@vercel/geistcn/components/<name>`. |
|
|
34
|
+
| `switch` | Use `@vercel/geistcn/components/toggle`. |
|
|
35
|
+
| `sonner` | Use `Toasts` and `useToasts` from `@vercel/geistcn/components/toasts`. |
|
|
36
|
+
| `theme-aware-image` | Use Geistcn `Image` with `srcLight` and `srcDark`. |
|
|
37
|
+
| `button-group`, `card`, or `input-group` | Choose a Geistcn component or keep an app-owned composition; there is no API-compatible replacement. |
|
|
38
|
+
| `@vercel/geistdocs/assets/icons` or `assets/icons/*` | `@vercel/geistcn-assets/icons` or `icons/*` |
|
|
39
|
+
| `@vercel/geistdocs/assets/logos` or `assets/logos/*` | `@vercel/geistcn-assets/logos` or `logos/*` |
|
|
40
|
+
|
|
41
|
+
Keep documentation-specific imports such as `callout`, `code-block`, `code-block-tabs`, `collapsible`, `command-prompt`, `copy-prompt`, `mermaid`, and `video` on `@vercel/geistdocs/components/*`.
|
|
42
|
+
|
|
43
|
+
Import the package stylesheet once and apply the Geist font classes at the root:
|
|
44
|
+
|
|
45
|
+
```tsx title="app/[lang]/layout.tsx"
|
|
46
|
+
import "@vercel/geistdocs/styles.css";
|
|
47
|
+
import { geistFontClasses } from "@vercel/geistcn/core";
|
|
48
|
+
|
|
49
|
+
export default function RootLayout({ children }: LayoutProps<"/[lang]">) {
|
|
50
|
+
return (
|
|
51
|
+
<html className={geistFontClasses}>
|
|
52
|
+
<body>{children}</body>
|
|
53
|
+
</html>
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## 3. Use the Next.js and source integrations
|
|
59
|
+
|
|
60
|
+
```ts title="next.config.ts"
|
|
61
|
+
import { createGeistdocs } from "@vercel/geistdocs/next";
|
|
62
|
+
import type { NextConfig } from "next";
|
|
63
|
+
|
|
64
|
+
const config: NextConfig = {
|
|
65
|
+
modularizeImports: {
|
|
66
|
+
"@vercel/geistcn/components": {
|
|
67
|
+
skipDefaultConversion: true,
|
|
68
|
+
transform: "@vercel/geistcn/components/{{ kebabCase member }}",
|
|
69
|
+
},
|
|
70
|
+
"@vercel/geistcn/core": {
|
|
71
|
+
skipDefaultConversion: true,
|
|
72
|
+
transform: "@vercel/geistcn/core",
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
transpilePackages: [
|
|
76
|
+
"@vercel/geistcn",
|
|
77
|
+
"@vercel/geist-test-utils",
|
|
78
|
+
"@vercel/next-themes",
|
|
79
|
+
],
|
|
80
|
+
cacheComponents: true,
|
|
81
|
+
partialPrefetching: true,
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export default createGeistdocs()(config);
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
In `source.config.ts`, import `defineGeistdocsSourceConfig`, `geistdocsFrontmatterSchema`, and `geistdocsMetaSchema` only from `@vercel/geistdocs/source-config`. Keep pages and route handlers as thin adapters around Geistdocs package APIs.
|
|
88
|
+
|
|
89
|
+
## 4. Preserve routing invariants
|
|
90
|
+
|
|
91
|
+
- If Next.js uses `basePath`, set the same value in Geistdocs config.
|
|
92
|
+
- Keep `content.route`, source `baseUrl`, navigation hrefs, `getPageUrl`, search results, and proxy `markdownRoutes` app-local. Next.js adds the mount prefix once; Geistdocs adds it to public metadata, Markdown, discovery links, and citations.
|
|
93
|
+
- For versioned docs, use `createVersionedSources` and pass server-computed `collectVersionSwitchPaths` to the version selector so missing pages fall back to an existing ancestor.
|
|
94
|
+
- Keep version and router dimensions in static route segments when layouts and sidebar state should persist. Build router-specific, prefix-relative path sets separately from version paths.
|
|
95
|
+
- Keep product-specific navigation titles, badges, related links, and content transforms in the app.
|
|
96
|
+
|
|
97
|
+
## 5. Verify the upgrade
|
|
98
|
+
|
|
99
|
+
- Run install, typecheck, tests, and a production build.
|
|
100
|
+
- Open representative HTML pages and their `.md` equivalents, including a not-found path.
|
|
101
|
+
- Test search, Ask AI citations, proxy rewrites, and agent-readable routes.
|
|
102
|
+
- Switch versions from pages that do and do not exist in the target version.
|
|
103
|
+
- Confirm links do not trigger broad post-load prefetching and Ask AI is not eagerly loaded.
|
|
104
|
+
- Recheck LCP, CLS, accessibility, and post-render network and CPU activity.
|
|
105
|
+
|
|
106
|
+
For a first migration from Fumadocs or a custom docs site, follow the [full migration guide](/docs/migration).
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
title:
|
|
2
|
+
title: Migrate to Geistdocs
|
|
3
3
|
description: Migrate a Fumadocs or custom Geist docs site to package-backed Geistdocs
|
|
4
4
|
type: guide
|
|
5
5
|
summary: Move an existing documentation site to @vercel/geistdocs while keeping local content, routing, middleware behavior, and AI-readable surfaces intact.
|
|
@@ -14,6 +14,10 @@ related:
|
|
|
14
14
|
|
|
15
15
|
Migrate an existing Fumadocs or custom Geist documentation site to `@vercel/geistdocs` by moving shared behavior into package APIs and keeping site-specific adapters local. The safest migration keeps content, routing decisions, and product-specific UI in your app while replacing copied runtime code with thin package-backed adapters.
|
|
16
16
|
|
|
17
|
+
<Callout title="Already use Geistdocs 1.x?">
|
|
18
|
+
Follow the concise [1.x → 2.0 guide](/docs/migration-2) instead. This page is for adopting Geistdocs from Fumadocs or a custom documentation site.
|
|
19
|
+
</Callout>
|
|
20
|
+
|
|
17
21
|
<CopyPrompt text="Help me migrate this existing docs site to package-backed Geistdocs. Inspect source.config.ts, lib/geistdocs/source.ts, app route files, proxy.ts or middleware.ts, public/llms.txt, Open Graph routes, Tailwind CSS setup, package.json AI SDK dependencies, and environment variables. Then produce a step-by-step migration plan using @vercel/geistdocs package APIs without copying package internals.">
|
|
18
22
|
Help me migrate this existing docs site to package-backed Geistdocs. Inspect `source.config.ts`, `lib/geistdocs/source.ts`, app route files, `proxy.ts` or `middleware.ts`, `public/llms.txt`, Open Graph routes, Tailwind CSS setup, `package.json` AI SDK dependencies, and environment variables. Then produce a step-by-step migration plan using `@vercel/geistdocs` package APIs without copying package internals.
|
|
19
23
|
</CopyPrompt>
|
|
@@ -67,11 +67,17 @@ Headings automatically generate anchor links for navigation and deep linking.
|
|
|
67
67
|
|
|
68
68
|
Create unordered lists with `-`, `*`, or `+`:
|
|
69
69
|
|
|
70
|
-
|
|
71
|
-
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
70
|
+
```md
|
|
71
|
+
- Install the required packages
|
|
72
|
+
- Configure your project
|
|
73
|
+
- Start the development server
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
This renders as:
|
|
77
|
+
|
|
78
|
+
- Install the required packages
|
|
79
|
+
- Configure your project
|
|
80
|
+
- Start the development server
|
|
75
81
|
|
|
76
82
|
Create ordered lists with numbers:
|
|
77
83
|
|
|
@@ -97,6 +103,84 @@ This renders as:
|
|
|
97
103
|
|
|
98
104
|
<Callout>This is automatically set when deploying to Vercel.</Callout>
|
|
99
105
|
|
|
106
|
+
Callouts can also contain a title and lists:
|
|
107
|
+
|
|
108
|
+
<Callout title="Good to know">
|
|
109
|
+
- The `App Router` uses [React canary
|
|
110
|
+
releases](https://react.dev/blog/2023/05/03/react-canaries) built-in, which
|
|
111
|
+
include all the stable React 19 changes, as well as newer features being
|
|
112
|
+
validated in frameworks, but you should still declare react and react-dom in
|
|
113
|
+
package.json for tooling and ecosystem compatibility.
|
|
114
|
+
- The `Pages Router` uses the React version from your `package.json`.
|
|
115
|
+
</Callout>
|
|
116
|
+
|
|
117
|
+
Callouts support rich inline Markdown, including code, emphasis, and links:
|
|
118
|
+
|
|
119
|
+
```mdx
|
|
120
|
+
<Callout title="Good to know">
|
|
121
|
+
Global styles can be imported into any layout, page, or component inside the
|
|
122
|
+
`app` directory. However, since Next.js uses React's built-in support for
|
|
123
|
+
stylesheets to integrate with Suspense, this currently does not remove
|
|
124
|
+
stylesheets as you navigate between routes which can lead to conflicts. We
|
|
125
|
+
recommend using global styles for _truly global_ CSS (like Tailwind's base
|
|
126
|
+
styles), [Tailwind CSS](https://tailwindcss.com) for component styling, and
|
|
127
|
+
[CSS Modules](https://nextjs.org/docs/app/getting-started/css#css-modules) for
|
|
128
|
+
custom scoped CSS when needed.
|
|
129
|
+
</Callout>
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
This renders as:
|
|
133
|
+
|
|
134
|
+
<Callout title="Good to know">
|
|
135
|
+
Global styles can be imported into any layout, page, or component inside the
|
|
136
|
+
`app` directory. However, since Next.js uses React's built-in support for
|
|
137
|
+
stylesheets to integrate with Suspense, this currently does not remove
|
|
138
|
+
stylesheets as you navigate between routes which can lead to conflicts. We
|
|
139
|
+
recommend using global styles for _truly global_ CSS (like Tailwind's base
|
|
140
|
+
styles), [Tailwind CSS](https://tailwindcss.com) for component styling, and
|
|
141
|
+
[CSS Modules](https://nextjs.org/docs/app/getting-started/css#css-modules) for
|
|
142
|
+
custom scoped CSS when needed.
|
|
143
|
+
</Callout>
|
|
144
|
+
|
|
145
|
+
### Copy Prompts
|
|
146
|
+
|
|
147
|
+
Short prompts render in full without an expansion control:
|
|
148
|
+
|
|
149
|
+
```mdx
|
|
150
|
+
<CopyPrompt text="Summarize this documentation page and list the key concepts.">
|
|
151
|
+
Summarize this documentation page and list the key concepts.
|
|
152
|
+
</CopyPrompt>
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
This renders as:
|
|
156
|
+
|
|
157
|
+
<CopyPrompt text="Summarize this documentation page and list the key concepts.">
|
|
158
|
+
Summarize this documentation page and list the key concepts.
|
|
159
|
+
</CopyPrompt>
|
|
160
|
+
|
|
161
|
+
Long prompts initially show a preview with a **Show more** control:
|
|
162
|
+
|
|
163
|
+
```mdx
|
|
164
|
+
<CopyPrompt collapsible text="Write a detailed migration plan for this project.">
|
|
165
|
+
Write a detailed migration plan for this project. Include prerequisites,
|
|
166
|
+
implementation steps, validation, rollback guidance, and common pitfalls.
|
|
167
|
+
</CopyPrompt>
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Set the boolean `collapsible` prop when the prompt should initially render as a
|
|
171
|
+
two-line preview. This renders as:
|
|
172
|
+
|
|
173
|
+
<CopyPrompt collapsible text="Review this Geistdocs project in detail. Explain how the @vercel/geistdocs package, application layouts, local adapter files, source configuration, content/docs directory, navigation metadata, MDX components, syntax highlighting, search routes, and deployment configuration work together. Then identify the safest first files to edit, describe the effect of each change, call out common mistakes, and propose a step-by-step plan for customizing the documentation site without breaking routing, generated Markdown, or accessibility behavior.">
|
|
174
|
+
Review this Geistdocs project in detail. Explain how the `@vercel/geistdocs`
|
|
175
|
+
package, application layouts, local adapter files, source configuration,
|
|
176
|
+
`content/docs` directory, navigation metadata, MDX components, syntax
|
|
177
|
+
highlighting, search routes, and deployment configuration work together.
|
|
178
|
+
Then identify the safest first files to edit, describe the effect of each
|
|
179
|
+
change, call out common mistakes, and propose a step-by-step plan for
|
|
180
|
+
customizing the documentation site without breaking routing, generated
|
|
181
|
+
Markdown, or accessibility behavior.
|
|
182
|
+
</CopyPrompt>
|
|
183
|
+
|
|
100
184
|
### Links
|
|
101
185
|
|
|
102
186
|
Create links with `[text](url)`:
|
|
@@ -104,15 +188,25 @@ Create links with `[text](url)`:
|
|
|
104
188
|
- [External link](https://vercel.com)
|
|
105
189
|
- [Internal link](/docs/getting-started)
|
|
106
190
|
|
|
107
|
-
Use an absolute `https://` or `http://` URL
|
|
108
|
-
|
|
109
|
-
|
|
191
|
+
Use an absolute `https://` or `http://` URL for an external destination. Use a
|
|
192
|
+
root-relative path beginning with `/` for an internal link. Both use the same
|
|
193
|
+
visual styling:
|
|
110
194
|
|
|
111
195
|
```md
|
|
112
196
|
[External link](https://vercel.com)
|
|
113
197
|
[Internal link](/docs/getting-started)
|
|
114
198
|
```
|
|
115
199
|
|
|
200
|
+
Links can also contain inline code:
|
|
201
|
+
|
|
202
|
+
```md
|
|
203
|
+
Run independent requests in parallel with [`Promise.all`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/all).
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
This renders as:
|
|
207
|
+
|
|
208
|
+
Run independent requests in parallel with [`Promise.all`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/all).
|
|
209
|
+
|
|
116
210
|
### Images
|
|
117
211
|
|
|
118
212
|
Add images with ``:
|
|
@@ -145,6 +239,16 @@ This renders as:
|
|
|
145
239
|
| GFM | GitHub extensions | Supported |
|
|
146
240
|
| MDX | JSX in Markdown | Supported |
|
|
147
241
|
|
|
242
|
+
Tables can also include inline code, as commonly used for file references:
|
|
243
|
+
|
|
244
|
+
| File | Description |
|
|
245
|
+
| -------------------- | ------------------------------------------------ |
|
|
246
|
+
| `next.config.js` | Configuration file for Next.js |
|
|
247
|
+
| `package.json` | Project dependencies and scripts |
|
|
248
|
+
| `instrumentation.ts` | OpenTelemetry and instrumentation file |
|
|
249
|
+
| `.env.local` | Local environment variables |
|
|
250
|
+
| `tsconfig.json` | Configuration file for TypeScript |
|
|
251
|
+
|
|
148
252
|
### Task Lists
|
|
149
253
|
|
|
150
254
|
Create interactive task lists:
|
package/template/package.json
CHANGED
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
"@orama/tokenizers": "^3.1.16",
|
|
16
16
|
"@streamdown/cjk": "^1.0.1",
|
|
17
17
|
"@streamdown/code": "^1.0.1",
|
|
18
|
-
"@vercel/agent-readability": "^0.
|
|
18
|
+
"@vercel/agent-readability": "^0.7.0",
|
|
19
19
|
"@vercel/analytics": "^1.6.1",
|
|
20
20
|
"@vercel/geistcn": "1.0.3",
|
|
21
21
|
"@vercel/geistcn-assets": "2.0.1",
|
|
22
|
-
"@vercel/geistdocs": "1.25.1-canary.
|
|
22
|
+
"@vercel/geistdocs": "1.25.1-canary.e20ff18",
|
|
23
23
|
"@vercel/speed-insights": "^1.3.1",
|
|
24
24
|
"ai": "^6.0.132",
|
|
25
25
|
"class-variance-authority": "^0.7.1",
|
package/theme.css
CHANGED
|
@@ -1,30 +1,14 @@
|
|
|
1
|
-
/* Geistdocs integration layer: package source scanning, Fumadocs mappings,
|
|
2
|
-
docs layout rules, syntax tokens, and package-specific behavior. Geistcn's
|
|
3
|
-
tailwind.css and styles.css own design tokens, utilities, typography,
|
|
4
|
-
material styles, and base resets.
|
|
5
|
-
|
|
6
|
-
The @source lines below emit every class the package's compiled components
|
|
7
|
-
and streamdown reference; they resolve relative to this file, so they work
|
|
8
|
-
when a consumer imports it. Consumers therefore only need
|
|
9
|
-
`@import "@vercel/geistdocs/theme.css";` and must not re-`@source` the
|
|
10
|
-
package dist or streamdown downstream (delete any such line you find). Add a
|
|
11
|
-
new @source here (never downstream) only when the package gains a new
|
|
12
|
-
compiled dependency. */
|
|
13
|
-
|
|
14
|
-
/* Streamdown classes for Ask AI markdown. Both paths cover the workspace and a
|
|
15
|
-
published pnpm install; Tailwind ignores whichever doesn't resolve. */
|
|
16
1
|
@source "node_modules/streamdown/dist/*.js";
|
|
17
2
|
@source "../../streamdown/dist/*.js";
|
|
18
3
|
|
|
19
|
-
/* The package's own compiled components (navbar container queries, etc.).
|
|
20
|
-
`./dist` resolves next to this file in both the workspace and an install. */
|
|
21
4
|
@source "./dist/**/*.js";
|
|
22
5
|
|
|
23
|
-
/* Monorepo dev only: also scan the package's TypeScript source so new Tailwind
|
|
24
|
-
classes hot-reload without rebuilding `dist`. `./src` exists only in the
|
|
25
|
-
workspace; a published install has no `src`, so Tailwind ignores it. */
|
|
26
6
|
@source "./src/**/*.{ts,tsx}";
|
|
27
7
|
|
|
8
|
+
button:not(:disabled, [aria-disabled="true"]) {
|
|
9
|
+
cursor: pointer;
|
|
10
|
+
}
|
|
11
|
+
|
|
28
12
|
.prose h1 {
|
|
29
13
|
@apply text-heading-32;
|
|
30
14
|
}
|
|
@@ -46,88 +30,58 @@
|
|
|
46
30
|
@apply text-heading-14;
|
|
47
31
|
}
|
|
48
32
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
reliably override. Own the Geist heading style here where specificity wins;
|
|
52
|
-
tracking-tighter loosens text-heading-40's dense -2.4px. */
|
|
53
|
-
#nd-page h1:not(:where(.prose *)) {
|
|
54
|
-
@apply text-heading-40 tracking-tighter;
|
|
33
|
+
.prose :is(h1, h2, h3, h4, h5, h6)[id] {
|
|
34
|
+
position: relative;
|
|
55
35
|
}
|
|
56
36
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
counter-reset: step;
|
|
60
|
-
counter-increment: step 0;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.line-numbers code .line::before {
|
|
64
|
-
content: counter(step);
|
|
65
|
-
counter-increment: step;
|
|
66
|
-
@apply mr-5 inline-block w-4 shrink-0 text-right font-mono text-[13px] tabular-nums text-gray-600;
|
|
67
|
-
}
|
|
37
|
+
.prose :is(h1, h2, h3, h4, h5, h6)[id] > a:first-child {
|
|
38
|
+
position: static;
|
|
68
39
|
}
|
|
69
40
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
width: max-content;
|
|
75
|
-
min-width: 100%;
|
|
76
|
-
height: 20px;
|
|
77
|
-
padding: 0 20px !important;
|
|
41
|
+
.prose :is(h1, h2, h3, h4, h5, h6)[id] > a:first-child::after {
|
|
42
|
+
position: absolute;
|
|
43
|
+
inset: 0;
|
|
44
|
+
content: "";
|
|
78
45
|
}
|
|
79
46
|
|
|
80
|
-
[
|
|
81
|
-
:
|
|
82
|
-
background: var(--ds-blue-300) !important;
|
|
83
|
-
border-left: 0 !important;
|
|
84
|
-
box-shadow: inset 2px 0 0 0 var(--ds-blue-900);
|
|
47
|
+
.prose :is(h1, h2, h3, h4, h5, h6)[id] > svg {
|
|
48
|
+
pointer-events: none;
|
|
85
49
|
}
|
|
86
50
|
|
|
87
|
-
[
|
|
88
|
-
|
|
89
|
-
box-shadow: inset 2px 0 0 0 var(--ds-amber-900);
|
|
51
|
+
.prose :is(h1, h2, h3, h4, h5, h6)[id]:is(:hover, :focus-within) > svg {
|
|
52
|
+
opacity: 1;
|
|
90
53
|
}
|
|
91
54
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
box-shadow: inset 2px 0 0 0 var(--ds-green-900);
|
|
55
|
+
.prose ul:where(:not(.not-prose, .not-prose *)) {
|
|
56
|
+
padding-left: 1.25rem;
|
|
95
57
|
}
|
|
96
58
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
variable to a weaker HSL value later in the cascade. */
|
|
100
|
-
background: oklch(94.33% 0.0369 15.0115) !important;
|
|
101
|
-
box-shadow: inset 2px 0 0 0 var(--ds-red-900);
|
|
102
|
-
opacity: 1 !important;
|
|
59
|
+
.prose ul > li:where(:not(.not-prose, .not-prose *)) {
|
|
60
|
+
padding-left: 0.5rem;
|
|
103
61
|
}
|
|
104
62
|
|
|
105
|
-
|
|
106
|
-
|
|
63
|
+
#nd-page h1:not(:where(.prose *)) {
|
|
64
|
+
@apply text-heading-40 tracking-tighter;
|
|
107
65
|
}
|
|
108
66
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
.line.diff.remove
|
|
115
|
-
)::after {
|
|
116
|
-
position: absolute;
|
|
117
|
-
inset: 0;
|
|
118
|
-
padding-left: 8px;
|
|
119
|
-
font-weight: 500;
|
|
120
|
-
pointer-events: none;
|
|
67
|
+
@media (width >= 80rem) {
|
|
68
|
+
#nd-page {
|
|
69
|
+
max-width: 780px;
|
|
70
|
+
transform: translateX(-20px);
|
|
71
|
+
}
|
|
121
72
|
}
|
|
122
73
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
74
|
+
@layer utilities {
|
|
75
|
+
.line-numbers code {
|
|
76
|
+
counter-reset: step;
|
|
77
|
+
counter-increment: step 0;
|
|
78
|
+
}
|
|
127
79
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
80
|
+
.line-numbers code .line::before {
|
|
81
|
+
content: counter(step);
|
|
82
|
+
counter-increment: step;
|
|
83
|
+
@apply mr-5 inline-block w-4 shrink-0 text-right font-mono text-[13px] tabular-nums text-gray-600;
|
|
84
|
+
}
|
|
131
85
|
}
|
|
132
86
|
|
|
133
87
|
:root {
|
|
@@ -147,7 +101,6 @@
|
|
|
147
101
|
@apply hidden;
|
|
148
102
|
}
|
|
149
103
|
|
|
150
|
-
/* Shiki syntax highlighting palette - matches packages/geist code-block.module.css */
|
|
151
104
|
:root {
|
|
152
105
|
--shiki-color-text: var(--ds-gray-1000);
|
|
153
106
|
--shiki-color-background: var(--ds-background-100);
|
|
@@ -162,7 +115,6 @@
|
|
|
162
115
|
--shiki-token-link: var(--ds-green-900);
|
|
163
116
|
}
|
|
164
117
|
|
|
165
|
-
/* Override fumadocs tokens to point at the Geist scale */
|
|
166
118
|
:root {
|
|
167
119
|
--color-fd-background: var(--ds-background-100);
|
|
168
120
|
--color-fd-foreground: var(--ds-gray-1000);
|
|
@@ -183,7 +135,6 @@
|
|
|
183
135
|
--color-fd-error: var(--ds-red-800);
|
|
184
136
|
}
|
|
185
137
|
|
|
186
|
-
/* Match the fumadocs sidebar selector to the Geist scale */
|
|
187
138
|
#nd-sidebar {
|
|
188
139
|
--color-fd-accent: var(--ds-gray-100);
|
|
189
140
|
--color-fd-accent-foreground: var(--ds-gray-1000);
|
|
@@ -276,8 +227,6 @@
|
|
|
276
227
|
}
|
|
277
228
|
}
|
|
278
229
|
|
|
279
|
-
/* fumadocs hardcodes the search dialog's className, so the command modal
|
|
280
|
-
shadow is applied here via the data attribute set in search.tsx. */
|
|
281
230
|
[data-geistdocs-command-modal] {
|
|
282
231
|
box-shadow: var(--ds-shadow-modal);
|
|
283
232
|
}
|
|
@@ -304,11 +253,6 @@
|
|
|
304
253
|
right: max(1rem, env(safe-area-inset-right));
|
|
305
254
|
}
|
|
306
255
|
|
|
307
|
-
/* Keep the table of contents scrollbar hidden on every platform. The
|
|
308
|
-
mask-gradient fade on the scroll area already signals that the list scrolls,
|
|
309
|
-
so a visible bar only adds clutter. `scrollbar-width: none` covers Firefox
|
|
310
|
-
(and non-overlay contexts); the WebKit rule covers Chrome/Safari on platforms
|
|
311
|
-
that render classic, space-consuming scrollbars. */
|
|
312
256
|
#nd-toc .geistdocs-toc-scroll {
|
|
313
257
|
scrollbar-width: none;
|
|
314
258
|
}
|
|
@@ -337,9 +281,6 @@
|
|
|
337
281
|
}
|
|
338
282
|
}
|
|
339
283
|
|
|
340
|
-
/* On home routes (GeistdocsHomeLayout renders the [data-home-route] marker),
|
|
341
|
-
the navbar starts borderless and fades its bottom border in only once the
|
|
342
|
-
page is scrolled (ScrollState toggles [data-scrolled] on <html>). */
|
|
343
284
|
body:has([data-home-route]) header {
|
|
344
285
|
border-bottom-color: transparent !important;
|
|
345
286
|
transition: border-color 200ms ease;
|
|
@@ -347,15 +288,12 @@ body:has([data-home-route]) header {
|
|
|
347
288
|
html[data-scrolled] body:has([data-home-route]) header {
|
|
348
289
|
border-bottom-color: var(--ds-gray-alpha-400) !important;
|
|
349
290
|
}
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
and covers every other route too. */
|
|
353
|
-
html body
|
|
291
|
+
html
|
|
292
|
+
body
|
|
354
293
|
header:has(
|
|
355
294
|
[data-slot="navigation-menu-trigger"][data-state="open"],
|
|
356
295
|
[data-slot="mobile-menu-toggle"][aria-expanded="true"]
|
|
357
296
|
) {
|
|
358
297
|
border-bottom-color: transparent !important;
|
|
359
|
-
/* Hide instantly; the scroll-reveal fade above still applies when closed. */
|
|
360
298
|
transition: none !important;
|
|
361
299
|
}
|