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.
@@ -11,7 +11,7 @@ import {
11
11
  import "../chunk-DRVUBK5B.js";
12
12
  import {
13
13
  fumaMatter
14
- } from "../chunk-MXACIHNJ.js";
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, outputPath, configHash) {
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, outDir),
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, outDir)}?collection=${collectionName}&hash=${configHash}`
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, dir) {
218
+ function toImportPath(file, config) {
216
219
  const ext = path.extname(file);
217
- let importPath = path.relative(
218
- dir,
219
- ext === ".ts" ? file.substring(0, file.length - ext.length) : file
220
- );
221
- if (!path.isAbsolute(importPath) && !importPath.startsWith(".")) {
222
- importPath = `./${importPath}`;
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(configPath, config, outPath, configHash)
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(jsOut, await generateJS(configPath, config, jsOut, hash));
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 {
@@ -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 cache = new import_lru_cache.LRUCache({
48
- max: 200
49
- });
46
+ var regex = /^---\r?\n(.+?)\r?\n---\r?\n/s;
50
47
  function fumaMatter(input) {
51
- if (input === "") {
52
- return { data: {}, content: input, matter: "" };
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
- str = str.slice(open.length);
69
- const len = str.length;
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 cache2 = /* @__PURE__ */ new Map();
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 = cache2.get(path2);
149
+ const cached = cache.get(path2);
171
150
  if (cached) return cached;
172
151
  const content = import_node_fs.default.readFileSync(path2).toString();
173
- cache2.set(path2, content);
152
+ cache.set(path2, content);
174
153
  return content;
175
154
  }
176
155
  };
@@ -1,14 +1,14 @@
1
- import { L as LoadedConfig, a as RuntimeAsync } from '../types-BsJd_P5O.cjs';
2
- import '../define-uoePrCQ_.cjs';
3
- import '@mdx-js/mdx';
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];
@@ -1,14 +1,14 @@
1
- import { L as LoadedConfig, a as RuntimeAsync } from '../types-BYJBKH4G.js';
2
- import '../define-uoePrCQ_.js';
3
- import '@mdx-js/mdx';
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];
@@ -4,11 +4,11 @@ import {
4
4
  } from "../chunk-NUDEC6C5.js";
5
5
  import {
6
6
  remarkInclude
7
- } from "../chunk-KTLWF7GN.js";
7
+ } from "../chunk-AVMO2SRO.js";
8
8
  import {
9
9
  buildConfig
10
10
  } from "../chunk-DRVUBK5B.js";
11
- import "../chunk-MXACIHNJ.js";
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 { D as DocCollection, b as MetaCollection, c as DocsCollection, G as GlobalConfig, F as FileInfo, M as MarkdownProps, B as BaseCollectionEntry } from './define-uoePrCQ_.js';
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 { LoadedConfig as L, Runtime as R, RuntimeAsync as a };
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
- export { type BaseCollectionEntry as B, type CollectionSchema as C, type DocCollection as D, type FileInfo as F, type GlobalConfig as G, type MarkdownProps as M, type BaseCollection as a, type MetaCollection as b, type DocsCollection as c, defineCollections as d, defineDocs as e, frontmatterSchema as f, defineConfig as g, type DefaultMDXOptions as h, getDefaultMDXOptions as i, metaSchema as m };
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
- export { type BaseCollectionEntry as B, type CollectionSchema as C, type DocCollection as D, type FileInfo as F, type GlobalConfig as G, type MarkdownProps as M, type BaseCollection as a, type MetaCollection as b, type DocsCollection as c, defineCollections as d, defineDocs as e, frontmatterSchema as f, defineConfig as g, type DefaultMDXOptions as h, getDefaultMDXOptions as i, metaSchema as m };
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 { D as DocCollection, b as MetaCollection, c as DocsCollection, G as GlobalConfig, F as FileInfo, M as MarkdownProps, B as BaseCollectionEntry } from './define-uoePrCQ_.cjs';
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 { LoadedConfig as L, Runtime as R, RuntimeAsync as a };
94
+ export type { Runtime as R, RuntimeAsync as a };