Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 20, 2026

Migrates the official documentation site from VitePress to Fumadocs, establishing the new site at /apps/site using a multi-package architecture.

Changes

  • Site Structure

    • Next.js 15 app at /apps/site with TypeScript, Tailwind CSS, and Fumadocs UI
    • MDX-based documentation in content/docs/ (Introduction, Quick Start, Installation)
    • Homepage with navigation, docs layout with sidebar
  • Configuration

    • Added fumadocs-core, fumadocs-mdx, fumadocs-ui dependencies
    • Configured Next.js with MDX support via next.config.mjs
    • Tailwind preset for Fumadocs UI components
    • Source config in source.config.ts for MDX compilation
  • Monorepo Integration

    • Added /apps/* to pnpm-workspace.yaml
    • Root scripts: site:dev, site:build, site:start
    • Updated .gitignore for Next.js and Fumadocs artifacts

Known Issue

Route generation requires API compatibility fix between fumadocs-mdx .source exports (wrapped by _runtime.doc()) and the loader. Build succeeds but pages return 404. Requires investigation of fumadocs 15.x integration pattern.

// Current workaround - manual mapping from .source
const mappedDocs = docs
  .filter((doc: any) => doc && doc.info && doc.info.path)
  .map((doc: any) => ({
    type: 'page' as const,
    path: doc.info.path.replace(/\.mdx?$/, ''),
    data: { ...doc.data, body: doc.data.default },
  }));

Screenshot

Fumadocs Site Structure

Original prompt

将官网文档站点迁移到fumadocs ,位于/apps/site,使用多包架构


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@vercel
Copy link

vercel bot commented Jan 20, 2026

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

Project Deployment Review Updated (UTC)
objectui-docs Error Error Jan 20, 2026 3:34am

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot AI changed the title [WIP] Migrate official documentation site to fumadocs Initialize fumadocs documentation site at /apps/site Jan 20, 2026
Copilot AI requested a review from hotlong January 20, 2026 03:36
@huangyiirene huangyiirene requested review from Copilot and removed request for hotlong January 20, 2026 03:48
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

This PR migrates the official documentation site from VitePress to Fumadocs, establishing a new Next.js 15-based documentation site at /apps/site with MDX content support.

Changes:

  • Sets up a new Next.js 15 app with Fumadocs UI framework, Tailwind CSS, and TypeScript
  • Creates MDX-based documentation content (Introduction, Quick Start, Installation)
  • Implements a workaround for fumadocs-mdx source API compatibility issues

Reviewed changes

Copilot reviewed 20 out of 22 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
package.json Adds workspace scripts for site development, build, and start commands
apps/site/package.json Defines dependencies for Next.js 15, Fumadocs packages, and React 18
apps/site/tsconfig.json Configures TypeScript with Next.js-specific settings
apps/site/tailwind.config.ts Sets up Tailwind with Fumadocs UI component scanning
apps/site/next.config.mjs Configures Next.js with MDX support via fumadocs-mdx
apps/site/source.config.ts Defines MDX compilation configuration for docs directory
apps/site/lib/source.ts Implements workaround for fumadocs source API compatibility
apps/site/app/*.tsx Creates root layout, homepage, and docs layout components
apps/site/app/docs/[[...slug]]/page.tsx Implements dynamic docs page renderer with metadata generation
apps/site/content/docs/*.mdx Adds documentation content pages
apps/site/.gitignore Ignores Next.js, Fumadocs, and build artifacts
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Comment on lines +4 to +12
// Map the docs from .source to the format expected by loader
// Note: docs from .source is wrapped by _runtime.doc(), not a plain array
const mappedDocs = docs
.filter((doc: any) => doc && doc.info && doc.info.path)
.map((doc: any) => {
let path = doc.info.path.replace(/\.mdx?$/, '');
// Convert index.mdx to empty path for root /docs route
if (path === 'index') path = '';

Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

The use of any type bypasses TypeScript's type safety. Consider defining a proper interface for the doc structure or using type guards to validate the structure before filtering and mapping.

Suggested change
// Map the docs from .source to the format expected by loader
// Note: docs from .source is wrapped by _runtime.doc(), not a plain array
const mappedDocs = docs
.filter((doc: any) => doc && doc.info && doc.info.path)
.map((doc: any) => {
let path = doc.info.path.replace(/\.mdx?$/, '');
// Convert index.mdx to empty path for root /docs route
if (path === 'index') path = '';
interface SourceDocInfo {
path: string;
}
interface SourceDocData {
// `default` holds the page body/component; other properties are spread through.
default: unknown;
// Allow additional properties without losing type safety on `default`.
[key: string]: unknown;
}
interface SourceDoc {
info?: SourceDocInfo;
data: SourceDocData;
}
function isValidDoc(doc: unknown): doc is SourceDoc {
if (typeof doc !== 'object' || doc === null) return false;
const maybeDoc = doc as { info?: { path?: unknown }; data?: unknown };
if (!maybeDoc.info || typeof maybeDoc.info.path !== 'string') return false;
if (typeof maybeDoc.data !== 'object' || maybeDoc.data === null) return false;
return true;
}
// Map the docs from .source to the format expected by loader
// Note: docs from .source is wrapped by _runtime.doc(), not a plain array
const mappedDocs = docs
.filter(isValidDoc)
.map((doc) => {
let path = doc.info!.path.replace(/\.mdx?$/, '');
// Convert index.mdx to empty path for root /docs route
if (path === 'index') path = '';

Copilot uses AI. Check for mistakes.
path,
data: {
...doc.data,
body: doc.data.default,
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

The property name default is ambiguous in this context. Consider using a more descriptive name like component or content to clarify what this represents in the data structure.

Copilot uses AI. Check for mistakes.
if (!page) notFound();

// Type assertion needed due to custom data mapping
const MDX = (page.data as any).body;
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

Type assertion to any removes type safety. Define a proper interface for the page data structure to maintain type safety throughout the component.

Copilot uses AI. Check for mistakes.
const MDX = (page.data as any).body;

return (
<DocsPage toc={(page.data as any).toc} full={(page.data as any).full}>
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

Multiple type assertions to any in the same expression reduces type safety. Define an interface for the expected page data structure with properties like toc, full, title, description, and body.

Copilot uses AI. Check for mistakes.
Create your first Object UI component:

```tsx
import { ObjectUIRenderer } from '@object-ui/react';
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

The component name ObjectUIRenderer does not align with the architectural guideline that references <SchemaRenderer> as the primary runtime component. Consider using SchemaRenderer for consistency with the documented architecture.

Copilot generated this review using guidance from repository custom instructions.
pnpm install @object-ui/react @object-ui/components

# Start building with JSON
import { ObjectUIRenderer } from '@object-ui/react';
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

The component name ObjectUIRenderer does not align with the architectural guideline that references <SchemaRenderer> as the primary runtime component. Consider using SchemaRenderer for consistency with the documented architecture.

Copilot generated this review using guidance from repository custom instructions.
### 3. Start Using

```tsx
import { ObjectUIRenderer } from '@object-ui/react';
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

The component name ObjectUIRenderer does not align with the architectural guideline that references <SchemaRenderer> as the primary runtime component. Consider using SchemaRenderer for consistency with the documented architecture.

Copilot generated this review using guidance from repository custom instructions.
@github-actions
Copy link

📦 Bundle Size Report

Package Size Gzipped
components (index.js) 1560.46KB 368.00KB
core (index.js) 0.46KB 0.26KB
data-objectql (ObjectQLDataSource.js) 12.09KB 2.84KB
data-objectql (hooks.js) 5.62KB 1.43KB
data-objectql (index.js) 0.62KB 0.36KB
designer (index.js) 1.46KB 0.51KB
plugin-charts (AdvancedChartImpl-C8-XIe1b.js) 74.89KB 15.82KB
plugin-charts (BarChart-CRc8MAtI.js) 551.60KB 127.51KB
plugin-charts (ChartImpl-CRaHSWhr.js) 3.17KB 1.10KB
plugin-charts (index-ClQPzSfD.js) 24.05KB 7.05KB
plugin-charts (index.js) 0.21KB 0.16KB
plugin-editor (MonacoImpl-BSiaJCGx.js) 18.15KB 5.59KB
plugin-editor (index-Bx39x2XN.js) 21.72KB 6.53KB
plugin-editor (index.js) 0.19KB 0.15KB
plugin-kanban (KanbanImpl-mGLdSHcd.js) 76.50KB 20.46KB
plugin-kanban (index-i_5clVsp.js) 23.51KB 6.90KB
plugin-kanban (index.js) 0.18KB 0.15KB
plugin-markdown (MarkdownImpl-Dp8rFxgw.js) 256.79KB 64.50KB
plugin-markdown (index-DDihmVdn.js) 21.25KB 6.37KB
plugin-markdown (index.js) 0.19KB 0.15KB
react (SchemaRenderer.js) 1.44KB 0.73KB
react (index.js) 0.32KB 0.23KB
react (index.test.js) 0.34KB 0.26KB
types (api-types.js) 0.20KB 0.18KB
types (app.js) 0.20KB 0.18KB
types (base.js) 0.20KB 0.18KB
types (complex.js) 0.20KB 0.18KB
types (crud.js) 0.20KB 0.18KB
types (data-display.js) 0.20KB 0.18KB
types (data.js) 0.20KB 0.18KB
types (disclosure.js) 0.20KB 0.18KB
types (feedback.js) 0.20KB 0.18KB
types (form.js) 0.20KB 0.18KB
types (index.js) 0.34KB 0.25KB
types (layout.js) 0.20KB 0.18KB
types (navigation.js) 0.20KB 0.18KB
types (objectql.js) 0.20KB 0.18KB
types (overlay.js) 0.20KB 0.18KB
types (registry.js) 0.20KB 0.18KB

Size Limits

  • ✅ Core packages should be < 50KB gzipped
  • ✅ Component packages should be < 100KB gzipped
  • ⚠️ Plugin packages should be < 150KB gzipped

@github-actions
Copy link

✅ All checks passed!

  • ✅ Type check passed
  • ✅ Tests passed
  • ✅ Lint check completed

@huangyiirene huangyiirene marked this pull request as ready for review January 20, 2026 03:54
@huangyiirene huangyiirene merged commit afb0341 into main Jan 20, 2026
11 of 12 checks passed
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.

3 participants