fumadocs-mdx 12.0.0 → 12.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 (40) hide show
  1. package/dist/bin.cjs +102 -84
  2. package/dist/bin.js +1 -1
  3. package/dist/bun/index.cjs +156 -130
  4. package/dist/bun/index.js +8 -8
  5. package/dist/chunk-ADR6R7HM.js +29 -0
  6. package/dist/{chunk-3M4SHY6K.js → chunk-FSZMKRVH.js} +1 -1
  7. package/dist/{chunk-POXTQZ4D.js → chunk-LGYVNESJ.js} +2 -6
  8. package/dist/chunk-LMG6UWCL.js +167 -0
  9. package/dist/{chunk-SWNOXPYJ.js → chunk-QAUWMR5D.js} +6 -6
  10. package/dist/{chunk-KGUBBRL6.js → chunk-SP7CHRTS.js} +9 -37
  11. package/dist/{chunk-YC25YEBF.js → chunk-U4MQ44TS.js} +1 -1
  12. package/dist/chunk-XMFLD5J6.js +30 -0
  13. package/dist/{chunk-TLD6JMT6.js → chunk-ZX7TM4AR.js} +4 -2
  14. package/dist/config/index.cjs +84 -56
  15. package/dist/config/index.js +2 -2
  16. package/dist/load-UUXLUBHL.js +9 -0
  17. package/dist/loader-mdx.cjs +217 -174
  18. package/dist/loader-mdx.js +7 -7
  19. package/dist/next/index.cjs +128 -108
  20. package/dist/next/index.js +39 -53
  21. package/dist/node/loader.cjs +152 -109
  22. package/dist/node/loader.js +6 -7
  23. package/dist/postinstall-SCSXM4IM.js +10 -0
  24. package/dist/{preset-WFEORCAB.js → preset-ZMP6U62C.js} +1 -1
  25. package/dist/runtime/next/async.cjs +117 -65
  26. package/dist/runtime/next/async.d.cts +1 -1
  27. package/dist/runtime/next/async.d.ts +1 -1
  28. package/dist/runtime/next/async.js +15 -8
  29. package/dist/runtime/next/index.d.cts +2 -2
  30. package/dist/runtime/next/index.d.ts +2 -2
  31. package/dist/{types-DLIAvrgC.d.ts → types-CFlQxTN8.d.ts} +4 -5
  32. package/dist/{types-Dl8HLbm5.d.cts → types-DkGjw-Uo.d.cts} +4 -5
  33. package/dist/vite/index.cjs +177 -145
  34. package/dist/vite/index.d.cts +1 -0
  35. package/dist/vite/index.d.ts +1 -0
  36. package/dist/vite/index.js +14 -19
  37. package/dist/{watcher-4NDMOH4R.js → watcher-HGOH3APP.js} +1 -1
  38. package/package.json +15 -11
  39. package/dist/chunk-KTDVTBMH.js +0 -139
  40. package/dist/postinstall-U7VROOY7.js +0 -9
@@ -30,7 +30,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
30
30
  ));
31
31
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
32
32
 
33
- // src/mdx/preset.ts
33
+ // src/loaders/mdx/preset.ts
34
34
  var preset_exports = {};
35
35
  __export(preset_exports, {
36
36
  getDefaultMDXOptions: () => getDefaultMDXOptions
@@ -111,56 +111,12 @@ function getDefaultMDXOptions({
111
111
  }
112
112
  var plugins;
113
113
  var init_preset = __esm({
114
- "src/mdx/preset.ts"() {
114
+ "src/loaders/mdx/preset.ts"() {
115
115
  "use strict";
116
116
  plugins = __toESM(require("fumadocs-core/mdx-plugins"), 1);
117
117
  }
118
118
  });
119
119
 
120
- // src/map/watcher.ts
121
- var watcher_exports = {};
122
- __export(watcher_exports, {
123
- watcher: () => watcher
124
- });
125
- function watcher(configPath, config, ignored) {
126
- const watcher2 = new import_chokidar.FSWatcher({
127
- ignoreInitial: true,
128
- persistent: true,
129
- ignored
130
- });
131
- watcher2.add(configPath);
132
- for (const collection of config.collections.values()) {
133
- if (collection.type === "docs") {
134
- watcher2.add(collection.docs.dir);
135
- watcher2.add(collection.meta.dir);
136
- } else {
137
- watcher2.add(collection.dir);
138
- }
139
- }
140
- return watcher2;
141
- }
142
- var import_chokidar;
143
- var init_watcher = __esm({
144
- "src/map/watcher.ts"() {
145
- "use strict";
146
- import_chokidar = require("chokidar");
147
- }
148
- });
149
-
150
- // src/next/index.ts
151
- var next_exports = {};
152
- __export(next_exports, {
153
- createMDX: () => createMDX,
154
- postInstall: () => postInstall,
155
- start: () => start
156
- });
157
- module.exports = __toCommonJS(next_exports);
158
-
159
- // src/utils/config.ts
160
- var fs = __toESM(require("fs/promises"), 1);
161
- var path = __toESM(require("path"), 1);
162
- var import_node_url = require("url");
163
-
164
120
  // src/config/build.ts
165
121
  function buildConfig(config) {
166
122
  const collections = /* @__PURE__ */ new Map();
@@ -210,12 +166,13 @@ function buildConfig(config) {
210
166
  }
211
167
  };
212
168
  }
169
+ var init_build = __esm({
170
+ "src/config/build.ts"() {
171
+ "use strict";
172
+ }
173
+ });
213
174
 
214
- // src/utils/config.ts
215
- function findConfigFile() {
216
- return path.resolve("source.config.ts");
217
- }
218
- var cache = null;
175
+ // src/loaders/config/load.ts
219
176
  async function compileConfig(configPath, outDir) {
220
177
  const { build } = await import("esbuild");
221
178
  const transformed = await build({
@@ -258,14 +215,63 @@ async function getConfigHash(configPath) {
258
215
  }
259
216
  throw new Error("Cannot find config file");
260
217
  }
218
+ var fs, path, import_node_url, cache;
219
+ var init_load = __esm({
220
+ "src/loaders/config/load.ts"() {
221
+ "use strict";
222
+ fs = __toESM(require("fs/promises"), 1);
223
+ path = __toESM(require("path"), 1);
224
+ import_node_url = require("url");
225
+ init_build();
226
+ cache = null;
227
+ }
228
+ });
229
+
230
+ // src/next/map/watcher.ts
231
+ var watcher_exports = {};
232
+ __export(watcher_exports, {
233
+ watcher: () => watcher
234
+ });
235
+ function watcher(configPath, config, ignored) {
236
+ const watcher2 = new import_chokidar.FSWatcher({
237
+ ignoreInitial: true,
238
+ persistent: true,
239
+ ignored
240
+ });
241
+ watcher2.add(configPath);
242
+ for (const collection of config.collections.values()) {
243
+ if (collection.type === "docs") {
244
+ watcher2.add(collection.docs.dir);
245
+ watcher2.add(collection.meta.dir);
246
+ } else {
247
+ watcher2.add(collection.dir);
248
+ }
249
+ }
250
+ return watcher2;
251
+ }
252
+ var import_chokidar;
253
+ var init_watcher = __esm({
254
+ "src/next/map/watcher.ts"() {
255
+ "use strict";
256
+ import_chokidar = require("chokidar");
257
+ }
258
+ });
261
259
 
262
260
  // src/next/index.ts
263
- var import_node_path3 = __toESM(require("path"), 1);
264
- var import_promises = __toESM(require("fs/promises"), 1);
261
+ var next_exports = {};
262
+ __export(next_exports, {
263
+ createMDX: () => createMDX,
264
+ postInstall: () => postInstall,
265
+ start: () => start
266
+ });
267
+ module.exports = __toCommonJS(next_exports);
268
+ init_load();
269
+ var import_node_path5 = __toESM(require("path"), 1);
270
+ var import_promises2 = __toESM(require("fs/promises"), 1);
265
271
 
266
- // src/map/generate.ts
267
- var path4 = __toESM(require("path"), 1);
268
- var fs2 = __toESM(require("fs/promises"), 1);
272
+ // src/next/map/generate.ts
273
+ var path5 = __toESM(require("path"), 1);
274
+ var import_node_crypto = require("crypto");
269
275
  var import_tinyglobby = require("tinyglobby");
270
276
 
271
277
  // src/utils/validation.ts
@@ -306,31 +312,36 @@ async function validate(schema, data, context, errorMessage) {
306
312
  return data;
307
313
  }
308
314
 
309
- // src/map/file-cache.ts
315
+ // src/next/map/file-cache.ts
310
316
  var import_lru_cache = require("lru-cache");
317
+ var import_promises = __toESM(require("fs/promises"), 1);
318
+ var import_node_path = __toESM(require("path"), 1);
311
319
  var map = new import_lru_cache.LRUCache({
312
- max: 200
320
+ max: 100
313
321
  });
314
- var fileCache = {
315
- read(namespace, path7) {
316
- return map.get(`${namespace}.${path7}`);
317
- },
318
- write(namespace, path7, data) {
319
- map.set(`${namespace}.${path7}`, data);
320
- },
321
- removeCache(path7) {
322
- for (const key of map.keys()) {
323
- const keyPath = key.slice(key.indexOf(".") + 1);
324
- if (keyPath === path7) map.delete(key);
325
- }
322
+ function toFullPath(file) {
323
+ if (import_node_path.default.isAbsolute(file)) {
324
+ return import_node_path.default.relative(process.cwd(), file);
326
325
  }
327
- };
326
+ return file;
327
+ }
328
+ async function readFileWithCache(file) {
329
+ const fullPath = toFullPath(file);
330
+ const cached = map.get(fullPath);
331
+ if (cached) return cached;
332
+ const read = import_promises.default.readFile(fullPath).then((s) => s.toString());
333
+ map.set(fullPath, read);
334
+ return read;
335
+ }
336
+ function removeFileCache(file) {
337
+ map.delete(toFullPath(file));
338
+ }
328
339
 
329
- // src/map/generate.ts
340
+ // src/next/map/generate.ts
330
341
  var import_js_yaml2 = require("js-yaml");
331
342
 
332
343
  // src/utils/git-timestamp.ts
333
- var import_node_path = __toESM(require("path"), 1);
344
+ var import_node_path2 = __toESM(require("path"), 1);
334
345
  var import_tinyexec = require("tinyexec");
335
346
  var cache2 = /* @__PURE__ */ new Map();
336
347
  async function getGitTimestamp(file) {
@@ -339,7 +350,7 @@ async function getGitTimestamp(file) {
339
350
  try {
340
351
  const out = await (0, import_tinyexec.x)(
341
352
  "git",
342
- ["log", "-1", '--pretty="%ai"', import_node_path.default.relative(process.cwd(), file)],
353
+ ["log", "-1", '--pretty="%ai"', import_node_path2.default.relative(process.cwd(), file)],
343
354
  {
344
355
  throwOnError: true
345
356
  }
@@ -369,7 +380,7 @@ function fumaMatter(input) {
369
380
  }
370
381
 
371
382
  // src/utils/import-formatter.ts
372
- var import_node_path2 = __toESM(require("path"), 1);
383
+ var import_node_path3 = __toESM(require("path"), 1);
373
384
  function getImportCode(info) {
374
385
  const specifier = JSON.stringify(info.specifier);
375
386
  if (info.type === "default") return `import ${info.name} from ${specifier}`;
@@ -384,7 +395,7 @@ function getImportCode(info) {
384
395
  return `import ${specifier}`;
385
396
  }
386
397
  function toImportPath(file, config) {
387
- const ext = import_node_path2.default.extname(file);
398
+ const ext = import_node_path3.default.extname(file);
388
399
  let filename;
389
400
  if (ext === ".ts" && config.jsExtension) {
390
401
  filename = file.substring(0, file.length - ext.length) + ".js";
@@ -395,14 +406,14 @@ function toImportPath(file, config) {
395
406
  }
396
407
  let importPath;
397
408
  if ("relativeTo" in config) {
398
- importPath = import_node_path2.default.relative(config.relativeTo, filename);
399
- if (!import_node_path2.default.isAbsolute(importPath) && !importPath.startsWith(".")) {
409
+ importPath = import_node_path3.default.relative(config.relativeTo, filename);
410
+ if (!import_node_path3.default.isAbsolute(importPath) && !importPath.startsWith(".")) {
400
411
  importPath = `./${importPath}`;
401
412
  }
402
413
  } else {
403
- importPath = import_node_path2.default.resolve(filename);
414
+ importPath = import_node_path3.default.resolve(filename);
404
415
  }
405
- return importPath.replaceAll(import_node_path2.default.sep, "/");
416
+ return importPath.replaceAll(import_node_path3.default.sep, "/");
406
417
  }
407
418
 
408
419
  // src/utils/collections.ts
@@ -423,12 +434,7 @@ function isFileSupported(filePath, collection) {
423
434
  return false;
424
435
  }
425
436
 
426
- // src/map/generate.ts
427
- async function readFileWithCache(file) {
428
- const cached = fileCache.read("read-file", file);
429
- if (cached) return cached;
430
- return (await fs2.readFile(file)).toString();
431
- }
437
+ // src/next/map/generate.ts
432
438
  async function generateJS(configPath, config, importPath, configHash = false) {
433
439
  let asyncInit = false;
434
440
  const lines = [
@@ -492,14 +498,18 @@ async function generateJS(configPath, config, importPath, configHash = false) {
492
498
  specifier: "fumadocs-mdx/runtime/async",
493
499
  names: ["_runtimeAsync", "buildConfig"]
494
500
  }),
495
- "const _sourceConfig = buildConfig(_source)"
501
+ "const _sourceConfig = buildConfig(_source)",
502
+ getImportCode({
503
+ type: "default",
504
+ name: "path",
505
+ specifier: "node:path"
506
+ })
496
507
  );
497
508
  asyncInit = true;
498
509
  }
499
510
  const entries2 = files.map(async (file) => {
500
- const parsed = fumaMatter(
501
- await readFileWithCache(file.fullPath).catch(() => "")
502
- );
511
+ const content = await readFileWithCache(file.fullPath).catch(() => "");
512
+ const parsed = fumaMatter(content);
503
513
  let data = parsed.data;
504
514
  if (collection.schema) {
505
515
  data = await validate(
@@ -513,12 +523,15 @@ async function generateJS(configPath, config, importPath, configHash = false) {
513
523
  if (config.global?.lastModifiedTime === "git") {
514
524
  lastModified = await getGitTimestamp(file.fullPath);
515
525
  }
516
- return JSON.stringify({
517
- info: file,
518
- lastModified,
519
- data,
520
- content: { body: parsed.content, matter: parsed.matter }
521
- });
526
+ const hash = (0, import_node_crypto.createHash)("md5").update(content).digest("hex");
527
+ const infoStr = [];
528
+ for (const [k, v] of Object.entries({ ...file, hash })) {
529
+ infoStr.push(`${k}: ${JSON.stringify(v)}`);
530
+ }
531
+ infoStr.push(
532
+ `absolutePath: path.resolve(${JSON.stringify(file.fullPath)})`
533
+ );
534
+ return `{ info: { ${infoStr.join(", ")} }, lastModified: ${JSON.stringify(lastModified)}, data: ${JSON.stringify(data)} }`;
522
535
  });
523
536
  return Promise.all(entries2);
524
537
  }
@@ -558,11 +571,11 @@ async function getCollectionFiles(collection) {
558
571
  await Promise.all(
559
572
  dirs.map(async (dir) => {
560
573
  const result = await (0, import_tinyglobby.glob)(patterns, {
561
- cwd: path4.resolve(dir)
574
+ cwd: path5.resolve(dir)
562
575
  });
563
576
  for (const item of result) {
564
577
  if (!isFileSupported(item, collection)) continue;
565
- const fullPath = path4.join(dir, item);
578
+ const fullPath = path5.join(dir, item);
566
579
  files.set(fullPath, {
567
580
  path: item,
568
581
  fullPath
@@ -573,7 +586,7 @@ async function getCollectionFiles(collection) {
573
586
  return Array.from(files.values());
574
587
  }
575
588
  function parseMetaEntry(file, content) {
576
- const extname2 = path4.extname(file);
589
+ const extname2 = path5.extname(file);
577
590
  try {
578
591
  if (extname2 === ".json") return JSON.parse(content);
579
592
  if (extname2 === ".yaml") return (0, import_js_yaml2.load)(content);
@@ -585,13 +598,20 @@ function parseMetaEntry(file, content) {
585
598
  throw new Error(`Unknown meta file format: ${extname2}, in ${file}.`);
586
599
  }
587
600
 
588
- // src/map/index.ts
589
- var path5 = __toESM(require("path"), 1);
601
+ // src/loaders/config/index.ts
602
+ var import_node_path4 = __toESM(require("path"), 1);
603
+ function findConfigFile() {
604
+ return import_node_path4.default.resolve("source.config.ts");
605
+ }
606
+
607
+ // src/next/map/index.ts
608
+ var path7 = __toESM(require("path"), 1);
590
609
  var fs3 = __toESM(require("fs/promises"), 1);
610
+ init_load();
591
611
  async function start(dev, configPath, outDir) {
592
612
  let configHash = await getConfigHash(configPath);
593
613
  let config = await loadConfig(configPath, outDir, configHash, true);
594
- const outPath = path5.resolve(outDir, `index.ts`);
614
+ const outPath = path7.resolve(outDir, `index.ts`);
595
615
  async function updateMapFile() {
596
616
  const start2 = performance.now();
597
617
  try {
@@ -622,14 +642,14 @@ async function start(dev, configPath, outDir) {
622
642
  });
623
643
  instance.on("all", (event, file) => {
624
644
  if (typeof file !== "string") return;
625
- const absolutePath = path5.resolve(file);
645
+ const absolutePath = path7.resolve(file);
626
646
  const onUpdate = async () => {
627
647
  const isConfigFile = absolutePath === configPath;
628
648
  if (isConfigFile) {
629
649
  configHash = await getConfigHash(configPath);
630
650
  config = await loadConfig(configPath, outDir, configHash, true);
631
651
  }
632
- if (event === "change") fileCache.removeCache(absolutePath);
652
+ if (event === "change") removeFileCache(absolutePath);
633
653
  await updateMapFile();
634
654
  };
635
655
  void onUpdate();
@@ -715,11 +735,11 @@ function createMDX({
715
735
  // src/next/index.ts
716
736
  async function postInstall(configPath = findConfigFile(), outDir = ".source") {
717
737
  const config = await loadConfig(configPath, outDir, void 0, true);
718
- const outPath = import_node_path3.default.join(outDir, "index.ts");
719
- await import_promises.default.rm(outDir, { recursive: true });
720
- await import_promises.default.mkdir(outDir, { recursive: true });
738
+ const outPath = import_node_path5.default.join(outDir, "index.ts");
739
+ await import_promises2.default.rm(outDir, { recursive: true });
740
+ await import_promises2.default.mkdir(outDir, { recursive: true });
721
741
  const hash = await getConfigHash(configPath);
722
- await import_promises.default.writeFile(
742
+ await import_promises2.default.writeFile(
723
743
  outPath,
724
744
  await generateJS(configPath, config, { relativeTo: outDir }, hash)
725
745
  );
@@ -4,57 +4,36 @@ import {
4
4
  isFileSupported,
5
5
  toImportPath
6
6
  } from "../chunk-6Y5JDZHD.js";
7
+ import {
8
+ getConfigHash,
9
+ loadConfig
10
+ } from "../chunk-LGYVNESJ.js";
7
11
  import {
8
12
  ValidationError,
9
13
  getGitTimestamp,
10
14
  validate
11
15
  } from "../chunk-IQAEAI4P.js";
12
16
  import {
13
- findConfigFile,
14
- getConfigHash,
15
- loadConfig
16
- } from "../chunk-POXTQZ4D.js";
17
- import "../chunk-YC25YEBF.js";
17
+ findConfigFile
18
+ } from "../chunk-XMFLD5J6.js";
19
+ import {
20
+ readFileWithCache,
21
+ removeFileCache
22
+ } from "../chunk-ADR6R7HM.js";
23
+ import "../chunk-U4MQ44TS.js";
18
24
  import {
19
25
  fumaMatter
20
26
  } from "../chunk-VWJKRQZR.js";
21
27
 
22
28
  // src/next/index.ts
23
29
  import path3 from "path";
24
- import fs3 from "fs/promises";
30
+ import fs2 from "fs/promises";
25
31
 
26
- // src/map/generate.ts
32
+ // src/next/map/generate.ts
27
33
  import * as path from "path";
28
- import * as fs from "fs/promises";
34
+ import { createHash } from "crypto";
29
35
  import { glob } from "tinyglobby";
30
-
31
- // src/map/file-cache.ts
32
- import { LRUCache } from "lru-cache";
33
- var map = new LRUCache({
34
- max: 200
35
- });
36
- var fileCache = {
37
- read(namespace, path4) {
38
- return map.get(`${namespace}.${path4}`);
39
- },
40
- write(namespace, path4, data) {
41
- map.set(`${namespace}.${path4}`, data);
42
- },
43
- removeCache(path4) {
44
- for (const key of map.keys()) {
45
- const keyPath = key.slice(key.indexOf(".") + 1);
46
- if (keyPath === path4) map.delete(key);
47
- }
48
- }
49
- };
50
-
51
- // src/map/generate.ts
52
36
  import { load } from "js-yaml";
53
- async function readFileWithCache(file) {
54
- const cached = fileCache.read("read-file", file);
55
- if (cached) return cached;
56
- return (await fs.readFile(file)).toString();
57
- }
58
37
  async function generateJS(configPath, config, importPath, configHash = false) {
59
38
  let asyncInit = false;
60
39
  const lines = [
@@ -118,14 +97,18 @@ async function generateJS(configPath, config, importPath, configHash = false) {
118
97
  specifier: "fumadocs-mdx/runtime/async",
119
98
  names: ["_runtimeAsync", "buildConfig"]
120
99
  }),
121
- "const _sourceConfig = buildConfig(_source)"
100
+ "const _sourceConfig = buildConfig(_source)",
101
+ getImportCode({
102
+ type: "default",
103
+ name: "path",
104
+ specifier: "node:path"
105
+ })
122
106
  );
123
107
  asyncInit = true;
124
108
  }
125
109
  const entries2 = files.map(async (file) => {
126
- const parsed = fumaMatter(
127
- await readFileWithCache(file.fullPath).catch(() => "")
128
- );
110
+ const content = await readFileWithCache(file.fullPath).catch(() => "");
111
+ const parsed = fumaMatter(content);
129
112
  let data = parsed.data;
130
113
  if (collection.schema) {
131
114
  data = await validate(
@@ -139,12 +122,15 @@ async function generateJS(configPath, config, importPath, configHash = false) {
139
122
  if (config.global?.lastModifiedTime === "git") {
140
123
  lastModified = await getGitTimestamp(file.fullPath);
141
124
  }
142
- return JSON.stringify({
143
- info: file,
144
- lastModified,
145
- data,
146
- content: { body: parsed.content, matter: parsed.matter }
147
- });
125
+ const hash = createHash("md5").update(content).digest("hex");
126
+ const infoStr = [];
127
+ for (const [k, v] of Object.entries({ ...file, hash })) {
128
+ infoStr.push(`${k}: ${JSON.stringify(v)}`);
129
+ }
130
+ infoStr.push(
131
+ `absolutePath: path.resolve(${JSON.stringify(file.fullPath)})`
132
+ );
133
+ return `{ info: { ${infoStr.join(", ")} }, lastModified: ${JSON.stringify(lastModified)}, data: ${JSON.stringify(data)} }`;
148
134
  });
149
135
  return Promise.all(entries2);
150
136
  }
@@ -211,9 +197,9 @@ function parseMetaEntry(file, content) {
211
197
  throw new Error(`Unknown meta file format: ${extname2}, in ${file}.`);
212
198
  }
213
199
 
214
- // src/map/index.ts
200
+ // src/next/map/index.ts
215
201
  import * as path2 from "path";
216
- import * as fs2 from "fs/promises";
202
+ import * as fs from "fs/promises";
217
203
  async function start(dev, configPath, outDir) {
218
204
  let configHash = await getConfigHash(configPath);
219
205
  let config = await loadConfig(configPath, outDir, configHash, true);
@@ -221,7 +207,7 @@ async function start(dev, configPath, outDir) {
221
207
  async function updateMapFile() {
222
208
  const start2 = performance.now();
223
209
  try {
224
- await fs2.writeFile(
210
+ await fs.writeFile(
225
211
  outPath,
226
212
  await generateJS(
227
213
  configPath,
@@ -241,7 +227,7 @@ async function start(dev, configPath, outDir) {
241
227
  }
242
228
  await updateMapFile();
243
229
  if (dev) {
244
- const { watcher } = await import("../watcher-4NDMOH4R.js");
230
+ const { watcher } = await import("../watcher-HGOH3APP.js");
245
231
  const instance = watcher(configPath, config, [outPath]);
246
232
  instance.on("ready", () => {
247
233
  console.log("[MDX] started dev server");
@@ -255,7 +241,7 @@ async function start(dev, configPath, outDir) {
255
241
  configHash = await getConfigHash(configPath);
256
242
  config = await loadConfig(configPath, outDir, configHash, true);
257
243
  }
258
- if (event === "change") fileCache.removeCache(absolutePath);
244
+ if (event === "change") removeFileCache(absolutePath);
259
245
  await updateMapFile();
260
246
  };
261
247
  void onUpdate();
@@ -342,10 +328,10 @@ function createMDX({
342
328
  async function postInstall(configPath = findConfigFile(), outDir = ".source") {
343
329
  const config = await loadConfig(configPath, outDir, void 0, true);
344
330
  const outPath = path3.join(outDir, "index.ts");
345
- await fs3.rm(outDir, { recursive: true });
346
- await fs3.mkdir(outDir, { recursive: true });
331
+ await fs2.rm(outDir, { recursive: true });
332
+ await fs2.mkdir(outDir, { recursive: true });
347
333
  const hash = await getConfigHash(configPath);
348
- await fs3.writeFile(
334
+ await fs2.writeFile(
349
335
  outPath,
350
336
  await generateJS(configPath, config, { relativeTo: outDir }, hash)
351
337
  );