fumadocs-mdx 14.0.0 → 14.0.2

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 (77) hide show
  1. package/dist/{build-mdx-6UAK5FF5.js → build-mdx-W3233QBZ.js} +1 -1
  2. package/dist/bun/index.d.ts +7 -1
  3. package/dist/bun/index.js +9 -8
  4. package/dist/{chunk-5YXP7JLN.js → chunk-5OBUOALK.js} +8 -5
  5. package/dist/{chunk-ZY6UZ7NH.js → chunk-6RPNS75C.js} +1 -1
  6. package/dist/{chunk-XHJCLBZ4.js → chunk-ED3ON275.js} +86 -162
  7. package/dist/{chunk-7L2KNF6B.js → chunk-GB4W3YCZ.js} +51 -7
  8. package/dist/{chunk-SLY7WXTX.js → chunk-KOPLIEVQ.js} +5 -6
  9. package/dist/{chunk-OXSRIWQW.js → chunk-LPX7ZO66.js} +4 -3
  10. package/dist/{chunk-SRSRFOVI.js → chunk-OLL7FM7W.js} +3 -3
  11. package/dist/{chunk-5UMZCWKV.js → chunk-Q5OSGLJL.js} +1 -1
  12. package/dist/{chunk-E5DJTSIM.js → chunk-S7KOJHHO.js} +4 -1
  13. package/dist/{chunk-6NISOLQ6.js → chunk-USWQVJWR.js} +1 -1
  14. package/dist/chunk-WBIHDYMN.js +126 -0
  15. package/dist/config/index.d.ts +6 -1
  16. package/dist/config/index.js +1 -1
  17. package/dist/{index-D7JdSMpp.d.cts → core-C3QZSdEx.d.ts} +73 -4
  18. package/dist/{index-BlVBvy-z.d.ts → index-RVIZxMZG.d.ts} +1 -1
  19. package/dist/index.d.ts +56 -3
  20. package/dist/load-from-file-OZ5N7DXU.js +8 -0
  21. package/dist/next/index.cjs +263 -193
  22. package/dist/next/index.d.ts +7 -2
  23. package/dist/next/index.js +12 -10
  24. package/dist/node/loader.js +4 -4
  25. package/dist/plugins/index-file.d.ts +7 -22
  26. package/dist/plugins/index-file.js +2 -2
  27. package/dist/plugins/json-schema.d.ts +7 -1
  28. package/dist/plugins/last-modified.d.ts +15 -2
  29. package/dist/plugins/last-modified.js +43 -6
  30. package/dist/runtime/browser.d.ts +22 -19
  31. package/dist/runtime/browser.js +5 -6
  32. package/dist/runtime/dynamic.d.ts +12 -12
  33. package/dist/runtime/dynamic.js +12 -11
  34. package/dist/runtime/server.d.ts +10 -157
  35. package/dist/runtime/server.js +3 -3
  36. package/dist/runtime/types.d.ts +61 -0
  37. package/dist/runtime/types.js +0 -0
  38. package/dist/vite/index.d.ts +7 -2
  39. package/dist/vite/index.js +10 -9
  40. package/dist/webpack/mdx.d.ts +8 -2
  41. package/dist/webpack/mdx.js +5 -5
  42. package/dist/webpack/meta.d.ts +8 -2
  43. package/dist/webpack/meta.js +4 -4
  44. package/package.json +4 -6
  45. package/dist/bin.cjs +0 -1889
  46. package/dist/bin.d.cts +0 -1
  47. package/dist/bun/index.cjs +0 -1112
  48. package/dist/bun/index.d.cts +0 -19
  49. package/dist/chunk-PKI7ZDA5.js +0 -29
  50. package/dist/config/index.cjs +0 -400
  51. package/dist/config/index.d.cts +0 -13
  52. package/dist/index-D7JdSMpp.d.ts +0 -272
  53. package/dist/index-P2NNUkHn.d.cts +0 -8
  54. package/dist/index.cjs +0 -18
  55. package/dist/index.d.cts +0 -8
  56. package/dist/load-from-file-I3ALLIVB.js +0 -8
  57. package/dist/next/index.d.cts +0 -28
  58. package/dist/node/loader.cjs +0 -1165
  59. package/dist/node/loader.d.cts +0 -5
  60. package/dist/plugins/index-file.cjs +0 -471
  61. package/dist/plugins/index-file.d.cts +0 -29
  62. package/dist/plugins/json-schema.cjs +0 -114
  63. package/dist/plugins/json-schema.d.cts +0 -25
  64. package/dist/plugins/last-modified.cjs +0 -75
  65. package/dist/plugins/last-modified.d.cts +0 -27
  66. package/dist/runtime/browser.cjs +0 -94
  67. package/dist/runtime/browser.d.cts +0 -50
  68. package/dist/runtime/dynamic.cjs +0 -985
  69. package/dist/runtime/dynamic.d.cts +0 -27
  70. package/dist/runtime/server.cjs +0 -173
  71. package/dist/runtime/server.d.cts +0 -161
  72. package/dist/vite/index.cjs +0 -1620
  73. package/dist/vite/index.d.cts +0 -39
  74. package/dist/webpack/mdx.cjs +0 -1089
  75. package/dist/webpack/mdx.d.cts +0 -14
  76. package/dist/webpack/meta.cjs +0 -649
  77. package/dist/webpack/meta.d.cts +0 -14
@@ -0,0 +1,61 @@
1
+ import { StructuredData } from 'fumadocs-core/mdx-plugins/remark-structure';
2
+ import { TOCItemType } from 'fumadocs-core/toc';
3
+ import { Root } from 'mdast';
4
+ import { MDXContent } from 'mdx/types';
5
+
6
+ interface DocData {
7
+ /**
8
+ * Compiled MDX content (as component)
9
+ */
10
+ body: MDXContent;
11
+ /**
12
+ * table of contents generated from content.
13
+ */
14
+ toc: TOCItemType[];
15
+ /**
16
+ * structured data for document search indexing.
17
+ */
18
+ structuredData: StructuredData;
19
+ /**
20
+ * Raw exports from the compiled MDX file.
21
+ */
22
+ _exports: Record<string, unknown>;
23
+ }
24
+ interface FileInfo {
25
+ /**
26
+ * virtualized path for Source API
27
+ */
28
+ path: string;
29
+ /**
30
+ * the file path in file system
31
+ */
32
+ fullPath: string;
33
+ }
34
+ interface DocMethods {
35
+ /**
36
+ * file info
37
+ */
38
+ info: FileInfo;
39
+ /**
40
+ * get document as text.
41
+ *
42
+ * - `type: raw` - read the original content from file system.
43
+ * - `type: processed` - get the processed Markdown content, only available when `includeProcessedMarkdown` is enabled on collection config.
44
+ */
45
+ getText: (type: 'raw' | 'processed') => Promise<string>;
46
+ getMDAST: () => Promise<Root>;
47
+ }
48
+ interface MetaMethods {
49
+ /**
50
+ * file info
51
+ */
52
+ info: FileInfo;
53
+ }
54
+ interface InternalTypeConfig {
55
+ /**
56
+ * collection name -> collection properties
57
+ */
58
+ DocData: Record<string, unknown>;
59
+ }
60
+
61
+ export type { DocData, DocMethods, FileInfo, InternalTypeConfig, MetaMethods };
File without changes
@@ -1,6 +1,5 @@
1
1
  import { Plugin } from 'vite';
2
- import { IndexFilePluginOptions } from '../plugins/index-file.js';
3
- import '../index-D7JdSMpp.js';
2
+ import { I as IndexFilePluginOptions } from '../core-C3QZSdEx.js';
4
3
  import '@mdx-js/mdx';
5
4
  import '@standard-schema/spec';
6
5
  import 'unified';
@@ -8,6 +7,12 @@ import 'fumadocs-core/mdx-plugins';
8
7
  import 'zod';
9
8
  import 'chokidar';
10
9
  import 'vfile';
10
+ import 'fumadocs-core/source';
11
+ import '../runtime/types.js';
12
+ import 'fumadocs-core/mdx-plugins/remark-structure';
13
+ import 'fumadocs-core/toc';
14
+ import 'mdast';
15
+ import 'mdx/types';
11
16
 
12
17
  interface PluginOptions {
13
18
  /**
@@ -1,27 +1,27 @@
1
1
  import {
2
2
  buildConfig
3
- } from "../chunk-ZY6UZ7NH.js";
4
- import "../chunk-E5DJTSIM.js";
3
+ } from "../chunk-6RPNS75C.js";
4
+ import "../chunk-S7KOJHHO.js";
5
5
  import {
6
6
  createMdxLoader
7
- } from "../chunk-6NISOLQ6.js";
7
+ } from "../chunk-USWQVJWR.js";
8
8
  import {
9
9
  createMetaLoader
10
10
  } from "../chunk-TYJDYTKH.js";
11
11
  import {
12
12
  createIntegratedConfigLoader,
13
13
  toVite
14
- } from "../chunk-SRSRFOVI.js";
14
+ } from "../chunk-OLL7FM7W.js";
15
15
  import "../chunk-4JSFLXXT.js";
16
16
  import {
17
17
  ValidationError,
18
18
  _Defaults,
19
19
  createCore
20
- } from "../chunk-7L2KNF6B.js";
20
+ } from "../chunk-GB4W3YCZ.js";
21
21
  import {
22
22
  indexFile
23
- } from "../chunk-XHJCLBZ4.js";
24
- import "../chunk-PKI7ZDA5.js";
23
+ } from "../chunk-ED3ON275.js";
24
+ import "../chunk-WBIHDYMN.js";
25
25
  import "../chunk-VWJKRQZR.js";
26
26
 
27
27
  // src/vite/index.ts
@@ -29,7 +29,8 @@ import { mergeConfig } from "vite";
29
29
  var FumadocsDeps = ["fumadocs-core", "fumadocs-ui", "fumadocs-openapi"];
30
30
  async function mdx(config, pluginOptions = {}) {
31
31
  const options = applyDefaults(pluginOptions);
32
- const core = await createViteCore(options).init({
32
+ const core = createViteCore(options);
33
+ await core.init({
33
34
  config: buildConfig(config)
34
35
  });
35
36
  const configLoader = createIntegratedConfigLoader(core);
@@ -82,7 +83,7 @@ async function mdx(config, pluginOptions = {}) {
82
83
  };
83
84
  }
84
85
  async function postInstall(pluginOptions = {}) {
85
- const { loadConfig } = await import("../load-from-file-I3ALLIVB.js");
86
+ const { loadConfig } = await import("../load-from-file-OZ5N7DXU.js");
86
87
  const core = createViteCore(applyDefaults(pluginOptions));
87
88
  await core.init({
88
89
  config: loadConfig(core, true)
@@ -1,6 +1,6 @@
1
1
  import { LoaderContext } from 'webpack';
2
- import { W as WebpackLoaderOptions } from '../index-BlVBvy-z.js';
3
- import '../index-D7JdSMpp.js';
2
+ import { W as WebpackLoaderOptions } from '../index-RVIZxMZG.js';
3
+ import '../core-C3QZSdEx.js';
4
4
  import '@mdx-js/mdx';
5
5
  import '@standard-schema/spec';
6
6
  import 'unified';
@@ -8,6 +8,12 @@ import 'fumadocs-core/mdx-plugins';
8
8
  import 'zod';
9
9
  import 'chokidar';
10
10
  import 'vfile';
11
+ import 'fumadocs-core/source';
12
+ import '../runtime/types.js';
13
+ import 'fumadocs-core/mdx-plugins/remark-structure';
14
+ import 'fumadocs-core/toc';
15
+ import 'mdast';
16
+ import 'mdx/types';
11
17
 
12
18
  declare function loader(this: LoaderContext<WebpackLoaderOptions>, source: string, callback: LoaderContext<WebpackLoaderOptions>['callback']): Promise<void>;
13
19
 
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  getCore
3
- } from "../chunk-5UMZCWKV.js";
3
+ } from "../chunk-Q5OSGLJL.js";
4
4
  import {
5
5
  createMdxLoader
6
- } from "../chunk-6NISOLQ6.js";
6
+ } from "../chunk-USWQVJWR.js";
7
7
  import {
8
8
  createStandaloneConfigLoader,
9
9
  toWebpack
10
- } from "../chunk-SRSRFOVI.js";
10
+ } from "../chunk-OLL7FM7W.js";
11
11
  import "../chunk-4JSFLXXT.js";
12
- import "../chunk-7L2KNF6B.js";
13
- import "../chunk-PKI7ZDA5.js";
12
+ import "../chunk-GB4W3YCZ.js";
13
+ import "../chunk-WBIHDYMN.js";
14
14
  import "../chunk-VWJKRQZR.js";
15
15
 
16
16
  // src/webpack/mdx.ts
@@ -1,6 +1,6 @@
1
1
  import { LoaderContext } from 'webpack';
2
- import { W as WebpackLoaderOptions } from '../index-BlVBvy-z.js';
3
- import '../index-D7JdSMpp.js';
2
+ import { W as WebpackLoaderOptions } from '../index-RVIZxMZG.js';
3
+ import '../core-C3QZSdEx.js';
4
4
  import '@mdx-js/mdx';
5
5
  import '@standard-schema/spec';
6
6
  import 'unified';
@@ -8,6 +8,12 @@ import 'fumadocs-core/mdx-plugins';
8
8
  import 'zod';
9
9
  import 'chokidar';
10
10
  import 'vfile';
11
+ import 'fumadocs-core/source';
12
+ import '../runtime/types.js';
13
+ import 'fumadocs-core/mdx-plugins/remark-structure';
14
+ import 'fumadocs-core/toc';
15
+ import 'mdast';
16
+ import 'mdx/types';
11
17
 
12
18
  declare function loader(this: LoaderContext<WebpackLoaderOptions>, source: string, callback: LoaderContext<WebpackLoaderOptions>['callback']): Promise<void>;
13
19
 
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  getCore
3
- } from "../chunk-5UMZCWKV.js";
3
+ } from "../chunk-Q5OSGLJL.js";
4
4
  import {
5
5
  createMetaLoader
6
6
  } from "../chunk-TYJDYTKH.js";
7
7
  import {
8
8
  createStandaloneConfigLoader,
9
9
  toWebpack
10
- } from "../chunk-SRSRFOVI.js";
10
+ } from "../chunk-OLL7FM7W.js";
11
11
  import "../chunk-4JSFLXXT.js";
12
- import "../chunk-7L2KNF6B.js";
13
- import "../chunk-PKI7ZDA5.js";
12
+ import "../chunk-GB4W3YCZ.js";
13
+ import "../chunk-WBIHDYMN.js";
14
14
 
15
15
  // src/webpack/meta.ts
16
16
  var instance;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-mdx",
3
- "version": "14.0.0",
3
+ "version": "14.0.2",
4
4
  "description": "The built-in source for Fumadocs",
5
5
  "keywords": [
6
6
  "NextJs",
@@ -16,8 +16,7 @@
16
16
  "./loader-meta": "./loader-meta.cjs",
17
17
  "./config": {
18
18
  "import": "./dist/config/index.js",
19
- "types": "./dist/config/index.d.ts",
20
- "require": "./dist/config/index.cjs"
19
+ "types": "./dist/config/index.d.ts"
21
20
  },
22
21
  "./next": {
23
22
  "import": "./dist/next/index.js",
@@ -26,8 +25,7 @@
26
25
  },
27
26
  "./vite": {
28
27
  "import": "./dist/vite/index.js",
29
- "types": "./dist/vite/index.d.ts",
30
- "require": "./dist/vite/index.cjs"
28
+ "types": "./dist/vite/index.d.ts"
31
29
  },
32
30
  ".": {
33
31
  "import": "./dist/index.js",
@@ -99,7 +97,7 @@
99
97
  "webpack": "^5.102.1",
100
98
  "@fumadocs/mdx-remote": "1.4.3",
101
99
  "eslint-config-custom": "0.0.0",
102
- "fumadocs-core": "16.0.12",
100
+ "fumadocs-core": "16.0.14",
103
101
  "tsconfig": "0.0.0"
104
102
  },
105
103
  "peerDependencies": {