fumadocs-mdx 11.6.0 → 13.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 (93) hide show
  1. package/dist/bin.cjs +1728 -0
  2. package/dist/bin.d.cts +1 -0
  3. package/dist/bin.d.ts +1 -0
  4. package/dist/bin.js +16 -0
  5. package/dist/build-mdx-CCNr86q6.d.ts +53 -0
  6. package/dist/build-mdx-D-r3_eQL.d.cts +53 -0
  7. package/dist/bun/index.cjs +857 -0
  8. package/dist/bun/index.d.cts +13 -0
  9. package/dist/bun/index.d.ts +13 -0
  10. package/dist/bun/index.js +62 -0
  11. package/dist/chunk-3J3WL7WN.js +160 -0
  12. package/dist/chunk-CXA4JO4Z.js +45 -0
  13. package/dist/chunk-EELYB2XC.js +207 -0
  14. package/dist/chunk-FSZMKRVH.js +80 -0
  15. package/dist/chunk-II3H5ZVZ.js +77 -0
  16. package/dist/chunk-JVZFH6ND.js +40 -0
  17. package/dist/chunk-K5ZLPEIQ.js +207 -0
  18. package/dist/{chunk-VFALQK6O.js → chunk-KILFIBVW.js} +21 -12
  19. package/dist/chunk-NVRDCY6Z.js +30 -0
  20. package/dist/chunk-U4MQ44TS.js +53 -0
  21. package/dist/chunk-VWJKRQZR.js +19 -0
  22. package/dist/chunk-XQ5O7IPO.js +128 -0
  23. package/dist/chunk-XZY2AWJI.js +81 -0
  24. package/dist/chunk-YVCR6FUH.js +82 -0
  25. package/dist/config/index.cjs +232 -128
  26. package/dist/config/index.d.cts +4 -6
  27. package/dist/config/index.d.ts +4 -6
  28. package/dist/config/index.js +26 -19
  29. package/dist/core-B6j6Fxse.d.cts +218 -0
  30. package/dist/core-B6j6Fxse.d.ts +218 -0
  31. package/dist/index.cjs +0 -76
  32. package/dist/index.d.cts +73 -20
  33. package/dist/index.d.ts +73 -20
  34. package/dist/index.js +0 -10
  35. package/dist/load-MNG3CLET.js +7 -0
  36. package/dist/next/index.cjs +567 -314
  37. package/dist/next/index.d.cts +9 -12
  38. package/dist/next/index.d.ts +9 -12
  39. package/dist/next/index.js +238 -211
  40. package/dist/node/loader.cjs +922 -0
  41. package/dist/node/loader.d.cts +5 -0
  42. package/dist/node/loader.d.ts +5 -0
  43. package/dist/node/loader.js +33 -0
  44. package/dist/plugins/json-schema.cjs +162 -0
  45. package/dist/plugins/json-schema.d.cts +24 -0
  46. package/dist/plugins/json-schema.d.ts +24 -0
  47. package/dist/plugins/json-schema.js +78 -0
  48. package/dist/{mdx-options-CAU273O3.js → preset-ZMP6U62C.js} +1 -1
  49. package/dist/runtime/next/async.cjs +715 -0
  50. package/dist/runtime/next/async.d.cts +21 -0
  51. package/dist/runtime/next/async.d.ts +21 -0
  52. package/dist/runtime/next/async.js +89 -0
  53. package/dist/runtime/next/index.cjs +136 -0
  54. package/dist/runtime/next/index.d.cts +33 -0
  55. package/dist/runtime/next/index.d.ts +33 -0
  56. package/dist/runtime/next/index.js +11 -0
  57. package/dist/runtime/vite/browser.cjs +107 -0
  58. package/dist/runtime/vite/browser.d.cts +59 -0
  59. package/dist/runtime/vite/browser.d.ts +59 -0
  60. package/dist/runtime/vite/browser.js +11 -0
  61. package/dist/runtime/vite/server.cjs +243 -0
  62. package/dist/runtime/vite/server.d.cts +30 -0
  63. package/dist/runtime/vite/server.d.ts +30 -0
  64. package/dist/runtime/vite/server.js +111 -0
  65. package/dist/types-AGzTfBmf.d.ts +45 -0
  66. package/dist/types-DKGMoay5.d.cts +45 -0
  67. package/dist/vite/index.cjs +1185 -0
  68. package/dist/vite/index.d.cts +45 -0
  69. package/dist/vite/index.d.ts +45 -0
  70. package/dist/vite/index.js +297 -0
  71. package/dist/webpack/index.cjs +957 -0
  72. package/dist/{loader-mdx.d.cts → webpack/index.d.cts} +3 -6
  73. package/dist/{loader-mdx.d.ts → webpack/index.d.ts} +3 -6
  74. package/dist/webpack/index.js +44 -0
  75. package/loader-mdx.cjs +1 -1
  76. package/package.json +86 -29
  77. package/bin.js +0 -5
  78. package/dist/chunk-2ZOW45YZ.js +0 -63
  79. package/dist/chunk-DRVUBK5B.js +0 -39
  80. package/dist/chunk-HFLDWPJA.js +0 -62
  81. package/dist/chunk-IOENRFUX.js +0 -112
  82. package/dist/chunk-MK7EXW7O.js +0 -75
  83. package/dist/define-BaW0PQDJ.d.cts +0 -201
  84. package/dist/define-BaW0PQDJ.d.ts +0 -201
  85. package/dist/loader-mdx.cjs +0 -527
  86. package/dist/loader-mdx.js +0 -162
  87. package/dist/runtime/async.cjs +0 -269
  88. package/dist/runtime/async.d.cts +0 -18
  89. package/dist/runtime/async.d.ts +0 -18
  90. package/dist/runtime/async.js +0 -73
  91. package/dist/types-BNrQHCj5.d.cts +0 -100
  92. package/dist/types-DEduCvIT.d.ts +0 -100
  93. package/dist/watcher-IAZDSTU7.js +0 -24
package/dist/index.d.ts CHANGED
@@ -1,26 +1,79 @@
1
- import { PageData, MetaData, Source, VirtualFile } from 'fumadocs-core/source';
2
- import { B as BaseCollectionEntry } from './define-BaW0PQDJ.js';
3
- import { R as Runtime } from './types-DEduCvIT.js';
1
+ import { StructuredData } from 'fumadocs-core/mdx-plugins';
2
+ import { TOCItemType } from 'fumadocs-core/toc';
3
+ import { MDXContent } from 'mdx/types';
4
+ import { E as ExtractedReference } from './core-B6j6Fxse.js';
5
+ export { p as Core, C as CoreOptions, j as EmitEntry, n as EmitOptions, i as Plugin, k as PluginContext, l as PluginOption, S as ServerContext, o as createCore } from './core-B6j6Fxse.js';
6
+ import { Root } from 'mdast';
7
+ import { C as CompiledMDXProperties } from './build-mdx-CCNr86q6.js';
8
+ import '@standard-schema/spec';
4
9
  import '@mdx-js/mdx';
5
- import 'mdx/types';
6
- import 'fumadocs-core/mdx-plugins';
7
- import 'fumadocs-core/server';
8
10
  import 'unified';
9
- import 'react';
10
11
  import 'zod';
11
- import '@standard-schema/spec';
12
- import '@fumadocs/mdx-remote';
12
+ import 'chokidar';
13
+ import 'react';
13
14
 
14
- declare const _runtime: Runtime;
15
- declare function createMDXSource<Doc extends PageData & BaseCollectionEntry, Meta extends MetaData & BaseCollectionEntry>(docs: Doc[], meta?: Meta[]): Source<{
16
- pageData: Doc;
17
- metaData: Meta;
18
- }>;
19
- interface ResolveOptions {
20
- docs: BaseCollectionEntry[];
21
- meta: BaseCollectionEntry[];
22
- rootDir?: string;
15
+ interface FileInfo {
16
+ /**
17
+ * virtualized path for Source API
18
+ */
19
+ path: string;
20
+ /**
21
+ * the file path in file system
22
+ */
23
+ fullPath: string;
24
+ }
25
+ interface DocData {
26
+ /**
27
+ * Compiled MDX content (as component)
28
+ */
29
+ body: MDXContent;
30
+ /**
31
+ * table of contents generated from content.
32
+ */
33
+ toc: TOCItemType[];
34
+ /**
35
+ * structured data for document search indexing.
36
+ */
37
+ structuredData: StructuredData;
38
+ /**
39
+ * Raw exports from the compiled MDX file.
40
+ */
41
+ _exports: Record<string, unknown>;
42
+ /**
43
+ * Last modified date of document file, obtained from version control.
44
+ *
45
+ * Only available when `lastModifiedTime` is enabled on global config.
46
+ */
47
+ lastModified?: Date;
48
+ /**
49
+ * extracted references (e.g. hrefs, paths), useful for analyzing relationships between pages.
50
+ */
51
+ extractedReferences?: ExtractedReference[];
52
+ }
53
+ interface DocMethods {
54
+ /**
55
+ * file info
56
+ */
57
+ info: FileInfo;
58
+ /**
59
+ * get document as text.
60
+ *
61
+ * - `type: raw` - read the original content from file system.
62
+ * - `type: processed` - get the processed Markdown content, only available when `includeProcessedMarkdown` is enabled on collection config.
63
+ */
64
+ getText: (type: 'raw' | 'processed') => Promise<string>;
65
+ getMDAST: () => Promise<Root>;
23
66
  }
24
- declare function resolveFiles({ docs, meta }: ResolveOptions): VirtualFile[];
67
+ type MetaCollectionEntry<Data> = Data & {
68
+ /**
69
+ * file info
70
+ */
71
+ info: FileInfo;
72
+ };
73
+ type DocCollectionEntry<Frontmatter> = DocData & DocMethods & Frontmatter;
74
+ type AsyncDocCollectionEntry<Frontmatter> = DocMethods & {
75
+ load: () => Promise<DocData>;
76
+ } & Frontmatter;
77
+ declare function createDocMethods(info: FileInfo, load: () => Promise<CompiledMDXProperties<any>>): DocMethods;
25
78
 
26
- export { _runtime, createMDXSource, resolveFiles };
79
+ export { type AsyncDocCollectionEntry, type DocCollectionEntry, type DocData, type DocMethods, ExtractedReference, type FileInfo, type MetaCollectionEntry, createDocMethods };
package/dist/index.js CHANGED
@@ -1,10 +0,0 @@
1
- import {
2
- _runtime,
3
- createMDXSource,
4
- resolveFiles
5
- } from "./chunk-VFALQK6O.js";
6
- export {
7
- _runtime,
8
- createMDXSource,
9
- resolveFiles
10
- };
@@ -0,0 +1,7 @@
1
+ import {
2
+ loadConfig
3
+ } from "./chunk-JVZFH6ND.js";
4
+ import "./chunk-U4MQ44TS.js";
5
+ export {
6
+ loadConfig
7
+ };