fumadocs-mdx 11.4.1 → 11.5.1
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-IU4D6M3A.js → chunk-2C4NRJ5O.js} +1 -1
- package/dist/chunk-3PXNPJQ2.js +72 -0
- package/dist/{chunk-2DJQ3DOD.js → chunk-6ZVE73IT.js} +9 -6
- package/dist/config/index.cjs +1 -1
- package/dist/config/index.d.cts +4 -4
- package/dist/config/index.d.ts +4 -4
- package/dist/config/index.js +1 -1
- package/dist/define-_brlBG8j.d.cts +201 -0
- package/dist/define-_brlBG8j.d.ts +201 -0
- package/dist/index.cjs +34 -17
- package/dist/index.d.cts +27 -6
- package/dist/index.d.ts +27 -6
- package/dist/index.js +7 -51
- package/dist/loader-mdx.cjs +26 -30
- package/dist/loader-mdx.js +22 -29
- package/dist/next/index.cjs +159 -121
- package/dist/next/index.js +144 -117
- package/dist/runtime/async.cjs +125 -41
- package/dist/runtime/async.d.cts +25 -14
- package/dist/runtime/async.d.ts +25 -14
- package/dist/runtime/async.js +53 -35
- package/dist/{watcher-7ALL6XOY.js → watcher-IAZDSTU7.js} +10 -2
- package/package.json +8 -7
- package/dist/build-mdx-o0kbHSlp.d.cts +0 -109
- package/dist/build-mdx-o0kbHSlp.d.ts +0 -109
- package/dist/define-BB9hRiTI.d.cts +0 -106
- package/dist/define-D3l733EX.d.ts +0 -106
package/dist/runtime/async.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
_runtime,
|
|
3
|
+
createMDXSource
|
|
4
|
+
} from "../chunk-3PXNPJQ2.js";
|
|
1
5
|
import {
|
|
2
6
|
remarkInclude
|
|
3
7
|
} from "../chunk-PY2KKTR2.js";
|
|
4
8
|
import {
|
|
5
9
|
buildConfig
|
|
6
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-6ZVE73IT.js";
|
|
7
11
|
|
|
8
12
|
// src/runtime/async.ts
|
|
9
13
|
import { createCompiler } from "@fumadocs/mdx-remote";
|
|
@@ -11,44 +15,58 @@ import * as fs from "node:fs/promises";
|
|
|
11
15
|
import {
|
|
12
16
|
remarkStructure
|
|
13
17
|
} from "fumadocs-core/mdx-plugins";
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
return createCompiler(mdxOptions);
|
|
18
|
+
async function initCompiler(config, collection) {
|
|
19
|
+
let col = config.collections.get(collection);
|
|
20
|
+
if (col?.type === "docs") col = col.docs;
|
|
21
|
+
let mdxOptions;
|
|
22
|
+
if (col?.type === "doc" && col.mdxOptions) {
|
|
23
|
+
mdxOptions = col.mdxOptions;
|
|
24
|
+
} else {
|
|
25
|
+
const options = typeof config.global?.mdxOptions === "function" ? await config.global.mdxOptions() : config.global?.mdxOptions;
|
|
26
|
+
const remarkPlugins = options?.remarkPlugins ?? [];
|
|
27
|
+
mdxOptions = {
|
|
28
|
+
...options,
|
|
29
|
+
remarkPlugins: (v) => typeof remarkPlugins === "function" ? [remarkInclude, ...remarkPlugins(v), remarkStructure] : [remarkInclude, ...v, ...remarkPlugins, remarkStructure]
|
|
30
|
+
};
|
|
29
31
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
return createCompiler(mdxOptions);
|
|
33
|
+
}
|
|
34
|
+
var _runtimeAsync = {
|
|
35
|
+
doc(files, collection, config) {
|
|
36
|
+
const init = initCompiler(config, collection);
|
|
37
|
+
return files.map(({ info: file, data: frontmatter }) => {
|
|
38
|
+
return {
|
|
39
|
+
...frontmatter,
|
|
40
|
+
_file: file,
|
|
41
|
+
async load() {
|
|
42
|
+
const compiler = await init;
|
|
43
|
+
const out = await compiler.compile({
|
|
44
|
+
source: (await fs.readFile(file.absolutePath)).toString(),
|
|
45
|
+
filePath: file.absolutePath
|
|
46
|
+
});
|
|
47
|
+
return {
|
|
48
|
+
body: out.body,
|
|
49
|
+
toc: out.toc,
|
|
50
|
+
structuredData: out.vfile.data.structuredData,
|
|
51
|
+
_exports: out.exports ?? {}
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
});
|
|
56
|
+
},
|
|
57
|
+
docs(docs, metas, collection, config) {
|
|
58
|
+
const parsedDocs = this.doc(docs, collection, config);
|
|
59
|
+
const parsedMetas = _runtime.meta(metas);
|
|
32
60
|
return {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const out = await compiler.compile({
|
|
38
|
-
source: (await fs.readFile(file.absolutePath)).toString(),
|
|
39
|
-
filePath: file.absolutePath
|
|
40
|
-
});
|
|
41
|
-
return {
|
|
42
|
-
body: out.body,
|
|
43
|
-
toc: out.toc,
|
|
44
|
-
structuredData: out.vfile.data.structuredData,
|
|
45
|
-
_exports: out.exports ?? {}
|
|
46
|
-
};
|
|
61
|
+
docs: parsedDocs,
|
|
62
|
+
meta: parsedMetas,
|
|
63
|
+
toFumadocsSource() {
|
|
64
|
+
return createMDXSource(parsedDocs, parsedMetas);
|
|
47
65
|
}
|
|
48
66
|
};
|
|
49
|
-
}
|
|
50
|
-
}
|
|
67
|
+
}
|
|
68
|
+
};
|
|
51
69
|
export {
|
|
52
|
-
|
|
70
|
+
_runtimeAsync,
|
|
53
71
|
buildConfig
|
|
54
72
|
};
|
|
@@ -2,9 +2,17 @@
|
|
|
2
2
|
import { watch } from "chokidar";
|
|
3
3
|
function watcher(configPath, config) {
|
|
4
4
|
const deps = [configPath];
|
|
5
|
+
function add(dir) {
|
|
6
|
+
if (Array.isArray(dir)) deps.push(...dir);
|
|
7
|
+
else deps.push(dir);
|
|
8
|
+
}
|
|
5
9
|
for (const collection of config.collections.values()) {
|
|
6
|
-
if (
|
|
7
|
-
|
|
10
|
+
if (collection.type === "docs") {
|
|
11
|
+
add(collection.docs.dir);
|
|
12
|
+
add(collection.meta.dir);
|
|
13
|
+
} else {
|
|
14
|
+
add(collection.dir);
|
|
15
|
+
}
|
|
8
16
|
}
|
|
9
17
|
return watch(deps, {
|
|
10
18
|
ignoreInitial: true,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-mdx",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.5.1",
|
|
4
4
|
"description": "The built-in source for Fumadocs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"NextJs",
|
|
@@ -54,6 +54,7 @@
|
|
|
54
54
|
"zod": "^3.24.1"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
+
"@standard-schema/spec": "^1.0.0",
|
|
57
58
|
"@types/cross-spawn": "^6.0.6",
|
|
58
59
|
"@types/mdast": "^4.0.3",
|
|
59
60
|
"@types/mdx": "^2.0.13",
|
|
@@ -64,15 +65,15 @@
|
|
|
64
65
|
"unified": "^11.0.5",
|
|
65
66
|
"vfile": "^6.0.3",
|
|
66
67
|
"webpack": "^5.97.1",
|
|
67
|
-
"@fumadocs/mdx-remote": "1.
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
68
|
+
"@fumadocs/mdx-remote": "1.2.0",
|
|
69
|
+
"fumadocs-core": "15.0.3",
|
|
70
|
+
"tsconfig": "0.0.0",
|
|
71
|
+
"eslint-config-custom": "0.0.0"
|
|
71
72
|
},
|
|
72
73
|
"peerDependencies": {
|
|
74
|
+
"@fumadocs/mdx-remote": "^1.2.0",
|
|
73
75
|
"fumadocs-core": "^14.0.0 || ^15.0.0",
|
|
74
|
-
"next": "14.x.x || 15.x.x"
|
|
75
|
-
"@fumadocs/mdx-remote": "1.1.3"
|
|
76
|
+
"next": "14.x.x || 15.x.x"
|
|
76
77
|
},
|
|
77
78
|
"peerDependenciesMeta": {
|
|
78
79
|
"@fumadocs/mdx-remote": {
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { AnyZodObject, z } from 'zod';
|
|
2
|
-
import { MDXProps } from 'mdx/types';
|
|
3
|
-
import * as plugins from 'fumadocs-core/mdx-plugins';
|
|
4
|
-
import { StructuredData } from 'fumadocs-core/mdx-plugins';
|
|
5
|
-
import { TableOfContents } from 'fumadocs-core/server';
|
|
6
|
-
import { ProcessorOptions } from '@mdx-js/mdx';
|
|
7
|
-
import { Pluggable } from 'unified';
|
|
8
|
-
import { FC } from 'react';
|
|
9
|
-
|
|
10
|
-
type ResolvePlugins = Pluggable[] | ((v: Pluggable[]) => Pluggable[]);
|
|
11
|
-
type DefaultMDXOptions = Omit<NonNullable<ProcessorOptions>, 'rehypePlugins' | 'remarkPlugins' | '_ctx'> & {
|
|
12
|
-
rehypePlugins?: ResolvePlugins;
|
|
13
|
-
remarkPlugins?: ResolvePlugins;
|
|
14
|
-
/**
|
|
15
|
-
* Properties to export from `vfile.data`
|
|
16
|
-
*/
|
|
17
|
-
valueToExport?: string[];
|
|
18
|
-
remarkStructureOptions?: plugins.StructureOptions | false;
|
|
19
|
-
remarkHeadingOptions?: plugins.RemarkHeadingOptions;
|
|
20
|
-
remarkImageOptions?: plugins.RemarkImageOptions | false;
|
|
21
|
-
remarkCodeTabOptions?: false;
|
|
22
|
-
rehypeCodeOptions?: plugins.RehypeCodeOptions | false;
|
|
23
|
-
};
|
|
24
|
-
declare function getDefaultMDXOptions({ valueToExport, rehypeCodeOptions, remarkImageOptions, remarkHeadingOptions, remarkStructureOptions, remarkCodeTabOptions, ...mdxOptions }: DefaultMDXOptions): ProcessorOptions;
|
|
25
|
-
|
|
26
|
-
interface GlobalConfig {
|
|
27
|
-
/**
|
|
28
|
-
* Configure global MDX options
|
|
29
|
-
*/
|
|
30
|
-
mdxOptions?: DefaultMDXOptions | (() => DefaultMDXOptions | Promise<DefaultMDXOptions>);
|
|
31
|
-
/**
|
|
32
|
-
* Fetch last modified time with specified version control
|
|
33
|
-
* @defaultValue 'none'
|
|
34
|
-
*/
|
|
35
|
-
lastModifiedTime?: 'git' | 'none';
|
|
36
|
-
/**
|
|
37
|
-
* Generate manifest file on build mode
|
|
38
|
-
*
|
|
39
|
-
* @defaultValue false
|
|
40
|
-
* @deprecated No longer needed, use a route handler to export build time info
|
|
41
|
-
*/
|
|
42
|
-
generateManifest?: boolean;
|
|
43
|
-
}
|
|
44
|
-
type InferSchema<CollectionOut> = CollectionOut extends {
|
|
45
|
-
_type: {
|
|
46
|
-
schema: infer T;
|
|
47
|
-
};
|
|
48
|
-
} ? T : never;
|
|
49
|
-
type InferSchemaType<C> = InferSchema<C> extends AnyZodObject ? z.output<InferSchema<C>> : never;
|
|
50
|
-
interface FileInfo {
|
|
51
|
-
path: string;
|
|
52
|
-
absolutePath: string;
|
|
53
|
-
}
|
|
54
|
-
interface MarkdownProps {
|
|
55
|
-
body: FC<MDXProps>;
|
|
56
|
-
structuredData: StructuredData;
|
|
57
|
-
toc: TableOfContents;
|
|
58
|
-
_exports: Record<string, unknown>;
|
|
59
|
-
/**
|
|
60
|
-
* Only available when `lastModifiedTime` is enabled on MDX loader
|
|
61
|
-
*/
|
|
62
|
-
lastModified?: Date;
|
|
63
|
-
}
|
|
64
|
-
type CollectionEntry<CollectionOut extends {
|
|
65
|
-
_type: {
|
|
66
|
-
runtime: unknown;
|
|
67
|
-
};
|
|
68
|
-
}> = CollectionOut['_type']['runtime'];
|
|
69
|
-
interface BaseCollectionEntry {
|
|
70
|
-
_file: FileInfo;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Get output type of collections
|
|
74
|
-
*/
|
|
75
|
-
type GetOutput<C extends {
|
|
76
|
-
_type: {
|
|
77
|
-
runtime: unknown;
|
|
78
|
-
};
|
|
79
|
-
}> = CollectionEntry<C>[];
|
|
80
|
-
|
|
81
|
-
interface MDXOptions extends ProcessorOptions {
|
|
82
|
-
/**
|
|
83
|
-
* Name of collection
|
|
84
|
-
*/
|
|
85
|
-
collection?: string;
|
|
86
|
-
/**
|
|
87
|
-
* Specify a file path for source
|
|
88
|
-
*/
|
|
89
|
-
filePath?: string;
|
|
90
|
-
frontmatter?: Record<string, unknown>;
|
|
91
|
-
/**
|
|
92
|
-
* Custom Vfile data
|
|
93
|
-
*/
|
|
94
|
-
data?: Record<string, unknown>;
|
|
95
|
-
_compiler?: CompilerOptions;
|
|
96
|
-
}
|
|
97
|
-
interface CompilerOptions {
|
|
98
|
-
addDependency: (file: string) => void;
|
|
99
|
-
}
|
|
100
|
-
declare module 'vfile' {
|
|
101
|
-
interface DataMap {
|
|
102
|
-
/**
|
|
103
|
-
* The compiler object from loader
|
|
104
|
-
*/
|
|
105
|
-
_compiler?: CompilerOptions;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
export { type BaseCollectionEntry as B, type CollectionEntry as C, type DefaultMDXOptions as D, type FileInfo as F, type GlobalConfig as G, type InferSchema as I, type MarkdownProps as M, type InferSchemaType as a, type GetOutput as b, type MDXOptions as c, getDefaultMDXOptions as g };
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { AnyZodObject, z } from 'zod';
|
|
2
|
-
import { MDXProps } from 'mdx/types';
|
|
3
|
-
import * as plugins from 'fumadocs-core/mdx-plugins';
|
|
4
|
-
import { StructuredData } from 'fumadocs-core/mdx-plugins';
|
|
5
|
-
import { TableOfContents } from 'fumadocs-core/server';
|
|
6
|
-
import { ProcessorOptions } from '@mdx-js/mdx';
|
|
7
|
-
import { Pluggable } from 'unified';
|
|
8
|
-
import { FC } from 'react';
|
|
9
|
-
|
|
10
|
-
type ResolvePlugins = Pluggable[] | ((v: Pluggable[]) => Pluggable[]);
|
|
11
|
-
type DefaultMDXOptions = Omit<NonNullable<ProcessorOptions>, 'rehypePlugins' | 'remarkPlugins' | '_ctx'> & {
|
|
12
|
-
rehypePlugins?: ResolvePlugins;
|
|
13
|
-
remarkPlugins?: ResolvePlugins;
|
|
14
|
-
/**
|
|
15
|
-
* Properties to export from `vfile.data`
|
|
16
|
-
*/
|
|
17
|
-
valueToExport?: string[];
|
|
18
|
-
remarkStructureOptions?: plugins.StructureOptions | false;
|
|
19
|
-
remarkHeadingOptions?: plugins.RemarkHeadingOptions;
|
|
20
|
-
remarkImageOptions?: plugins.RemarkImageOptions | false;
|
|
21
|
-
remarkCodeTabOptions?: false;
|
|
22
|
-
rehypeCodeOptions?: plugins.RehypeCodeOptions | false;
|
|
23
|
-
};
|
|
24
|
-
declare function getDefaultMDXOptions({ valueToExport, rehypeCodeOptions, remarkImageOptions, remarkHeadingOptions, remarkStructureOptions, remarkCodeTabOptions, ...mdxOptions }: DefaultMDXOptions): ProcessorOptions;
|
|
25
|
-
|
|
26
|
-
interface GlobalConfig {
|
|
27
|
-
/**
|
|
28
|
-
* Configure global MDX options
|
|
29
|
-
*/
|
|
30
|
-
mdxOptions?: DefaultMDXOptions | (() => DefaultMDXOptions | Promise<DefaultMDXOptions>);
|
|
31
|
-
/**
|
|
32
|
-
* Fetch last modified time with specified version control
|
|
33
|
-
* @defaultValue 'none'
|
|
34
|
-
*/
|
|
35
|
-
lastModifiedTime?: 'git' | 'none';
|
|
36
|
-
/**
|
|
37
|
-
* Generate manifest file on build mode
|
|
38
|
-
*
|
|
39
|
-
* @defaultValue false
|
|
40
|
-
* @deprecated No longer needed, use a route handler to export build time info
|
|
41
|
-
*/
|
|
42
|
-
generateManifest?: boolean;
|
|
43
|
-
}
|
|
44
|
-
type InferSchema<CollectionOut> = CollectionOut extends {
|
|
45
|
-
_type: {
|
|
46
|
-
schema: infer T;
|
|
47
|
-
};
|
|
48
|
-
} ? T : never;
|
|
49
|
-
type InferSchemaType<C> = InferSchema<C> extends AnyZodObject ? z.output<InferSchema<C>> : never;
|
|
50
|
-
interface FileInfo {
|
|
51
|
-
path: string;
|
|
52
|
-
absolutePath: string;
|
|
53
|
-
}
|
|
54
|
-
interface MarkdownProps {
|
|
55
|
-
body: FC<MDXProps>;
|
|
56
|
-
structuredData: StructuredData;
|
|
57
|
-
toc: TableOfContents;
|
|
58
|
-
_exports: Record<string, unknown>;
|
|
59
|
-
/**
|
|
60
|
-
* Only available when `lastModifiedTime` is enabled on MDX loader
|
|
61
|
-
*/
|
|
62
|
-
lastModified?: Date;
|
|
63
|
-
}
|
|
64
|
-
type CollectionEntry<CollectionOut extends {
|
|
65
|
-
_type: {
|
|
66
|
-
runtime: unknown;
|
|
67
|
-
};
|
|
68
|
-
}> = CollectionOut['_type']['runtime'];
|
|
69
|
-
interface BaseCollectionEntry {
|
|
70
|
-
_file: FileInfo;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Get output type of collections
|
|
74
|
-
*/
|
|
75
|
-
type GetOutput<C extends {
|
|
76
|
-
_type: {
|
|
77
|
-
runtime: unknown;
|
|
78
|
-
};
|
|
79
|
-
}> = CollectionEntry<C>[];
|
|
80
|
-
|
|
81
|
-
interface MDXOptions extends ProcessorOptions {
|
|
82
|
-
/**
|
|
83
|
-
* Name of collection
|
|
84
|
-
*/
|
|
85
|
-
collection?: string;
|
|
86
|
-
/**
|
|
87
|
-
* Specify a file path for source
|
|
88
|
-
*/
|
|
89
|
-
filePath?: string;
|
|
90
|
-
frontmatter?: Record<string, unknown>;
|
|
91
|
-
/**
|
|
92
|
-
* Custom Vfile data
|
|
93
|
-
*/
|
|
94
|
-
data?: Record<string, unknown>;
|
|
95
|
-
_compiler?: CompilerOptions;
|
|
96
|
-
}
|
|
97
|
-
interface CompilerOptions {
|
|
98
|
-
addDependency: (file: string) => void;
|
|
99
|
-
}
|
|
100
|
-
declare module 'vfile' {
|
|
101
|
-
interface DataMap {
|
|
102
|
-
/**
|
|
103
|
-
* The compiler object from loader
|
|
104
|
-
*/
|
|
105
|
-
_compiler?: CompilerOptions;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
export { type BaseCollectionEntry as B, type CollectionEntry as C, type DefaultMDXOptions as D, type FileInfo as F, type GlobalConfig as G, type InferSchema as I, type MarkdownProps as M, type InferSchemaType as a, type GetOutput as b, type MDXOptions as c, getDefaultMDXOptions as g };
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { z, ZodTypeAny } from 'zod';
|
|
2
|
-
import { ProcessorOptions } from '@mdx-js/mdx';
|
|
3
|
-
import { c as MDXOptions, B as BaseCollectionEntry, M as MarkdownProps, G as GlobalConfig } from './build-mdx-o0kbHSlp.cjs';
|
|
4
|
-
|
|
5
|
-
declare const metaSchema: z.ZodObject<{
|
|
6
|
-
title: z.ZodOptional<z.ZodString>;
|
|
7
|
-
pages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
8
|
-
description: z.ZodOptional<z.ZodString>;
|
|
9
|
-
root: z.ZodOptional<z.ZodBoolean>;
|
|
10
|
-
defaultOpen: z.ZodOptional<z.ZodBoolean>;
|
|
11
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
12
|
-
}, "strip", z.ZodTypeAny, {
|
|
13
|
-
root?: boolean | undefined;
|
|
14
|
-
title?: string | undefined;
|
|
15
|
-
icon?: string | undefined;
|
|
16
|
-
pages?: string[] | undefined;
|
|
17
|
-
description?: string | undefined;
|
|
18
|
-
defaultOpen?: boolean | undefined;
|
|
19
|
-
}, {
|
|
20
|
-
root?: boolean | undefined;
|
|
21
|
-
title?: string | undefined;
|
|
22
|
-
icon?: string | undefined;
|
|
23
|
-
pages?: string[] | undefined;
|
|
24
|
-
description?: string | undefined;
|
|
25
|
-
defaultOpen?: boolean | undefined;
|
|
26
|
-
}>;
|
|
27
|
-
declare const frontmatterSchema: z.ZodObject<{
|
|
28
|
-
title: z.ZodString;
|
|
29
|
-
description: z.ZodOptional<z.ZodString>;
|
|
30
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
31
|
-
full: z.ZodOptional<z.ZodBoolean>;
|
|
32
|
-
_openapi: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
33
|
-
}, "strip", z.ZodTypeAny, {
|
|
34
|
-
title: string;
|
|
35
|
-
icon?: string | undefined;
|
|
36
|
-
description?: string | undefined;
|
|
37
|
-
full?: boolean | undefined;
|
|
38
|
-
_openapi?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
39
|
-
}, {
|
|
40
|
-
title: string;
|
|
41
|
-
icon?: string | undefined;
|
|
42
|
-
description?: string | undefined;
|
|
43
|
-
full?: boolean | undefined;
|
|
44
|
-
_openapi?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
45
|
-
}>;
|
|
46
|
-
|
|
47
|
-
interface TransformContext {
|
|
48
|
-
path: string;
|
|
49
|
-
source: string;
|
|
50
|
-
/**
|
|
51
|
-
* Compile MDX to JavaScript
|
|
52
|
-
*/
|
|
53
|
-
buildMDX: (source: string, options?: ProcessorOptions) => Promise<string>;
|
|
54
|
-
}
|
|
55
|
-
interface BaseCollection<Schema> {
|
|
56
|
-
/**
|
|
57
|
-
* Directories to scan
|
|
58
|
-
*/
|
|
59
|
-
dir: string | string[];
|
|
60
|
-
/**
|
|
61
|
-
* what files to include/exclude (glob patterns)
|
|
62
|
-
*
|
|
63
|
-
* Include all files if not specified
|
|
64
|
-
*/
|
|
65
|
-
files?: string[];
|
|
66
|
-
schema?: Schema | ((ctx: TransformContext) => Schema);
|
|
67
|
-
}
|
|
68
|
-
interface MetaCollection<Schema extends ZodTypeAny = ZodTypeAny> extends BaseCollection<Schema> {
|
|
69
|
-
type: 'meta';
|
|
70
|
-
}
|
|
71
|
-
interface DocCollection<Schema extends ZodTypeAny = ZodTypeAny, Async extends boolean = boolean> extends BaseCollection<Schema> {
|
|
72
|
-
type: 'doc';
|
|
73
|
-
mdxOptions?: MDXOptions;
|
|
74
|
-
/**
|
|
75
|
-
* Load files with async
|
|
76
|
-
*/
|
|
77
|
-
async?: Async;
|
|
78
|
-
}
|
|
79
|
-
declare function defineCollections<T extends 'doc' | 'meta', Schema extends ZodTypeAny = ZodTypeAny, Async extends boolean = false>(options: {
|
|
80
|
-
type: T;
|
|
81
|
-
} & (T extends 'doc' ? DocCollection<Schema, Async> : MetaCollection<Schema>)): {
|
|
82
|
-
_doc: 'collections';
|
|
83
|
-
type: T;
|
|
84
|
-
_type: {
|
|
85
|
-
async: Async;
|
|
86
|
-
runtime: T extends 'doc' ? Async extends true ? z.infer<Schema> & BaseCollectionEntry & {
|
|
87
|
-
load: () => Promise<MarkdownProps>;
|
|
88
|
-
} : Omit<MarkdownProps, keyof z.infer<Schema>> & z.infer<Schema> & BaseCollectionEntry : typeof options extends MetaCollection ? z.infer<Schema> & BaseCollectionEntry : never;
|
|
89
|
-
};
|
|
90
|
-
};
|
|
91
|
-
declare function defineDocs<DocData extends ZodTypeAny = typeof frontmatterSchema, MetaData extends ZodTypeAny = typeof metaSchema, DocAsync extends boolean = false>(options?: {
|
|
92
|
-
/**
|
|
93
|
-
* The directory to scan files
|
|
94
|
-
*
|
|
95
|
-
* @defaultValue 'content/docs'
|
|
96
|
-
*/
|
|
97
|
-
dir?: string | string[];
|
|
98
|
-
docs?: Partial<DocCollection<DocData, DocAsync>>;
|
|
99
|
-
meta?: Partial<MetaCollection<MetaData>>;
|
|
100
|
-
}): {
|
|
101
|
-
docs: ReturnType<typeof defineCollections<'doc', DocData, DocAsync>>;
|
|
102
|
-
meta: ReturnType<typeof defineCollections<'meta', MetaData, false>>;
|
|
103
|
-
};
|
|
104
|
-
declare function defineConfig(config?: GlobalConfig): GlobalConfig;
|
|
105
|
-
|
|
106
|
-
export { type BaseCollection as B, type DocCollection as D, type MetaCollection as M, type TransformContext as T, defineDocs as a, defineConfig as b, defineCollections as d, frontmatterSchema as f, metaSchema as m };
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { z, ZodTypeAny } from 'zod';
|
|
2
|
-
import { ProcessorOptions } from '@mdx-js/mdx';
|
|
3
|
-
import { c as MDXOptions, B as BaseCollectionEntry, M as MarkdownProps, G as GlobalConfig } from './build-mdx-o0kbHSlp.js';
|
|
4
|
-
|
|
5
|
-
declare const metaSchema: z.ZodObject<{
|
|
6
|
-
title: z.ZodOptional<z.ZodString>;
|
|
7
|
-
pages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
8
|
-
description: z.ZodOptional<z.ZodString>;
|
|
9
|
-
root: z.ZodOptional<z.ZodBoolean>;
|
|
10
|
-
defaultOpen: z.ZodOptional<z.ZodBoolean>;
|
|
11
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
12
|
-
}, "strip", z.ZodTypeAny, {
|
|
13
|
-
root?: boolean | undefined;
|
|
14
|
-
title?: string | undefined;
|
|
15
|
-
icon?: string | undefined;
|
|
16
|
-
pages?: string[] | undefined;
|
|
17
|
-
description?: string | undefined;
|
|
18
|
-
defaultOpen?: boolean | undefined;
|
|
19
|
-
}, {
|
|
20
|
-
root?: boolean | undefined;
|
|
21
|
-
title?: string | undefined;
|
|
22
|
-
icon?: string | undefined;
|
|
23
|
-
pages?: string[] | undefined;
|
|
24
|
-
description?: string | undefined;
|
|
25
|
-
defaultOpen?: boolean | undefined;
|
|
26
|
-
}>;
|
|
27
|
-
declare const frontmatterSchema: z.ZodObject<{
|
|
28
|
-
title: z.ZodString;
|
|
29
|
-
description: z.ZodOptional<z.ZodString>;
|
|
30
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
31
|
-
full: z.ZodOptional<z.ZodBoolean>;
|
|
32
|
-
_openapi: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
33
|
-
}, "strip", z.ZodTypeAny, {
|
|
34
|
-
title: string;
|
|
35
|
-
icon?: string | undefined;
|
|
36
|
-
description?: string | undefined;
|
|
37
|
-
full?: boolean | undefined;
|
|
38
|
-
_openapi?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
39
|
-
}, {
|
|
40
|
-
title: string;
|
|
41
|
-
icon?: string | undefined;
|
|
42
|
-
description?: string | undefined;
|
|
43
|
-
full?: boolean | undefined;
|
|
44
|
-
_openapi?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
45
|
-
}>;
|
|
46
|
-
|
|
47
|
-
interface TransformContext {
|
|
48
|
-
path: string;
|
|
49
|
-
source: string;
|
|
50
|
-
/**
|
|
51
|
-
* Compile MDX to JavaScript
|
|
52
|
-
*/
|
|
53
|
-
buildMDX: (source: string, options?: ProcessorOptions) => Promise<string>;
|
|
54
|
-
}
|
|
55
|
-
interface BaseCollection<Schema> {
|
|
56
|
-
/**
|
|
57
|
-
* Directories to scan
|
|
58
|
-
*/
|
|
59
|
-
dir: string | string[];
|
|
60
|
-
/**
|
|
61
|
-
* what files to include/exclude (glob patterns)
|
|
62
|
-
*
|
|
63
|
-
* Include all files if not specified
|
|
64
|
-
*/
|
|
65
|
-
files?: string[];
|
|
66
|
-
schema?: Schema | ((ctx: TransformContext) => Schema);
|
|
67
|
-
}
|
|
68
|
-
interface MetaCollection<Schema extends ZodTypeAny = ZodTypeAny> extends BaseCollection<Schema> {
|
|
69
|
-
type: 'meta';
|
|
70
|
-
}
|
|
71
|
-
interface DocCollection<Schema extends ZodTypeAny = ZodTypeAny, Async extends boolean = boolean> extends BaseCollection<Schema> {
|
|
72
|
-
type: 'doc';
|
|
73
|
-
mdxOptions?: MDXOptions;
|
|
74
|
-
/**
|
|
75
|
-
* Load files with async
|
|
76
|
-
*/
|
|
77
|
-
async?: Async;
|
|
78
|
-
}
|
|
79
|
-
declare function defineCollections<T extends 'doc' | 'meta', Schema extends ZodTypeAny = ZodTypeAny, Async extends boolean = false>(options: {
|
|
80
|
-
type: T;
|
|
81
|
-
} & (T extends 'doc' ? DocCollection<Schema, Async> : MetaCollection<Schema>)): {
|
|
82
|
-
_doc: 'collections';
|
|
83
|
-
type: T;
|
|
84
|
-
_type: {
|
|
85
|
-
async: Async;
|
|
86
|
-
runtime: T extends 'doc' ? Async extends true ? z.infer<Schema> & BaseCollectionEntry & {
|
|
87
|
-
load: () => Promise<MarkdownProps>;
|
|
88
|
-
} : Omit<MarkdownProps, keyof z.infer<Schema>> & z.infer<Schema> & BaseCollectionEntry : typeof options extends MetaCollection ? z.infer<Schema> & BaseCollectionEntry : never;
|
|
89
|
-
};
|
|
90
|
-
};
|
|
91
|
-
declare function defineDocs<DocData extends ZodTypeAny = typeof frontmatterSchema, MetaData extends ZodTypeAny = typeof metaSchema, DocAsync extends boolean = false>(options?: {
|
|
92
|
-
/**
|
|
93
|
-
* The directory to scan files
|
|
94
|
-
*
|
|
95
|
-
* @defaultValue 'content/docs'
|
|
96
|
-
*/
|
|
97
|
-
dir?: string | string[];
|
|
98
|
-
docs?: Partial<DocCollection<DocData, DocAsync>>;
|
|
99
|
-
meta?: Partial<MetaCollection<MetaData>>;
|
|
100
|
-
}): {
|
|
101
|
-
docs: ReturnType<typeof defineCollections<'doc', DocData, DocAsync>>;
|
|
102
|
-
meta: ReturnType<typeof defineCollections<'meta', MetaData, false>>;
|
|
103
|
-
};
|
|
104
|
-
declare function defineConfig(config?: GlobalConfig): GlobalConfig;
|
|
105
|
-
|
|
106
|
-
export { type BaseCollection as B, type DocCollection as D, type MetaCollection as M, type TransformContext as T, defineDocs as a, defineConfig as b, defineCollections as d, frontmatterSchema as f, metaSchema as m };
|