@farming-labs/docs 0.1.10 → 0.1.11
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-DlfH-Y9c.mjs → api-reference-BQ16eRPP.mjs} +16 -5
- package/dist/cli/index.mjs +3 -3
- package/dist/index.d.mts +3 -3
- package/dist/{init-DfvwcfEI.mjs → init-DwUjo2Kv.mjs} +12 -7
- package/dist/{mcp-aXyV1jPp.mjs → mcp-DLP94P1H.mjs} +1 -1
- package/dist/mcp.d.mts +1 -1
- package/dist/{search-ChhShKMO.mjs → search-CLaNOUrd.mjs} +1 -1
- package/dist/{search-KzREATdM.d.mts → search-DOjDVgyY.d.mts} +1 -1
- package/dist/server.d.mts +6 -3
- package/dist/server.mjs +2 -2
- package/dist/{types-BAulrjlV.d.mts → types-B_Qc9Axa.d.mts} +18 -2
- package/package.json +1 -1
|
@@ -26,6 +26,7 @@ function resolveApiReferenceConfig(value) {
|
|
|
26
26
|
enabled: true,
|
|
27
27
|
path: "api-reference",
|
|
28
28
|
specUrl: void 0,
|
|
29
|
+
renderer: void 0,
|
|
29
30
|
routeRoot: "api",
|
|
30
31
|
exclude: []
|
|
31
32
|
};
|
|
@@ -33,6 +34,7 @@ function resolveApiReferenceConfig(value) {
|
|
|
33
34
|
enabled: false,
|
|
34
35
|
path: "api-reference",
|
|
35
36
|
specUrl: void 0,
|
|
37
|
+
renderer: void 0,
|
|
36
38
|
routeRoot: "api",
|
|
37
39
|
exclude: []
|
|
38
40
|
};
|
|
@@ -40,10 +42,19 @@ function resolveApiReferenceConfig(value) {
|
|
|
40
42
|
enabled: value.enabled !== false,
|
|
41
43
|
path: normalizePathSegment(value.path ?? "api-reference"),
|
|
42
44
|
specUrl: normalizeRemoteSpecUrl(value.specUrl),
|
|
45
|
+
renderer: normalizeApiReferenceRenderer(value.renderer),
|
|
43
46
|
routeRoot: normalizePathSegment(value.routeRoot ?? "api") || "api",
|
|
44
47
|
exclude: normalizeApiReferenceExcludes(value.exclude)
|
|
45
48
|
};
|
|
46
49
|
}
|
|
50
|
+
function normalizeApiReferenceRenderer(value) {
|
|
51
|
+
if (value === "fumadocs" || value === "scalar") return value;
|
|
52
|
+
}
|
|
53
|
+
function resolveApiReferenceRenderer(value, framework) {
|
|
54
|
+
const config = resolveApiReferenceConfig(value);
|
|
55
|
+
if (config.renderer) return config.renderer;
|
|
56
|
+
return framework === "next" ? "fumadocs" : "scalar";
|
|
57
|
+
}
|
|
47
58
|
function normalizeRemoteSpecUrl(value) {
|
|
48
59
|
const trimmed = value?.trim();
|
|
49
60
|
if (!trimmed) return void 0;
|
|
@@ -420,7 +431,7 @@ async function buildApiReferenceOpenApiDocumentAsync(config, options) {
|
|
|
420
431
|
const apiReference = resolveApiReferenceConfig(config.apiReference);
|
|
421
432
|
if (!apiReference.specUrl) return buildApiReferenceOpenApiDocument(config, options);
|
|
422
433
|
try {
|
|
423
|
-
return normalizeRemoteOpenApiDocument(await fetchRemoteOpenApiDocument(apiReference.specUrl), config);
|
|
434
|
+
return normalizeRemoteOpenApiDocument(await fetchRemoteOpenApiDocument(apiReference.specUrl, options.baseUrl), config);
|
|
424
435
|
} catch (error) {
|
|
425
436
|
return buildUnavailableOpenApiDocument(config, `Unable to load the remote OpenAPI JSON. ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
426
437
|
}
|
|
@@ -471,12 +482,12 @@ function buildApiReferenceHtmlDocumentFromDocument(config, options, document) {
|
|
|
471
482
|
documentDownloadType: "json"
|
|
472
483
|
});
|
|
473
484
|
}
|
|
474
|
-
async function fetchRemoteOpenApiDocument(specUrl) {
|
|
485
|
+
async function fetchRemoteOpenApiDocument(specUrl, baseUrl) {
|
|
475
486
|
let url;
|
|
476
487
|
try {
|
|
477
|
-
url = new URL(specUrl);
|
|
488
|
+
url = baseUrl ? new URL(specUrl, baseUrl) : new URL(specUrl);
|
|
478
489
|
} catch {
|
|
479
|
-
throw new Error("`apiReference.specUrl` must be an absolute URL.");
|
|
490
|
+
throw new Error(baseUrl ? "`apiReference.specUrl` must be an absolute URL or a request-relative path." : "`apiReference.specUrl` must be an absolute URL.");
|
|
480
491
|
}
|
|
481
492
|
const response = await fetch(url, { headers: { accept: "application/json" } });
|
|
482
493
|
if (!response.ok) throw new Error(`Received ${response.status} ${response.statusText}`.trim());
|
|
@@ -799,4 +810,4 @@ function humanizeSegment(value) {
|
|
|
799
810
|
}
|
|
800
811
|
|
|
801
812
|
//#endregion
|
|
802
|
-
export { buildApiReferencePageTitle as a, buildApiReferenceOpenApiDocumentAsync as i, buildApiReferenceHtmlDocumentAsync as n, buildApiReferenceScalarCss as o, buildApiReferenceOpenApiDocument as r, resolveApiReferenceConfig as s, buildApiReferenceHtmlDocument as t };
|
|
813
|
+
export { buildApiReferencePageTitle as a, resolveApiReferenceRenderer as c, buildApiReferenceOpenApiDocumentAsync as i, buildApiReferenceHtmlDocumentAsync as n, buildApiReferenceScalarCss as o, buildApiReferenceOpenApiDocument as r, resolveApiReferenceConfig as s, buildApiReferenceHtmlDocument as t };
|
package/dist/cli/index.mjs
CHANGED
|
@@ -69,13 +69,13 @@ async function main() {
|
|
|
69
69
|
searchApiKey: typeof flags["search-api-key"] === "string" ? flags["search-api-key"] : void 0
|
|
70
70
|
};
|
|
71
71
|
if (!parsedCommand.command || parsedCommand.command === "init") {
|
|
72
|
-
const { init } = await import("../init-
|
|
72
|
+
const { init } = await import("../init-DwUjo2Kv.mjs");
|
|
73
73
|
await init(initOptions);
|
|
74
74
|
} else if (parsedCommand.command === "mcp") {
|
|
75
|
-
const { runMcp } = await import("../mcp-
|
|
75
|
+
const { runMcp } = await import("../mcp-DLP94P1H.mjs");
|
|
76
76
|
await runMcp(mcpOptions);
|
|
77
77
|
} else if (parsedCommand.command === "search" && subcommand === "sync") {
|
|
78
|
-
const { syncSearch } = await import("../search-
|
|
78
|
+
const { syncSearch } = await import("../search-CLaNOUrd.mjs");
|
|
79
79
|
await syncSearch(searchSyncOptions);
|
|
80
80
|
} else if (parsedCommand.command === "search") {
|
|
81
81
|
console.error(pc.red(`Unknown search subcommand: ${subcommand ?? "(missing)"}`));
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { a as createSimpleSearchAdapter, c as resolveSearchRequestConfig, i as createMcpSearchAdapter, n as createAlgoliaSearchAdapter, o as createTypesenseSearchAdapter, r as createCustomSearchAdapter, s as performDocsSearch, t as buildDocsSearchDocuments } from "./search-
|
|
1
|
+
import { $ as TypographyConfig, A as FontStyle, B as PageActionsConfig, C as DocsSearchEmbeddingsConfig, D as DocsSearchSourcePage, E as DocsSearchResultType, F as OGConfig, G as SidebarConfig, H as PageOpenGraph, I as OpenDocsConfig, J as SidebarPageNode, K as SidebarFolderNode, L as OpenDocsProvider, M as LastUpdatedConfig, N as LlmsTxtConfig, O as DocsTheme, P as McpDocsSearchConfig, Q as TypesenseDocsSearchConfig, R as OpenGraphImage, S as DocsSearchDocument, T as DocsSearchResult, U as PageTwitter, V as PageFrontmatter, W as SidebarComponentProps, X as SimpleDocsSearchConfig, Y as SidebarTree, Z as ThemeToggleConfig, _ as DocsSearchAdapter, a as BreadcrumbConfig, b as DocsSearchChunkingConfig, c as CustomDocsSearchConfig, d as DocsFeedbackValue, et as UIConfig, f as DocsI18nConfig, g as DocsNav, h as DocsMetadata, i as ApiReferenceRenderer, j as GithubConfig, k as FeedbackConfig, l as DocsConfig, m as DocsMcpToolsConfig, n as AlgoliaDocsSearchConfig, o as CodeBlockCopyData, p as DocsMcpConfig, q as SidebarNode, r as ApiReferenceConfig, s as CopyMarkdownConfig, t as AIConfig, u as DocsFeedbackData, v as DocsSearchAdapterContext, w as DocsSearchQuery, x as DocsSearchConfig, y as DocsSearchAdapterFactory, z as OrderingItem } from "./types-B_Qc9Axa.mjs";
|
|
2
|
+
import { a as createSimpleSearchAdapter, c as resolveSearchRequestConfig, i as createMcpSearchAdapter, n as createAlgoliaSearchAdapter, o as createTypesenseSearchAdapter, r as createCustomSearchAdapter, s as performDocsSearch, t as buildDocsSearchDocuments } from "./search-DOjDVgyY.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/define-docs.d.ts
|
|
5
5
|
/**
|
|
@@ -98,4 +98,4 @@ declare function buildPageOpenGraph(page: Pick<PageFrontmatter, "title" | "descr
|
|
|
98
98
|
*/
|
|
99
99
|
declare function buildPageTwitter(page: Pick<PageFrontmatter, "title" | "description" | "ogImage" | "openGraph" | "twitter">, ogConfig?: OGConfig, baseUrl?: string): PageTwitter | undefined;
|
|
100
100
|
//#endregion
|
|
101
|
-
export { type AIConfig, type AlgoliaDocsSearchConfig, type ApiReferenceConfig, type BreadcrumbConfig, type CodeBlockCopyData, type CopyMarkdownConfig, type CustomDocsSearchConfig, type DocsConfig, type DocsFeedbackData, type DocsFeedbackValue, type DocsI18nConfig, type DocsMcpConfig, type DocsMcpToolsConfig, type DocsMetadata, type DocsNav, type DocsPathMatch, type DocsSearchAdapter, type DocsSearchAdapterContext, type DocsSearchAdapterFactory, type DocsSearchChunkingConfig, type DocsSearchConfig, type DocsSearchDocument, type DocsSearchEmbeddingsConfig, type DocsSearchQuery, type DocsSearchResult, type DocsSearchResultType, type DocsSearchSourcePage, type DocsTheme, type FeedbackConfig, type FontStyle, type GithubConfig, type LastUpdatedConfig, type LlmsTxtConfig, type McpDocsSearchConfig, type OGConfig, type OpenDocsConfig, type OpenDocsProvider, type OpenGraphImage, type OrderingItem, type PageActionsConfig, type PageFrontmatter, type PageOpenGraph, type PageTwitter, type ResolvedDocsI18n, type SidebarComponentProps, type SidebarConfig, type SidebarFolderNode, type SidebarNode, type SidebarPageNode, type SidebarTree, type SimpleDocsSearchConfig, type ThemeToggleConfig, type TypesenseDocsSearchConfig, type TypographyConfig, type UIConfig, buildDocsSearchDocuments, buildPageOpenGraph, buildPageTwitter, createAlgoliaSearchAdapter, createCustomSearchAdapter, createMcpSearchAdapter, createSimpleSearchAdapter, createTheme, createTypesenseSearchAdapter, deepMerge, defineDocs, extendTheme, performDocsSearch, resolveDocsI18n, resolveDocsLocale, resolveDocsPath, resolveOGImage, resolveSearchRequestConfig, resolveTitle };
|
|
101
|
+
export { type AIConfig, type AlgoliaDocsSearchConfig, type ApiReferenceConfig, type ApiReferenceRenderer, type BreadcrumbConfig, type CodeBlockCopyData, type CopyMarkdownConfig, type CustomDocsSearchConfig, type DocsConfig, type DocsFeedbackData, type DocsFeedbackValue, type DocsI18nConfig, type DocsMcpConfig, type DocsMcpToolsConfig, type DocsMetadata, type DocsNav, type DocsPathMatch, type DocsSearchAdapter, type DocsSearchAdapterContext, type DocsSearchAdapterFactory, type DocsSearchChunkingConfig, type DocsSearchConfig, type DocsSearchDocument, type DocsSearchEmbeddingsConfig, type DocsSearchQuery, type DocsSearchResult, type DocsSearchResultType, type DocsSearchSourcePage, type DocsTheme, type FeedbackConfig, type FontStyle, type GithubConfig, type LastUpdatedConfig, type LlmsTxtConfig, type McpDocsSearchConfig, type OGConfig, type OpenDocsConfig, type OpenDocsProvider, type OpenGraphImage, type OrderingItem, type PageActionsConfig, type PageFrontmatter, type PageOpenGraph, type PageTwitter, type ResolvedDocsI18n, type SidebarComponentProps, type SidebarConfig, type SidebarFolderNode, type SidebarNode, type SidebarPageNode, type SidebarTree, type SimpleDocsSearchConfig, type ThemeToggleConfig, type TypesenseDocsSearchConfig, type TypographyConfig, type UIConfig, buildDocsSearchDocuments, buildPageOpenGraph, buildPageTwitter, createAlgoliaSearchAdapter, createCustomSearchAdapter, createMcpSearchAdapter, createSimpleSearchAdapter, createTheme, createTypesenseSearchAdapter, deepMerge, defineDocs, extendTheme, performDocsSearch, resolveDocsI18n, resolveDocsLocale, resolveDocsPath, resolveOGImage, resolveSearchRequestConfig, resolveTitle };
|
|
@@ -168,7 +168,8 @@ function renderI18nConfig(cfg, indent = " ") {
|
|
|
168
168
|
function renderApiReferenceConfig(cfg, indent = " ") {
|
|
169
169
|
const apiReference = cfg.apiReference;
|
|
170
170
|
if (!apiReference) return "";
|
|
171
|
-
|
|
171
|
+
const rendererLine = cfg.framework === "nextjs" ? `${indent} renderer: "fumadocs",\n` : "";
|
|
172
|
+
return `${indent}apiReference: {\n${indent} enabled: true,\n${indent} path: "${apiReference.path}",\n${rendererLine}${indent} routeRoot: "${apiReference.routeRoot}",\n${indent}},\n`;
|
|
172
173
|
}
|
|
173
174
|
function toLocaleImportName(locale) {
|
|
174
175
|
return `LocalePage_${locale.replace(/[^a-zA-Z0-9_$]/g, "_")}`;
|
|
@@ -424,15 +425,19 @@ export default function Layout({ children }: { children: React.ReactNode }) {
|
|
|
424
425
|
}
|
|
425
426
|
`;
|
|
426
427
|
}
|
|
427
|
-
function
|
|
428
|
+
function nextApiReferencePageTemplate(cfg, filePath) {
|
|
428
429
|
const appDir = cfg.nextAppDir ?? "app";
|
|
429
430
|
return `
|
|
431
|
+
import "@farming-labs/next/api-reference.css";
|
|
430
432
|
import docsConfig from "${nextApiReferenceConfigImport(cfg.useAlias, appDir, filePath)}";
|
|
431
|
-
import {
|
|
433
|
+
import { createNextApiReferencePage } from "@farming-labs/next/api-reference";
|
|
432
434
|
|
|
433
|
-
|
|
435
|
+
const ApiReferencePage = createNextApiReferencePage(docsConfig);
|
|
434
436
|
|
|
435
|
-
export const
|
|
437
|
+
export const dynamic = "force-dynamic";
|
|
438
|
+
export const revalidate = 0;
|
|
439
|
+
|
|
440
|
+
export default ApiReferencePage;
|
|
436
441
|
`;
|
|
437
442
|
}
|
|
438
443
|
function nextLocaleDocPageTemplate(defaultLocale) {
|
|
@@ -3024,8 +3029,8 @@ function scaffoldNextJs(cwd, cfg, globalCssRelPath, write, skipped, written) {
|
|
|
3024
3029
|
} else write(globalCssRelPath, globalCssTemplate(cfg.theme, cfg.customThemeName, globalCssRelPath));
|
|
3025
3030
|
write(`${appDir}/${cfg.entry}/layout.tsx`, docsLayoutTemplate(cfg));
|
|
3026
3031
|
if (cfg.apiReference) {
|
|
3027
|
-
const
|
|
3028
|
-
write(
|
|
3032
|
+
const apiReferencePage = `${appDir}/${cfg.apiReference.path}/[[...slug]]/page.tsx`;
|
|
3033
|
+
write(apiReferencePage, nextApiReferencePageTemplate(cfg, apiReferencePage));
|
|
3029
3034
|
}
|
|
3030
3035
|
write("postcss.config.mjs", postcssConfigTemplate());
|
|
3031
3036
|
if (!fileExists(path.join(cwd, "tsconfig.json"))) write("tsconfig.json", tsconfigTemplate(cfg.useAlias));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./api-reference-
|
|
1
|
+
import "./api-reference-BQ16eRPP.mjs";
|
|
2
2
|
import { createFilesystemDocsMcpSource, resolveDocsMcpConfig, runDocsMcpStdio } from "./mcp.mjs";
|
|
3
3
|
import "./server.mjs";
|
|
4
4
|
import { a as readStringProperty, i as readNavTitle, o as resolveDocsConfigPath, r as readBooleanProperty, s as resolveDocsContentDir, t as extractObjectLiteral } from "./config-CSywk3ou.mjs";
|
package/dist/mcp.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { p as DocsMcpConfig, x as DocsSearchConfig, z as OrderingItem } from "./types-B_Qc9Axa.mjs";
|
|
2
2
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
3
|
|
|
4
4
|
//#region src/mcp.d.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as createAlgoliaSearchAdapter, o as createTypesenseSearchAdapter, t as buildDocsSearchDocuments } from "./search-BS6C5N1i.mjs";
|
|
2
|
-
import "./api-reference-
|
|
2
|
+
import "./api-reference-BQ16eRPP.mjs";
|
|
3
3
|
import { createFilesystemDocsMcpSource } from "./mcp.mjs";
|
|
4
4
|
import "./server.mjs";
|
|
5
5
|
import { a as readStringProperty, n as loadProjectEnv, o as resolveDocsConfigPath, s as resolveDocsContentDir } from "./config-CSywk3ou.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { D as DocsSearchSourcePage, P as McpDocsSearchConfig, Q as TypesenseDocsSearchConfig, S as DocsSearchDocument, T as DocsSearchResult, _ as DocsSearchAdapter, b as DocsSearchChunkingConfig, c as CustomDocsSearchConfig, n as AlgoliaDocsSearchConfig, x as DocsSearchConfig, y as DocsSearchAdapterFactory } from "./types-B_Qc9Axa.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/search.d.ts
|
|
4
4
|
declare function buildDocsSearchDocuments(pages: DocsSearchSourcePage[], chunking?: DocsSearchChunkingConfig): DocsSearchDocument[];
|
package/dist/server.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as createSimpleSearchAdapter, c as resolveSearchRequestConfig, i as createMcpSearchAdapter, n as createAlgoliaSearchAdapter, o as createTypesenseSearchAdapter, r as createCustomSearchAdapter, s as performDocsSearch, t as buildDocsSearchDocuments } from "./search-
|
|
1
|
+
import { D as DocsSearchSourcePage, P as McpDocsSearchConfig, S as DocsSearchDocument, T as DocsSearchResult, _ as DocsSearchAdapter, i as ApiReferenceRenderer, l as DocsConfig, v as DocsSearchAdapterContext, w as DocsSearchQuery, x as DocsSearchConfig, y as DocsSearchAdapterFactory } from "./types-B_Qc9Axa.mjs";
|
|
2
|
+
import { a as createSimpleSearchAdapter, c as resolveSearchRequestConfig, i as createMcpSearchAdapter, n as createAlgoliaSearchAdapter, o as createTypesenseSearchAdapter, r as createCustomSearchAdapter, s as performDocsSearch, t as buildDocsSearchDocuments } from "./search-DOjDVgyY.mjs";
|
|
3
3
|
import { DocsMcpHttpHandlers, DocsMcpNavigationNode, DocsMcpNavigationTree, DocsMcpPage, DocsMcpResolvedConfig, DocsMcpSource, createDocsMcpHttpHandler, createDocsMcpServer, createFilesystemDocsMcpSource, normalizeDocsMcpRoute, resolveDocsMcpConfig, runDocsMcpStdio } from "./mcp.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/api-reference.d.ts
|
|
@@ -19,17 +19,20 @@ interface ResolvedApiReferenceConfig {
|
|
|
19
19
|
enabled: boolean;
|
|
20
20
|
path: string;
|
|
21
21
|
specUrl?: string;
|
|
22
|
+
renderer?: ApiReferenceRenderer;
|
|
22
23
|
routeRoot: string;
|
|
23
24
|
exclude: string[];
|
|
24
25
|
}
|
|
25
26
|
interface BuildApiReferenceOptions {
|
|
26
27
|
framework: ApiReferenceFramework;
|
|
27
28
|
rootDir?: string;
|
|
29
|
+
baseUrl?: string;
|
|
28
30
|
}
|
|
29
31
|
interface BuildApiReferenceHtmlOptions extends BuildApiReferenceOptions {
|
|
30
32
|
title?: string;
|
|
31
33
|
}
|
|
32
34
|
declare function resolveApiReferenceConfig(value: DocsConfig["apiReference"]): ResolvedApiReferenceConfig;
|
|
35
|
+
declare function resolveApiReferenceRenderer(value: DocsConfig["apiReference"], framework: ApiReferenceFramework): ApiReferenceRenderer;
|
|
33
36
|
declare function buildApiReferencePageTitle(config: DocsConfig, title?: string): string;
|
|
34
37
|
declare function buildApiReferenceScalarCss(config: DocsConfig): string;
|
|
35
38
|
declare function buildApiReferenceOpenApiDocument(config: DocsConfig, options: BuildApiReferenceOptions): Record<string, unknown>;
|
|
@@ -37,4 +40,4 @@ declare function buildApiReferenceOpenApiDocumentAsync(config: DocsConfig, optio
|
|
|
37
40
|
declare function buildApiReferenceHtmlDocument(config: DocsConfig, options: BuildApiReferenceHtmlOptions): string;
|
|
38
41
|
declare function buildApiReferenceHtmlDocumentAsync(config: DocsConfig, options: BuildApiReferenceHtmlOptions): Promise<string>;
|
|
39
42
|
//#endregion
|
|
40
|
-
export { type ApiReferenceFramework, type ApiReferenceRoute, type DocsMcpHttpHandlers, type DocsMcpNavigationNode, type DocsMcpNavigationTree, type DocsMcpPage, type DocsMcpResolvedConfig, type DocsMcpSource, type DocsSearchAdapter, type DocsSearchAdapterContext, type DocsSearchAdapterFactory, type DocsSearchConfig, type DocsSearchDocument, type DocsSearchQuery, type DocsSearchResult, type DocsSearchSourcePage, type McpDocsSearchConfig, type ResolvedApiReferenceConfig, buildApiReferenceHtmlDocument, buildApiReferenceHtmlDocumentAsync, buildApiReferenceOpenApiDocument, buildApiReferenceOpenApiDocumentAsync, buildApiReferencePageTitle, buildApiReferenceScalarCss, buildDocsSearchDocuments, createAlgoliaSearchAdapter, createCustomSearchAdapter, createDocsMcpHttpHandler, createDocsMcpServer, createFilesystemDocsMcpSource, createMcpSearchAdapter, createSimpleSearchAdapter, createTypesenseSearchAdapter, normalizeDocsMcpRoute, performDocsSearch, resolveApiReferenceConfig, resolveDocsMcpConfig, resolveSearchRequestConfig, runDocsMcpStdio };
|
|
43
|
+
export { type ApiReferenceFramework, type ApiReferenceRenderer, type ApiReferenceRoute, type DocsMcpHttpHandlers, type DocsMcpNavigationNode, type DocsMcpNavigationTree, type DocsMcpPage, type DocsMcpResolvedConfig, type DocsMcpSource, type DocsSearchAdapter, type DocsSearchAdapterContext, type DocsSearchAdapterFactory, type DocsSearchConfig, type DocsSearchDocument, type DocsSearchQuery, type DocsSearchResult, type DocsSearchSourcePage, type McpDocsSearchConfig, type ResolvedApiReferenceConfig, buildApiReferenceHtmlDocument, buildApiReferenceHtmlDocumentAsync, buildApiReferenceOpenApiDocument, buildApiReferenceOpenApiDocumentAsync, buildApiReferencePageTitle, buildApiReferenceScalarCss, buildDocsSearchDocuments, createAlgoliaSearchAdapter, createCustomSearchAdapter, createDocsMcpHttpHandler, createDocsMcpServer, createFilesystemDocsMcpSource, createMcpSearchAdapter, createSimpleSearchAdapter, createTypesenseSearchAdapter, normalizeDocsMcpRoute, performDocsSearch, resolveApiReferenceConfig, resolveApiReferenceRenderer, resolveDocsMcpConfig, resolveSearchRequestConfig, runDocsMcpStdio };
|
package/dist/server.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as createSimpleSearchAdapter, c as resolveSearchRequestConfig, i as createMcpSearchAdapter, n as createAlgoliaSearchAdapter, o as createTypesenseSearchAdapter, r as createCustomSearchAdapter, s as performDocsSearch, t as buildDocsSearchDocuments } from "./search-BS6C5N1i.mjs";
|
|
2
|
-
import { a as buildApiReferencePageTitle, i as buildApiReferenceOpenApiDocumentAsync, n as buildApiReferenceHtmlDocumentAsync, o as buildApiReferenceScalarCss, r as buildApiReferenceOpenApiDocument, s as resolveApiReferenceConfig, t as buildApiReferenceHtmlDocument } from "./api-reference-
|
|
2
|
+
import { a as buildApiReferencePageTitle, c as resolveApiReferenceRenderer, i as buildApiReferenceOpenApiDocumentAsync, n as buildApiReferenceHtmlDocumentAsync, o as buildApiReferenceScalarCss, r as buildApiReferenceOpenApiDocument, s as resolveApiReferenceConfig, t as buildApiReferenceHtmlDocument } from "./api-reference-BQ16eRPP.mjs";
|
|
3
3
|
import { createDocsMcpHttpHandler, createDocsMcpServer, createFilesystemDocsMcpSource, normalizeDocsMcpRoute, resolveDocsMcpConfig, runDocsMcpStdio } from "./mcp.mjs";
|
|
4
4
|
|
|
5
|
-
export { buildApiReferenceHtmlDocument, buildApiReferenceHtmlDocumentAsync, buildApiReferenceOpenApiDocument, buildApiReferenceOpenApiDocumentAsync, buildApiReferencePageTitle, buildApiReferenceScalarCss, buildDocsSearchDocuments, createAlgoliaSearchAdapter, createCustomSearchAdapter, createDocsMcpHttpHandler, createDocsMcpServer, createFilesystemDocsMcpSource, createMcpSearchAdapter, createSimpleSearchAdapter, createTypesenseSearchAdapter, normalizeDocsMcpRoute, performDocsSearch, resolveApiReferenceConfig, resolveDocsMcpConfig, resolveSearchRequestConfig, runDocsMcpStdio };
|
|
5
|
+
export { buildApiReferenceHtmlDocument, buildApiReferenceHtmlDocumentAsync, buildApiReferenceOpenApiDocument, buildApiReferenceOpenApiDocumentAsync, buildApiReferencePageTitle, buildApiReferenceScalarCss, buildDocsSearchDocuments, createAlgoliaSearchAdapter, createCustomSearchAdapter, createDocsMcpHttpHandler, createDocsMcpServer, createFilesystemDocsMcpSource, createMcpSearchAdapter, createSimpleSearchAdapter, createTypesenseSearchAdapter, normalizeDocsMcpRoute, performDocsSearch, resolveApiReferenceConfig, resolveApiReferenceRenderer, resolveDocsMcpConfig, resolveSearchRequestConfig, runDocsMcpStdio };
|
|
@@ -1244,6 +1244,7 @@ interface DocsI18nConfig {
|
|
|
1244
1244
|
/** Default locale when `?lang=` is missing or invalid. Defaults to first locale. */
|
|
1245
1245
|
defaultLocale?: string;
|
|
1246
1246
|
}
|
|
1247
|
+
type ApiReferenceRenderer = "fumadocs" | "scalar";
|
|
1247
1248
|
interface ApiReferenceConfig {
|
|
1248
1249
|
/**
|
|
1249
1250
|
* Whether to enable generated API reference pages.
|
|
@@ -1258,11 +1259,15 @@ interface ApiReferenceConfig {
|
|
|
1258
1259
|
*/
|
|
1259
1260
|
path?: string;
|
|
1260
1261
|
/**
|
|
1261
|
-
*
|
|
1262
|
+
* URL to a remote OpenAPI JSON document.
|
|
1262
1263
|
*
|
|
1263
1264
|
* When provided, the API reference is generated from this hosted spec instead
|
|
1264
1265
|
* of scanning local framework route files.
|
|
1265
1266
|
*
|
|
1267
|
+
* Supports:
|
|
1268
|
+
* - absolute URLs like `https://example.com/openapi.json`
|
|
1269
|
+
* - request-relative URLs like `/api/openapi.json` in Next.js
|
|
1270
|
+
*
|
|
1266
1271
|
* @example
|
|
1267
1272
|
* ```ts
|
|
1268
1273
|
* apiReference: {
|
|
@@ -1272,6 +1277,17 @@ interface ApiReferenceConfig {
|
|
|
1272
1277
|
* ```
|
|
1273
1278
|
*/
|
|
1274
1279
|
specUrl?: string;
|
|
1280
|
+
/**
|
|
1281
|
+
* Which renderer to use for the API reference UI.
|
|
1282
|
+
*
|
|
1283
|
+
* - `"fumadocs"` uses `fumadocs-openapi`
|
|
1284
|
+
* - `"scalar"` uses the existing Scalar renderer
|
|
1285
|
+
*
|
|
1286
|
+
* Defaults are framework-aware:
|
|
1287
|
+
* - Next.js: `"fumadocs"`
|
|
1288
|
+
* - TanStack Start / SvelteKit / Astro / Nuxt: `"scalar"`
|
|
1289
|
+
*/
|
|
1290
|
+
renderer?: ApiReferenceRenderer;
|
|
1275
1291
|
/**
|
|
1276
1292
|
* Filesystem route root to scan for API handlers.
|
|
1277
1293
|
*
|
|
@@ -1629,4 +1645,4 @@ interface DocsConfig {
|
|
|
1629
1645
|
og?: OGConfig;
|
|
1630
1646
|
}
|
|
1631
1647
|
//#endregion
|
|
1632
|
-
export {
|
|
1648
|
+
export { TypographyConfig as $, FontStyle as A, PageActionsConfig as B, DocsSearchEmbeddingsConfig as C, DocsSearchSourcePage as D, DocsSearchResultType as E, OGConfig as F, SidebarConfig as G, PageOpenGraph as H, OpenDocsConfig as I, SidebarPageNode as J, SidebarFolderNode as K, OpenDocsProvider as L, LastUpdatedConfig as M, LlmsTxtConfig as N, DocsTheme as O, McpDocsSearchConfig as P, TypesenseDocsSearchConfig as Q, OpenGraphImage as R, DocsSearchDocument as S, DocsSearchResult as T, PageTwitter as U, PageFrontmatter as V, SidebarComponentProps as W, SimpleDocsSearchConfig as X, SidebarTree as Y, ThemeToggleConfig as Z, DocsSearchAdapter as _, BreadcrumbConfig as a, DocsSearchChunkingConfig as b, CustomDocsSearchConfig as c, DocsFeedbackValue as d, UIConfig as et, DocsI18nConfig as f, DocsNav as g, DocsMetadata as h, ApiReferenceRenderer as i, GithubConfig as j, FeedbackConfig as k, DocsConfig as l, DocsMcpToolsConfig as m, AlgoliaDocsSearchConfig as n, CodeBlockCopyData as o, DocsMcpConfig as p, SidebarNode as q, ApiReferenceConfig as r, CopyMarkdownConfig as s, AIConfig as t, DocsFeedbackData as u, DocsSearchAdapterContext as v, DocsSearchQuery as w, DocsSearchConfig as x, DocsSearchAdapterFactory as y, OrderingItem as z };
|