fumadocs-mdx 15.4.9 → 15.5.0
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-BUIa-1SI.js → adapter-C_fAYz8a.js} +6 -7
- package/dist/bin.js +1 -2
- package/dist/{build-H2VN-Hpm.js → build-6pmheBOc.js} +4 -5
- package/dist/{build-default-CSiWktEh.js → build-default-DxRVIZIq.js} +42 -13
- package/dist/{build-satteri-DUjpwpvb.js → build-satteri-BRRVAMZo.js} +2 -3
- package/dist/bun/index.d.ts +3 -5
- package/dist/bun/index.js +10 -11
- package/dist/{codegen-DfCJFqO-.js → codegen-D-Cjx_kh.js} +1 -2
- package/dist/config/index.d.ts +23 -3
- package/dist/config/index.js +4 -4
- package/dist/{core-DV3f7rXs.js → core-B3ysiPKS.js} +4 -7
- package/dist/{core-6H7qqwEM.d.ts → core-CdciznjV.d.ts} +5 -25
- package/dist/{define-BW5lveuc.js → define-C2jwQBlt.js} +1 -2
- package/dist/{dist-DrAxpp76.js → dist-C5kTFYyB.js} +1 -2
- package/dist/{eval-Cnxpyc4j.js → eval-BK4eWlcF.js} +6 -7
- package/dist/{index-CIxuOQ_6.d.ts → index-DHkDeoqE.d.ts} +1 -3
- package/dist/{index-file-C9-jDz59.js → index-file-Cd0QDLxu.js} +3 -5
- package/dist/index.d.ts +1 -1
- package/dist/{last-modified-BkZYFKSh.js → last-modified-COIEvwZu.js} +1 -2
- package/dist/{load-from-file-DGFWQ0eg.js → load-from-file-BP8EpGZa.js} +2 -3
- package/dist/{loaders-DWC_Uwqq.js → loaders-B_gj5Fq1.js} +1 -2
- package/dist/macro/index.d.ts +1 -3
- package/dist/macro/index.js +1 -2
- package/dist/{mdx-D0Qtc99b.js → mdx-wIFREygW.js} +5 -5
- package/dist/{meta-BR_rkCyY.js → meta-B2-_R5y0.js} +1 -2
- package/dist/next/index.d.ts +3 -5
- package/dist/next/index.js +6 -7
- package/dist/node/_loader.d.ts +1 -3
- package/dist/node/_loader.js +10 -11
- package/dist/node/index.d.ts +3 -5
- package/dist/node/index.js +1 -2
- package/dist/node/loader.d.ts +1 -3
- package/dist/node/loader.js +6 -7
- package/dist/{options-BNnYUjkM.js → options-B2o-zV4A.js} +1 -2
- package/dist/{options-aB6xV-d7.d.ts → options-BCId5Url.d.ts} +0 -2
- package/dist/plugins/index-file.d.ts +1 -1
- package/dist/plugins/index-file.js +1 -1
- package/dist/plugins/json-schema.d.ts +2 -4
- package/dist/plugins/json-schema.js +1 -2
- package/dist/plugins/last-modified.d.ts +2 -4
- package/dist/plugins/last-modified.js +1 -2
- package/dist/preset-Vhfrb01t.js +58 -0
- package/dist/press.d.ts +10 -0
- package/dist/press.js +53 -0
- package/dist/rolldown/index.d.ts +3 -5
- package/dist/rolldown/index.js +10 -11
- package/dist/{rolldown-runtime-D7D4PA-g.js → rolldown-runtime-D8jQpDG7.js} +1 -2
- package/dist/runtime/browser.d.ts +2 -4
- package/dist/runtime/browser.js +1 -2
- package/dist/runtime/dynamic.d.ts +4 -6
- package/dist/runtime/dynamic.js +3 -4
- package/dist/runtime/macro.d.ts +1 -3
- package/dist/runtime/macro.js +1 -2
- package/dist/runtime/server.d.ts +3 -5
- package/dist/runtime/server.js +1 -2
- package/dist/runtime/types.d.ts +1 -1
- package/dist/{transform-CpwlddS0.js → transform-CVIZq8Al.js} +4 -5
- package/dist/{types-1n7Fk5Dl.d.ts → types-CBr1-xYX.d.ts} +0 -2
- package/dist/vite/index.d.ts +4 -6
- package/dist/vite/index.js +20 -15
- package/dist/webpack/macro.d.ts +1 -3
- package/dist/webpack/macro.js +3 -4
- package/dist/webpack/mdx.d.ts +1 -3
- package/dist/webpack/mdx.js +4 -5
- package/dist/webpack/meta.d.ts +1 -3
- package/dist/webpack/meta.js +4 -5
- package/dist/{webpack-BozYCamo.js → webpack-DyVbvTYa.js} +3 -4
- package/package.json +13 -7
- package/dist/index-DosG5f9I.d.ts +0 -28
- package/dist/remark-include-WlmaWKPS.js +0 -318
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { i as buildConfig, n as ValidationError } from "./core-
|
|
2
|
-
import { t as loadConfig } from "./load-from-file-
|
|
1
|
+
import { i as buildConfig, n as ValidationError } from "./core-B3ysiPKS.js";
|
|
2
|
+
import { t as loadConfig } from "./load-from-file-BP8EpGZa.js";
|
|
3
3
|
import { readFileSync } from "node:fs";
|
|
4
4
|
import fs from "node:fs/promises";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
6
|
import { parse } from "node:querystring";
|
|
7
|
-
|
|
7
|
+
// src/loaders/config.ts
|
|
8
8
|
function createStandaloneConfigLoader({ core, buildConfig: buildConfig$1, mode }) {
|
|
9
9
|
let prev;
|
|
10
10
|
async function getConfigHash() {
|
|
@@ -34,8 +34,7 @@ function createIntegratedConfigLoader(core) {
|
|
|
34
34
|
return core;
|
|
35
35
|
} };
|
|
36
36
|
}
|
|
37
|
-
|
|
38
|
-
//#region src/loaders/adapter.ts
|
|
37
|
+
// src/loaders/adapter.ts
|
|
39
38
|
function toNode(test, loader) {
|
|
40
39
|
return async (url, _context, nextLoad) => {
|
|
41
40
|
if (url.startsWith("file:///") && (!test || test.test(url))) {
|
|
@@ -59,13 +58,14 @@ function toNode(test, loader) {
|
|
|
59
58
|
return nextLoad(url);
|
|
60
59
|
};
|
|
61
60
|
}
|
|
62
|
-
function toVite(loader) {
|
|
61
|
+
function toVite(loader, getInput) {
|
|
63
62
|
return { async transform(value, id) {
|
|
64
63
|
const [file, query = ""] = id.split("?", 2);
|
|
65
64
|
try {
|
|
66
65
|
const parsedQuery = parse(query);
|
|
67
66
|
if ("raw" in parsedQuery) return null;
|
|
68
67
|
const result = await loader.load({
|
|
68
|
+
...getInput?.(),
|
|
69
69
|
filePath: file,
|
|
70
70
|
query: parsedQuery,
|
|
71
71
|
getSource() {
|
|
@@ -139,5 +139,4 @@ function toBun(test, loader) {
|
|
|
139
139
|
});
|
|
140
140
|
};
|
|
141
141
|
}
|
|
142
|
-
//#endregion
|
|
143
142
|
export { createIntegratedConfigLoader as a, toWebpack as i, toNode as n, createStandaloneConfigLoader as o, toVite as r, toBun as t };
|
package/dist/bin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { existsSync } from "node:fs";
|
|
3
|
-
|
|
3
|
+
// src/bin.ts
|
|
4
4
|
async function start() {
|
|
5
5
|
const [configPath, outDir] = process.argv.slice(2);
|
|
6
6
|
if (existsSync("next.config.js") || existsSync("next.config.mjs") || existsSync("next.config.mts") || existsSync("next.config.ts")) {
|
|
@@ -18,4 +18,3 @@ async function start() {
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
start();
|
|
21
|
-
//#endregion
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D8jQpDG7.js";
|
|
2
|
+
// src/loaders/mdx/build.ts
|
|
3
3
|
var build_exports = /* @__PURE__ */ __exportAll({ buildMDX: () => buildMDX });
|
|
4
4
|
async function buildMDX(core, collection, options) {
|
|
5
5
|
if ((collection ? collection.compiler : core.getConfig().global.compiler) === "satteri") {
|
|
6
|
-
const { buildSatteriMDX } = await import("./build-satteri-
|
|
6
|
+
const { buildSatteriMDX } = await import("./build-satteri-BRRVAMZo.js");
|
|
7
7
|
return buildSatteriMDX(core, collection, options);
|
|
8
8
|
}
|
|
9
|
-
const { buildJSMDX } = await import("./build-default-
|
|
9
|
+
const { buildJSMDX } = await import("./build-default-DxRVIZIq.js");
|
|
10
10
|
return buildJSMDX(core, collection, options);
|
|
11
11
|
}
|
|
12
|
-
//#endregion
|
|
13
12
|
export { build_exports as n, buildMDX as t };
|
|
@@ -1,11 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as resolveLastModified } from "./last-modified-
|
|
3
|
-
import {
|
|
1
|
+
import { t as applyMdxPreset } from "./preset-Vhfrb01t.js";
|
|
2
|
+
import { t as resolveLastModified } from "./last-modified-COIEvwZu.js";
|
|
3
|
+
import { remarkInclude } from "fumadocs-core/mdx-plugins/remark-include";
|
|
4
4
|
import { createProcessor } from "@mdx-js/mdx";
|
|
5
|
+
import { VFile } from "vfile";
|
|
5
6
|
import { valueToEstree } from "estree-util-value-to-estree";
|
|
6
7
|
import { removePosition } from "unist-util-remove-position";
|
|
7
8
|
import { remarkLLMs } from "fumadocs-core/mdx-plugins/remark-llms";
|
|
8
|
-
|
|
9
|
+
// src/loaders/mdx/mdast-utils.ts
|
|
10
|
+
function flattenNode(node) {
|
|
11
|
+
if ("children" in node) return node.children.map((child) => flattenNode(child)).join("");
|
|
12
|
+
if ("value" in node) return node.value;
|
|
13
|
+
return "";
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Visit a tree in document order, returning `skip` skips the children of a node and `false` stops the walk.
|
|
17
|
+
*/
|
|
18
|
+
function walk(node, visitor, index, parent) {
|
|
19
|
+
const result = visitor(node, index, parent);
|
|
20
|
+
if (result === false) return false;
|
|
21
|
+
if (result !== "skip" && node.children) {
|
|
22
|
+
for (let i = 0; i < node.children.length; i++) if (!walk(node.children[i], visitor, i, node)) return false;
|
|
23
|
+
}
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
// src/loaders/mdx/remark-postprocess.ts
|
|
9
27
|
/**
|
|
10
28
|
* - collect references
|
|
11
29
|
* - write frontmatter (auto-title & description)
|
|
@@ -91,13 +109,12 @@ function getMdastExport(name, value) {
|
|
|
91
109
|
} }
|
|
92
110
|
};
|
|
93
111
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
async function buildJSMDX(core, collection, { filePath, frontmatter, source, _compiler, environment, isDevelopment }) {
|
|
112
|
+
// src/loaders/mdx/build-default.ts
|
|
113
|
+
async function buildJSMDX(core, collection, { filePath, frontmatter, source, _compiler, environment, isDevelopment, importsOnly = false }) {
|
|
97
114
|
const mdxOptions = await getMDXOptions(core.getConfig(), collection, environment);
|
|
98
115
|
function getProcessor(format) {
|
|
99
116
|
const cache = core.cache;
|
|
100
|
-
const key = `build-mdx:${collection?.name ?? "global"}:${format}`;
|
|
117
|
+
const key = `build-mdx:${collection?.name ?? "global"}:${format}:${importsOnly}`;
|
|
101
118
|
let processor = cache.get(key);
|
|
102
119
|
if (!processor) {
|
|
103
120
|
const postprocessOptions = {
|
|
@@ -109,9 +126,9 @@ async function buildJSMDX(core, collection, { filePath, frontmatter, source, _co
|
|
|
109
126
|
development: isDevelopment,
|
|
110
127
|
...mdxOptions,
|
|
111
128
|
remarkPlugins: [
|
|
112
|
-
remarkInclude,
|
|
129
|
+
[remarkInclude, { getProcessor }],
|
|
113
130
|
...mdxOptions.remarkPlugins ?? [],
|
|
114
|
-
[remarkPostprocess, postprocessOptions]
|
|
131
|
+
importsOnly ? remarkImportsOnly : [remarkPostprocess, postprocessOptions]
|
|
115
132
|
],
|
|
116
133
|
format
|
|
117
134
|
});
|
|
@@ -125,8 +142,7 @@ async function buildJSMDX(core, collection, { filePath, frontmatter, source, _co
|
|
|
125
142
|
cwd: collection?.cwd,
|
|
126
143
|
data: {
|
|
127
144
|
frontmatter,
|
|
128
|
-
_compiler
|
|
129
|
-
_getProcessor: getProcessor
|
|
145
|
+
_compiler
|
|
130
146
|
}
|
|
131
147
|
});
|
|
132
148
|
if (collection) vfile = await core.transformVFile({
|
|
@@ -148,6 +164,20 @@ async function buildJSMDX(core, collection, { filePath, frontmatter, source, _co
|
|
|
148
164
|
map: out.map
|
|
149
165
|
};
|
|
150
166
|
}
|
|
167
|
+
/**
|
|
168
|
+
* Keep only the ESM, after the remark plugins that may add imports, so the other plugins have nothing to process.
|
|
169
|
+
*/
|
|
170
|
+
function remarkImportsOnly() {
|
|
171
|
+
return (tree) => {
|
|
172
|
+
const esm = [];
|
|
173
|
+
walk(tree, (node) => {
|
|
174
|
+
if (node.type !== "mdxjsEsm") return;
|
|
175
|
+
esm.push(node);
|
|
176
|
+
return "skip";
|
|
177
|
+
});
|
|
178
|
+
tree.children = esm;
|
|
179
|
+
};
|
|
180
|
+
}
|
|
151
181
|
const mdxOptionsCache = /* @__PURE__ */ new WeakMap();
|
|
152
182
|
function getMDXOptions(config, collection, environment = "bundler") {
|
|
153
183
|
let cacheMap = mdxOptionsCache.get(config);
|
|
@@ -170,5 +200,4 @@ function getMDXOptions(config, collection, environment = "bundler") {
|
|
|
170
200
|
cacheMap.set(key, result);
|
|
171
201
|
return result;
|
|
172
202
|
}
|
|
173
|
-
//#endregion
|
|
174
203
|
export { buildJSMDX };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as resolveLastModified } from "./last-modified-
|
|
1
|
+
import { t as resolveLastModified } from "./last-modified-COIEvwZu.js";
|
|
2
2
|
import { pathToFileURL } from "node:url";
|
|
3
|
-
|
|
3
|
+
// src/loaders/mdx/build-satteri.ts
|
|
4
4
|
async function buildSatteriMDX(core, collection, { filePath, frontmatter, source, _compiler, environment, isDevelopment }) {
|
|
5
5
|
const satteriOptions = await getSatteriOptions(core.getConfig(), collection, environment);
|
|
6
6
|
const format = filePath.endsWith(".mdx") ? "mdx" : "md";
|
|
@@ -91,5 +91,4 @@ function getSatteriOptions(config, collection, environment = "bundler") {
|
|
|
91
91
|
cache.set(key, result);
|
|
92
92
|
return result;
|
|
93
93
|
}
|
|
94
|
-
//#endregion
|
|
95
94
|
export { buildSatteriMDX };
|
package/dist/bun/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { r as CoreOptions } from "../core-
|
|
2
|
-
import { n as ResolvedMacroOptions, t as MacroPluginOption } from "../options-
|
|
1
|
+
import { r as CoreOptions } from "../core-CdciznjV.js";
|
|
2
|
+
import { n as ResolvedMacroOptions, t as MacroPluginOption } from "../options-BCId5Url.js";
|
|
3
3
|
import { BunPlugin } from "bun";
|
|
4
|
-
//#region src/bun/index.d.ts
|
|
5
4
|
export interface MdxPluginOptions extends Pick<CoreOptions, 'configPath' | 'outDir' | 'plugins'> {
|
|
6
5
|
/**
|
|
7
6
|
* Configure the macro API (`fumadocs-mdx/macro`), or `false` to disable it.
|
|
@@ -16,5 +15,4 @@ export interface MdxPluginOptions extends Pick<CoreOptions, 'configPath' | 'outD
|
|
|
16
15
|
* @internal
|
|
17
16
|
*/
|
|
18
17
|
export declare function macroFilter(root: string, { include, exclude }: ResolvedMacroOptions): RegExp;
|
|
19
|
-
export declare function createMdxPlugin(options?: MdxPluginOptions): BunPlugin;
|
|
20
|
-
//#endregion
|
|
18
|
+
export declare function createMdxPlugin(options?: MdxPluginOptions): BunPlugin;
|
package/dist/bun/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { t as createMdxLoader } from "../mdx-
|
|
2
|
-
import { i as buildConfig, t as createCore } from "../core-
|
|
3
|
-
import { r as slash } from "../codegen-
|
|
4
|
-
import { a as createIntegratedConfigLoader, t as toBun } from "../adapter-
|
|
5
|
-
import { t as createMetaLoader } from "../meta-
|
|
6
|
-
import { r as metaLoaderGlob, t as mdxLoaderGlob } from "../loaders-
|
|
7
|
-
import { r as resolveMacroOptions } from "../options-
|
|
1
|
+
import { t as createMdxLoader } from "../mdx-wIFREygW.js";
|
|
2
|
+
import { i as buildConfig, t as createCore } from "../core-B3ysiPKS.js";
|
|
3
|
+
import { r as slash } from "../codegen-D-Cjx_kh.js";
|
|
4
|
+
import { a as createIntegratedConfigLoader, t as toBun } from "../adapter-C_fAYz8a.js";
|
|
5
|
+
import { t as createMetaLoader } from "../meta-B2-_R5y0.js";
|
|
6
|
+
import { r as metaLoaderGlob, t as mdxLoaderGlob } from "../loaders-B_gj5Fq1.js";
|
|
7
|
+
import { r as resolveMacroOptions } from "../options-B2o-zV4A.js";
|
|
8
8
|
import fs from "node:fs/promises";
|
|
9
9
|
import path from "node:path";
|
|
10
10
|
import { randomUUID } from "node:crypto";
|
|
11
11
|
import picomatch from "picomatch";
|
|
12
12
|
import { pathToFileURL } from "node:url";
|
|
13
|
-
|
|
13
|
+
// src/bun/index.ts
|
|
14
14
|
const EvalQueryKey = "fd-macro-eval";
|
|
15
15
|
/**
|
|
16
16
|
* @internal
|
|
@@ -44,7 +44,7 @@ function createMdxPlugin(options = {}) {
|
|
|
44
44
|
await core.init({ config: buildConfig(configExports, process.cwd()) });
|
|
45
45
|
if (macroOptions) {
|
|
46
46
|
const root = process.cwd();
|
|
47
|
-
const { MacroCollector } = await import("../eval-
|
|
47
|
+
const { MacroCollector } = await import("../eval-BK4eWlcF.js").then((n) => n.r);
|
|
48
48
|
const pendingEvals = /* @__PURE__ */ new Map();
|
|
49
49
|
core.macro = new MacroCollector({
|
|
50
50
|
root,
|
|
@@ -76,7 +76,7 @@ function createMdxPlugin(options = {}) {
|
|
|
76
76
|
contents: await transform(source, file) ?? source,
|
|
77
77
|
loader
|
|
78
78
|
};
|
|
79
|
-
const { transformMacroModule } = await import("../transform-
|
|
79
|
+
const { transformMacroModule } = await import("../transform-CVIZq8Al.js").then((n) => n.i);
|
|
80
80
|
return {
|
|
81
81
|
contents: (await transformMacroModule({
|
|
82
82
|
code: source,
|
|
@@ -94,5 +94,4 @@ function createMdxPlugin(options = {}) {
|
|
|
94
94
|
}
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
|
-
//#endregion
|
|
98
97
|
export { createMdxPlugin, macroFilter };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import { glob } from "tinyglobby";
|
|
3
|
-
|
|
3
|
+
// src/utils/codegen.ts
|
|
4
4
|
/**
|
|
5
5
|
* Code generator (one instance per file)
|
|
6
6
|
*/
|
|
@@ -104,5 +104,4 @@ function slash(path) {
|
|
|
104
104
|
function ident(code, tab = 1) {
|
|
105
105
|
return code.split("\n").map((v) => " ".repeat(tab) + v).join("\n");
|
|
106
106
|
}
|
|
107
|
-
//#endregion
|
|
108
107
|
export { ident as n, slash as r, createCodegen as t };
|
package/dist/config/index.d.ts
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
-
import { C as DocsCollection, D as defineCollections, E as SatteriPresetOptions, F as DefaultMDXOptions, I as MDXPresetOptions, L as applyMdxPreset, O as defineConfig, P as PostprocessOptions, S as DocCollectionSatteri, T as MetaCollection, _ as BaseCollection, b as DocCollectionBase, g as AnyCollection, k as defineDocs, v as CollectionSchema, w as GlobalConfig, x as DocCollectionMdx, y as DocCollection } from "../core-
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { C as DocsCollection, D as defineCollections, E as SatteriPresetOptions, F as DefaultMDXOptions, I as MDXPresetOptions, L as applyMdxPreset, O as defineConfig, P as PostprocessOptions, S as DocCollectionSatteri, T as MetaCollection, _ as BaseCollection, b as DocCollectionBase, g as AnyCollection, k as defineDocs, v as CollectionSchema, w as GlobalConfig, x as DocCollectionMdx, y as DocCollection } from "../core-CdciznjV.js";
|
|
2
|
+
import { remarkInclude } from "fumadocs-core/mdx-plugins/remark-include";
|
|
3
|
+
/** @deprecated import `pageSchema` from `fumadocs-core/source/schema` instead (since 16.2.3) */
|
|
4
|
+
export declare const frontmatterSchema: import("zod").ZodObject<{
|
|
5
|
+
title: import("zod").ZodString;
|
|
6
|
+
description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
7
|
+
icon: import("zod").ZodOptional<import("zod").ZodString>;
|
|
8
|
+
full: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
9
|
+
_openapi: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodCustom<import("fumadocs-core/source/schema")._JSONType, import("fumadocs-core/source/schema")._JSONType>>>;
|
|
10
|
+
_asyncapi: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodCustom<import("fumadocs-core/source/schema")._JSONType, import("fumadocs-core/source/schema")._JSONType>>>;
|
|
11
|
+
}, import("zod/v4/core").$strip>;
|
|
12
|
+
/** @deprecated import from `fumadocs-core/source/schema` instead (since 16.2.3) */
|
|
13
|
+
export declare const metaSchema: import("zod").ZodObject<{
|
|
14
|
+
title: import("zod").ZodOptional<import("zod").ZodString>;
|
|
15
|
+
pages: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
16
|
+
pagesIndex: import("zod").ZodOptional<import("zod").ZodString>;
|
|
17
|
+
description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
18
|
+
root: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodBoolean, import("zod").ZodString]>>;
|
|
19
|
+
defaultOpen: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
20
|
+
collapsible: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
21
|
+
icon: import("zod").ZodOptional<import("zod").ZodString>;
|
|
22
|
+
}, import("zod/v4/core").$strip>;
|
|
23
|
+
export { AnyCollection, BaseCollection, CollectionSchema, DefaultMDXOptions, DocCollection, DocCollectionBase, DocCollectionMdx, DocCollectionSatteri, DocsCollection, GlobalConfig, MDXPresetOptions, MetaCollection, type PostprocessOptions, type SatteriPresetOptions, applyMdxPreset, defineCollections, defineConfig, defineDocs, remarkInclude };
|
package/dist/config/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { n as defineConfig, r as defineDocs, t as defineCollections } from "../define-
|
|
2
|
-
import {
|
|
1
|
+
import { n as defineConfig, r as defineDocs, t as defineCollections } from "../define-C2jwQBlt.js";
|
|
2
|
+
import { t as applyMdxPreset } from "../preset-Vhfrb01t.js";
|
|
3
3
|
import { metaSchema as metaSchema$1, pageSchema } from "fumadocs-core/source/schema";
|
|
4
|
-
|
|
4
|
+
import { remarkInclude } from "fumadocs-core/mdx-plugins/remark-include";
|
|
5
|
+
// src/config/index.ts
|
|
5
6
|
/** @deprecated import `pageSchema` from `fumadocs-core/source/schema` instead (since 16.2.3) */
|
|
6
7
|
const frontmatterSchema = pageSchema;
|
|
7
8
|
/** @deprecated import from `fumadocs-core/source/schema` instead (since 16.2.3) */
|
|
8
9
|
const metaSchema = metaSchema$1;
|
|
9
|
-
//#endregion
|
|
10
10
|
export { applyMdxPreset, defineCollections, defineConfig, defineDocs, frontmatterSchema, metaSchema, remarkInclude };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { n as ident } from "./codegen-
|
|
1
|
+
import { n as ident } from "./codegen-D-Cjx_kh.js";
|
|
2
2
|
import fs from "node:fs/promises";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import picomatch from "picomatch";
|
|
5
|
-
|
|
5
|
+
// src/config/build.ts
|
|
6
6
|
const SupportedFormats = {
|
|
7
7
|
doc: ["mdx", "md"],
|
|
8
8
|
meta: ["json", "yaml"]
|
|
@@ -78,8 +78,7 @@ function buildConfig(config, cwd) {
|
|
|
78
78
|
}))
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
|
-
|
|
82
|
-
//#region src/utils/validation.ts
|
|
81
|
+
// src/utils/validation.ts
|
|
83
82
|
var ValidationError = class extends Error {
|
|
84
83
|
constructor(message, issues) {
|
|
85
84
|
super(`${message}:\n${issues.map((issue) => ` ${issue.path}: ${issue.message}`).join("\n")}`);
|
|
@@ -101,8 +100,7 @@ async function validate(schema, data, context, errorMessage) {
|
|
|
101
100
|
}
|
|
102
101
|
return data;
|
|
103
102
|
}
|
|
104
|
-
|
|
105
|
-
//#region src/core.ts
|
|
103
|
+
// src/core.ts
|
|
106
104
|
async function getPlugins(pluginOptions) {
|
|
107
105
|
const plugins = [];
|
|
108
106
|
for await (const option of pluginOptions) {
|
|
@@ -314,5 +312,4 @@ function postprocessPlugin() {
|
|
|
314
312
|
return lines.join("\n");
|
|
315
313
|
} } };
|
|
316
314
|
}
|
|
317
|
-
//#endregion
|
|
318
315
|
export { buildConfig as i, ValidationError as n, buildCollection as r, createCore as t };
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import { metaSchema, pageSchema } from "fumadocs-core/source/schema";
|
|
2
|
-
import { Pluggable, Transformer } from "unified";
|
|
3
|
-
import * as Plugins from "fumadocs-core/mdx-plugins";
|
|
4
|
-
import { LLMsOptions, StructuredData } from "fumadocs-core/mdx-plugins";
|
|
5
|
-
import { VFile } from "vfile";
|
|
6
1
|
import { FC } from "react";
|
|
2
|
+
import { metaSchema, pageSchema } from "fumadocs-core/source/schema";
|
|
7
3
|
import { ProcessorOptions } from "@mdx-js/mdx";
|
|
4
|
+
import { VFile } from "vfile";
|
|
8
5
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
6
|
+
import { Pluggable } from "unified";
|
|
7
|
+
import * as Plugins from "fumadocs-core/mdx-plugins";
|
|
8
|
+
import { LLMsOptions, StructuredData } from "fumadocs-core/mdx-plugins";
|
|
9
9
|
import { Root } from "mdast";
|
|
10
10
|
import { SatteriPresetOptions, SatteriPresetOptions as SatteriPresetOptions$1 } from "@fumadocs/satteri/preset";
|
|
11
11
|
import { TOCItemType } from "fumadocs-core/toc";
|
|
12
12
|
import { MDXProps } from "mdx/types";
|
|
13
13
|
import { FSWatcher } from "chokidar";
|
|
14
|
-
//#region src/config/preset.d.ts
|
|
15
14
|
type ResolvePlugins = Pluggable[] | ((v: Pluggable[]) => Pluggable[]);
|
|
16
15
|
type DefaultMDXOptions = Omit<NonNullable<ProcessorOptions>, 'rehypePlugins' | 'remarkPlugins' | '_ctx'> & {
|
|
17
16
|
rehypePlugins?: ResolvePlugins;
|
|
@@ -36,8 +35,6 @@ type MDXPresetOptions = ({
|
|
|
36
35
|
* apply MDX processor presets
|
|
37
36
|
*/
|
|
38
37
|
declare function applyMdxPreset(options?: MDXPresetOptions): (environment: BuildEnvironment) => Promise<ProcessorOptions>;
|
|
39
|
-
//#endregion
|
|
40
|
-
//#region src/loaders/mdx/remark-postprocess.d.ts
|
|
41
38
|
interface ExtractedReference {
|
|
42
39
|
href: string;
|
|
43
40
|
}
|
|
@@ -62,16 +59,12 @@ interface PostprocessOptions {
|
|
|
62
59
|
removePosition?: boolean;
|
|
63
60
|
};
|
|
64
61
|
}
|
|
65
|
-
//#endregion
|
|
66
|
-
//#region src/loaders/mdx/last-modified.d.ts
|
|
67
62
|
/**
|
|
68
63
|
* Obtain the last modified time of a file.
|
|
69
64
|
*
|
|
70
65
|
* @returns `null`/`undefined` when unknown (e.g. the file isn't committed).
|
|
71
66
|
*/
|
|
72
67
|
type LastModifiedFn = (filePath: string) => Promise<Date | null | undefined>;
|
|
73
|
-
//#endregion
|
|
74
|
-
//#region src/loaders/mdx/build.d.ts
|
|
75
68
|
interface CompiledMDXProperties<Frontmatter = Record<string, unknown>> {
|
|
76
69
|
frontmatter: Frontmatter;
|
|
77
70
|
structuredData: StructuredData;
|
|
@@ -89,8 +82,6 @@ interface CompiledMDXProperties<Frontmatter = Record<string, unknown>> {
|
|
|
89
82
|
*/
|
|
90
83
|
_mdast?: string;
|
|
91
84
|
}
|
|
92
|
-
//#endregion
|
|
93
|
-
//#region src/loaders/mdx/build-satteri.d.ts
|
|
94
85
|
declare module 'satteri' {
|
|
95
86
|
interface DataMap {
|
|
96
87
|
extractedReferences?: {
|
|
@@ -99,8 +90,6 @@ declare module 'satteri' {
|
|
|
99
90
|
}
|
|
100
91
|
}
|
|
101
92
|
type SatteriOptionsInput = SatteriPresetOptions | ((environment: BuildEnvironment) => SatteriPresetOptions | Promise<SatteriPresetOptions>) | undefined;
|
|
102
|
-
//#endregion
|
|
103
|
-
//#region src/config/define.d.ts
|
|
104
93
|
type CollectionSchema<Schema extends StandardSchemaV1, Context> = Schema | ((ctx: Context) => Schema);
|
|
105
94
|
type AnyCollection = DocsCollection | DocCollection | MetaCollection;
|
|
106
95
|
interface BaseCollection {
|
|
@@ -188,8 +177,6 @@ declare function defineDocs<DocSchema extends StandardSchemaV1 = typeof pageSche
|
|
|
188
177
|
meta?: Omit<MetaCollection<MetaSchema>, 'dir' | 'type'>;
|
|
189
178
|
}): DocsCollection<DocSchema, MetaSchema>;
|
|
190
179
|
declare function defineConfig(config?: GlobalConfig): GlobalConfig;
|
|
191
|
-
//#endregion
|
|
192
|
-
//#region src/config/build.d.ts
|
|
193
180
|
type BuildEnvironment = 'bundler' | 'runtime';
|
|
194
181
|
interface LoadedConfig {
|
|
195
182
|
collections: Map<string, CollectionItem>;
|
|
@@ -217,8 +204,6 @@ interface DocsCollectionItem extends Omit<DocsCollection, 'dir' | 'meta' | 'docs
|
|
|
217
204
|
meta: MetaCollectionItem;
|
|
218
205
|
docs: DocCollectionItem;
|
|
219
206
|
}
|
|
220
|
-
//#endregion
|
|
221
|
-
//#region src/plugins/index-file.d.ts
|
|
222
207
|
interface IndexFilePluginOptions {
|
|
223
208
|
target?: 'default' | 'vite';
|
|
224
209
|
/**
|
|
@@ -242,8 +227,6 @@ interface IndexFilePlugin {
|
|
|
242
227
|
};
|
|
243
228
|
}
|
|
244
229
|
declare function indexFile(options?: IndexFilePluginOptions): Plugin;
|
|
245
|
-
//#endregion
|
|
246
|
-
//#region src/macro/eval.d.ts
|
|
247
230
|
interface MacroEvaluatorOptions {
|
|
248
231
|
/**
|
|
249
232
|
* absolute path of the entry module
|
|
@@ -307,8 +290,6 @@ declare class MacroCollector {
|
|
|
307
290
|
private stamp;
|
|
308
291
|
private evaluate;
|
|
309
292
|
}
|
|
310
|
-
//#endregion
|
|
311
|
-
//#region src/core.d.ts
|
|
312
293
|
type Awaitable<T> = T | Promise<T>;
|
|
313
294
|
interface EmitEntry {
|
|
314
295
|
/**
|
|
@@ -493,5 +474,4 @@ declare function createCore(options: CoreOptions): {
|
|
|
493
474
|
transformVFile(options: TransformOptions<DocCollectionItem>, file: VFile): Promise<VFile>;
|
|
494
475
|
};
|
|
495
476
|
type Core = ReturnType<typeof createCore>;
|
|
496
|
-
//#endregion
|
|
497
477
|
export { SatteriOptionsInput as A, DocsCollection as C, defineCollections as D, SatteriPresetOptions$1 as E, DefaultMDXOptions as F, MDXPresetOptions as I, applyMdxPreset as L, LastModifiedFn as M, ExtractedReference as N, defineConfig as O, PostprocessOptions as P, DocCollectionSatteri as S, MetaCollection as T, BaseCollection as _, EmitOptions as a, DocCollectionBase as b, PluginContext as c, TransformOptions as d, IndexFilePlugin as f, AnyCollection as g, BuildEnvironment as h, EmitEntry as i, CompiledMDXProperties as j, defineDocs as k, PluginOption as l, indexFile as m, Core as n, EmitOutput as o, IndexFilePluginOptions as p, CoreOptions as r, Plugin as s, CompilationContext as t, ServerContext as u, CollectionSchema as v, GlobalConfig as w, DocCollectionMdx as x, DocCollection as y };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { metaSchema, pageSchema } from "fumadocs-core/source/schema";
|
|
2
|
-
|
|
2
|
+
// src/config/define.ts
|
|
3
3
|
function defineCollections(options) {
|
|
4
4
|
return options;
|
|
5
5
|
}
|
|
@@ -25,5 +25,4 @@ function defineDocs(options) {
|
|
|
25
25
|
function defineConfig(config = {}) {
|
|
26
26
|
return config;
|
|
27
27
|
}
|
|
28
|
-
//#endregion
|
|
29
28
|
export { defineConfig as n, defineDocs as r, defineCollections as t };
|
|
@@ -2,7 +2,7 @@ import fsSync from "node:fs";
|
|
|
2
2
|
import fs from "node:fs/promises";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
|
-
|
|
5
|
+
// ../vite/dist/index.js
|
|
6
6
|
let pnp;
|
|
7
7
|
if (process.versions.pnp) try {
|
|
8
8
|
pnp = createRequire(import.meta.url)("pnpapi");
|
|
@@ -209,5 +209,4 @@ async function getInstallKey(root) {
|
|
|
209
209
|
if (path.dirname(dir) === dir) return;
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
|
-
//#endregion
|
|
213
212
|
export { getConfig };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { r as buildCollection } from "./core-
|
|
3
|
-
import { r as slash } from "./codegen-
|
|
4
|
-
import { r as defineDocs } from "./define-
|
|
5
|
-
import { n as transformMacroConfigModule, t as parseMacroId } from "./transform-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D8jQpDG7.js";
|
|
2
|
+
import { r as buildCollection } from "./core-B3ysiPKS.js";
|
|
3
|
+
import { r as slash } from "./codegen-D-Cjx_kh.js";
|
|
4
|
+
import { r as defineDocs } from "./define-C2jwQBlt.js";
|
|
5
|
+
import { n as transformMacroConfigModule, t as parseMacroId } from "./transform-CVIZq8Al.js";
|
|
6
6
|
import fs from "node:fs/promises";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import { randomUUID } from "node:crypto";
|
|
9
9
|
import { pathToFileURL } from "node:url";
|
|
10
|
-
|
|
10
|
+
// src/macro/eval.ts
|
|
11
11
|
var eval_exports = /* @__PURE__ */ __exportAll({
|
|
12
12
|
MacroCollector: () => MacroCollector,
|
|
13
13
|
createNodeEvaluator: () => createNodeEvaluator
|
|
@@ -172,5 +172,4 @@ var MacroCollector = class {
|
|
|
172
172
|
};
|
|
173
173
|
}
|
|
174
174
|
};
|
|
175
|
-
//#endregion
|
|
176
175
|
export { createNodeEvaluator as n, eval_exports as r, MacroCollector as t };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import "./core-
|
|
2
|
-
//#region src/webpack/index.d.ts
|
|
1
|
+
import "./core-CdciznjV.js";
|
|
3
2
|
interface WebpackLoaderOptions {
|
|
4
3
|
type: 'webpack' | 'turbopack';
|
|
5
4
|
/** absolute path */
|
|
@@ -14,5 +13,4 @@ interface WebpackLoaderOptions {
|
|
|
14
13
|
*/
|
|
15
14
|
macro?: boolean;
|
|
16
15
|
}
|
|
17
|
-
//#endregion
|
|
18
16
|
export { WebpackLoaderOptions as t };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { n as ident, r as slash, t as createCodegen } from "./codegen-
|
|
1
|
+
import { n as ident, r as slash, t as createCodegen } from "./codegen-D-Cjx_kh.js";
|
|
2
2
|
import { frontmatter } from "fumadocs-core/content/md/frontmatter";
|
|
3
3
|
import fs from "node:fs/promises";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
6
6
|
import { glob } from "tinyglobby";
|
|
7
|
-
|
|
7
|
+
// src/utils/fs-cache.ts
|
|
8
8
|
const map = /* @__PURE__ */ new Map();
|
|
9
9
|
function createFSCache() {
|
|
10
10
|
return {
|
|
@@ -28,8 +28,7 @@ function toFullPath(file) {
|
|
|
28
28
|
if (path.isAbsolute(file)) return path.relative(process.cwd(), file);
|
|
29
29
|
return file;
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
//#region src/plugins/index-file.ts
|
|
31
|
+
// src/plugins/index-file.ts
|
|
33
32
|
const indexFileCache = createFSCache();
|
|
34
33
|
function indexFile(options = {}) {
|
|
35
34
|
const { target = "default", addJsExtension, browser = true, dynamic = true } = options;
|
|
@@ -268,5 +267,4 @@ function generateMetaCollectionGlob({ codegen, workspace }, collection, eager =
|
|
|
268
267
|
eager
|
|
269
268
|
});
|
|
270
269
|
}
|
|
271
|
-
//#endregion
|
|
272
270
|
export { indexFile as t };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { N as ExtractedReference, a as EmitOptions, c as PluginContext, d as TransformOptions, i as EmitEntry, j as CompiledMDXProperties, l as PluginOption, n as Core, o as EmitOutput, r as CoreOptions, s as Plugin, t as CompilationContext, u as ServerContext } from "./core-
|
|
1
|
+
import { N as ExtractedReference, a as EmitOptions, c as PluginContext, d as TransformOptions, i as EmitEntry, j as CompiledMDXProperties, l as PluginOption, n as Core, o as EmitOutput, r as CoreOptions, s as Plugin, t as CompilationContext, u as ServerContext } from "./core-CdciznjV.js";
|
|
2
2
|
export type { CompilationContext, CompiledMDXProperties, Core, CoreOptions, EmitEntry, EmitOptions, EmitOutput, ExtractedReference, Plugin, PluginContext, PluginOption, ServerContext, TransformOptions };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import { x } from "tinyexec";
|
|
3
|
-
|
|
3
|
+
// src/loaders/mdx/last-modified.ts
|
|
4
4
|
const cache = /* @__PURE__ */ new Map();
|
|
5
5
|
/**
|
|
6
6
|
* Resolve the `lastModified` collection option for a document.
|
|
@@ -43,5 +43,4 @@ function getGitTimestamps(cwd, dir) {
|
|
|
43
43
|
cache.set(dir, promise);
|
|
44
44
|
return promise;
|
|
45
45
|
}
|
|
46
|
-
//#endregion
|
|
47
46
|
export { resolveLastModified as t };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { i as buildConfig } from "./core-
|
|
1
|
+
import { i as buildConfig } from "./core-B3ysiPKS.js";
|
|
2
2
|
import fs from "node:fs/promises";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { pathToFileURL } from "node:url";
|
|
5
|
-
|
|
5
|
+
// src/config/load-from-file.ts
|
|
6
6
|
async function compileConfig(core) {
|
|
7
7
|
const { build } = await import("esbuild");
|
|
8
8
|
let source;
|
|
@@ -53,5 +53,4 @@ async function loadConfig(core, build = false) {
|
|
|
53
53
|
fromFile: true
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
|
-
//#endregion
|
|
57
56
|
export { loadConfig as t };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
// src/loaders/index.ts
|
|
2
2
|
const metaLoaderGlob = /\.(json|yaml)\?.*(collection|macro_id)=/;
|
|
3
3
|
const metaLoaderFileGlob = /\.(json|yaml)$/;
|
|
4
4
|
const metaLoaderQueryGlob = /[?&](collection|macro_id)=/;
|
|
5
5
|
const mdxLoaderGlob = /\.mdx?(\?.+?)?$/;
|
|
6
|
-
//#endregion
|
|
7
6
|
export { metaLoaderQueryGlob as i, metaLoaderFileGlob as n, metaLoaderGlob as r, mdxLoaderGlob as t };
|
package/dist/macro/index.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { A as SatteriOptionsInput, N as ExtractedReference, P as PostprocessOptions, h as BuildEnvironment, v as CollectionSchema } from "../core-
|
|
1
|
+
import { A as SatteriOptionsInput, N as ExtractedReference, P as PostprocessOptions, h as BuildEnvironment, v as CollectionSchema } from "../core-CdciznjV.js";
|
|
2
2
|
import { MacroAsyncDocCollection, MacroAsyncDocsCollection, MacroDocCollection, MacroDocsCollection, MacroMetaCollection } from "../runtime/macro.js";
|
|
3
3
|
import { metaSchema, pageSchema } from "fumadocs-core/source/schema";
|
|
4
4
|
import { MetaData, PageData } from "fumadocs-core/source";
|
|
5
5
|
import { ProcessorOptions } from "@mdx-js/mdx";
|
|
6
6
|
import { StandardJSONSchemaV1, StandardSchemaV1 } from "@standard-schema/spec";
|
|
7
|
-
//#region src/macro/index.d.ts
|
|
8
7
|
export interface MacroSchemaContext {
|
|
9
8
|
path: string;
|
|
10
9
|
source: string;
|
|
@@ -120,5 +119,4 @@ export declare function defineCollections<DocSchema extends StandardSchemaV1 = S
|
|
|
120
119
|
async: Async;
|
|
121
120
|
lastModified: LastModified;
|
|
122
121
|
}>>;
|
|
123
|
-
//#endregion
|
|
124
122
|
export type { ExtractedReference };
|
package/dist/macro/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/macro/index.ts
|
|
2
2
|
function macroError() {
|
|
3
3
|
return /* @__PURE__ */ new Error("[MDX] this macro was not compiled by the bundler plugin of `fumadocs-mdx`. To use `fumadocs-mdx/macro`, set the `include` option on your bundler plugin, and make sure this module matches its patterns.");
|
|
4
4
|
}
|
|
@@ -18,5 +18,4 @@ function defineDocs(options) {
|
|
|
18
18
|
function defineCollections() {
|
|
19
19
|
throw macroError();
|
|
20
20
|
}
|
|
21
|
-
//#endregion
|
|
22
21
|
export { defineCollections, defineDocs };
|