@farming-labs/next 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.
Files changed (2) hide show
  1. package/README.md +88 -0
  2. package/package.json +3 -3
package/README.md ADDED
@@ -0,0 +1,88 @@
1
+ # @farming-labs/next
2
+
3
+ The Next.js App Router adapter for
4
+ [`@farming-labs/docs`](https://www.npmjs.com/package/@farming-labs/docs).
5
+
6
+ It connects the shared docs configuration and theme to Next.js, compiles Markdown and MDX,
7
+ generates the standard docs routes, and provides Next-native runtime helpers for documentation
8
+ APIs, API references, MCP, and changelogs.
9
+
10
+ ## What this package does
11
+
12
+ - Wraps `next.config.ts` with the Farming Labs MDX and routing integration
13
+ - Generates missing docs layouts, API routes, MCP routes, and enabled feature routes
14
+ - Adds machine-readable Markdown, agent discovery, sitemap, and `llms.txt` rewrites
15
+ - Provides App Router layout, metadata, API-reference, and changelog helpers
16
+ - Preserves user-authored files and existing Next.js configuration
17
+
18
+ The shared config and CLI live in `@farming-labs/docs`. React UI, MDX components, providers, and
19
+ theme CSS live in `@farming-labs/theme`.
20
+
21
+ ## Install
22
+
23
+ The CLI can add docs to an existing Next.js project:
24
+
25
+ ```bash
26
+ npx @farming-labs/docs@latest init
27
+ ```
28
+
29
+ For manual installation:
30
+
31
+ ```bash
32
+ npm install @farming-labs/docs @farming-labs/next @farming-labs/theme
33
+ ```
34
+
35
+ ## Minimal setup
36
+
37
+ Create `docs.config.ts` with `defineDocs()`, then wrap the Next.js config:
38
+
39
+ ```ts
40
+ // next.config.ts
41
+ import { withDocs } from "@farming-labs/next/config";
42
+
43
+ export default withDocs();
44
+ ```
45
+
46
+ Existing Next.js configuration can be passed directly:
47
+
48
+ ```ts
49
+ export default withDocs({
50
+ reactStrictMode: true,
51
+ });
52
+ ```
53
+
54
+ Import the selected theme in your global stylesheet:
55
+
56
+ ```css
57
+ @import "tailwindcss";
58
+ @import "@farming-labs/theme/default/css";
59
+ ```
60
+
61
+ Write documentation pages under `app/docs/` or `src/app/docs/`. The CLI also adds the root
62
+ `RootProvider`, generated docs layout, and server routes needed for a complete setup.
63
+
64
+ ## Main entrypoints
65
+
66
+ | Entrypoint | Purpose |
67
+ | --- | --- |
68
+ | `@farming-labs/next/config` | `withDocs()` Next.js configuration wrapper |
69
+ | `@farming-labs/next/layout` | App Router docs layout and metadata helpers |
70
+ | `@farming-labs/next/api` | Docs API and MCP route handlers |
71
+ | `@farming-labs/next/api-reference` | Generated API-reference routes and pages |
72
+ | `@farming-labs/next/changelog` | Generated changelog page helpers |
73
+
74
+ ## Requirements
75
+
76
+ - Next.js 16 or newer
77
+ - React and React DOM 19.2 or newer
78
+ - `@farming-labs/docs` and `@farming-labs/theme`
79
+
80
+ ## Learn more
81
+
82
+ - [Documentation](https://docs.farming-labs.dev/docs)
83
+ - [Next.js example](https://github.com/farming-labs/docs/tree/main/examples/next)
84
+ - [GitHub repository](https://github.com/farming-labs/docs)
85
+
86
+ ## License
87
+
88
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farming-labs/next",
3
- "version": "0.2.49",
3
+ "version": "0.2.52",
4
4
  "description": "Next.js adapter for @farming-labs/docs — MDX config wrapper",
5
5
  "keywords": [
6
6
  "docs",
@@ -106,8 +106,8 @@
106
106
  "tsdown": "^0.20.3",
107
107
  "typescript": "^5.9.3",
108
108
  "vitest": "^4.1.8",
109
- "@farming-labs/theme": "0.2.49",
110
- "@farming-labs/docs": "0.2.49"
109
+ "@farming-labs/docs": "0.2.52",
110
+ "@farming-labs/theme": "0.2.52"
111
111
  },
112
112
  "peerDependencies": {
113
113
  "@farming-labs/docs": ">=0.0.1",