@farming-labs/next 0.1.21 → 0.1.23
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/dist/config.mjs +13 -1
- package/package.json +3 -3
package/dist/config.mjs
CHANGED
|
@@ -76,6 +76,7 @@ export const { GET, POST } = createDocsAPI({
|
|
|
76
76
|
i18n: docsConfig.i18n,
|
|
77
77
|
changelog: docsConfig.changelog,
|
|
78
78
|
feedback: docsConfig.feedback,
|
|
79
|
+
mcp: docsConfig.mcp,
|
|
79
80
|
search: docsConfig.search,
|
|
80
81
|
ai: docsConfig.ai,
|
|
81
82
|
});
|
|
@@ -145,6 +146,7 @@ const FILE_EXTS = [
|
|
|
145
146
|
];
|
|
146
147
|
const INTERNAL_DOCS_CONFIG_ALIAS = "@farming-labs/next-internal-docs-config";
|
|
147
148
|
const NEXT_PACKAGE_ROOT = fileURLToPath(new URL("..", import.meta.url));
|
|
149
|
+
const DEFAULT_AGENT_SPEC_ROUTE = "/api/docs/agent/spec";
|
|
148
150
|
const DEFAULT_AGENT_FEEDBACK_ROUTE = "/api/docs/agent/feedback";
|
|
149
151
|
function resolvePackageAlias(packageName, fallbacks = []) {
|
|
150
152
|
return [join(NEXT_PACKAGE_ROOT, "node_modules", packageName), ...fallbacks.map((value) => join(NEXT_PACKAGE_ROOT, value))].find((value) => existsSync(value));
|
|
@@ -701,6 +703,12 @@ function buildDocsMarkdownRewrites(entry) {
|
|
|
701
703
|
destination: "/api/docs?format=markdown&path=:slug*"
|
|
702
704
|
}];
|
|
703
705
|
}
|
|
706
|
+
function buildAgentSpecRewrites() {
|
|
707
|
+
return [{
|
|
708
|
+
source: DEFAULT_AGENT_SPEC_ROUTE,
|
|
709
|
+
destination: "/api/docs?agent=spec"
|
|
710
|
+
}];
|
|
711
|
+
}
|
|
704
712
|
function buildAgentFeedbackRewrites(config) {
|
|
705
713
|
if (!config.enabled) return [];
|
|
706
714
|
return [{
|
|
@@ -723,7 +731,11 @@ function dedupeRewrites(rewrites) {
|
|
|
723
731
|
return result;
|
|
724
732
|
}
|
|
725
733
|
function mergeDocsMarkdownRewrites(entry, agentFeedback, result) {
|
|
726
|
-
const autoRewrites = [
|
|
734
|
+
const autoRewrites = [
|
|
735
|
+
...buildAgentSpecRewrites(),
|
|
736
|
+
...buildDocsMarkdownRewrites(entry),
|
|
737
|
+
...buildAgentFeedbackRewrites(agentFeedback)
|
|
738
|
+
];
|
|
727
739
|
if (!result) return [...autoRewrites];
|
|
728
740
|
if (Array.isArray(result)) return dedupeRewrites([...autoRewrites, ...result]);
|
|
729
741
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farming-labs/next",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.23",
|
|
4
4
|
"description": "Next.js adapter for @farming-labs/docs — MDX config wrapper",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"docs",
|
|
@@ -95,8 +95,8 @@
|
|
|
95
95
|
"tsdown": "^0.20.3",
|
|
96
96
|
"typescript": "^5.9.3",
|
|
97
97
|
"vitest": "^3.2.4",
|
|
98
|
-
"@farming-labs/docs": "0.1.
|
|
99
|
-
"@farming-labs/theme": "0.1.
|
|
98
|
+
"@farming-labs/docs": "0.1.23",
|
|
99
|
+
"@farming-labs/theme": "0.1.23"
|
|
100
100
|
},
|
|
101
101
|
"peerDependencies": {
|
|
102
102
|
"@farming-labs/docs": ">=0.0.1",
|