@farming-labs/astro 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 +75 -0
  2. package/package.json +2 -2
package/README.md ADDED
@@ -0,0 +1,75 @@
1
+ # @farming-labs/astro
2
+
3
+ The Astro runtime adapter for
4
+ [`@farming-labs/docs`](https://www.npmjs.com/package/@farming-labs/docs).
5
+
6
+ It loads Markdown and MDX content, builds navigation, renders page content on the server, and
7
+ provides Astro 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/astro` — Astro content loading and server handlers
13
+ - `@farming-labs/astro-theme` — Astro layout and UI components
14
+ - `@farming-labs/theme` — shared preset CSS
15
+
16
+ ## Install
17
+
18
+ The CLI can wire the complete Astro 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/astro @farming-labs/astro-theme @farming-labs/theme
28
+ ```
29
+
30
+ Dynamic docs routes also require an Astro server adapter such as `@astrojs/vercel`,
31
+ `@astrojs/netlify`, `@astrojs/node`, or `@astrojs/cloudflare`.
32
+
33
+ ## Server integration
34
+
35
+ Preload content with Vite and create the docs server:
36
+
37
+ ```ts
38
+ // src/lib/docs.server.ts
39
+ import { createDocsServer } from "@farming-labs/astro/server";
40
+ import config from "./docs.config";
41
+
42
+ const contentFiles = import.meta.glob("/docs/**/*.{md,mdx}", {
43
+ query: "?raw",
44
+ import: "default",
45
+ eager: true,
46
+ }) as Record<string, string>;
47
+
48
+ export const { load, GET, POST, MCP } = createDocsServer({
49
+ ...config,
50
+ _preloadedContent: contentFiles,
51
+ });
52
+ ```
53
+
54
+ Call `load(Astro.url.pathname)` from the docs page and render the result with components from
55
+ `@farming-labs/astro-theme`. The CLI generates the pages, API routes, public forwarding, theme
56
+ CSS import, and Astro adapter configuration.
57
+
58
+ ## Main entrypoints
59
+
60
+ | Entrypoint | Purpose |
61
+ | --- | --- |
62
+ | `@farming-labs/astro/server` | Docs server, loaders, API/MCP handlers, and API-reference helper |
63
+ | `@farming-labs/astro/content` | Content discovery and navigation utilities |
64
+ | `@farming-labs/astro/markdown` | Server-side Markdown rendering |
65
+ | `@farming-labs/astro/api-reference` | API-reference route handler |
66
+
67
+ ## Learn more
68
+
69
+ - [Documentation](https://docs.farming-labs.dev/docs)
70
+ - [Astro example](https://github.com/farming-labs/docs/tree/main/examples/astro)
71
+ - [GitHub repository](https://github.com/farming-labs/docs)
72
+
73
+ ## License
74
+
75
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farming-labs/astro",
3
- "version": "0.2.49",
3
+ "version": "0.2.52",
4
4
  "description": "Astro adapter for @farming-labs/docs — content loading and navigation utilities",
5
5
  "keywords": [
6
6
  "astro",
@@ -50,7 +50,7 @@
50
50
  "devDependencies": {
51
51
  "@types/node": "^22.10.0",
52
52
  "typescript": "^5.9.3",
53
- "@farming-labs/docs": "0.2.49"
53
+ "@farming-labs/docs": "0.2.52"
54
54
  },
55
55
  "peerDependencies": {
56
56
  "@farming-labs/docs": "*"