create-fumadocs-app 16.0.0 → 16.0.2
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/{chunk-KVKS2K3W.js → chunk-6C2B326N.js} +198 -196
- package/dist/create-app.d.ts +35 -8
- package/dist/create-app.js +3 -5
- package/dist/index.js +110 -32
- package/package.json +3 -2
- package/template/+next+fuma-docs-mdx/app/(home)/page.tsx +16 -0
- package/template/{+next+tailwindcss → +next+fuma-docs-mdx}/app/layout.tsx +1 -1
- package/template/{+next → +next+fuma-docs-mdx}/example.gitignore +0 -2
- package/template/+next+fuma-docs-mdx/lib/layout.shared.tsx +9 -0
- package/template/+next+fuma-docs-mdx/lib/source.ts +1 -1
- package/template/{+next → +next+fuma-docs-mdx}/mdx-components.tsx +0 -1
- package/template/+next+fuma-docs-mdx/package.json +29 -0
- package/template/+next+fuma-docs-mdx/source.config.ts +1 -0
- package/template/+next+fuma-docs-mdx/tsconfig.json +2 -2
- package/template/{+next → +orama-cloud/+next+fuma-docs-mdx}/app/layout.tsx +4 -9
- package/template/+orama-cloud/+next+fuma-docs-mdx/app/static.json/route.ts +7 -0
- package/template/+orama-cloud/@app/components/search.tsx +59 -0
- package/template/+orama-cloud/@app/lib/export-static-indexes.ts +14 -0
- package/template/+orama-cloud/@root/.env.example +6 -0
- package/template/+orama-cloud/react-router/app/root.tsx +76 -0
- package/template/+orama-cloud/react-router/app/routes/static.ts +5 -0
- package/template/+orama-cloud/react-router/app/routes.ts +8 -0
- package/template/+orama-cloud/react-router-spa/app/root.tsx +76 -0
- package/template/+orama-cloud/react-router-spa/app/routes/static.ts +5 -0
- package/template/+orama-cloud/react-router-spa/app/routes.ts +8 -0
- package/template/+orama-cloud/tanstack-start/src/routes/__root.tsx +51 -0
- package/template/+orama-cloud/tanstack-start/src/routes/static[.]json.ts +10 -0
- package/template/+orama-cloud/tanstack-start/vite.config.ts +27 -0
- package/template/+orama-cloud/waku/src/components/provider.tsx +8 -0
- package/template/+orama-cloud/waku/src/pages/api/static.json.ts +9 -0
- package/template/react-router/app/docs/page.tsx +4 -4
- package/template/react-router/example.gitignore +0 -1
- package/template/react-router-spa/README.md +12 -0
- package/template/react-router-spa/app/app.css +3 -0
- package/template/react-router-spa/app/components/search.tsx +50 -0
- package/template/react-router-spa/app/docs/page.tsx +53 -0
- package/template/react-router-spa/app/docs/search.ts +10 -0
- package/template/react-router-spa/app/lib/layout.shared.tsx +9 -0
- package/template/react-router-spa/app/lib/source.ts +7 -0
- package/template/react-router-spa/app/root.tsx +76 -0
- package/template/react-router-spa/app/routes/home.tsx +30 -0
- package/template/react-router-spa/app/routes.ts +7 -0
- package/template/react-router-spa/content/docs/index.mdx +32 -0
- package/template/react-router-spa/content/docs/test.mdx +24 -0
- package/template/react-router-spa/example.gitignore +7 -0
- package/template/react-router-spa/package.json +36 -0
- package/template/react-router-spa/public/favicon.ico +0 -0
- package/template/react-router-spa/react-router.config.ts +18 -0
- package/template/react-router-spa/serve.json +3 -0
- package/template/react-router-spa/source.config.ts +7 -0
- package/template/react-router-spa/tsconfig.json +28 -0
- package/template/react-router-spa/vite.config.ts +10 -0
- package/template/tanstack-start/example.gitignore +9 -1
- package/template/tanstack-start/package.json +6 -6
- package/template/waku/example.gitignore +3 -1
- package/template/waku/package.json +3 -3
- package/template/+next/README.md +0 -37
- package/template/+next/app/(home)/page.tsx +0 -42
- package/template/+next/lib/layout.shared.tsx +0 -30
- package/template/+next+content-collections/app/docs/[[...slug]]/page.tsx +0 -51
- package/template/+next+content-collections/content-collections.ts +0 -26
- package/template/+next+content-collections/lib/source.ts +0 -8
- package/template/+next+content-collections/next.config.mjs +0 -8
- package/template/+next+content-collections/tsconfig.json +0 -35
- package/template/+next+tailwindcss/app/(home)/page.tsx +0 -19
- package/template/{+next → +next+fuma-docs-mdx}/app/(home)/layout.tsx +0 -0
- package/template/{+next → +next+fuma-docs-mdx}/app/api/search/route.ts +0 -0
- package/template/{+next → +next+fuma-docs-mdx}/app/docs/layout.tsx +1 -1
- /package/template/{+next+tailwindcss → +next+fuma-docs-mdx}/app/global.css +0 -0
- /package/template/{+next → +next+fuma-docs-mdx}/content/docs/index.mdx +0 -0
- /package/template/{+next → +next+fuma-docs-mdx}/content/docs/test.mdx +0 -0
- /package/template/{+next+tailwindcss → +next+fuma-docs-mdx}/postcss.config.mjs +0 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createRootRoute,
|
|
3
|
+
HeadContent,
|
|
4
|
+
Outlet,
|
|
5
|
+
Scripts,
|
|
6
|
+
} from '@tanstack/react-router';
|
|
7
|
+
import * as React from 'react';
|
|
8
|
+
import appCss from '@/styles/app.css?url';
|
|
9
|
+
import { RootProvider } from 'fumadocs-ui/provider/tanstack';
|
|
10
|
+
import SearchDialog from '@/components/search';
|
|
11
|
+
|
|
12
|
+
export const Route = createRootRoute({
|
|
13
|
+
head: () => ({
|
|
14
|
+
meta: [
|
|
15
|
+
{
|
|
16
|
+
charSet: 'utf-8',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: 'viewport',
|
|
20
|
+
content: 'width=device-width, initial-scale=1',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
title: 'Fumadocs on TanStack Start',
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
links: [{ rel: 'stylesheet', href: appCss }],
|
|
27
|
+
}),
|
|
28
|
+
component: RootComponent,
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
function RootComponent() {
|
|
32
|
+
return (
|
|
33
|
+
<RootDocument>
|
|
34
|
+
<Outlet />
|
|
35
|
+
</RootDocument>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function RootDocument({ children }: { children: React.ReactNode }) {
|
|
40
|
+
return (
|
|
41
|
+
<html suppressHydrationWarning>
|
|
42
|
+
<head>
|
|
43
|
+
<HeadContent />
|
|
44
|
+
</head>
|
|
45
|
+
<body className="flex flex-col min-h-screen">
|
|
46
|
+
<RootProvider search={{ SearchDialog }}>{children}</RootProvider>
|
|
47
|
+
<Scripts />
|
|
48
|
+
</body>
|
|
49
|
+
</html>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createFileRoute } from '@tanstack/react-router';
|
|
2
|
+
import { exportSearchIndexes } from '@/lib/export-search-indexes';
|
|
3
|
+
|
|
4
|
+
export const Route = createFileRoute('/static.json')({
|
|
5
|
+
server: {
|
|
6
|
+
handlers: {
|
|
7
|
+
GET: async () => Response.json(await exportSearchIndexes()),
|
|
8
|
+
},
|
|
9
|
+
},
|
|
10
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import react from '@vitejs/plugin-react';
|
|
2
|
+
import { tanstackStart } from '@tanstack/react-start/plugin/vite';
|
|
3
|
+
import { defineConfig } from 'vite';
|
|
4
|
+
import tsConfigPaths from 'vite-tsconfig-paths';
|
|
5
|
+
import tailwindcss from '@tailwindcss/vite';
|
|
6
|
+
import mdx from 'fumadocs-mdx/vite';
|
|
7
|
+
|
|
8
|
+
export default defineConfig({
|
|
9
|
+
server: {
|
|
10
|
+
port: 3000,
|
|
11
|
+
},
|
|
12
|
+
plugins: [
|
|
13
|
+
mdx(await import('./source.config')),
|
|
14
|
+
tailwindcss(),
|
|
15
|
+
tsConfigPaths({
|
|
16
|
+
projects: ['./tsconfig.json'],
|
|
17
|
+
}),
|
|
18
|
+
tanstackStart({
|
|
19
|
+
prerender: {
|
|
20
|
+
enabled: true,
|
|
21
|
+
// pre-render the static file
|
|
22
|
+
pages: [{ path: '/static.json' }],
|
|
23
|
+
},
|
|
24
|
+
}),
|
|
25
|
+
react(),
|
|
26
|
+
],
|
|
27
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
import { RootProvider } from 'fumadocs-ui/provider/waku';
|
|
4
|
+
import SearchDialog from '@/components/search';
|
|
5
|
+
|
|
6
|
+
export function Provider({ children }: { children: ReactNode }) {
|
|
7
|
+
return <RootProvider search={{ SearchDialog }}>{children}</RootProvider>;
|
|
8
|
+
}
|
|
@@ -7,11 +7,11 @@ import {
|
|
|
7
7
|
DocsTitle,
|
|
8
8
|
} from 'fumadocs-ui/page';
|
|
9
9
|
import { source } from '@/lib/source';
|
|
10
|
-
import { baseOptions } from '@/lib/layout.shared';
|
|
11
10
|
import type * as PageTree from 'fumadocs-core/page-tree';
|
|
12
11
|
import defaultMdxComponents from 'fumadocs-ui/mdx';
|
|
13
12
|
import { docs } from '@/.source';
|
|
14
13
|
import { toClientRenderer } from 'fumadocs-mdx/runtime/vite';
|
|
14
|
+
import { baseOptions } from '@/lib/layout.shared';
|
|
15
15
|
|
|
16
16
|
export async function loader({ params }: Route.LoaderArgs) {
|
|
17
17
|
const slugs = params['*'].split('/').filter((v) => v.length > 0);
|
|
@@ -20,7 +20,7 @@ export async function loader({ params }: Route.LoaderArgs) {
|
|
|
20
20
|
|
|
21
21
|
return {
|
|
22
22
|
path: page.path,
|
|
23
|
-
tree: source.
|
|
23
|
+
tree: source.getPageTree(),
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
|
|
@@ -41,8 +41,8 @@ const renderer = toClientRenderer(
|
|
|
41
41
|
},
|
|
42
42
|
);
|
|
43
43
|
|
|
44
|
-
export default function Page(
|
|
45
|
-
const { tree, path } =
|
|
44
|
+
export default function Page({ loaderData }: Route.ComponentProps) {
|
|
45
|
+
const { tree, path } = loaderData;
|
|
46
46
|
const Content = renderer[path];
|
|
47
47
|
|
|
48
48
|
return (
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
SearchDialog,
|
|
4
|
+
SearchDialogClose,
|
|
5
|
+
SearchDialogContent,
|
|
6
|
+
SearchDialogHeader,
|
|
7
|
+
SearchDialogIcon,
|
|
8
|
+
SearchDialogInput,
|
|
9
|
+
SearchDialogList,
|
|
10
|
+
SearchDialogOverlay,
|
|
11
|
+
type SharedProps,
|
|
12
|
+
} from 'fumadocs-ui/components/dialog/search';
|
|
13
|
+
import { useDocsSearch } from 'fumadocs-core/search/client';
|
|
14
|
+
import { create } from '@orama/orama';
|
|
15
|
+
import { useI18n } from 'fumadocs-ui/contexts/i18n';
|
|
16
|
+
|
|
17
|
+
function initOrama() {
|
|
18
|
+
return create({
|
|
19
|
+
schema: { _: 'string' },
|
|
20
|
+
language: 'english',
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export default function DefaultSearchDialog(props: SharedProps) {
|
|
25
|
+
const { locale } = useI18n();
|
|
26
|
+
const { search, setSearch, query } = useDocsSearch({
|
|
27
|
+
type: 'static',
|
|
28
|
+
initOrama,
|
|
29
|
+
locale,
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<SearchDialog
|
|
34
|
+
search={search}
|
|
35
|
+
onSearchChange={setSearch}
|
|
36
|
+
isLoading={query.isLoading}
|
|
37
|
+
{...props}
|
|
38
|
+
>
|
|
39
|
+
<SearchDialogOverlay />
|
|
40
|
+
<SearchDialogContent>
|
|
41
|
+
<SearchDialogHeader>
|
|
42
|
+
<SearchDialogIcon />
|
|
43
|
+
<SearchDialogInput />
|
|
44
|
+
<SearchDialogClose />
|
|
45
|
+
</SearchDialogHeader>
|
|
46
|
+
<SearchDialogList items={query.data !== 'empty' ? query.data : null} />
|
|
47
|
+
</SearchDialogContent>
|
|
48
|
+
</SearchDialog>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { Route } from './+types/page';
|
|
2
|
+
import { DocsLayout } from 'fumadocs-ui/layouts/docs';
|
|
3
|
+
import {
|
|
4
|
+
DocsBody,
|
|
5
|
+
DocsDescription,
|
|
6
|
+
DocsPage,
|
|
7
|
+
DocsTitle,
|
|
8
|
+
} from 'fumadocs-ui/page';
|
|
9
|
+
import { source } from '@/lib/source';
|
|
10
|
+
import type * as PageTree from 'fumadocs-core/page-tree';
|
|
11
|
+
import defaultMdxComponents from 'fumadocs-ui/mdx';
|
|
12
|
+
import { docs } from '@/.source';
|
|
13
|
+
import { toClientRenderer } from 'fumadocs-mdx/runtime/vite';
|
|
14
|
+
import { baseOptions } from '@/lib/layout.shared';
|
|
15
|
+
|
|
16
|
+
export async function loader({ params }: Route.LoaderArgs) {
|
|
17
|
+
const slugs = params['*'].split('/').filter((v) => v.length > 0);
|
|
18
|
+
const page = source.getPage(slugs);
|
|
19
|
+
if (!page) throw new Response('Not found', { status: 404 });
|
|
20
|
+
|
|
21
|
+
return {
|
|
22
|
+
path: page.path,
|
|
23
|
+
tree: source.getPageTree(),
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const renderer = toClientRenderer(
|
|
28
|
+
docs.doc,
|
|
29
|
+
({ toc, default: Mdx, frontmatter }) => {
|
|
30
|
+
return (
|
|
31
|
+
<DocsPage toc={toc}>
|
|
32
|
+
<title>{frontmatter.title}</title>
|
|
33
|
+
<meta name="description" content={frontmatter.description} />
|
|
34
|
+
<DocsTitle>{frontmatter.title}</DocsTitle>
|
|
35
|
+
<DocsDescription>{frontmatter.description}</DocsDescription>
|
|
36
|
+
<DocsBody>
|
|
37
|
+
<Mdx components={{ ...defaultMdxComponents }} />
|
|
38
|
+
</DocsBody>
|
|
39
|
+
</DocsPage>
|
|
40
|
+
);
|
|
41
|
+
},
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
export default function Page({ loaderData }: Route.ComponentProps) {
|
|
45
|
+
const { tree, path } = loaderData;
|
|
46
|
+
const Content = renderer[path];
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<DocsLayout {...baseOptions()} tree={tree as PageTree.Root}>
|
|
50
|
+
<Content />
|
|
51
|
+
</DocsLayout>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isRouteErrorResponse,
|
|
3
|
+
Links,
|
|
4
|
+
Meta,
|
|
5
|
+
Outlet,
|
|
6
|
+
Scripts,
|
|
7
|
+
ScrollRestoration,
|
|
8
|
+
} from 'react-router';
|
|
9
|
+
import { RootProvider } from 'fumadocs-ui/provider/react-router';
|
|
10
|
+
import type { Route } from './+types/root';
|
|
11
|
+
import './app.css';
|
|
12
|
+
import SearchDialog from '@/components/search';
|
|
13
|
+
|
|
14
|
+
export const links: Route.LinksFunction = () => [
|
|
15
|
+
{ rel: 'preconnect', href: 'https://fonts.googleapis.com' },
|
|
16
|
+
{
|
|
17
|
+
rel: 'preconnect',
|
|
18
|
+
href: 'https://fonts.gstatic.com',
|
|
19
|
+
crossOrigin: 'anonymous',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
rel: 'stylesheet',
|
|
23
|
+
href: 'https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap',
|
|
24
|
+
},
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
export function Layout({ children }: { children: React.ReactNode }) {
|
|
28
|
+
return (
|
|
29
|
+
<html lang="en" suppressHydrationWarning>
|
|
30
|
+
<head>
|
|
31
|
+
<meta charSet="utf-8" />
|
|
32
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
33
|
+
<Meta />
|
|
34
|
+
<Links />
|
|
35
|
+
</head>
|
|
36
|
+
<body className="flex flex-col min-h-screen">
|
|
37
|
+
<RootProvider search={{ SearchDialog }}>{children}</RootProvider>
|
|
38
|
+
<ScrollRestoration />
|
|
39
|
+
<Scripts />
|
|
40
|
+
</body>
|
|
41
|
+
</html>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export default function App() {
|
|
46
|
+
return <Outlet />;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function ErrorBoundary({ error }: Route.ErrorBoundaryProps) {
|
|
50
|
+
let message = 'Oops!';
|
|
51
|
+
let details = 'An unexpected error occurred.';
|
|
52
|
+
let stack: string | undefined;
|
|
53
|
+
|
|
54
|
+
if (isRouteErrorResponse(error)) {
|
|
55
|
+
message = error.status === 404 ? '404' : 'Error';
|
|
56
|
+
details =
|
|
57
|
+
error.status === 404
|
|
58
|
+
? 'The requested page could not be found.'
|
|
59
|
+
: error.statusText || details;
|
|
60
|
+
} else if (import.meta.env.DEV && error && error instanceof Error) {
|
|
61
|
+
details = error.message;
|
|
62
|
+
stack = error.stack;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return (
|
|
66
|
+
<main className="pt-16 p-4 container mx-auto">
|
|
67
|
+
<h1>{message}</h1>
|
|
68
|
+
<p>{details}</p>
|
|
69
|
+
{stack && (
|
|
70
|
+
<pre className="w-full p-4 overflow-x-auto">
|
|
71
|
+
<code>{stack}</code>
|
|
72
|
+
</pre>
|
|
73
|
+
)}
|
|
74
|
+
</main>
|
|
75
|
+
);
|
|
76
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Route } from './+types/home';
|
|
2
|
+
import { HomeLayout } from 'fumadocs-ui/layouts/home';
|
|
3
|
+
import { Link } from 'react-router';
|
|
4
|
+
import { baseOptions } from '@/lib/layout.shared';
|
|
5
|
+
|
|
6
|
+
export function meta({}: Route.MetaArgs) {
|
|
7
|
+
return [
|
|
8
|
+
{ title: 'New React Router App' },
|
|
9
|
+
{ name: 'description', content: 'Welcome to React Router!' },
|
|
10
|
+
];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default function Home() {
|
|
14
|
+
return (
|
|
15
|
+
<HomeLayout {...baseOptions()}>
|
|
16
|
+
<div className="p-4 flex flex-col items-center justify-center text-center flex-1">
|
|
17
|
+
<h1 className="text-xl font-bold mb-2">Fumadocs on React Router.</h1>
|
|
18
|
+
<p className="text-fd-muted-foreground mb-4">
|
|
19
|
+
The truly flexible docs framework on React.js.
|
|
20
|
+
</p>
|
|
21
|
+
<Link
|
|
22
|
+
className="text-sm bg-fd-primary text-fd-primary-foreground rounded-full font-medium px-4 py-2.5"
|
|
23
|
+
to="/docs"
|
|
24
|
+
>
|
|
25
|
+
Open Docs
|
|
26
|
+
</Link>
|
|
27
|
+
</div>
|
|
28
|
+
</HomeLayout>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Hello World
|
|
3
|
+
description: |
|
|
4
|
+
Your first `document`
|
|
5
|
+
You'll love it!
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Hey there! Fumadocs is the docs framework that also works on React Router!
|
|
9
|
+
|
|
10
|
+
## Heading
|
|
11
|
+
|
|
12
|
+
Hello World
|
|
13
|
+
|
|
14
|
+
<Cards>
|
|
15
|
+
<Card title="Learn more about React Router" href="https://reactrouter.com" />
|
|
16
|
+
<Card title="Learn more about Fumadocs" href="https://fumadocs.dev" />
|
|
17
|
+
</Cards>
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
console.log('I love React!');
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Heading
|
|
24
|
+
|
|
25
|
+
#### Heading
|
|
26
|
+
|
|
27
|
+
| Head | Description |
|
|
28
|
+
| ------------------------------- | ----------------------------------- |
|
|
29
|
+
| `hello` | Hello World |
|
|
30
|
+
| very **important** | Hey |
|
|
31
|
+
| _Surprisingly_ | Fumadocs |
|
|
32
|
+
| very long text that looks weird | hello world hello world hello world |
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Test
|
|
3
|
+
description: A document to test Fumadocs
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Hey there!
|
|
7
|
+
|
|
8
|
+
## Cards
|
|
9
|
+
|
|
10
|
+
<Cards>
|
|
11
|
+
<Card title="Learn more about Next.js" href="https://nextjs.org/docs" />
|
|
12
|
+
<Card title="Learn more about Fumadocs" href="https://fumadocs.dev" />
|
|
13
|
+
</Cards>
|
|
14
|
+
|
|
15
|
+
### CodeBlock
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
console.log('Hello World');
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
#### List
|
|
22
|
+
|
|
23
|
+
- Hello
|
|
24
|
+
- World
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "example-react-router-spa",
|
|
3
|
+
"private": true,
|
|
4
|
+
"type": "module",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"build": "react-router build",
|
|
7
|
+
"dev": "react-router dev",
|
|
8
|
+
"start": "serve ./build/client",
|
|
9
|
+
"typecheck": "react-router typegen && tsc"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@orama/orama": "^3.1.16",
|
|
13
|
+
"@react-router/node": "^7.9.4",
|
|
14
|
+
"fumadocs-core": "workspace:*",
|
|
15
|
+
"fumadocs-mdx": "workspace:*",
|
|
16
|
+
"fumadocs-ui": "workspace:*",
|
|
17
|
+
"isbot": "^5.1.31",
|
|
18
|
+
"react": "^19.2.0",
|
|
19
|
+
"react-dom": "^19.2.0",
|
|
20
|
+
"react-router": "^7.9.4"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"serve": "^14.2.5",
|
|
24
|
+
"@react-router/dev": "^7.9.4",
|
|
25
|
+
"@tailwindcss/vite": "^4.1.15",
|
|
26
|
+
"@types/mdx": "^2.0.13",
|
|
27
|
+
"@types/node": "^24.9.1",
|
|
28
|
+
"@types/react": "^19.2.2",
|
|
29
|
+
"@types/react-dom": "^19.2.2",
|
|
30
|
+
"react-router-devtools": "^5.1.3",
|
|
31
|
+
"tailwindcss": "^4.1.15",
|
|
32
|
+
"typescript": "^5.9.3",
|
|
33
|
+
"vite": "^7.1.11",
|
|
34
|
+
"vite-tsconfig-paths": "^5.1.4"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Config } from '@react-router/dev/config';
|
|
2
|
+
import { glob } from 'node:fs/promises';
|
|
3
|
+
import { createGetUrl, getSlugs } from 'fumadocs-core/source';
|
|
4
|
+
|
|
5
|
+
const getUrl = createGetUrl('/docs');
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
ssr: false,
|
|
9
|
+
async prerender({ getStaticPaths }) {
|
|
10
|
+
const paths: string[] = [...getStaticPaths()];
|
|
11
|
+
|
|
12
|
+
for await (const entry of glob('**/*.mdx', { cwd: 'content/docs' })) {
|
|
13
|
+
paths.push(getUrl(getSlugs(entry)));
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return paths;
|
|
17
|
+
},
|
|
18
|
+
} satisfies Config;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"include": [
|
|
3
|
+
"**/*",
|
|
4
|
+
"**/.server/**/*",
|
|
5
|
+
"**/.client/**/*",
|
|
6
|
+
".react-router/types/**/*"
|
|
7
|
+
],
|
|
8
|
+
"compilerOptions": {
|
|
9
|
+
"lib": ["DOM", "DOM.Iterable", "ES2022"],
|
|
10
|
+
"types": ["node", "vite/client"],
|
|
11
|
+
"target": "esnext",
|
|
12
|
+
"module": "esnext",
|
|
13
|
+
"moduleResolution": "bundler",
|
|
14
|
+
"jsx": "react-jsx",
|
|
15
|
+
"rootDirs": [".", "./.react-router/types"],
|
|
16
|
+
"baseUrl": ".",
|
|
17
|
+
"paths": {
|
|
18
|
+
"@/*": ["./app/*"],
|
|
19
|
+
"@/.source": [".source"]
|
|
20
|
+
},
|
|
21
|
+
"esModuleInterop": true,
|
|
22
|
+
"verbatimModuleSyntax": true,
|
|
23
|
+
"noEmit": true,
|
|
24
|
+
"resolveJsonModule": true,
|
|
25
|
+
"skipLibCheck": true,
|
|
26
|
+
"strict": true
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { reactRouter } from '@react-router/dev/vite';
|
|
2
|
+
import tailwindcss from '@tailwindcss/vite';
|
|
3
|
+
import { defineConfig } from 'vite';
|
|
4
|
+
import tsconfigPaths from 'vite-tsconfig-paths';
|
|
5
|
+
import mdx from 'fumadocs-mdx/vite';
|
|
6
|
+
import * as MdxConfig from './source.config';
|
|
7
|
+
|
|
8
|
+
export default defineConfig({
|
|
9
|
+
plugins: [mdx(MdxConfig), tailwindcss(), reactRouter(), tsconfigPaths()],
|
|
10
|
+
});
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
"start": "node .output/server/index.mjs"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@tanstack/react-router": "^1.133.
|
|
13
|
-
"@tanstack/react-router-devtools": "^1.133.
|
|
14
|
-
"@tanstack/react-start": "^1.133.
|
|
12
|
+
"@tanstack/react-router": "^1.133.21",
|
|
13
|
+
"@tanstack/react-router-devtools": "^1.133.21",
|
|
14
|
+
"@tanstack/react-start": "^1.133.21",
|
|
15
15
|
"fumadocs-core": "workspace:*",
|
|
16
16
|
"fumadocs-mdx": "workspace:*",
|
|
17
17
|
"fumadocs-ui": "workspace:*",
|
|
@@ -22,13 +22,13 @@
|
|
|
22
22
|
"vite": "^7.1.11"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@tailwindcss/vite": "^4.1.
|
|
25
|
+
"@tailwindcss/vite": "^4.1.15",
|
|
26
26
|
"@types/mdx": "^2.0.13",
|
|
27
|
-
"@types/node": "^24.
|
|
27
|
+
"@types/node": "^24.9.1",
|
|
28
28
|
"@types/react": "^19.2.2",
|
|
29
29
|
"@types/react-dom": "^19.2.2",
|
|
30
30
|
"@vitejs/plugin-react": "^5.0.4",
|
|
31
|
-
"tailwindcss": "^4.1.
|
|
31
|
+
"tailwindcss": "^4.1.15",
|
|
32
32
|
"typescript": "^5.9.3",
|
|
33
33
|
"vite-tsconfig-paths": "^5.1.4"
|
|
34
34
|
}
|