create-fumadocs-app 16.0.1 → 16.0.3

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.
Files changed (64) hide show
  1. package/dist/chunk-3VWJJEHU.js +204 -0
  2. package/dist/chunk-HLHY7KAF.js +181 -0
  3. package/dist/create-app.d.ts +23 -8
  4. package/dist/create-app.js +4 -5
  5. package/dist/index.js +33 -31
  6. package/dist/orama-cloud-VQUOOEZ2.js +313 -0
  7. package/package.json +5 -3
  8. package/template/+next+fuma-docs-mdx/app/(home)/page.tsx +16 -0
  9. package/template/{+next+tailwindcss → +next+fuma-docs-mdx}/app/layout.tsx +1 -1
  10. package/template/{+next → +next+fuma-docs-mdx}/example.gitignore +0 -2
  11. package/template/+next+fuma-docs-mdx/lib/layout.shared.tsx +9 -0
  12. package/template/+next+fuma-docs-mdx/lib/source.ts +1 -1
  13. package/template/{+next → +next+fuma-docs-mdx}/mdx-components.tsx +0 -1
  14. package/template/+next+fuma-docs-mdx/package.json +29 -0
  15. package/template/+next+fuma-docs-mdx/source.config.ts +1 -0
  16. package/template/+next+fuma-docs-mdx/tsconfig.json +2 -2
  17. package/template/+orama-cloud/@app/components/search.tsx +59 -0
  18. package/template/+orama-cloud/@app/lib/export-static-indexes.ts +14 -0
  19. package/template/+orama-cloud/@root/.env.example +6 -0
  20. package/template/react-router/app/docs/page.tsx +4 -4
  21. package/template/react-router/example.gitignore +0 -1
  22. package/template/react-router/react-router.config.ts +3 -3
  23. package/template/react-router-spa/README.md +12 -0
  24. package/template/react-router-spa/app/app.css +3 -0
  25. package/template/react-router-spa/app/components/search.tsx +50 -0
  26. package/template/react-router-spa/app/docs/page.tsx +53 -0
  27. package/template/react-router-spa/app/docs/search.ts +10 -0
  28. package/template/react-router-spa/app/lib/layout.shared.tsx +9 -0
  29. package/template/react-router-spa/app/lib/source.ts +7 -0
  30. package/template/react-router-spa/app/root.tsx +76 -0
  31. package/template/react-router-spa/app/routes/home.tsx +30 -0
  32. package/template/react-router-spa/app/routes.ts +7 -0
  33. package/template/react-router-spa/content/docs/index.mdx +32 -0
  34. package/template/react-router-spa/content/docs/test.mdx +24 -0
  35. package/template/react-router-spa/example.gitignore +7 -0
  36. package/template/react-router-spa/package.json +36 -0
  37. package/template/react-router-spa/public/favicon.ico +0 -0
  38. package/template/react-router-spa/react-router.config.ts +23 -0
  39. package/template/react-router-spa/serve.json +3 -0
  40. package/template/react-router-spa/source.config.ts +7 -0
  41. package/template/react-router-spa/tsconfig.json +28 -0
  42. package/template/react-router-spa/vite.config.ts +10 -0
  43. package/template/tanstack-start/example.gitignore +9 -1
  44. package/template/tanstack-start/package.json +6 -6
  45. package/template/waku/example.gitignore +3 -1
  46. package/template/waku/package.json +3 -3
  47. package/dist/chunk-YVEWA65C.js +0 -370
  48. package/template/+next/README.md +0 -37
  49. package/template/+next/app/(home)/page.tsx +0 -42
  50. package/template/+next/app/layout.tsx +0 -23
  51. package/template/+next/lib/layout.shared.tsx +0 -30
  52. package/template/+next+content-collections/app/docs/[[...slug]]/page.tsx +0 -51
  53. package/template/+next+content-collections/content-collections.ts +0 -26
  54. package/template/+next+content-collections/lib/source.ts +0 -8
  55. package/template/+next+content-collections/next.config.mjs +0 -8
  56. package/template/+next+content-collections/tsconfig.json +0 -35
  57. package/template/+next+tailwindcss/app/(home)/page.tsx +0 -19
  58. package/template/{+next → +next+fuma-docs-mdx}/app/(home)/layout.tsx +0 -0
  59. package/template/{+next → +next+fuma-docs-mdx}/app/api/search/route.ts +0 -0
  60. package/template/{+next → +next+fuma-docs-mdx}/app/docs/layout.tsx +1 -1
  61. /package/template/{+next+tailwindcss → +next+fuma-docs-mdx}/app/global.css +0 -0
  62. /package/template/{+next → +next+fuma-docs-mdx}/content/docs/index.mdx +0 -0
  63. /package/template/{+next → +next+fuma-docs-mdx}/content/docs/test.mdx +0 -0
  64. /package/template/{+next+tailwindcss → +next+fuma-docs-mdx}/postcss.config.mjs +0 -0
@@ -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,10 @@
1
+ import { createFromSource } from 'fumadocs-core/search/server';
2
+ import { source } from '@/lib/source';
3
+
4
+ const server = createFromSource(source, {
5
+ language: 'english',
6
+ });
7
+
8
+ export async function loader() {
9
+ return server.staticGET();
10
+ }
@@ -0,0 +1,9 @@
1
+ import type { BaseLayoutProps } from 'fumadocs-ui/layouts/shared';
2
+
3
+ export function baseOptions(): BaseLayoutProps {
4
+ return {
5
+ nav: {
6
+ title: 'React Router',
7
+ },
8
+ };
9
+ }
@@ -0,0 +1,7 @@
1
+ import { loader } from 'fumadocs-core/source';
2
+ import { create, docs } from '@/.source';
3
+
4
+ export const source = loader({
5
+ source: await create.sourceAsync(docs.doc, docs.meta),
6
+ baseUrl: '/docs',
7
+ });
@@ -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,7 @@
1
+ import { index, route, type RouteConfig } from '@react-router/dev/routes';
2
+
3
+ export default [
4
+ index('routes/home.tsx'),
5
+ route('docs/*', 'docs/page.tsx'),
6
+ route('api/search', 'docs/search.ts'),
7
+ ] satisfies RouteConfig;
@@ -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,7 @@
1
+ .DS_Store
2
+ /node_modules/
3
+
4
+ # React Router
5
+ /.react-router/
6
+ /build/
7
+ .source
@@ -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
+ }
@@ -0,0 +1,23 @@
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: true,
9
+ async prerender({ getStaticPaths }) {
10
+ const paths: string[] = [];
11
+ const excluded: string[] = [];
12
+
13
+ for (const path of getStaticPaths()) {
14
+ if (!excluded.includes(path)) paths.push(path);
15
+ }
16
+
17
+ for await (const entry of glob('**/*.mdx', { cwd: 'content/docs' })) {
18
+ paths.push(getUrl(getSlugs(entry)));
19
+ }
20
+
21
+ return paths;
22
+ },
23
+ } satisfies Config;
@@ -0,0 +1,3 @@
1
+ {
2
+ "rewrites": [{ "source": "/**", "destination": "/index.html" }]
3
+ }
@@ -0,0 +1,7 @@
1
+ import { defineConfig, defineDocs } from 'fumadocs-mdx/config';
2
+
3
+ export const docs = defineDocs({
4
+ dir: 'content/docs',
5
+ });
6
+
7
+ export default defineConfig();
@@ -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
+ });
@@ -6,6 +6,14 @@ node_modules
6
6
  .output
7
7
  .nitro
8
8
  /build/
9
-
9
+ /api/
10
+ /server/build
11
+ /public/build
12
+ /test-results/
13
+ /playwright-report/
14
+ /blob-report/
15
+ /playwright/.cache/
10
16
  .tanstack
17
+
18
+ src/routeTree.gen.ts
11
19
  .source
@@ -9,9 +9,9 @@
9
9
  "start": "node .output/server/index.mjs"
10
10
  },
11
11
  "dependencies": {
12
- "@tanstack/react-router": "^1.133.15",
13
- "@tanstack/react-router-devtools": "^1.133.15",
14
- "@tanstack/react-start": "^1.133.15",
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.14",
25
+ "@tailwindcss/vite": "^4.1.15",
26
26
  "@types/mdx": "^2.0.13",
27
- "@types/node": "^24.8.1",
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.14",
31
+ "tailwindcss": "^4.1.15",
32
32
  "typescript": "^5.9.3",
33
33
  "vite-tsconfig-paths": "^5.1.4"
34
34
  }
@@ -1,4 +1,6 @@
1
1
  .DS_Store
2
2
  /node_modules/
3
+
4
+ dist
3
5
  .source
4
- dist
6
+ src/pages.gen.ts
@@ -18,12 +18,12 @@
18
18
  "waku": "^0.26.1"
19
19
  },
20
20
  "devDependencies": {
21
- "@tailwindcss/vite": "^4.1.14",
21
+ "@tailwindcss/vite": "^4.1.15",
22
22
  "@types/mdx": "^2.0.13",
23
- "@types/node": "^24.8.1",
23
+ "@types/node": "^24.9.1",
24
24
  "@types/react": "^19.2.2",
25
25
  "@types/react-dom": "^19.2.2",
26
- "tailwindcss": "^4.1.14",
26
+ "tailwindcss": "^4.1.15",
27
27
  "typescript": "^5.9.3",
28
28
  "vite": "^7.1.11",
29
29
  "vite-tsconfig-paths": "^5.1.4"