Skip to content

Commit 617405d

Browse files
committed
feat: setup docs
1 parent 6122744 commit 617405d

22 files changed

+6341
-49
lines changed

biome.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
},
2222
"overrides": [
2323
{
24-
"includes": ["**/*.spec.ts", "**/*.test.ts"],
24+
"includes": ["**/*.spec.ts", "**/*.test.ts", "**/*.gen.ts"],
2525
"linter": {
2626
"rules": {
2727
"suspicious": {

docs/.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
node_modules
2+
3+
.DS_Store
4+
.cache
5+
.vercel
6+
.output
7+
.nitro
8+
/build/
9+
10+
.tanstack

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+
```

docs/content/index.mdx

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

docs/content/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+
```

docs/package.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"name": "example-tanstack-start",
3+
"private": true,
4+
"sideEffects": false,
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite dev",
8+
"build": "vite build && tsc --noEmit",
9+
"start": "node .output/server/index.mjs"
10+
},
11+
"dependencies": {
12+
"@tanstack/react-router": "^1.131.30",
13+
"@tanstack/react-router-devtools": "^1.131.30",
14+
"@tanstack/react-start": "^1.131.30",
15+
"fumadocs-core": "15.7.8",
16+
"fumadocs-mdx": "11.8.3",
17+
"fumadocs-ui": "15.7.8",
18+
"lucide-static": "^0.542.0",
19+
"react": "^19.1.1",
20+
"react-dom": "^19.1.1",
21+
"tailwind-merge": "^3.3.1",
22+
"vite": "^7.1.3"
23+
},
24+
"devDependencies": {
25+
"@tailwindcss/vite": "^4.1.12",
26+
"@types/node": "^24.3.0",
27+
"@types/react": "^19.1.12",
28+
"@types/react-dom": "^19.1.9",
29+
"@vitejs/plugin-react": "^5.0.2",
30+
"tailwindcss": "^4.1.12",
31+
"typescript": "^5.9.2",
32+
"vite-tsconfig-paths": "^5.1.4"
33+
}
34+
}

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",
5+
});
6+
7+
export default defineConfig();

docs/source.generated.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/// <reference types="vite/client" />
2+
import { fromConfig } from "fumadocs-mdx/runtime/vite";
3+
import type * as Config from "./source.config";
4+
5+
export const create = fromConfig<typeof Config>();
6+
7+
export const docs = {
8+
doc: create.doc(
9+
"docs",
10+
import.meta.glob(["./**/*.{mdx,md}"], {
11+
query: {
12+
collection: "docs",
13+
},
14+
base: "/content",
15+
}),
16+
),
17+
meta: create.meta(
18+
"docs",
19+
import.meta.glob(["./**/*.{json,yaml}"], {
20+
import: "default",
21+
query: {
22+
collection: "docs",
23+
},
24+
base: "/content",
25+
}),
26+
),
27+
};

docs/src/components/not-found.tsx

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
17+
changed, or is 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+
}

docs/src/lib/layout.shared.tsx

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+
}

0 commit comments

Comments
 (0)