Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 8, 2026

Aligns the site template with the latest pnpm create fumadocs-app scaffold while preserving i18n routing.

Dependency updates

  • fumadocs-core/ui 16.5.1, fumadocs-mdx 14.2.6, Next.js 16.1.6, React 19.2.4
  • Removed deprecated @fumadocs/ui and autoprefixer; moved type packages to devDependencies

API migrations

  • source.config.ts: defineDocs() now uses frontmatterSchema/metaSchema with includeProcessedMarkdown for LLM text extraction
  • lib/source.ts: toFumadocsSource(docs, meta)docs.toFumadocsSource(), added lucideIconsPlugin
  • search: createSearchAPI('advanced', {...})createFromSource(source, { localeMap }) — maps cn to 'english' tokenizer since Orama doesn't support Chinese natively
  • mdx-components.tsx: useMDXComponentsgetMDXComponents
  • DocsPage: now uses DocsTitle + DocsDescription + DocsBody + createRelativeLink
  • tsconfig.json: added fumadocs-mdx:collections/* path mapping
// Before
import { docs, meta } from '../.source/server';
const mainSource = toFumadocsSource(docs, meta);

// After
import { docs } from 'fumadocs-mdx:collections/server';
source: docs.toFumadocsSource(),

New features

  • LLM routes: /llms.txt, /llms-full.txt, /docs/*.mdx (via Next.js rewrites)
  • OG images: /og/docs/[...slug] with fumadocs-ui/og
  • AI page actions: copy markdown, open in ChatGPT/Claude/T3 Chat component
  • CSS: global.css with Tailwind v4 @import pattern + postcss.config.mjs
  • Layout: layout.config.tsx (object export) → lib/layout.shared.tsx (function)

i18n

Middleware updated to exclude /llms.* and /og/ from i18n redirects. [lang] routing, language switcher, and translations all preserved.

English docs

Chinese docs


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@vercel
Copy link

vercel bot commented Feb 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
objectdocs Ready Ready Preview, Comment Feb 8, 2026 11:59am

Request Review

- Update fumadocs-core, fumadocs-mdx, fumadocs-ui to 16.5.1/14.2.6
- Update Next.js to 16.1.6, React to 19.2.4
- Migrate source.config.ts to new defineDocs API with schemas
- Migrate lib/source.ts to use docs.toFumadocsSource() and lucideIconsPlugin
- Move layout.config.tsx to lib/layout.shared.tsx (function-based)
- Update mdx-components.tsx to getMDXComponents pattern
- Update tsconfig.json with fumadocs-mdx:collections path mapping
- Add postcss.config.mjs and app/global.css
- Update search API to use createFromSource with localeMap
- Update DocsPage to use DocsTitle/DocsDescription/DocsBody components
- Add LLM routes (llms.txt, llms-full.txt, llms.mdx)
- Add OG image generation route
- Add AI page actions component (copy markdown, open in AI tools)
- Add next.config.mjs rewrites for MDX URL support
- Add lib/cn.ts utility

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
…cludeProcessedMarkdown comment

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot AI changed the title [WIP] Update Fumadocs template to latest version with internationalization Update fumadocs template to v16.5.1 with i18n and LLM support Feb 8, 2026
Copilot AI requested a review from hotlong February 8, 2026 12:03
@hotlong hotlong marked this pull request as ready for review February 8, 2026 12:05
Copilot AI review requested due to automatic review settings February 8, 2026 12:05
@github-actions
Copy link

github-actions bot commented Feb 8, 2026

🚀 Preview Deployment

This pull request will be automatically deployed to Vercel.

Preview Links

  • 📝 Documentation: Will be available once Vercel deployment completes
  • 🌍 Languages: English (/en/docs) and Chinese (/cn/docs)

Build Status

Check the CI workflow for build status and any errors.


Automated preview information for PR #47

@hotlong hotlong merged commit ea889c3 into main Feb 8, 2026
11 checks passed
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the ObjectDocs site package to match the latest Fumadocs v16.5.1 scaffold, while keeping the existing i18n routing and adding LLM/OG features for docs consumption and sharing.

Changes:

  • Bumps Fumadocs/Next/React-related dependencies and migrates to the newer Fumadocs collections/source/search APIs.
  • Adds LLM-focused endpoints (/llms.txt, /llms-full.txt, and rewritten /docs/*.mdx) plus OG image generation routes.
  • Refactors layout/config plumbing (shared base layout options, Tailwind v4 PostCSS setup, global CSS imports) and adjusts middleware matchers for new routes.

Reviewed changes

Copilot reviewed 23 out of 24 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
pnpm-lock.yaml Locks updated dependency graph for Fumadocs/Next/React upgrades and new packages.
package.json Bumps root React/lucide/tailwind-merge versions to match site package.
packages/site/package.json Updates Fumadocs/Next deps, moves type packages to devDependencies, adds types:check and postinstall.
packages/site/tsconfig.json Adds baseUrl, updates target, and introduces fumadocs-mdx:collections/* path mapping.
packages/site/source.config.ts Migrates defineDocs config to use schemas + processed markdown for LLM extraction.
packages/site/postcss.config.mjs Adds Tailwind v4 PostCSS plugin config.
packages/site/next.config.mjs Adds rewrite for /docs/:path*.mdx to LLM markdown route.
packages/site/middleware.ts Updates matcher exclusions for LLM/OG routes while preserving i18n middleware behavior.
packages/site/mdx-components.tsx Switches to getMDXComponents() pattern with default Fumadocs MDX components.
packages/site/lib/source.ts Switches to collections loader + adds lucide icons plugin, plus LLM/OG helper functions.
packages/site/lib/layout.shared.tsx Refactors base layout options into a shared function for reuse.
packages/site/lib/cn.ts Adds cn helper exported from tailwind-merge.
packages/site/components/ai/page-actions.tsx Adds client-side LLM page actions (copy markdown + open in external chat tools).
packages/site/app/layout.tsx Switches root layout styling to Tailwind class + imports new global CSS.
packages/site/app/global.css Introduces Tailwind + Fumadocs UI CSS imports via Tailwind v4 @import pattern.
packages/site/app/api/search/route.ts Migrates search endpoint to createFromSource with locale mapping.
packages/site/app/[lang]/layout.tsx Simplifies i18n provider layout to wrap children without redefining html/body.
packages/site/app/[lang]/docs/layout.tsx Uses shared base layout options function and spreads into DocsLayout.
packages/site/app/[lang]/docs/[[...slug]]/page.tsx Migrates DocsPage rendering to new Fumadocs page components + relative link handling + OG metadata.
packages/site/app/llms.txt/route.ts Adds /llms.txt listing for docs pages.
packages/site/app/llms-full.txt/route.ts Adds /llms-full.txt full concatenated LLM text export.
packages/site/app/llms.mdx/docs/[[...slug]]/route.ts Adds per-page markdown export route backing /docs/*.mdx rewrite.
packages/site/app/og/docs/[...slug]/route.tsx Adds OG image route using fumadocs-ui/og.
packages/site/app/layout.config.tsx Removes old static baseOptions export in favor of shared layout helper.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Comment on lines +17 to +18
export async function GET(_req: Request, { params }: RouteContext<'/og/docs/[...slug]'>) {
const { slug } = await params;
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RouteContext is referenced in the GET handler signature but is not defined/imported anywhere in the repo, which will cause a TypeScript compile error. Replace it with an explicit context type (e.g., { params: { slug: string[] } } or the appropriate Next-generated type) or import the correct type if it exists.

Copilot uses AI. Check for mistakes.
Comment on lines +18 to +20
const { slug } = await params;
const page = source.getPage(slug.slice(0, -1));
if (!page) notFound();
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This OG route isn’t locale-aware: source.getPage(...) is called without a lang, and getPageImage() doesn’t include page.locale in the generated URL segments. For i18n pages this can return the default-language page and also causes URL collisions between locales; include locale in the OG URL/params and pass the correct language into source.getPage.

Copilot uses AI. Check for mistakes.
Comment on lines +31 to +35
export function generateStaticParams() {
return source.getPages().map((page) => ({
lang: page.locale,
slug: getPageImage(page).segments,
}));
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generateStaticParams() returns an extra lang field even though this route only has a [...slug] param. Next’s static params are expected to match the route’s dynamic segments; either add a [lang] segment to the route path or fold the locale into slug so the params shape matches the route.

Copilot uses AI. Check for mistakes.
Comment on lines +14 to +16
export async function GET(_req: Request, { params }: RouteContext<'/llms.mdx/docs/[[...slug]]'>) {
const { slug } = await params;
const page = source.getPage(slug);
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RouteContext is referenced in the GET handler signature but is not defined/imported anywhere in the repo, which will cause a TypeScript compile error. Replace it with an explicit context type for params (or import the correct Next-generated type if available).

Copilot uses AI. Check for mistakes.
Comment on lines +21 to +27
export function getPageImage(page: InferPageType<typeof source>) {
const segments = [...page.slugs, 'image.png'];

return {
segments,
url: `/og/docs/${segments.join('/')}`,
};
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getPageImage() builds OG image URLs without including page.locale. In an i18n setup this can produce identical OG URLs for different locales and makes it impossible for the OG route to reliably render the correct-language page. Include the locale in segments/url (and align the OG route params parsing accordingly).

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants