@farming-labs/nuxt 0.2.50 → 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 +76 -0
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# @farming-labs/nuxt
|
|
2
|
+
|
|
3
|
+
The Nuxt and Nitro runtime adapter for
|
|
4
|
+
[`@farming-labs/docs`](https://www.npmjs.com/package/@farming-labs/docs).
|
|
5
|
+
|
|
6
|
+
It loads Markdown and MDX content from Nitro storage, builds navigation, renders page content on
|
|
7
|
+
the server, and provides H3 handlers for docs, search, AI, agent discovery, MCP, and API references.
|
|
8
|
+
|
|
9
|
+
## Package responsibilities
|
|
10
|
+
|
|
11
|
+
- `@farming-labs/docs` — shared config, types, content features, and CLI
|
|
12
|
+
- `@farming-labs/nuxt` — Nitro content loading and server handlers
|
|
13
|
+
- `@farming-labs/nuxt-theme` — Vue layout and UI components
|
|
14
|
+
- `@farming-labs/theme` — shared preset CSS
|
|
15
|
+
|
|
16
|
+
## Install
|
|
17
|
+
|
|
18
|
+
The CLI can wire the complete Nuxt integration:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npx @farming-labs/docs@latest init
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
For manual installation:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npm install @farming-labs/docs @farming-labs/nuxt @farming-labs/nuxt-theme @farming-labs/theme
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Server integration
|
|
31
|
+
|
|
32
|
+
Create the main Nitro API handler:
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
// server/api/docs.ts
|
|
36
|
+
import { defineDocsHandler } from "@farming-labs/nuxt/server";
|
|
37
|
+
import config from "../../docs.config";
|
|
38
|
+
|
|
39
|
+
export default defineDocsHandler(config, useStorage);
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
The generated setup also adds public-route middleware with `defineDocsPublicHandler()` and makes
|
|
43
|
+
the docs directory available through Nitro storage:
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
// nuxt.config.ts
|
|
47
|
+
export default defineNuxtConfig({
|
|
48
|
+
css: ["@farming-labs/theme/default/css"],
|
|
49
|
+
nitro: {
|
|
50
|
+
moduleSideEffects: ["@farming-labs/nuxt/server"],
|
|
51
|
+
serverAssets: [{ baseName: "docs", dir: "docs" }],
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Render the returned page data with `DocsLayout` and `DocsContent` from
|
|
57
|
+
`@farming-labs/nuxt-theme`.
|
|
58
|
+
|
|
59
|
+
## Main entrypoints
|
|
60
|
+
|
|
61
|
+
| Entrypoint | Purpose |
|
|
62
|
+
| --- | --- |
|
|
63
|
+
| `@farming-labs/nuxt/server` | Nitro handlers, docs server, public forwarding, and MCP |
|
|
64
|
+
| `@farming-labs/nuxt/content` | Content discovery and navigation utilities |
|
|
65
|
+
| `@farming-labs/nuxt/markdown` | Server-side Markdown rendering |
|
|
66
|
+
| `@farming-labs/nuxt/api-reference` | API-reference route handler |
|
|
67
|
+
|
|
68
|
+
## Learn more
|
|
69
|
+
|
|
70
|
+
- [Documentation](https://docs.farming-labs.dev/docs)
|
|
71
|
+
- [Nuxt example](https://github.com/farming-labs/docs/tree/main/examples/nuxt)
|
|
72
|
+
- [GitHub repository](https://github.com/farming-labs/docs)
|
|
73
|
+
|
|
74
|
+
## License
|
|
75
|
+
|
|
76
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farming-labs/nuxt",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.52",
|
|
4
4
|
"description": "Nuxt adapter for @farming-labs/docs — content loading and navigation utilities",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"docs",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@types/node": "^22.10.0",
|
|
53
53
|
"typescript": "^5.9.3",
|
|
54
|
-
"@farming-labs/docs": "0.2.
|
|
54
|
+
"@farming-labs/docs": "0.2.52"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
57
|
"@farming-labs/docs": "*"
|