@vercel/geistdocs 1.24.1 → 1.25.1

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.
Files changed (46) hide show
  1. package/dist/cli/index.js +1 -1
  2. package/dist/components/code-block.d.ts.map +1 -1
  3. package/dist/components/code-block.js +2 -2
  4. package/dist/components/copy-prompt.js +1 -1
  5. package/dist/home-layout.js +1 -1
  6. package/dist/internal/app-route-manifest.d.ts +19 -0
  7. package/dist/internal/app-route-manifest.d.ts.map +1 -0
  8. package/dist/internal/app-route-manifest.js +121 -0
  9. package/dist/internal/app-route-scanner.d.ts +9 -0
  10. package/dist/internal/app-route-scanner.d.ts.map +1 -0
  11. package/dist/internal/app-route-scanner.js +149 -0
  12. package/dist/internal/chat/shell.d.ts.map +1 -1
  13. package/dist/internal/chat/shell.js +1 -1
  14. package/dist/internal/navbar/desktop-menu.d.ts.map +1 -1
  15. package/dist/internal/navbar/desktop-menu.js +1 -1
  16. package/dist/internal/navbar/navbar-logo.d.ts.map +1 -1
  17. package/dist/internal/navbar/navbar-logo.js +2 -2
  18. package/dist/internal/ui/button.d.ts +1 -1
  19. package/dist/internal/ui/kbd.js +1 -1
  20. package/dist/layout.js +1 -1
  21. package/dist/next.d.ts +6 -0
  22. package/dist/next.d.ts.map +1 -0
  23. package/dist/next.js +52 -0
  24. package/dist/proxy.d.ts +2 -1
  25. package/dist/proxy.d.ts.map +1 -1
  26. package/dist/proxy.js +28 -5
  27. package/dist/routes/llms.d.ts +1 -1
  28. package/dist/routes/llms.d.ts.map +1 -1
  29. package/dist/routes/llms.js +1 -1
  30. package/docs/agents.md +2 -2
  31. package/docs/llms.txt +45 -13
  32. package/docs/manifest.json +2 -2
  33. package/docs/pages/configuration.md +8 -0
  34. package/docs/pages/md.md +8 -5
  35. package/docs/pages/migration.md +7 -5
  36. package/docs/pages/proxy.md +20 -1
  37. package/docs/sitemap.md +1 -1
  38. package/package.json +5 -1
  39. package/template/AGENTS.md +2 -0
  40. package/template/app/[lang]/llms.mdx/[[...slug]]/route.ts +0 -1
  41. package/template/content/docs/configuration.mdx +8 -0
  42. package/template/content/docs/md.mdx +8 -5
  43. package/template/content/docs/migration.mdx +7 -5
  44. package/template/content/docs/proxy.mdx +20 -1
  45. package/template/next.config.ts +3 -3
  46. package/template/package.json +1 -1
@@ -2,7 +2,7 @@
2
2
  title: Proxy and markdown routes
3
3
  description: Add custom request logic while keeping Geistdocs markdown negotiation in the package
4
4
  type: reference
5
- summary: Configure createProxy with before and after hooks, markdown route mappings, and a static Next.js matcher.
5
+ summary: Configure createProxy with generated route discovery, request hooks, markdown mappings, and a static Next.js matcher.
6
6
  prerequisites:
7
7
  - /docs/configuration
8
8
  related:
@@ -177,6 +177,25 @@ export const config = {
177
177
 
178
178
  The package keeps `llms.txt`, `sitemap.md`, `agents.md`, MCP discovery, and RSS out of root page-Markdown negotiation. Continue to exclude site-specific application and API routes with the matcher or a `before` hook. A root Markdown page is exposed as `/index.md`, or `<basePath>/index.md` publicly.
179
179
 
180
+ ## Recover unmatched Markdown requests
181
+
182
+ `createGeistdocs` in `next.config.ts` generates a lightweight manifest from App Router pages and route handlers. When `agent` is enabled, `createProxy` uses this manifest to return a Markdown 404 only when a `GET` or `HEAD` request matches neither a Markdown mapping nor an application route.
183
+
184
+ The manifest contains route patterns, not page modules or content. Static, dynamic, catch-all, optional catch-all, grouped, and localized routes continue to Next.js. Root catch-all pages are treated as potentially valid, so the app remains responsible for their 404 behavior. The package's own `[...not-found]` route handler is excluded so it does not claim every path.
185
+
186
+ The integration also resolves `next.config.ts` rewrites. Static rewrite sources are matched exactly, while parameterized sources protect their safe static prefix. If a rewrite begins with a dynamic root segment, Geistdocs disables automatic recovery rather than risk returning a Markdown 404 for a real rewritten route.
187
+
188
+ No proxy option is required. Pass `markdownNotFound: false` only when the site needs to disable automatic recovery:
189
+
190
+ ```ts title="proxy.ts"
191
+ const proxy = createProxy({
192
+ config: geistdocsConfig,
193
+ markdownNotFound: false,
194
+ });
195
+ ```
196
+
197
+ Existing sites that use `createMDX` directly do not receive a generated manifest and keep the previous opt-in behavior. Restart `next dev` after adding, deleting, or renaming a route; production builds always regenerate the manifest.
198
+
180
199
  ## Hook context
181
200
 
182
201
  Both `before` and `after` receive the same context:
@@ -1,9 +1,9 @@
1
1
  import { existsSync } from "node:fs";
2
2
  import { join } from "node:path";
3
- import { createMDX } from "fumadocs-mdx/next";
3
+ import { createGeistdocs } from "@vercel/geistdocs/next";
4
4
  import type { NextConfig } from "next";
5
5
 
6
- const withMDX = createMDX();
6
+ const withGeistdocs = createGeistdocs();
7
7
 
8
8
  // In this monorepo, compile @vercel/geistdocs from its workspace source so edits
9
9
  // to the package hot-reload in the running dev server (no rebuild/restart).
@@ -41,4 +41,4 @@ const config: NextConfig = {
41
41
  },
42
42
  };
43
43
 
44
- export default withMDX(config);
44
+ export default withGeistdocs(config);
@@ -18,7 +18,7 @@
18
18
  "@streamdown/code": "^1.0.1",
19
19
  "@vercel/agent-readability": "^0.6.0",
20
20
  "@vercel/analytics": "^1.6.1",
21
- "@vercel/geistdocs": "1.24.1",
21
+ "@vercel/geistdocs": "1.25.1",
22
22
  "@vercel/speed-insights": "^1.3.1",
23
23
  "ai": "^6.0.132",
24
24
  "class-variance-authority": "^0.7.1",