create-fumadocs-app 16.0.23 → 16.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +2 -2
- package/dist/{chunk-7TRDY2H2.js → chunk-C6KFU27E.js} +3 -3
- package/dist/{chunk-CNJCXUXH.js → chunk-ODUKG5BD.js} +1 -1
- package/dist/index.js +2 -2
- package/dist/plugins/biome.js +1 -1
- package/dist/plugins/eslint.js +1 -1
- package/dist/plugins/orama-cloud.js +1 -1
- package/package.json +2 -2
- package/template/+next+fuma-docs-mdx/package.json +10 -10
- package/template/+orama-cloud/@app/components/search.tsx +1 -1
- package/template/react-router/app/docs/page.tsx +5 -5
- package/template/react-router/app/root.tsx +1 -1
- package/template/react-router/package.json +13 -13
- package/template/react-router-spa/app/docs/page.tsx +5 -5
- package/template/react-router-spa/app/root.tsx +1 -1
- package/template/react-router-spa/package.json +12 -12
- package/template/tanstack-start/example.gitignore +0 -1
- package/template/tanstack-start/package.json +14 -14
- package/template/tanstack-start/src/lib/source.ts +2 -8
- package/template/tanstack-start/src/routes/docs/$.tsx +6 -43
- package/template/tanstack-start/src/routes/index.tsx +15 -11
- package/template/tanstack-start-spa/example.gitignore +0 -1
- package/template/tanstack-start-spa/package.json +15 -15
- package/template/tanstack-start-spa/src/routes/docs/$.tsx +4 -41
- package/template/waku/package.json +10 -10
package/dist/bin.js
CHANGED
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
create,
|
|
4
4
|
getPackageManager,
|
|
5
5
|
managers
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ODUKG5BD.js";
|
|
7
7
|
import {
|
|
8
8
|
isCI,
|
|
9
9
|
templates
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-C6KFU27E.js";
|
|
11
11
|
|
|
12
12
|
// src/bin.ts
|
|
13
13
|
import fs from "fs/promises";
|
|
@@ -94,7 +94,7 @@ import { fileURLToPath } from "url";
|
|
|
94
94
|
// ../create-app-versions/package.json
|
|
95
95
|
var package_default = {
|
|
96
96
|
name: "create-fumadocs-versions",
|
|
97
|
-
version: "16.0.
|
|
97
|
+
version: "16.0.24",
|
|
98
98
|
private: true,
|
|
99
99
|
description: "Used to track dependency versions in create-fumadocs-app",
|
|
100
100
|
dependencies: {
|
|
@@ -109,10 +109,10 @@ var package_default = {
|
|
|
109
109
|
};
|
|
110
110
|
|
|
111
111
|
// ../core/package.json
|
|
112
|
-
var version = "16.2.
|
|
112
|
+
var version = "16.2.4";
|
|
113
113
|
|
|
114
114
|
// ../ui/package.json
|
|
115
|
-
var version2 = "16.2.
|
|
115
|
+
var version2 = "16.2.4";
|
|
116
116
|
|
|
117
117
|
// ../mdx/package.json
|
|
118
118
|
var version3 = "14.1.0";
|
package/dist/index.js
CHANGED
package/dist/plugins/biome.js
CHANGED
package/dist/plugins/eslint.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-fumadocs-app",
|
|
3
|
-
"version": "16.0.
|
|
3
|
+
"version": "16.0.24",
|
|
4
4
|
"description": "Create a new documentation site with Fumadocs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@types/cross-spawn": "^6.0.6",
|
|
42
|
-
"@types/node": "24.10.
|
|
42
|
+
"@types/node": "24.10.2",
|
|
43
43
|
"tinyglobby": "^0.2.15",
|
|
44
44
|
"typescript": "^5.9.3",
|
|
45
45
|
"eslint-config-custom": "0.0.0",
|
|
@@ -6,25 +6,25 @@
|
|
|
6
6
|
"build": "next build",
|
|
7
7
|
"dev": "next dev",
|
|
8
8
|
"start": "next start",
|
|
9
|
-
"types:check": "fumadocs-mdx && tsc --noEmit"
|
|
9
|
+
"types:check": "fumadocs-mdx && next typegen && tsc --noEmit"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"fumadocs-core": "workspace:*",
|
|
13
13
|
"fumadocs-mdx": "workspace:*",
|
|
14
14
|
"fumadocs-ui": "workspace:*",
|
|
15
|
-
"lucide-react": "^0.
|
|
16
|
-
"next": "16.0.
|
|
17
|
-
"react": "^19.2.
|
|
18
|
-
"react-dom": "^19.2.
|
|
15
|
+
"lucide-react": "^0.556.0",
|
|
16
|
+
"next": "16.0.8",
|
|
17
|
+
"react": "^19.2.1",
|
|
18
|
+
"react-dom": "^19.2.1"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@tailwindcss/postcss": "^4.1.
|
|
21
|
+
"@tailwindcss/postcss": "^4.1.17",
|
|
22
22
|
"@types/mdx": "^2.0.13",
|
|
23
|
-
"@types/node": "^24.10.
|
|
24
|
-
"@types/react": "^19.2.
|
|
25
|
-
"@types/react-dom": "^19.2.
|
|
23
|
+
"@types/node": "^24.10.2",
|
|
24
|
+
"@types/react": "^19.2.7",
|
|
25
|
+
"@types/react-dom": "^19.2.3",
|
|
26
26
|
"postcss": "^8.5.6",
|
|
27
|
-
"tailwindcss": "^4.1.
|
|
27
|
+
"tailwindcss": "^4.1.17",
|
|
28
28
|
"typescript": "^5.9.3"
|
|
29
29
|
}
|
|
30
30
|
}
|
|
@@ -17,7 +17,7 @@ import { OramaCloud } from '@orama/core';
|
|
|
17
17
|
import { useI18n } from 'fumadocs-ui/contexts/i18n';
|
|
18
18
|
|
|
19
19
|
const client = new OramaCloud({
|
|
20
|
-
projectId: process.env.
|
|
20
|
+
projectId: process.env.NEXT_PUBLIC_ORAMA_PROJECT_ID,
|
|
21
21
|
apiKey: process.env.NEXT_PUBLIC_ORAMA_API_KEY,
|
|
22
22
|
});
|
|
23
23
|
|
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
DocsTitle,
|
|
8
8
|
} from 'fumadocs-ui/layouts/docs/page';
|
|
9
9
|
import { source } from '@/lib/source';
|
|
10
|
-
import type * as PageTree from 'fumadocs-core/page-tree';
|
|
11
10
|
import defaultMdxComponents from 'fumadocs-ui/mdx';
|
|
12
11
|
import browserCollections from 'fumadocs-mdx:collections/browser';
|
|
13
12
|
import { baseOptions } from '@/lib/layout.shared';
|
|
13
|
+
import { useFumadocsLoader } from 'fumadocs-core/source/client';
|
|
14
14
|
|
|
15
15
|
export async function loader({ params }: Route.LoaderArgs) {
|
|
16
16
|
const slugs = params['*'].split('/').filter((v) => v.length > 0);
|
|
@@ -19,7 +19,7 @@ export async function loader({ params }: Route.LoaderArgs) {
|
|
|
19
19
|
|
|
20
20
|
return {
|
|
21
21
|
path: page.path,
|
|
22
|
-
|
|
22
|
+
pageTree: await source.serializePageTree(source.getPageTree()),
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
|
|
@@ -40,11 +40,11 @@ const clientLoader = browserCollections.docs.createClientLoader({
|
|
|
40
40
|
});
|
|
41
41
|
|
|
42
42
|
export default function Page({ loaderData }: Route.ComponentProps) {
|
|
43
|
-
const
|
|
44
|
-
const
|
|
43
|
+
const Content = clientLoader.getComponent(loaderData.path);
|
|
44
|
+
const { pageTree } = useFumadocsLoader(loaderData);
|
|
45
45
|
|
|
46
46
|
return (
|
|
47
|
-
<DocsLayout {...baseOptions()} tree={
|
|
47
|
+
<DocsLayout {...baseOptions()} tree={pageTree}>
|
|
48
48
|
<Content />
|
|
49
49
|
</DocsLayout>
|
|
50
50
|
);
|
|
@@ -9,27 +9,27 @@
|
|
|
9
9
|
"types:check": "react-router typegen && fumadocs-mdx && tsc --noEmit"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@react-router/node": "^7.
|
|
13
|
-
"@react-router/serve": "^7.
|
|
12
|
+
"@react-router/node": "^7.10.1",
|
|
13
|
+
"@react-router/serve": "^7.10.1",
|
|
14
14
|
"fumadocs-core": "workspace:*",
|
|
15
15
|
"fumadocs-mdx": "workspace:*",
|
|
16
16
|
"fumadocs-ui": "workspace:*",
|
|
17
17
|
"isbot": "^5.1.32",
|
|
18
|
-
"react": "^19.2.
|
|
19
|
-
"react-dom": "^19.2.
|
|
20
|
-
"react-router": "^7.
|
|
18
|
+
"react": "^19.2.1",
|
|
19
|
+
"react-dom": "^19.2.1",
|
|
20
|
+
"react-router": "^7.10.1"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@react-router/dev": "^7.
|
|
24
|
-
"@tailwindcss/vite": "^4.1.
|
|
23
|
+
"@react-router/dev": "^7.10.1",
|
|
24
|
+
"@tailwindcss/vite": "^4.1.17",
|
|
25
25
|
"@types/mdx": "^2.0.13",
|
|
26
|
-
"@types/node": "^24.10.
|
|
27
|
-
"@types/react": "^19.2.
|
|
28
|
-
"@types/react-dom": "^19.2.
|
|
29
|
-
"react-router-devtools": "^
|
|
30
|
-
"tailwindcss": "^4.1.
|
|
26
|
+
"@types/node": "^24.10.2",
|
|
27
|
+
"@types/react": "^19.2.7",
|
|
28
|
+
"@types/react-dom": "^19.2.3",
|
|
29
|
+
"react-router-devtools": "^6.0.0",
|
|
30
|
+
"tailwindcss": "^4.1.17",
|
|
31
31
|
"typescript": "^5.9.3",
|
|
32
|
-
"vite": "^7.2.
|
|
32
|
+
"vite": "^7.2.7",
|
|
33
33
|
"vite-tsconfig-paths": "^5.1.4"
|
|
34
34
|
}
|
|
35
35
|
}
|
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
DocsTitle,
|
|
8
8
|
} from 'fumadocs-ui/layouts/docs/page';
|
|
9
9
|
import { source } from '@/lib/source';
|
|
10
|
-
import type * as PageTree from 'fumadocs-core/page-tree';
|
|
11
10
|
import defaultMdxComponents from 'fumadocs-ui/mdx';
|
|
12
11
|
import browserCollections from 'fumadocs-mdx:collections/browser';
|
|
13
12
|
import { baseOptions } from '@/lib/layout.shared';
|
|
13
|
+
import { useFumadocsLoader } from 'fumadocs-core/source/client';
|
|
14
14
|
|
|
15
15
|
export async function loader({ params }: Route.LoaderArgs) {
|
|
16
16
|
const slugs = params['*'].split('/').filter((v) => v.length > 0);
|
|
@@ -19,7 +19,7 @@ export async function loader({ params }: Route.LoaderArgs) {
|
|
|
19
19
|
|
|
20
20
|
return {
|
|
21
21
|
path: page.path,
|
|
22
|
-
|
|
22
|
+
pageTree: await source.serializePageTree(source.pageTree),
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
|
|
@@ -40,11 +40,11 @@ const clientLoader = browserCollections.docs.createClientLoader({
|
|
|
40
40
|
});
|
|
41
41
|
|
|
42
42
|
export default function Page({ loaderData }: Route.ComponentProps) {
|
|
43
|
-
const
|
|
44
|
-
const
|
|
43
|
+
const Content = clientLoader.getComponent(loaderData.path);
|
|
44
|
+
const { pageTree } = useFumadocsLoader(loaderData);
|
|
45
45
|
|
|
46
46
|
return (
|
|
47
|
-
<DocsLayout {...baseOptions()} tree={
|
|
47
|
+
<DocsLayout {...baseOptions()} tree={pageTree}>
|
|
48
48
|
<Content />
|
|
49
49
|
</DocsLayout>
|
|
50
50
|
);
|
|
@@ -10,27 +10,27 @@
|
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@orama/orama": "^3.1.16",
|
|
13
|
-
"@react-router/node": "^7.
|
|
13
|
+
"@react-router/node": "^7.10.1",
|
|
14
14
|
"fumadocs-core": "workspace:*",
|
|
15
15
|
"fumadocs-mdx": "workspace:*",
|
|
16
16
|
"fumadocs-ui": "workspace:*",
|
|
17
17
|
"isbot": "^5.1.32",
|
|
18
|
-
"react": "^19.2.
|
|
19
|
-
"react-dom": "^19.2.
|
|
20
|
-
"react-router": "^7.
|
|
18
|
+
"react": "^19.2.1",
|
|
19
|
+
"react-dom": "^19.2.1",
|
|
20
|
+
"react-router": "^7.10.1"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@react-router/dev": "^7.
|
|
24
|
-
"@tailwindcss/vite": "^4.1.
|
|
23
|
+
"@react-router/dev": "^7.10.1",
|
|
24
|
+
"@tailwindcss/vite": "^4.1.17",
|
|
25
25
|
"@types/mdx": "^2.0.13",
|
|
26
|
-
"@types/node": "^24.10.
|
|
27
|
-
"@types/react": "^19.2.
|
|
28
|
-
"@types/react-dom": "^19.2.
|
|
29
|
-
"react-router-devtools": "^
|
|
26
|
+
"@types/node": "^24.10.2",
|
|
27
|
+
"@types/react": "^19.2.7",
|
|
28
|
+
"@types/react-dom": "^19.2.3",
|
|
29
|
+
"react-router-devtools": "^6.0.0",
|
|
30
30
|
"serve": "^14.2.5",
|
|
31
|
-
"tailwindcss": "^4.1.
|
|
31
|
+
"tailwindcss": "^4.1.17",
|
|
32
32
|
"typescript": "^5.9.3",
|
|
33
|
-
"vite": "^7.2.
|
|
33
|
+
"vite": "^7.2.7",
|
|
34
34
|
"vite-tsconfig-paths": "^5.1.4"
|
|
35
35
|
}
|
|
36
36
|
}
|
|
@@ -10,27 +10,27 @@
|
|
|
10
10
|
"types:check": "fumadocs-mdx && tsc --noEmit"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@tanstack/react-router": "
|
|
14
|
-
"@tanstack/react-router-devtools": "
|
|
15
|
-
"@tanstack/react-start": "
|
|
13
|
+
"@tanstack/react-router": "1.136.18",
|
|
14
|
+
"@tanstack/react-router-devtools": "1.136.18",
|
|
15
|
+
"@tanstack/react-start": "1.136.18",
|
|
16
16
|
"fumadocs-core": "workspace:*",
|
|
17
17
|
"fumadocs-mdx": "workspace:*",
|
|
18
18
|
"fumadocs-ui": "workspace:*",
|
|
19
|
-
"lucide-
|
|
20
|
-
"react": "^19.2.
|
|
21
|
-
"react-dom": "^19.2.
|
|
22
|
-
"tailwind-merge": "^3.
|
|
23
|
-
"vite": "^7.2.
|
|
19
|
+
"lucide-react": "^0.556.0",
|
|
20
|
+
"react": "^19.2.1",
|
|
21
|
+
"react-dom": "^19.2.1",
|
|
22
|
+
"tailwind-merge": "^3.4.0",
|
|
23
|
+
"vite": "^7.2.7"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@tailwindcss/vite": "^4.1.
|
|
26
|
+
"@tailwindcss/vite": "^4.1.17",
|
|
27
27
|
"@types/mdx": "^2.0.13",
|
|
28
|
-
"@types/node": "^24.10.
|
|
29
|
-
"@types/react": "^19.2.
|
|
30
|
-
"@types/react-dom": "^19.2.
|
|
31
|
-
"@vitejs/plugin-react": "^5.1.
|
|
28
|
+
"@types/node": "^24.10.2",
|
|
29
|
+
"@types/react": "^19.2.7",
|
|
30
|
+
"@types/react-dom": "^19.2.3",
|
|
31
|
+
"@vitejs/plugin-react": "^5.1.2",
|
|
32
32
|
"nitro": "3.0.1-alpha.1",
|
|
33
|
-
"tailwindcss": "^4.1.
|
|
33
|
+
"tailwindcss": "^4.1.17",
|
|
34
34
|
"typescript": "^5.9.3",
|
|
35
35
|
"vite-tsconfig-paths": "^5.1.4"
|
|
36
36
|
}
|
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
import { loader } from 'fumadocs-core/source';
|
|
2
|
-
import * as icons from 'lucide-static';
|
|
3
2
|
import { docs } from 'fumadocs-mdx:collections/server';
|
|
3
|
+
import { lucideIconsPlugin } from 'fumadocs-core/source/lucide-icons';
|
|
4
4
|
|
|
5
5
|
export const source = loader({
|
|
6
6
|
source: docs.toFumadocsSource(),
|
|
7
7
|
baseUrl: '/docs',
|
|
8
|
-
|
|
9
|
-
if (!icon) {
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
if (icon in icons) return icons[icon as keyof typeof icons];
|
|
14
|
-
},
|
|
8
|
+
plugins: [lucideIconsPlugin()],
|
|
15
9
|
});
|
|
@@ -2,8 +2,6 @@ import { createFileRoute, notFound } from '@tanstack/react-router';
|
|
|
2
2
|
import { DocsLayout } from 'fumadocs-ui/layouts/docs';
|
|
3
3
|
import { createServerFn } from '@tanstack/react-start';
|
|
4
4
|
import { source } from '@/lib/source';
|
|
5
|
-
import type * as PageTree from 'fumadocs-core/page-tree';
|
|
6
|
-
import { useMemo } from 'react';
|
|
7
5
|
import browserCollections from 'fumadocs-mdx:collections/browser';
|
|
8
6
|
import {
|
|
9
7
|
DocsBody,
|
|
@@ -13,18 +11,19 @@ import {
|
|
|
13
11
|
} from 'fumadocs-ui/layouts/docs/page';
|
|
14
12
|
import defaultMdxComponents from 'fumadocs-ui/mdx';
|
|
15
13
|
import { baseOptions } from '@/lib/layout.shared';
|
|
14
|
+
import { useFumadocsLoader } from 'fumadocs-core/source/client';
|
|
16
15
|
|
|
17
16
|
export const Route = createFileRoute('/docs/$')({
|
|
18
17
|
component: Page,
|
|
19
18
|
loader: async ({ params }) => {
|
|
20
19
|
const slugs = params._splat?.split('/') ?? [];
|
|
21
|
-
const data = await
|
|
20
|
+
const data = await serverLoader({ data: slugs });
|
|
22
21
|
await clientLoader.preload(data.path);
|
|
23
22
|
return data;
|
|
24
23
|
},
|
|
25
24
|
});
|
|
26
25
|
|
|
27
|
-
const
|
|
26
|
+
const serverLoader = createServerFn({
|
|
28
27
|
method: 'GET',
|
|
29
28
|
})
|
|
30
29
|
.inputValidator((slugs: string[]) => slugs)
|
|
@@ -33,8 +32,8 @@ const loader = createServerFn({
|
|
|
33
32
|
if (!page) throw notFound();
|
|
34
33
|
|
|
35
34
|
return {
|
|
36
|
-
tree: source.pageTree as object,
|
|
37
35
|
path: page.path,
|
|
36
|
+
pageTree: await source.serializePageTree(source.getPageTree()),
|
|
38
37
|
};
|
|
39
38
|
});
|
|
40
39
|
|
|
@@ -58,48 +57,12 @@ const clientLoader = browserCollections.docs.createClientLoader({
|
|
|
58
57
|
|
|
59
58
|
function Page() {
|
|
60
59
|
const data = Route.useLoaderData();
|
|
60
|
+
const { pageTree } = useFumadocsLoader(data);
|
|
61
61
|
const Content = clientLoader.getComponent(data.path);
|
|
62
|
-
const tree = useMemo(
|
|
63
|
-
() => transformPageTree(data.tree as PageTree.Folder),
|
|
64
|
-
[data.tree],
|
|
65
|
-
);
|
|
66
62
|
|
|
67
63
|
return (
|
|
68
|
-
<DocsLayout {...baseOptions()} tree={
|
|
64
|
+
<DocsLayout {...baseOptions()} tree={pageTree}>
|
|
69
65
|
<Content />
|
|
70
66
|
</DocsLayout>
|
|
71
67
|
);
|
|
72
68
|
}
|
|
73
|
-
|
|
74
|
-
function transformPageTree(root: PageTree.Root): PageTree.Root {
|
|
75
|
-
function mapNode<T extends PageTree.Node>(item: T): T {
|
|
76
|
-
if (typeof item.icon === 'string') {
|
|
77
|
-
item = {
|
|
78
|
-
...item,
|
|
79
|
-
icon: (
|
|
80
|
-
<span
|
|
81
|
-
dangerouslySetInnerHTML={{
|
|
82
|
-
__html: item.icon,
|
|
83
|
-
}}
|
|
84
|
-
/>
|
|
85
|
-
),
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
if (item.type === 'folder') {
|
|
90
|
-
return {
|
|
91
|
-
...item,
|
|
92
|
-
index: item.index ? mapNode(item.index) : undefined,
|
|
93
|
-
children: item.children.map(mapNode),
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
return item;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
return {
|
|
101
|
-
...root,
|
|
102
|
-
children: root.children.map(mapNode),
|
|
103
|
-
fallback: root.fallback ? transformPageTree(root.fallback) : undefined,
|
|
104
|
-
};
|
|
105
|
-
}
|
|
@@ -8,17 +8,21 @@ export const Route = createFileRoute('/')({
|
|
|
8
8
|
|
|
9
9
|
function Home() {
|
|
10
10
|
return (
|
|
11
|
-
<HomeLayout {...baseOptions()}
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
11
|
+
<HomeLayout {...baseOptions()}>
|
|
12
|
+
<div className="flex flex-col flex-1 justify-center px-4 py-8 text-center">
|
|
13
|
+
<h1 className="font-medium text-xl mb-4">
|
|
14
|
+
Fumadocs on Tanstack Start.
|
|
15
|
+
</h1>
|
|
16
|
+
<Link
|
|
17
|
+
to="/docs/$"
|
|
18
|
+
params={{
|
|
19
|
+
_splat: '',
|
|
20
|
+
}}
|
|
21
|
+
className="px-3 py-2 rounded-lg bg-fd-primary text-fd-primary-foreground font-medium text-sm mx-auto"
|
|
22
|
+
>
|
|
23
|
+
Open Docs
|
|
24
|
+
</Link>
|
|
25
|
+
</div>
|
|
22
26
|
</HomeLayout>
|
|
23
27
|
);
|
|
24
28
|
}
|
|
@@ -11,28 +11,28 @@
|
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@orama/orama": "^3.1.16",
|
|
14
|
-
"@tanstack/react-router": "
|
|
15
|
-
"@tanstack/react-router-devtools": "
|
|
16
|
-
"@tanstack/react-start": "
|
|
17
|
-
"@tanstack/start-static-server-functions": "
|
|
14
|
+
"@tanstack/react-router": "1.136.18",
|
|
15
|
+
"@tanstack/react-router-devtools": "1.136.18",
|
|
16
|
+
"@tanstack/react-start": "1.136.18",
|
|
17
|
+
"@tanstack/start-static-server-functions": "1.136.18",
|
|
18
18
|
"fumadocs-core": "workspace:*",
|
|
19
19
|
"fumadocs-mdx": "workspace:*",
|
|
20
20
|
"fumadocs-ui": "workspace:*",
|
|
21
|
-
"lucide-static": "^0.
|
|
22
|
-
"react": "^19.2.
|
|
23
|
-
"react-dom": "^19.2.
|
|
24
|
-
"tailwind-merge": "^3.
|
|
25
|
-
"vite": "^7.2.
|
|
21
|
+
"lucide-static": "^0.556.0",
|
|
22
|
+
"react": "^19.2.1",
|
|
23
|
+
"react-dom": "^19.2.1",
|
|
24
|
+
"tailwind-merge": "^3.4.0",
|
|
25
|
+
"vite": "^7.2.7"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@tailwindcss/vite": "^4.1.
|
|
28
|
+
"@tailwindcss/vite": "^4.1.17",
|
|
29
29
|
"@types/mdx": "^2.0.13",
|
|
30
|
-
"@types/node": "^24.10.
|
|
31
|
-
"@types/react": "^19.2.
|
|
32
|
-
"@types/react-dom": "^19.2.
|
|
33
|
-
"@vitejs/plugin-react": "^5.1.
|
|
30
|
+
"@types/node": "^24.10.2",
|
|
31
|
+
"@types/react": "^19.2.7",
|
|
32
|
+
"@types/react-dom": "^19.2.3",
|
|
33
|
+
"@vitejs/plugin-react": "^5.1.2",
|
|
34
34
|
"serve": "^14.2.5",
|
|
35
|
-
"tailwindcss": "^4.1.
|
|
35
|
+
"tailwindcss": "^4.1.17",
|
|
36
36
|
"typescript": "^5.9.3",
|
|
37
37
|
"vite-tsconfig-paths": "^5.1.4"
|
|
38
38
|
}
|
|
@@ -2,8 +2,6 @@ import { createFileRoute, notFound } from '@tanstack/react-router';
|
|
|
2
2
|
import { DocsLayout } from 'fumadocs-ui/layouts/docs';
|
|
3
3
|
import { createServerFn } from '@tanstack/react-start';
|
|
4
4
|
import { source } from '@/lib/source';
|
|
5
|
-
import type * as PageTree from 'fumadocs-core/page-tree';
|
|
6
|
-
import { useMemo } from 'react';
|
|
7
5
|
import browserCollections from 'fumadocs-mdx:collections/browser';
|
|
8
6
|
import {
|
|
9
7
|
DocsBody,
|
|
@@ -14,6 +12,7 @@ import {
|
|
|
14
12
|
import defaultMdxComponents from 'fumadocs-ui/mdx';
|
|
15
13
|
import { baseOptions } from '@/lib/layout.shared';
|
|
16
14
|
import { staticFunctionMiddleware } from '@tanstack/start-static-server-functions';
|
|
15
|
+
import { useFumadocsLoader } from 'fumadocs-core/source/client';
|
|
17
16
|
|
|
18
17
|
export const Route = createFileRoute('/docs/$')({
|
|
19
18
|
component: Page,
|
|
@@ -35,8 +34,8 @@ const loader = createServerFn({
|
|
|
35
34
|
if (!page) throw notFound();
|
|
36
35
|
|
|
37
36
|
return {
|
|
38
|
-
tree: source.pageTree as object,
|
|
39
37
|
path: page.path,
|
|
38
|
+
pageTree: await source.serializePageTree(source.pageTree),
|
|
40
39
|
};
|
|
41
40
|
});
|
|
42
41
|
|
|
@@ -61,47 +60,11 @@ const clientLoader = browserCollections.docs.createClientLoader({
|
|
|
61
60
|
function Page() {
|
|
62
61
|
const data = Route.useLoaderData();
|
|
63
62
|
const Content = clientLoader.getComponent(data.path);
|
|
64
|
-
const
|
|
65
|
-
() => transformPageTree(data.tree as PageTree.Folder),
|
|
66
|
-
[data.tree],
|
|
67
|
-
);
|
|
63
|
+
const { pageTree } = useFumadocsLoader(data);
|
|
68
64
|
|
|
69
65
|
return (
|
|
70
|
-
<DocsLayout {...baseOptions()} tree={
|
|
66
|
+
<DocsLayout {...baseOptions()} tree={pageTree}>
|
|
71
67
|
<Content />
|
|
72
68
|
</DocsLayout>
|
|
73
69
|
);
|
|
74
70
|
}
|
|
75
|
-
|
|
76
|
-
function transformPageTree(root: PageTree.Root): PageTree.Root {
|
|
77
|
-
function mapNode<T extends PageTree.Node>(item: T): T {
|
|
78
|
-
if (typeof item.icon === 'string') {
|
|
79
|
-
item = {
|
|
80
|
-
...item,
|
|
81
|
-
icon: (
|
|
82
|
-
<span
|
|
83
|
-
dangerouslySetInnerHTML={{
|
|
84
|
-
__html: item.icon,
|
|
85
|
-
}}
|
|
86
|
-
/>
|
|
87
|
-
),
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
if (item.type === 'folder') {
|
|
92
|
-
return {
|
|
93
|
-
...item,
|
|
94
|
-
index: item.index ? mapNode(item.index) : undefined,
|
|
95
|
-
children: item.children.map(mapNode),
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
return item;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
return {
|
|
103
|
-
...root,
|
|
104
|
-
children: root.children.map(mapNode),
|
|
105
|
-
fallback: root.fallback ? transformPageTree(root.fallback) : undefined,
|
|
106
|
-
};
|
|
107
|
-
}
|
|
@@ -13,20 +13,20 @@
|
|
|
13
13
|
"fumadocs-core": "workspace:*",
|
|
14
14
|
"fumadocs-mdx": "workspace:*",
|
|
15
15
|
"fumadocs-ui": "workspace:*",
|
|
16
|
-
"react": "^19.2.
|
|
17
|
-
"react-dom": "^19.2.
|
|
18
|
-
"react-server-dom-webpack": "^19.2.
|
|
19
|
-
"waku": "^0.27.
|
|
16
|
+
"react": "^19.2.1",
|
|
17
|
+
"react-dom": "^19.2.1",
|
|
18
|
+
"react-server-dom-webpack": "^19.2.1",
|
|
19
|
+
"waku": "^0.27.3"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@tailwindcss/vite": "^4.1.
|
|
22
|
+
"@tailwindcss/vite": "^4.1.17",
|
|
23
23
|
"@types/mdx": "^2.0.13",
|
|
24
|
-
"@types/node": "^24.10.
|
|
25
|
-
"@types/react": "^19.2.
|
|
26
|
-
"@types/react-dom": "^19.2.
|
|
27
|
-
"tailwindcss": "^4.1.
|
|
24
|
+
"@types/node": "^24.10.2",
|
|
25
|
+
"@types/react": "^19.2.7",
|
|
26
|
+
"@types/react-dom": "^19.2.3",
|
|
27
|
+
"tailwindcss": "^4.1.17",
|
|
28
28
|
"typescript": "^5.9.3",
|
|
29
|
-
"vite": "^7.2.
|
|
29
|
+
"vite": "^7.2.7",
|
|
30
30
|
"vite-tsconfig-paths": "^5.1.4"
|
|
31
31
|
}
|
|
32
32
|
}
|