Skip to content

feat (docs): revamp -> swap to fumadoc#759

Merged
AviPeltz merged 3 commits intomainfrom
doc
Jan 14, 2026
Merged

feat (docs): revamp -> swap to fumadoc#759
AviPeltz merged 3 commits intomainfrom
doc

Conversation

@AviPeltz
Copy link
Copy Markdown
Collaborator

@AviPeltz AviPeltz commented Jan 14, 2026

Description

Related Issues

Type of Change

  • Bug fix
  • New feature
  • Documentation
  • Refactor
  • Other (please describe):

Testing

Screenshots (if applicable)

Additional Notes

Summary by CodeRabbit

Release Notes

  • New Features

    • Added comprehensive documentation pages including Quick Start, Installation, Overview, and Core Features guides
    • Implemented search functionality for documentation
  • Documentation

    • Restructured and expanded documentation with improved navigation and organization

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 14, 2026

📝 Walkthrough

Walkthrough

This PR migrates the docs app from Nextra to FUMAdocs framework. It removes legacy UI components and animations, replaces Next.js configuration, updates dependencies, introduces new MDX documentation pages, and refactors layout and routing to work with the new documentation system.

Changes

Cohort / File(s) Summary
Framework Migration
apps/docs/package.json, apps/docs/next.config.mjs, apps/docs/next.config.ts, apps/docs/tsconfig.json
Migrates from Nextra and three.js to FUMAdocs. Removes nextra, @react-three/fiber, @react-three/drei, framer-motion, and related deps. Adds fumadocs-core, fumadocs-mdx, fumadocs-ui, lucide-react, tailwind-merge. Replaces old .ts config with .mjs version featuring MDX wiring, Sentry integration, and redirects. Updates tsconfig with fumadocs path aliases.
Documentation Content
apps/docs/content/docs/meta.json, apps/docs/content/docs/{quick-start,overview,installation,core-features,guides}.mdx
Adds 5 new MDX documentation pages covering Quick Start, Overview, Installation, Core Features, and Guides. Introduces meta.json defining documentation navigation structure with sections for Getting Started, Core Features, and How to Guides.
Root & Docs Layout
apps/docs/src/app/layout.tsx, apps/docs/src/app/docs/layout.tsx, apps/docs/src/app/docs/[[...slug]]/page.tsx
Simplifies root layout from async Nextra-based wrapper to lightweight provider pattern with Inter font. Adds new docs layout wrapping DocsLayout component. Introduces dynamic docs page routing with metadata generation and static parameter generation via source provider.
API Routes & OG Images
apps/docs/src/app/api/search/route.ts, apps/docs/src/app/llms.mdx/docs/[[...slug]]/route.ts, apps/docs/src/app/llms-full.txt/route.ts, apps/docs/src/app/og/docs/[...slug]/route.tsx
Adds search API route using fumadocs-core, two LLM text endpoints for AI integration, and Open Graph image generation route for social sharing. All routes wire through new source provider.
Removed UI Components
apps/docs/src/components/{Footer,Header}.tsx, apps/docs/src/components/motion/{FadeUp,HeroParallax,TiltCard}.tsx, apps/docs/src/components/three/HeroCanvas.tsx, apps/docs/src/components/motion/index.ts, apps/docs/src/components/three/index.ts
Removes legacy animated hero components (parallax, tilt, fade), header/footer navigation, and three.js canvas. Cleans up motion and three component barrel exports.
New Documentation Utilities
apps/docs/src/lib/source.ts, apps/docs/src/lib/layout.shared.tsx, apps/docs/src/mdx-components.tsx, apps/docs/src/components/docs/DownloadButton.tsx, apps/docs/src/components/ai/page-actions.tsx
Adds fumadocs source loader with page tree, image, and LLM text helpers. Introduces shared layout options with logo/title. Creates MDX component mapper and AI-related actions (clipboard copy, multi-AI viewer links) with LLM prompt construction.
Configuration & Styling
apps/docs/.gitignore, apps/docs/README.md, apps/docs/postcss.config.mjs, apps/docs/source.config.ts, apps/docs/src/app/{global,global}.css, apps/docs/tsconfig.json, cli.json
Updates .gitignore sections (deps/test/build/others), rewrites README for FUMAdocs focus, simplifies postcss config, adds new fumadocs source config, refactors global CSS removing Geist fonts and @superset/ui, adds postcss as dev dep, introduces fumadocs CLI config.
Removed Pages & Providers
apps/docs/src/app/{getting-started,page}.mdx, apps/docs/src/app/providers.tsx, apps/docs/mdx-components.tsx, apps/docs/src/env.ts, apps/docs/src/instrumentation-client.ts
Removes old Getting Started and home pages. Deletes PostHogProvider wrapper (now optional in env). Removes old nextra-delegating mdx-components export. Makes PostHog env vars optional. Adds guard for PostHog initialization.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐰 FUMAdocs came to town, replaced the Nextra frame,
Three.js heroes faded out, new docs took the name,
Cleaned the clutter, swept away old motion's gleam,
MDX pages bloom now—documentation's dream! ✨

🚥 Pre-merge checks | ❌ 3
❌ Failed checks (2 warnings, 1 inconclusive)
Check name Status Explanation Resolution
Description check ⚠️ Warning The description is incomplete, containing only the repository template with checkbox selections but lacking any substantive information about changes, implementation details, testing, or context. Complete the description with details about the Fumadocs migration, deleted legacy components, configuration changes, and testing instructions.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title refers to a real and significant aspect of the changes—replacing Nextra with Fumadocs—but uses vague and unconventional phrasing ('revamp', 'swap') without clearly stating the main objective. Clarify the title to explicitly state the primary change, such as 'refactor(docs): migrate documentation from Nextra to Fumadocs' for better clarity.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 14, 2026

🚀 Preview Deployment

🔗 Preview Links

Service Status Link
Neon Database (Neon) View Branch
Fly.io Electric (Fly.io) View App
Vercel API (Vercel) Open Preview
Vercel Web (Vercel) Open Preview
Vercel Marketing (Vercel) Open Preview
Vercel Admin (Vercel) Open Preview
Vercel Docs (Vercel) Open Preview

Preview updates automatically with new commits

@AviPeltz AviPeltz marked this pull request as ready for review January 14, 2026 22:40
@AviPeltz AviPeltz merged commit b1cc6a3 into main Jan 14, 2026
11 of 12 checks passed
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 6

🤖 Fix all issues with AI agents
In `@apps/docs/next.config.mjs`:
- Around line 31-43: The rewrite ordering causes the wildcard rule
"/ingest/:path*" to shadow the specific "/ingest/decide" rule; fix by reordering
the array of rewrite objects so the specific route object with source
"/ingest/decide" and destination "https://us.i.posthog.com/decide" appears
before the wildcard object with source "/ingest/:path*" (leave the
"/ingest/static/:path*" mapping as appropriate).
- Around line 25-29: Update the MDX rewrite object so its destination removes
the extra "/docs/" segment: leave source as "/docs/:path*.mdx" and change
destination from "/llms.mdx/docs/:path*" to "/llms.mdx/:path*" so the route
handler that serves LLM MDX content can match correctly.

In `@apps/docs/src/app/docs/layout.tsx`:
- Around line 1-5: The file uses the LayoutProps generic in the Layout signature
but doesn't import it, causing a TS build error; add an import for the type
(e.g. add "import type { LayoutProps } from 'next';") at the top of
apps/docs/src/app/docs/layout.tsx and do the same in
apps/docs/src/app/layout.tsx, or if your project exposes LayoutProps from
fumadocs-ui, import it from "fumadocs-ui" instead (ensure you use "import type"
to avoid runtime imports).

In `@apps/docs/src/components/ai/page-actions.tsx`:
- Around line 85-90: The SSR fallback sets fullMarkdownUrl to the literal
"loading" inside the useMemo (items) which produces a malformed query; change
the logic so URL construction is deferred to client mount: detect SSR by
checking typeof window and if undefined return an empty items array (or null)
from the useMemo, or convert the memo to a client-only pattern using useState +
useEffect to build fullMarkdownUrl from markdownUrl after mount; update
references to items/fullMarkdownUrl so render paths handle the empty array/null
case until the real URL is available.

In `@cli.json`:
- Around line 1-13: The cli.json references a missing dependency and
non-existent aliased dirs; either remove cli.json if fumadocs/ `@fumadocs/cli` is
not used, or install the package and create the required directories: add
`@fumadocs/cli` to dependencies (or devDependencies) in package.json and run
npm/yarn install, then create the aliased folders referenced by the "aliases"
keys ("uiDir", "componentsDir", "blockDir", "cssDir", "libDir") with the
expected content (e.g., ./components/ui, ./components, ./styles, ./lib), and
ensure the "$schema" path resolves or update it to the installed package schema
path; pick one approach and apply it consistently so cli.json is valid.
🧹 Nitpick comments (10)
apps/docs/src/lib/cn.ts (1)

1-1: Consider combining clsx with twMerge for full cn utility behavior.

The standard cn utility (as popularized by shadcn/ui) combines clsx for conditional class handling with twMerge for Tailwind class deduplication. This implementation only re-exports twMerge, which doesn't support conditional class syntax like cn("foo", isActive && "bar").

♻️ Suggested implementation for full cn utility
-export { twMerge as cn } from "tailwind-merge";
+import { clsx, type ClassValue } from "clsx";
+import { twMerge } from "tailwind-merge";
+
+export function cn(...inputs: ClassValue[]) {
+  return twMerge(clsx(inputs));
+}

This requires adding clsx as a dependency in apps/docs/package.json.

apps/docs/src/components/docs/DownloadButton.tsx (1)

1-25: Component folder structure doesn't follow guidelines.

Per coding guidelines, components should follow the folder structure pattern: ComponentName/ComponentName.tsx with a barrel export index.ts. Consider moving to:

  • apps/docs/src/components/docs/DownloadButton/DownloadButton.tsx
  • apps/docs/src/components/docs/DownloadButton/index.ts

The implementation itself is clean with proper accessibility attributes on the SVG.

📁 Suggested folder structure

Create apps/docs/src/components/docs/DownloadButton/DownloadButton.tsx with the current content, and add a barrel export:

// apps/docs/src/components/docs/DownloadButton/index.ts
export { DownloadButton } from "./DownloadButton";
apps/docs/tsconfig.json (1)

1-36: Extend the shared TypeScript configuration for consistency.

All other Next.js apps in the monorepo extend @superset/typescript/next.json, but apps/docs/tsconfig.json does not. This creates configuration drift from peer apps (admin, marketing, web).

Extend the shared config while preserving the intentional compiler option overrides needed for the fumadocs setup:

{
  "extends": "@superset/typescript/next.json",
  "compilerOptions": {
    "target": "ESNext",
    "lib": ["dom", "dom.iterable", "esnext"],
    "jsx": "react-jsx",
    "module": "esnext",
    "moduleResolution": "bundler",
    "allowJs": true,
    "noEmit": true,
    "isolatedModules": true,
    "incremental": true,
    "baseUrl": ".",
    "paths": {
      "@/*": ["./src/*"],
      "fumadocs-mdx:collections/*": [".source/*"]
    }
  },
  "include": [
    "next-env.d.ts",
    "**/*.ts",
    "**/*.tsx",
    ".next/types/**/*.ts",
    ".next/dev/types/**/*.ts"
  ],
  "exclude": ["node_modules"]
}
apps/docs/src/lib/source.ts (1)

21-27: Consider adding error handling for getText.

If page.data.getText("processed") fails (e.g., missing processed content), this will throw an unhandled exception. Per coding guidelines, errors should not be swallowed silently—at minimum, log them with context.

🛠️ Suggested improvement
 export async function getLLMText(page: InferPageType<typeof source>) {
-	const processed = await page.data.getText("processed");
+	let processed: string;
+	try {
+		processed = await page.data.getText("processed");
+	} catch (error) {
+		console.error(`[source/getLLMText] Failed to get processed text for page: ${page.data.title}`, error);
+		processed = "";
+	}

 	return `# ${page.data.title}

 ${processed}`;
 }
apps/docs/src/app/llms-full.txt/route.ts (1)

5-9: Add Content-Type header and consider error resilience.

Two observations:

  1. The sibling route at llms.mdx/docs/[[...slug]]/route.ts sets Content-Type: text/markdown, but this route omits it. For consistency and proper client handling, consider adding the header.

  2. Promise.all will reject immediately if any single getLLMText call fails, potentially returning nothing. Consider Promise.allSettled for resilience if partial results are acceptable.

🛠️ Suggested fix with Content-Type header
 export async function GET() {
 	const scan = source.getPages().map(getLLMText);
 	const scanned = await Promise.all(scan);

-	return new Response(scanned.join("\n\n"));
+	return new Response(scanned.join("\n\n"), {
+		headers: {
+			"Content-Type": "text/plain; charset=utf-8",
+		},
+	});
 }
apps/docs/README.md (1)

16-16: Wrap the bare URL in angle brackets or use Markdown link syntax.

Static analysis (markdownlint MD034) flagged the bare URL. For proper Markdown formatting:

📝 Suggested fix
-Open http://localhost:3000 with your browser to see the result.
+Open <http://localhost:3000> with your browser to see the result.
apps/docs/src/app/og/docs/[...slug]/route.tsx (1)

8-27: Extract hardcoded site name to a constant or shared config.

The "My App" placeholder should be extracted to a named constant or shared configuration for maintainability and consistency across the app.

🛠️ Suggested improvement
+const SITE_NAME = "My App"; // TODO: Move to shared config
+
 export async function GET(
 	_req: Request,
 	{ params }: RouteContext<"/og/docs/[...slug]">,
 ) {
 	const { slug } = await params;
 	const page = source.getPage(slug.slice(0, -1));
 	if (!page) notFound();

 	return new ImageResponse(
 		<DefaultImage
 			title={page.data.title}
 			description={page.data.description}
-			site="My App"
+			site={SITE_NAME}
 		/>,
 		{
 			width: 1200,
 			height: 630,
 		},
 	);
 }
apps/docs/package.json (1)

17-19: Consider consistent version pinning strategy.

The fumadocs-* packages use exact versions (16.4.7, 14.2.5) while other dependencies use caret ranges (^). This inconsistency may lead to confusion about the versioning strategy. Consider either:

  • Using caret ranges for fumadocs packages if you want automatic minor/patch updates
  • Documenting why exact pinning is needed for fumadocs (e.g., known compatibility issues)
apps/docs/content/docs/core-features.mdx (1)

6-24: Consider differentiating or consolidating content with overview.mdx.

This page covers the same topics as overview.mdx (Workspace Management, Terminal Integration, Team Collaboration, How It Works) but with less detail. This creates content redundancy and potential maintenance burden.

Consider either:

  1. Making this page a deep-dive into each feature with more technical details
  2. Removing duplicate sections and linking to the overview instead
  3. Consolidating into a single comprehensive page
apps/docs/src/components/ai/page-actions.tsx (1)

21-243: Multiple exported components in a single file.

This file exports two components (LLMCopyButton and ViewOptions), which violates the coding guideline: "One component per file - do not create multi-component files."

Consider splitting into:

  • apps/docs/src/components/ai/llm-copy-button.tsx
  • apps/docs/src/components/ai/view-options.tsx

Based on learnings, kebab-case file naming should be used for components in src/components/.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 930ee10 and 0e7a885.

⛔ Files ignored due to path filters (8)
  • apps/docs/public/file.svg is excluded by !**/*.svg
  • apps/docs/public/globe.svg is excluded by !**/*.svg
  • apps/docs/public/logo-full.png is excluded by !**/*.png
  • apps/docs/public/logo.png is excluded by !**/*.png
  • apps/docs/public/next.svg is excluded by !**/*.svg
  • apps/docs/public/vercel.svg is excluded by !**/*.svg
  • apps/docs/public/window.svg is excluded by !**/*.svg
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (44)
  • apps/docs/.gitignore
  • apps/docs/README.md
  • apps/docs/content/docs/core-features.mdx
  • apps/docs/content/docs/guides.mdx
  • apps/docs/content/docs/installation.mdx
  • apps/docs/content/docs/meta.json
  • apps/docs/content/docs/overview.mdx
  • apps/docs/content/docs/quick-start.mdx
  • apps/docs/mdx-components.tsx
  • apps/docs/next.config.mjs
  • apps/docs/next.config.ts
  • apps/docs/package.json
  • apps/docs/postcss.config.mjs
  • apps/docs/source.config.ts
  • apps/docs/src/app/api/search/route.ts
  • apps/docs/src/app/docs/[[...slug]]/page.tsx
  • apps/docs/src/app/docs/layout.tsx
  • apps/docs/src/app/getting-started/page.mdx
  • apps/docs/src/app/global.css
  • apps/docs/src/app/globals.css
  • apps/docs/src/app/layout.tsx
  • apps/docs/src/app/llms-full.txt/route.ts
  • apps/docs/src/app/llms.mdx/docs/[[...slug]]/route.ts
  • apps/docs/src/app/og/docs/[...slug]/route.tsx
  • apps/docs/src/app/page.mdx
  • apps/docs/src/app/providers.tsx
  • apps/docs/src/components/Footer.tsx
  • apps/docs/src/components/Header.tsx
  • apps/docs/src/components/ai/page-actions.tsx
  • apps/docs/src/components/docs/DownloadButton.tsx
  • apps/docs/src/components/motion/FadeUp.tsx
  • apps/docs/src/components/motion/HeroParallax.tsx
  • apps/docs/src/components/motion/TiltCard.tsx
  • apps/docs/src/components/motion/index.ts
  • apps/docs/src/components/three/HeroCanvas.tsx
  • apps/docs/src/components/three/index.ts
  • apps/docs/src/env.ts
  • apps/docs/src/instrumentation-client.ts
  • apps/docs/src/lib/cn.ts
  • apps/docs/src/lib/layout.shared.tsx
  • apps/docs/src/lib/source.ts
  • apps/docs/src/mdx-components.tsx
  • apps/docs/tsconfig.json
  • cli.json
💤 Files with no reviewable changes (14)
  • apps/docs/src/components/three/index.ts
  • apps/docs/src/app/page.mdx
  • apps/docs/src/components/motion/index.ts
  • apps/docs/next.config.ts
  • apps/docs/src/app/providers.tsx
  • apps/docs/src/components/motion/TiltCard.tsx
  • apps/docs/src/components/three/HeroCanvas.tsx
  • apps/docs/src/app/getting-started/page.mdx
  • apps/docs/src/app/globals.css
  • apps/docs/src/components/Footer.tsx
  • apps/docs/src/components/motion/HeroParallax.tsx
  • apps/docs/mdx-components.tsx
  • apps/docs/src/components/Header.tsx
  • apps/docs/src/components/motion/FadeUp.tsx
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Use object parameters for functions with 2+ parameters instead of positional arguments
Functions with 2+ parameters should accept a single params object with named properties for self-documentation and extensibility
Use prefixed console logging with context pattern: [domain/operation] message
Extract magic numbers and hardcoded values to named constants at module top
Use lookup objects/maps instead of repeated if (type === ...) conditionals
Avoid using any type - maintain type safety in TypeScript code
Never swallow errors silently - at minimum log them with context
Import from concrete files directly when possible - avoid barrel file abuse that creates circular dependencies
Avoid deep nesting (4+ levels) - use early returns, extract functions, and invert conditions
Use named properties in options objects instead of boolean parameters to avoid boolean blindness

Files:

  • apps/docs/src/app/llms-full.txt/route.ts
  • apps/docs/src/app/docs/layout.tsx
  • apps/docs/src/mdx-components.tsx
  • apps/docs/src/components/ai/page-actions.tsx
  • apps/docs/src/lib/cn.ts
  • apps/docs/source.config.ts
  • apps/docs/src/app/layout.tsx
  • apps/docs/src/app/llms.mdx/docs/[[...slug]]/route.ts
  • apps/docs/src/lib/layout.shared.tsx
  • apps/docs/src/lib/source.ts
  • apps/docs/src/components/docs/DownloadButton.tsx
  • apps/docs/src/instrumentation-client.ts
  • apps/docs/src/app/og/docs/[...slug]/route.tsx
  • apps/docs/src/app/docs/[[...slug]]/page.tsx
  • apps/docs/src/app/api/search/route.ts
  • apps/docs/src/env.ts
apps/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use Drizzle ORM for all database operations - never use raw SQL

Files:

  • apps/docs/src/app/llms-full.txt/route.ts
  • apps/docs/src/app/docs/layout.tsx
  • apps/docs/src/mdx-components.tsx
  • apps/docs/src/components/ai/page-actions.tsx
  • apps/docs/src/lib/cn.ts
  • apps/docs/source.config.ts
  • apps/docs/src/app/layout.tsx
  • apps/docs/src/app/llms.mdx/docs/[[...slug]]/route.ts
  • apps/docs/src/lib/layout.shared.tsx
  • apps/docs/src/lib/source.ts
  • apps/docs/src/components/docs/DownloadButton.tsx
  • apps/docs/src/instrumentation-client.ts
  • apps/docs/src/app/og/docs/[...slug]/route.tsx
  • apps/docs/src/app/docs/[[...slug]]/page.tsx
  • apps/docs/src/app/api/search/route.ts
  • apps/docs/src/env.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use Biome for formatting and linting - run at root level with bun run lint:fix or biome check --write

Files:

  • apps/docs/src/app/llms-full.txt/route.ts
  • apps/docs/src/app/docs/layout.tsx
  • apps/docs/src/mdx-components.tsx
  • apps/docs/src/components/ai/page-actions.tsx
  • apps/docs/src/lib/cn.ts
  • apps/docs/source.config.ts
  • apps/docs/src/app/layout.tsx
  • apps/docs/src/app/llms.mdx/docs/[[...slug]]/route.ts
  • apps/docs/src/lib/layout.shared.tsx
  • apps/docs/src/lib/source.ts
  • apps/docs/src/components/docs/DownloadButton.tsx
  • apps/docs/src/instrumentation-client.ts
  • apps/docs/src/app/og/docs/[...slug]/route.tsx
  • apps/docs/src/app/docs/[[...slug]]/page.tsx
  • apps/docs/src/app/api/search/route.ts
  • apps/docs/src/env.ts
**/*.tsx

📄 CodeRabbit inference engine (AGENTS.md)

One component per file - do not create multi-component files

Files:

  • apps/docs/src/app/docs/layout.tsx
  • apps/docs/src/mdx-components.tsx
  • apps/docs/src/components/ai/page-actions.tsx
  • apps/docs/src/app/layout.tsx
  • apps/docs/src/lib/layout.shared.tsx
  • apps/docs/src/components/docs/DownloadButton.tsx
  • apps/docs/src/app/og/docs/[...slug]/route.tsx
  • apps/docs/src/app/docs/[[...slug]]/page.tsx
apps/*/src/components/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Co-locate component dependencies: utils, hooks, constants, config, tests, stories in the same folder as the component using them

Files:

  • apps/docs/src/components/ai/page-actions.tsx
  • apps/docs/src/components/docs/DownloadButton.tsx
apps/*/src/components/**/[A-Z]*.tsx

📄 CodeRabbit inference engine (AGENTS.md)

Create component folder structure with one folder per component: ComponentName/ComponentName.tsx with barrel export index.ts

Files:

  • apps/docs/src/components/docs/DownloadButton.tsx
🧠 Learnings (9)
📚 Learning: 2026-01-02T06:50:28.671Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-02T06:50:28.671Z
Learning: Applies to apps/*/src/components/**/[A-Z]*.tsx : Create component folder structure with one folder per component: ComponentName/ComponentName.tsx with barrel export index.ts

Applied to files:

  • apps/docs/src/app/docs/layout.tsx
  • apps/docs/src/mdx-components.tsx
📚 Learning: 2026-01-02T06:50:28.671Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-02T06:50:28.671Z
Learning: Applies to apps/*/src/components/**/*.{ts,tsx} : Co-locate component dependencies: utils, hooks, constants, config, tests, stories in the same folder as the component using them

Applied to files:

  • apps/docs/src/mdx-components.tsx
  • apps/docs/src/lib/source.ts
  • apps/docs/.gitignore
📚 Learning: 2026-01-02T06:50:28.671Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-02T06:50:28.671Z
Learning: Applies to apps/**/proxy.ts : Never use `middleware.ts` in Next.js 16. Use `proxy.ts` instead for request interception.

Applied to files:

  • apps/docs/next.config.mjs
  • apps/docs/src/app/llms.mdx/docs/[[...slug]]/route.ts
📚 Learning: 2026-01-02T06:50:28.671Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-02T06:50:28.671Z
Learning: Applies to apps/*/src/components/{ui,ai-elements,react-flow}/*.tsx : Use kebab-case single files for shadcn/ui components (e.g., button.tsx, base-node.tsx) in src/components/ui/, src/components/ai-elements, and src/components/react-flow/

Applied to files:

  • apps/docs/src/components/ai/page-actions.tsx
  • apps/docs/src/app/layout.tsx
  • apps/docs/src/components/docs/DownloadButton.tsx
📚 Learning: 2025-12-21T04:39:28.543Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: apps/desktop/AGENTS.md:0-0
Timestamp: 2025-12-21T04:39:28.543Z
Learning: Applies to apps/desktop/**/*.{ts,tsx} : Use alias as defined in `tsconfig.json` when possible

Applied to files:

  • apps/docs/src/lib/cn.ts
  • apps/docs/tsconfig.json
📚 Learning: 2026-01-02T06:50:28.671Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-02T06:50:28.671Z
Learning: Applies to **/*.{ts,tsx} : Use named properties in options objects instead of boolean parameters to avoid boolean blindness

Applied to files:

  • apps/docs/tsconfig.json
📚 Learning: 2026-01-02T06:50:28.671Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-02T06:50:28.671Z
Learning: Applies to **/*.{ts,tsx} : Extract magic numbers and hardcoded values to named constants at module top

Applied to files:

  • apps/docs/tsconfig.json
📚 Learning: 2026-01-02T06:50:28.671Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-02T06:50:28.671Z
Learning: Applies to apps/desktop/src/renderer/**/*.{ts,tsx} : Never import Node.js modules (fs, path, os, net) in renderer process or shared code - they are externalized for browser compatibility

Applied to files:

  • apps/docs/tsconfig.json
  • apps/docs/src/lib/source.ts
📚 Learning: 2026-01-02T06:50:28.671Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-02T06:50:28.671Z
Learning: Applies to **/*.test.{ts,tsx} : Co-locate tests with implementation files using .test.ts or .test.tsx suffix

Applied to files:

  • apps/docs/tsconfig.json
🧬 Code graph analysis (10)
apps/docs/src/app/llms-full.txt/route.ts (2)
apps/docs/src/app/llms.mdx/docs/[[...slug]]/route.ts (1)
  • GET (6-19)
apps/docs/src/lib/source.ts (2)
  • source (6-10)
  • getLLMText (21-27)
apps/docs/src/app/docs/layout.tsx (3)
apps/docs/src/app/layout.tsx (1)
  • Layout (9-17)
apps/docs/src/lib/source.ts (1)
  • source (6-10)
apps/docs/src/lib/layout.shared.tsx (1)
  • baseOptions (4-15)
apps/docs/src/components/ai/page-actions.tsx (2)
packages/ui/src/lib/utils.ts (1)
  • cn (4-6)
packages/ui/src/components/ui/button.tsx (1)
  • buttonVariants (60-60)
apps/docs/src/app/layout.tsx (1)
apps/docs/src/app/docs/layout.tsx (1)
  • Layout (5-11)
apps/docs/src/app/llms.mdx/docs/[[...slug]]/route.ts (4)
apps/docs/src/app/llms-full.txt/route.ts (2)
  • revalidate (3-3)
  • GET (5-10)
apps/docs/src/app/og/docs/[...slug]/route.tsx (3)
  • revalidate (6-6)
  • GET (8-27)
  • generateStaticParams (29-34)
apps/docs/src/lib/source.ts (2)
  • source (6-10)
  • getLLMText (21-27)
apps/docs/src/app/docs/[[...slug]]/page.tsx (1)
  • generateStaticParams (30-32)
apps/docs/src/lib/source.ts (1)
apps/docs/source.config.ts (1)
  • docs (10-21)
apps/docs/src/components/docs/DownloadButton.tsx (1)
packages/shared/src/constants.ts (1)
  • DOWNLOAD_URL_MAC_ARM64 (30-30)
apps/docs/src/instrumentation-client.ts (7)
apps/docs/src/env.ts (1)
  • env (5-36)
apps/admin/src/env.ts (1)
  • env (5-45)
apps/api/src/env.ts (1)
  • env (4-48)
apps/marketing/src/env.ts (1)
  • env (5-37)
apps/web/src/env.ts (1)
  • env (5-47)
apps/desktop/src/renderer/lib/posthog.ts (1)
  • posthog (6-6)
packages/shared/src/constants.ts (1)
  • POSTHOG_COOKIE_NAME (43-43)
apps/docs/src/app/docs/[[...slug]]/page.tsx (4)
apps/docs/src/lib/source.ts (2)
  • source (6-10)
  • getPageImage (12-19)
apps/docs/src/mdx-components.tsx (1)
  • getMDXComponents (5-11)
apps/docs/src/app/llms.mdx/docs/[[...slug]]/route.ts (1)
  • generateStaticParams (21-23)
apps/docs/src/app/og/docs/[...slug]/route.tsx (1)
  • generateStaticParams (29-34)
apps/docs/src/app/api/search/route.ts (1)
apps/docs/src/lib/source.ts (1)
  • source (6-10)
🪛 markdownlint-cli2 (0.18.1)
apps/docs/README.md

16-16: Bare URL used

(MD034, no-bare-urls)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: Deploy Admin
  • GitHub Check: Deploy Web
  • GitHub Check: Deploy API
  • GitHub Check: Deploy Marketing
  • GitHub Check: Deploy Docs
  • GitHub Check: Build
🔇 Additional comments (30)
apps/docs/.gitignore (1)

1-26: LGTM! Clean organization and appropriate ignore patterns.

The restructured .gitignore is well-organized with clear sections and properly ignores all necessary artifacts:

  • New .source entry appropriately handles fumadocs generated content
  • Consolidated "# test & build" section groups related artifacts logically
  • The .env*.local pattern follows Next.js best practices (ignoring local overrides while allowing base config to be committed)
  • All standard Next.js build artifacts are properly covered
apps/docs/src/env.ts (1)

17-24: LGTM! Optional PostHog configuration for docs app.

Making NEXT_PUBLIC_POSTHOG_KEY and NEXT_PUBLIC_POSTHOG_HOST optional is appropriate for a documentation site that may be deployed without analytics. This correctly aligns with the guarded initialization in instrumentation-client.ts.

Note: This intentionally diverges from other apps (web, marketing, admin) where these fields are required. This allows the docs app to run standalone without PostHog configuration.

apps/docs/src/instrumentation-client.ts (2)

7-26: LGTM! Proper guard for optional PostHog initialization.

The conditional initialization correctly prevents PostHog from being called when the key is not configured, aligning with the optional schema in env.ts. This ensures the docs app can run without analytics dependencies.


11-11: The defaults: "2025-11-30" is a valid PostHog configuration option. PostHog JS recognizes date strings in this format to enable specific breaking-change defaults—in this case, behaviors introduced on 2025-11-30 including session recording and rageclick defaults. No changes needed.

apps/docs/src/app/global.css (1)

1-26: LGTM!

The global CSS correctly imports Tailwind and FUMAdocs styles. The sidebar customizations are well-commented and use appropriate selectors for the fumadocs-ui structure.

apps/docs/src/mdx-components.tsx (1)

1-11: LGTM!

Clean implementation of the MDX components mapper for FUMAdocs. The spread order correctly prioritizes: default components → custom components → user overrides. Type safety is maintained with the MDXComponents type.

apps/docs/postcss.config.mjs (1)

1-5: LGTM!

Correct PostCSS configuration for Tailwind CSS v4 using the @tailwindcss/postcss plugin.

apps/docs/src/lib/layout.shared.tsx (1)

1-15: LGTM!

Clean, focused helper function that properly configures the navigation title with logo and branding. Good use of the fumadocs-ui types and Next.js Image component with explicit dimensions.

apps/docs/source.config.ts (1)

1-27: LGTM!

Clean fumadocs-mdx configuration with proper schema setup and content directory configuration. The empty mdxOptions serves as a good placeholder for future MDX customizations.

apps/docs/src/app/layout.tsx (2)

10-17: Layout structure looks good.

The HTML structure with suppressHydrationWarning is appropriate for theme providers that may cause hydration mismatches. The flex column layout provides a solid foundation for the docs pages.


1-9: No changes needed. LayoutProps is a built-in Next.js route-aware type helper that is automatically generated during build/typegen and globally available without importing. The code is correct as written.

Likely an incorrect or invalid review comment.

apps/docs/src/lib/source.ts (2)

5-10: LGTM!

The source loader configuration follows fumadocs conventions correctly. The baseUrl, source adapter, and lucide icons plugin are properly wired.


12-19: LGTM!

Clean helper that constructs both the segments array and the OG image URL. The spread operator preserves immutability of the original slugs.

apps/docs/README.md (1)

1-45: LGTM!

The README is well-structured and provides clear guidance for the fumadocs setup, including the project structure, routes table, and external resources.

apps/docs/src/app/llms.mdx/docs/[[...slug]]/route.ts (3)

6-19: LGTM!

Clean route handler implementation with proper:

  • 404 handling via notFound()
  • Content-Type header for markdown
  • Async params handling for Next.js 15+

21-23: LGTM!

Static params generation is correctly delegated to the source, enabling proper static site generation for all doc pages.


8-8: No action needed. RouteContext is a global type generated by Next.js during the build process (next typegen, next build, or next dev) and does not require an import. The code correctly uses it as a global type, which is the intended pattern for Next.js 16+ route handlers with dynamic segments.

apps/docs/src/app/og/docs/[...slug]/route.tsx (1)

29-34: Remove the unused lang property from generateStaticParams output.

The route pattern /og/docs/[...slug] has no [lang] dynamic segment. The returned lang property will be ignored by Next.js during static generation and indicates a copy-paste error from a different route. Change the return value to { slug: getPageImage(page).segments } only.

apps/docs/package.json (1)

1-38: Migration changes look appropriate.

The dependency swap from Nextra/three.js stack to FUMAdocs ecosystem is clean. Build scripts are properly updated for the fumadocs-mdx workflow, and the postinstall hook ensures MDX generation happens after installation.

apps/docs/content/docs/guides.mdx (1)

1-10: LGTM!

Placeholder page for future guides is appropriately structured with valid front matter.

apps/docs/src/app/docs/layout.tsx (1)

6-10: Layout structure follows fumadocs conventions.

The DocsLayout wrapper with page tree and base options spread is the correct pattern for fumadocs documentation layouts.

apps/docs/content/docs/installation.mdx (1)

1-29: LGTM!

Well-structured installation documentation with clear sections for different platforms and build options. The DownloadButton component usage is consistent with other docs pages.

apps/docs/content/docs/quick-start.mdx (1)

19-22: Missing closing </Cards> tag.

The <Cards> component is opened on line 19 but there's no closing tag at the end of the file. This will cause a JSX parsing error.

🐛 Proposed fix
 <Cards>
 	<Card title="Overview" href="/docs/overview" />
 	<Card title="Installation" href="/docs/installation" />
+</Cards>

Likely an incorrect or invalid review comment.

apps/docs/content/docs/meta.json (1)

1-13: LGTM!

The navigation structure is well-organized with clear section separators and properly references the MDX pages added in this PR.

apps/docs/content/docs/overview.mdx (1)

1-59: LGTM!

Well-structured overview page with clear sections covering features, architecture, and tech stack. The front matter is properly formatted for FUMAdocs.

apps/docs/src/app/api/search/route.ts (1)

1-7: LGTM!

Clean implementation following fumadocs patterns. The language configuration is properly documented with reference to Orama's supported languages.

apps/docs/src/app/docs/[[...slug]]/page.tsx (3)

19-27: LGTM!

The DocsPage rendering with MDX body, title, description, and table of contents follows fumadocs patterns correctly.


30-48: LGTM!

Static params generation and metadata configuration are well-implemented. The OpenGraph image integration using getPageImage aligns with the source utility pattern used elsewhere in the codebase.


12-12: No action needed — PageProps is a Next.js global type helper.

PageProps is automatically generated by Next.js (v16+) during build/dev/typegen and is globally available without import. No import is required or should be added.

Likely an incorrect or invalid review comment.

apps/docs/src/components/ai/page-actions.tsx (1)

226-240: LGTM for external link handling.

Good security practices applied: rel="noreferrer noopener" and target="_blank" are correctly set for all external links.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Comment thread apps/docs/next.config.mjs
Comment on lines +25 to +29
// Fumadocs MDX rewrites
{
source: "/docs/:path*.mdx",
destination: "/llms.mdx/docs/:path*",
},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

fumadocs llms.txt LLM text configuration nextjs rewrite

💡 Result:

Yes — Fumadocs already includes patterns for producing an LLM-friendly llms.txt (and per-page .mdx endpoints) and shows how to wire Next.js rewrites to expose them.

Quick steps (minimal):

  1. Create a getLLMText helper that returns page content (uses page.data.getText('processed')). See Fumadocs example. [1]

  2. Expose a site-wide llms file route (cached, returns joined pages) — e.g. app/llms-full.txt/route.ts that collects source.getPages().map(getLLMText) and returns a Response. This produces /llms-full.txt for AI crawlers. [1]

  3. Expose per-page Markdown via a dynamic route (app/llms.mdx/[[...slug]]/route.ts) that returns getLLMText(page) with Content-Type: text/markdown and generateStaticParams. [1]

  4. Add Next.js rewrites so clean URLs map to those handlers. Example next.config.ts rewrites:

    • map /docs/:path*.mdx -> /llms.mdx/:path* (so requests for /docs/whatever.mdx hit your mdx route)
    • if you serve llms.txt from an API route, add rewrite /llms.txt -> /api/llms.txt; alternatively write static public/llms.txt. [1][2][3]

Example rewrite snippet:
async rewrites() {
return [
{ source: '/docs/:path*.mdx', destination: '/llms.mdx/:path*' },
{ source: '/llms.txt', destination: '/api/llms.txt' }, // or public/llms.txt
];
}
(place in next.config.ts). [1][3]

  1. (Optional) Use Accept header negotiation / a proxy to serve Markdown to AI agents (fumadocs-core/negotiation helper + proxy middleware). [1]

References:

  • Fumadocs AI & LLM docs (getLLMText, llms-full.txt, llms.mdx, rewrites, Accept negotiation). [1]
  • Guidance on exposing llms.txt in Next.js (API route vs public file + rewrite example). [3]

If you want, I can: generate the exact route files + getLLMText code for your Fumadocs project (Next.js App Router) or produce a ready-to-drop next.config.ts — which would you prefer?


Fix the MDX rewrite destination path to match fumadocs' recommended pattern.

The destination /llms.mdx/docs/:path* includes an extra /docs/ segment. According to fumadocs documentation, this rewrite should map to /llms.mdx/:path* instead, so the route handler at app/llms.mdx/[[...slug]]/route.ts can properly serve the LLM text content.

{
  source: "/docs/:path*.mdx",
  destination: "/llms.mdx/:path*",
},
🤖 Prompt for AI Agents
In `@apps/docs/next.config.mjs` around lines 25 - 29, Update the MDX rewrite
object so its destination removes the extra "/docs/" segment: leave source as
"/docs/:path*.mdx" and change destination from "/llms.mdx/docs/:path*" to
"/llms.mdx/:path*" so the route handler that serves LLM MDX content can match
correctly.

Comment thread apps/docs/next.config.mjs
Comment on lines +31 to +43
{
source: "/ingest/static/:path*",
destination: "https://us-assets.i.posthog.com/static/:path*",
},
{
source: "/ingest/:path*",
destination: "https://us.i.posthog.com/:path*",
},
{
source: "/ingest/decide",
destination: "https://us.i.posthog.com/decide",
},
];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Rewrite ordering may cause /ingest/decide to be unreachable.

The /ingest/:path* rewrite on line 36 will match /ingest/decide before the more specific rule on line 40 is evaluated. Next.js rewrites are processed in order, and the first match wins.

Consider reordering to place more specific routes first:

♻️ Suggested reorder
 			// PostHog rewrites
 			{
 				source: "/ingest/static/:path*",
 				destination: "https://us-assets.i.posthog.com/static/:path*",
 			},
+			{
+				source: "/ingest/decide",
+				destination: "https://us.i.posthog.com/decide",
+			},
 			{
 				source: "/ingest/:path*",
 				destination: "https://us.i.posthog.com/:path*",
 			},
-			{
-				source: "/ingest/decide",
-				destination: "https://us.i.posthog.com/decide",
-			},
🤖 Prompt for AI Agents
In `@apps/docs/next.config.mjs` around lines 31 - 43, The rewrite ordering causes
the wildcard rule "/ingest/:path*" to shadow the specific "/ingest/decide" rule;
fix by reordering the array of rewrite objects so the specific route object with
source "/ingest/decide" and destination "https://us.i.posthog.com/decide"
appears before the wildcard object with source "/ingest/:path*" (leave the
"/ingest/static/:path*" mapping as appropriate).

Comment on lines +1 to +5
import { DocsLayout } from "fumadocs-ui/layouts/docs";
import { baseOptions } from "@/lib/layout.shared";
import { source } from "@/lib/source";

export default function Layout({ children }: LayoutProps<"/docs">) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check if the file exists and view its contents
if [ -f "apps/docs/src/app/docs/layout.tsx" ]; then
  echo "=== File exists, showing content ==="
  cat -n "apps/docs/src/app/docs/layout.tsx"
else
  echo "File not found"
fi

Repository: superset-sh/superset

Length of output: 500


🏁 Script executed:

#!/bin/bash
# Search for LayoutProps in the codebase
echo "=== Searching for LayoutProps definitions ==="
rg -n "LayoutProps" --type ts --type tsx

Repository: superset-sh/superset

Length of output: 154


🏁 Script executed:

#!/bin/bash
# Check for fumadocs-ui package.json or exports
echo "=== Checking fumadocs-ui in node_modules or package info ==="
find . -path "*/node_modules/fumadocs-ui*" -name "package.json" -o -path "*/node_modules/fumadocs-ui*" -name "*.d.ts" | head -20

Repository: superset-sh/superset

Length of output: 124


🏁 Script executed:

#!/bin/bash
# Search for LayoutProps without file type restrictions
echo "=== Searching for LayoutProps ==="
rg "LayoutProps" | head -20

Repository: superset-sh/superset

Length of output: 946


🏁 Script executed:

#!/bin/bash
# Check other layout files for comparison
echo "=== Finding layout files ==="
find apps/docs -name "layout.tsx" -o -name "layout.ts"

Repository: superset-sh/superset

Length of output: 155


🏁 Script executed:

#!/bin/bash
# Check one of the root/parent layout files to see how they handle LayoutProps
if [ -f "apps/docs/src/app/layout.tsx" ]; then
  echo "=== Root layout.tsx content ==="
  cat -n "apps/docs/src/app/layout.tsx"
fi

Repository: superset-sh/superset

Length of output: 653


🏁 Script executed:

#!/bin/bash
# Check package.json for fumadocs-ui dependency
echo "=== Checking package.json for fumadocs-ui ==="
rg "fumadocs-ui" package.json --type json

Repository: superset-sh/superset

Length of output: 109


🏁 Script executed:

#!/bin/bash
# Check layout.shared.tsx
echo "=== layout.shared.tsx content ==="
cat -n "apps/docs/src/lib/layout.shared.tsx"

Repository: superset-sh/superset

Length of output: 578


🏁 Script executed:

#!/bin/bash
# Check tsconfig in apps/docs
echo "=== tsconfig.json in apps/docs ==="
if [ -f "apps/docs/tsconfig.json" ]; then
  cat "apps/docs/tsconfig.json"
fi

Repository: superset-sh/superset

Length of output: 800


🏁 Script executed:

#!/bin/bash
# Check for global type definitions
echo "=== Looking for .d.ts files in apps/docs ==="
find apps/docs -name "*.d.ts"

Repository: superset-sh/superset

Length of output: 108


🏁 Script executed:

#!/bin/bash
# Check if there's a global.d.ts or types folder
echo "=== Checking types/global files ==="
find apps/docs -type f \( -name "global.d.ts" -o -path "*/types/*" \)

Repository: superset-sh/superset

Length of output: 99


🏁 Script executed:

#!/bin/bash
# Check the fumadocs-ui imports used elsewhere and search for LayoutProps in node_modules if available
echo "=== Search for all fumadocs-ui imports ==="
rg "from ['\"]fumadocs-ui" apps/docs | head -20

Repository: superset-sh/superset

Length of output: 972


🏁 Script executed:

#!/bin/bash
# Try to understand what fumadocs-ui exports by checking if there's documentation or example usage
echo "=== Check if there are any example or test files using fumadocs ==="
find apps/docs -type f \( -name "*.tsx" -o -name "*.ts" \) -exec grep -l "fumadocs-ui" {} \;

Repository: superset-sh/superset

Length of output: 398


🏁 Script executed:

#!/bin/bash
# Check if maybe LayoutProps is defined in next.js app router types
echo "=== Checking for React or Next.js layout type patterns ==="
rg "type.*LayoutProps|interface.*LayoutProps" --type ts --type tsx

Repository: superset-sh/superset

Length of output: 167


🏁 Script executed:

#!/bin/bash
# Search for LayoutProps without file type filters
echo "=== Direct search for LayoutProps definition ==="
rg "LayoutProps" -i

Repository: superset-sh/superset

Length of output: 961


🏁 Script executed:

#!/bin/bash
# Check if the build actually works - look for build outputs or CI config
echo "=== Checking for build scripts or CI config ==="
cat package.json 2>/dev/null | jq '.scripts' | head -20

Repository: superset-sh/superset

Length of output: 973


🏁 Script executed:

#!/bin/bash
# Check apps/docs package.json specifically
if [ -f "apps/docs/package.json" ]; then
  echo "=== apps/docs/package.json ==="
  cat "apps/docs/package.json"
fi

Repository: superset-sh/superset

Length of output: 1076


Missing LayoutProps type import will cause TypeScript compilation error.

The LayoutProps type is used on line 5 but is not imported. With TypeScript strict mode enabled in tsconfig.json, this will prevent the project from building.

Proposed fix
 import { DocsLayout } from "fumadocs-ui/layouts/docs";
+import type { LayoutProps } from "fumadocs-ui/layouts/shared";
 import { baseOptions } from "@/lib/layout.shared";
 import { source } from "@/lib/source";

Alternatively, if LayoutProps is not available from fumadocs-ui:

 import { DocsLayout } from "fumadocs-ui/layouts/docs";
+import type { ReactNode } from "react";
 import { baseOptions } from "@/lib/layout.shared";
 import { source } from "@/lib/source";

-export default function Layout({ children }: LayoutProps<"/docs">) {
+export default function Layout({ children }: { children: ReactNode }) {

Note: The same issue exists in apps/docs/src/app/layout.tsx.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import { DocsLayout } from "fumadocs-ui/layouts/docs";
import { baseOptions } from "@/lib/layout.shared";
import { source } from "@/lib/source";
export default function Layout({ children }: LayoutProps<"/docs">) {
import type { LayoutProps } from "fumadocs-ui/layouts/shared";
import { DocsLayout } from "fumadocs-ui/layouts/docs";
import { baseOptions } from "@/lib/layout.shared";
import { source } from "@/lib/source";
export default function Layout({ children }: LayoutProps<"/docs">) {
🤖 Prompt for AI Agents
In `@apps/docs/src/app/docs/layout.tsx` around lines 1 - 5, The file uses the
LayoutProps generic in the Layout signature but doesn't import it, causing a TS
build error; add an import for the type (e.g. add "import type { LayoutProps }
from 'next';") at the top of apps/docs/src/app/docs/layout.tsx and do the same
in apps/docs/src/app/layout.tsx, or if your project exposes LayoutProps from
fumadocs-ui, import it from "fumadocs-ui" instead (ensure you use "import type"
to avoid runtime imports).

Comment on lines +36 to +49
try {
await navigator.clipboard.write([
new ClipboardItem({
"text/plain": fetch(markdownUrl).then(async (res) => {
const content = await res.text();
cache.set(markdownUrl, content);

return content;
}),
}),
]);
} finally {
setLoading(false);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Missing error handling for fetch failures.

The fetch operation lacks proper error handling:

  1. No check for res.ok - error responses (404, 500) will be cached and copied as content
  2. Errors are silently swallowed in the finally block without logging, violating the guideline to "never swallow errors silently"
🔧 Suggested fix with error handling
 		try {
-			await navigator.clipboard.write([
-				new ClipboardItem({
-					"text/plain": fetch(markdownUrl).then(async (res) => {
-						const content = await res.text();
-						cache.set(markdownUrl, content);
-
-						return content;
-					}),
-				}),
-			]);
+			const res = await fetch(markdownUrl);
+			if (!res.ok) {
+				console.error("[LLMCopyButton] Failed to fetch markdown:", res.status, res.statusText);
+				return;
+			}
+			const content = await res.text();
+			cache.set(markdownUrl, content);
+			await navigator.clipboard.writeText(content);
+		} catch (error) {
+			console.error("[LLMCopyButton] Clipboard write failed:", error);
 		} finally {
 			setLoading(false);
 		}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
try {
await navigator.clipboard.write([
new ClipboardItem({
"text/plain": fetch(markdownUrl).then(async (res) => {
const content = await res.text();
cache.set(markdownUrl, content);
return content;
}),
}),
]);
} finally {
setLoading(false);
}
try {
const res = await fetch(markdownUrl);
if (!res.ok) {
console.error("[LLMCopyButton] Failed to fetch markdown:", res.status, res.statusText);
return;
}
const content = await res.text();
cache.set(markdownUrl, content);
await navigator.clipboard.writeText(content);
} catch (error) {
console.error("[LLMCopyButton] Clipboard write failed:", error);
} finally {
setLoading(false);
}

Comment on lines +85 to +90
const items = useMemo(() => {
const fullMarkdownUrl =
typeof window !== "undefined"
? new URL(markdownUrl, window.location.origin)
: "loading";
const q = `Read ${fullMarkdownUrl}, I want to ask questions about it.`;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

SSR fallback produces an invalid URL.

When window is undefined during SSR/hydration, fullMarkdownUrl becomes the literal string "loading", resulting in a malformed query: "Read loading, I want to ask questions about it.".

While this is a client component and the popover content likely only renders client-side, consider using a more defensive approach or deferring URL construction until the component mounts.

🔧 Suggested fix
 	const items = useMemo(() => {
-		const fullMarkdownUrl =
-			typeof window !== "undefined"
-				? new URL(markdownUrl, window.location.origin)
-				: "loading";
+		if (typeof window === "undefined") return [];
+		const fullMarkdownUrl = new URL(markdownUrl, window.location.origin);
 		const q = `Read ${fullMarkdownUrl}, I want to ask questions about it.`;

Then handle the empty array case in the render, or use a useEffect to set items after mount.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const items = useMemo(() => {
const fullMarkdownUrl =
typeof window !== "undefined"
? new URL(markdownUrl, window.location.origin)
: "loading";
const q = `Read ${fullMarkdownUrl}, I want to ask questions about it.`;
const items = useMemo(() => {
if (typeof window === "undefined") return [];
const fullMarkdownUrl = new URL(markdownUrl, window.location.origin);
const q = `Read ${fullMarkdownUrl}, I want to ask questions about it.`;
🤖 Prompt for AI Agents
In `@apps/docs/src/components/ai/page-actions.tsx` around lines 85 - 90, The SSR
fallback sets fullMarkdownUrl to the literal "loading" inside the useMemo
(items) which produces a malformed query; change the logic so URL construction
is deferred to client mount: detect SSR by checking typeof window and if
undefined return an empty items array (or null) from the useMemo, or convert the
memo to a client-only pattern using useState + useEffect to build
fullMarkdownUrl from markdownUrl after mount; update references to
items/fullMarkdownUrl so render paths handle the empty array/null case until the
real URL is available.

Comment thread cli.json
Comment on lines +1 to +13
{
"$schema": "node_modules/@fumadocs/cli/dist/schema/default.json",
"aliases": {
"uiDir": "./components/ui",
"componentsDir": "./components",
"blockDir": "./components",
"cssDir": "./styles",
"libDir": "./lib"
},
"baseDir": "",
"uiLibrary": "radix-ui",
"commands": {}
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify directory paths and fumadocs CLI installation

echo "=== Checking directory existence ==="
for dir in "./components/ui" "./components" "./styles" "./lib"; do
  if [ -d "$dir" ]; then
    echo "✓ Directory exists: $dir"
  else
    echo "✗ Directory missing: $dir"
  fi
done

echo ""
echo "=== Checking package.json for fumadocs CLI ==="
if [ -f "package.json" ]; then
  jq -r '.dependencies["@fumadocs/cli"] // .devDependencies["@fumadocs/cli"] // "not found"' package.json
else
  echo "package.json not found"
fi

echo ""
echo "=== Checking schema file existence ==="
if [ -f "node_modules/@fumadocs/cli/dist/schema/default.json" ]; then
  echo "✓ Schema file exists"
  head -20 node_modules/@fumadocs/cli/dist/schema/default.json
else
  echo "✗ Schema file not found"
fi

echo ""
echo "=== Verifying cli.json syntax ==="
if [ -f "cli.json" ]; then
  if jq empty cli.json 2>/dev/null; then
    echo "✓ cli.json has valid JSON syntax"
  else
    echo "✗ cli.json has invalid JSON syntax"
  fi
else
  echo "cli.json not found"
fi

Repository: superset-sh/superset

Length of output: 418


🏁 Script executed:

# Check package.json structure and dependencies
if [ -f "package.json" ]; then
  echo "=== Checking for fumadocs-related packages ==="
  jq '.dependencies, .devDependencies' package.json | grep -i fumadocs || echo "No fumadocs packages found"
  
  echo ""
  echo "=== Checking for documentation build tools ==="
  jq '.dependencies, .devDependencies' package.json | grep -iE "(docs|doc|build|cli)" | head -20
fi

echo ""
echo "=== Checking for other config files ==="
ls -la | grep -E '\.(json|yaml|yml|toml|config)$' | awk '{print $NF}'

echo ""
echo "=== Checking README or documentation ==="
if [ -f "README.md" ]; then
  echo "README.md exists"
  grep -i "fumadocs\|cli.json\|documentation\|docs" README.md | head -5 || echo "No fumadocs/cli.json references in README"
fi

Repository: superset-sh/superset

Length of output: 442


🏁 Script executed:

# Check git status and history of cli.json
if git rev-parse --git-dir > /dev/null 2>&1; then
  echo "=== Git status of cli.json ==="
  git status cli.json 2>/dev/null || echo "Not in git or file is new"
  
  echo ""
  echo "=== Recent changes to cli.json ==="
  git log --oneline -5 -- cli.json 2>/dev/null || echo "No git history"
fi

echo ""
echo "=== Check project structure ==="
find . -maxdepth 2 -type d -name "components" -o -name "styles" -o -name "lib" 2>/dev/null | head -10

Repository: superset-sh/superset

Length of output: 260


Remove cli.json or complete the fumadocs setup; configuration is broken.

The configuration file references @fumadocs/cli which is not installed (missing from package.json dependencies), and all aliased directories (./components/ui, ./components, ./styles, ./lib) don't exist in the project. The schema file cannot be resolved, making this configuration unusable. Either remove the file if fumadocs is not part of the project, or install the dependency and create the required directory structure.

🤖 Prompt for AI Agents
In `@cli.json` around lines 1 - 13, The cli.json references a missing dependency
and non-existent aliased dirs; either remove cli.json if fumadocs/ `@fumadocs/cli`
is not used, or install the package and create the required directories: add
`@fumadocs/cli` to dependencies (or devDependencies) in package.json and run
npm/yarn install, then create the aliased folders referenced by the "aliases"
keys ("uiDir", "componentsDir", "blockDir", "cssDir", "libDir") with the
expected content (e.g., ./components/ui, ./components, ./styles, ./lib), and
ensure the "$schema" path resolves or update it to the installed package schema
path; pick one approach and apply it consistently so cli.json is valid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant