Skip to content

Commit 3f2cfe0

Browse files
committed
chore: prep
1 parent 5bb231a commit 3f2cfe0

File tree

21 files changed

+1757
-209
lines changed

21 files changed

+1757
-209
lines changed

apps/docs/.gitignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
node_modules
2+
3+
.DS_Store
4+
.cache
5+
.vercel
6+
.output
7+
.nitro
8+
/build/
9+
/api/
10+
/server/build
11+
/public/build
12+
/test-results/
13+
/playwright-report/
14+
/blob-report/
15+
/playwright/.cache/
16+
.tanstack
17+
18+
.source

apps/docs/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# docs
2+
3+
This is a Tanstack Start application generated with
4+
[Create Fumadocs](https://github.com/fuma-nama/fumadocs).
5+
6+
Run development server:
7+
8+
```bash
9+
npm run dev
10+
# or
11+
pnpm dev
12+
# or
13+
yarn dev
14+
```

apps/docs/content/docs/index.mdx

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
title: Hello World
3+
description: Your favourite docs framework.
4+
icon: Rocket
5+
---
6+
7+
Hey there! Fumadocs is the docs framework that also works on Tanstack Start!
8+
9+
## Heading
10+
11+
Hello World!
12+
13+
<Cards>
14+
<Card title="Learn more about Tanstack Start" href="https://tanstack.com/start" />
15+
<Card title="Learn more about Fumadocs" href="https://fumadocs.dev" />
16+
</Cards>
17+
18+
### CodeBlock
19+
20+
```ts
21+
console.log('Hello World');
22+
```
23+
24+
#### Table
25+
26+
| Head | Description |
27+
| ------------------------------- | ----------------------------------- |
28+
| `hello` | Hello World |
29+
| very **important** | Hey |
30+
| _Surprisingly_ | Fumadocs |
31+
| very long text that looks weird | hello world hello world hello world |

apps/docs/content/docs/test.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
title: Test
3+
description: This is another page
4+
---
5+
6+
Hello World again!
7+
8+
## Installation
9+
10+
```npm
11+
npm i fumadocs-core fumadocs-ui
12+
```

apps/docs/package.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"name": "docs",
3+
"private": true,
4+
"type": "module",
5+
"sideEffects": false,
6+
"scripts": {
7+
"dev": "vite dev",
8+
"build": "vite build",
9+
"start": "serve dist/client",
10+
"types:check": "fumadocs-mdx && tsc --noEmit",
11+
"postinstall": "fumadocs-mdx"
12+
},
13+
"dependencies": {
14+
"@orama/orama": "^3.1.18",
15+
"@tanstack/react-router": "1.147.1",
16+
"@tanstack/react-router-devtools": "1.147.1",
17+
"@tanstack/react-start": "1.147.1",
18+
"@tanstack/start-static-server-functions": "1.147.1",
19+
"fumadocs-core": "16.4.7",
20+
"fumadocs-mdx": "14.2.6",
21+
"fumadocs-ui": "16.4.7",
22+
"lucide-react": "^0.562.0",
23+
"react": "^19.2.3",
24+
"react-dom": "^19.2.3",
25+
"tailwind-merge": "^3.4.0",
26+
"vite": "^7.3.1"
27+
},
28+
"devDependencies": {
29+
"@tailwindcss/vite": "^4.1.18",
30+
"@types/mdx": "^2.0.13",
31+
"@types/node": "^25.0.5",
32+
"@types/react": "^19.2.8",
33+
"@types/react-dom": "^19.2.3",
34+
"@vitejs/plugin-react": "^5.1.2",
35+
"serve": "^14.2.5",
36+
"tailwindcss": "^4.1.18",
37+
"typescript": "^5.9.3",
38+
"vite-tsconfig-paths": "^6.0.4"
39+
}
40+
}

apps/docs/source.config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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();
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { Link } from '@tanstack/react-router';
2+
import { HomeLayout } from 'fumadocs-ui/layouts/home';
3+
4+
export function NotFound() {
5+
return (
6+
<HomeLayout
7+
nav={{
8+
title: 'Tanstack Start',
9+
}}
10+
className="text-center py-32 justify-center"
11+
>
12+
<div className="flex flex-col items-center gap-4">
13+
<h1 className="text-6xl font-bold text-fd-muted-foreground">404</h1>
14+
<h2 className="text-2xl font-semibold">Page Not Found</h2>
15+
<p className="text-fd-muted-foreground max-w-md">
16+
The page you are looking for might have been removed, had its name changed, or is
17+
temporarily unavailable.
18+
</p>
19+
<Link
20+
to="/"
21+
className="mt-4 px-4 py-2 rounded-lg bg-fd-primary text-fd-primary-foreground font-medium text-sm hover:opacity-90 transition-opacity"
22+
>
23+
Back to Home
24+
</Link>
25+
</div>
26+
</HomeLayout>
27+
);
28+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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+
// https://docs.orama.com/docs/orama-js/supported-languages
21+
language: 'english',
22+
});
23+
}
24+
25+
export default function DefaultSearchDialog(props: SharedProps) {
26+
const { locale } = useI18n(); // (optional) for i18n
27+
const { search, setSearch, query } = useDocsSearch({
28+
type: 'static',
29+
initOrama,
30+
locale,
31+
});
32+
33+
return (
34+
<SearchDialog search={search} onSearchChange={setSearch} isLoading={query.isLoading} {...props}>
35+
<SearchDialogOverlay />
36+
<SearchDialogContent>
37+
<SearchDialogHeader>
38+
<SearchDialogIcon />
39+
<SearchDialogInput />
40+
<SearchDialogClose />
41+
</SearchDialogHeader>
42+
<SearchDialogList items={query.data !== 'empty' ? query.data : null} />
43+
</SearchDialogContent>
44+
</SearchDialog>
45+
);
46+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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: 'Tanstack Start',
7+
},
8+
};
9+
}

apps/docs/src/lib/source.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { loader } from 'fumadocs-core/source';
2+
import { lucideIconsPlugin } from 'fumadocs-core/source/lucide-icons';
3+
import { docs } from 'fumadocs-mdx:collections/server';
4+
5+
export const source = loader({
6+
source: docs.toFumadocsSource(),
7+
baseUrl: '/docs',
8+
plugins: [lucideIconsPlugin()],
9+
});

0 commit comments

Comments
 (0)