@hanzo/docs-create-app 16.0.50

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 (204) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +11 -0
  3. package/dist/auto-install-CenyMuK7.js +33 -0
  4. package/dist/auto-install-CenyMuK7.js.map +1 -0
  5. package/dist/bin.d.ts +1 -0
  6. package/dist/bin.js +165 -0
  7. package/dist/bin.js.map +1 -0
  8. package/dist/constants-BkYWkLHa.d.ts +22 -0
  9. package/dist/constants-BkYWkLHa.d.ts.map +1 -0
  10. package/dist/constants-CbNzssp2.js +957 -0
  11. package/dist/constants-CbNzssp2.js.map +1 -0
  12. package/dist/index.d.ts +49 -0
  13. package/dist/index.d.ts.map +1 -0
  14. package/dist/index.js +60 -0
  15. package/dist/index.js.map +1 -0
  16. package/dist/plugins/biome.base.d.ts +40 -0
  17. package/dist/plugins/biome.base.d.ts.map +1 -0
  18. package/dist/plugins/biome.base.js +38 -0
  19. package/dist/plugins/biome.base.js.map +1 -0
  20. package/dist/plugins/biome.d.ts +7 -0
  21. package/dist/plugins/biome.d.ts.map +1 -0
  22. package/dist/plugins/biome.js +33 -0
  23. package/dist/plugins/biome.js.map +1 -0
  24. package/dist/plugins/biome.next.d.ts +41 -0
  25. package/dist/plugins/biome.next.d.ts.map +1 -0
  26. package/dist/plugins/biome.next.js +44 -0
  27. package/dist/plugins/biome.next.js.map +1 -0
  28. package/dist/plugins/eslint.d.ts +7 -0
  29. package/dist/plugins/eslint.d.ts.map +1 -0
  30. package/dist/plugins/eslint.js +47 -0
  31. package/dist/plugins/eslint.js.map +1 -0
  32. package/dist/plugins/next-use-src.d.ts +10 -0
  33. package/dist/plugins/next-use-src.d.ts.map +1 -0
  34. package/dist/plugins/next-use-src.js +37 -0
  35. package/dist/plugins/next-use-src.js.map +1 -0
  36. package/dist/plugins/orama-cloud.d.ts +7 -0
  37. package/dist/plugins/orama-cloud.d.ts.map +1 -0
  38. package/dist/plugins/orama-cloud.js +296 -0
  39. package/dist/plugins/orama-cloud.js.map +1 -0
  40. package/package.json +63 -0
  41. package/template/+next+fuma-docs-mdx/app/(home)/layout.tsx +6 -0
  42. package/template/+next+fuma-docs-mdx/app/(home)/page.tsx +16 -0
  43. package/template/+next+fuma-docs-mdx/app/api/search/route.ts +7 -0
  44. package/template/+next+fuma-docs-mdx/app/docs/[[...slug]]/page.tsx +57 -0
  45. package/template/+next+fuma-docs-mdx/app/docs/layout.tsx +11 -0
  46. package/template/+next+fuma-docs-mdx/app/global.css +3 -0
  47. package/template/+next+fuma-docs-mdx/app/layout.tsx +17 -0
  48. package/template/+next+fuma-docs-mdx/app/llms-full.txt/route.ts +10 -0
  49. package/template/+next+fuma-docs-mdx/app/llms.mdx/docs/[[...slug]]/route.ts +20 -0
  50. package/template/+next+fuma-docs-mdx/app/llms.txt/route.ts +13 -0
  51. package/template/+next+fuma-docs-mdx/app/og/docs/[...slug]/route.tsx +27 -0
  52. package/template/+next+fuma-docs-mdx/components/ai/page-actions.tsx +240 -0
  53. package/template/+next+fuma-docs-mdx/content/docs/index.mdx +13 -0
  54. package/template/+next+fuma-docs-mdx/content/docs/test.mdx +17 -0
  55. package/template/+next+fuma-docs-mdx/example.gitignore +26 -0
  56. package/template/+next+fuma-docs-mdx/lib/cn.ts +1 -0
  57. package/template/+next+fuma-docs-mdx/lib/layout.shared.tsx +17 -0
  58. package/template/+next+fuma-docs-mdx/lib/source.ts +27 -0
  59. package/template/+next+fuma-docs-mdx/mdx-components.tsx +9 -0
  60. package/template/+next+fuma-docs-mdx/next.config.mjs +18 -0
  61. package/template/+next+fuma-docs-mdx/package.json +31 -0
  62. package/template/+next+fuma-docs-mdx/postcss.config.mjs +7 -0
  63. package/template/+next+fuma-docs-mdx/source.config.ts +23 -0
  64. package/template/+next+fuma-docs-mdx/tsconfig.json +36 -0
  65. package/template/+next+fuma-docs-mdx+static/README.md +45 -0
  66. package/template/+next+fuma-docs-mdx+static/app/(home)/layout.tsx +6 -0
  67. package/template/+next+fuma-docs-mdx+static/app/(home)/page.tsx +16 -0
  68. package/template/+next+fuma-docs-mdx+static/app/api/search/route.ts +9 -0
  69. package/template/+next+fuma-docs-mdx+static/app/docs/[[...slug]]/page.tsx +47 -0
  70. package/template/+next+fuma-docs-mdx+static/app/docs/layout.tsx +11 -0
  71. package/template/+next+fuma-docs-mdx+static/app/global.css +3 -0
  72. package/template/+next+fuma-docs-mdx+static/app/layout.tsx +17 -0
  73. package/template/+next+fuma-docs-mdx+static/app/llms-full.txt/route.ts +10 -0
  74. package/template/+next+fuma-docs-mdx+static/app/og/docs/[...slug]/route.tsx +27 -0
  75. package/template/+next+fuma-docs-mdx+static/components/provider.tsx +8 -0
  76. package/template/+next+fuma-docs-mdx+static/components/search.tsx +46 -0
  77. package/template/+next+fuma-docs-mdx+static/content/docs/index.mdx +13 -0
  78. package/template/+next+fuma-docs-mdx+static/content/docs/test.mdx +17 -0
  79. package/template/+next+fuma-docs-mdx+static/example.gitignore +26 -0
  80. package/template/+next+fuma-docs-mdx+static/lib/layout.shared.tsx +9 -0
  81. package/template/+next+fuma-docs-mdx+static/lib/source.ts +26 -0
  82. package/template/+next+fuma-docs-mdx+static/mdx-components.tsx +9 -0
  83. package/template/+next+fuma-docs-mdx+static/next.config.mjs +11 -0
  84. package/template/+next+fuma-docs-mdx+static/package.json +32 -0
  85. package/template/+next+fuma-docs-mdx+static/postcss.config.mjs +7 -0
  86. package/template/+next+fuma-docs-mdx+static/source.config.ts +23 -0
  87. package/template/+next+fuma-docs-mdx+static/tsconfig.json +36 -0
  88. package/template/+next+hanzo-docs-mdx/README.md +43 -0
  89. package/template/+next+hanzo-docs-mdx/app/(home)/layout.tsx +6 -0
  90. package/template/+next+hanzo-docs-mdx/app/(home)/page.tsx +16 -0
  91. package/template/+next+hanzo-docs-mdx/app/api/search/route.ts +7 -0
  92. package/template/+next+hanzo-docs-mdx/app/docs/[[...slug]]/page.tsx +61 -0
  93. package/template/+next+hanzo-docs-mdx/app/docs/layout.tsx +11 -0
  94. package/template/+next+hanzo-docs-mdx/app/global.css +3 -0
  95. package/template/+next+hanzo-docs-mdx/app/layout.tsx +17 -0
  96. package/template/+next+hanzo-docs-mdx/app/llms-full.txt/route.ts +10 -0
  97. package/template/+next+hanzo-docs-mdx/app/og/docs/[...slug]/route.tsx +27 -0
  98. package/template/+next+hanzo-docs-mdx/content/docs/index.mdx +13 -0
  99. package/template/+next+hanzo-docs-mdx/content/docs/test.mdx +17 -0
  100. package/template/+next+hanzo-docs-mdx/example.gitignore +26 -0
  101. package/template/+next+hanzo-docs-mdx/lib/cn.ts +1 -0
  102. package/template/+next+hanzo-docs-mdx/lib/layout.shared.tsx +9 -0
  103. package/template/+next+hanzo-docs-mdx/lib/source.ts +27 -0
  104. package/template/+next+hanzo-docs-mdx/mdx-components.tsx +9 -0
  105. package/template/+next+hanzo-docs-mdx/next.config.mjs +18 -0
  106. package/template/+next+hanzo-docs-mdx/package.json +31 -0
  107. package/template/+next+hanzo-docs-mdx/postcss.config.mjs +5 -0
  108. package/template/+next+hanzo-docs-mdx/source.config.ts +23 -0
  109. package/template/+next+hanzo-docs-mdx/tsconfig.json +36 -0
  110. package/template/+orama-cloud/@app/components/search.tsx +54 -0
  111. package/template/+orama-cloud/@app/lib/export-static-indexes.ts +14 -0
  112. package/template/+orama-cloud/@root/.env.example +6 -0
  113. package/template/react-router/README.md +12 -0
  114. package/template/react-router/app/app.css +3 -0
  115. package/template/react-router/app/docs/page.tsx +51 -0
  116. package/template/react-router/app/docs/search.ts +12 -0
  117. package/template/react-router/app/lib/layout.shared.tsx +9 -0
  118. package/template/react-router/app/lib/source.ts +7 -0
  119. package/template/react-router/app/root.tsx +73 -0
  120. package/template/react-router/app/routes/home.tsx +30 -0
  121. package/template/react-router/app/routes.ts +7 -0
  122. package/template/react-router/content/docs/index.mdx +32 -0
  123. package/template/react-router/content/docs/meta.json +3 -0
  124. package/template/react-router/content/docs/test.mdx +24 -0
  125. package/template/react-router/example.gitignore +7 -0
  126. package/template/react-router/package.json +35 -0
  127. package/template/react-router/public/favicon.ico +0 -0
  128. package/template/react-router/react-router.config.ts +23 -0
  129. package/template/react-router/source.config.ts +7 -0
  130. package/template/react-router/tsconfig.json +23 -0
  131. package/template/react-router/vite.config.ts +17 -0
  132. package/template/react-router-spa/README.md +12 -0
  133. package/template/react-router-spa/app/app.css +3 -0
  134. package/template/react-router-spa/app/components/search.tsx +45 -0
  135. package/template/react-router-spa/app/docs/page.tsx +53 -0
  136. package/template/react-router-spa/app/docs/search.ts +10 -0
  137. package/template/react-router-spa/app/lib/layout.shared.tsx +9 -0
  138. package/template/react-router-spa/app/lib/source.ts +7 -0
  139. package/template/react-router-spa/app/root.tsx +74 -0
  140. package/template/react-router-spa/app/routes/home.tsx +30 -0
  141. package/template/react-router-spa/app/routes.ts +7 -0
  142. package/template/react-router-spa/content/docs/index.mdx +32 -0
  143. package/template/react-router-spa/content/docs/test.mdx +24 -0
  144. package/template/react-router-spa/example.gitignore +7 -0
  145. package/template/react-router-spa/package.json +36 -0
  146. package/template/react-router-spa/public/favicon.ico +0 -0
  147. package/template/react-router-spa/react-router.config.ts +23 -0
  148. package/template/react-router-spa/serve.json +3 -0
  149. package/template/react-router-spa/source.config.ts +7 -0
  150. package/template/react-router-spa/tsconfig.json +23 -0
  151. package/template/react-router-spa/vite.config.ts +17 -0
  152. package/template/tanstack-start/README.md +12 -0
  153. package/template/tanstack-start/content/docs/index.mdx +31 -0
  154. package/template/tanstack-start/content/docs/test.mdx +12 -0
  155. package/template/tanstack-start/example.gitignore +18 -0
  156. package/template/tanstack-start/package.json +38 -0
  157. package/template/tanstack-start/source.config.ts +7 -0
  158. package/template/tanstack-start/src/components/not-found.tsx +28 -0
  159. package/template/tanstack-start/src/lib/layout.shared.tsx +9 -0
  160. package/template/tanstack-start/src/lib/source.ts +9 -0
  161. package/template/tanstack-start/src/router.tsx +12 -0
  162. package/template/tanstack-start/src/routes/__root.tsx +45 -0
  163. package/template/tanstack-start/src/routes/api/search.ts +16 -0
  164. package/template/tanstack-start/src/routes/docs/$.tsx +72 -0
  165. package/template/tanstack-start/src/routes/index.tsx +26 -0
  166. package/template/tanstack-start/src/styles/app.css +3 -0
  167. package/template/tanstack-start/tsconfig.json +24 -0
  168. package/template/tanstack-start/vite.config.ts +33 -0
  169. package/template/tanstack-start-spa/README.md +12 -0
  170. package/template/tanstack-start-spa/content/docs/index.mdx +31 -0
  171. package/template/tanstack-start-spa/content/docs/test.mdx +12 -0
  172. package/template/tanstack-start-spa/example.gitignore +18 -0
  173. package/template/tanstack-start-spa/package.json +41 -0
  174. package/template/tanstack-start-spa/source.config.ts +7 -0
  175. package/template/tanstack-start-spa/src/components/not-found.tsx +28 -0
  176. package/template/tanstack-start-spa/src/components/search.tsx +46 -0
  177. package/template/tanstack-start-spa/src/lib/layout.shared.tsx +9 -0
  178. package/template/tanstack-start-spa/src/lib/source.ts +9 -0
  179. package/template/tanstack-start-spa/src/router.tsx +12 -0
  180. package/template/tanstack-start-spa/src/routes/__root.tsx +46 -0
  181. package/template/tanstack-start-spa/src/routes/api/search.ts +16 -0
  182. package/template/tanstack-start-spa/src/routes/docs/$.tsx +74 -0
  183. package/template/tanstack-start-spa/src/routes/index.tsx +26 -0
  184. package/template/tanstack-start-spa/src/styles/app.css +3 -0
  185. package/template/tanstack-start-spa/tsconfig.json +24 -0
  186. package/template/tanstack-start-spa/vite.config.ts +42 -0
  187. package/template/waku/README.md +11 -0
  188. package/template/waku/content/docs/index.mdx +31 -0
  189. package/template/waku/content/docs/test.mdx +12 -0
  190. package/template/waku/example.gitignore +6 -0
  191. package/template/waku/package.json +33 -0
  192. package/template/waku/source.config.ts +7 -0
  193. package/template/waku/src/components/provider.tsx +7 -0
  194. package/template/waku/src/lib/layout.shared.tsx +9 -0
  195. package/template/waku/src/lib/source.ts +9 -0
  196. package/template/waku/src/pages/(home)/_layout.tsx +7 -0
  197. package/template/waku/src/pages/(home)/index.tsx +21 -0
  198. package/template/waku/src/pages/_api/api/search.ts +4 -0
  199. package/template/waku/src/pages/_root.tsx +20 -0
  200. package/template/waku/src/pages/docs/[...slugs].tsx +45 -0
  201. package/template/waku/src/pages/docs/_layout.tsx +12 -0
  202. package/template/waku/src/styles/globals.css +9 -0
  203. package/template/waku/tsconfig.json +25 -0
  204. package/template/waku/waku.config.ts +17 -0
@@ -0,0 +1,72 @@
1
+ import { createFileRoute, notFound } from '@tanstack/react-router';
2
+ import { DocsLayout } from '@hanzo/docs-base-ui/layouts/docs';
3
+ import { createServerFn } from '@tanstack/react-start';
4
+ import { source } from '@/lib/source';
5
+ import browserCollections from '@hanzo/docs-mdx:collections/browser';
6
+ import { DocsBody, DocsDescription, DocsPage, DocsTitle } from '@hanzo/docs-base-ui/layouts/docs/page';
7
+ import defaultMdxComponents from '@hanzo/docs-base-ui/mdx';
8
+ import { baseOptions } from '@/lib/layout.shared';
9
+ import { useHanzoDocsLoader } from '@hanzo/docs-core/source/client';
10
+ import { Suspense } from 'react';
11
+
12
+ export const Route = createFileRoute('/docs/$')({
13
+ component: Page,
14
+ loader: async ({ params }) => {
15
+ const slugs = params._splat?.split('/') ?? [];
16
+ const data = await serverLoader({ data: slugs });
17
+ await clientLoader.preload(data.path);
18
+ return data;
19
+ },
20
+ });
21
+
22
+ const serverLoader = createServerFn({
23
+ method: 'GET',
24
+ })
25
+ .inputValidator((slugs: string[]) => slugs)
26
+ .handler(async ({ data: slugs }) => {
27
+ const page = source.getPage(slugs);
28
+ if (!page) throw notFound();
29
+
30
+ return {
31
+ path: page.path,
32
+ pageTree: await source.serializePageTree(source.getPageTree()),
33
+ };
34
+ });
35
+
36
+ const clientLoader = browserCollections.docs.createClientLoader({
37
+ component(
38
+ { toc, frontmatter, default: MDX },
39
+ // you can define props for the component
40
+ props: {
41
+ className?: string;
42
+ },
43
+ ) {
44
+ return (
45
+ <DocsPage toc={toc} {...props}>
46
+ <DocsTitle>{frontmatter.title}</DocsTitle>
47
+ <DocsDescription>{frontmatter.description}</DocsDescription>
48
+ <DocsBody>
49
+ <MDX
50
+ components={{
51
+ ...defaultMdxComponents,
52
+ }}
53
+ />
54
+ </DocsBody>
55
+ </DocsPage>
56
+ );
57
+ },
58
+ });
59
+
60
+ function Page() {
61
+ const data = useHanzoDocsLoader(Route.useLoaderData());
62
+
63
+ return (
64
+ <DocsLayout {...baseOptions()} tree={data.pageTree}>
65
+ <Suspense>
66
+ {clientLoader.useContent(data.path, {
67
+ className: '',
68
+ })}
69
+ </Suspense>
70
+ </DocsLayout>
71
+ );
72
+ }
@@ -0,0 +1,26 @@
1
+ import { createFileRoute, Link } from '@tanstack/react-router';
2
+ import { HomeLayout } from '@hanzo/docs/ui/layouts/home';
3
+ import { baseOptions } from '@/lib/layout.shared';
4
+
5
+ export const Route = createFileRoute('/')({
6
+ component: Home,
7
+ });
8
+
9
+ function Home() {
10
+ return (
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">Hanzo Docs on Tanstack Start.</h1>
14
+ <Link
15
+ to="/docs/$"
16
+ params={{
17
+ _splat: '',
18
+ }}
19
+ className="px-3 py-2 rounded-lg bg-fd-primary text-fd-primary-foreground font-medium text-sm mx-auto"
20
+ >
21
+ Open Docs
22
+ </Link>
23
+ </div>
24
+ </HomeLayout>
25
+ );
26
+ }
@@ -0,0 +1,3 @@
1
+ @import 'tailwindcss';
2
+ @import '@hanzo/docs-base-ui/css/neutral.css';
3
+ @import '@hanzo/docs-base-ui/css/preset.css';
@@ -0,0 +1,24 @@
1
+ {
2
+ "include": ["**/*.ts", "**/*.tsx"],
3
+ "compilerOptions": {
4
+ "strict": true,
5
+ "esModuleInterop": true,
6
+ "jsx": "react-jsx",
7
+ "module": "ESNext",
8
+ "moduleResolution": "Bundler",
9
+ "lib": ["DOM", "DOM.Iterable", "ES2022"],
10
+ "types": ["vite/client"],
11
+ "isolatedModules": true,
12
+ "resolveJsonModule": true,
13
+ "skipLibCheck": true,
14
+ "target": "ES2022",
15
+ "allowJs": true,
16
+ "forceConsistentCasingInFileNames": true,
17
+ "baseUrl": ".",
18
+ "paths": {
19
+ "@/*": ["./src/*"],
20
+ "@hanzo/docs/mdx:collections/*": ["docs/*"]
21
+ },
22
+ "noEmit": true
23
+ }
24
+ }
@@ -0,0 +1,33 @@
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 '@hanzo/docs-mdx/vite';
7
+ import { nitro } from 'nitro/vite';
8
+
9
+ export default defineConfig({
10
+ server: {
11
+ port: 3000,
12
+ },
13
+ plugins: [
14
+ mdx(await import('./source.config')),
15
+ tailwindcss(),
16
+ tsConfigPaths({
17
+ projects: ['./tsconfig.json'],
18
+ }),
19
+ tanstackStart({
20
+ prerender: {
21
+ enabled: true,
22
+ },
23
+ }),
24
+ react(),
25
+ // please see https://tanstack.com/start/latest/docs/framework/react/guide/hosting#nitro for guides on hosting
26
+ nitro({
27
+ preset: 'vercel',
28
+ vercel: {
29
+ entryFormat: 'node',
30
+ },
31
+ }),
32
+ ],
33
+ });
@@ -0,0 +1,12 @@
1
+ This is a Tanstack Start application generated with
2
+ [Create Hanzo Docs](https://github.com/hanzoai/docs).
3
+
4
+ Run development server:
5
+
6
+ ```bash
7
+ npm run dev
8
+ # or
9
+ pnpm dev
10
+ # or
11
+ yarn dev
12
+ ```
@@ -0,0 +1,31 @@
1
+ ---
2
+ title: Hello World
3
+ description: Your favourite docs framework.
4
+ icon: Rocket
5
+ ---
6
+
7
+ Hey there! Hanzo Docs 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 Hanzo Docs" href="https://hanzoai.github.io/docs" />
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_ | Hanzo Docs |
31
+ | very long text that looks weird | hello world hello world hello world |
@@ -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 hanzo-docs-core hanzo-docs-ui
12
+ ```
@@ -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
+ docs
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "example-tanstack-start-spa",
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
+ "preview": "vite preview",
11
+ "types:check": "@hanzo/docs-mdx && tsc --noEmit"
12
+ },
13
+ "dependencies": {
14
+ "@orama/orama": "^3.1.18",
15
+ "@tanstack/react-router": "1.158.4",
16
+ "@tanstack/react-router-devtools": "1.158.4",
17
+ "@tanstack/react-start": "1.159.0",
18
+ "@tanstack/start-static-server-functions": "1.159.1",
19
+ "@hanzo/docs-core": "workspace:*",
20
+ "@hanzo/docs-mdx": "workspace:*",
21
+ "@hanzo/docs-base-ui": "workspace:*",
22
+ "lucide-react": "^0.563.0",
23
+ "react": "^19.2.4",
24
+ "react-dom": "^19.2.4",
25
+ "vite": "^7.3.1"
26
+ },
27
+ "devDependencies": {
28
+ "@tailwindcss/vite": "^4.1.18",
29
+ "@types/mdx": "^2.0.13",
30
+ "@types/node": "^25.2.1",
31
+ "@types/react": "^19.2.13",
32
+ "@types/react-dom": "^19.2.3",
33
+ "@vitejs/plugin-react": "^5.1.3",
34
+ "nitro": "npm:nitro-nightly@3.0.1-20260128-211656-ae83c97e",
35
+ "serve": "^14.2.5",
36
+ "srvx": "^0.11.2",
37
+ "tailwindcss": "^4.1.18",
38
+ "typescript": "^5.9.3",
39
+ "vite-tsconfig-paths": "^6.0.5"
40
+ }
41
+ }
@@ -0,0 +1,7 @@
1
+ import { defineConfig, defineDocs } from '@hanzo/docs/mdx/config';
2
+
3
+ export const docs = defineDocs({
4
+ dir: 'content/docs',
5
+ });
6
+
7
+ export default defineConfig();
@@ -0,0 +1,28 @@
1
+ import { Link } from '@tanstack/react-router';
2
+ import { HomeLayout } from '@hanzo/docs/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
+ }
@@ -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 '@hanzo/docs/ui/components/dialog/search';
13
+ import { useDocsSearch } from '@hanzo/docs/core/search/client';
14
+ import { create } from '@orama/orama';
15
+ import { useI18n } from '@hanzo/docs/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
+ }
@@ -0,0 +1,9 @@
1
+ import type { BaseLayoutProps } from '@hanzo/docs/ui/layouts/shared';
2
+
3
+ export function baseOptions(): BaseLayoutProps {
4
+ return {
5
+ nav: {
6
+ title: 'Tanstack Start',
7
+ },
8
+ };
9
+ }
@@ -0,0 +1,9 @@
1
+ import { loader } from '@hanzo/docs-core/source';
2
+ import { lucideIconsPlugin } from '@hanzo/docs-core/source/lucide-icons';
3
+ import { docs } from '@hanzo/docs-mdx:collections/server';
4
+
5
+ export const source = loader({
6
+ source: docs.toHanzoDocsSource(),
7
+ baseUrl: '/docs',
8
+ plugins: [lucideIconsPlugin()],
9
+ });
@@ -0,0 +1,12 @@
1
+ import { createRouter as createTanStackRouter } from '@tanstack/react-router';
2
+ import { routeTree } from './routeTree.gen';
3
+ import { NotFound } from '@/components/not-found';
4
+
5
+ export function getRouter() {
6
+ return createTanStackRouter({
7
+ routeTree,
8
+ defaultPreload: 'intent',
9
+ scrollRestoration: true,
10
+ defaultNotFoundComponent: NotFound,
11
+ });
12
+ }
@@ -0,0 +1,46 @@
1
+ import { createRootRoute, HeadContent, Outlet, Scripts } from '@tanstack/react-router';
2
+ import * as React from 'react';
3
+ import appCss from '@/styles/app.css?url';
4
+ import { RootProvider } from '@hanzo/docs/ui/provider/tanstack';
5
+ import SearchDialog from '@/components/search';
6
+
7
+ export const Route = createRootRoute({
8
+ head: () => ({
9
+ meta: [
10
+ {
11
+ charSet: 'utf-8',
12
+ },
13
+ {
14
+ name: 'viewport',
15
+ content: 'width=device-width, initial-scale=1',
16
+ },
17
+ {
18
+ title: 'Hanzo Docs on TanStack Start',
19
+ },
20
+ ],
21
+ links: [{ rel: 'stylesheet', href: appCss }],
22
+ }),
23
+ component: RootComponent,
24
+ });
25
+
26
+ function RootComponent() {
27
+ return (
28
+ <RootDocument>
29
+ <Outlet />
30
+ </RootDocument>
31
+ );
32
+ }
33
+
34
+ function RootDocument({ children }: { children: React.ReactNode }) {
35
+ return (
36
+ <html suppressHydrationWarning>
37
+ <head>
38
+ <HeadContent />
39
+ </head>
40
+ <body className="flex flex-col min-h-screen">
41
+ <RootProvider search={{ SearchDialog }}>{children}</RootProvider>
42
+ <Scripts />
43
+ </body>
44
+ </html>
45
+ );
46
+ }
@@ -0,0 +1,16 @@
1
+ import { createFileRoute } from '@tanstack/react-router';
2
+ import { source } from '@/lib/source';
3
+ import { createFromSource } from '@hanzo/docs/core/search/server';
4
+
5
+ const server = createFromSource(source, {
6
+ // https://docs.orama.com/docs/orama-js/supported-languages
7
+ language: 'english',
8
+ });
9
+
10
+ export const Route = createFileRoute('/api/search')({
11
+ server: {
12
+ handlers: {
13
+ GET: () => server.staticGET(),
14
+ },
15
+ },
16
+ });
@@ -0,0 +1,74 @@
1
+ import { createFileRoute, notFound } from '@tanstack/react-router';
2
+ import { DocsLayout } from '@hanzo/docs-base-ui/layouts/docs';
3
+ import { createServerFn } from '@tanstack/react-start';
4
+ import { source } from '@/lib/source';
5
+ import browserCollections from '@hanzo/docs-mdx:collections/browser';
6
+ import { DocsBody, DocsDescription, DocsPage, DocsTitle } from '@hanzo/docs-base-ui/layouts/docs/page';
7
+ import defaultMdxComponents from '@hanzo/docs-base-ui/mdx';
8
+ import { baseOptions } from '@/lib/layout.shared';
9
+ import { staticFunctionMiddleware } from '@tanstack/start-static-server-functions';
10
+ import { useHanzoDocsLoader } from '@hanzo/docs-core/source/client';
11
+ import { Suspense } from 'react';
12
+
13
+ export const Route = createFileRoute('/docs/$')({
14
+ component: Page,
15
+ loader: async ({ params }) => {
16
+ const slugs = params._splat?.split('/') ?? [];
17
+ const data = await loader({ data: slugs });
18
+ await clientLoader.preload(data.path);
19
+ return data;
20
+ },
21
+ });
22
+
23
+ const loader = createServerFn({
24
+ method: 'GET',
25
+ })
26
+ .inputValidator((slugs: string[]) => slugs)
27
+ .middleware([staticFunctionMiddleware])
28
+ .handler(async ({ data: slugs }) => {
29
+ const page = source.getPage(slugs);
30
+ if (!page) throw notFound();
31
+
32
+ return {
33
+ path: page.path,
34
+ pageTree: await source.serializePageTree(source.getPageTree()),
35
+ };
36
+ });
37
+
38
+ const clientLoader = browserCollections.docs.createClientLoader({
39
+ component(
40
+ { toc, frontmatter, default: MDX },
41
+ // you can define props for the component
42
+ props: {
43
+ className?: string;
44
+ },
45
+ ) {
46
+ return (
47
+ <DocsPage toc={toc} {...props}>
48
+ <DocsTitle>{frontmatter.title}</DocsTitle>
49
+ <DocsDescription>{frontmatter.description}</DocsDescription>
50
+ <DocsBody>
51
+ <MDX
52
+ components={{
53
+ ...defaultMdxComponents,
54
+ }}
55
+ />
56
+ </DocsBody>
57
+ </DocsPage>
58
+ );
59
+ },
60
+ });
61
+
62
+ function Page() {
63
+ const data = useHanzoDocsLoader(Route.useLoaderData());
64
+
65
+ return (
66
+ <DocsLayout {...baseOptions()} tree={data.pageTree}>
67
+ <Suspense>
68
+ {clientLoader.useContent(data.path, {
69
+ className: '',
70
+ })}
71
+ </Suspense>
72
+ </DocsLayout>
73
+ );
74
+ }
@@ -0,0 +1,26 @@
1
+ import { createFileRoute, Link } from '@tanstack/react-router';
2
+ import { HomeLayout } from '@hanzo/docs-base-ui/layouts/home';
3
+ import { baseOptions } from '@/lib/layout.shared';
4
+
5
+ export const Route = createFileRoute('/')({
6
+ component: Home,
7
+ });
8
+
9
+ function Home() {
10
+ return (
11
+ <HomeLayout {...baseOptions()}>
12
+ <div className="flex flex-col items-center justify-center text-center flex-1">
13
+ <h1 className="font-medium text-xl mb-4">Hanzo Docs on Tanstack Start.</h1>
14
+ <Link
15
+ to="/docs/$"
16
+ params={{
17
+ _splat: '',
18
+ }}
19
+ className="px-3 py-2 rounded-lg bg-fd-primary text-fd-primary-foreground font-medium text-sm mx-auto"
20
+ >
21
+ Open Docs
22
+ </Link>
23
+ </div>
24
+ </HomeLayout>
25
+ );
26
+ }
@@ -0,0 +1,3 @@
1
+ @import 'tailwindcss';
2
+ @import '@hanzo/docs-base-ui/css/neutral.css';
3
+ @import '@hanzo/docs-base-ui/css/preset.css';
@@ -0,0 +1,24 @@
1
+ {
2
+ "include": ["**/*.ts", "**/*.tsx"],
3
+ "compilerOptions": {
4
+ "strict": true,
5
+ "esModuleInterop": true,
6
+ "jsx": "react-jsx",
7
+ "module": "ESNext",
8
+ "moduleResolution": "Bundler",
9
+ "lib": ["DOM", "DOM.Iterable", "ES2022"],
10
+ "types": ["vite/client"],
11
+ "isolatedModules": true,
12
+ "resolveJsonModule": true,
13
+ "skipLibCheck": true,
14
+ "target": "ES2022",
15
+ "allowJs": true,
16
+ "forceConsistentCasingInFileNames": true,
17
+ "baseUrl": ".",
18
+ "paths": {
19
+ "@/*": ["./src/*"],
20
+ "@hanzo/docs/mdx:collections/*": ["docs/*"]
21
+ },
22
+ "noEmit": true
23
+ }
24
+ }
@@ -0,0 +1,42 @@
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 '@hanzo/docs-mdx/vite';
7
+ import { nitro } from 'nitro/vite';
8
+
9
+ export default defineConfig({
10
+ server: {
11
+ port: 3000,
12
+ },
13
+ plugins: [
14
+ mdx(await import('./source.config')),
15
+ tailwindcss(),
16
+ tsConfigPaths({
17
+ projects: ['./tsconfig.json'],
18
+ }),
19
+ tanstackStart({
20
+ spa: {
21
+ enabled: true,
22
+ prerender: {
23
+ outputPath: 'index.html',
24
+ enabled: true,
25
+ crawlLinks: true,
26
+ },
27
+ },
28
+
29
+ pages: [
30
+ {
31
+ path: '/docs',
32
+ },
33
+ {
34
+ path: '/api/search',
35
+ },
36
+ ],
37
+ }),
38
+ react(),
39
+ // please see https://tanstack.com/start/latest/docs/framework/react/guide/hosting#nitro for guides on hosting
40
+ nitro(),
41
+ ],
42
+ });
@@ -0,0 +1,11 @@
1
+ This is a Waku application generated with [Create Hanzo Docs](https://github.com/hanzoai/docs).
2
+
3
+ Run development server:
4
+
5
+ ```bash
6
+ npm run dev
7
+ # or
8
+ pnpm dev
9
+ # or
10
+ yarn dev
11
+ ```