fumadocs-mdx 11.10.1 → 12.0.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.
Files changed (68) hide show
  1. package/dist/bin.cjs +126 -218
  2. package/dist/bin.js +1 -1
  3. package/dist/{browser-B2G8uAF2.d.cts → browser-D5lvL8vv.d.ts} +51 -4
  4. package/dist/{browser-DrH7tKRi.d.ts → browser-DjWADqp8.d.cts} +51 -4
  5. package/dist/bun/index.cjs +274 -230
  6. package/dist/bun/index.js +8 -8
  7. package/dist/chunk-ADR6R7HM.js +29 -0
  8. package/dist/{chunk-UOOPSLFY.js → chunk-AUOOMFAI.js} +27 -21
  9. package/dist/chunk-FSZMKRVH.js +80 -0
  10. package/dist/{chunk-766EAFX6.js → chunk-LGYVNESJ.js} +2 -36
  11. package/dist/chunk-LMG6UWCL.js +167 -0
  12. package/dist/chunk-QAUWMR5D.js +142 -0
  13. package/dist/{chunk-QJCCVMBJ.js → chunk-SP7CHRTS.js} +17 -47
  14. package/dist/{chunk-QVZ7JH4H.js → chunk-U4MQ44TS.js} +1 -1
  15. package/dist/{chunk-CNKI574E.js → chunk-VXEBLM4X.js} +1 -1
  16. package/dist/chunk-XMFLD5J6.js +30 -0
  17. package/dist/chunk-ZLCSVXCD.js +10 -0
  18. package/dist/{chunk-XXSKWWMB.js → chunk-ZX7TM4AR.js} +4 -2
  19. package/dist/config/index.cjs +97 -148
  20. package/dist/config/index.d.cts +1 -1
  21. package/dist/config/index.d.ts +1 -1
  22. package/dist/config/index.js +48 -9
  23. package/dist/{define-BH4bnHQl.d.ts → define--6HQ1ehX.d.cts} +18 -3
  24. package/dist/{define-BH4bnHQl.d.cts → define--6HQ1ehX.d.ts} +18 -3
  25. package/dist/load-UUXLUBHL.js +9 -0
  26. package/dist/loader-mdx.cjs +336 -305
  27. package/dist/loader-mdx.js +8 -8
  28. package/dist/next/index.cjs +152 -242
  29. package/dist/next/index.js +52 -66
  30. package/dist/node/loader.cjs +274 -243
  31. package/dist/node/loader.js +7 -8
  32. package/dist/postinstall-SCSXM4IM.js +10 -0
  33. package/dist/{mdx-options-T73E4LQB.js → preset-ZMP6U62C.js} +1 -1
  34. package/dist/runtime/next/async.cjs +304 -204
  35. package/dist/runtime/next/async.d.cts +3 -3
  36. package/dist/runtime/next/async.d.ts +3 -3
  37. package/dist/runtime/next/async.js +59 -32
  38. package/dist/runtime/next/index.cjs +32 -21
  39. package/dist/runtime/next/index.d.cts +11 -7
  40. package/dist/runtime/next/index.d.ts +11 -7
  41. package/dist/runtime/next/index.js +2 -1
  42. package/dist/runtime/vite/browser.d.cts +2 -3
  43. package/dist/runtime/vite/browser.d.ts +2 -3
  44. package/dist/runtime/vite/server.cjs +67 -21
  45. package/dist/runtime/vite/server.d.cts +14 -28
  46. package/dist/runtime/vite/server.d.ts +14 -28
  47. package/dist/runtime/vite/server.js +61 -21
  48. package/dist/shared-0QIuV0XZ.d.ts +70 -0
  49. package/dist/shared-CqgMnt9h.d.cts +70 -0
  50. package/dist/{types-DN9KrG7R.d.ts → types-CFlQxTN8.d.ts} +10 -37
  51. package/dist/{types-DT83Ijs6.d.cts → types-DkGjw-Uo.d.cts} +10 -37
  52. package/dist/vite/index.cjs +299 -279
  53. package/dist/vite/index.d.cts +1 -0
  54. package/dist/vite/index.d.ts +1 -0
  55. package/dist/vite/index.js +15 -20
  56. package/dist/{watcher-4NDMOH4R.js → watcher-HGOH3APP.js} +1 -1
  57. package/package.json +16 -16
  58. package/dist/build-mdx-DnC1jKvn.d.cts +0 -46
  59. package/dist/build-mdx-DnC1jKvn.d.ts +0 -46
  60. package/dist/chunk-GBMFGEC7.js +0 -57
  61. package/dist/chunk-QQWCBFFE.js +0 -40
  62. package/dist/chunk-SMSNZ6N5.js +0 -155
  63. package/dist/chunk-SVTXMVLQ.js +0 -139
  64. package/dist/config/zod-3.cjs +0 -422
  65. package/dist/config/zod-3.d.cts +0 -53
  66. package/dist/config/zod-3.d.ts +0 -53
  67. package/dist/config/zod-3.js +0 -40
  68. package/dist/postinstall-XV4WSHZP.js +0 -9
@@ -1,12 +1,12 @@
1
- import { L as LoadedConfig, a as RuntimeAsync } from '../../types-DN9KrG7R.js';
1
+ import { L as LoadedConfig, c as RuntimeAsync } from '../../types-CFlQxTN8.js';
2
2
  import '@standard-schema/spec';
3
3
  import 'fumadocs-core/source';
4
- import '../../define-BH4bnHQl.js';
4
+ import '../../define--6HQ1ehX.js';
5
5
  import 'fumadocs-core/mdx-plugins';
6
6
  import '@mdx-js/mdx';
7
7
  import 'unified';
8
8
  import 'zod';
9
- import '../../build-mdx-DnC1jKvn.js';
9
+ import '../../shared-0QIuV0XZ.js';
10
10
  import 'fumadocs-core/server';
11
11
  import 'react';
12
12
  import 'mdx/types';
@@ -1,54 +1,81 @@
1
1
  import {
2
2
  _runtime,
3
3
  createMDXSource
4
- } from "../../chunk-UOOPSLFY.js";
4
+ } from "../../chunk-AUOOMFAI.js";
5
5
  import {
6
- buildMDX
7
- } from "../../chunk-QQWCBFFE.js";
8
- import "../../chunk-SVTXMVLQ.js";
6
+ missingProcessedMarkdown
7
+ } from "../../chunk-ZLCSVXCD.js";
8
+ import {
9
+ readFileWithCache
10
+ } from "../../chunk-ADR6R7HM.js";
9
11
  import {
10
12
  buildConfig
11
- } from "../../chunk-QVZ7JH4H.js";
12
- import "../../chunk-VWJKRQZR.js";
13
+ } from "../../chunk-U4MQ44TS.js";
14
+ import {
15
+ buildMDX
16
+ } from "../../chunk-QAUWMR5D.js";
17
+ import "../../chunk-LMG6UWCL.js";
18
+ import {
19
+ fumaMatter
20
+ } from "../../chunk-VWJKRQZR.js";
13
21
 
14
22
  // src/runtime/next/async.ts
15
23
  import { executeMdx } from "@fumadocs/mdx-remote/client";
16
24
  import { pathToFileURL } from "url";
17
- async function getOptions(config, collection) {
25
+ function getDocCollection(config, collection) {
18
26
  const col = config.collections.get(collection);
19
- if (col?.type === "doc" && col.mdxOptions) return col.mdxOptions;
20
- if (col?.type === "docs" && col.docs.mdxOptions) return col.docs.mdxOptions;
21
- return config.getDefaultMDXOptions("remote");
27
+ if (col?.type === "doc" && col.mdxOptions) return col;
28
+ if (col?.type === "docs" && col.docs.mdxOptions) return col.docs;
29
+ }
30
+ async function getOptions(config, collection) {
31
+ return collection?.mdxOptions ?? await config.getDefaultMDXOptions("remote");
22
32
  }
23
33
  var _runtimeAsync = {
24
- doc(files, collection, config) {
34
+ doc(files, collectionName, config) {
35
+ const collection = getDocCollection(config, collectionName);
25
36
  const initMdxOptions = getOptions(config, collection);
26
- return files.map(({ info: file, data, content, lastModified }) => {
37
+ return files.map(({ info, data, lastModified }) => {
38
+ let cachedResult;
39
+ async function compileAndLoad() {
40
+ if (cachedResult) return cachedResult;
41
+ const mdxOptions = await initMdxOptions;
42
+ const raw = await readFileWithCache(info.fullPath);
43
+ const { content } = fumaMatter(raw);
44
+ const compiled = await buildMDX(collectionName, content, {
45
+ ...mdxOptions,
46
+ development: false,
47
+ frontmatter: data,
48
+ postprocess: collection?.postprocess,
49
+ data: {
50
+ lastModified
51
+ },
52
+ filePath: info.fullPath
53
+ });
54
+ const result = await executeMdx(String(compiled.value), {
55
+ baseUrl: pathToFileURL(info.fullPath)
56
+ });
57
+ return cachedResult = result;
58
+ }
27
59
  return {
28
60
  ...data,
29
- _file: file,
30
- get content() {
31
- return `${content.matter}${content.body}`;
61
+ info,
62
+ async getText(type) {
63
+ if (type === "raw") {
64
+ return readFileWithCache(info.fullPath);
65
+ }
66
+ const out = await compileAndLoad();
67
+ if (typeof out._markdown !== "string") missingProcessedMarkdown();
68
+ return out._markdown;
32
69
  },
33
70
  async load() {
34
- const mdxOptions = await initMdxOptions;
35
- const out = await buildMDX(collection, content.body, {
36
- ...mdxOptions,
37
- development: false,
38
- frontmatter: data,
39
- data: {
40
- lastModified
41
- },
42
- filePath: file.absolutePath
43
- });
44
- const { default: body, ...rest } = await executeMdx(String(out), {
45
- baseUrl: pathToFileURL(file.absolutePath)
46
- });
71
+ const out = await compileAndLoad();
47
72
  return {
48
- structuredData: out.data.structuredData,
49
- body,
50
- ...rest,
51
- lastModified
73
+ _exports: out,
74
+ body: out.default,
75
+ lastModified,
76
+ toc: out.toc,
77
+ extractedReferences: out.extractedReferences,
78
+ structuredData: out.structuredData
52
79
  };
53
80
  }
54
81
  };
@@ -35,25 +35,36 @@ __export(next_exports, {
35
35
  resolveFiles: () => resolveFiles
36
36
  });
37
37
  module.exports = __toCommonJS(next_exports);
38
- var import_node_fs = __toESM(require("fs"), 1);
39
- var cache = /* @__PURE__ */ new Map();
38
+ var fs = __toESM(require("fs/promises"), 1);
39
+
40
+ // src/runtime/shared.ts
41
+ function missingProcessedMarkdown() {
42
+ throw new Error(
43
+ "getText('processed') requires `includeProcessedMarkdown` to be enabled in your collection config."
44
+ );
45
+ }
46
+
47
+ // src/runtime/next/index.ts
40
48
  var _runtime = {
41
49
  doc(files) {
42
50
  return files.map((file) => {
43
- const { default: body, frontmatter, ...exports2 } = file.data;
51
+ const data = file.data;
52
+ const filePath = file.info.fullPath;
44
53
  return {
45
- body,
46
- ...exports2,
47
- ...frontmatter,
48
- _file: file.info,
49
- _exports: file.data,
50
- get content() {
51
- const path = this._file.absolutePath;
52
- const cached = cache.get(path);
53
- if (cached) return cached;
54
- const content = import_node_fs.default.readFileSync(path).toString();
55
- cache.set(path, content);
56
- return content;
54
+ info: file.info,
55
+ _exports: data,
56
+ body: data.default,
57
+ lastModified: data.lastModified,
58
+ toc: data.toc,
59
+ structuredData: data.structuredData,
60
+ extractedReferences: data.extractedReferences,
61
+ ...data.frontmatter,
62
+ async getText(type) {
63
+ if (type === "raw") {
64
+ return (await fs.readFile(filePath)).toString();
65
+ }
66
+ if (typeof data._markdown !== "string") missingProcessedMarkdown();
67
+ return data._markdown;
57
68
  }
58
69
  };
59
70
  });
@@ -61,8 +72,8 @@ var _runtime = {
61
72
  meta(files) {
62
73
  return files.map((file) => {
63
74
  return {
64
- ...file.data,
65
- _file: file.info
75
+ info: file.info,
76
+ ...file.data
66
77
  };
67
78
  });
68
79
  },
@@ -91,16 +102,16 @@ function resolveFiles({ docs, meta }) {
91
102
  for (const entry of docs) {
92
103
  outputs.push({
93
104
  type: "page",
94
- absolutePath: entry._file.absolutePath,
95
- path: entry._file.path,
105
+ absolutePath: entry.info.fullPath,
106
+ path: entry.info.path,
96
107
  data: entry
97
108
  });
98
109
  }
99
110
  for (const entry of meta) {
100
111
  outputs.push({
101
112
  type: "meta",
102
- absolutePath: entry._file.absolutePath,
103
- path: entry._file.path,
113
+ absolutePath: entry.info.fullPath,
114
+ path: entry.info.path,
104
115
  data: entry
105
116
  });
106
117
  }
@@ -1,26 +1,30 @@
1
1
  import { PageData, MetaData, Source, VirtualFile } from 'fumadocs-core/source';
2
- import { R as Runtime, B as BaseCollectionEntry } from '../../types-DT83Ijs6.cjs';
2
+ import { R as Runtime } from '../../types-DkGjw-Uo.cjs';
3
+ export { b as AsyncDocOut, A as AsyncRuntimeFile, D as DocOut, M as MetaOut, c as RuntimeAsync, a as RuntimeFile } from '../../types-DkGjw-Uo.cjs';
4
+ import { F as FileInfo } from '../../shared-CqgMnt9h.cjs';
3
5
  import '@standard-schema/spec';
4
- import '../../define-BH4bnHQl.cjs';
6
+ import '../../define--6HQ1ehX.cjs';
5
7
  import 'fumadocs-core/mdx-plugins';
6
8
  import '@mdx-js/mdx';
7
9
  import 'unified';
8
10
  import 'zod';
9
- import '../../build-mdx-DnC1jKvn.cjs';
10
11
  import 'fumadocs-core/server';
11
12
  import 'react';
12
13
  import 'mdx/types';
13
14
 
14
15
  declare const _runtime: Runtime;
15
- declare function createMDXSource<Doc extends PageData & BaseCollectionEntry, Meta extends MetaData & BaseCollectionEntry>(docs: Doc[], meta?: Meta[]): Source<{
16
+ interface AnyCollectionEntry {
17
+ info: FileInfo;
18
+ }
19
+ declare function createMDXSource<Doc extends PageData & AnyCollectionEntry, Meta extends MetaData & AnyCollectionEntry>(docs: Doc[], meta?: Meta[]): Source<{
16
20
  pageData: Doc;
17
21
  metaData: Meta;
18
22
  }>;
19
23
  interface ResolveOptions {
20
- docs: BaseCollectionEntry[];
21
- meta: BaseCollectionEntry[];
24
+ docs: AnyCollectionEntry[];
25
+ meta: AnyCollectionEntry[];
22
26
  rootDir?: string;
23
27
  }
24
28
  declare function resolveFiles({ docs, meta }: ResolveOptions): VirtualFile[];
25
29
 
26
- export { _runtime, createMDXSource, resolveFiles };
30
+ export { type AnyCollectionEntry, Runtime, _runtime, createMDXSource, resolveFiles };
@@ -1,26 +1,30 @@
1
1
  import { PageData, MetaData, Source, VirtualFile } from 'fumadocs-core/source';
2
- import { R as Runtime, B as BaseCollectionEntry } from '../../types-DN9KrG7R.js';
2
+ import { R as Runtime } from '../../types-CFlQxTN8.js';
3
+ export { b as AsyncDocOut, A as AsyncRuntimeFile, D as DocOut, M as MetaOut, c as RuntimeAsync, a as RuntimeFile } from '../../types-CFlQxTN8.js';
4
+ import { F as FileInfo } from '../../shared-0QIuV0XZ.js';
3
5
  import '@standard-schema/spec';
4
- import '../../define-BH4bnHQl.js';
6
+ import '../../define--6HQ1ehX.js';
5
7
  import 'fumadocs-core/mdx-plugins';
6
8
  import '@mdx-js/mdx';
7
9
  import 'unified';
8
10
  import 'zod';
9
- import '../../build-mdx-DnC1jKvn.js';
10
11
  import 'fumadocs-core/server';
11
12
  import 'react';
12
13
  import 'mdx/types';
13
14
 
14
15
  declare const _runtime: Runtime;
15
- declare function createMDXSource<Doc extends PageData & BaseCollectionEntry, Meta extends MetaData & BaseCollectionEntry>(docs: Doc[], meta?: Meta[]): Source<{
16
+ interface AnyCollectionEntry {
17
+ info: FileInfo;
18
+ }
19
+ declare function createMDXSource<Doc extends PageData & AnyCollectionEntry, Meta extends MetaData & AnyCollectionEntry>(docs: Doc[], meta?: Meta[]): Source<{
16
20
  pageData: Doc;
17
21
  metaData: Meta;
18
22
  }>;
19
23
  interface ResolveOptions {
20
- docs: BaseCollectionEntry[];
21
- meta: BaseCollectionEntry[];
24
+ docs: AnyCollectionEntry[];
25
+ meta: AnyCollectionEntry[];
22
26
  rootDir?: string;
23
27
  }
24
28
  declare function resolveFiles({ docs, meta }: ResolveOptions): VirtualFile[];
25
29
 
26
- export { _runtime, createMDXSource, resolveFiles };
30
+ export { type AnyCollectionEntry, Runtime, _runtime, createMDXSource, resolveFiles };
@@ -2,7 +2,8 @@ import {
2
2
  _runtime,
3
3
  createMDXSource,
4
4
  resolveFiles
5
- } from "../../chunk-UOOPSLFY.js";
5
+ } from "../../chunk-AUOOMFAI.js";
6
+ import "../../chunk-ZLCSVXCD.js";
6
7
  export {
7
8
  _runtime,
8
9
  createMDXSource,
@@ -1,11 +1,10 @@
1
- export { a as ClientLoader, b as ClientLoaderOptions, c as createClientLoader, f as fromConfig, t as toClientRenderer } from '../../browser-B2G8uAF2.cjs';
1
+ export { C as ClientLoader, a as ClientLoaderOptions, c as createClientLoader, f as fromConfig, t as toClientRenderer } from '../../browser-DjWADqp8.cjs';
2
2
  import 'react';
3
- import '../../build-mdx-DnC1jKvn.cjs';
4
3
  import '@mdx-js/mdx';
5
4
  import 'fumadocs-core/mdx-plugins';
6
5
  import 'fumadocs-core/server';
7
6
  import 'mdx/types';
8
- import '../../define-BH4bnHQl.cjs';
7
+ import '../../define--6HQ1ehX.cjs';
9
8
  import '@standard-schema/spec';
10
9
  import 'unified';
11
10
  import 'zod';
@@ -1,11 +1,10 @@
1
- export { a as ClientLoader, b as ClientLoaderOptions, c as createClientLoader, f as fromConfig, t as toClientRenderer } from '../../browser-DrH7tKRi.js';
1
+ export { C as ClientLoader, a as ClientLoaderOptions, c as createClientLoader, f as fromConfig, t as toClientRenderer } from '../../browser-D5lvL8vv.js';
2
2
  import 'react';
3
- import '../../build-mdx-DnC1jKvn.js';
4
3
  import '@mdx-js/mdx';
5
4
  import 'fumadocs-core/mdx-plugins';
6
5
  import 'fumadocs-core/server';
7
6
  import 'mdx/types';
8
- import '../../define-BH4bnHQl.js';
7
+ import '../../define--6HQ1ehX.js';
9
8
  import '@standard-schema/spec';
10
9
  import 'unified';
11
10
  import 'zod';
@@ -67,6 +67,16 @@ function fromConfigBase() {
67
67
  // src/runtime/vite/server.ts
68
68
  var path = __toESM(require("path"), 1);
69
69
 
70
+ // src/runtime/shared.ts
71
+ function missingProcessedMarkdown() {
72
+ throw new Error(
73
+ "getText('processed') requires `includeProcessedMarkdown` to be enabled in your collection config."
74
+ );
75
+ }
76
+
77
+ // src/runtime/vite/server.ts
78
+ var import_promises = __toESM(require("fs/promises"), 1);
79
+
70
80
  // src/runtime/vite/browser.ts
71
81
  var import_react = require("react");
72
82
  var loaderStore = /* @__PURE__ */ new Map();
@@ -112,45 +122,79 @@ function toClientRenderer(files, component) {
112
122
  // src/runtime/vite/server.ts
113
123
  function fromConfig() {
114
124
  const base = fromConfigBase();
115
- function mapPageData(entry) {
116
- const { toc, structuredData, lastModified, frontmatter } = entry;
125
+ function fileInfo(file, base2) {
126
+ return {
127
+ path: file,
128
+ fullPath: path.join(base2, file)
129
+ };
130
+ }
131
+ function mapDocData(entry) {
117
132
  return {
118
- ...frontmatter,
119
- default: entry.default,
120
133
  body: entry.default,
121
- toc,
122
- structuredData,
123
- lastModified,
134
+ toc: entry.toc,
135
+ extractedReferences: entry.extractedReferences,
136
+ structuredData: entry.structuredData,
137
+ lastModified: entry.lastModified,
124
138
  _exports: entry
125
139
  };
126
140
  }
127
- function mapPageDataLazy(head, content) {
141
+ function mapPageData(info, entry) {
142
+ return {
143
+ ...mapDocData(entry),
144
+ info,
145
+ async getText(type) {
146
+ if (type === "raw") {
147
+ return (await import_promises.default.readFile(info.fullPath)).toString();
148
+ }
149
+ if (typeof entry._markdown !== "string") missingProcessedMarkdown();
150
+ return entry._markdown;
151
+ },
152
+ ...entry.frontmatter
153
+ };
154
+ }
155
+ function mapPageDataLazy(info, head, content) {
128
156
  return {
129
157
  ...head,
158
+ info,
130
159
  async load() {
131
- const { default: body, ...rest } = await content();
132
- return { body, ...rest };
160
+ return mapDocData(await content());
161
+ },
162
+ async getText(type) {
163
+ if (type === "raw") {
164
+ return (await import_promises.default.readFile(info.fullPath)).toString();
165
+ }
166
+ const entry = await content();
167
+ if (typeof entry._markdown !== "string") missingProcessedMarkdown();
168
+ return entry._markdown;
133
169
  }
134
170
  };
135
171
  }
172
+ function mapMetaData(info, content) {
173
+ return {
174
+ info,
175
+ ...content
176
+ };
177
+ }
136
178
  return {
137
179
  ...base,
138
180
  async sourceAsync(doc, meta) {
139
181
  const virtualFiles = [
140
182
  ...Object.entries(doc).map(async ([file, content]) => {
183
+ const info = fileInfo(file, content.base);
141
184
  return {
142
185
  type: "page",
143
186
  path: file,
144
- absolutePath: path.join(content.base, file),
145
- data: mapPageData(await content())
187
+ absolutePath: info.fullPath,
188
+ data: mapPageData(info, await content())
146
189
  };
147
190
  }),
148
191
  ...Object.entries(meta).map(async ([file, content]) => {
192
+ const info = fileInfo(file, content.base);
149
193
  return {
150
194
  type: "meta",
151
- path: file,
152
- absolutePath: path.join(content.base, file),
153
- data: await content()
195
+ path: info.path,
196
+ absolutePath: info.fullPath,
197
+ data: mapMetaData(info, await content())
154
198
  };
155
199
  })
156
200
  ];
@@ -159,19 +203,21 @@ function fromConfig() {
159
203
  async sourceLazy(doc, meta) {
160
204
  const virtualFiles = [
161
205
  ...Object.entries(doc.head).map(async ([file, frontmatter]) => {
206
+ const info = fileInfo(file, doc.base);
162
207
  return {
163
208
  type: "page",
164
- path: file,
165
- absolutePath: path.join(doc.base, file),
166
- data: mapPageDataLazy(await frontmatter(), doc.body[file])
209
+ path: info.path,
210
+ absolutePath: info.fullPath,
211
+ data: mapPageDataLazy(info, await frontmatter(), doc.body[file])
167
212
  };
168
213
  }),
169
214
  ...Object.entries(meta).map(async ([file, content]) => {
215
+ const info = fileInfo(file, content.base);
170
216
  return {
171
217
  type: "meta",
172
- path: file,
173
- absolutePath: path.join(content.base, file),
174
- data: await content()
218
+ path: info.path,
219
+ absolutePath: info.fullPath,
220
+ data: mapMetaData(info, await content())
175
221
  };
176
222
  })
177
223
  ];
@@ -1,41 +1,27 @@
1
- import { B as BaseCreate, D as DocMap, M as MetaMap, L as LazyDocMap, C as CompiledMDXFile } from '../../browser-B2G8uAF2.cjs';
2
- export { a as ClientLoader, b as ClientLoaderOptions, c as createClientLoader, t as toClientRenderer } from '../../browser-B2G8uAF2.cjs';
1
+ import { B as BaseCreate, D as DocMap, M as MetaMap, L as LazyDocMap } from '../../browser-DjWADqp8.cjs';
2
+ export { C as ClientLoader, a as ClientLoaderOptions, b as CompiledMDXFile, c as createClientLoader, t as toClientRenderer } from '../../browser-DjWADqp8.cjs';
3
3
  import { PageData, MetaData, Source } from 'fumadocs-core/source';
4
- import { C as CompiledMDXProperties } from '../../build-mdx-DnC1jKvn.cjs';
5
- import { FC } from 'react';
6
- import { MDXProps } from 'mdx/types';
7
- import '../../define-BH4bnHQl.cjs';
8
- import '@standard-schema/spec';
9
- import 'fumadocs-core/mdx-plugins';
4
+ import { D as DocCollectionEntry, M as MetaCollectionEntry, A as AsyncDocCollectionEntry } from '../../shared-CqgMnt9h.cjs';
10
5
  import '@mdx-js/mdx';
6
+ import 'fumadocs-core/mdx-plugins';
7
+ import 'fumadocs-core/server';
8
+ import 'react';
9
+ import 'mdx/types';
10
+ import '../../define--6HQ1ehX.cjs';
11
+ import '@standard-schema/spec';
11
12
  import 'unified';
12
13
  import 'zod';
13
- import 'fumadocs-core/server';
14
14
 
15
- type Override<A, B> = Omit<A, keyof B> & B;
16
- type MDXFileToPageData<Frontmatter> = Override<Omit<CompiledMDXProperties<Frontmatter>, 'frontmatter' | 'default'>, Frontmatter & {
17
- /**
18
- * @deprecated use `body` instead.
19
- */
20
- default: FC<MDXProps>;
21
- _exports: Record<string, unknown>;
22
- body: FC<MDXProps>;
23
- }>;
24
- type MDXFileToPageDataLazy<Frontmatter> = Override<Frontmatter, {
25
- load: () => Promise<Omit<CompiledMDXFile<Frontmatter>, 'default'> & {
26
- body: FC<MDXProps>;
27
- }>;
28
- }>;
29
15
  interface ServerCreate<Config> extends BaseCreate<Config> {
30
16
  sourceAsync: <DocOut extends PageData, MetaOut extends MetaData>(doc: DocMap<DocOut>, meta: MetaMap<MetaOut>) => Promise<Source<{
31
- pageData: MDXFileToPageData<DocOut>;
32
- metaData: MetaOut;
17
+ pageData: DocCollectionEntry<DocOut>;
18
+ metaData: MetaCollectionEntry<MetaOut>;
33
19
  }>>;
34
20
  sourceLazy: <DocOut extends PageData, MetaOut extends MetaData>(doc: LazyDocMap<DocOut>, meta: MetaMap<MetaOut>) => Promise<Source<{
35
- pageData: MDXFileToPageDataLazy<DocOut>;
36
- metaData: MetaOut;
21
+ pageData: AsyncDocCollectionEntry<DocOut>;
22
+ metaData: MetaCollectionEntry<MetaOut>;
37
23
  }>>;
38
24
  }
39
25
  declare function fromConfig<Config>(): ServerCreate<Config>;
40
26
 
41
- export { CompiledMDXFile, type ServerCreate, fromConfig };
27
+ export { type ServerCreate, fromConfig };
@@ -1,41 +1,27 @@
1
- import { B as BaseCreate, D as DocMap, M as MetaMap, L as LazyDocMap, C as CompiledMDXFile } from '../../browser-DrH7tKRi.js';
2
- export { a as ClientLoader, b as ClientLoaderOptions, c as createClientLoader, t as toClientRenderer } from '../../browser-DrH7tKRi.js';
1
+ import { B as BaseCreate, D as DocMap, M as MetaMap, L as LazyDocMap } from '../../browser-D5lvL8vv.js';
2
+ export { C as ClientLoader, a as ClientLoaderOptions, b as CompiledMDXFile, c as createClientLoader, t as toClientRenderer } from '../../browser-D5lvL8vv.js';
3
3
  import { PageData, MetaData, Source } from 'fumadocs-core/source';
4
- import { C as CompiledMDXProperties } from '../../build-mdx-DnC1jKvn.js';
5
- import { FC } from 'react';
6
- import { MDXProps } from 'mdx/types';
7
- import '../../define-BH4bnHQl.js';
8
- import '@standard-schema/spec';
9
- import 'fumadocs-core/mdx-plugins';
4
+ import { D as DocCollectionEntry, M as MetaCollectionEntry, A as AsyncDocCollectionEntry } from '../../shared-0QIuV0XZ.js';
10
5
  import '@mdx-js/mdx';
6
+ import 'fumadocs-core/mdx-plugins';
7
+ import 'fumadocs-core/server';
8
+ import 'react';
9
+ import 'mdx/types';
10
+ import '../../define--6HQ1ehX.js';
11
+ import '@standard-schema/spec';
11
12
  import 'unified';
12
13
  import 'zod';
13
- import 'fumadocs-core/server';
14
14
 
15
- type Override<A, B> = Omit<A, keyof B> & B;
16
- type MDXFileToPageData<Frontmatter> = Override<Omit<CompiledMDXProperties<Frontmatter>, 'frontmatter' | 'default'>, Frontmatter & {
17
- /**
18
- * @deprecated use `body` instead.
19
- */
20
- default: FC<MDXProps>;
21
- _exports: Record<string, unknown>;
22
- body: FC<MDXProps>;
23
- }>;
24
- type MDXFileToPageDataLazy<Frontmatter> = Override<Frontmatter, {
25
- load: () => Promise<Omit<CompiledMDXFile<Frontmatter>, 'default'> & {
26
- body: FC<MDXProps>;
27
- }>;
28
- }>;
29
15
  interface ServerCreate<Config> extends BaseCreate<Config> {
30
16
  sourceAsync: <DocOut extends PageData, MetaOut extends MetaData>(doc: DocMap<DocOut>, meta: MetaMap<MetaOut>) => Promise<Source<{
31
- pageData: MDXFileToPageData<DocOut>;
32
- metaData: MetaOut;
17
+ pageData: DocCollectionEntry<DocOut>;
18
+ metaData: MetaCollectionEntry<MetaOut>;
33
19
  }>>;
34
20
  sourceLazy: <DocOut extends PageData, MetaOut extends MetaData>(doc: LazyDocMap<DocOut>, meta: MetaMap<MetaOut>) => Promise<Source<{
35
- pageData: MDXFileToPageDataLazy<DocOut>;
36
- metaData: MetaOut;
21
+ pageData: AsyncDocCollectionEntry<DocOut>;
22
+ metaData: MetaCollectionEntry<MetaOut>;
37
23
  }>>;
38
24
  }
39
25
  declare function fromConfig<Config>(): ServerCreate<Config>;
40
26
 
41
- export { CompiledMDXFile, type ServerCreate, fromConfig };
27
+ export { type ServerCreate, fromConfig };