fumadocs-mdx 13.0.6 → 13.0.8

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.
package/dist/bin.cjs CHANGED
@@ -1430,7 +1430,7 @@ function toVite(loader) {
1430
1430
  }
1431
1431
  };
1432
1432
  }
1433
- var import_node_url2, import_promises4, import_node_querystring, import_node_path6;
1433
+ var import_node_url2, import_promises4, import_node_querystring, import_node_path6, import_node_fs;
1434
1434
  var init_adapter = __esm({
1435
1435
  "src/loaders/adapter.ts"() {
1436
1436
  "use strict";
@@ -1439,6 +1439,7 @@ var init_adapter = __esm({
1439
1439
  import_node_querystring = require("querystring");
1440
1440
  init_validation();
1441
1441
  import_node_path6 = __toESM(require("path"), 1);
1442
+ import_node_fs = require("fs");
1442
1443
  }
1443
1444
  });
1444
1445
 
@@ -1708,8 +1709,7 @@ function createMetaLoader(configLoader, resolve5 = {}) {
1708
1709
  };
1709
1710
  },
1710
1711
  bun: {
1711
- async fallback({ getSource, filePath }) {
1712
- const source = await getSource();
1712
+ loadSync(source, { filePath }) {
1713
1713
  const isJson = filePath.endsWith(".json");
1714
1714
  let data;
1715
1715
  try {
@@ -1755,7 +1755,7 @@ async function mdx(config, pluginOptions = {}) {
1755
1755
  const metaLoader = toVite(
1756
1756
  createMetaLoader(configLoader, {
1757
1757
  // vite has built-in plugin for JSON files
1758
- json: "js"
1758
+ json: "json"
1759
1759
  })
1760
1760
  );
1761
1761
  return {
@@ -1851,10 +1851,10 @@ var init_vite2 = __esm({
1851
1851
  });
1852
1852
 
1853
1853
  // src/bin.ts
1854
- var import_node_fs = require("fs");
1854
+ var import_node_fs2 = require("fs");
1855
1855
  async function start() {
1856
1856
  const [configPath] = process.argv.slice(2);
1857
- const isNext = (0, import_node_fs.existsSync)("next.config.js") || (0, import_node_fs.existsSync)("next.config.mjs") || (0, import_node_fs.existsSync)("next.config.mts") || (0, import_node_fs.existsSync)("next.config.ts");
1857
+ const isNext = (0, import_node_fs2.existsSync)("next.config.js") || (0, import_node_fs2.existsSync)("next.config.mjs") || (0, import_node_fs2.existsSync)("next.config.mts") || (0, import_node_fs2.existsSync)("next.config.ts");
1858
1858
  if (isNext) {
1859
1859
  const { postInstall: postInstall3 } = await Promise.resolve().then(() => (init_next2(), next_exports));
1860
1860
  await postInstall3(configPath);
@@ -916,8 +916,7 @@ function createMetaLoader(configLoader, resolve2 = {}) {
916
916
  };
917
917
  },
918
918
  bun: {
919
- async fallback({ getSource, filePath }) {
920
- const source = await getSource();
919
+ loadSync(source, { filePath }) {
921
920
  const isJson = filePath.endsWith(".json");
922
921
  let data;
923
922
  try {
@@ -939,9 +938,17 @@ var import_node_url = require("url");
939
938
  var import_promises4 = __toESM(require("fs/promises"), 1);
940
939
  var import_node_querystring = require("querystring");
941
940
  var import_node_path4 = __toESM(require("path"), 1);
941
+ var import_node_fs = require("fs");
942
942
  function toBun(loader) {
943
+ function toResult(output) {
944
+ if (!output) return;
945
+ return {
946
+ contents: output.code,
947
+ loader: "js"
948
+ };
949
+ }
943
950
  return (build) => {
944
- build.onLoad({ filter: loader.test ?? /.+/ }, async (args) => {
951
+ build.onLoad({ filter: loader.test ?? /.+/ }, (args) => {
945
952
  const [filePath, query = ""] = args.path.split("?", 2);
946
953
  const input = {
947
954
  async getSource() {
@@ -955,17 +962,14 @@ function toBun(loader) {
955
962
  }
956
963
  }
957
964
  };
958
- const result = await loader.load(input);
959
- if (result === null) {
960
- if (!loader.bun?.fallback) {
961
- return;
962
- }
963
- return loader.bun.fallback(input);
965
+ if (loader.bun?.loadSync) {
966
+ return loader.bun.loadSync((0, import_node_fs.readFileSync)(filePath).toString(), input);
964
967
  }
965
- return {
966
- contents: result.code,
967
- loader: "js"
968
- };
968
+ const result = loader.load(input);
969
+ if (result instanceof Promise) {
970
+ return result.then(toResult);
971
+ }
972
+ return toResult(result);
969
973
  });
970
974
  };
971
975
  }
package/dist/bun/index.js CHANGED
@@ -6,11 +6,11 @@ import {
6
6
  } from "../chunk-2E2JCOSO.js";
7
7
  import {
8
8
  createMetaLoader
9
- } from "../chunk-4757L6ST.js";
9
+ } from "../chunk-DMJ6I4C3.js";
10
10
  import {
11
11
  createIntegratedConfigLoader,
12
12
  toBun
13
- } from "../chunk-ETIN2W7C.js";
13
+ } from "../chunk-5FTSWCB4.js";
14
14
  import "../chunk-3J3WL7WN.js";
15
15
  import "../chunk-K5ZLPEIQ.js";
16
16
  import "../chunk-VUEZTR2H.js";
@@ -7,6 +7,7 @@ import { fileURLToPath } from "url";
7
7
  import fs from "fs/promises";
8
8
  import { parse } from "querystring";
9
9
  import path from "path";
10
+ import { readFileSync } from "fs";
10
11
  function toNode(loader) {
11
12
  return async (url, _context, nextLoad) => {
12
13
  if (url.startsWith("file:///") && (!loader.test || loader.test.test(url))) {
@@ -92,8 +93,15 @@ function toWebpack(loader) {
92
93
  };
93
94
  }
94
95
  function toBun(loader) {
96
+ function toResult(output) {
97
+ if (!output) return;
98
+ return {
99
+ contents: output.code,
100
+ loader: "js"
101
+ };
102
+ }
95
103
  return (build) => {
96
- build.onLoad({ filter: loader.test ?? /.+/ }, async (args) => {
104
+ build.onLoad({ filter: loader.test ?? /.+/ }, (args) => {
97
105
  const [filePath, query = ""] = args.path.split("?", 2);
98
106
  const input = {
99
107
  async getSource() {
@@ -107,17 +115,14 @@ function toBun(loader) {
107
115
  }
108
116
  }
109
117
  };
110
- const result = await loader.load(input);
111
- if (result === null) {
112
- if (!loader.bun?.fallback) {
113
- return;
114
- }
115
- return loader.bun.fallback(input);
118
+ if (loader.bun?.loadSync) {
119
+ return loader.bun.loadSync(readFileSync(filePath).toString(), input);
116
120
  }
117
- return {
118
- contents: result.code,
119
- loader: "js"
120
- };
121
+ const result = loader.load(input);
122
+ if (result instanceof Promise) {
123
+ return result.then(toResult);
124
+ }
125
+ return toResult(result);
121
126
  });
122
127
  };
123
128
  }
@@ -54,8 +54,7 @@ function createMetaLoader(configLoader, resolve = {}) {
54
54
  };
55
55
  },
56
56
  bun: {
57
- async fallback({ getSource, filePath }) {
58
- const source = await getSource();
57
+ loadSync(source, { filePath }) {
59
58
  const isJson = filePath.endsWith(".json");
60
59
  let data;
61
60
  try {
@@ -900,6 +900,7 @@ var import_node_url = require("url");
900
900
  var import_promises3 = __toESM(require("fs/promises"), 1);
901
901
  var import_node_querystring = require("querystring");
902
902
  var import_node_path4 = __toESM(require("path"), 1);
903
+ var import_node_fs = require("fs");
903
904
  function toNode(loader) {
904
905
  return async (url, _context, nextLoad) => {
905
906
  if (url.startsWith("file:///") && (!loader.test || loader.test.test(url))) {
@@ -1019,8 +1020,7 @@ function createMetaLoader(configLoader2, resolve3 = {}) {
1019
1020
  };
1020
1021
  },
1021
1022
  bun: {
1022
- async fallback({ getSource, filePath }) {
1023
- const source = await getSource();
1023
+ loadSync(source, { filePath }) {
1024
1024
  const isJson = filePath.endsWith(".json");
1025
1025
  let data;
1026
1026
  try {
@@ -3,11 +3,11 @@ import {
3
3
  } from "../chunk-2E2JCOSO.js";
4
4
  import {
5
5
  createMetaLoader
6
- } from "../chunk-4757L6ST.js";
6
+ } from "../chunk-DMJ6I4C3.js";
7
7
  import {
8
8
  createStandaloneConfigLoader,
9
9
  toNode
10
- } from "../chunk-ETIN2W7C.js";
10
+ } from "../chunk-5FTSWCB4.js";
11
11
  import "../chunk-3J3WL7WN.js";
12
12
  import "../chunk-K5ZLPEIQ.js";
13
13
  import "../chunk-VUEZTR2H.js";
@@ -834,6 +834,7 @@ var import_node_url = require("url");
834
834
  var import_promises2 = __toESM(require("fs/promises"), 1);
835
835
  var import_node_querystring = require("querystring");
836
836
  var import_node_path3 = __toESM(require("path"), 1);
837
+ var import_node_fs = require("fs");
837
838
  function toVite(loader) {
838
839
  return {
839
840
  filter(id) {
@@ -1210,8 +1211,7 @@ function createMetaLoader(configLoader, resolve3 = {}) {
1210
1211
  };
1211
1212
  },
1212
1213
  bun: {
1213
- async fallback({ getSource, filePath }) {
1214
- const source = await getSource();
1214
+ loadSync(source, { filePath }) {
1215
1215
  const isJson = filePath.endsWith(".json");
1216
1216
  let data;
1217
1217
  try {
@@ -1240,7 +1240,7 @@ async function mdx(config, pluginOptions = {}) {
1240
1240
  const metaLoader = toVite(
1241
1241
  createMetaLoader(configLoader, {
1242
1242
  // vite has built-in plugin for JSON files
1243
- json: "js"
1243
+ json: "json"
1244
1244
  })
1245
1245
  );
1246
1246
  return {
@@ -10,11 +10,11 @@ import {
10
10
  } from "../chunk-2E2JCOSO.js";
11
11
  import {
12
12
  createMetaLoader
13
- } from "../chunk-4757L6ST.js";
13
+ } from "../chunk-DMJ6I4C3.js";
14
14
  import {
15
15
  createIntegratedConfigLoader,
16
16
  toVite
17
- } from "../chunk-ETIN2W7C.js";
17
+ } from "../chunk-5FTSWCB4.js";
18
18
  import "../chunk-3J3WL7WN.js";
19
19
  import "../chunk-K5ZLPEIQ.js";
20
20
  import "../chunk-VUEZTR2H.js";
@@ -230,7 +230,7 @@ async function mdx(config, pluginOptions = {}) {
230
230
  const metaLoader = toVite(
231
231
  createMetaLoader(configLoader, {
232
232
  // vite has built-in plugin for JSON files
233
- json: "js"
233
+ json: "json"
234
234
  })
235
235
  );
236
236
  return {
@@ -830,6 +830,7 @@ var import_node_url = require("url");
830
830
  var import_promises2 = __toESM(require("fs/promises"), 1);
831
831
  var import_node_querystring = require("querystring");
832
832
  var import_node_path3 = __toESM(require("path"), 1);
833
+ var import_node_fs = require("fs");
833
834
  function toWebpack(loader2) {
834
835
  return async function(source, callback) {
835
836
  try {
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  createStandaloneConfigLoader,
6
6
  toWebpack
7
- } from "../chunk-ETIN2W7C.js";
7
+ } from "../chunk-5FTSWCB4.js";
8
8
  import "../chunk-3J3WL7WN.js";
9
9
  import "../chunk-K5ZLPEIQ.js";
10
10
  import "../chunk-VUEZTR2H.js";
@@ -317,6 +317,7 @@ async function validate(schema, data, context, errorMessage) {
317
317
 
318
318
  // src/loaders/adapter.ts
319
319
  var import_node_path = __toESM(require("path"), 1);
320
+ var import_node_fs = require("fs");
320
321
  function toWebpack(loader2) {
321
322
  return async function(source, callback) {
322
323
  try {
@@ -507,8 +508,7 @@ function createMetaLoader(configLoader, resolve2 = {}) {
507
508
  };
508
509
  },
509
510
  bun: {
510
- async fallback({ getSource, filePath }) {
511
- const source = await getSource();
511
+ loadSync(source, { filePath }) {
512
512
  const isJson = filePath.endsWith(".json");
513
513
  let data;
514
514
  try {
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  createMetaLoader
3
- } from "../chunk-4757L6ST.js";
3
+ } from "../chunk-DMJ6I4C3.js";
4
4
  import {
5
5
  createStandaloneConfigLoader,
6
6
  toWebpack
7
- } from "../chunk-ETIN2W7C.js";
7
+ } from "../chunk-5FTSWCB4.js";
8
8
  import {
9
9
  createCore
10
10
  } from "../chunk-2AQRQXSO.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-mdx",
3
- "version": "13.0.6",
3
+ "version": "13.0.8",
4
4
  "description": "The built-in source for Fumadocs",
5
5
  "keywords": [
6
6
  "NextJs",
@@ -116,7 +116,7 @@
116
116
  "webpack": "^5.102.1",
117
117
  "@fumadocs/mdx-remote": "1.4.3",
118
118
  "eslint-config-custom": "0.0.0",
119
- "fumadocs-core": "16.0.9",
119
+ "fumadocs-core": "16.0.11",
120
120
  "tsconfig": "0.0.0"
121
121
  },
122
122
  "peerDependencies": {