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