fumadocs-mdx 14.0.2 → 14.0.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.
package/dist/bun/index.js CHANGED
@@ -11,12 +11,12 @@ import {
11
11
  import {
12
12
  createIntegratedConfigLoader,
13
13
  toBun
14
- } from "../chunk-OLL7FM7W.js";
14
+ } from "../chunk-NKIL543T.js";
15
15
  import "../chunk-4JSFLXXT.js";
16
16
  import {
17
17
  _Defaults,
18
18
  createCore
19
- } from "../chunk-GB4W3YCZ.js";
19
+ } from "../chunk-K4KWUM3J.js";
20
20
  import "../chunk-WBIHDYMN.js";
21
21
  import "../chunk-VWJKRQZR.js";
22
22
 
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createCore
3
- } from "./chunk-GB4W3YCZ.js";
3
+ } from "./chunk-K4KWUM3J.js";
4
4
 
5
5
  // src/webpack/index.ts
6
6
  var core;
@@ -13,7 +13,8 @@ ${issues.map((issue) => ` ${issue.path}: ${issue.message}`).join("\n")}`
13
13
  this.issues = issues;
14
14
  }
15
15
  async toStringFormatted() {
16
- const picocolors = await import("picocolors");
16
+ const picocolorsModule = await import("picocolors");
17
+ const picocolors = picocolorsModule.default ?? picocolorsModule;
17
18
  return [
18
19
  picocolors.bold(`[MDX] ${this.title}:`),
19
20
  ...this.issues.map(
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ValidationError
3
- } from "./chunk-GB4W3YCZ.js";
3
+ } from "./chunk-K4KWUM3J.js";
4
4
 
5
5
  // src/loaders/adapter.ts
6
6
  import { fileURLToPath } from "url";
@@ -1,7 +1,7 @@
1
1
  import { C as CoreOptions } from './core-C3QZSdEx.js';
2
2
 
3
3
  interface WebpackLoaderOptions extends CoreOptions {
4
- compiledConfigPath: string;
4
+ absoluteCompiledConfigPath: string;
5
5
  isDev: boolean;
6
6
  }
7
7
 
@@ -267,7 +267,8 @@ ${issues.map((issue) => ` ${issue.path}: ${issue.message}`).join("\n")}`
267
267
  this.issues = issues;
268
268
  }
269
269
  async toStringFormatted() {
270
- const picocolors = await import("picocolors");
270
+ const picocolorsModule = await import("picocolors");
271
+ const picocolors = picocolorsModule.default ?? picocolorsModule;
271
272
  return [
272
273
  picocolors.bold(`[MDX] ${this.title}:`),
273
274
  ...this.issues.map(
@@ -948,7 +949,7 @@ function createMDX(createOptions = {}) {
948
949
  return (nextConfig = {}) => {
949
950
  const loaderOptions = {
950
951
  ...core.getOptions(),
951
- compiledConfigPath: core.getCompiledConfigPath(),
952
+ absoluteCompiledConfigPath: path5.resolve(core.getCompiledConfigPath()),
952
953
  isDev
953
954
  };
954
955
  const turbopack = {
@@ -1005,8 +1006,8 @@ function createMDX(createOptions = {}) {
1005
1006
  },
1006
1007
  {
1007
1008
  test: metaLoaderGlob,
1009
+ enforce: "pre",
1008
1010
  use: [
1009
- options.defaultLoaders.babel,
1010
1011
  {
1011
1012
  loader: "fumadocs-mdx/loader-meta",
1012
1013
  options: loaderOptions
@@ -11,7 +11,7 @@ import {
11
11
  ValidationError,
12
12
  _Defaults,
13
13
  createCore
14
- } from "../chunk-GB4W3YCZ.js";
14
+ } from "../chunk-K4KWUM3J.js";
15
15
  import {
16
16
  indexFile
17
17
  } from "../chunk-ED3ON275.js";
@@ -31,7 +31,7 @@ function createMDX(createOptions = {}) {
31
31
  return (nextConfig = {}) => {
32
32
  const loaderOptions = {
33
33
  ...core.getOptions(),
34
- compiledConfigPath: core.getCompiledConfigPath(),
34
+ absoluteCompiledConfigPath: path.resolve(core.getCompiledConfigPath()),
35
35
  isDev
36
36
  };
37
37
  const turbopack = {
@@ -88,8 +88,8 @@ function createMDX(createOptions = {}) {
88
88
  },
89
89
  {
90
90
  test: metaLoaderGlob,
91
+ enforce: "pre",
91
92
  use: [
92
- options.defaultLoaders.babel,
93
93
  {
94
94
  loader: "fumadocs-mdx/loader-meta",
95
95
  options: loaderOptions
@@ -7,12 +7,12 @@ import {
7
7
  import {
8
8
  createStandaloneConfigLoader,
9
9
  toNode
10
- } from "../chunk-OLL7FM7W.js";
10
+ } from "../chunk-NKIL543T.js";
11
11
  import "../chunk-4JSFLXXT.js";
12
12
  import {
13
13
  _Defaults,
14
14
  createCore
15
- } from "../chunk-GB4W3YCZ.js";
15
+ } from "../chunk-K4KWUM3J.js";
16
16
  import "../chunk-WBIHDYMN.js";
17
17
  import "../chunk-VWJKRQZR.js";
18
18
 
@@ -13,7 +13,7 @@ import 'fumadocs-core/toc';
13
13
  import 'mdast';
14
14
  import 'mdx/types';
15
15
 
16
- type VersionControlFn = (filePath: string) => Promise<Date | undefined>;
16
+ type VersionControlFn = (filePath: string) => Promise<Date | null | undefined>;
17
17
  interface LastModifiedPluginOptions {
18
18
  /**
19
19
  * Version control to obtain the last modified time.
@@ -49,7 +49,7 @@ function lastModified(options = {}) {
49
49
  async vfile(file) {
50
50
  if (!filter(this.collection.name)) return;
51
51
  const timestamp = await fn(this.filePath);
52
- if (timestamp !== void 0) {
52
+ if (timestamp) {
53
53
  file.data["mdx-export"] ??= [];
54
54
  file.data["mdx-export"].push({
55
55
  name: "lastModified",
@@ -71,10 +71,11 @@ async function getGitTimestamp(file) {
71
71
  throwOnError: true
72
72
  }
73
73
  );
74
- return new Date(out.stdout);
74
+ const date = new Date(out.stdout);
75
+ return isNaN(date.getTime()) ? null : date;
75
76
  })();
76
77
  cache.set(file, timePromise);
77
- return timePromise.catch(() => void 0);
78
+ return timePromise.catch(() => null);
78
79
  }
79
80
  export {
80
81
  lastModified as default
@@ -11,7 +11,7 @@ import {
11
11
  import "../chunk-S7KOJHHO.js";
12
12
  import {
13
13
  createCore
14
- } from "../chunk-GB4W3YCZ.js";
14
+ } from "../chunk-K4KWUM3J.js";
15
15
  import "../chunk-WBIHDYMN.js";
16
16
  import {
17
17
  fumaMatter
@@ -11,13 +11,13 @@ import {
11
11
  import {
12
12
  createIntegratedConfigLoader,
13
13
  toVite
14
- } from "../chunk-OLL7FM7W.js";
14
+ } from "../chunk-NKIL543T.js";
15
15
  import "../chunk-4JSFLXXT.js";
16
16
  import {
17
17
  ValidationError,
18
18
  _Defaults,
19
19
  createCore
20
- } from "../chunk-GB4W3YCZ.js";
20
+ } from "../chunk-K4KWUM3J.js";
21
21
  import {
22
22
  indexFile
23
23
  } from "../chunk-ED3ON275.js";
@@ -1,5 +1,5 @@
1
1
  import { LoaderContext } from 'webpack';
2
- import { W as WebpackLoaderOptions } from '../index-RVIZxMZG.js';
2
+ import { W as WebpackLoaderOptions } from '../index-DG1I0CwF.js';
3
3
  import '../core-C3QZSdEx.js';
4
4
  import '@mdx-js/mdx';
5
5
  import '@standard-schema/spec';
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  getCore
3
- } from "../chunk-Q5OSGLJL.js";
3
+ } from "../chunk-CGGDM5F3.js";
4
4
  import {
5
5
  createMdxLoader
6
6
  } from "../chunk-USWQVJWR.js";
7
7
  import {
8
8
  createStandaloneConfigLoader,
9
9
  toWebpack
10
- } from "../chunk-OLL7FM7W.js";
10
+ } from "../chunk-NKIL543T.js";
11
11
  import "../chunk-4JSFLXXT.js";
12
- import "../chunk-GB4W3YCZ.js";
12
+ import "../chunk-K4KWUM3J.js";
13
13
  import "../chunk-WBIHDYMN.js";
14
14
  import "../chunk-VWJKRQZR.js";
15
15
 
@@ -18,7 +18,7 @@ var instance;
18
18
  async function loader(source, callback) {
19
19
  const options = this.getOptions();
20
20
  this.cacheable(true);
21
- this.addDependency(options.compiledConfigPath);
21
+ this.addDependency(options.absoluteCompiledConfigPath);
22
22
  if (!instance) {
23
23
  instance = toWebpack(
24
24
  createMdxLoader(
@@ -1,5 +1,5 @@
1
1
  import { LoaderContext } from 'webpack';
2
- import { W as WebpackLoaderOptions } from '../index-RVIZxMZG.js';
2
+ import { W as WebpackLoaderOptions } from '../index-DG1I0CwF.js';
3
3
  import '../core-C3QZSdEx.js';
4
4
  import '@mdx-js/mdx';
5
5
  import '@standard-schema/spec';
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  getCore
3
- } from "../chunk-Q5OSGLJL.js";
3
+ } from "../chunk-CGGDM5F3.js";
4
4
  import {
5
5
  createMetaLoader
6
6
  } from "../chunk-TYJDYTKH.js";
7
7
  import {
8
8
  createStandaloneConfigLoader,
9
9
  toWebpack
10
- } from "../chunk-OLL7FM7W.js";
10
+ } from "../chunk-NKIL543T.js";
11
11
  import "../chunk-4JSFLXXT.js";
12
- import "../chunk-GB4W3YCZ.js";
12
+ import "../chunk-K4KWUM3J.js";
13
13
  import "../chunk-WBIHDYMN.js";
14
14
 
15
15
  // src/webpack/meta.ts
@@ -17,7 +17,7 @@ var instance;
17
17
  async function loader(source, callback) {
18
18
  const options = this.getOptions();
19
19
  this.cacheable(true);
20
- this.addDependency(options.compiledConfigPath);
20
+ this.addDependency(options.absoluteCompiledConfigPath);
21
21
  if (!instance) {
22
22
  instance = toWebpack(
23
23
  createMetaLoader(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-mdx",
3
- "version": "14.0.2",
3
+ "version": "14.0.4",
4
4
  "description": "The built-in source for Fumadocs",
5
5
  "keywords": [
6
6
  "NextJs",
@@ -59,7 +59,7 @@
59
59
  "dependencies": {
60
60
  "@mdx-js/mdx": "^3.1.1",
61
61
  "@standard-schema/spec": "^1.0.0",
62
- "chokidar": "^4.0.3",
62
+ "chokidar": "^5.0.0",
63
63
  "esbuild": "^0.27.0",
64
64
  "estree-util-value-to-estree": "^3.5.0",
65
65
  "js-yaml": "^4.1.1",
@@ -97,7 +97,7 @@
97
97
  "webpack": "^5.102.1",
98
98
  "@fumadocs/mdx-remote": "1.4.3",
99
99
  "eslint-config-custom": "0.0.0",
100
- "fumadocs-core": "16.0.14",
100
+ "fumadocs-core": "16.2.0",
101
101
  "tsconfig": "0.0.0"
102
102
  },
103
103
  "peerDependencies": {