fumadocs-mdx 10.0.0 → 10.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.
@@ -4,6 +4,7 @@ import fs from "node:fs";
4
4
 
5
5
  // src/config/load.ts
6
6
  import * as path from "node:path";
7
+ import { pathToFileURL } from "node:url";
7
8
  import { build } from "esbuild";
8
9
 
9
10
  // src/config/validate.ts
@@ -58,9 +59,10 @@ async function loadConfig(configPath) {
58
59
  if (transformed.errors.length > 0) {
59
60
  throw new Error("failed to compile configuration file");
60
61
  }
62
+ const url = pathToFileURL(outputPath);
61
63
  const [err, config] = validateConfig(
62
64
  // every call to `loadConfig` will cause the previous cache to be ignored
63
- await import(`${outputPath}?hash=${Date.now().toString()}`)
65
+ await import(`${url.toString()}?hash=${Date.now().toString()}`)
64
66
  );
65
67
  if (err !== null) throw new Error(err);
66
68
  return config;
@@ -2,7 +2,7 @@ import {
2
2
  getConfigHash,
3
3
  getKey,
4
4
  loadConfigCached
5
- } from "./chunk-EKBKQCSU.mjs";
5
+ } from "./chunk-P6WKCOD5.mjs";
6
6
  import {
7
7
  getDefaultMDXOptions
8
8
  } from "./chunk-LRV535YP.mjs";
@@ -5,7 +5,7 @@ import {
5
5
  loadConfig,
6
6
  loadConfigCached,
7
7
  writeManifest
8
- } from "../chunk-EKBKQCSU.mjs";
8
+ } from "../chunk-P6WKCOD5.mjs";
9
9
 
10
10
  // src/next/create.ts
11
11
  import path3 from "node:path";
@@ -91,11 +91,11 @@ async function generateJS(configPath, config, outputPath, hash) {
91
91
  return [...imports, ...sources].join("\n");
92
92
  }
93
93
  function toImportPath(file, dir) {
94
- let importPath = path.relative(dir, file).replaceAll(path.sep, "/");
95
- if (!importPath.startsWith(".")) {
94
+ let importPath = path.relative(dir, file);
95
+ if (!path.isAbsolute(importPath) && !importPath.startsWith(".")) {
96
96
  importPath = `./${importPath}`;
97
97
  }
98
- return importPath;
98
+ return importPath.replaceAll(path.sep, "/");
99
99
  }
100
100
  function generateTypes(configPath, config, outputPath) {
101
101
  const importPath = JSON.stringify(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-mdx",
3
- "version": "10.0.0",
3
+ "version": "10.0.1",
4
4
  "description": "The built-in source for Fumadocs",
5
5
  "keywords": [
6
6
  "NextJs",
@@ -64,7 +64,7 @@
64
64
  "unified": "^11.0.5",
65
65
  "webpack": "^5.90.3",
66
66
  "eslint-config-custom": "0.0.0",
67
- "fumadocs-core": "13.4.2",
67
+ "fumadocs-core": "13.4.5",
68
68
  "tsconfig": "0.0.0"
69
69
  },
70
70
  "peerDependencies": {