fumadocs-mdx 14.2.3 → 14.2.5
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/adapter-DI4cexsC.js +145 -0
- package/dist/adapter-DI4cexsC.js.map +1 -0
- package/dist/bin.d.ts +1 -1
- package/dist/bin.js +21 -12
- package/dist/bin.js.map +1 -0
- package/dist/build-BTTNEFmV.js +100 -0
- package/dist/build-BTTNEFmV.js.map +1 -0
- package/dist/build-mdx-10MrLupc.d.ts +53 -0
- package/dist/build-mdx-10MrLupc.d.ts.map +1 -0
- package/dist/build-mdx-BVeBo4jT.js +153 -0
- package/dist/build-mdx-BVeBo4jT.js.map +1 -0
- package/dist/build-mdx-ChjP7zAn.js +5 -0
- package/dist/bun/index.d.ts +10 -21
- package/dist/bun/index.d.ts.map +1 -0
- package/dist/bun/index.js +30 -49
- package/dist/bun/index.js.map +1 -0
- package/dist/codegen-DleOVLNr.js +101 -0
- package/dist/codegen-DleOVLNr.js.map +1 -0
- package/dist/config/index.d.ts +2 -18
- package/dist/config/index.js +50 -53
- package/dist/config/index.js.map +1 -0
- package/dist/core-DG43f_AU.d.ts +364 -0
- package/dist/core-DG43f_AU.d.ts.map +1 -0
- package/dist/core-DjldE3H9.js +212 -0
- package/dist/core-DjldE3H9.js.map +1 -0
- package/dist/fuma-matter-CHgJa_-B.js +27 -0
- package/dist/fuma-matter-CHgJa_-B.js.map +1 -0
- package/dist/index-Bc_4I1HE.d.ts +12 -0
- package/dist/index-Bc_4I1HE.d.ts.map +1 -0
- package/dist/index-file-D9HsrWU_.js +264 -0
- package/dist/index-file-D9HsrWU_.js.map +1 -0
- package/dist/index.d.ts +3 -61
- package/dist/index.js +1 -0
- package/dist/load-from-file-B7Rswy9i.js +5 -0
- package/dist/load-from-file-Doc98oEB.js +38 -0
- package/dist/load-from-file-Doc98oEB.js.map +1 -0
- package/dist/loaders-BVwYfelL.js +7 -0
- package/dist/loaders-BVwYfelL.js.map +1 -0
- package/dist/mdx-CRT-jSh5.js +91 -0
- package/dist/mdx-CRT-jSh5.js.map +1 -0
- package/dist/meta-BKBx8Gab.js +81 -0
- package/dist/meta-BKBx8Gab.js.map +1 -0
- package/dist/next/index.cjs +863 -1076
- package/dist/next/index.d.ts +17 -28
- package/dist/next/index.d.ts.map +1 -0
- package/dist/next/index.js +141 -170
- package/dist/next/index.js.map +1 -0
- package/dist/node/loader.d.ts +4 -2
- package/dist/node/loader.d.ts.map +1 -0
- package/dist/node/loader.js +26 -38
- package/dist/node/loader.js.map +1 -0
- package/dist/plugins/index-file.d.ts +2 -14
- package/dist/plugins/index-file.js +5 -8
- package/dist/plugins/json-schema.d.ts +14 -23
- package/dist/plugins/json-schema.d.ts.map +1 -0
- package/dist/plugins/json-schema.js +70 -78
- package/dist/plugins/json-schema.js.map +1 -0
- package/dist/plugins/last-modified.d.ts +21 -32
- package/dist/plugins/last-modified.d.ts.map +1 -0
- package/dist/plugins/last-modified.js +70 -78
- package/dist/plugins/last-modified.js.map +1 -0
- package/dist/preset-gmDZnBcg.js +61 -0
- package/dist/preset-gmDZnBcg.js.map +1 -0
- package/dist/remark-include-D3G3mAnv.js +247 -0
- package/dist/remark-include-D3G3mAnv.js.map +1 -0
- package/dist/runtime/browser.d.ts +33 -42
- package/dist/runtime/browser.d.ts.map +1 -0
- package/dist/runtime/browser.js +54 -63
- package/dist/runtime/browser.js.map +1 -0
- package/dist/runtime/dynamic.d.ts +13 -21
- package/dist/runtime/dynamic.d.ts.map +1 -0
- package/dist/runtime/dynamic.js +64 -76
- package/dist/runtime/dynamic.js.map +1 -0
- package/dist/runtime/server.d.ts +2 -14
- package/dist/runtime/server.js +111 -8
- package/dist/runtime/server.js.map +1 -0
- package/dist/runtime/types.d.ts +2 -61
- package/dist/runtime/types.js +1 -0
- package/dist/types-B6myALSk.d.ts +63 -0
- package/dist/types-B6myALSk.d.ts.map +1 -0
- package/dist/vite/index.d.ts +28 -39
- package/dist/vite/index.d.ts.map +1 -0
- package/dist/vite/index.js +79 -122
- package/dist/vite/index.js.map +1 -0
- package/dist/webpack/mdx.d.ts +6 -3
- package/dist/webpack/mdx.d.ts.map +1 -0
- package/dist/webpack/mdx.js +21 -34
- package/dist/webpack/mdx.js.map +1 -0
- package/dist/webpack/meta.d.ts +6 -3
- package/dist/webpack/meta.d.ts.map +1 -0
- package/dist/webpack/meta.js +23 -37
- package/dist/webpack/meta.js.map +1 -0
- package/dist/webpack--VSEE6Zp.js +15 -0
- package/dist/webpack--VSEE6Zp.js.map +1 -0
- package/loader-mdx.cjs +1 -3
- package/loader-meta.cjs +1 -3
- package/package.json +40 -40
- package/dist/build-mdx-5XLFMP5P.js +0 -8
- package/dist/chunk-257RZJEQ.js +0 -17
- package/dist/chunk-2PY3JUIC.js +0 -126
- package/dist/chunk-4EUH5CD2.js +0 -173
- package/dist/chunk-4JSFLXXT.js +0 -8
- package/dist/chunk-5OBUOALK.js +0 -141
- package/dist/chunk-DTFUANSF.js +0 -40
- package/dist/chunk-KWSETXYC.js +0 -274
- package/dist/chunk-OLD35ARB.js +0 -116
- package/dist/chunk-RSASAHLX.js +0 -91
- package/dist/chunk-S7KOJHHO.js +0 -89
- package/dist/chunk-STLEUNK7.js +0 -335
- package/dist/chunk-USQZ5OLE.js +0 -116
- package/dist/chunk-VWJKRQZR.js +0 -19
- package/dist/chunk-WFDF56IJ.js +0 -290
- package/dist/chunk-XYVVDDIF.js +0 -180
- package/dist/core-X5ggQtBM.d.ts +0 -350
- package/dist/index-BqkSNsGO.d.ts +0 -8
- package/dist/load-from-file-FHW724YY.js +0 -8
package/dist/runtime/dynamic.js
CHANGED
|
@@ -1,79 +1,67 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
} from "../
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import "../
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
} from "
|
|
11
|
-
import "../chunk-S7KOJHHO.js";
|
|
12
|
-
import {
|
|
13
|
-
createCore
|
|
14
|
-
} from "../chunk-KWSETXYC.js";
|
|
15
|
-
import "../chunk-2PY3JUIC.js";
|
|
16
|
-
import {
|
|
17
|
-
fumaMatter
|
|
18
|
-
} from "../chunk-VWJKRQZR.js";
|
|
19
|
-
|
|
20
|
-
// src/runtime/dynamic.ts
|
|
1
|
+
import { t as fumaMatter } from "../fuma-matter-CHgJa_-B.js";
|
|
2
|
+
import "../preset-gmDZnBcg.js";
|
|
3
|
+
import { t as buildConfig } from "../build-BTTNEFmV.js";
|
|
4
|
+
import { n as createCore } from "../core-DjldE3H9.js";
|
|
5
|
+
import "../codegen-DleOVLNr.js";
|
|
6
|
+
import "../remark-include-D3G3mAnv.js";
|
|
7
|
+
import { t as buildMDX } from "../build-mdx-BVeBo4jT.js";
|
|
8
|
+
import { server } from "./server.js";
|
|
9
|
+
import fs from "node:fs/promises";
|
|
10
|
+
import { pathToFileURL } from "node:url";
|
|
21
11
|
import { executeMdx } from "@fumadocs/mdx-remote/client";
|
|
22
|
-
|
|
23
|
-
|
|
12
|
+
|
|
13
|
+
//#region src/runtime/dynamic.ts
|
|
24
14
|
async function dynamic(configExports, coreOptions, serverOptions) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
return create.docsLazy(name, base, meta, docs.head, docs.body);
|
|
74
|
-
}
|
|
75
|
-
};
|
|
15
|
+
const core = createCore(coreOptions);
|
|
16
|
+
await core.init({ config: buildConfig(configExports) });
|
|
17
|
+
const create = server(serverOptions);
|
|
18
|
+
function getDocCollection(name) {
|
|
19
|
+
const collection = core.getCollection(name);
|
|
20
|
+
if (!collection) return;
|
|
21
|
+
if (collection.type === "docs") return collection.docs;
|
|
22
|
+
else if (collection.type === "doc") return collection;
|
|
23
|
+
}
|
|
24
|
+
function convertLazyEntries(collection, entries) {
|
|
25
|
+
const head = {};
|
|
26
|
+
const body = {};
|
|
27
|
+
async function compile({ info, data }) {
|
|
28
|
+
let content = (await fs.readFile(info.fullPath)).toString();
|
|
29
|
+
content = fumaMatter(content).content;
|
|
30
|
+
const compiled = await buildMDX(core, collection, {
|
|
31
|
+
filePath: info.fullPath,
|
|
32
|
+
source: content,
|
|
33
|
+
frontmatter: data,
|
|
34
|
+
isDevelopment: false,
|
|
35
|
+
environment: "runtime"
|
|
36
|
+
});
|
|
37
|
+
return await executeMdx(String(compiled.value), { baseUrl: pathToFileURL(info.fullPath) });
|
|
38
|
+
}
|
|
39
|
+
for (const entry of entries) {
|
|
40
|
+
head[entry.info.path] = () => entry.data;
|
|
41
|
+
let cachedResult;
|
|
42
|
+
body[entry.info.path] = () => cachedResult ??= compile(entry);
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
head,
|
|
46
|
+
body
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
async doc(name, base, entries) {
|
|
51
|
+
const collection = getDocCollection(name);
|
|
52
|
+
if (!collection) throw new Error(`the doc collection ${name} doesn't exist.`);
|
|
53
|
+
const { head, body } = convertLazyEntries(collection, entries);
|
|
54
|
+
return create.docLazy(name, base, head, body);
|
|
55
|
+
},
|
|
56
|
+
async docs(name, base, meta, entries) {
|
|
57
|
+
const collection = getDocCollection(name);
|
|
58
|
+
if (!collection) throw new Error(`the doc collection ${name} doesn't exist.`);
|
|
59
|
+
const docs = convertLazyEntries(collection, entries);
|
|
60
|
+
return create.docsLazy(name, base, meta, docs.head, docs.body);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
76
63
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
};
|
|
64
|
+
|
|
65
|
+
//#endregion
|
|
66
|
+
export { dynamic };
|
|
67
|
+
//# sourceMappingURL=dynamic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dynamic.js","names":[],"sources":["../../src/runtime/dynamic.ts"],"sourcesContent":["import { buildConfig, type DocCollectionItem } from '@/config/build';\nimport { buildMDX, type CompiledMDXProperties } from '@/loaders/mdx/build-mdx';\nimport { executeMdx } from '@fumadocs/mdx-remote/client';\nimport { pathToFileURL } from 'node:url';\nimport { fumaMatter } from '@/utils/fuma-matter';\nimport fs from 'node:fs/promises';\nimport { server, type ServerOptions } from './server';\nimport { type CoreOptions, createCore } from '@/core';\nimport type { FileInfo, InternalTypeConfig } from './types';\n\nexport interface LazyEntry<Data = unknown> {\n info: FileInfo;\n data: Data;\n\n hash?: string;\n}\n\nexport type CreateDynamic<Config, TC extends InternalTypeConfig = InternalTypeConfig> = ReturnType<\n typeof dynamic<Config, TC>\n>;\n\nexport async function dynamic<Config, TC extends InternalTypeConfig>(\n configExports: Config,\n coreOptions: CoreOptions,\n serverOptions?: ServerOptions,\n) {\n const core = createCore(coreOptions);\n await core.init({\n config: buildConfig(configExports as Record<string, unknown>),\n });\n\n const create = server<Config, TC>(serverOptions);\n\n function getDocCollection(name: string): DocCollectionItem | undefined {\n const collection = core.getCollection(name);\n if (!collection) return;\n\n if (collection.type === 'docs') return collection.docs;\n else if (collection.type === 'doc') return collection;\n }\n\n function convertLazyEntries(collection: DocCollectionItem, entries: LazyEntry[]) {\n const head: Record<string, () => unknown> = {};\n const body: Record<string, () => Promise<unknown>> = {};\n\n async function compile({ info, data }: LazyEntry<unknown>) {\n let content = (await fs.readFile(info.fullPath)).toString();\n content = fumaMatter(content).content;\n\n const compiled = await buildMDX(core, collection, {\n filePath: info.fullPath,\n source: content,\n frontmatter: data as Record<string, unknown>,\n isDevelopment: false,\n environment: 'runtime',\n });\n\n return (await executeMdx(String(compiled.value), {\n baseUrl: pathToFileURL(info.fullPath),\n })) as CompiledMDXProperties;\n }\n\n for (const entry of entries) {\n head[entry.info.path] = () => entry.data;\n let cachedResult: Promise<CompiledMDXProperties> | undefined;\n body[entry.info.path] = () => (cachedResult ??= compile(entry));\n }\n\n return { head, body };\n }\n\n return {\n async doc<Name extends keyof Config & string>(\n name: Name,\n base: string,\n entries: LazyEntry<unknown>[],\n ) {\n const collection = getDocCollection(name as string);\n if (!collection) throw new Error(`the doc collection ${name as string} doesn't exist.`);\n\n const { head, body } = convertLazyEntries(collection, entries);\n\n return create.docLazy(name, base, head, body);\n },\n async docs<Name extends keyof Config & string>(\n name: Name,\n base: string,\n meta: Record<string, unknown>,\n entries: LazyEntry<unknown>[],\n ) {\n const collection = getDocCollection(name as string);\n if (!collection) throw new Error(`the doc collection ${name as string} doesn't exist.`);\n\n const docs = convertLazyEntries(collection, entries);\n return create.docsLazy(name, base, meta, docs.head, docs.body);\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;AAqBA,eAAsB,QACpB,eACA,aACA,eACA;CACA,MAAM,OAAO,WAAW,YAAY;AACpC,OAAM,KAAK,KAAK,EACd,QAAQ,YAAY,cAAyC,EAC9D,CAAC;CAEF,MAAM,SAAS,OAAmB,cAAc;CAEhD,SAAS,iBAAiB,MAA6C;EACrE,MAAM,aAAa,KAAK,cAAc,KAAK;AAC3C,MAAI,CAAC,WAAY;AAEjB,MAAI,WAAW,SAAS,OAAQ,QAAO,WAAW;WACzC,WAAW,SAAS,MAAO,QAAO;;CAG7C,SAAS,mBAAmB,YAA+B,SAAsB;EAC/E,MAAM,OAAsC,EAAE;EAC9C,MAAM,OAA+C,EAAE;EAEvD,eAAe,QAAQ,EAAE,MAAM,QAA4B;GACzD,IAAI,WAAW,MAAM,GAAG,SAAS,KAAK,SAAS,EAAE,UAAU;AAC3D,aAAU,WAAW,QAAQ,CAAC;GAE9B,MAAM,WAAW,MAAM,SAAS,MAAM,YAAY;IAChD,UAAU,KAAK;IACf,QAAQ;IACR,aAAa;IACb,eAAe;IACf,aAAa;IACd,CAAC;AAEF,UAAQ,MAAM,WAAW,OAAO,SAAS,MAAM,EAAE,EAC/C,SAAS,cAAc,KAAK,SAAS,EACtC,CAAC;;AAGJ,OAAK,MAAM,SAAS,SAAS;AAC3B,QAAK,MAAM,KAAK,cAAc,MAAM;GACpC,IAAI;AACJ,QAAK,MAAM,KAAK,cAAe,iBAAiB,QAAQ,MAAM;;AAGhE,SAAO;GAAE;GAAM;GAAM;;AAGvB,QAAO;EACL,MAAM,IACJ,MACA,MACA,SACA;GACA,MAAM,aAAa,iBAAiB,KAAe;AACnD,OAAI,CAAC,WAAY,OAAM,IAAI,MAAM,sBAAsB,KAAe,iBAAiB;GAEvF,MAAM,EAAE,MAAM,SAAS,mBAAmB,YAAY,QAAQ;AAE9D,UAAO,OAAO,QAAQ,MAAM,MAAM,MAAM,KAAK;;EAE/C,MAAM,KACJ,MACA,MACA,MACA,SACA;GACA,MAAM,aAAa,iBAAiB,KAAe;AACnD,OAAI,CAAC,WAAY,OAAM,IAAI,MAAM,sBAAsB,KAAe,iBAAiB;GAEvF,MAAM,OAAO,mBAAmB,YAAY,QAAQ;AACpD,UAAO,OAAO,SAAS,MAAM,MAAM,MAAM,KAAK,MAAM,KAAK,KAAK;;EAEjE"}
|
package/dist/runtime/server.d.ts
CHANGED
|
@@ -1,14 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
export {
|
|
3
|
-
import '@standard-schema/spec';
|
|
4
|
-
import './types.js';
|
|
5
|
-
import '@mdx-js/mdx';
|
|
6
|
-
import 'unified';
|
|
7
|
-
import 'fumadocs-core/mdx-plugins';
|
|
8
|
-
import 'fumadocs-core/source/schema';
|
|
9
|
-
import 'chokidar';
|
|
10
|
-
import 'vfile';
|
|
11
|
-
import 'fumadocs-core/mdx-plugins/remark-structure';
|
|
12
|
-
import 'fumadocs-core/toc';
|
|
13
|
-
import 'mdast';
|
|
14
|
-
import 'mdx/types';
|
|
1
|
+
import { C as ServerOptions, S as ServerCreate, T as toFumadocsSource, _ as AsyncDocCollectionEntry, b as DocsCollectionEntry, v as AsyncDocsCollectionEntry, w as server, x as MetaCollectionEntry, y as DocCollectionEntry } from "../core-DG43f_AU.js";
|
|
2
|
+
export { AsyncDocCollectionEntry, AsyncDocsCollectionEntry, DocCollectionEntry, DocsCollectionEntry, MetaCollectionEntry, ServerCreate, ServerOptions, server, toFumadocsSource };
|
package/dist/runtime/server.js
CHANGED
|
@@ -1,8 +1,111 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import * as path$1 from "node:path";
|
|
2
|
+
|
|
3
|
+
//#region src/runtime/server.ts
|
|
4
|
+
function server(options = {}) {
|
|
5
|
+
const { doc: { passthroughs: docPassthroughs = [] } = {} } = options;
|
|
6
|
+
function fileInfo(file, base) {
|
|
7
|
+
if (file.startsWith("./")) file = file.slice(2);
|
|
8
|
+
return {
|
|
9
|
+
path: file,
|
|
10
|
+
fullPath: path$1.join(base, file)
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function mapDocData(entry) {
|
|
14
|
+
const data = {
|
|
15
|
+
body: entry.default,
|
|
16
|
+
toc: entry.toc,
|
|
17
|
+
structuredData: entry.structuredData,
|
|
18
|
+
_exports: entry
|
|
19
|
+
};
|
|
20
|
+
for (const key of docPassthroughs) data[key] = entry[key];
|
|
21
|
+
return data;
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
async doc(_name, base, glob) {
|
|
25
|
+
return await Promise.all(Object.entries(glob).map(async ([k, v]) => {
|
|
26
|
+
const data = typeof v === "function" ? await v() : v;
|
|
27
|
+
return {
|
|
28
|
+
...mapDocData(data),
|
|
29
|
+
...data.frontmatter,
|
|
30
|
+
...createDocMethods(fileInfo(k, base), () => data)
|
|
31
|
+
};
|
|
32
|
+
}));
|
|
33
|
+
},
|
|
34
|
+
async docLazy(_name, base, head, body) {
|
|
35
|
+
return await Promise.all(Object.entries(head).map(async ([k, v]) => {
|
|
36
|
+
const data = typeof v === "function" ? await v() : v;
|
|
37
|
+
const content = body[k];
|
|
38
|
+
return {
|
|
39
|
+
...data,
|
|
40
|
+
...createDocMethods(fileInfo(k, base), content),
|
|
41
|
+
async load() {
|
|
42
|
+
return mapDocData(await content());
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
}));
|
|
46
|
+
},
|
|
47
|
+
async meta(_name, base, glob) {
|
|
48
|
+
return await Promise.all(Object.entries(glob).map(async ([k, v]) => {
|
|
49
|
+
const data = typeof v === "function" ? await v() : v;
|
|
50
|
+
return {
|
|
51
|
+
info: fileInfo(k, base),
|
|
52
|
+
...data
|
|
53
|
+
};
|
|
54
|
+
}));
|
|
55
|
+
},
|
|
56
|
+
async docs(name, base, metaGlob, docGlob) {
|
|
57
|
+
return {
|
|
58
|
+
docs: await this.doc(name, base, docGlob),
|
|
59
|
+
meta: await this.meta(name, base, metaGlob),
|
|
60
|
+
toFumadocsSource() {
|
|
61
|
+
return toFumadocsSource(this.docs, this.meta);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
},
|
|
65
|
+
async docsLazy(name, base, metaGlob, docHeadGlob, docBodyGlob) {
|
|
66
|
+
return {
|
|
67
|
+
docs: await this.docLazy(name, base, docHeadGlob, docBodyGlob),
|
|
68
|
+
meta: await this.meta(name, base, metaGlob),
|
|
69
|
+
toFumadocsSource() {
|
|
70
|
+
return toFumadocsSource(this.docs, this.meta);
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
function toFumadocsSource(pages, metas) {
|
|
77
|
+
const files = [];
|
|
78
|
+
for (const entry of pages) files.push({
|
|
79
|
+
type: "page",
|
|
80
|
+
path: entry.info.path,
|
|
81
|
+
absolutePath: entry.info.fullPath,
|
|
82
|
+
data: entry
|
|
83
|
+
});
|
|
84
|
+
for (const entry of metas) files.push({
|
|
85
|
+
type: "meta",
|
|
86
|
+
path: entry.info.path,
|
|
87
|
+
absolutePath: entry.info.fullPath,
|
|
88
|
+
data: entry
|
|
89
|
+
});
|
|
90
|
+
return { files };
|
|
91
|
+
}
|
|
92
|
+
function createDocMethods(info, load) {
|
|
93
|
+
return {
|
|
94
|
+
info,
|
|
95
|
+
async getText(type) {
|
|
96
|
+
if (type === "raw") return (await (await import("node:fs/promises")).readFile(info.fullPath)).toString();
|
|
97
|
+
const data = await load();
|
|
98
|
+
if (typeof data._markdown !== "string") throw new Error("getText('processed') requires `includeProcessedMarkdown` to be enabled in your collection config.");
|
|
99
|
+
return data._markdown;
|
|
100
|
+
},
|
|
101
|
+
async getMDAST() {
|
|
102
|
+
const data = await load();
|
|
103
|
+
if (!data._mdast) throw new Error("getMDAST() requires `includeMDAST` to be enabled in your collection config.");
|
|
104
|
+
return JSON.parse(data._mdast);
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
//#endregion
|
|
110
|
+
export { server, toFumadocsSource };
|
|
111
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","names":["path"],"sources":["../../src/runtime/server.ts"],"sourcesContent":["import type { MetaData, PageData, Source, VirtualFile } from 'fumadocs-core/source';\nimport * as path from 'node:path';\nimport type { DocCollection, DocsCollection, MetaCollection } from '@/config';\nimport type { StandardSchemaV1 } from '@standard-schema/spec';\nimport type { CompiledMDXProperties } from '@/loaders/mdx/build-mdx';\nimport type { InternalTypeConfig, DocData, DocMethods, FileInfo, MetaMethods } from './types';\n\nexport type MetaCollectionEntry<Data> = Data & MetaMethods;\n\nexport type DocCollectionEntry<\n Name extends string = string,\n Frontmatter = unknown,\n TC extends InternalTypeConfig = InternalTypeConfig,\n> = DocData & DocMethods & Frontmatter & TC['DocData'][Name];\n\nexport type AsyncDocCollectionEntry<\n Name extends string = string,\n Frontmatter = unknown,\n TC extends InternalTypeConfig = InternalTypeConfig,\n> = {\n load: () => Promise<DocData & TC['DocData'][Name]>;\n} & DocMethods &\n Frontmatter;\n\nexport interface DocsCollectionEntry<\n Name extends string = string,\n Frontmatter extends PageData = PageData,\n Meta extends MetaData = MetaData,\n TC extends InternalTypeConfig = InternalTypeConfig,\n> {\n docs: DocCollectionEntry<Name, Frontmatter, TC>[];\n meta: MetaCollectionEntry<Meta>[];\n toFumadocsSource: () => Source<{\n pageData: DocCollectionEntry<Name, Frontmatter, TC>;\n metaData: MetaCollectionEntry<Meta>;\n }>;\n}\n\nexport interface AsyncDocsCollectionEntry<\n Name extends string = string,\n Frontmatter extends PageData = PageData,\n Meta extends MetaData = MetaData,\n TC extends InternalTypeConfig = InternalTypeConfig,\n> {\n docs: AsyncDocCollectionEntry<Name, Frontmatter, TC>[];\n meta: MetaCollectionEntry<Meta>[];\n toFumadocsSource: () => Source<{\n pageData: AsyncDocCollectionEntry<Name, Frontmatter, TC>;\n metaData: MetaCollectionEntry<Meta>;\n }>;\n}\n\ntype AwaitableGlobEntries<T> = Record<string, T | (() => Promise<T>)>;\n\nexport type ServerCreate<Config, TC extends InternalTypeConfig = InternalTypeConfig> = ReturnType<\n typeof server<Config, TC>\n>;\n\nexport interface ServerOptions {\n doc?: {\n passthroughs?: string[];\n };\n}\n\nexport function server<Config, TC extends InternalTypeConfig>(options: ServerOptions = {}) {\n const { doc: { passthroughs: docPassthroughs = [] } = {} } = options;\n\n function fileInfo(file: string, base: string): FileInfo {\n if (file.startsWith('./')) {\n file = file.slice(2);\n }\n\n return {\n path: file,\n fullPath: path.join(base, file),\n };\n }\n\n function mapDocData(entry: CompiledMDXProperties): DocData {\n const data: DocData = {\n body: entry.default,\n toc: entry.toc,\n structuredData: entry.structuredData,\n _exports: entry as unknown as Record<string, unknown>,\n };\n\n for (const key of docPassthroughs) {\n // @ts-expect-error -- handle passthrough properties\n data[key] = entry[key];\n }\n\n return data;\n }\n\n return {\n async doc<Name extends keyof Config & string>(\n _name: Name,\n base: string,\n glob: AwaitableGlobEntries<unknown>,\n ) {\n const out = await Promise.all(\n Object.entries(glob).map(async ([k, v]) => {\n const data: CompiledMDXProperties = typeof v === 'function' ? await v() : v;\n\n return {\n ...mapDocData(data),\n ...(data.frontmatter as object),\n ...createDocMethods(fileInfo(k, base), () => data),\n } satisfies DocCollectionEntry;\n }),\n );\n\n return out as unknown as Config[Name] extends\n | DocCollection<infer Schema>\n | DocsCollection<infer Schema>\n ? DocCollectionEntry<Name, StandardSchemaV1.InferOutput<Schema>, TC>[]\n : never;\n },\n async docLazy<Name extends keyof Config & string>(\n _name: Name,\n base: string,\n head: AwaitableGlobEntries<unknown>,\n body: Record<string, () => Promise<unknown>>,\n ) {\n const out = await Promise.all(\n Object.entries(head).map(async ([k, v]) => {\n const data = typeof v === 'function' ? await v() : v;\n const content = body[k] as () => Promise<CompiledMDXProperties>;\n\n return {\n ...data,\n ...createDocMethods(fileInfo(k, base), content),\n async load() {\n return mapDocData(await content());\n },\n } satisfies AsyncDocCollectionEntry;\n }),\n );\n\n return out as unknown as Config[Name] extends\n | DocCollection<infer Schema>\n | DocsCollection<infer Schema>\n ? AsyncDocCollectionEntry<Name, StandardSchemaV1.InferOutput<Schema>, TC>[]\n : never;\n },\n async meta<Name extends keyof Config & string>(\n _name: Name,\n base: string,\n glob: AwaitableGlobEntries<unknown>,\n ) {\n const out = await Promise.all(\n Object.entries(glob).map(async ([k, v]) => {\n const data = typeof v === 'function' ? await v() : v;\n\n return {\n info: fileInfo(k, base),\n ...data,\n } satisfies MetaCollectionEntry<unknown>;\n }),\n );\n\n return out as unknown as Config[Name] extends\n | MetaCollection<infer Schema>\n | DocsCollection<StandardSchemaV1, infer Schema>\n ? MetaCollectionEntry<StandardSchemaV1.InferOutput<Schema>>[]\n : never;\n },\n\n async docs<Name extends keyof Config & string>(\n name: Name,\n base: string,\n metaGlob: AwaitableGlobEntries<unknown>,\n docGlob: AwaitableGlobEntries<unknown>,\n ) {\n const entry = {\n docs: await this.doc(name, base, docGlob),\n meta: await this.meta(name, base, metaGlob),\n toFumadocsSource() {\n return toFumadocsSource(this.docs, this.meta);\n },\n } satisfies DocsCollectionEntry;\n\n return entry as Config[Name] extends DocsCollection<infer Page, infer Meta>\n ? StandardSchemaV1.InferOutput<Page> extends PageData\n ? StandardSchemaV1.InferOutput<Meta> extends MetaData\n ? DocsCollectionEntry<\n Name,\n StandardSchemaV1.InferOutput<Page>,\n StandardSchemaV1.InferOutput<Meta>,\n TC\n >\n : never\n : never\n : never;\n },\n async docsLazy<Name extends keyof Config & string>(\n name: Name,\n base: string,\n metaGlob: AwaitableGlobEntries<unknown>,\n docHeadGlob: AwaitableGlobEntries<unknown>,\n docBodyGlob: Record<string, () => Promise<unknown>>,\n ) {\n const entry = {\n docs: await this.docLazy(name, base, docHeadGlob, docBodyGlob),\n meta: await this.meta(name, base, metaGlob),\n toFumadocsSource() {\n return toFumadocsSource(this.docs, this.meta);\n },\n } satisfies AsyncDocsCollectionEntry;\n\n return entry as Config[Name] extends DocsCollection<infer Page, infer Meta>\n ? StandardSchemaV1.InferOutput<Page> extends PageData\n ? StandardSchemaV1.InferOutput<Meta> extends MetaData\n ? AsyncDocsCollectionEntry<\n Name,\n StandardSchemaV1.InferOutput<Page>,\n StandardSchemaV1.InferOutput<Meta>,\n TC\n >\n : never\n : never\n : never;\n },\n };\n}\n\nexport function toFumadocsSource<\n Page extends DocMethods & PageData,\n Meta extends MetaMethods & MetaData,\n>(\n pages: Page[],\n metas: Meta[],\n): Source<{\n pageData: Page;\n metaData: Meta;\n}> {\n const files: VirtualFile<{\n pageData: Page;\n metaData: Meta;\n }>[] = [];\n\n for (const entry of pages) {\n files.push({\n type: 'page',\n path: entry.info.path,\n absolutePath: entry.info.fullPath,\n data: entry,\n });\n }\n\n for (const entry of metas) {\n files.push({\n type: 'meta',\n path: entry.info.path,\n absolutePath: entry.info.fullPath,\n data: entry,\n });\n }\n\n return {\n files,\n };\n}\n\nfunction createDocMethods(\n info: FileInfo,\n load: () => CompiledMDXProperties | Promise<CompiledMDXProperties>,\n): DocMethods {\n return {\n info,\n async getText(type) {\n if (type === 'raw') {\n const fs = await import('node:fs/promises');\n\n return (await fs.readFile(info.fullPath)).toString();\n }\n\n const data = await load();\n if (typeof data._markdown !== 'string')\n throw new Error(\n \"getText('processed') requires `includeProcessedMarkdown` to be enabled in your collection config.\",\n );\n return data._markdown;\n },\n async getMDAST() {\n const data = await load();\n\n if (!data._mdast)\n throw new Error(\n 'getMDAST() requires `includeMDAST` to be enabled in your collection config.',\n );\n return JSON.parse(data._mdast);\n },\n };\n}\n"],"mappings":";;;AAgEA,SAAgB,OAA8C,UAAyB,EAAE,EAAE;CACzF,MAAM,EAAE,KAAK,EAAE,cAAc,kBAAkB,EAAE,KAAK,EAAE,KAAK;CAE7D,SAAS,SAAS,MAAc,MAAwB;AACtD,MAAI,KAAK,WAAW,KAAK,CACvB,QAAO,KAAK,MAAM,EAAE;AAGtB,SAAO;GACL,MAAM;GACN,UAAUA,OAAK,KAAK,MAAM,KAAK;GAChC;;CAGH,SAAS,WAAW,OAAuC;EACzD,MAAM,OAAgB;GACpB,MAAM,MAAM;GACZ,KAAK,MAAM;GACX,gBAAgB,MAAM;GACtB,UAAU;GACX;AAED,OAAK,MAAM,OAAO,gBAEhB,MAAK,OAAO,MAAM;AAGpB,SAAO;;AAGT,QAAO;EACL,MAAM,IACJ,OACA,MACA,MACA;AAaA,UAZY,MAAM,QAAQ,IACxB,OAAO,QAAQ,KAAK,CAAC,IAAI,OAAO,CAAC,GAAG,OAAO;IACzC,MAAM,OAA8B,OAAO,MAAM,aAAa,MAAM,GAAG,GAAG;AAE1E,WAAO;KACL,GAAG,WAAW,KAAK;KACnB,GAAI,KAAK;KACT,GAAG,iBAAiB,SAAS,GAAG,KAAK,QAAQ,KAAK;KACnD;KACD,CACH;;EAQH,MAAM,QACJ,OACA,MACA,MACA,MACA;AAgBA,UAfY,MAAM,QAAQ,IACxB,OAAO,QAAQ,KAAK,CAAC,IAAI,OAAO,CAAC,GAAG,OAAO;IACzC,MAAM,OAAO,OAAO,MAAM,aAAa,MAAM,GAAG,GAAG;IACnD,MAAM,UAAU,KAAK;AAErB,WAAO;KACL,GAAG;KACH,GAAG,iBAAiB,SAAS,GAAG,KAAK,EAAE,QAAQ;KAC/C,MAAM,OAAO;AACX,aAAO,WAAW,MAAM,SAAS,CAAC;;KAErC;KACD,CACH;;EAQH,MAAM,KACJ,OACA,MACA,MACA;AAYA,UAXY,MAAM,QAAQ,IACxB,OAAO,QAAQ,KAAK,CAAC,IAAI,OAAO,CAAC,GAAG,OAAO;IACzC,MAAM,OAAO,OAAO,MAAM,aAAa,MAAM,GAAG,GAAG;AAEnD,WAAO;KACL,MAAM,SAAS,GAAG,KAAK;KACvB,GAAG;KACJ;KACD,CACH;;EASH,MAAM,KACJ,MACA,MACA,UACA,SACA;AASA,UARc;IACZ,MAAM,MAAM,KAAK,IAAI,MAAM,MAAM,QAAQ;IACzC,MAAM,MAAM,KAAK,KAAK,MAAM,MAAM,SAAS;IAC3C,mBAAmB;AACjB,YAAO,iBAAiB,KAAK,MAAM,KAAK,KAAK;;IAEhD;;EAeH,MAAM,SACJ,MACA,MACA,UACA,aACA,aACA;AASA,UARc;IACZ,MAAM,MAAM,KAAK,QAAQ,MAAM,MAAM,aAAa,YAAY;IAC9D,MAAM,MAAM,KAAK,KAAK,MAAM,MAAM,SAAS;IAC3C,mBAAmB;AACjB,YAAO,iBAAiB,KAAK,MAAM,KAAK,KAAK;;IAEhD;;EAeJ;;AAGH,SAAgB,iBAId,OACA,OAIC;CACD,MAAM,QAGC,EAAE;AAET,MAAK,MAAM,SAAS,MAClB,OAAM,KAAK;EACT,MAAM;EACN,MAAM,MAAM,KAAK;EACjB,cAAc,MAAM,KAAK;EACzB,MAAM;EACP,CAAC;AAGJ,MAAK,MAAM,SAAS,MAClB,OAAM,KAAK;EACT,MAAM;EACN,MAAM,MAAM,KAAK;EACjB,cAAc,MAAM,KAAK;EACzB,MAAM;EACP,CAAC;AAGJ,QAAO,EACL,OACD;;AAGH,SAAS,iBACP,MACA,MACY;AACZ,QAAO;EACL;EACA,MAAM,QAAQ,MAAM;AAClB,OAAI,SAAS,MAGX,SAAQ,OAFG,MAAM,OAAO,qBAEP,SAAS,KAAK,SAAS,EAAE,UAAU;GAGtD,MAAM,OAAO,MAAM,MAAM;AACzB,OAAI,OAAO,KAAK,cAAc,SAC5B,OAAM,IAAI,MACR,oGACD;AACH,UAAO,KAAK;;EAEd,MAAM,WAAW;GACf,MAAM,OAAO,MAAM,MAAM;AAEzB,OAAI,CAAC,KAAK,OACR,OAAM,IAAI,MACR,8EACD;AACH,UAAO,KAAK,MAAM,KAAK,OAAO;;EAEjC"}
|
package/dist/runtime/types.d.ts
CHANGED
|
@@ -1,61 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { Root } from 'mdast';
|
|
4
|
-
import { MDXContent } from 'mdx/types';
|
|
5
|
-
|
|
6
|
-
interface DocData {
|
|
7
|
-
/**
|
|
8
|
-
* Compiled MDX content (as component)
|
|
9
|
-
*/
|
|
10
|
-
body: MDXContent;
|
|
11
|
-
/**
|
|
12
|
-
* table of contents generated from content.
|
|
13
|
-
*/
|
|
14
|
-
toc: TOCItemType[];
|
|
15
|
-
/**
|
|
16
|
-
* structured data for document search indexing.
|
|
17
|
-
*/
|
|
18
|
-
structuredData: StructuredData;
|
|
19
|
-
/**
|
|
20
|
-
* Raw exports from the compiled MDX file.
|
|
21
|
-
*/
|
|
22
|
-
_exports: Record<string, unknown>;
|
|
23
|
-
}
|
|
24
|
-
interface FileInfo {
|
|
25
|
-
/**
|
|
26
|
-
* virtualized path for Source API
|
|
27
|
-
*/
|
|
28
|
-
path: string;
|
|
29
|
-
/**
|
|
30
|
-
* the file path in file system
|
|
31
|
-
*/
|
|
32
|
-
fullPath: string;
|
|
33
|
-
}
|
|
34
|
-
interface DocMethods {
|
|
35
|
-
/**
|
|
36
|
-
* file info
|
|
37
|
-
*/
|
|
38
|
-
info: FileInfo;
|
|
39
|
-
/**
|
|
40
|
-
* get document as text.
|
|
41
|
-
*
|
|
42
|
-
* - `type: raw` - read the original content from file system.
|
|
43
|
-
* - `type: processed` - get the processed Markdown content, only available when `includeProcessedMarkdown` is enabled on collection config.
|
|
44
|
-
*/
|
|
45
|
-
getText: (type: 'raw' | 'processed') => Promise<string>;
|
|
46
|
-
getMDAST: () => Promise<Root>;
|
|
47
|
-
}
|
|
48
|
-
interface MetaMethods {
|
|
49
|
-
/**
|
|
50
|
-
* file info
|
|
51
|
-
*/
|
|
52
|
-
info: FileInfo;
|
|
53
|
-
}
|
|
54
|
-
interface InternalTypeConfig {
|
|
55
|
-
/**
|
|
56
|
-
* collection name -> collection properties
|
|
57
|
-
*/
|
|
58
|
-
DocData: Record<string, unknown>;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export type { DocData, DocMethods, FileInfo, InternalTypeConfig, MetaMethods };
|
|
1
|
+
import { a as MetaMethods, i as InternalTypeConfig, n as DocMethods, r as FileInfo, t as DocData } from "../types-B6myALSk.js";
|
|
2
|
+
export { DocData, DocMethods, FileInfo, InternalTypeConfig, MetaMethods };
|
package/dist/runtime/types.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Root } from "mdast";
|
|
2
|
+
import { StructuredData } from "fumadocs-core/mdx-plugins/remark-structure";
|
|
3
|
+
import { TOCItemType } from "fumadocs-core/toc";
|
|
4
|
+
import { MDXContent } from "mdx/types";
|
|
5
|
+
|
|
6
|
+
//#region src/runtime/types.d.ts
|
|
7
|
+
interface DocData {
|
|
8
|
+
/**
|
|
9
|
+
* Compiled MDX content (as component)
|
|
10
|
+
*/
|
|
11
|
+
body: MDXContent;
|
|
12
|
+
/**
|
|
13
|
+
* table of contents generated from content.
|
|
14
|
+
*/
|
|
15
|
+
toc: TOCItemType[];
|
|
16
|
+
/**
|
|
17
|
+
* structured data for document search indexing.
|
|
18
|
+
*/
|
|
19
|
+
structuredData: StructuredData;
|
|
20
|
+
/**
|
|
21
|
+
* Raw exports from the compiled MDX file.
|
|
22
|
+
*/
|
|
23
|
+
_exports: Record<string, unknown>;
|
|
24
|
+
}
|
|
25
|
+
interface FileInfo {
|
|
26
|
+
/**
|
|
27
|
+
* virtualized path for Source API
|
|
28
|
+
*/
|
|
29
|
+
path: string;
|
|
30
|
+
/**
|
|
31
|
+
* the file path in file system
|
|
32
|
+
*/
|
|
33
|
+
fullPath: string;
|
|
34
|
+
}
|
|
35
|
+
interface DocMethods {
|
|
36
|
+
/**
|
|
37
|
+
* file info
|
|
38
|
+
*/
|
|
39
|
+
info: FileInfo;
|
|
40
|
+
/**
|
|
41
|
+
* get document as text.
|
|
42
|
+
*
|
|
43
|
+
* - `type: raw` - read the original content from file system.
|
|
44
|
+
* - `type: processed` - get the processed Markdown content, only available when `includeProcessedMarkdown` is enabled on collection config.
|
|
45
|
+
*/
|
|
46
|
+
getText: (type: 'raw' | 'processed') => Promise<string>;
|
|
47
|
+
getMDAST: () => Promise<Root>;
|
|
48
|
+
}
|
|
49
|
+
interface MetaMethods {
|
|
50
|
+
/**
|
|
51
|
+
* file info
|
|
52
|
+
*/
|
|
53
|
+
info: FileInfo;
|
|
54
|
+
}
|
|
55
|
+
interface InternalTypeConfig {
|
|
56
|
+
/**
|
|
57
|
+
* collection name -> collection properties
|
|
58
|
+
*/
|
|
59
|
+
DocData: Record<string, unknown>;
|
|
60
|
+
}
|
|
61
|
+
//#endregion
|
|
62
|
+
export { MetaMethods as a, InternalTypeConfig as i, DocMethods as n, FileInfo as r, DocData as t };
|
|
63
|
+
//# sourceMappingURL=types-B6myALSk.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-B6myALSk.d.ts","names":[],"sources":["../src/runtime/types.ts"],"sourcesContent":[],"mappings":";;;;;;UAKiB,OAAA;;AAAjB;;EASO,IAAA,EALC,UAKD;EAKW;;;EAQD,GAAA,EAbV,WAakB,EAAA;EAYR;;;EAcS,cAAA,EAlCR,cAkCQ;EAAR;;AAGlB;EAOiB,QAAA,EAvCL,MAuCK,CAAA,MAAkB,EAAA,OAAA,CAIxB;;UAxCM,QAAA;;;;;;;;;;UAYA,UAAA;;;;QAIT;;;;;;;0CAQkC;kBAExB,QAAQ;;UAGT,WAAA;;;;QAIT;;UAGS,kBAAA;;;;WAIN"}
|
package/dist/vite/index.d.ts
CHANGED
|
@@ -1,44 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import '@mdx-js/mdx';
|
|
4
|
-
import '@standard-schema/spec';
|
|
5
|
-
import 'unified';
|
|
6
|
-
import 'fumadocs-core/mdx-plugins';
|
|
7
|
-
import 'fumadocs-core/source/schema';
|
|
8
|
-
import 'chokidar';
|
|
9
|
-
import 'vfile';
|
|
10
|
-
import 'fumadocs-core/source';
|
|
11
|
-
import '../runtime/types.js';
|
|
12
|
-
import 'fumadocs-core/mdx-plugins/remark-structure';
|
|
13
|
-
import 'fumadocs-core/toc';
|
|
14
|
-
import 'mdast';
|
|
15
|
-
import 'mdx/types';
|
|
1
|
+
import { h as IndexFilePluginOptions } from "../core-DG43f_AU.js";
|
|
2
|
+
import { Plugin } from "vite";
|
|
16
3
|
|
|
4
|
+
//#region src/vite/index.d.ts
|
|
17
5
|
interface PluginOptions {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Generate index files for accessing content.
|
|
8
|
+
*
|
|
9
|
+
* @defaultValue true
|
|
10
|
+
*/
|
|
11
|
+
index?: boolean | IndexFilePluginOptions;
|
|
12
|
+
/**
|
|
13
|
+
* @defaultValue source.config.ts
|
|
14
|
+
*/
|
|
15
|
+
configPath?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Update Vite config to fix module resolution of Fumadocs
|
|
18
|
+
*
|
|
19
|
+
* @defaultValue true
|
|
20
|
+
*/
|
|
21
|
+
updateViteConfig?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Output directory of generated files
|
|
24
|
+
*
|
|
25
|
+
* @defaultValue '.source'
|
|
26
|
+
*/
|
|
27
|
+
outDir?: string;
|
|
40
28
|
}
|
|
41
29
|
declare function mdx(config: Record<string, unknown>, pluginOptions?: PluginOptions): Promise<Plugin>;
|
|
42
30
|
declare function postInstall(pluginOptions?: PluginOptions): Promise<void>;
|
|
43
|
-
|
|
44
|
-
export {
|
|
31
|
+
//#endregion
|
|
32
|
+
export { PluginOptions, mdx as default, postInstall };
|
|
33
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/vite/index.ts"],"sourcesContent":[],"mappings":";;;;UAWiB,aAAA;;AAAjB;AA0BC;;;EAKU,KAAA,CAAA,EAAA,OAAA,GAzBS,sBAyBT;EAAR;;AAiEH;;;;;;;;;;;;;;;iBApE8B,GAAA,SACpB,yCACO,gBACd,QAAQ;iBAiEW,WAAA,iBAA2B,gBAAkB"}
|