@hanzo/docs-mdx 14.1.1 → 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 (143) hide show
  1. package/dist/adapter-Jwap8N8Y.js +144 -0
  2. package/dist/adapter-Jwap8N8Y.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-DP5xMGSd.js +100 -0
  7. package/dist/build-DP5xMGSd.js.map +1 -0
  8. package/dist/build-mdx-B0MQbgVM.js +5 -0
  9. package/dist/build-mdx-CNzC71ea.js +153 -0
  10. package/dist/build-mdx-CNzC71ea.js.map +1 -0
  11. package/dist/build-mdx-DyJk_jWV.d.ts +53 -0
  12. package/dist/build-mdx-DyJk_jWV.d.ts.map +1 -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-BJualF84.js +212 -0
  23. package/dist/core-BJualF84.js.map +1 -0
  24. package/dist/core-D2BJuXMW.d.ts +364 -0
  25. package/dist/core-D2BJuXMW.d.ts.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-Bil6OoJJ.js +264 -0
  31. package/dist/index-file-Bil6OoJJ.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-BD2SdoUT.js +5 -0
  35. package/dist/load-from-file-CSjo1gN1.js +38 -0
  36. package/dist/load-from-file-CSjo1gN1.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-QPp-1kXt.js +91 -0
  40. package/dist/mdx-QPp-1kXt.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-DtKimtBh.js +61 -0
  63. package/dist/preset-DtKimtBh.js.map +1 -0
  64. package/dist/remark-include-DirFkbLw.js +247 -0
  65. package/dist/remark-include-DirFkbLw.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-CBMeukTI.d.ts +63 -0
  80. package/dist/types-CBMeukTI.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 -114
  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-DKHWtYK4.js +15 -0
  94. package/dist/webpack-DKHWtYK4.js.map +1 -0
  95. package/loader-mdx.cjs +1 -3
  96. package/loader-meta.cjs +1 -3
  97. package/package.json +50 -50
  98. package/dist/build-mdx-LN7FEKIP.js +0 -8
  99. package/dist/build-mdx-RXJZQXGA.js +0 -8
  100. package/dist/chunk-4JSFLXXT.js +0 -8
  101. package/dist/chunk-5OBUOALK.js +0 -141
  102. package/dist/chunk-72JS4QVZ.js +0 -17
  103. package/dist/chunk-7I4W7XGI.js +0 -179
  104. package/dist/chunk-7W73RILB.js +0 -173
  105. package/dist/chunk-A3YIGE7S.js +0 -334
  106. package/dist/chunk-AOTZP2TV.js +0 -152
  107. package/dist/chunk-AXJB5MGS.js +0 -173
  108. package/dist/chunk-DMIIE3XZ.js +0 -179
  109. package/dist/chunk-DTFUANSF.js +0 -40
  110. package/dist/chunk-JWZR25CW.js +0 -116
  111. package/dist/chunk-K7N6GD4M.js +0 -17
  112. package/dist/chunk-LXB7WYAF.js +0 -334
  113. package/dist/chunk-MYAVS2LD.js +0 -116
  114. package/dist/chunk-OLD35ARB.js +0 -116
  115. package/dist/chunk-PW2AZGGD.js +0 -125
  116. package/dist/chunk-RGBNABKS.js +0 -334
  117. package/dist/chunk-RPUM7REY.js +0 -40
  118. package/dist/chunk-RR2X6AE6.js +0 -274
  119. package/dist/chunk-S7KOJHHO.js +0 -89
  120. package/dist/chunk-STUCUTJQ.js +0 -334
  121. package/dist/chunk-T6G5VOED.js +0 -116
  122. package/dist/chunk-U5YPLCO5.js +0 -89
  123. package/dist/chunk-UB55AMXC.js +0 -274
  124. package/dist/chunk-VITVHHR6.js +0 -334
  125. package/dist/chunk-VKSHE52K.js +0 -274
  126. package/dist/chunk-VWJKRQZR.js +0 -19
  127. package/dist/chunk-WAAWFNDX.js +0 -179
  128. package/dist/chunk-WGXYJGSZ.js +0 -141
  129. package/dist/chunk-WLJ6EKOZ.js +0 -17
  130. package/dist/chunk-WMYYALAS.js +0 -334
  131. package/dist/chunk-Y7ISNZ7X.js +0 -216
  132. package/dist/chunk-YKRCQ42E.js +0 -216
  133. package/dist/chunk-ZAYZWFWP.js +0 -89
  134. package/dist/core-BQcKaqmC.d.ts +0 -350
  135. package/dist/core-BhWOtait.d.ts +0 -350
  136. package/dist/core-CV8uFMUa.d.ts +0 -350
  137. package/dist/core-DAQ64Hkq.d.ts +0 -350
  138. package/dist/core-DZtRjhds.d.ts +0 -350
  139. package/dist/core-De5K4ixv.d.ts +0 -350
  140. package/dist/core-X5ggQtBM.d.ts +0 -350
  141. package/dist/index-BqkSNsGO.d.ts +0 -8
  142. package/dist/load-from-file-FHW724YY.js +0 -8
  143. package/dist/load-from-file-S5CQ4H6T.js +0 -8
@@ -1,122 +1,87 @@
1
- import {
2
- buildConfig
3
- } from "../chunk-MYAVS2LD.js";
4
- import "../chunk-U5YPLCO5.js";
5
- import {
6
- createMdxLoader
7
- } from "../chunk-JWZR25CW.js";
8
- import {
9
- createMetaLoader
10
- } from "../chunk-ZAYZWFWP.js";
11
- import {
12
- createIntegratedConfigLoader,
13
- toVite
14
- } from "../chunk-DMIIE3XZ.js";
15
- import "../chunk-4JSFLXXT.js";
16
- import {
17
- ValidationError,
18
- _Defaults,
19
- createCore
20
- } from "../chunk-RR2X6AE6.js";
21
- import {
22
- indexFile
23
- } from "../chunk-A3YIGE7S.js";
24
- import "../chunk-PW2AZGGD.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-QPp-1kXt.js";
3
+ import "../preset-DtKimtBh.js";
4
+ import { t as buildConfig } from "../build-DP5xMGSd.js";
5
+ import { n as createCore, r as ValidationError, t as _Defaults } from "../core-BJualF84.js";
6
+ import "../codegen-DleOVLNr.js";
7
+ import { a as createIntegratedConfigLoader, r as toVite } from "../adapter-Jwap8N8Y.js";
8
+ import { t as createMetaLoader } from "../meta-DyieTM4Z.js";
9
+ import { t as indexFile } from "../index-file-Bil6OoJJ.js";
28
10
  import { mergeConfig } from "vite";
29
- var FumadocsDeps = ["@hanzo/docs-core", "@hanzo/docs-ui", "@hanzo/docs-openapi"];
11
+
12
+ //#region src/vite/index.ts
30
13
  async function mdx(config, pluginOptions = {}) {
31
- const options = applyDefaults(pluginOptions);
32
- const core = createViteCore(options);
33
- await core.init({
34
- config: buildConfig(config)
35
- });
36
- const configLoader = createIntegratedConfigLoader(core);
37
- const mdxLoader = toVite(createMdxLoader(configLoader));
38
- const metaLoader = toVite(
39
- createMetaLoader(configLoader, {
40
- // vite has built-in plugin for JSON files
41
- json: "json"
42
- })
43
- );
44
- return {
45
- name: "@hanzo/docs-mdx",
46
- // needed, otherwise other plugins will be executed before our `transform`.
47
- enforce: "pre",
48
- config(config2) {
49
- if (!options.updateViteConfig) return config2;
50
- return mergeConfig(config2, {
51
- optimizeDeps: {
52
- exclude: FumadocsDeps
53
- },
54
- resolve: {
55
- noExternal: FumadocsDeps,
56
- dedupe: FumadocsDeps
57
- }
58
- });
59
- },
60
- async buildStart() {
61
- await core.emit({ write: true });
62
- },
63
- async configureServer(server) {
64
- await core.initServer({
65
- watcher: server.watcher
66
- });
67
- },
68
- async transform(value, id) {
69
- try {
70
- if (metaLoader.filter(id)) {
71
- return await metaLoader.transform.call(this, value, id);
72
- }
73
- if (mdxLoader.filter(id)) {
74
- return await mdxLoader.transform.call(this, value, id);
75
- }
76
- } catch (e) {
77
- if (e instanceof ValidationError) {
78
- throw new Error(await e.toStringFormatted());
79
- }
80
- throw e;
81
- }
82
- }
83
- };
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: "hanzo-docs-mdx",
22
+ enforce: "pre",
23
+ config(config$1) {
24
+ if (!options.updateViteConfig) return config$1;
25
+ return mergeConfig(config$1, { resolve: {
26
+ noExternal: [
27
+ "@hanzo/docs-core",
28
+ "@hanzo/docs-ui",
29
+ "@hanzo/docs-openapi",
30
+ "@hanzo/docs-base-ui",
31
+ "@hanzo/docs-ui"
32
+ ],
33
+ dedupe: [
34
+ "@hanzo/docs-core",
35
+ "@hanzo/docs-ui",
36
+ "@hanzo/docs-openapi",
37
+ "@hanzo/docs-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
+ };
84
57
  }
85
58
  async function postInstall(pluginOptions = {}) {
86
- const { loadConfig } = await import("../load-from-file-S5CQ4H6T.js");
87
- const core = createViteCore(applyDefaults(pluginOptions));
88
- await core.init({
89
- config: loadConfig(core, true)
90
- });
91
- await core.emit({ write: true });
59
+ const { loadConfig } = await import("../load-from-file-BD2SdoUT.js");
60
+ const core = createViteCore(applyDefaults(pluginOptions));
61
+ await core.init({ config: loadConfig(core, true) });
62
+ await core.emit({ write: true });
92
63
  }
93
- function createViteCore({
94
- index,
95
- configPath,
96
- outDir
97
- }) {
98
- if (index === true) index = {};
99
- return createCore({
100
- environment: "vite",
101
- configPath,
102
- outDir,
103
- plugins: [
104
- index && indexFile({
105
- ...index,
106
- target: index.target ?? "vite"
107
- })
108
- ]
109
- });
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
+ });
110
75
  }
111
76
  function applyDefaults(options) {
112
- return {
113
- updateViteConfig: options.updateViteConfig ?? true,
114
- index: options.index ?? true,
115
- configPath: options.configPath ?? _Defaults.configPath,
116
- outDir: options.outDir ?? _Defaults.outDir
117
- };
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
+ };
118
83
  }
119
- export {
120
- mdx as default,
121
- postInstall
122
- };
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 '.docs'\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: 'hanzo-docs-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 '@hanzo/docs-core',\n '@hanzo/docs-ui',\n '@hanzo/docs-openapi',\n '@hanzo/docs-base-ui',\n '@hanzo/docs-ui',\n ],\n // only dedupe for public, non-transitive libs\n dedupe: ['@hanzo/docs-core', '@hanzo/docs-ui', '@hanzo/docs-openapi', '@hanzo/docs-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;KAAoB;KAAkB;KAAuB;KAAsB;IAC7F,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-D2BJuXMW.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-WLJ6EKOZ.js";
4
- import {
5
- createMdxLoader
6
- } from "../chunk-JWZR25CW.js";
7
- import {
8
- createStandaloneConfigLoader,
9
- toWebpack
10
- } from "../chunk-DMIIE3XZ.js";
11
- import "../chunk-4JSFLXXT.js";
12
- import "../chunk-RR2X6AE6.js";
13
- import "../chunk-PW2AZGGD.js";
14
- import "../chunk-VWJKRQZR.js";
1
+ import "../fuma-matter-CHgJa_-B.js";
2
+ import { t as createMdxLoader } from "../mdx-QPp-1kXt.js";
3
+ import "../core-BJualF84.js";
4
+ import "../codegen-DleOVLNr.js";
5
+ import { i as toWebpack, o as createStandaloneConfigLoader } from "../adapter-Jwap8N8Y.js";
6
+ import { t as getCore } from "../webpack-DKHWtYK4.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-D2BJuXMW.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-WLJ6EKOZ.js";
4
- import {
5
- createMetaLoader
6
- } from "../chunk-ZAYZWFWP.js";
7
- import {
8
- createStandaloneConfigLoader,
9
- toWebpack
10
- } from "../chunk-DMIIE3XZ.js";
11
- import "../chunk-4JSFLXXT.js";
12
- import "../chunk-RR2X6AE6.js";
13
- import "../chunk-PW2AZGGD.js";
1
+ import "../core-BJualF84.js";
2
+ import "../codegen-DleOVLNr.js";
3
+ import { i as toWebpack, o as createStandaloneConfigLoader } from "../adapter-Jwap8N8Y.js";
4
+ import { t as createMetaLoader } from "../meta-DyieTM4Z.js";
5
+ import { t as getCore } from "../webpack-DKHWtYK4.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-BJualF84.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-DKHWtYK4.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webpack-DKHWtYK4.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,70 +1,69 @@
1
1
  {
2
2
  "name": "@hanzo/docs-mdx",
3
- "version": "14.1.1",
4
- "description": "The built-in MDX source for Hanzo Docs",
3
+ "version": "14.2.4",
4
+ "description": "The built-in source for Fumadocs",
5
5
  "keywords": [
6
- "Hanzo",
7
6
  "Docs",
8
- "MDX"
7
+ "NextJs"
9
8
  ],
10
- "homepage": "https://hanzo.ai/docs",
11
- "repository": "github:hanzoai/docs",
9
+ "homepage": "https://fumadocs.dev",
12
10
  "license": "MIT",
13
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
+ ],
14
19
  "type": "module",
20
+ "main": "./dist/index.js",
21
+ "types": "./dist/index.d.ts",
15
22
  "exports": {
16
23
  "./loader-mdx": "./loader-mdx.cjs",
17
24
  "./loader-meta": "./loader-meta.cjs",
18
25
  "./config": {
19
- "import": "./dist/config/index.js",
20
- "types": "./dist/config/index.d.ts"
26
+ "types": "./dist/config/index.d.ts",
27
+ "import": "./dist/config/index.js"
21
28
  },
22
29
  "./next": {
23
- "import": "./dist/next/index.js",
24
30
  "types": "./dist/next/index.d.ts",
31
+ "import": "./dist/next/index.js",
25
32
  "require": "./dist/next/index.cjs"
26
33
  },
27
34
  "./vite": {
28
- "import": "./dist/vite/index.js",
29
- "types": "./dist/vite/index.d.ts"
35
+ "types": "./dist/vite/index.d.ts",
36
+ "import": "./dist/vite/index.js"
30
37
  },
31
38
  ".": {
32
- "import": "./dist/index.js",
33
- "types": "./dist/index.d.ts"
39
+ "types": "./dist/index.d.ts",
40
+ "import": "./dist/index.js"
34
41
  },
35
42
  "./runtime/*": {
36
- "import": "./dist/runtime/*.js",
37
- "types": "./dist/runtime/*.d.ts"
43
+ "types": "./dist/runtime/*.d.ts",
44
+ "import": "./dist/runtime/*.js"
38
45
  },
39
46
  "./node/loader": {
40
- "import": "./dist/node/loader.js",
41
- "types": "./dist/node/loader.d.ts"
47
+ "types": "./dist/node/loader.d.ts",
48
+ "import": "./dist/node/loader.js"
42
49
  },
43
50
  "./bun": {
44
- "import": "./dist/bun/index.js",
45
- "types": "./dist/bun/index.d.ts"
51
+ "types": "./dist/bun/index.d.ts",
52
+ "import": "./dist/bun/index.js"
46
53
  },
47
54
  "./plugins/*": {
48
- "import": "./dist/plugins/*.js",
49
- "types": "./dist/plugins/*.d.ts"
55
+ "types": "./dist/plugins/*.d.ts",
56
+ "import": "./dist/plugins/*.js"
50
57
  }
51
58
  },
52
- "main": "./dist/index.js",
53
- "types": "./dist/index.d.ts",
54
- "bin": {
55
- "hanzo-docs": "./dist/bin.js",
56
- "fumadocs-mdx": "./dist/bin.js"
59
+ "publishConfig": {
60
+ "access": "public"
57
61
  },
58
- "files": [
59
- "dist/*",
60
- "loader-mdx.cjs",
61
- "loader-meta.cjs"
62
- ],
63
62
  "dependencies": {
64
63
  "@mdx-js/mdx": "^3.1.1",
65
- "@standard-schema/spec": "^1.0.0",
64
+ "@standard-schema/spec": "^1.1.0",
66
65
  "chokidar": "^5.0.0",
67
- "esbuild": "^0.27.1",
66
+ "esbuild": "^0.27.2",
68
67
  "estree-util-value-to-estree": "^3.5.0",
69
68
  "js-yaml": "^4.1.1",
70
69
  "mdast-util-to-markdown": "^2.1.2",
@@ -77,34 +76,35 @@
77
76
  "unist-util-remove-position": "^5.0.0",
78
77
  "unist-util-visit": "^5.0.0",
79
78
  "vfile": "^6.0.3",
80
- "zod": "^4.1.13"
79
+ "zod": "^4.2.1"
81
80
  },
82
81
  "devDependencies": {
83
- "@types/bun": "^1.3.4",
82
+ "@types/bun": "^1.3.5",
84
83
  "@types/js-yaml": "^4.0.9",
85
84
  "@types/mdast": "^4.0.4",
86
85
  "@types/mdx": "^2.0.13",
87
86
  "@types/node": "^24.10.2",
88
87
  "@types/picomatch": "^4.0.2",
89
88
  "@types/react": "^19.2.7",
90
- "astro": "^5.16.5",
91
89
  "mdast-util-directive": "^3.1.0",
92
90
  "mdast-util-mdx-jsx": "^3.2.0",
93
- "next": "16.0.10",
91
+ "next": "16.1.1",
94
92
  "react": "^19.2.3",
95
93
  "remark": "^15.0.1",
96
94
  "remark-directive": "^4.0.0",
97
95
  "remark-stringify": "^11.0.0",
98
- "rollup": "^4.53.3",
99
- "vite": "^7.2.7",
100
- "webpack": "^5.103.0",
101
- "eslint-config-custom": "0.0.0",
96
+ "rollup": "^4.54.0",
97
+ "tsdown": "^0.18.3",
98
+ "vite": "^7.3.0",
99
+ "webpack": "^5.104.1",
100
+ "@hanzo/mdx-runtime": "1.5.1",
101
+ "@hanzo/docs-core": "16.4.2",
102
102
  "tsconfig": "0.0.0",
103
- "@hanzo/docs-mdx-remote": "1.4.3",
104
- "@hanzo/docs-core": "16.2.6"
103
+ "eslint-config-custom": "0.0.0"
105
104
  },
106
105
  "peerDependencies": {
107
- "@hanzo/docs-mdx-remote": "^1.4.0",
106
+ "@hanzo/mdx-runtime": "^1.4.0",
107
+ "@types/react": "*",
108
108
  "@hanzo/docs-core": "^15.0.0 || ^16.0.0",
109
109
  "next": "^15.3.0 || ^16.0.0",
110
110
  "react": "*",
@@ -114,23 +114,23 @@
114
114
  "react": {
115
115
  "optional": true
116
116
  },
117
+ "@types/react": {
118
+ "optional": true
119
+ },
117
120
  "next": {
118
121
  "optional": true
119
122
  },
120
123
  "vite": {
121
124
  "optional": true
122
125
  },
123
- "@hanzo/docs-mdx-remote": {
126
+ "@hanzo/mdx-runtime": {
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-AXJB5MGS.js";
4
- import "./chunk-YKRCQ42E.js";
5
- import "./chunk-VWJKRQZR.js";
6
- export {
7
- buildMDX
8
- };
@@ -1,8 +0,0 @@
1
- import {
2
- buildMDX
3
- } from "./chunk-7W73RILB.js";
4
- import "./chunk-Y7ISNZ7X.js";
5
- import "./chunk-VWJKRQZR.js";
6
- export {
7
- buildMDX
8
- };
@@ -1,8 +0,0 @@
1
- // src/loaders/index.ts
2
- var metaLoaderGlob = /\.(json|yaml)(\?.+?)?$/;
3
- var mdxLoaderGlob = /\.mdx?(\?.+?)?$/;
4
-
5
- export {
6
- metaLoaderGlob,
7
- mdxLoaderGlob
8
- };