fumadocs-mdx 14.2.3 → 14.2.4

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 (116) hide show
  1. package/dist/adapter-DG-viEbG.js +144 -0
  2. package/dist/adapter-DG-viEbG.js.map +1 -0
  3. package/dist/bin.d.ts +1 -1
  4. package/dist/bin.js +21 -12
  5. package/dist/bin.js.map +1 -0
  6. package/dist/build-BTTNEFmV.js +100 -0
  7. package/dist/build-BTTNEFmV.js.map +1 -0
  8. package/dist/build-mdx-10MrLupc.d.ts +53 -0
  9. package/dist/build-mdx-10MrLupc.d.ts.map +1 -0
  10. package/dist/build-mdx-BVeBo4jT.js +153 -0
  11. package/dist/build-mdx-BVeBo4jT.js.map +1 -0
  12. package/dist/build-mdx-ChjP7zAn.js +5 -0
  13. package/dist/bun/index.d.ts +10 -21
  14. package/dist/bun/index.d.ts.map +1 -0
  15. package/dist/bun/index.js +30 -49
  16. package/dist/bun/index.js.map +1 -0
  17. package/dist/codegen-DleOVLNr.js +101 -0
  18. package/dist/codegen-DleOVLNr.js.map +1 -0
  19. package/dist/config/index.d.ts +2 -18
  20. package/dist/config/index.js +50 -53
  21. package/dist/config/index.js.map +1 -0
  22. package/dist/core-DG43f_AU.d.ts +364 -0
  23. package/dist/core-DG43f_AU.d.ts.map +1 -0
  24. package/dist/core-DjldE3H9.js +212 -0
  25. package/dist/core-DjldE3H9.js.map +1 -0
  26. package/dist/fuma-matter-CHgJa_-B.js +27 -0
  27. package/dist/fuma-matter-CHgJa_-B.js.map +1 -0
  28. package/dist/index-Bc_4I1HE.d.ts +12 -0
  29. package/dist/index-Bc_4I1HE.d.ts.map +1 -0
  30. package/dist/index-file-D9HsrWU_.js +264 -0
  31. package/dist/index-file-D9HsrWU_.js.map +1 -0
  32. package/dist/index.d.ts +3 -61
  33. package/dist/index.js +1 -0
  34. package/dist/load-from-file-B7Rswy9i.js +5 -0
  35. package/dist/load-from-file-Doc98oEB.js +38 -0
  36. package/dist/load-from-file-Doc98oEB.js.map +1 -0
  37. package/dist/loaders-BVwYfelL.js +7 -0
  38. package/dist/loaders-BVwYfelL.js.map +1 -0
  39. package/dist/mdx-DMZ9tsAa.js +91 -0
  40. package/dist/mdx-DMZ9tsAa.js.map +1 -0
  41. package/dist/meta-DyieTM4Z.js +81 -0
  42. package/dist/meta-DyieTM4Z.js.map +1 -0
  43. package/dist/next/index.cjs +863 -1076
  44. package/dist/next/index.d.ts +17 -28
  45. package/dist/next/index.d.ts.map +1 -0
  46. package/dist/next/index.js +141 -170
  47. package/dist/next/index.js.map +1 -0
  48. package/dist/node/loader.d.ts +4 -2
  49. package/dist/node/loader.d.ts.map +1 -0
  50. package/dist/node/loader.js +26 -38
  51. package/dist/node/loader.js.map +1 -0
  52. package/dist/plugins/index-file.d.ts +2 -14
  53. package/dist/plugins/index-file.js +5 -8
  54. package/dist/plugins/json-schema.d.ts +14 -23
  55. package/dist/plugins/json-schema.d.ts.map +1 -0
  56. package/dist/plugins/json-schema.js +70 -78
  57. package/dist/plugins/json-schema.js.map +1 -0
  58. package/dist/plugins/last-modified.d.ts +21 -32
  59. package/dist/plugins/last-modified.d.ts.map +1 -0
  60. package/dist/plugins/last-modified.js +70 -78
  61. package/dist/plugins/last-modified.js.map +1 -0
  62. package/dist/preset-gmDZnBcg.js +61 -0
  63. package/dist/preset-gmDZnBcg.js.map +1 -0
  64. package/dist/remark-include-D3G3mAnv.js +247 -0
  65. package/dist/remark-include-D3G3mAnv.js.map +1 -0
  66. package/dist/runtime/browser.d.ts +32 -41
  67. package/dist/runtime/browser.d.ts.map +1 -0
  68. package/dist/runtime/browser.js +56 -63
  69. package/dist/runtime/browser.js.map +1 -0
  70. package/dist/runtime/dynamic.d.ts +13 -21
  71. package/dist/runtime/dynamic.d.ts.map +1 -0
  72. package/dist/runtime/dynamic.js +64 -76
  73. package/dist/runtime/dynamic.js.map +1 -0
  74. package/dist/runtime/server.d.ts +2 -14
  75. package/dist/runtime/server.js +111 -8
  76. package/dist/runtime/server.js.map +1 -0
  77. package/dist/runtime/types.d.ts +2 -61
  78. package/dist/runtime/types.js +1 -0
  79. package/dist/types-B6myALSk.d.ts +63 -0
  80. package/dist/types-B6myALSk.d.ts.map +1 -0
  81. package/dist/vite/index.d.ts +28 -39
  82. package/dist/vite/index.d.ts.map +1 -0
  83. package/dist/vite/index.js +79 -122
  84. package/dist/vite/index.js.map +1 -0
  85. package/dist/webpack/mdx.d.ts +6 -3
  86. package/dist/webpack/mdx.d.ts.map +1 -0
  87. package/dist/webpack/mdx.js +21 -34
  88. package/dist/webpack/mdx.js.map +1 -0
  89. package/dist/webpack/meta.d.ts +6 -3
  90. package/dist/webpack/meta.d.ts.map +1 -0
  91. package/dist/webpack/meta.js +23 -37
  92. package/dist/webpack/meta.js.map +1 -0
  93. package/dist/webpack--VSEE6Zp.js +15 -0
  94. package/dist/webpack--VSEE6Zp.js.map +1 -0
  95. package/loader-mdx.cjs +1 -3
  96. package/loader-meta.cjs +1 -3
  97. package/package.json +35 -35
  98. package/dist/build-mdx-5XLFMP5P.js +0 -8
  99. package/dist/chunk-257RZJEQ.js +0 -17
  100. package/dist/chunk-2PY3JUIC.js +0 -126
  101. package/dist/chunk-4EUH5CD2.js +0 -173
  102. package/dist/chunk-4JSFLXXT.js +0 -8
  103. package/dist/chunk-5OBUOALK.js +0 -141
  104. package/dist/chunk-DTFUANSF.js +0 -40
  105. package/dist/chunk-KWSETXYC.js +0 -274
  106. package/dist/chunk-OLD35ARB.js +0 -116
  107. package/dist/chunk-RSASAHLX.js +0 -91
  108. package/dist/chunk-S7KOJHHO.js +0 -89
  109. package/dist/chunk-STLEUNK7.js +0 -335
  110. package/dist/chunk-USQZ5OLE.js +0 -116
  111. package/dist/chunk-VWJKRQZR.js +0 -19
  112. package/dist/chunk-WFDF56IJ.js +0 -290
  113. package/dist/chunk-XYVVDDIF.js +0 -180
  114. package/dist/core-X5ggQtBM.d.ts +0 -350
  115. package/dist/index-BqkSNsGO.d.ts +0 -8
  116. package/dist/load-from-file-FHW724YY.js +0 -8
@@ -1,130 +1,87 @@
1
- import {
2
- buildConfig
3
- } from "../chunk-OLD35ARB.js";
4
- import "../chunk-S7KOJHHO.js";
5
- import {
6
- createMdxLoader
7
- } from "../chunk-USQZ5OLE.js";
8
- import {
9
- createMetaLoader
10
- } from "../chunk-RSASAHLX.js";
11
- import {
12
- createIntegratedConfigLoader,
13
- toVite
14
- } from "../chunk-XYVVDDIF.js";
15
- import "../chunk-4JSFLXXT.js";
16
- import {
17
- ValidationError,
18
- _Defaults,
19
- createCore
20
- } from "../chunk-KWSETXYC.js";
21
- import {
22
- indexFile
23
- } from "../chunk-STLEUNK7.js";
24
- import "../chunk-2PY3JUIC.js";
25
- import "../chunk-VWJKRQZR.js";
26
-
27
- // src/vite/index.ts
1
+ import "../fuma-matter-CHgJa_-B.js";
2
+ import { t as createMdxLoader } from "../mdx-DMZ9tsAa.js";
3
+ import "../preset-gmDZnBcg.js";
4
+ import { t as buildConfig } from "../build-BTTNEFmV.js";
5
+ import { n as createCore, r as ValidationError, t as _Defaults } from "../core-DjldE3H9.js";
6
+ import "../codegen-DleOVLNr.js";
7
+ import { a as createIntegratedConfigLoader, r as toVite } from "../adapter-DG-viEbG.js";
8
+ import { t as createMetaLoader } from "../meta-DyieTM4Z.js";
9
+ import { t as indexFile } from "../index-file-D9HsrWU_.js";
28
10
  import { mergeConfig } from "vite";
11
+
12
+ //#region src/vite/index.ts
29
13
  async function mdx(config, pluginOptions = {}) {
30
- const options = applyDefaults(pluginOptions);
31
- const core = createViteCore(options);
32
- await core.init({
33
- config: buildConfig(config)
34
- });
35
- const configLoader = createIntegratedConfigLoader(core);
36
- const mdxLoader = toVite(createMdxLoader(configLoader));
37
- const metaLoader = toVite(
38
- createMetaLoader(configLoader, {
39
- // vite has built-in plugin for JSON files
40
- json: "json"
41
- })
42
- );
43
- return {
44
- name: "fumadocs-mdx",
45
- // needed, otherwise other plugins will be executed before our `transform`.
46
- enforce: "pre",
47
- config(config2) {
48
- if (!options.updateViteConfig) return config2;
49
- return mergeConfig(config2, {
50
- resolve: {
51
- noExternal: [
52
- "fumadocs-core",
53
- "fumadocs-ui",
54
- "fumadocs-openapi",
55
- "@fumadocs/base-ui",
56
- "@fumadocs/ui"
57
- ],
58
- // only dedupe for public, non-transitive libs
59
- dedupe: [
60
- "fumadocs-core",
61
- "fumadocs-ui",
62
- "fumadocs-openapi",
63
- "@fumadocs/base-ui"
64
- ]
65
- }
66
- });
67
- },
68
- async buildStart() {
69
- await core.emit({ write: true });
70
- },
71
- async configureServer(server) {
72
- await core.initServer({
73
- watcher: server.watcher
74
- });
75
- },
76
- async transform(value, id) {
77
- try {
78
- if (metaLoader.filter(id)) {
79
- return await metaLoader.transform.call(this, value, id);
80
- }
81
- if (mdxLoader.filter(id)) {
82
- return await mdxLoader.transform.call(this, value, id);
83
- }
84
- } catch (e) {
85
- if (e instanceof ValidationError) {
86
- throw new Error(await e.toStringFormatted());
87
- }
88
- throw e;
89
- }
90
- }
91
- };
14
+ const options = applyDefaults(pluginOptions);
15
+ const core = createViteCore(options);
16
+ await core.init({ config: buildConfig(config) });
17
+ const configLoader = createIntegratedConfigLoader(core);
18
+ const mdxLoader = toVite(createMdxLoader(configLoader));
19
+ const metaLoader = toVite(createMetaLoader(configLoader, { json: "json" }));
20
+ return {
21
+ name: "fumadocs-mdx",
22
+ enforce: "pre",
23
+ config(config$1) {
24
+ if (!options.updateViteConfig) return config$1;
25
+ return mergeConfig(config$1, { resolve: {
26
+ noExternal: [
27
+ "fumadocs-core",
28
+ "fumadocs-ui",
29
+ "fumadocs-openapi",
30
+ "@fumadocs/base-ui",
31
+ "@fumadocs/ui"
32
+ ],
33
+ dedupe: [
34
+ "fumadocs-core",
35
+ "fumadocs-ui",
36
+ "fumadocs-openapi",
37
+ "@fumadocs/base-ui"
38
+ ]
39
+ } });
40
+ },
41
+ async buildStart() {
42
+ await core.emit({ write: true });
43
+ },
44
+ async configureServer(server) {
45
+ await core.initServer({ watcher: server.watcher });
46
+ },
47
+ async transform(value, id) {
48
+ try {
49
+ if (metaLoader.filter(id)) return await metaLoader.transform.call(this, value, id);
50
+ if (mdxLoader.filter(id)) return await mdxLoader.transform.call(this, value, id);
51
+ } catch (e) {
52
+ if (e instanceof ValidationError) throw new Error(await e.toStringFormatted());
53
+ throw e;
54
+ }
55
+ }
56
+ };
92
57
  }
93
58
  async function postInstall(pluginOptions = {}) {
94
- const { loadConfig } = await import("../load-from-file-FHW724YY.js");
95
- const core = createViteCore(applyDefaults(pluginOptions));
96
- await core.init({
97
- config: loadConfig(core, true)
98
- });
99
- await core.emit({ write: true });
59
+ const { loadConfig } = await import("../load-from-file-B7Rswy9i.js");
60
+ const core = createViteCore(applyDefaults(pluginOptions));
61
+ await core.init({ config: loadConfig(core, true) });
62
+ await core.emit({ write: true });
100
63
  }
101
- function createViteCore({
102
- index,
103
- configPath,
104
- outDir
105
- }) {
106
- if (index === true) index = {};
107
- return createCore({
108
- environment: "vite",
109
- configPath,
110
- outDir,
111
- plugins: [
112
- index && indexFile({
113
- ...index,
114
- target: index.target ?? "vite"
115
- })
116
- ]
117
- });
64
+ function createViteCore({ index, configPath, outDir }) {
65
+ if (index === true) index = {};
66
+ return createCore({
67
+ environment: "vite",
68
+ configPath,
69
+ outDir,
70
+ plugins: [index && indexFile({
71
+ ...index,
72
+ target: index.target ?? "vite"
73
+ })]
74
+ });
118
75
  }
119
76
  function applyDefaults(options) {
120
- return {
121
- updateViteConfig: options.updateViteConfig ?? true,
122
- index: options.index ?? true,
123
- configPath: options.configPath ?? _Defaults.configPath,
124
- outDir: options.outDir ?? _Defaults.outDir
125
- };
77
+ return {
78
+ updateViteConfig: options.updateViteConfig ?? true,
79
+ index: options.index ?? true,
80
+ configPath: options.configPath ?? _Defaults.configPath,
81
+ outDir: options.outDir ?? _Defaults.outDir
82
+ };
126
83
  }
127
- export {
128
- mdx as default,
129
- postInstall
130
- };
84
+
85
+ //#endregion
86
+ export { mdx as default, postInstall };
87
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["config"],"sources":["../../src/vite/index.ts"],"sourcesContent":["import { mergeConfig, type Plugin, type UserConfig } from 'vite';\nimport { buildConfig } from '@/config/build';\nimport { ValidationError } from '@/utils/validation';\nimport { createMdxLoader } from '@/loaders/mdx';\nimport { toVite } from '@/loaders/adapter';\nimport type { FSWatcher } from 'chokidar';\nimport { _Defaults, createCore } from '@/core';\nimport { createIntegratedConfigLoader } from '@/loaders/config';\nimport { createMetaLoader } from '@/loaders/meta';\nimport indexFile, { IndexFilePluginOptions } from '@/plugins/index-file';\n\nexport interface PluginOptions {\n /**\n * Generate index files for accessing content.\n *\n * @defaultValue true\n */\n index?: boolean | IndexFilePluginOptions;\n\n /**\n * @defaultValue source.config.ts\n */\n configPath?: string;\n\n /**\n * Update Vite config to fix module resolution of Fumadocs\n *\n * @defaultValue true\n */\n updateViteConfig?: boolean;\n\n /**\n * Output directory of generated files\n *\n * @defaultValue '.source'\n */\n outDir?: string;\n}\n\nexport default async function mdx(\n config: Record<string, unknown>,\n pluginOptions: PluginOptions = {},\n): Promise<Plugin> {\n const options = applyDefaults(pluginOptions);\n const core = createViteCore(options);\n await core.init({\n config: buildConfig(config),\n });\n\n const configLoader = createIntegratedConfigLoader(core);\n const mdxLoader = toVite(createMdxLoader(configLoader));\n const metaLoader = toVite(\n createMetaLoader(configLoader, {\n // vite has built-in plugin for JSON files\n json: 'json',\n }),\n );\n\n return {\n name: 'fumadocs-mdx',\n // needed, otherwise other plugins will be executed before our `transform`.\n enforce: 'pre',\n config(config) {\n if (!options.updateViteConfig) return config;\n\n return mergeConfig(config, {\n resolve: {\n noExternal: [\n 'fumadocs-core',\n 'fumadocs-ui',\n 'fumadocs-openapi',\n '@fumadocs/base-ui',\n '@fumadocs/ui',\n ],\n // only dedupe for public, non-transitive libs\n dedupe: ['fumadocs-core', 'fumadocs-ui', 'fumadocs-openapi', '@fumadocs/base-ui'],\n },\n } satisfies UserConfig);\n },\n async buildStart() {\n await core.emit({ write: true });\n },\n async configureServer(server) {\n await core.initServer({\n watcher: server.watcher as unknown as FSWatcher,\n });\n },\n async transform(value, id) {\n try {\n if (metaLoader.filter(id)) {\n return await metaLoader.transform.call(this, value, id);\n }\n\n if (mdxLoader.filter(id)) {\n return await mdxLoader.transform.call(this, value, id);\n }\n } catch (e) {\n if (e instanceof ValidationError) {\n throw new Error(await e.toStringFormatted());\n }\n\n throw e;\n }\n },\n };\n}\n\nexport async function postInstall(pluginOptions: PluginOptions = {}) {\n const { loadConfig } = await import('@/config/load-from-file');\n const core = createViteCore(applyDefaults(pluginOptions));\n await core.init({\n config: loadConfig(core, true),\n });\n await core.emit({ write: true });\n}\n\nfunction createViteCore({ index, configPath, outDir }: Required<PluginOptions>) {\n if (index === true) index = {};\n\n return createCore({\n environment: 'vite',\n configPath,\n outDir,\n plugins: [\n index &&\n indexFile({\n ...index,\n target: index.target ?? 'vite',\n }),\n ],\n });\n}\n\nfunction applyDefaults(options: PluginOptions): Required<PluginOptions> {\n return {\n updateViteConfig: options.updateViteConfig ?? true,\n index: options.index ?? true,\n configPath: options.configPath ?? _Defaults.configPath,\n outDir: options.outDir ?? _Defaults.outDir,\n };\n}\n"],"mappings":";;;;;;;;;;;;AAuCA,eAA8B,IAC5B,QACA,gBAA+B,EAAE,EAChB;CACjB,MAAM,UAAU,cAAc,cAAc;CAC5C,MAAM,OAAO,eAAe,QAAQ;AACpC,OAAM,KAAK,KAAK,EACd,QAAQ,YAAY,OAAO,EAC5B,CAAC;CAEF,MAAM,eAAe,6BAA6B,KAAK;CACvD,MAAM,YAAY,OAAO,gBAAgB,aAAa,CAAC;CACvD,MAAM,aAAa,OACjB,iBAAiB,cAAc,EAE7B,MAAM,QACP,CAAC,CACH;AAED,QAAO;EACL,MAAM;EAEN,SAAS;EACT,OAAO,UAAQ;AACb,OAAI,CAAC,QAAQ,iBAAkB,QAAOA;AAEtC,UAAO,YAAYA,UAAQ,EACzB,SAAS;IACP,YAAY;KACV;KACA;KACA;KACA;KACA;KACD;IAED,QAAQ;KAAC;KAAiB;KAAe;KAAoB;KAAoB;IAClF,EACF,CAAsB;;EAEzB,MAAM,aAAa;AACjB,SAAM,KAAK,KAAK,EAAE,OAAO,MAAM,CAAC;;EAElC,MAAM,gBAAgB,QAAQ;AAC5B,SAAM,KAAK,WAAW,EACpB,SAAS,OAAO,SACjB,CAAC;;EAEJ,MAAM,UAAU,OAAO,IAAI;AACzB,OAAI;AACF,QAAI,WAAW,OAAO,GAAG,CACvB,QAAO,MAAM,WAAW,UAAU,KAAK,MAAM,OAAO,GAAG;AAGzD,QAAI,UAAU,OAAO,GAAG,CACtB,QAAO,MAAM,UAAU,UAAU,KAAK,MAAM,OAAO,GAAG;YAEjD,GAAG;AACV,QAAI,aAAa,gBACf,OAAM,IAAI,MAAM,MAAM,EAAE,mBAAmB,CAAC;AAG9C,UAAM;;;EAGX;;AAGH,eAAsB,YAAY,gBAA+B,EAAE,EAAE;CACnE,MAAM,EAAE,eAAe,MAAM,OAAO;CACpC,MAAM,OAAO,eAAe,cAAc,cAAc,CAAC;AACzD,OAAM,KAAK,KAAK,EACd,QAAQ,WAAW,MAAM,KAAK,EAC/B,CAAC;AACF,OAAM,KAAK,KAAK,EAAE,OAAO,MAAM,CAAC;;AAGlC,SAAS,eAAe,EAAE,OAAO,YAAY,UAAmC;AAC9E,KAAI,UAAU,KAAM,SAAQ,EAAE;AAE9B,QAAO,WAAW;EAChB,aAAa;EACb;EACA;EACA,SAAS,CACP,SACE,UAAU;GACR,GAAG;GACH,QAAQ,MAAM,UAAU;GACzB,CAAC,CACL;EACF,CAAC;;AAGJ,SAAS,cAAc,SAAiD;AACtE,QAAO;EACL,kBAAkB,QAAQ,oBAAoB;EAC9C,OAAO,QAAQ,SAAS;EACxB,YAAY,QAAQ,cAAc,UAAU;EAC5C,QAAQ,QAAQ,UAAU,UAAU;EACrC"}
@@ -1,6 +1,9 @@
1
- import { LoaderContext } from 'webpack';
2
- import { W as WebpackLoaderOptions } from '../index-BqkSNsGO.js';
1
+ import "../core-DG43f_AU.js";
2
+ import { t as WebpackLoaderOptions } from "../index-Bc_4I1HE.js";
3
+ import { LoaderContext } from "webpack";
3
4
 
5
+ //#region src/webpack/mdx.d.ts
4
6
  declare function loader(this: LoaderContext<WebpackLoaderOptions>, source: string, callback: LoaderContext<WebpackLoaderOptions>['callback']): Promise<void>;
5
-
7
+ //#endregion
6
8
  export { loader as default };
9
+ //# sourceMappingURL=mdx.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mdx.d.ts","names":[],"sources":["../../src/webpack/mdx.ts"],"sourcesContent":[],"mappings":";;;;;iBAQ8B,MAAA,OACtB,cAAc,iDAEV,cAAc,oCACvB"}
@@ -1,37 +1,24 @@
1
- import {
2
- getCore
3
- } from "../chunk-257RZJEQ.js";
4
- import {
5
- createMdxLoader
6
- } from "../chunk-USQZ5OLE.js";
7
- import {
8
- createStandaloneConfigLoader,
9
- toWebpack
10
- } from "../chunk-XYVVDDIF.js";
11
- import "../chunk-4JSFLXXT.js";
12
- import "../chunk-KWSETXYC.js";
13
- import "../chunk-2PY3JUIC.js";
14
- import "../chunk-VWJKRQZR.js";
1
+ import "../fuma-matter-CHgJa_-B.js";
2
+ import { t as createMdxLoader } from "../mdx-DMZ9tsAa.js";
3
+ import "../core-DjldE3H9.js";
4
+ import "../codegen-DleOVLNr.js";
5
+ import { i as toWebpack, o as createStandaloneConfigLoader } from "../adapter-DG-viEbG.js";
6
+ import { t as getCore } from "../webpack--VSEE6Zp.js";
15
7
 
16
- // src/webpack/mdx.ts
17
- var instance;
8
+ //#region src/webpack/mdx.ts
9
+ let instance;
18
10
  async function loader(source, callback) {
19
- const options = this.getOptions();
20
- this.cacheable(true);
21
- this.addDependency(options.absoluteCompiledConfigPath);
22
- if (!instance) {
23
- instance = toWebpack(
24
- createMdxLoader(
25
- createStandaloneConfigLoader({
26
- core: getCore(options),
27
- buildConfig: false,
28
- mode: options.isDev ? "dev" : "production"
29
- })
30
- )
31
- );
32
- }
33
- await instance.call(this, source, callback);
11
+ const options = this.getOptions();
12
+ this.cacheable(true);
13
+ this.addDependency(options.absoluteCompiledConfigPath);
14
+ if (!instance) instance = toWebpack(createMdxLoader(createStandaloneConfigLoader({
15
+ core: getCore(options),
16
+ buildConfig: false,
17
+ mode: options.isDev ? "dev" : "production"
18
+ })));
19
+ await instance.call(this, source, callback);
34
20
  }
35
- export {
36
- loader as default
37
- };
21
+
22
+ //#endregion
23
+ export { loader as default };
24
+ //# sourceMappingURL=mdx.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mdx.js","names":["instance: WebpackLoader | undefined"],"sources":["../../src/webpack/mdx.ts"],"sourcesContent":["import { type LoaderContext } from 'webpack';\nimport { createMdxLoader } from '@/loaders/mdx';\nimport { toWebpack, type WebpackLoader } from '@/loaders/adapter';\nimport { createStandaloneConfigLoader } from '@/loaders/config';\nimport { getCore, type WebpackLoaderOptions } from '@/webpack';\n\nlet instance: WebpackLoader | undefined;\n\nexport default async function loader(\n this: LoaderContext<WebpackLoaderOptions>,\n source: string,\n callback: LoaderContext<WebpackLoaderOptions>['callback'],\n): Promise<void> {\n const options = this.getOptions();\n this.cacheable(true);\n this.addDependency(options.absoluteCompiledConfigPath);\n\n if (!instance) {\n instance = toWebpack(\n createMdxLoader(\n createStandaloneConfigLoader({\n core: getCore(options),\n buildConfig: false,\n mode: options.isDev ? 'dev' : 'production',\n }),\n ),\n );\n }\n\n await instance.call(this, source, callback);\n}\n"],"mappings":";;;;;;;;AAMA,IAAIA;AAEJ,eAA8B,OAE5B,QACA,UACe;CACf,MAAM,UAAU,KAAK,YAAY;AACjC,MAAK,UAAU,KAAK;AACpB,MAAK,cAAc,QAAQ,2BAA2B;AAEtD,KAAI,CAAC,SACH,YAAW,UACT,gBACE,6BAA6B;EAC3B,MAAM,QAAQ,QAAQ;EACtB,aAAa;EACb,MAAM,QAAQ,QAAQ,QAAQ;EAC/B,CAAC,CACH,CACF;AAGH,OAAM,SAAS,KAAK,MAAM,QAAQ,SAAS"}
@@ -1,6 +1,9 @@
1
- import { LoaderContext } from 'webpack';
2
- import { W as WebpackLoaderOptions } from '../index-BqkSNsGO.js';
1
+ import "../core-DG43f_AU.js";
2
+ import { t as WebpackLoaderOptions } from "../index-Bc_4I1HE.js";
3
+ import { LoaderContext } from "webpack";
3
4
 
5
+ //#region src/webpack/meta.d.ts
4
6
  declare function loader(this: LoaderContext<WebpackLoaderOptions>, source: string, callback: LoaderContext<WebpackLoaderOptions>['callback']): Promise<void>;
5
-
7
+ //#endregion
6
8
  export { loader as default };
9
+ //# sourceMappingURL=meta.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"meta.d.ts","names":[],"sources":["../../src/webpack/meta.ts"],"sourcesContent":[],"mappings":";;;;;iBAQ8B,MAAA,OACtB,cAAc,iDAEV,cAAc,oCACvB"}
@@ -1,40 +1,26 @@
1
- import {
2
- getCore
3
- } from "../chunk-257RZJEQ.js";
4
- import {
5
- createMetaLoader
6
- } from "../chunk-RSASAHLX.js";
7
- import {
8
- createStandaloneConfigLoader,
9
- toWebpack
10
- } from "../chunk-XYVVDDIF.js";
11
- import "../chunk-4JSFLXXT.js";
12
- import "../chunk-KWSETXYC.js";
13
- import "../chunk-2PY3JUIC.js";
1
+ import "../core-DjldE3H9.js";
2
+ import "../codegen-DleOVLNr.js";
3
+ import { i as toWebpack, o as createStandaloneConfigLoader } from "../adapter-DG-viEbG.js";
4
+ import { t as createMetaLoader } from "../meta-DyieTM4Z.js";
5
+ import { t as getCore } from "../webpack--VSEE6Zp.js";
14
6
 
15
- // src/webpack/meta.ts
16
- var instance;
7
+ //#region src/webpack/meta.ts
8
+ let instance;
17
9
  async function loader(source, callback) {
18
- const options = this.getOptions();
19
- this.cacheable(true);
20
- this.addDependency(options.absoluteCompiledConfigPath);
21
- if (!instance) {
22
- instance = toWebpack(
23
- createMetaLoader(
24
- createStandaloneConfigLoader({
25
- core: getCore(options),
26
- buildConfig: false,
27
- mode: options.isDev ? "dev" : "production"
28
- }),
29
- {
30
- json: "json",
31
- yaml: "js"
32
- }
33
- )
34
- );
35
- }
36
- await instance.call(this, source, callback);
10
+ const options = this.getOptions();
11
+ this.cacheable(true);
12
+ this.addDependency(options.absoluteCompiledConfigPath);
13
+ if (!instance) instance = toWebpack(createMetaLoader(createStandaloneConfigLoader({
14
+ core: getCore(options),
15
+ buildConfig: false,
16
+ mode: options.isDev ? "dev" : "production"
17
+ }), {
18
+ json: "json",
19
+ yaml: "js"
20
+ }));
21
+ await instance.call(this, source, callback);
37
22
  }
38
- export {
39
- loader as default
40
- };
23
+
24
+ //#endregion
25
+ export { loader as default };
26
+ //# sourceMappingURL=meta.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"meta.js","names":["instance: WebpackLoader | undefined"],"sources":["../../src/webpack/meta.ts"],"sourcesContent":["import { type LoaderContext } from 'webpack';\nimport { toWebpack, type WebpackLoader } from '@/loaders/adapter';\nimport { createStandaloneConfigLoader } from '@/loaders/config';\nimport { createMetaLoader } from '@/loaders/meta';\nimport { getCore, type WebpackLoaderOptions } from '@/webpack';\n\nlet instance: WebpackLoader | undefined;\n\nexport default async function loader(\n this: LoaderContext<WebpackLoaderOptions>,\n source: string,\n callback: LoaderContext<WebpackLoaderOptions>['callback'],\n): Promise<void> {\n const options = this.getOptions();\n this.cacheable(true);\n this.addDependency(options.absoluteCompiledConfigPath);\n\n if (!instance) {\n instance = toWebpack(\n createMetaLoader(\n createStandaloneConfigLoader({\n core: getCore(options),\n buildConfig: false,\n mode: options.isDev ? 'dev' : 'production',\n }),\n {\n json: 'json',\n yaml: 'js',\n },\n ),\n );\n }\n\n await instance.call(this, source, callback);\n}\n"],"mappings":";;;;;;;AAMA,IAAIA;AAEJ,eAA8B,OAE5B,QACA,UACe;CACf,MAAM,UAAU,KAAK,YAAY;AACjC,MAAK,UAAU,KAAK;AACpB,MAAK,cAAc,QAAQ,2BAA2B;AAEtD,KAAI,CAAC,SACH,YAAW,UACT,iBACE,6BAA6B;EAC3B,MAAM,QAAQ,QAAQ;EACtB,aAAa;EACb,MAAM,QAAQ,QAAQ,QAAQ;EAC/B,CAAC,EACF;EACE,MAAM;EACN,MAAM;EACP,CACF,CACF;AAGH,OAAM,SAAS,KAAK,MAAM,QAAQ,SAAS"}
@@ -0,0 +1,15 @@
1
+ import { n as createCore } from "./core-DjldE3H9.js";
2
+
3
+ //#region src/webpack/index.ts
4
+ let core;
5
+ function getCore(options) {
6
+ return core ??= createCore({
7
+ environment: "webpack",
8
+ outDir: options.outDir,
9
+ configPath: options.configPath
10
+ });
11
+ }
12
+
13
+ //#endregion
14
+ export { getCore as t };
15
+ //# sourceMappingURL=webpack--VSEE6Zp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webpack--VSEE6Zp.js","names":["core: Core"],"sources":["../src/webpack/index.ts"],"sourcesContent":["import { type Core, createCore } from '@/core';\n\nexport interface WebpackLoaderOptions {\n absoluteCompiledConfigPath: string;\n configPath: string;\n outDir: string;\n isDev: boolean;\n}\n\nlet core: Core;\n\nexport function getCore(options: WebpackLoaderOptions) {\n return (core ??= createCore({\n environment: 'webpack',\n outDir: options.outDir,\n configPath: options.configPath,\n }));\n}\n"],"mappings":";;;AASA,IAAIA;AAEJ,SAAgB,QAAQ,SAA+B;AACrD,QAAQ,SAAS,WAAW;EAC1B,aAAa;EACb,QAAQ,QAAQ;EAChB,YAAY,QAAQ;EACrB,CAAC"}
package/loader-mdx.cjs CHANGED
@@ -1,7 +1,5 @@
1
1
  module.exports = function loader(code) {
2
2
  const callback = this.async();
3
3
 
4
- import('./dist/webpack/mdx.js').then((mod) =>
5
- mod.default.call(this, code, callback),
6
- );
4
+ import('./dist/webpack/mdx.js').then((mod) => mod.default.call(this, code, callback));
7
5
  };
package/loader-meta.cjs CHANGED
@@ -1,7 +1,5 @@
1
1
  module.exports = function loader(code) {
2
2
  const callback = this.async();
3
3
 
4
- import('./dist/webpack/meta.js').then((mod) =>
5
- mod.default.call(this, code, callback),
6
- );
4
+ import('./dist/webpack/meta.js').then((mod) => mod.default.call(this, code, callback));
7
5
  };
package/package.json CHANGED
@@ -1,61 +1,64 @@
1
1
  {
2
2
  "name": "fumadocs-mdx",
3
- "version": "14.2.3",
3
+ "version": "14.2.4",
4
4
  "description": "The built-in source for Fumadocs",
5
5
  "keywords": [
6
- "NextJs",
7
- "Docs"
6
+ "Docs",
7
+ "NextJs"
8
8
  ],
9
9
  "homepage": "https://fumadocs.dev",
10
- "repository": "github:fuma-nama/fumadocs",
11
10
  "license": "MIT",
12
11
  "author": "Fuma Nama",
12
+ "repository": "github:fuma-nama/fumadocs",
13
+ "bin": "./dist/bin.js",
14
+ "files": [
15
+ "loader-mdx.cjs",
16
+ "loader-meta.cjs",
17
+ "dist/*"
18
+ ],
13
19
  "type": "module",
20
+ "main": "./dist/index.js",
21
+ "types": "./dist/index.d.ts",
14
22
  "exports": {
15
23
  "./loader-mdx": "./loader-mdx.cjs",
16
24
  "./loader-meta": "./loader-meta.cjs",
17
25
  "./config": {
18
- "import": "./dist/config/index.js",
19
- "types": "./dist/config/index.d.ts"
26
+ "types": "./dist/config/index.d.ts",
27
+ "import": "./dist/config/index.js"
20
28
  },
21
29
  "./next": {
22
- "import": "./dist/next/index.js",
23
30
  "types": "./dist/next/index.d.ts",
31
+ "import": "./dist/next/index.js",
24
32
  "require": "./dist/next/index.cjs"
25
33
  },
26
34
  "./vite": {
27
- "import": "./dist/vite/index.js",
28
- "types": "./dist/vite/index.d.ts"
35
+ "types": "./dist/vite/index.d.ts",
36
+ "import": "./dist/vite/index.js"
29
37
  },
30
38
  ".": {
31
- "import": "./dist/index.js",
32
- "types": "./dist/index.d.ts"
39
+ "types": "./dist/index.d.ts",
40
+ "import": "./dist/index.js"
33
41
  },
34
42
  "./runtime/*": {
35
- "import": "./dist/runtime/*.js",
36
- "types": "./dist/runtime/*.d.ts"
43
+ "types": "./dist/runtime/*.d.ts",
44
+ "import": "./dist/runtime/*.js"
37
45
  },
38
46
  "./node/loader": {
39
- "import": "./dist/node/loader.js",
40
- "types": "./dist/node/loader.d.ts"
47
+ "types": "./dist/node/loader.d.ts",
48
+ "import": "./dist/node/loader.js"
41
49
  },
42
50
  "./bun": {
43
- "import": "./dist/bun/index.js",
44
- "types": "./dist/bun/index.d.ts"
51
+ "types": "./dist/bun/index.d.ts",
52
+ "import": "./dist/bun/index.js"
45
53
  },
46
54
  "./plugins/*": {
47
- "import": "./dist/plugins/*.js",
48
- "types": "./dist/plugins/*.d.ts"
55
+ "types": "./dist/plugins/*.d.ts",
56
+ "import": "./dist/plugins/*.js"
49
57
  }
50
58
  },
51
- "main": "./dist/index.js",
52
- "types": "./dist/index.d.ts",
53
- "bin": "./dist/bin.js",
54
- "files": [
55
- "dist/*",
56
- "loader-mdx.cjs",
57
- "loader-meta.cjs"
58
- ],
59
+ "publishConfig": {
60
+ "access": "public"
61
+ },
59
62
  "dependencies": {
60
63
  "@mdx-js/mdx": "^3.1.1",
61
64
  "@standard-schema/spec": "^1.1.0",
@@ -83,7 +86,6 @@
83
86
  "@types/node": "^24.10.2",
84
87
  "@types/picomatch": "^4.0.2",
85
88
  "@types/react": "^19.2.7",
86
- "astro": "^5.16.6",
87
89
  "mdast-util-directive": "^3.1.0",
88
90
  "mdast-util-mdx-jsx": "^3.2.0",
89
91
  "next": "16.1.1",
@@ -92,11 +94,12 @@
92
94
  "remark-directive": "^4.0.0",
93
95
  "remark-stringify": "^11.0.0",
94
96
  "rollup": "^4.54.0",
97
+ "tsdown": "^0.18.3",
95
98
  "vite": "^7.3.0",
96
99
  "webpack": "^5.104.1",
100
+ "@fumadocs/mdx-remote": "1.4.4",
97
101
  "eslint-config-custom": "0.0.0",
98
- "@fumadocs/mdx-remote": "1.4.3",
99
- "fumadocs-core": "16.4.1",
102
+ "fumadocs-core": "16.4.2",
100
103
  "tsconfig": "0.0.0"
101
104
  },
102
105
  "peerDependencies": {
@@ -124,13 +127,10 @@
124
127
  "optional": true
125
128
  }
126
129
  },
127
- "publishConfig": {
128
- "access": "public"
129
- },
130
130
  "scripts": {
131
- "build": "tsup",
131
+ "build": "tsdown",
132
132
  "clean": "rimraf dist",
133
- "dev": "tsup --watch",
133
+ "dev": "tsdown --watch",
134
134
  "lint": "eslint .",
135
135
  "types:check": "tsc --noEmit"
136
136
  }
@@ -1,8 +0,0 @@
1
- import {
2
- buildMDX
3
- } from "./chunk-4EUH5CD2.js";
4
- import "./chunk-WFDF56IJ.js";
5
- import "./chunk-VWJKRQZR.js";
6
- export {
7
- buildMDX
8
- };
@@ -1,17 +0,0 @@
1
- import {
2
- createCore
3
- } from "./chunk-KWSETXYC.js";
4
-
5
- // src/webpack/index.ts
6
- var core;
7
- function getCore(options) {
8
- return core ??= createCore({
9
- environment: "webpack",
10
- outDir: options.outDir,
11
- configPath: options.configPath
12
- });
13
- }
14
-
15
- export {
16
- getCore
17
- };