CLI: Require Next.js 15.3.0 or above

This commit is contained in:
Fuma Nama
2025-04-10 18:59:22 +08:00
parent 6d1fe7c0c6
commit 7fcf612179
23 changed files with 988 additions and 889 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'fumadocs-mdx': minor
---
Require Next.js 15.3.0 or above
+14 -14
View File
@@ -15,12 +15,12 @@
"@fumadocs/mdx-remote": "workspace:*",
"@inkeep/ai-api": "^0.8.0",
"@oramacloud/client": "^2.1.4",
"@radix-ui/react-dialog": "^1.1.6",
"@radix-ui/react-hover-card": "^1.1.6",
"@radix-ui/react-popover": "^1.1.6",
"@radix-ui/react-slot": "^1.1.2",
"@radix-ui/react-tooltip": "^1.1.8",
"@shikijs/rehype": "^3.2.1",
"@radix-ui/react-dialog": "^1.1.7",
"@radix-ui/react-hover-card": "^1.1.7",
"@radix-ui/react-popover": "^1.1.7",
"@radix-ui/react-slot": "^1.2.0",
"@radix-ui/react-tooltip": "^1.2.0",
"@shikijs/rehype": "^3.2.2",
"class-variance-authority": "^0.7.1",
"fumadocs-core": "workspace:*",
"fumadocs-docgen": "workspace:^",
@@ -30,13 +30,13 @@
"fumadocs-typescript": "workspace:^",
"fumadocs-ui": "workspace:*",
"hast-util-to-jsx-runtime": "^2.3.6",
"katex": "^0.16.21",
"katex": "^0.16.22",
"lucide-react": "^0.487.0",
"mermaid": "^11.6.0",
"next": "15.2.4",
"next": "15.3.0",
"next-themes": "^0.4.6",
"octokit": "^4.1.2",
"oxc-transform": "^0.62.0",
"oxc-transform": "^0.63.0",
"phenomenon": "^1.6.0",
"react": "^19.1.0",
"react-dom": "^19.1.0",
@@ -48,22 +48,22 @@
"remark-rehype": "^11.1.2",
"remark-stringify": "^11.0.0",
"scroll-into-view-if-needed": "^3.1.0",
"shiki": "^3.2.1",
"shiki": "^3.2.2",
"tailwind-merge": "^3.2.0",
"twoslash": "^0.3.1",
"zod": "^3.24.2"
},
"devDependencies": {
"@fumadocs/cli": "workspace:*",
"@next/bundle-analyzer": "15.2.4",
"@next/env": "15.2.4",
"@next/eslint-plugin-next": "15.2.4",
"@next/bundle-analyzer": "15.3.0",
"@next/env": "15.3.0",
"@next/eslint-plugin-next": "15.3.0",
"@tailwindcss/postcss": "^4.1.3",
"@types/hast": "^3.0.4",
"@types/mdx": "^2.0.13",
"@types/node": "22.14.0",
"@types/react": "^19.1.0",
"@types/react-dom": "^19.1.1",
"@types/react-dom": "^19.1.2",
"eslint-config-custom": "workspace:*",
"fast-glob": "^3.3.3",
"gray-matter": "^4.0.3",
+2 -2
View File
@@ -11,7 +11,7 @@
"@fumadocs/content-collections": "workspace:*",
"fumadocs-core": "workspace:*",
"fumadocs-ui": "workspace:*",
"next": "^15.2.4",
"next": "^15.3.0",
"react": "19.1.0",
"react-dom": "19.1.0"
},
@@ -21,7 +21,7 @@
"@content-collections/next": "^0.2.6",
"@types/mdx": "^2.0.13",
"@types/react": "^19.1.0",
"@types/react-dom": "^19.1.1",
"@types/react-dom": "^19.1.2",
"typescript": "^5.8.3"
}
}
+2 -2
View File
@@ -13,14 +13,14 @@
"fumadocs-core": "workspace:*",
"fumadocs-mdx": "workspace:*",
"fumadocs-ui": "workspace:*",
"next": "15.2.4",
"next": "15.3.0",
"react": "19.1.0",
"react-dom": "19.1.0"
},
"devDependencies": {
"@types/mdx": "^2.0.13",
"@types/react": "^19.1.0",
"@types/react-dom": "^19.1.1",
"@types/react-dom": "^19.1.2",
"typescript": "^5.8.3"
}
}
+2 -2
View File
@@ -11,14 +11,14 @@
"fumadocs-core": "workspace:*",
"fumadocs-mdx": "workspace:*",
"fumadocs-ui": "workspace:*",
"next": "15.2.4",
"next": "15.3.0",
"react": "19.1.0",
"react-dom": "19.1.0"
},
"devDependencies": {
"@types/mdx": "^2.0.13",
"@types/react": "^19.1.0",
"@types/react-dom": "^19.1.1",
"@types/react-dom": "^19.1.2",
"algoliasearch": "4.24.0",
"typescript": "^5.8.3"
}
+4 -4
View File
@@ -10,22 +10,22 @@
"types:check": "fumadocs-mdx && tsc --noEmit"
},
"dependencies": {
"@scalar/api-client-react": "^1.2.13",
"@scalar/api-client-react": "^1.2.15",
"fumadocs-core": "workspace:*",
"fumadocs-mdx": "workspace:*",
"fumadocs-openapi": "workspace:*",
"fumadocs-ui": "workspace:*",
"next": "15.2.4",
"next": "15.3.0",
"react": "19.1.0",
"react-dom": "19.1.0",
"shiki": "^3.2.1",
"shiki": "^3.2.2",
"zod": "^3.24.2"
},
"devDependencies": {
"@tailwindcss/postcss": "^4.1.3",
"@types/mdx": "^2.0.13",
"@types/react": "^19.1.0",
"@types/react-dom": "^19.1.1",
"@types/react-dom": "^19.1.2",
"postcss": "^8.5.3",
"rimraf": "^6.0.1",
"tailwindcss": "^4.1.3",
+4 -4
View File
@@ -15,22 +15,22 @@
"fumadocs-core": "workspace:*",
"fumadocs-ui": "workspace:*",
"gray-matter": "^4.0.3",
"isbot": "^5.1.17",
"isbot": "^5.1.26",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"react-router": "^7.5.0",
"shiki": "^3.2.1"
"shiki": "^3.2.2"
},
"devDependencies": {
"@react-router/dev": "^7.5.0",
"@tailwindcss/vite": "^4.1.3",
"@types/node": "^22.14.0",
"@types/react": "^19.1.0",
"@types/react-dom": "^19.1.1",
"@types/react-dom": "^19.1.2",
"react-router-devtools": "^1.1.10",
"tailwindcss": "^4.1.3",
"typescript": "^5.8.3",
"vite": "^6.2.5",
"vite": "^6.2.6",
"vite-tsconfig-paths": "^5.1.4"
}
}
+2 -2
View File
@@ -12,14 +12,14 @@
"fast-glob": "^3.3.3",
"fumadocs-core": "workspace:*",
"fumadocs-ui": "workspace:*",
"next": "15.2.4",
"next": "15.3.0",
"react": "19.1.0",
"react-dom": "19.1.0"
},
"devDependencies": {
"@types/mdx": "^2.0.13",
"@types/react": "^19.1.0",
"@types/react-dom": "^19.1.1",
"@types/react-dom": "^19.1.2",
"typescript": "^5.8.3"
}
}
+3 -3
View File
@@ -18,16 +18,16 @@
"gray-matter": "^4.0.3",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"vinxi": "^0.5.3"
"vinxi": "^0.5.4"
},
"devDependencies": {
"@tailwindcss/vite": "^4.1.3",
"@types/react": "^19.1.0",
"@types/react-dom": "^19.1.1",
"@types/react-dom": "^19.1.2",
"@vitejs/plugin-react": "^4.3.4",
"tailwindcss": "^4.1.3",
"typescript": "^5.8.3",
"vite": "^6.2.5",
"vite": "^6.2.6",
"vite-tsconfig-paths": "^5.1.4"
}
}
+5 -5
View File
@@ -86,8 +86,8 @@
"dependencies": {
"@formatjs/intl-localematcher": "^0.6.1",
"@orama/orama": "^3.1.4",
"@shikijs/rehype": "^3.2.1",
"@shikijs/transformers": "^3.2.1",
"@shikijs/rehype": "^3.2.2",
"@shikijs/transformers": "^3.2.2",
"github-slugger": "^2.0.0",
"hast-util-to-estree": "^3.1.3",
"hast-util-to-jsx-runtime": "^2.3.6",
@@ -97,7 +97,7 @@
"remark": "^15.0.0",
"remark-gfm": "^4.0.1",
"scroll-into-view-if-needed": "^3.1.0",
"shiki": "^3.2.1",
"shiki": "^3.2.2",
"unist-util-visit": "^5.0.0"
},
"devDependencies": {
@@ -111,12 +111,12 @@
"@types/negotiator": "^0.6.3",
"@types/node": "22.14.0",
"@types/react": "^19.1.0",
"@types/react-dom": "^19.1.1",
"@types/react-dom": "^19.1.2",
"algoliasearch": "4.24.0",
"eslint-config-custom": "workspace:*",
"mdast-util-mdx-jsx": "^3.2.0",
"mdast-util-mdxjs-esm": "^2.0.1",
"next": "^15.2.4",
"next": "^15.3.0",
"react-router": "^7.5.0",
"remark-mdx": "^3.1.0",
"remark-rehype": "^11.1.2",
+6 -6
View File
@@ -18,22 +18,22 @@
"@types/mdx": "^2.0.13",
"@types/node": "22.14.0",
"@types/react": "^19.1.0",
"@types/react-dom": "^19.1.1",
"@types/react-dom": "^19.1.2",
"@vitejs/plugin-react": "^4.3.4",
"fast-glob": "^3.3.3",
"gray-matter": "^4.0.3",
"isbot": "^5.1.17",
"next": "15.2.4",
"isbot": "^5.1.26",
"next": "15.3.0",
"postcss": "^8.5.3",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"react-router": "^7.5.0",
"react-router-devtools": "^1.1.10",
"shiki": "^3.2.1",
"shiki": "^3.2.2",
"tailwindcss": "^4.1.3",
"typescript": "^5.8.3",
"vinxi": "^0.5.3",
"vite": "^6.2.5",
"vinxi": "^0.5.4",
"vite": "^6.2.6",
"vite-tsconfig-paths": "^5.1.4"
}
}
+1 -1
View File
@@ -40,7 +40,7 @@
"estree-util-to-js": "^2.0.0",
"estree-util-value-to-estree": "^3.3.3",
"npm-to-yarn": "^3.0.1",
"oxc-transform": "^0.62.0",
"oxc-transform": "^0.63.0",
"unist-util-visit": "^5.0.0",
"zod": "^3.24.2"
},
+3 -3
View File
@@ -71,16 +71,16 @@
"eslint-config-custom": "workspace:*",
"fumadocs-core": "workspace:*",
"mdast-util-mdx-jsx": "^3.2.0",
"next": "^15.2.4",
"next": "^15.3.0",
"tsconfig": "workspace:*",
"unified": "^11.0.5",
"vfile": "^6.0.3",
"webpack": "^5.99.1"
"webpack": "^5.99.5"
},
"peerDependencies": {
"@fumadocs/mdx-remote": "^1.2.0",
"fumadocs-core": "^14.0.0 || ^15.0.0",
"next": "14.x.x || 15.x.x"
"next": "^15.3.0"
},
"peerDependenciesMeta": {
"@fumadocs/mdx-remote": {
+2 -2
View File
@@ -8,7 +8,7 @@ import type { DocCollection, MetaCollection } from '@/config';
import { validate } from '@/utils/schema';
import { fileCache } from '@/map/file-cache';
import matter from 'gray-matter';
import type { RuntimeFile } from '@/runtime';
import type { AsyncRuntimeFile } from '@/runtime/types';
async function readFileWithCache(file: string): Promise<string> {
const cached = fileCache.read<string>('read-file', file);
@@ -116,7 +116,7 @@ export async function generateJS(
info: file,
data: parsed.data,
content: parsed.content,
} satisfies RuntimeFile);
} satisfies AsyncRuntimeFile);
});
return Promise.all(entries);
+13 -16
View File
@@ -41,22 +41,19 @@ export function createMDX({
return {
...nextConfig,
experimental: {
...nextConfig.experimental,
turbo: {
...nextConfig.experimental?.turbo,
rules: {
...nextConfig.experimental?.turbo?.rules,
// @ts-expect-error -- safe types
'*.{md,mdx}': {
loaders: [
{
loader: 'fumadocs-mdx/loader-mdx',
options: mdxLoaderOptions,
},
],
as: '*.js',
},
turbopack: {
...nextConfig?.turbopack,
rules: {
...nextConfig?.turbopack?.rules,
// @ts-expect-error -- safe
'*.{md,mdx}': {
loaders: [
{
loader: 'fumadocs-mdx/loader-mdx',
options: mdxLoaderOptions,
},
],
as: '*.js',
},
},
},
+1
View File
@@ -45,6 +45,7 @@ export const _runtimeAsync: RuntimeAsync = {
return {
...data,
_file: file,
content,
async load() {
const compiler = await init;
const out = await compiler.compile({
-2
View File
@@ -7,8 +7,6 @@ import { type BaseCollectionEntry } from '@/config';
import type { VirtualFile } from 'fumadocs-core/source';
import type { Runtime } from '@/runtime/types';
export type { RuntimeFile } from '@/runtime/types';
export const _runtime: Runtime = {
doc(files) {
return files.map((file) => {
+8 -2
View File
@@ -6,6 +6,11 @@ import type { LoadedConfig } from '@/utils/config';
export interface RuntimeFile {
info: FileInfo;
data: Record<string, unknown>;
}
export interface AsyncRuntimeFile {
info: FileInfo;
data: Record<string, unknown>;
content: string;
}
@@ -76,12 +81,13 @@ export interface Runtime {
type AsyncDocOut<Schema extends StandardSchemaV1> =
StandardSchemaV1.InferOutput<Schema> &
BaseCollectionEntry & {
content: string;
load: () => Promise<MarkdownProps>;
};
export interface RuntimeAsync {
doc: <C>(
files: RuntimeFile[],
files: AsyncRuntimeFile[],
collection: string,
config: LoadedConfig,
) => C extends {
@@ -93,7 +99,7 @@ export interface RuntimeAsync {
? AsyncDocOut<Schema>[]
: never;
docs: <C>(
docs: RuntimeFile[],
docs: AsyncRuntimeFile[],
metas: RuntimeFile[],
collection: string,
config: LoadedConfig,
+7 -7
View File
@@ -51,9 +51,9 @@
},
"dependencies": {
"@fumari/json-schema-to-typescript": "^1.1.3",
"@radix-ui/react-dialog": "^1.1.6",
"@radix-ui/react-select": "^2.1.6",
"@radix-ui/react-slot": "^1.1.2",
"@radix-ui/react-dialog": "^1.1.7",
"@radix-ui/react-select": "^2.1.7",
"@radix-ui/react-slot": "^1.2.0",
"@scalar/openapi-parser": "0.10.14",
"ajv-draft-04": "^1.0.0",
"class-variance-authority": "^0.7.1",
@@ -69,20 +69,20 @@
"react-hook-form": "^7.55.0",
"remark": "^15.0.1",
"remark-rehype": "^11.1.2",
"shiki": "^3.2.1",
"shiki": "^3.2.2",
"xml-js": "^1.6.11"
},
"devDependencies": {
"@scalar/api-client-react": "^1.2.13",
"@scalar/api-client-react": "^1.2.15",
"@types/js-yaml": "^4.0.9",
"@types/node": "22.14.0",
"@types/openapi-sampler": "^1.0.3",
"@types/react": "^19.1.0",
"eslint-config-custom": "workspace:*",
"next": "15.2.4",
"next": "15.3.0",
"openapi-types": "^12.1.3",
"tailwindcss": "^4.1.3",
"tsc-alias": "^1.8.13",
"tsc-alias": "^1.8.15",
"tsconfig": "workspace:*"
},
"peerDependencies": {
+3 -3
View File
@@ -40,8 +40,8 @@
"types:check": "tsc --noEmit"
},
"dependencies": {
"@radix-ui/react-popover": "^1.1.6",
"@shikijs/twoslash": "^3.2.1",
"@radix-ui/react-popover": "^1.1.7",
"@shikijs/twoslash": "^3.2.2",
"mdast-util-from-markdown": "^2.0.2",
"mdast-util-gfm": "^3.1.0",
"mdast-util-to-hast": "^13.2.0",
@@ -55,7 +55,7 @@
"@types/react": "^19.1.0",
"eslint-config-custom": "workspace:*",
"fumadocs-ui": "workspace:*",
"shiki": "^3.2.1",
"shiki": "^3.2.2",
"tsconfig": "workspace:*"
},
"peerDependencies": {
+2 -2
View File
@@ -41,7 +41,7 @@
"hast-util-to-jsx-runtime": "^2.3.6",
"remark": "^15.0.1",
"remark-rehype": "^11.1.2",
"shiki": "^3.2.1",
"shiki": "^3.2.2",
"ts-morph": "^25.0.1",
"unist-util-visit": "^5.0.0"
},
@@ -52,7 +52,7 @@
"@types/mdast": "^4.0.3",
"@types/node": "22.14.0",
"@types/react": "19.1.0",
"@types/react-dom": "19.1.1",
"@types/react-dom": "19.1.2",
"eslint-config-custom": "workspace:*",
"fumadocs-core": "workspace:*",
"fumadocs-ui": "workspace:*",
+13 -13
View File
@@ -78,15 +78,15 @@
"types:check": "tsc --noEmit"
},
"dependencies": {
"@radix-ui/react-accordion": "^1.2.3",
"@radix-ui/react-collapsible": "^1.1.3",
"@radix-ui/react-dialog": "^1.1.6",
"@radix-ui/react-direction": "^1.1.0",
"@radix-ui/react-navigation-menu": "^1.2.5",
"@radix-ui/react-popover": "^1.1.6",
"@radix-ui/react-scroll-area": "^1.2.3",
"@radix-ui/react-slot": "^1.1.2",
"@radix-ui/react-tabs": "^1.1.3",
"@radix-ui/react-accordion": "^1.2.4",
"@radix-ui/react-collapsible": "^1.1.4",
"@radix-ui/react-dialog": "^1.1.7",
"@radix-ui/react-direction": "^1.1.1",
"@radix-ui/react-navigation-menu": "^1.2.6",
"@radix-ui/react-popover": "^1.1.7",
"@radix-ui/react-scroll-area": "^1.2.4",
"@radix-ui/react-slot": "^1.2.0",
"@radix-ui/react-tabs": "^1.1.4",
"class-variance-authority": "^0.7.1",
"fumadocs-core": "workspace:*",
"lodash.merge": "^4.6.2",
@@ -98,16 +98,16 @@
},
"devDependencies": {
"@fumadocs/cli": "workspace:*",
"@next/eslint-plugin-next": "^15.2.4",
"@next/eslint-plugin-next": "^15.3.0",
"@tailwindcss/cli": "^4.1.3",
"@types/lodash.merge": "^4.6.9",
"@types/react": "^19.1.0",
"@types/react-dom": "^19.1.1",
"@types/react-dom": "^19.1.2",
"eslint-config-custom": "workspace:*",
"fumadocs-core": "workspace:*",
"next": "15.2.4",
"next": "15.3.0",
"tailwindcss": "^4.1.3",
"tsc-alias": "^1.8.13",
"tsc-alias": "^1.8.15",
"tsconfig": "workspace:*"
},
"peerDependencies": {
+886 -794
View File
File diff suppressed because it is too large Load Diff