@farming-labs/next 0.2.117 → 0.2.118
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/api-reference.d.mts +1 -1
- package/dist/api-reference.mjs +43 -9
- package/dist/changelog.mjs +9 -1
- package/dist/config.mjs +16 -0
- package/package.json +3 -3
package/dist/api-reference.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DocsConfig } from "@farming-labs/docs";
|
|
2
|
-
import { resolveApiReferenceConfig } from "@farming-labs/docs/
|
|
2
|
+
import { resolveApiReferenceConfig } from "@farming-labs/docs/runtime";
|
|
3
3
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region src/api-reference.d.ts
|
package/dist/api-reference.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import DocsClientCallbacks from "./client-callbacks.mjs";
|
|
|
2
2
|
import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
|
|
3
3
|
import { join, relative } from "node:path";
|
|
4
4
|
import { resolveDocsMetadataBaseUrl } from "@farming-labs/docs";
|
|
5
|
-
import { buildApiReferenceHtmlDocumentAsync, buildApiReferenceOpenApiDocumentAsync, buildApiReferencePageTitle, buildApiReferenceScalarCss, createApiReferenceOperationMarkdownResponse, resolveApiReferenceConfig, resolveApiReferenceRenderer, resolveApiReferenceVersion, resolveApiReferenceVersionFromPathname } from "@farming-labs/docs/server";
|
|
6
5
|
import { ApiReference } from "@scalar/nextjs-api-reference";
|
|
6
|
+
import { buildApiReferenceHtmlDocumentAsync, buildApiReferenceOpenApiDocumentAsync, buildApiReferencePageTitle, buildApiReferenceScalarCss, createApiReferenceOperationMarkdownResponse, resolveApiReferenceConfig, resolveApiReferenceRenderer, resolveApiReferenceVersion, resolveApiReferenceVersionFromPathname } from "@farming-labs/docs/runtime";
|
|
7
7
|
import { SidebarTabsDropdown } from "fumadocs-ui/components/sidebar/tabs/dropdown";
|
|
8
8
|
import Link from "next/link";
|
|
9
9
|
import { notFound } from "next/navigation";
|
|
@@ -13,7 +13,15 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
13
13
|
const ROUTE_FILE_RE = /^route\.(ts|tsx|js|jsx)$/;
|
|
14
14
|
const METHOD_RE = /export\s+(?:async\s+function|function|const)\s+(GET|POST|PUT|PATCH|DELETE|OPTIONS|HEAD)\b/g;
|
|
15
15
|
function getNextAppDir(root) {
|
|
16
|
-
if (existsSync(
|
|
16
|
+
if (existsSync(
|
|
17
|
+
/* turbopackIgnore: true */
|
|
18
|
+
join(
|
|
19
|
+
/* turbopackIgnore: true */
|
|
20
|
+
root,
|
|
21
|
+
"src",
|
|
22
|
+
"app"
|
|
23
|
+
)
|
|
24
|
+
)) return "src/app";
|
|
17
25
|
return "app";
|
|
18
26
|
}
|
|
19
27
|
function normalizeRouteRoot(value) {
|
|
@@ -31,8 +39,17 @@ function getRoutePathBase(config) {
|
|
|
31
39
|
}
|
|
32
40
|
function resolveNextApiRouteRoot(root, config) {
|
|
33
41
|
const routeRoot = normalizeRouteRoot(config.routeRoot);
|
|
34
|
-
if (routeRoot === "app" || routeRoot.startsWith("app/") || routeRoot === "src/app" || routeRoot.startsWith("src/app/")) return join(
|
|
35
|
-
|
|
42
|
+
if (routeRoot === "app" || routeRoot.startsWith("app/") || routeRoot === "src/app" || routeRoot.startsWith("src/app/")) return join(
|
|
43
|
+
/* turbopackIgnore: true */
|
|
44
|
+
root,
|
|
45
|
+
...routeRoot.split("/")
|
|
46
|
+
);
|
|
47
|
+
return join(
|
|
48
|
+
/* turbopackIgnore: true */
|
|
49
|
+
root,
|
|
50
|
+
getNextAppDir(root),
|
|
51
|
+
...routeRoot.split("/")
|
|
52
|
+
);
|
|
36
53
|
}
|
|
37
54
|
function shouldExcludeRoute(excludes, routePath, relativeFile, relativeDir) {
|
|
38
55
|
if (excludes.length === 0) return false;
|
|
@@ -78,11 +95,24 @@ function extractMethods(source) {
|
|
|
78
95
|
return Array.from(methods);
|
|
79
96
|
}
|
|
80
97
|
function scanRouteFiles(dir) {
|
|
81
|
-
if (!existsSync(
|
|
98
|
+
if (!existsSync(
|
|
99
|
+
/* turbopackIgnore: true */
|
|
100
|
+
dir
|
|
101
|
+
)) return [];
|
|
82
102
|
const results = [];
|
|
83
|
-
for (const name of readdirSync(
|
|
84
|
-
|
|
85
|
-
|
|
103
|
+
for (const name of readdirSync(
|
|
104
|
+
/* turbopackIgnore: true */
|
|
105
|
+
dir
|
|
106
|
+
)) {
|
|
107
|
+
const full = join(
|
|
108
|
+
/* turbopackIgnore: true */
|
|
109
|
+
dir,
|
|
110
|
+
name
|
|
111
|
+
);
|
|
112
|
+
if (statSync(
|
|
113
|
+
/* turbopackIgnore: true */
|
|
114
|
+
full
|
|
115
|
+
).isDirectory()) {
|
|
86
116
|
results.push(...scanRouteFiles(full));
|
|
87
117
|
continue;
|
|
88
118
|
}
|
|
@@ -160,7 +190,11 @@ function buildApiReferenceRoutes(config) {
|
|
|
160
190
|
const excludes = apiReference.exclude;
|
|
161
191
|
const routes = [];
|
|
162
192
|
for (const file of files) {
|
|
163
|
-
const source = readFileSync(
|
|
193
|
+
const source = readFileSync(
|
|
194
|
+
/* turbopackIgnore: true */
|
|
195
|
+
file,
|
|
196
|
+
"utf-8"
|
|
197
|
+
);
|
|
164
198
|
const methods = extractMethods(source);
|
|
165
199
|
if (methods.length === 0) continue;
|
|
166
200
|
const relativeFile = relative(apiDir, file).replace(/\\/g, "/");
|
package/dist/changelog.mjs
CHANGED
|
@@ -42,7 +42,15 @@ function truncatePaginationDescription(value, maxLength = 110) {
|
|
|
42
42
|
}
|
|
43
43
|
function extractChangelogToc(sourcePath) {
|
|
44
44
|
try {
|
|
45
|
-
return collectDocsMarkdownSections(readFileSync(
|
|
45
|
+
return collectDocsMarkdownSections(readFileSync(
|
|
46
|
+
/* turbopackIgnore: true */
|
|
47
|
+
join(
|
|
48
|
+
/* turbopackIgnore: true */
|
|
49
|
+
process.cwd(),
|
|
50
|
+
sourcePath
|
|
51
|
+
),
|
|
52
|
+
"utf-8"
|
|
53
|
+
)).filter((heading) => heading.level >= 2 && heading.level <= 4 && heading.heading).map((heading) => ({
|
|
46
54
|
title: heading.heading,
|
|
47
55
|
url: `#${encodeURIComponent(heading.id)}`,
|
|
48
56
|
depth: heading.level
|
package/dist/config.mjs
CHANGED
|
@@ -2208,6 +2208,7 @@ function withDocs(nextConfig = {}, docsConfig) {
|
|
|
2208
2208
|
return resolvedConfig;
|
|
2209
2209
|
};
|
|
2210
2210
|
const existingTracingIncludes = nextConfig.outputFileTracingIncludes ?? {};
|
|
2211
|
+
const existingTracingExcludes = nextConfig.outputFileTracingExcludes ?? {};
|
|
2211
2212
|
const docsTraceGlob = docsContentDir.replace(/\\/g, "/").replace(/^\.?\//, "") + "/**/*";
|
|
2212
2213
|
const sitemapManifestTraceFile = DEFAULT_SITEMAP_MANIFEST_PATH;
|
|
2213
2214
|
const docsContentRoot = isAbsolute(docsContentDir) ? docsContentDir : join(root, docsContentDir);
|
|
@@ -2233,6 +2234,21 @@ function withDocs(nextConfig = {}, docsConfig) {
|
|
|
2233
2234
|
])],
|
|
2234
2235
|
[DEFAULT_MCP_ROUTE]: [...new Set([...existingTracingIncludes[DEFAULT_MCP_ROUTE] ?? [], docsTraceGlob])]
|
|
2235
2236
|
};
|
|
2237
|
+
nextConfig.outputFileTracingExcludes = {
|
|
2238
|
+
...existingTracingExcludes,
|
|
2239
|
+
"/api/docs": [...new Set([
|
|
2240
|
+
...existingTracingExcludes["/api/docs"] ?? [],
|
|
2241
|
+
"next.config.js",
|
|
2242
|
+
"next.config.mjs",
|
|
2243
|
+
"next.config.ts"
|
|
2244
|
+
])],
|
|
2245
|
+
[DEFAULT_MCP_ROUTE]: [...new Set([
|
|
2246
|
+
...existingTracingExcludes[DEFAULT_MCP_ROUTE] ?? [],
|
|
2247
|
+
"next.config.js",
|
|
2248
|
+
"next.config.mjs",
|
|
2249
|
+
"next.config.ts"
|
|
2250
|
+
])]
|
|
2251
|
+
};
|
|
2236
2252
|
return withMDX(nextConfig);
|
|
2237
2253
|
}
|
|
2238
2254
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farming-labs/next",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.118",
|
|
4
4
|
"description": "Next.js adapter for @farming-labs/docs — MDX config wrapper",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"docs",
|
|
@@ -109,8 +109,8 @@
|
|
|
109
109
|
"tsdown": "^0.20.3",
|
|
110
110
|
"typescript": "^5.9.3",
|
|
111
111
|
"vitest": "^4.1.8",
|
|
112
|
-
"@farming-labs/
|
|
113
|
-
"@farming-labs/
|
|
112
|
+
"@farming-labs/docs": "0.2.118",
|
|
113
|
+
"@farming-labs/theme": "0.2.118"
|
|
114
114
|
},
|
|
115
115
|
"peerDependencies": {
|
|
116
116
|
"@farming-labs/docs": ">=0.2.73",
|