fumadocs-mdx 11.6.8 → 11.6.10
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-VC3Y6FLZ.js → chunk-64MMPGML.js} +12 -2
- package/dist/chunk-6PDS7MUA.js +49 -0
- package/dist/{chunk-KTLWF7GN.js → chunk-AVMO2SRO.js} +1 -1
- package/dist/chunk-KVWX6THC.js +19 -0
- package/dist/config/index.cjs +19 -30
- package/dist/config/index.d.cts +3 -2
- package/dist/config/index.d.ts +3 -2
- package/dist/config/index.js +6 -6
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/loader-mdx.cjs +145 -183
- package/dist/loader-mdx.js +9 -56
- package/dist/next/index.cjs +33 -40
- package/dist/next/index.js +28 -14
- package/dist/runtime/async.cjs +9 -30
- package/dist/runtime/async.d.cts +5 -5
- package/dist/runtime/async.d.ts +5 -5
- package/dist/runtime/async.js +2 -2
- package/dist/{types-BYJBKH4G.d.ts → types-Dk7DhSKZ.d.ts} +2 -15
- package/dist/{define-uoePrCQ_.d.ts → types-DvTNxAvo.d.cts} +67 -54
- package/dist/{define-uoePrCQ_.d.cts → types-DvTNxAvo.d.ts} +67 -54
- package/dist/{types-BsJd_P5O.d.cts → types-ZwLebhOl.d.cts} +2 -15
- package/dist/vite/index.cjs +384 -0
- package/dist/vite/index.d.cts +8 -0
- package/dist/vite/index.d.ts +8 -0
- package/dist/vite/index.js +71 -0
- package/package.json +19 -6
- package/dist/chunk-MXACIHNJ.js +0 -40
- package/dist/mdx-options-YGL3EP3M.js +0 -6
package/dist/next/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
import "../chunk-DRVUBK5B.js";
|
|
12
12
|
import {
|
|
13
13
|
fumaMatter
|
|
14
|
-
} from "../chunk-
|
|
14
|
+
} from "../chunk-KVWX6THC.js";
|
|
15
15
|
|
|
16
16
|
// src/map/index.ts
|
|
17
17
|
import * as path2 from "path";
|
|
@@ -59,8 +59,7 @@ async function readFileWithCache(file) {
|
|
|
59
59
|
if (cached) return cached;
|
|
60
60
|
return (await fs.readFile(file)).toString();
|
|
61
61
|
}
|
|
62
|
-
async function generateJS(configPath, config,
|
|
63
|
-
const outDir = path.dirname(outputPath);
|
|
62
|
+
async function generateJS(configPath, config, importPath, configHash = false) {
|
|
64
63
|
let asyncInit = false;
|
|
65
64
|
const lines = [
|
|
66
65
|
getImportCode({
|
|
@@ -70,7 +69,7 @@ async function generateJS(configPath, config, outputPath, configHash) {
|
|
|
70
69
|
}),
|
|
71
70
|
getImportCode({
|
|
72
71
|
type: "namespace",
|
|
73
|
-
specifier: toImportPath(configPath,
|
|
72
|
+
specifier: toImportPath(configPath, importPath),
|
|
74
73
|
name: "_source"
|
|
75
74
|
})
|
|
76
75
|
];
|
|
@@ -78,11 +77,15 @@ async function generateJS(configPath, config, outputPath, configHash) {
|
|
|
78
77
|
async function getDocEntries(collectionName, files) {
|
|
79
78
|
const items = files.map(async (file, i) => {
|
|
80
79
|
const importId = `${collectionName}_${i}`;
|
|
80
|
+
const params = [`collection=${collectionName}`];
|
|
81
|
+
if (configHash) {
|
|
82
|
+
params.push(`hash=${configHash}`);
|
|
83
|
+
}
|
|
81
84
|
lines.unshift(
|
|
82
85
|
getImportCode({
|
|
83
86
|
type: "namespace",
|
|
84
87
|
name: importId,
|
|
85
|
-
specifier: `${toImportPath(file.absolutePath,
|
|
88
|
+
specifier: `${toImportPath(file.absolutePath, importPath)}?${params.join("&")}`
|
|
86
89
|
})
|
|
87
90
|
);
|
|
88
91
|
return `{ info: ${JSON.stringify(file)}, data: ${importId} }`;
|
|
@@ -212,14 +215,17 @@ function getImportCode(info) {
|
|
|
212
215
|
}
|
|
213
216
|
return `import ${specifier}`;
|
|
214
217
|
}
|
|
215
|
-
function toImportPath(file,
|
|
218
|
+
function toImportPath(file, config) {
|
|
216
219
|
const ext = path.extname(file);
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
220
|
+
const filename = ext === ".ts" ? file.substring(0, file.length - ext.length) : file;
|
|
221
|
+
let importPath;
|
|
222
|
+
if ("relativeTo" in config) {
|
|
223
|
+
importPath = path.relative(config.relativeTo, filename);
|
|
224
|
+
if (!path.isAbsolute(importPath) && !importPath.startsWith(".")) {
|
|
225
|
+
importPath = `./${importPath}`;
|
|
226
|
+
}
|
|
227
|
+
} else {
|
|
228
|
+
importPath = path.resolve(filename);
|
|
223
229
|
}
|
|
224
230
|
return importPath.replaceAll(path.sep, "/");
|
|
225
231
|
}
|
|
@@ -246,7 +252,12 @@ async function start(dev, configPath, outDir) {
|
|
|
246
252
|
try {
|
|
247
253
|
await fs2.writeFile(
|
|
248
254
|
outPath,
|
|
249
|
-
await generateJS(
|
|
255
|
+
await generateJS(
|
|
256
|
+
configPath,
|
|
257
|
+
config,
|
|
258
|
+
{ relativeTo: outDir },
|
|
259
|
+
configHash
|
|
260
|
+
)
|
|
250
261
|
);
|
|
251
262
|
} catch (err) {
|
|
252
263
|
if (err instanceof ValidationError) {
|
|
@@ -351,7 +362,10 @@ async function postInstall(configPath = findConfigFile(), outDir = ".source") {
|
|
|
351
362
|
const config = await loadConfig(configPath, outDir, hash, true);
|
|
352
363
|
await fs3.rm(path3.dirname(jsOut), { recursive: true });
|
|
353
364
|
await fs3.mkdir(path3.dirname(jsOut), { recursive: true });
|
|
354
|
-
await fs3.writeFile(
|
|
365
|
+
await fs3.writeFile(
|
|
366
|
+
jsOut,
|
|
367
|
+
await generateJS(configPath, config, { relativeTo: outDir }, hash)
|
|
368
|
+
);
|
|
355
369
|
console.log("[MDX] types generated");
|
|
356
370
|
}
|
|
357
371
|
export {
|
package/dist/runtime/async.cjs
CHANGED
|
@@ -42,37 +42,16 @@ var path = __toESM(require("path"), 1);
|
|
|
42
42
|
var fs = __toESM(require("fs/promises"), 1);
|
|
43
43
|
|
|
44
44
|
// src/utils/fuma-matter.ts
|
|
45
|
-
var import_lru_cache = require("lru-cache");
|
|
46
45
|
var import_js_yaml = require("js-yaml");
|
|
47
|
-
var
|
|
48
|
-
max: 200
|
|
49
|
-
});
|
|
46
|
+
var regex = /^---\r?\n(.+?)\r?\n---\r?\n/s;
|
|
50
47
|
function fumaMatter(input) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const cached = cache.get(input);
|
|
55
|
-
if (cached) return cached;
|
|
56
|
-
const result = parseMatter(input);
|
|
57
|
-
cache.set(input, result);
|
|
58
|
-
return structuredClone(result);
|
|
59
|
-
}
|
|
60
|
-
var delimiter = "---";
|
|
61
|
-
function parseMatter(str) {
|
|
62
|
-
const output = { matter: "", data: {}, content: str };
|
|
63
|
-
const open = delimiter + "\n";
|
|
64
|
-
const close = "\n" + delimiter;
|
|
65
|
-
if (!str.startsWith(open)) {
|
|
48
|
+
const output = { matter: "", data: {}, content: input };
|
|
49
|
+
const match = regex.exec(input);
|
|
50
|
+
if (!match) {
|
|
66
51
|
return output;
|
|
67
52
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
let closeIdx = str.indexOf(close);
|
|
71
|
-
if (closeIdx === -1) {
|
|
72
|
-
closeIdx = len;
|
|
73
|
-
}
|
|
74
|
-
output.matter = str.slice(0, closeIdx);
|
|
75
|
-
output.content = str.slice(closeIdx + close.length);
|
|
53
|
+
output.matter = match[1];
|
|
54
|
+
output.content = input.slice(match[0].length);
|
|
76
55
|
const loaded = (0, import_js_yaml.load)(output.matter);
|
|
77
56
|
output.data = loaded ?? {};
|
|
78
57
|
return output;
|
|
@@ -154,7 +133,7 @@ var import_mdx_plugins = require("fumadocs-core/mdx-plugins");
|
|
|
154
133
|
|
|
155
134
|
// src/runtime/index.ts
|
|
156
135
|
var import_node_fs = __toESM(require("fs"), 1);
|
|
157
|
-
var
|
|
136
|
+
var cache = /* @__PURE__ */ new Map();
|
|
158
137
|
var _runtime = {
|
|
159
138
|
doc(files) {
|
|
160
139
|
return files.map((file) => {
|
|
@@ -167,10 +146,10 @@ var _runtime = {
|
|
|
167
146
|
_exports: file.data,
|
|
168
147
|
get content() {
|
|
169
148
|
const path2 = this._file.absolutePath;
|
|
170
|
-
const cached =
|
|
149
|
+
const cached = cache.get(path2);
|
|
171
150
|
if (cached) return cached;
|
|
172
151
|
const content = import_node_fs.default.readFileSync(path2).toString();
|
|
173
|
-
|
|
152
|
+
cache.set(path2, content);
|
|
174
153
|
return content;
|
|
175
154
|
}
|
|
176
155
|
};
|
package/dist/runtime/async.d.cts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import '../
|
|
3
|
-
import '@
|
|
1
|
+
import { a as RuntimeAsync } from '../types-ZwLebhOl.cjs';
|
|
2
|
+
import { L as LoadedConfig } from '../types-DvTNxAvo.cjs';
|
|
3
|
+
import '@standard-schema/spec';
|
|
4
|
+
import 'fumadocs-core/source';
|
|
4
5
|
import 'mdx/types';
|
|
5
6
|
import 'fumadocs-core/mdx-plugins';
|
|
6
7
|
import 'fumadocs-core/server';
|
|
8
|
+
import '@mdx-js/mdx';
|
|
7
9
|
import 'unified';
|
|
8
10
|
import 'react';
|
|
9
11
|
import 'zod';
|
|
10
|
-
import '@standard-schema/spec';
|
|
11
|
-
import 'fumadocs-core/source';
|
|
12
12
|
import '@fumadocs/mdx-remote';
|
|
13
13
|
|
|
14
14
|
declare function buildConfig(config: Record<string, unknown>): [err: string, value: null] | [err: null, value: LoadedConfig];
|
package/dist/runtime/async.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import '../
|
|
3
|
-
import '@
|
|
1
|
+
import { a as RuntimeAsync } from '../types-Dk7DhSKZ.js';
|
|
2
|
+
import { L as LoadedConfig } from '../types-DvTNxAvo.js';
|
|
3
|
+
import '@standard-schema/spec';
|
|
4
|
+
import 'fumadocs-core/source';
|
|
4
5
|
import 'mdx/types';
|
|
5
6
|
import 'fumadocs-core/mdx-plugins';
|
|
6
7
|
import 'fumadocs-core/server';
|
|
8
|
+
import '@mdx-js/mdx';
|
|
7
9
|
import 'unified';
|
|
8
10
|
import 'react';
|
|
9
11
|
import 'zod';
|
|
10
|
-
import '@standard-schema/spec';
|
|
11
|
-
import 'fumadocs-core/source';
|
|
12
12
|
import '@fumadocs/mdx-remote';
|
|
13
13
|
|
|
14
14
|
declare function buildConfig(config: Record<string, unknown>): [err: string, value: null] | [err: null, value: LoadedConfig];
|
package/dist/runtime/async.js
CHANGED
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
} from "../chunk-NUDEC6C5.js";
|
|
5
5
|
import {
|
|
6
6
|
remarkInclude
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-AVMO2SRO.js";
|
|
8
8
|
import {
|
|
9
9
|
buildConfig
|
|
10
10
|
} from "../chunk-DRVUBK5B.js";
|
|
11
|
-
import "../chunk-
|
|
11
|
+
import "../chunk-KVWX6THC.js";
|
|
12
12
|
|
|
13
13
|
// src/runtime/async.ts
|
|
14
14
|
import { createCompiler } from "@fumadocs/mdx-remote";
|
|
@@ -1,19 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { F as FileInfo, M as MarkdownProps, B as BaseCollectionEntry, L as LoadedConfig } from './types-DvTNxAvo.js';
|
|
2
2
|
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
3
3
|
import { Source, PageData, MetaData } from 'fumadocs-core/source';
|
|
4
|
-
import { ProcessorOptions } from '@mdx-js/mdx';
|
|
5
|
-
import { MDXOptions } from '@fumadocs/mdx-remote';
|
|
6
|
-
|
|
7
|
-
interface LoadedConfig {
|
|
8
|
-
collections: Map<string, DocCollection | MetaCollection | DocsCollection>;
|
|
9
|
-
global?: GlobalConfig;
|
|
10
|
-
_mdx_loader?: {
|
|
11
|
-
cachedOptions?: ProcessorOptions;
|
|
12
|
-
};
|
|
13
|
-
_mdx_async?: {
|
|
14
|
-
cachedMdxOptions?: MDXOptions;
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
4
|
|
|
18
5
|
interface RuntimeFile {
|
|
19
6
|
info: FileInfo;
|
|
@@ -104,4 +91,4 @@ interface RuntimeAsync {
|
|
|
104
91
|
} : never;
|
|
105
92
|
}
|
|
106
93
|
|
|
107
|
-
export type {
|
|
94
|
+
export type { Runtime as R, RuntimeAsync as a };
|
|
@@ -1,60 +1,13 @@
|
|
|
1
|
-
import { ProcessorOptions } from '@mdx-js/mdx';
|
|
2
1
|
import { MDXProps } from 'mdx/types';
|
|
3
2
|
import * as plugins from 'fumadocs-core/mdx-plugins';
|
|
4
3
|
import { StructuredData } from 'fumadocs-core/mdx-plugins';
|
|
5
4
|
import { TableOfContents } from 'fumadocs-core/server';
|
|
5
|
+
import { ProcessorOptions } from '@mdx-js/mdx';
|
|
6
6
|
import { Pluggable } from 'unified';
|
|
7
7
|
import { FC } from 'react';
|
|
8
8
|
import { z } from 'zod';
|
|
9
9
|
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
10
|
-
|
|
11
|
-
type ResolvePlugins = Pluggable[] | ((v: Pluggable[]) => Pluggable[]);
|
|
12
|
-
type DefaultMDXOptions = Omit<NonNullable<ProcessorOptions>, 'rehypePlugins' | 'remarkPlugins' | '_ctx'> & {
|
|
13
|
-
rehypePlugins?: ResolvePlugins;
|
|
14
|
-
remarkPlugins?: ResolvePlugins;
|
|
15
|
-
/**
|
|
16
|
-
* Properties to export from `vfile.data`
|
|
17
|
-
*/
|
|
18
|
-
valueToExport?: string[];
|
|
19
|
-
remarkStructureOptions?: plugins.StructureOptions | false;
|
|
20
|
-
remarkHeadingOptions?: plugins.RemarkHeadingOptions;
|
|
21
|
-
remarkImageOptions?: plugins.RemarkImageOptions | false;
|
|
22
|
-
remarkCodeTabOptions?: plugins.RemarkCodeTabOptions | false;
|
|
23
|
-
rehypeCodeOptions?: plugins.RehypeCodeOptions | false;
|
|
24
|
-
};
|
|
25
|
-
declare function getDefaultMDXOptions({ valueToExport, rehypeCodeOptions, remarkImageOptions, remarkHeadingOptions, remarkStructureOptions, remarkCodeTabOptions, ...mdxOptions }: DefaultMDXOptions): ProcessorOptions;
|
|
26
|
-
|
|
27
|
-
interface GlobalConfig {
|
|
28
|
-
/**
|
|
29
|
-
* Configure global MDX options
|
|
30
|
-
*/
|
|
31
|
-
mdxOptions?: DefaultMDXOptions | (() => DefaultMDXOptions | Promise<DefaultMDXOptions>);
|
|
32
|
-
/**
|
|
33
|
-
* Fetch last modified time with specified version control
|
|
34
|
-
* @defaultValue 'none'
|
|
35
|
-
*/
|
|
36
|
-
lastModifiedTime?: 'git' | 'none';
|
|
37
|
-
}
|
|
38
|
-
interface FileInfo {
|
|
39
|
-
path: string;
|
|
40
|
-
absolutePath: string;
|
|
41
|
-
}
|
|
42
|
-
interface MarkdownProps {
|
|
43
|
-
body: FC<MDXProps>;
|
|
44
|
-
structuredData: StructuredData;
|
|
45
|
-
toc: TableOfContents;
|
|
46
|
-
_exports: Record<string, unknown>;
|
|
47
|
-
/**
|
|
48
|
-
* Only available when `lastModifiedTime` is enabled on MDX loader
|
|
49
|
-
*/
|
|
50
|
-
lastModified?: Date;
|
|
51
|
-
}
|
|
52
|
-
interface BaseCollectionEntry {
|
|
53
|
-
/**
|
|
54
|
-
* Raw file path of collection entry, including absolute path (not normalized).
|
|
55
|
-
*/
|
|
56
|
-
_file: FileInfo;
|
|
57
|
-
}
|
|
10
|
+
import { MDXOptions as MDXOptions$1 } from '@fumadocs/mdx-remote';
|
|
58
11
|
|
|
59
12
|
interface MDXOptions extends ProcessorOptions {
|
|
60
13
|
/**
|
|
@@ -94,17 +47,17 @@ declare const metaSchema: z.ZodObject<{
|
|
|
94
47
|
}, "strip", z.ZodTypeAny, {
|
|
95
48
|
root?: boolean | undefined;
|
|
96
49
|
title?: string | undefined;
|
|
97
|
-
icon?: string | undefined;
|
|
98
50
|
pages?: string[] | undefined;
|
|
99
51
|
description?: string | undefined;
|
|
100
52
|
defaultOpen?: boolean | undefined;
|
|
53
|
+
icon?: string | undefined;
|
|
101
54
|
}, {
|
|
102
55
|
root?: boolean | undefined;
|
|
103
56
|
title?: string | undefined;
|
|
104
|
-
icon?: string | undefined;
|
|
105
57
|
pages?: string[] | undefined;
|
|
106
58
|
description?: string | undefined;
|
|
107
59
|
defaultOpen?: boolean | undefined;
|
|
60
|
+
icon?: string | undefined;
|
|
108
61
|
}>;
|
|
109
62
|
declare const frontmatterSchema: z.ZodObject<{
|
|
110
63
|
title: z.ZodString;
|
|
@@ -114,14 +67,14 @@ declare const frontmatterSchema: z.ZodObject<{
|
|
|
114
67
|
_openapi: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
115
68
|
}, "strip", z.ZodTypeAny, {
|
|
116
69
|
title: string;
|
|
117
|
-
icon?: string | undefined;
|
|
118
70
|
description?: string | undefined;
|
|
71
|
+
icon?: string | undefined;
|
|
119
72
|
full?: boolean | undefined;
|
|
120
73
|
_openapi?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
121
74
|
}, {
|
|
122
75
|
title: string;
|
|
123
|
-
icon?: string | undefined;
|
|
124
76
|
description?: string | undefined;
|
|
77
|
+
icon?: string | undefined;
|
|
125
78
|
full?: boolean | undefined;
|
|
126
79
|
_openapi?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
127
80
|
}>;
|
|
@@ -201,4 +154,64 @@ declare function defineDocs<DocSchema extends StandardSchemaV1 = typeof frontmat
|
|
|
201
154
|
};
|
|
202
155
|
declare function defineConfig(config?: GlobalConfig): GlobalConfig;
|
|
203
156
|
|
|
204
|
-
|
|
157
|
+
interface LoadedConfig {
|
|
158
|
+
collections: Map<string, DocCollection | MetaCollection | DocsCollection>;
|
|
159
|
+
global?: GlobalConfig;
|
|
160
|
+
_mdx_loader?: {
|
|
161
|
+
cachedOptions?: ProcessorOptions;
|
|
162
|
+
};
|
|
163
|
+
_mdx_async?: {
|
|
164
|
+
cachedMdxOptions?: MDXOptions$1;
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
type ResolvePlugins = Pluggable[] | ((v: Pluggable[]) => Pluggable[]);
|
|
169
|
+
type DefaultMDXOptions = Omit<NonNullable<ProcessorOptions>, 'rehypePlugins' | 'remarkPlugins' | '_ctx'> & {
|
|
170
|
+
rehypePlugins?: ResolvePlugins;
|
|
171
|
+
remarkPlugins?: ResolvePlugins;
|
|
172
|
+
/**
|
|
173
|
+
* Properties to export from `vfile.data`
|
|
174
|
+
*/
|
|
175
|
+
valueToExport?: string[];
|
|
176
|
+
remarkStructureOptions?: plugins.StructureOptions | false;
|
|
177
|
+
remarkHeadingOptions?: plugins.RemarkHeadingOptions;
|
|
178
|
+
remarkImageOptions?: plugins.RemarkImageOptions | false;
|
|
179
|
+
remarkCodeTabOptions?: plugins.RemarkCodeTabOptions | false;
|
|
180
|
+
remarkNpmOptions?: plugins.RemarkNpmOptions | false;
|
|
181
|
+
rehypeCodeOptions?: plugins.RehypeCodeOptions | false;
|
|
182
|
+
};
|
|
183
|
+
declare function loadDefaultOptions(config: LoadedConfig): Promise<ProcessorOptions>;
|
|
184
|
+
|
|
185
|
+
interface GlobalConfig {
|
|
186
|
+
/**
|
|
187
|
+
* Configure global MDX options
|
|
188
|
+
*/
|
|
189
|
+
mdxOptions?: DefaultMDXOptions | (() => DefaultMDXOptions | Promise<DefaultMDXOptions>);
|
|
190
|
+
/**
|
|
191
|
+
* Fetch last modified time with specified version control
|
|
192
|
+
* @defaultValue 'none'
|
|
193
|
+
*/
|
|
194
|
+
lastModifiedTime?: 'git' | 'none';
|
|
195
|
+
}
|
|
196
|
+
interface FileInfo {
|
|
197
|
+
path: string;
|
|
198
|
+
absolutePath: string;
|
|
199
|
+
}
|
|
200
|
+
interface MarkdownProps {
|
|
201
|
+
body: FC<MDXProps>;
|
|
202
|
+
structuredData: StructuredData;
|
|
203
|
+
toc: TableOfContents;
|
|
204
|
+
_exports: Record<string, unknown>;
|
|
205
|
+
/**
|
|
206
|
+
* Only available when `lastModifiedTime` is enabled on MDX loader
|
|
207
|
+
*/
|
|
208
|
+
lastModified?: Date;
|
|
209
|
+
}
|
|
210
|
+
interface BaseCollectionEntry {
|
|
211
|
+
/**
|
|
212
|
+
* Raw file path of collection entry, including absolute path (not normalized).
|
|
213
|
+
*/
|
|
214
|
+
_file: FileInfo;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export { type BaseCollectionEntry as B, type CollectionSchema as C, type DefaultMDXOptions as D, type FileInfo as F, type GlobalConfig as G, type LoadedConfig as L, type MarkdownProps as M, type BaseCollection as a, type MetaCollection as b, type DocCollection as c, type DocsCollection as d, defineCollections as e, frontmatterSchema as f, defineDocs as g, defineConfig as h, loadDefaultOptions as l, metaSchema as m };
|
|
@@ -1,60 +1,13 @@
|
|
|
1
|
-
import { ProcessorOptions } from '@mdx-js/mdx';
|
|
2
1
|
import { MDXProps } from 'mdx/types';
|
|
3
2
|
import * as plugins from 'fumadocs-core/mdx-plugins';
|
|
4
3
|
import { StructuredData } from 'fumadocs-core/mdx-plugins';
|
|
5
4
|
import { TableOfContents } from 'fumadocs-core/server';
|
|
5
|
+
import { ProcessorOptions } from '@mdx-js/mdx';
|
|
6
6
|
import { Pluggable } from 'unified';
|
|
7
7
|
import { FC } from 'react';
|
|
8
8
|
import { z } from 'zod';
|
|
9
9
|
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
10
|
-
|
|
11
|
-
type ResolvePlugins = Pluggable[] | ((v: Pluggable[]) => Pluggable[]);
|
|
12
|
-
type DefaultMDXOptions = Omit<NonNullable<ProcessorOptions>, 'rehypePlugins' | 'remarkPlugins' | '_ctx'> & {
|
|
13
|
-
rehypePlugins?: ResolvePlugins;
|
|
14
|
-
remarkPlugins?: ResolvePlugins;
|
|
15
|
-
/**
|
|
16
|
-
* Properties to export from `vfile.data`
|
|
17
|
-
*/
|
|
18
|
-
valueToExport?: string[];
|
|
19
|
-
remarkStructureOptions?: plugins.StructureOptions | false;
|
|
20
|
-
remarkHeadingOptions?: plugins.RemarkHeadingOptions;
|
|
21
|
-
remarkImageOptions?: plugins.RemarkImageOptions | false;
|
|
22
|
-
remarkCodeTabOptions?: plugins.RemarkCodeTabOptions | false;
|
|
23
|
-
rehypeCodeOptions?: plugins.RehypeCodeOptions | false;
|
|
24
|
-
};
|
|
25
|
-
declare function getDefaultMDXOptions({ valueToExport, rehypeCodeOptions, remarkImageOptions, remarkHeadingOptions, remarkStructureOptions, remarkCodeTabOptions, ...mdxOptions }: DefaultMDXOptions): ProcessorOptions;
|
|
26
|
-
|
|
27
|
-
interface GlobalConfig {
|
|
28
|
-
/**
|
|
29
|
-
* Configure global MDX options
|
|
30
|
-
*/
|
|
31
|
-
mdxOptions?: DefaultMDXOptions | (() => DefaultMDXOptions | Promise<DefaultMDXOptions>);
|
|
32
|
-
/**
|
|
33
|
-
* Fetch last modified time with specified version control
|
|
34
|
-
* @defaultValue 'none'
|
|
35
|
-
*/
|
|
36
|
-
lastModifiedTime?: 'git' | 'none';
|
|
37
|
-
}
|
|
38
|
-
interface FileInfo {
|
|
39
|
-
path: string;
|
|
40
|
-
absolutePath: string;
|
|
41
|
-
}
|
|
42
|
-
interface MarkdownProps {
|
|
43
|
-
body: FC<MDXProps>;
|
|
44
|
-
structuredData: StructuredData;
|
|
45
|
-
toc: TableOfContents;
|
|
46
|
-
_exports: Record<string, unknown>;
|
|
47
|
-
/**
|
|
48
|
-
* Only available when `lastModifiedTime` is enabled on MDX loader
|
|
49
|
-
*/
|
|
50
|
-
lastModified?: Date;
|
|
51
|
-
}
|
|
52
|
-
interface BaseCollectionEntry {
|
|
53
|
-
/**
|
|
54
|
-
* Raw file path of collection entry, including absolute path (not normalized).
|
|
55
|
-
*/
|
|
56
|
-
_file: FileInfo;
|
|
57
|
-
}
|
|
10
|
+
import { MDXOptions as MDXOptions$1 } from '@fumadocs/mdx-remote';
|
|
58
11
|
|
|
59
12
|
interface MDXOptions extends ProcessorOptions {
|
|
60
13
|
/**
|
|
@@ -94,17 +47,17 @@ declare const metaSchema: z.ZodObject<{
|
|
|
94
47
|
}, "strip", z.ZodTypeAny, {
|
|
95
48
|
root?: boolean | undefined;
|
|
96
49
|
title?: string | undefined;
|
|
97
|
-
icon?: string | undefined;
|
|
98
50
|
pages?: string[] | undefined;
|
|
99
51
|
description?: string | undefined;
|
|
100
52
|
defaultOpen?: boolean | undefined;
|
|
53
|
+
icon?: string | undefined;
|
|
101
54
|
}, {
|
|
102
55
|
root?: boolean | undefined;
|
|
103
56
|
title?: string | undefined;
|
|
104
|
-
icon?: string | undefined;
|
|
105
57
|
pages?: string[] | undefined;
|
|
106
58
|
description?: string | undefined;
|
|
107
59
|
defaultOpen?: boolean | undefined;
|
|
60
|
+
icon?: string | undefined;
|
|
108
61
|
}>;
|
|
109
62
|
declare const frontmatterSchema: z.ZodObject<{
|
|
110
63
|
title: z.ZodString;
|
|
@@ -114,14 +67,14 @@ declare const frontmatterSchema: z.ZodObject<{
|
|
|
114
67
|
_openapi: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
115
68
|
}, "strip", z.ZodTypeAny, {
|
|
116
69
|
title: string;
|
|
117
|
-
icon?: string | undefined;
|
|
118
70
|
description?: string | undefined;
|
|
71
|
+
icon?: string | undefined;
|
|
119
72
|
full?: boolean | undefined;
|
|
120
73
|
_openapi?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
121
74
|
}, {
|
|
122
75
|
title: string;
|
|
123
|
-
icon?: string | undefined;
|
|
124
76
|
description?: string | undefined;
|
|
77
|
+
icon?: string | undefined;
|
|
125
78
|
full?: boolean | undefined;
|
|
126
79
|
_openapi?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
127
80
|
}>;
|
|
@@ -201,4 +154,64 @@ declare function defineDocs<DocSchema extends StandardSchemaV1 = typeof frontmat
|
|
|
201
154
|
};
|
|
202
155
|
declare function defineConfig(config?: GlobalConfig): GlobalConfig;
|
|
203
156
|
|
|
204
|
-
|
|
157
|
+
interface LoadedConfig {
|
|
158
|
+
collections: Map<string, DocCollection | MetaCollection | DocsCollection>;
|
|
159
|
+
global?: GlobalConfig;
|
|
160
|
+
_mdx_loader?: {
|
|
161
|
+
cachedOptions?: ProcessorOptions;
|
|
162
|
+
};
|
|
163
|
+
_mdx_async?: {
|
|
164
|
+
cachedMdxOptions?: MDXOptions$1;
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
type ResolvePlugins = Pluggable[] | ((v: Pluggable[]) => Pluggable[]);
|
|
169
|
+
type DefaultMDXOptions = Omit<NonNullable<ProcessorOptions>, 'rehypePlugins' | 'remarkPlugins' | '_ctx'> & {
|
|
170
|
+
rehypePlugins?: ResolvePlugins;
|
|
171
|
+
remarkPlugins?: ResolvePlugins;
|
|
172
|
+
/**
|
|
173
|
+
* Properties to export from `vfile.data`
|
|
174
|
+
*/
|
|
175
|
+
valueToExport?: string[];
|
|
176
|
+
remarkStructureOptions?: plugins.StructureOptions | false;
|
|
177
|
+
remarkHeadingOptions?: plugins.RemarkHeadingOptions;
|
|
178
|
+
remarkImageOptions?: plugins.RemarkImageOptions | false;
|
|
179
|
+
remarkCodeTabOptions?: plugins.RemarkCodeTabOptions | false;
|
|
180
|
+
remarkNpmOptions?: plugins.RemarkNpmOptions | false;
|
|
181
|
+
rehypeCodeOptions?: plugins.RehypeCodeOptions | false;
|
|
182
|
+
};
|
|
183
|
+
declare function loadDefaultOptions(config: LoadedConfig): Promise<ProcessorOptions>;
|
|
184
|
+
|
|
185
|
+
interface GlobalConfig {
|
|
186
|
+
/**
|
|
187
|
+
* Configure global MDX options
|
|
188
|
+
*/
|
|
189
|
+
mdxOptions?: DefaultMDXOptions | (() => DefaultMDXOptions | Promise<DefaultMDXOptions>);
|
|
190
|
+
/**
|
|
191
|
+
* Fetch last modified time with specified version control
|
|
192
|
+
* @defaultValue 'none'
|
|
193
|
+
*/
|
|
194
|
+
lastModifiedTime?: 'git' | 'none';
|
|
195
|
+
}
|
|
196
|
+
interface FileInfo {
|
|
197
|
+
path: string;
|
|
198
|
+
absolutePath: string;
|
|
199
|
+
}
|
|
200
|
+
interface MarkdownProps {
|
|
201
|
+
body: FC<MDXProps>;
|
|
202
|
+
structuredData: StructuredData;
|
|
203
|
+
toc: TableOfContents;
|
|
204
|
+
_exports: Record<string, unknown>;
|
|
205
|
+
/**
|
|
206
|
+
* Only available when `lastModifiedTime` is enabled on MDX loader
|
|
207
|
+
*/
|
|
208
|
+
lastModified?: Date;
|
|
209
|
+
}
|
|
210
|
+
interface BaseCollectionEntry {
|
|
211
|
+
/**
|
|
212
|
+
* Raw file path of collection entry, including absolute path (not normalized).
|
|
213
|
+
*/
|
|
214
|
+
_file: FileInfo;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export { type BaseCollectionEntry as B, type CollectionSchema as C, type DefaultMDXOptions as D, type FileInfo as F, type GlobalConfig as G, type LoadedConfig as L, type MarkdownProps as M, type BaseCollection as a, type MetaCollection as b, type DocCollection as c, type DocsCollection as d, defineCollections as e, frontmatterSchema as f, defineDocs as g, defineConfig as h, loadDefaultOptions as l, metaSchema as m };
|
|
@@ -1,19 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { F as FileInfo, M as MarkdownProps, B as BaseCollectionEntry, L as LoadedConfig } from './types-DvTNxAvo.cjs';
|
|
2
2
|
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
3
3
|
import { Source, PageData, MetaData } from 'fumadocs-core/source';
|
|
4
|
-
import { ProcessorOptions } from '@mdx-js/mdx';
|
|
5
|
-
import { MDXOptions } from '@fumadocs/mdx-remote';
|
|
6
|
-
|
|
7
|
-
interface LoadedConfig {
|
|
8
|
-
collections: Map<string, DocCollection | MetaCollection | DocsCollection>;
|
|
9
|
-
global?: GlobalConfig;
|
|
10
|
-
_mdx_loader?: {
|
|
11
|
-
cachedOptions?: ProcessorOptions;
|
|
12
|
-
};
|
|
13
|
-
_mdx_async?: {
|
|
14
|
-
cachedMdxOptions?: MDXOptions;
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
4
|
|
|
18
5
|
interface RuntimeFile {
|
|
19
6
|
info: FileInfo;
|
|
@@ -104,4 +91,4 @@ interface RuntimeAsync {
|
|
|
104
91
|
} : never;
|
|
105
92
|
}
|
|
106
93
|
|
|
107
|
-
export type {
|
|
94
|
+
export type { Runtime as R, RuntimeAsync as a };
|