@farming-labs/tanstack-start 0.2.49 → 0.2.52
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/README.md +91 -0
- package/package.json +3 -3
package/README.md
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# @farming-labs/tanstack-start
|
|
2
|
+
|
|
3
|
+
The TanStack Start adapter for
|
|
4
|
+
[`@farming-labs/docs`](https://www.npmjs.com/package/@farming-labs/docs).
|
|
5
|
+
|
|
6
|
+
It compiles Markdown and MDX with Vite, loads documentation content on the server, builds
|
|
7
|
+
navigation and page metadata, exposes docs and MCP handlers, and renders pages with the Farming
|
|
8
|
+
Labs React theme.
|
|
9
|
+
|
|
10
|
+
## What this package does
|
|
11
|
+
|
|
12
|
+
- Adds the Farming Labs MDX pipeline to Vite
|
|
13
|
+
- Loads filesystem content and builds navigation trees on the server
|
|
14
|
+
- Provides handlers for pages, search, AI, agent discovery, MCP, and API references
|
|
15
|
+
- Supplies the `TanstackDocsPage` React renderer for TanStack Router routes
|
|
16
|
+
|
|
17
|
+
The shared config and CLI live in `@farming-labs/docs`. Providers, React UI, MDX components, and
|
|
18
|
+
theme CSS live in `@farming-labs/theme`.
|
|
19
|
+
|
|
20
|
+
## Install
|
|
21
|
+
|
|
22
|
+
The CLI can scaffold the full integration:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npx @farming-labs/docs@latest init
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
For manual installation:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npm install @farming-labs/docs @farming-labs/tanstack-start @farming-labs/theme
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Minimal setup
|
|
35
|
+
|
|
36
|
+
Add the docs MDX plugin before the TanStack Start plugin:
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
// vite.config.ts
|
|
40
|
+
import { tanstackStart } from "@tanstack/react-start/plugin/vite";
|
|
41
|
+
import { docsMdx } from "@farming-labs/tanstack-start/vite";
|
|
42
|
+
import { defineConfig } from "vite";
|
|
43
|
+
|
|
44
|
+
export default defineConfig({
|
|
45
|
+
plugins: [docsMdx(), tanstackStart()],
|
|
46
|
+
});
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Create the server integration:
|
|
50
|
+
|
|
51
|
+
```ts
|
|
52
|
+
// src/lib/docs.server.ts
|
|
53
|
+
import { createDocsServer } from "@farming-labs/tanstack-start/server";
|
|
54
|
+
import docsConfig from "../../docs.config";
|
|
55
|
+
|
|
56
|
+
export const docsServer = createDocsServer({
|
|
57
|
+
...docsConfig,
|
|
58
|
+
rootDir: process.cwd(),
|
|
59
|
+
});
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Render loaded page data with the React adapter:
|
|
63
|
+
|
|
64
|
+
```tsx
|
|
65
|
+
import { TanstackDocsPage } from "@farming-labs/tanstack-start/react";
|
|
66
|
+
|
|
67
|
+
<TanstackDocsPage config={docsConfig} data={loaderData} />;
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
A complete integration also needs docs and API routes, `RootProvider` from
|
|
71
|
+
`@farming-labs/theme/tanstack`, and the selected theme CSS. The CLI creates those files.
|
|
72
|
+
|
|
73
|
+
## Main entrypoints
|
|
74
|
+
|
|
75
|
+
| Entrypoint | Purpose |
|
|
76
|
+
| --- | --- |
|
|
77
|
+
| `@farming-labs/tanstack-start/vite` | Vite MDX compilation plugin |
|
|
78
|
+
| `@farming-labs/tanstack-start/server` | Content loading and docs API/MCP handlers |
|
|
79
|
+
| `@farming-labs/tanstack-start/react` | `TanstackDocsPage` renderer |
|
|
80
|
+
| `@farming-labs/tanstack-start/content` | Lower-level content and navigation utilities |
|
|
81
|
+
| `@farming-labs/tanstack-start/api-reference` | API-reference route handler |
|
|
82
|
+
|
|
83
|
+
## Learn more
|
|
84
|
+
|
|
85
|
+
- [Documentation](https://docs.farming-labs.dev/docs)
|
|
86
|
+
- [TanStack Start example](https://github.com/farming-labs/docs/tree/main/examples/tanstack-start)
|
|
87
|
+
- [GitHub repository](https://github.com/farming-labs/docs)
|
|
88
|
+
|
|
89
|
+
## License
|
|
90
|
+
|
|
91
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farming-labs/tanstack-start",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.52",
|
|
4
4
|
"description": "TanStack Start adapter for @farming-labs/docs — content loading, search, and AI utilities",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"docs",
|
|
@@ -64,8 +64,8 @@
|
|
|
64
64
|
"react": "^19.2.0",
|
|
65
65
|
"vite": "^7.3.5",
|
|
66
66
|
"typescript": "^5.9.3",
|
|
67
|
-
"@farming-labs/docs": "0.2.
|
|
68
|
-
"@farming-labs/theme": "0.2.
|
|
67
|
+
"@farming-labs/docs": "0.2.52",
|
|
68
|
+
"@farming-labs/theme": "0.2.52"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
71
|
"@farming-labs/docs": "*",
|