@farming-labs/farmjs 0.2.95 → 0.2.97
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 +4 -1
- package/dist/module-map.d.ts +9 -0
- package/dist/module-map.d.ts.map +1 -0
- package/dist/module-map.js +19 -0
- package/dist/module-map.js.map +1 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -50,7 +50,9 @@ also gives the application a normal place for project-specific overrides:
|
|
|
50
50
|
```
|
|
51
51
|
|
|
52
52
|
The theme factory in `docs.config.ts` and the CSS entrypoint must describe the
|
|
53
|
-
same theme.
|
|
53
|
+
same theme. This is the same unified CSS entrypoint used by the Next.js,
|
|
54
|
+
TanStack Start, SvelteKit, Astro, and Nuxt integrations. The adapter does not
|
|
55
|
+
ship or inject a second Farm-specific theme stylesheet.
|
|
54
56
|
|
|
55
57
|
## Server wrapper
|
|
56
58
|
|
|
@@ -82,6 +84,7 @@ pipeline without taking over application routes. The server also exposes
|
|
|
82
84
|
| `@farming-labs/farmjs/react` | React documentation page renderer |
|
|
83
85
|
| `@farming-labs/farmjs/content` | Content and navigation utilities |
|
|
84
86
|
| `@farming-labs/farmjs/vite` | MDX compilation plugin |
|
|
87
|
+
| `@farming-labs/farmjs/runtime` | Versioned Farm runtime contract |
|
|
85
88
|
| `@farming-labs/farmjs/api-reference` | Farm API-reference handler |
|
|
86
89
|
|
|
87
90
|
## License
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function normalizeDocsModuleKey(key: string): string;
|
|
2
|
+
/**
|
|
3
|
+
* Resolve a compiled MDX module using the route-relative source path emitted
|
|
4
|
+
* by the docs server. Vite preserves the application source prefix in
|
|
5
|
+
* production glob keys (for example `/src/app/docs/guide/page.mdx`) while the
|
|
6
|
+
* runtime data intentionally stays portable (`/guide/page.mdx`).
|
|
7
|
+
*/
|
|
8
|
+
export declare function resolveDocsModule<T>(modules: Record<string, T>, sourcePath: string): T | undefined;
|
|
9
|
+
//# sourceMappingURL=module-map.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-map.d.ts","sourceRoot":"","sources":["../src/module-map.ts"],"names":[],"mappings":"AAAA,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAG1D;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EACjC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,EAC1B,UAAU,EAAE,MAAM,GACjB,CAAC,GAAG,SAAS,CAUf"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export function normalizeDocsModuleKey(key) {
|
|
2
|
+
const posixKey = key.replace(/\\/g, "/");
|
|
3
|
+
return posixKey.startsWith("/") ? posixKey : `/${posixKey.replace(/^\.?\//, "")}`;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Resolve a compiled MDX module using the route-relative source path emitted
|
|
7
|
+
* by the docs server. Vite preserves the application source prefix in
|
|
8
|
+
* production glob keys (for example `/src/app/docs/guide/page.mdx`) while the
|
|
9
|
+
* runtime data intentionally stays portable (`/guide/page.mdx`).
|
|
10
|
+
*/
|
|
11
|
+
export function resolveDocsModule(modules, sourcePath) {
|
|
12
|
+
const normalizedSourcePath = normalizeDocsModuleKey(sourcePath);
|
|
13
|
+
const directMatch = modules[normalizedSourcePath];
|
|
14
|
+
if (directMatch !== undefined)
|
|
15
|
+
return directMatch;
|
|
16
|
+
const suffixMatches = Object.entries(modules).filter(([key]) => normalizeDocsModuleKey(key).endsWith(normalizedSourcePath));
|
|
17
|
+
return suffixMatches.length === 1 ? suffixMatches[0][1] : undefined;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=module-map.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-map.js","sourceRoot":"","sources":["../src/module-map.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,sBAAsB,CAAC,GAAW;IAChD,MAAM,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACzC,OAAO,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,EAAE,CAAC;AACpF,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAC/B,OAA0B,EAC1B,UAAkB;IAElB,MAAM,oBAAoB,GAAG,sBAAsB,CAAC,UAAU,CAAC,CAAC;IAChE,MAAM,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAClD,IAAI,WAAW,KAAK,SAAS;QAAE,OAAO,WAAW,CAAC;IAElD,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAC7D,sBAAsB,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,oBAAoB,CAAC,CAC3D,CAAC;IAEF,OAAO,aAAa,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACtE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farming-labs/farmjs",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.97",
|
|
4
4
|
"description": "Farm.js adapter for @farming-labs/docs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"docs",
|
|
@@ -77,8 +77,8 @@
|
|
|
77
77
|
"typescript": "^5.9.3",
|
|
78
78
|
"vite": "^7.3.5",
|
|
79
79
|
"vitest": "^4.1.8",
|
|
80
|
-
"@farming-labs/docs": "0.2.
|
|
81
|
-
"@farming-labs/theme": "0.2.
|
|
80
|
+
"@farming-labs/docs": "0.2.97",
|
|
81
|
+
"@farming-labs/theme": "0.2.97"
|
|
82
82
|
},
|
|
83
83
|
"peerDependencies": {
|
|
84
84
|
"@farm.js/core": "^0.1.0-beta.19",
|