fumadocs-mdx 11.7.4 → 11.7.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/{chunk-PQCNPAD3.js → chunk-3XN4P23K.js} +9 -6
- package/dist/chunk-GBMFGEC7.js +57 -0
- package/dist/{chunk-ZOWJF3OH.js → chunk-GX3THK2Q.js} +25 -20
- package/dist/{chunk-2CSSQTP6.js → chunk-GYWPPGFD.js} +9 -1
- package/dist/chunk-HWSF4OGZ.js +42 -0
- package/dist/chunk-UCY7OBZG.js +12 -0
- package/dist/{chunk-JFNBRKRV.js → chunk-XVL4ZQFK.js} +12 -6
- package/dist/{chunk-4CGSOZUZ.js → chunk-XZR5QXVY.js} +32 -2
- package/dist/config/index.cjs +19 -9
- package/dist/config/index.d.cts +2 -2
- package/dist/config/index.d.ts +2 -2
- package/dist/config/index.js +8 -36
- package/dist/config/zod-3.cjs +371 -0
- package/dist/config/zod-3.d.cts +53 -0
- package/dist/config/zod-3.d.ts +53 -0
- package/dist/config/zod-3.js +40 -0
- package/dist/{define-E6TRBwBQ.d.cts → define-DnJzAZrj.d.cts} +3 -2
- package/dist/{define-E6TRBwBQ.d.ts → define-DnJzAZrj.d.ts} +3 -2
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/loader-mdx.cjs +81 -48
- package/dist/loader-mdx.js +8 -8
- package/dist/{mdx-options-UDV5WEFU.js → mdx-options-3NB74EMB.js} +1 -1
- package/dist/next/index.cjs +52 -25
- package/dist/next/index.js +4 -6
- package/dist/runtime/async.cjs +162 -124
- package/dist/runtime/async.d.cts +3 -3
- package/dist/runtime/async.d.ts +3 -3
- package/dist/runtime/async.js +26 -43
- package/dist/runtime/vite.d.cts +2 -2
- package/dist/runtime/vite.d.ts +2 -2
- package/dist/{types-DiL328cG.d.ts → types-C-WXTx1W.d.cts} +2 -2
- package/dist/{types-Lh_-Uuix.d.cts → types-CU9nn_je.d.ts} +2 -2
- package/dist/vite/index.cjs +52 -49
- package/dist/vite/index.js +8 -8
- package/package.json +12 -7
- package/dist/chunk-2K55VKP6.js +0 -49
- package/dist/chunk-VUEZTR2H.js +0 -26
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/config/zod-3.ts
|
|
31
|
+
var zod_3_exports = {};
|
|
32
|
+
__export(zod_3_exports, {
|
|
33
|
+
defineCollections: () => defineCollections,
|
|
34
|
+
defineConfig: () => defineConfig,
|
|
35
|
+
defineDocs: () => defineDocs,
|
|
36
|
+
frontmatterSchema: () => frontmatterSchema2,
|
|
37
|
+
getDefaultMDXOptions: () => getDefaultMDXOptions,
|
|
38
|
+
metaSchema: () => metaSchema2,
|
|
39
|
+
remarkInclude: () => remarkInclude
|
|
40
|
+
});
|
|
41
|
+
module.exports = __toCommonJS(zod_3_exports);
|
|
42
|
+
var import_v3 = require("zod/v3");
|
|
43
|
+
|
|
44
|
+
// src/config/zod-4.ts
|
|
45
|
+
var import_zod = require("zod");
|
|
46
|
+
var metaSchema = import_zod.z.object({
|
|
47
|
+
title: import_zod.z.string().optional(),
|
|
48
|
+
pages: import_zod.z.array(import_zod.z.string()).optional(),
|
|
49
|
+
description: import_zod.z.string().optional(),
|
|
50
|
+
root: import_zod.z.boolean().optional(),
|
|
51
|
+
defaultOpen: import_zod.z.boolean().optional(),
|
|
52
|
+
icon: import_zod.z.string().optional()
|
|
53
|
+
});
|
|
54
|
+
var frontmatterSchema = import_zod.z.object({
|
|
55
|
+
title: import_zod.z.string(),
|
|
56
|
+
description: import_zod.z.string().optional(),
|
|
57
|
+
icon: import_zod.z.string().optional(),
|
|
58
|
+
full: import_zod.z.boolean().optional(),
|
|
59
|
+
// Fumadocs OpenAPI generated
|
|
60
|
+
_openapi: import_zod.z.looseObject({}).optional()
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
// src/config/define.ts
|
|
64
|
+
function defineCollections(options) {
|
|
65
|
+
return options;
|
|
66
|
+
}
|
|
67
|
+
function defineDocs(options) {
|
|
68
|
+
if (!options)
|
|
69
|
+
console.warn(
|
|
70
|
+
"[`source.config.ts`] Deprecated: please pass options to `defineDocs()` and specify a `dir`."
|
|
71
|
+
);
|
|
72
|
+
const dir = options?.dir ?? "content/docs";
|
|
73
|
+
return {
|
|
74
|
+
type: "docs",
|
|
75
|
+
dir,
|
|
76
|
+
docs: defineCollections({
|
|
77
|
+
type: "doc",
|
|
78
|
+
dir,
|
|
79
|
+
schema: frontmatterSchema,
|
|
80
|
+
...options?.docs
|
|
81
|
+
}),
|
|
82
|
+
meta: defineCollections({
|
|
83
|
+
type: "meta",
|
|
84
|
+
dir,
|
|
85
|
+
schema: metaSchema,
|
|
86
|
+
...options?.meta
|
|
87
|
+
})
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
function defineConfig(config = {}) {
|
|
91
|
+
return config;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// src/utils/mdx-options.ts
|
|
95
|
+
var plugins = __toESM(require("fumadocs-core/mdx-plugins"), 1);
|
|
96
|
+
|
|
97
|
+
// src/mdx-plugins/remark-exports.ts
|
|
98
|
+
var import_estree_util_value_to_estree = require("estree-util-value-to-estree");
|
|
99
|
+
function remarkMdxExport({ values }) {
|
|
100
|
+
return (tree, vfile) => {
|
|
101
|
+
for (const name of values) {
|
|
102
|
+
if (!(name in vfile.data)) return;
|
|
103
|
+
tree.children.unshift(getMdastExport(name, vfile.data[name]));
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
function getMdastExport(name, value) {
|
|
108
|
+
return {
|
|
109
|
+
type: "mdxjsEsm",
|
|
110
|
+
value: "",
|
|
111
|
+
data: {
|
|
112
|
+
estree: {
|
|
113
|
+
type: "Program",
|
|
114
|
+
sourceType: "module",
|
|
115
|
+
body: [
|
|
116
|
+
{
|
|
117
|
+
type: "ExportNamedDeclaration",
|
|
118
|
+
specifiers: [],
|
|
119
|
+
source: null,
|
|
120
|
+
declaration: {
|
|
121
|
+
type: "VariableDeclaration",
|
|
122
|
+
kind: "let",
|
|
123
|
+
declarations: [
|
|
124
|
+
{
|
|
125
|
+
type: "VariableDeclarator",
|
|
126
|
+
id: {
|
|
127
|
+
type: "Identifier",
|
|
128
|
+
name
|
|
129
|
+
},
|
|
130
|
+
init: (0, import_estree_util_value_to_estree.valueToEstree)(value)
|
|
131
|
+
}
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
]
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// src/utils/mdx-options.ts
|
|
142
|
+
function pluginOption(def, options = []) {
|
|
143
|
+
const list = def(Array.isArray(options) ? options : []).filter(
|
|
144
|
+
Boolean
|
|
145
|
+
);
|
|
146
|
+
if (typeof options === "function") {
|
|
147
|
+
return options(list);
|
|
148
|
+
}
|
|
149
|
+
return list;
|
|
150
|
+
}
|
|
151
|
+
function getDefaultMDXOptions({
|
|
152
|
+
valueToExport = [],
|
|
153
|
+
rehypeCodeOptions,
|
|
154
|
+
remarkImageOptions,
|
|
155
|
+
remarkHeadingOptions,
|
|
156
|
+
remarkStructureOptions,
|
|
157
|
+
remarkCodeTabOptions,
|
|
158
|
+
remarkNpmOptions,
|
|
159
|
+
_withoutBundler = false,
|
|
160
|
+
...mdxOptions
|
|
161
|
+
}) {
|
|
162
|
+
const mdxExports = [
|
|
163
|
+
"structuredData",
|
|
164
|
+
"frontmatter",
|
|
165
|
+
"lastModified",
|
|
166
|
+
...valueToExport
|
|
167
|
+
];
|
|
168
|
+
const remarkPlugins = pluginOption(
|
|
169
|
+
(v) => [
|
|
170
|
+
plugins.remarkGfm,
|
|
171
|
+
[
|
|
172
|
+
plugins.remarkHeading,
|
|
173
|
+
{
|
|
174
|
+
generateToc: false,
|
|
175
|
+
...remarkHeadingOptions
|
|
176
|
+
}
|
|
177
|
+
],
|
|
178
|
+
remarkImageOptions !== false && [
|
|
179
|
+
plugins.remarkImage,
|
|
180
|
+
{
|
|
181
|
+
...remarkImageOptions,
|
|
182
|
+
useImport: _withoutBundler ? false : remarkImageOptions?.useImport
|
|
183
|
+
}
|
|
184
|
+
],
|
|
185
|
+
"remarkCodeTab" in plugins && remarkCodeTabOptions !== false && [
|
|
186
|
+
plugins.remarkCodeTab,
|
|
187
|
+
remarkCodeTabOptions
|
|
188
|
+
],
|
|
189
|
+
"remarkNpm" in plugins && remarkNpmOptions !== false && [plugins.remarkNpm, remarkNpmOptions],
|
|
190
|
+
...v,
|
|
191
|
+
remarkStructureOptions !== false && [
|
|
192
|
+
plugins.remarkStructure,
|
|
193
|
+
remarkStructureOptions
|
|
194
|
+
],
|
|
195
|
+
[remarkMdxExport, { values: mdxExports }]
|
|
196
|
+
],
|
|
197
|
+
mdxOptions.remarkPlugins
|
|
198
|
+
);
|
|
199
|
+
const rehypePlugins = pluginOption(
|
|
200
|
+
(v) => [
|
|
201
|
+
rehypeCodeOptions !== false && [plugins.rehypeCode, rehypeCodeOptions],
|
|
202
|
+
...v,
|
|
203
|
+
plugins.rehypeToc
|
|
204
|
+
],
|
|
205
|
+
mdxOptions.rehypePlugins
|
|
206
|
+
);
|
|
207
|
+
return {
|
|
208
|
+
...mdxOptions,
|
|
209
|
+
outputFormat: _withoutBundler ? "function-body" : mdxOptions.outputFormat,
|
|
210
|
+
remarkPlugins,
|
|
211
|
+
rehypePlugins
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
// src/mdx-plugins/remark-include.ts
|
|
216
|
+
var import_unist_util_visit = require("unist-util-visit");
|
|
217
|
+
var path = __toESM(require("path"), 1);
|
|
218
|
+
var fs = __toESM(require("fs/promises"), 1);
|
|
219
|
+
|
|
220
|
+
// src/utils/fuma-matter.ts
|
|
221
|
+
var import_js_yaml = require("js-yaml");
|
|
222
|
+
var regex = /^---\r?\n(.+?)\r?\n---\r?\n/s;
|
|
223
|
+
function fumaMatter(input) {
|
|
224
|
+
const output = { matter: "", data: {}, content: input };
|
|
225
|
+
const match = regex.exec(input);
|
|
226
|
+
if (!match) {
|
|
227
|
+
return output;
|
|
228
|
+
}
|
|
229
|
+
output.matter = match[1];
|
|
230
|
+
output.content = input.slice(match[0].length);
|
|
231
|
+
const loaded = (0, import_js_yaml.load)(output.matter);
|
|
232
|
+
output.data = loaded ?? {};
|
|
233
|
+
return output;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
// src/mdx-plugins/remark-include.ts
|
|
237
|
+
function flattenNode(node) {
|
|
238
|
+
if ("children" in node)
|
|
239
|
+
return node.children.map((child) => flattenNode(child)).join("");
|
|
240
|
+
if ("value" in node) return node.value;
|
|
241
|
+
return "";
|
|
242
|
+
}
|
|
243
|
+
function parseSpecifier(specifier) {
|
|
244
|
+
const idx = specifier.lastIndexOf("#");
|
|
245
|
+
if (idx === -1) return { file: specifier };
|
|
246
|
+
return {
|
|
247
|
+
file: specifier.slice(0, idx),
|
|
248
|
+
section: specifier.slice(idx + 1)
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
function extractSection(root, section) {
|
|
252
|
+
for (const node of root.children) {
|
|
253
|
+
if (node.type === "mdxJsxFlowElement" && node.name === "section" && node.attributes.some(
|
|
254
|
+
(attr) => attr.type === "mdxJsxAttribute" && attr.name === "id" && attr.value === section
|
|
255
|
+
)) {
|
|
256
|
+
return {
|
|
257
|
+
type: "root",
|
|
258
|
+
children: node.children
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
function remarkInclude() {
|
|
264
|
+
const TagName = "include";
|
|
265
|
+
async function update(tree, directory, data) {
|
|
266
|
+
const queue = [];
|
|
267
|
+
(0, import_unist_util_visit.visit)(
|
|
268
|
+
tree,
|
|
269
|
+
["mdxJsxFlowElement", "mdxJsxTextElement"],
|
|
270
|
+
(node, _, parent) => {
|
|
271
|
+
let specifier;
|
|
272
|
+
const params = {};
|
|
273
|
+
if ((node.type === "mdxJsxFlowElement" || node.type === "mdxJsxTextElement") && node.name === TagName) {
|
|
274
|
+
const value = flattenNode(node);
|
|
275
|
+
if (value.length > 0) {
|
|
276
|
+
for (const attr of node.attributes) {
|
|
277
|
+
if (attr.type === "mdxJsxAttribute" && (typeof attr.value === "string" || attr.value === null)) {
|
|
278
|
+
params[attr.name] = attr.value;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
specifier = value;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
if (!specifier) return;
|
|
285
|
+
const { file, section } = parseSpecifier(specifier);
|
|
286
|
+
const targetPath = path.resolve(
|
|
287
|
+
"cwd" in params ? process.cwd() : directory,
|
|
288
|
+
file
|
|
289
|
+
);
|
|
290
|
+
const asCode = params.lang || !file.endsWith(".md") && !file.endsWith(".mdx");
|
|
291
|
+
queue.push(
|
|
292
|
+
fs.readFile(targetPath).then((buffer) => buffer.toString()).then(async (content) => {
|
|
293
|
+
data._compiler?.addDependency(targetPath);
|
|
294
|
+
if (asCode) {
|
|
295
|
+
const lang = params.lang ?? path.extname(file).slice(1);
|
|
296
|
+
Object.assign(node, {
|
|
297
|
+
type: "code",
|
|
298
|
+
lang,
|
|
299
|
+
meta: params.meta,
|
|
300
|
+
value: content,
|
|
301
|
+
data: {}
|
|
302
|
+
});
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
const processor = data._processor ? data._processor.getProcessor(
|
|
306
|
+
targetPath.endsWith(".md") ? "md" : "mdx"
|
|
307
|
+
) : this;
|
|
308
|
+
let parsed = processor.parse(fumaMatter(content).content);
|
|
309
|
+
if (section) {
|
|
310
|
+
const extracted = extractSection(parsed, section);
|
|
311
|
+
if (!extracted)
|
|
312
|
+
throw new Error(
|
|
313
|
+
`Cannot find section ${section} in ${file}, make sure you have encapsulated the section in a <section id="${section}"> tag`
|
|
314
|
+
);
|
|
315
|
+
parsed = extracted;
|
|
316
|
+
}
|
|
317
|
+
await update.call(
|
|
318
|
+
processor,
|
|
319
|
+
parsed,
|
|
320
|
+
path.dirname(targetPath),
|
|
321
|
+
data
|
|
322
|
+
);
|
|
323
|
+
Object.assign(
|
|
324
|
+
parent && parent.type === "paragraph" ? parent : node,
|
|
325
|
+
parsed
|
|
326
|
+
);
|
|
327
|
+
}).catch((e) => {
|
|
328
|
+
throw new Error(
|
|
329
|
+
`failed to read file ${targetPath}
|
|
330
|
+
${e instanceof Error ? e.message : String(e)}`,
|
|
331
|
+
{ cause: e }
|
|
332
|
+
);
|
|
333
|
+
})
|
|
334
|
+
);
|
|
335
|
+
return "skip";
|
|
336
|
+
}
|
|
337
|
+
);
|
|
338
|
+
await Promise.all(queue);
|
|
339
|
+
}
|
|
340
|
+
return async (tree, file) => {
|
|
341
|
+
await update.call(this, tree, path.dirname(file.path), file.data);
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
// src/config/zod-3.ts
|
|
346
|
+
var metaSchema2 = import_v3.z.object({
|
|
347
|
+
title: import_v3.z.string().optional(),
|
|
348
|
+
pages: import_v3.z.array(import_v3.z.string()).optional(),
|
|
349
|
+
description: import_v3.z.string().optional(),
|
|
350
|
+
root: import_v3.z.boolean().optional(),
|
|
351
|
+
defaultOpen: import_v3.z.boolean().optional(),
|
|
352
|
+
icon: import_v3.z.string().optional()
|
|
353
|
+
});
|
|
354
|
+
var frontmatterSchema2 = import_v3.z.object({
|
|
355
|
+
title: import_v3.z.string(),
|
|
356
|
+
description: import_v3.z.string().optional(),
|
|
357
|
+
icon: import_v3.z.string().optional(),
|
|
358
|
+
full: import_v3.z.boolean().optional(),
|
|
359
|
+
// Fumadocs OpenAPI generated
|
|
360
|
+
_openapi: import_v3.z.object({}).passthrough().optional()
|
|
361
|
+
});
|
|
362
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
363
|
+
0 && (module.exports = {
|
|
364
|
+
defineCollections,
|
|
365
|
+
defineConfig,
|
|
366
|
+
defineDocs,
|
|
367
|
+
frontmatterSchema,
|
|
368
|
+
getDefaultMDXOptions,
|
|
369
|
+
metaSchema,
|
|
370
|
+
remarkInclude
|
|
371
|
+
});
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { z } from 'zod/v3';
|
|
2
|
+
export { A as AnyCollection, B as BaseCollection, C as CollectionSchema, D as DefaultMDXOptions, a as DocCollection, b as DocsCollection, G as GlobalConfig, M as MetaCollection, d as defineCollections, e as defineConfig, c as defineDocs, g as getDefaultMDXOptions } from '../define-DnJzAZrj.cjs';
|
|
3
|
+
export { remarkInclude } from './index.cjs';
|
|
4
|
+
import '@standard-schema/spec';
|
|
5
|
+
import 'fumadocs-core/mdx-plugins';
|
|
6
|
+
import '@mdx-js/mdx';
|
|
7
|
+
import 'unified';
|
|
8
|
+
import 'zod';
|
|
9
|
+
import 'mdast';
|
|
10
|
+
|
|
11
|
+
declare const metaSchema: z.ZodObject<{
|
|
12
|
+
title: z.ZodOptional<z.ZodString>;
|
|
13
|
+
pages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
14
|
+
description: z.ZodOptional<z.ZodString>;
|
|
15
|
+
root: z.ZodOptional<z.ZodBoolean>;
|
|
16
|
+
defaultOpen: z.ZodOptional<z.ZodBoolean>;
|
|
17
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
18
|
+
}, "strip", z.ZodTypeAny, {
|
|
19
|
+
title?: string | undefined;
|
|
20
|
+
pages?: string[] | undefined;
|
|
21
|
+
description?: string | undefined;
|
|
22
|
+
root?: boolean | undefined;
|
|
23
|
+
defaultOpen?: boolean | undefined;
|
|
24
|
+
icon?: string | undefined;
|
|
25
|
+
}, {
|
|
26
|
+
title?: string | undefined;
|
|
27
|
+
pages?: string[] | undefined;
|
|
28
|
+
description?: string | undefined;
|
|
29
|
+
root?: boolean | undefined;
|
|
30
|
+
defaultOpen?: boolean | undefined;
|
|
31
|
+
icon?: string | undefined;
|
|
32
|
+
}>;
|
|
33
|
+
declare const frontmatterSchema: z.ZodObject<{
|
|
34
|
+
title: z.ZodString;
|
|
35
|
+
description: z.ZodOptional<z.ZodString>;
|
|
36
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
37
|
+
full: z.ZodOptional<z.ZodBoolean>;
|
|
38
|
+
_openapi: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
39
|
+
}, "strip", z.ZodTypeAny, {
|
|
40
|
+
title: string;
|
|
41
|
+
description?: string | undefined;
|
|
42
|
+
icon?: string | undefined;
|
|
43
|
+
full?: boolean | undefined;
|
|
44
|
+
_openapi?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
45
|
+
}, {
|
|
46
|
+
title: string;
|
|
47
|
+
description?: string | undefined;
|
|
48
|
+
icon?: string | undefined;
|
|
49
|
+
full?: boolean | undefined;
|
|
50
|
+
_openapi?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
51
|
+
}>;
|
|
52
|
+
|
|
53
|
+
export { frontmatterSchema, metaSchema };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { z } from 'zod/v3';
|
|
2
|
+
export { A as AnyCollection, B as BaseCollection, C as CollectionSchema, D as DefaultMDXOptions, a as DocCollection, b as DocsCollection, G as GlobalConfig, M as MetaCollection, d as defineCollections, e as defineConfig, c as defineDocs, g as getDefaultMDXOptions } from '../define-DnJzAZrj.js';
|
|
3
|
+
export { remarkInclude } from './index.js';
|
|
4
|
+
import '@standard-schema/spec';
|
|
5
|
+
import 'fumadocs-core/mdx-plugins';
|
|
6
|
+
import '@mdx-js/mdx';
|
|
7
|
+
import 'unified';
|
|
8
|
+
import 'zod';
|
|
9
|
+
import 'mdast';
|
|
10
|
+
|
|
11
|
+
declare const metaSchema: z.ZodObject<{
|
|
12
|
+
title: z.ZodOptional<z.ZodString>;
|
|
13
|
+
pages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
14
|
+
description: z.ZodOptional<z.ZodString>;
|
|
15
|
+
root: z.ZodOptional<z.ZodBoolean>;
|
|
16
|
+
defaultOpen: z.ZodOptional<z.ZodBoolean>;
|
|
17
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
18
|
+
}, "strip", z.ZodTypeAny, {
|
|
19
|
+
title?: string | undefined;
|
|
20
|
+
pages?: string[] | undefined;
|
|
21
|
+
description?: string | undefined;
|
|
22
|
+
root?: boolean | undefined;
|
|
23
|
+
defaultOpen?: boolean | undefined;
|
|
24
|
+
icon?: string | undefined;
|
|
25
|
+
}, {
|
|
26
|
+
title?: string | undefined;
|
|
27
|
+
pages?: string[] | undefined;
|
|
28
|
+
description?: string | undefined;
|
|
29
|
+
root?: boolean | undefined;
|
|
30
|
+
defaultOpen?: boolean | undefined;
|
|
31
|
+
icon?: string | undefined;
|
|
32
|
+
}>;
|
|
33
|
+
declare const frontmatterSchema: z.ZodObject<{
|
|
34
|
+
title: z.ZodString;
|
|
35
|
+
description: z.ZodOptional<z.ZodString>;
|
|
36
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
37
|
+
full: z.ZodOptional<z.ZodBoolean>;
|
|
38
|
+
_openapi: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
39
|
+
}, "strip", z.ZodTypeAny, {
|
|
40
|
+
title: string;
|
|
41
|
+
description?: string | undefined;
|
|
42
|
+
icon?: string | undefined;
|
|
43
|
+
full?: boolean | undefined;
|
|
44
|
+
_openapi?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
45
|
+
}, {
|
|
46
|
+
title: string;
|
|
47
|
+
description?: string | undefined;
|
|
48
|
+
icon?: string | undefined;
|
|
49
|
+
full?: boolean | undefined;
|
|
50
|
+
_openapi?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
51
|
+
}>;
|
|
52
|
+
|
|
53
|
+
export { frontmatterSchema, metaSchema };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import {
|
|
2
|
+
defineCollections,
|
|
3
|
+
defineConfig,
|
|
4
|
+
defineDocs
|
|
5
|
+
} from "../chunk-GBMFGEC7.js";
|
|
6
|
+
import {
|
|
7
|
+
getDefaultMDXOptions
|
|
8
|
+
} from "../chunk-GYWPPGFD.js";
|
|
9
|
+
import {
|
|
10
|
+
remarkInclude
|
|
11
|
+
} from "../chunk-3XN4P23K.js";
|
|
12
|
+
import "../chunk-KVWX6THC.js";
|
|
13
|
+
|
|
14
|
+
// src/config/zod-3.ts
|
|
15
|
+
import { z } from "zod/v3";
|
|
16
|
+
var metaSchema = z.object({
|
|
17
|
+
title: z.string().optional(),
|
|
18
|
+
pages: z.array(z.string()).optional(),
|
|
19
|
+
description: z.string().optional(),
|
|
20
|
+
root: z.boolean().optional(),
|
|
21
|
+
defaultOpen: z.boolean().optional(),
|
|
22
|
+
icon: z.string().optional()
|
|
23
|
+
});
|
|
24
|
+
var frontmatterSchema = z.object({
|
|
25
|
+
title: z.string(),
|
|
26
|
+
description: z.string().optional(),
|
|
27
|
+
icon: z.string().optional(),
|
|
28
|
+
full: z.boolean().optional(),
|
|
29
|
+
// Fumadocs OpenAPI generated
|
|
30
|
+
_openapi: z.object({}).passthrough().optional()
|
|
31
|
+
});
|
|
32
|
+
export {
|
|
33
|
+
defineCollections,
|
|
34
|
+
defineConfig,
|
|
35
|
+
defineDocs,
|
|
36
|
+
frontmatterSchema,
|
|
37
|
+
getDefaultMDXOptions,
|
|
38
|
+
metaSchema,
|
|
39
|
+
remarkInclude
|
|
40
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
1
|
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
3
2
|
import * as plugins from 'fumadocs-core/mdx-plugins';
|
|
4
3
|
import { ProcessorOptions } from '@mdx-js/mdx';
|
|
5
4
|
import { Pluggable } from 'unified';
|
|
5
|
+
import { z } from 'zod';
|
|
6
6
|
|
|
7
7
|
type ResolvePlugins = Pluggable[] | ((v: Pluggable[]) => Pluggable[]);
|
|
8
8
|
type DefaultMDXOptions = Omit<NonNullable<ProcessorOptions>, 'rehypePlugins' | 'remarkPlugins' | '_ctx'> & {
|
|
@@ -18,8 +18,9 @@ type DefaultMDXOptions = Omit<NonNullable<ProcessorOptions>, 'rehypePlugins' | '
|
|
|
18
18
|
remarkCodeTabOptions?: plugins.RemarkCodeTabOptions | false;
|
|
19
19
|
remarkNpmOptions?: plugins.RemarkNpmOptions | false;
|
|
20
20
|
rehypeCodeOptions?: plugins.RehypeCodeOptions | false;
|
|
21
|
+
_withoutBundler?: boolean;
|
|
21
22
|
};
|
|
22
|
-
declare function getDefaultMDXOptions({ valueToExport, rehypeCodeOptions, remarkImageOptions, remarkHeadingOptions, remarkStructureOptions, remarkCodeTabOptions, remarkNpmOptions, ...mdxOptions }: DefaultMDXOptions): ProcessorOptions;
|
|
23
|
+
declare function getDefaultMDXOptions({ valueToExport, rehypeCodeOptions, remarkImageOptions, remarkHeadingOptions, remarkStructureOptions, remarkCodeTabOptions, remarkNpmOptions, _withoutBundler, ...mdxOptions }: DefaultMDXOptions): ProcessorOptions;
|
|
23
24
|
|
|
24
25
|
declare const metaSchema: z.ZodObject<{
|
|
25
26
|
title: z.ZodOptional<z.ZodString>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
1
|
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
3
2
|
import * as plugins from 'fumadocs-core/mdx-plugins';
|
|
4
3
|
import { ProcessorOptions } from '@mdx-js/mdx';
|
|
5
4
|
import { Pluggable } from 'unified';
|
|
5
|
+
import { z } from 'zod';
|
|
6
6
|
|
|
7
7
|
type ResolvePlugins = Pluggable[] | ((v: Pluggable[]) => Pluggable[]);
|
|
8
8
|
type DefaultMDXOptions = Omit<NonNullable<ProcessorOptions>, 'rehypePlugins' | 'remarkPlugins' | '_ctx'> & {
|
|
@@ -18,8 +18,9 @@ type DefaultMDXOptions = Omit<NonNullable<ProcessorOptions>, 'rehypePlugins' | '
|
|
|
18
18
|
remarkCodeTabOptions?: plugins.RemarkCodeTabOptions | false;
|
|
19
19
|
remarkNpmOptions?: plugins.RemarkNpmOptions | false;
|
|
20
20
|
rehypeCodeOptions?: plugins.RehypeCodeOptions | false;
|
|
21
|
+
_withoutBundler?: boolean;
|
|
21
22
|
};
|
|
22
|
-
declare function getDefaultMDXOptions({ valueToExport, rehypeCodeOptions, remarkImageOptions, remarkHeadingOptions, remarkStructureOptions, remarkCodeTabOptions, remarkNpmOptions, ...mdxOptions }: DefaultMDXOptions): ProcessorOptions;
|
|
23
|
+
declare function getDefaultMDXOptions({ valueToExport, rehypeCodeOptions, remarkImageOptions, remarkHeadingOptions, remarkStructureOptions, remarkCodeTabOptions, remarkNpmOptions, _withoutBundler, ...mdxOptions }: DefaultMDXOptions): ProcessorOptions;
|
|
23
24
|
|
|
24
25
|
declare const metaSchema: z.ZodObject<{
|
|
25
26
|
title: z.ZodOptional<z.ZodString>;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { PageData, MetaData, Source, VirtualFile } from 'fumadocs-core/source';
|
|
2
|
-
import { R as Runtime, B as BaseCollectionEntry } from './types-
|
|
2
|
+
import { R as Runtime, B as BaseCollectionEntry } from './types-C-WXTx1W.cjs';
|
|
3
3
|
import '@standard-schema/spec';
|
|
4
|
-
import './define-
|
|
5
|
-
import 'zod';
|
|
4
|
+
import './define-DnJzAZrj.cjs';
|
|
6
5
|
import 'fumadocs-core/mdx-plugins';
|
|
7
6
|
import '@mdx-js/mdx';
|
|
8
7
|
import 'unified';
|
|
8
|
+
import 'zod';
|
|
9
9
|
import 'react';
|
|
10
10
|
import 'mdx/types';
|
|
11
11
|
import 'fumadocs-core/server';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { PageData, MetaData, Source, VirtualFile } from 'fumadocs-core/source';
|
|
2
|
-
import { R as Runtime, B as BaseCollectionEntry } from './types-
|
|
2
|
+
import { R as Runtime, B as BaseCollectionEntry } from './types-CU9nn_je.js';
|
|
3
3
|
import '@standard-schema/spec';
|
|
4
|
-
import './define-
|
|
5
|
-
import 'zod';
|
|
4
|
+
import './define-DnJzAZrj.js';
|
|
6
5
|
import 'fumadocs-core/mdx-plugins';
|
|
7
6
|
import '@mdx-js/mdx';
|
|
8
7
|
import 'unified';
|
|
8
|
+
import 'zod';
|
|
9
9
|
import 'react';
|
|
10
10
|
import 'mdx/types';
|
|
11
11
|
import 'fumadocs-core/server';
|