fumadocs-mdx 11.6.3 → 11.6.5

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.
@@ -1,7 +1,7 @@
1
1
  // src/mdx-plugins/remark-include.ts
2
2
  import { visit } from "unist-util-visit";
3
- import * as path from "node:path";
4
- import * as fs from "node:fs/promises";
3
+ import * as path from "path";
4
+ import * as fs from "fs/promises";
5
5
  import matter from "gray-matter";
6
6
  function flattenNode(node) {
7
7
  if ("children" in node)
@@ -1,5 +1,5 @@
1
1
  // src/runtime/index.ts
2
- import fs from "node:fs";
2
+ import fs from "fs";
3
3
  var _runtime = {
4
4
  doc(files) {
5
5
  return files.map((file) => {
@@ -82,7 +82,10 @@ function getDefaultMDXOptions({
82
82
  ],
83
83
  remarkImageOptions !== false && [plugins.remarkImage, remarkImageOptions],
84
84
  // Fumadocs 14 compatibility
85
- "remarkCodeTab" in plugins && remarkCodeTabOptions !== false && plugins.remarkCodeTab,
85
+ "remarkCodeTab" in plugins && remarkCodeTabOptions !== false && [
86
+ plugins.remarkCodeTab,
87
+ remarkCodeTabOptions
88
+ ],
86
89
  ...v,
87
90
  remarkStructureOptions !== false && [
88
91
  plugins.remarkStructure,
@@ -3,9 +3,9 @@ import {
3
3
  } from "./chunk-DRVUBK5B.js";
4
4
 
5
5
  // src/utils/config.ts
6
- import * as fs from "node:fs/promises";
7
- import * as path from "node:path";
8
- import { pathToFileURL } from "node:url";
6
+ import * as fs from "fs/promises";
7
+ import * as path from "path";
8
+ import { pathToFileURL } from "url";
9
9
  function findConfigFile() {
10
10
  return path.resolve("source.config.ts");
11
11
  }
@@ -181,7 +181,10 @@ function getDefaultMDXOptions({
181
181
  ],
182
182
  remarkImageOptions !== false && [plugins.remarkImage, remarkImageOptions],
183
183
  // Fumadocs 14 compatibility
184
- "remarkCodeTab" in plugins && remarkCodeTabOptions !== false && plugins.remarkCodeTab,
184
+ "remarkCodeTab" in plugins && remarkCodeTabOptions !== false && [
185
+ plugins.remarkCodeTab,
186
+ remarkCodeTabOptions
187
+ ],
185
188
  ...v,
186
189
  remarkStructureOptions !== false && [
187
190
  plugins.remarkStructure,
@@ -1,4 +1,4 @@
1
- export { a as BaseCollection, B as BaseCollectionEntry, C as CollectionSchema, h as DefaultMDXOptions, D as DocCollection, c as DocsCollection, F as FileInfo, G as GlobalConfig, M as MarkdownProps, b as MetaCollection, d as defineCollections, g as defineConfig, e as defineDocs, f as frontmatterSchema, i as getDefaultMDXOptions, m as metaSchema } from '../define-Cbpc-b73.cjs';
1
+ export { a as BaseCollection, B as BaseCollectionEntry, C as CollectionSchema, h as DefaultMDXOptions, D as DocCollection, c as DocsCollection, F as FileInfo, G as GlobalConfig, M as MarkdownProps, b as MetaCollection, d as defineCollections, g as defineConfig, e as defineDocs, f as frontmatterSchema, i as getDefaultMDXOptions, m as metaSchema } from '../define-uoePrCQ_.cjs';
2
2
  import { Processor, Transformer } from 'unified';
3
3
  import { Root } from 'mdast';
4
4
  import '@mdx-js/mdx';
@@ -1,4 +1,4 @@
1
- export { a as BaseCollection, B as BaseCollectionEntry, C as CollectionSchema, h as DefaultMDXOptions, D as DocCollection, c as DocsCollection, F as FileInfo, G as GlobalConfig, M as MarkdownProps, b as MetaCollection, d as defineCollections, g as defineConfig, e as defineDocs, f as frontmatterSchema, i as getDefaultMDXOptions, m as metaSchema } from '../define-Cbpc-b73.js';
1
+ export { a as BaseCollection, B as BaseCollectionEntry, C as CollectionSchema, h as DefaultMDXOptions, D as DocCollection, c as DocsCollection, F as FileInfo, G as GlobalConfig, M as MarkdownProps, b as MetaCollection, d as defineCollections, g as defineConfig, e as defineDocs, f as frontmatterSchema, i as getDefaultMDXOptions, m as metaSchema } from '../define-uoePrCQ_.js';
2
2
  import { Processor, Transformer } from 'unified';
3
3
  import { Root } from 'mdast';
4
4
  import '@mdx-js/mdx';
@@ -4,10 +4,10 @@ import {
4
4
  } from "../chunk-2ZOW45YZ.js";
5
5
  import {
6
6
  remarkInclude
7
- } from "../chunk-MK7EXW7O.js";
7
+ } from "../chunk-3UUEUK4M.js";
8
8
  import {
9
9
  getDefaultMDXOptions
10
- } from "../chunk-IOENRFUX.js";
10
+ } from "../chunk-7UCWBLFI.js";
11
11
 
12
12
  // src/config/define.ts
13
13
  function defineCollections(options) {
@@ -19,7 +19,7 @@ type DefaultMDXOptions = Omit<NonNullable<ProcessorOptions>, 'rehypePlugins' | '
19
19
  remarkStructureOptions?: plugins.StructureOptions | false;
20
20
  remarkHeadingOptions?: plugins.RemarkHeadingOptions;
21
21
  remarkImageOptions?: plugins.RemarkImageOptions | false;
22
- remarkCodeTabOptions?: false;
22
+ remarkCodeTabOptions?: plugins.RemarkCodeTabOptions | false;
23
23
  rehypeCodeOptions?: plugins.RehypeCodeOptions | false;
24
24
  };
25
25
  declare function getDefaultMDXOptions({ valueToExport, rehypeCodeOptions, remarkImageOptions, remarkHeadingOptions, remarkStructureOptions, remarkCodeTabOptions, ...mdxOptions }: DefaultMDXOptions): ProcessorOptions;
@@ -19,7 +19,7 @@ type DefaultMDXOptions = Omit<NonNullable<ProcessorOptions>, 'rehypePlugins' | '
19
19
  remarkStructureOptions?: plugins.StructureOptions | false;
20
20
  remarkHeadingOptions?: plugins.RemarkHeadingOptions;
21
21
  remarkImageOptions?: plugins.RemarkImageOptions | false;
22
- remarkCodeTabOptions?: false;
22
+ remarkCodeTabOptions?: plugins.RemarkCodeTabOptions | false;
23
23
  rehypeCodeOptions?: plugins.RehypeCodeOptions | false;
24
24
  };
25
25
  declare function getDefaultMDXOptions({ valueToExport, rehypeCodeOptions, remarkImageOptions, remarkHeadingOptions, remarkStructureOptions, remarkCodeTabOptions, ...mdxOptions }: DefaultMDXOptions): ProcessorOptions;
package/dist/index.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { PageData, MetaData, Source, VirtualFile } from 'fumadocs-core/source';
2
- import { B as BaseCollectionEntry } from './define-Cbpc-b73.cjs';
3
- import { R as Runtime } from './types-CY4MX9if.cjs';
2
+ import { B as BaseCollectionEntry } from './define-uoePrCQ_.cjs';
3
+ import { R as Runtime } from './types-Cph8Ml_K.cjs';
4
4
  import '@mdx-js/mdx';
5
5
  import 'mdx/types';
6
6
  import 'fumadocs-core/mdx-plugins';
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { PageData, MetaData, Source, VirtualFile } from 'fumadocs-core/source';
2
- import { B as BaseCollectionEntry } from './define-Cbpc-b73.js';
3
- import { R as Runtime } from './types-DeEXKgfl.js';
2
+ import { B as BaseCollectionEntry } from './define-uoePrCQ_.js';
3
+ import { R as Runtime } from './types-BvEsyMKj.js';
4
4
  import '@mdx-js/mdx';
5
5
  import 'mdx/types';
6
6
  import 'fumadocs-core/mdx-plugins';
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  _runtime,
3
3
  createMDXSource,
4
4
  resolveFiles
5
- } from "./chunk-4LSNX4UE.js";
5
+ } from "./chunk-7SSA5RCV.js";
6
6
  export {
7
7
  _runtime,
8
8
  createMDXSource,
@@ -121,7 +121,10 @@ function getDefaultMDXOptions({
121
121
  ],
122
122
  remarkImageOptions !== false && [plugins.remarkImage, remarkImageOptions],
123
123
  // Fumadocs 14 compatibility
124
- "remarkCodeTab" in plugins && remarkCodeTabOptions !== false && plugins.remarkCodeTab,
124
+ "remarkCodeTab" in plugins && remarkCodeTabOptions !== false && [
125
+ plugins.remarkCodeTab,
126
+ remarkCodeTabOptions
127
+ ],
125
128
  ...v,
126
129
  remarkStructureOptions !== false && [
127
130
  plugins.remarkStructure,
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  getConfigHash,
3
3
  loadConfig
4
- } from "./chunk-HFLDWPJA.js";
4
+ } from "./chunk-LC4HO353.js";
5
5
  import {
6
6
  validate
7
7
  } from "./chunk-2ZOW45YZ.js";
8
8
  import {
9
9
  remarkInclude
10
- } from "./chunk-MK7EXW7O.js";
10
+ } from "./chunk-3UUEUK4M.js";
11
11
  import "./chunk-DRVUBK5B.js";
12
12
 
13
13
  // src/loader-mdx.ts
14
- import * as path2 from "node:path";
15
- import { parse } from "node:querystring";
14
+ import * as path2 from "path";
15
+ import { parse } from "querystring";
16
16
  import grayMatter from "gray-matter";
17
17
 
18
18
  // src/utils/build-mdx.ts
@@ -49,8 +49,8 @@ async function buildMDX(cacheKey, source, options = {}) {
49
49
  }
50
50
 
51
51
  // src/utils/git-timestamp.ts
52
- import path from "node:path";
53
- import fs from "node:fs";
52
+ import path from "path";
53
+ import fs from "fs";
54
54
  import { spawn } from "cross-spawn";
55
55
  var cache2 = /* @__PURE__ */ new Map();
56
56
  function getGitTimestamp(file) {
@@ -104,7 +104,7 @@ async function loader(source, callback) {
104
104
  }
105
105
  let mdxOptions = collection?.mdxOptions;
106
106
  if (!mdxOptions) {
107
- const { getDefaultMDXOptions } = await import("./mdx-options-CAU273O3.js");
107
+ const { getDefaultMDXOptions } = await import("./mdx-options-7J2A6BUA.js");
108
108
  config._mdx_loader ??= {};
109
109
  const extendedOptions = config.global?.mdxOptions;
110
110
  config._mdx_loader.cachedProcessorOptions ??= typeof extendedOptions === "function" ? getDefaultMDXOptions(await extendedOptions()) : getDefaultMDXOptions(extendedOptions ?? {});
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getDefaultMDXOptions
3
- } from "./chunk-IOENRFUX.js";
3
+ } from "./chunk-7UCWBLFI.js";
4
4
  export {
5
5
  getDefaultMDXOptions
6
6
  };
@@ -36,24 +36,21 @@ __export(watcher_exports, {
36
36
  watcher: () => watcher
37
37
  });
38
38
  function watcher(configPath, config, ignored) {
39
- const deps = [configPath];
40
- function add(dir) {
41
- if (Array.isArray(dir)) deps.push(...dir);
42
- else deps.push(dir);
43
- }
39
+ const watcher2 = new import_chokidar.FSWatcher({
40
+ ignoreInitial: true,
41
+ persistent: true,
42
+ ignored
43
+ });
44
+ watcher2.add(configPath);
44
45
  for (const collection of config.collections.values()) {
45
46
  if (collection.type === "docs") {
46
- add(collection.docs.dir);
47
- add(collection.meta.dir);
47
+ watcher2.add(collection.docs.dir);
48
+ watcher2.add(collection.meta.dir);
48
49
  } else {
49
- add(collection.dir);
50
+ watcher2.add(collection.dir);
50
51
  }
51
52
  }
52
- return (0, import_chokidar.watch)(deps, {
53
- ignoreInitial: true,
54
- ignored,
55
- persistent: true
56
- });
53
+ return watcher2;
57
54
  }
58
55
  var import_chokidar;
59
56
  var init_watcher = __esm({
@@ -173,7 +170,7 @@ var fs3 = __toESM(require("fs/promises"), 1);
173
170
  // src/map/generate.ts
174
171
  var path2 = __toESM(require("path"), 1);
175
172
  var fs2 = __toESM(require("fs/promises"), 1);
176
- var import_fast_glob = __toESM(require("fast-glob"), 1);
173
+ var import_tinyglobby = require("tinyglobby");
177
174
 
178
175
  // src/utils/get-type-from-path.ts
179
176
  var import_node_path = require("path");
@@ -389,7 +386,7 @@ async function getCollectionFiles(collection) {
389
386
  const dirs = Array.isArray(collection.dir) ? collection.dir : [collection.dir];
390
387
  await Promise.all(
391
388
  dirs.map(async (dir) => {
392
- const result = await (0, import_fast_glob.default)(collection.files ?? "**/*", {
389
+ const result = await (0, import_tinyglobby.glob)(collection.files ?? "**/*", {
393
390
  cwd: path2.resolve(dir),
394
391
  absolute: true
395
392
  });
@@ -2,7 +2,7 @@ import {
2
2
  findConfigFile,
3
3
  getConfigHash,
4
4
  loadConfig
5
- } from "../chunk-HFLDWPJA.js";
5
+ } from "../chunk-LC4HO353.js";
6
6
  import {
7
7
  ValidationError,
8
8
  validate
@@ -10,19 +10,19 @@ import {
10
10
  import "../chunk-DRVUBK5B.js";
11
11
 
12
12
  // src/next/create.ts
13
- import path3 from "node:path";
13
+ import path3 from "path";
14
14
 
15
15
  // src/map/index.ts
16
- import * as path2 from "node:path";
17
- import * as fs2 from "node:fs/promises";
16
+ import * as path2 from "path";
17
+ import * as fs2 from "fs/promises";
18
18
 
19
19
  // src/map/generate.ts
20
- import * as path from "node:path";
21
- import * as fs from "node:fs/promises";
22
- import fg from "fast-glob";
20
+ import * as path from "path";
21
+ import * as fs from "fs/promises";
22
+ import { glob } from "tinyglobby";
23
23
 
24
24
  // src/utils/get-type-from-path.ts
25
- import { extname } from "node:path";
25
+ import { extname } from "path";
26
26
  var docTypes = [".mdx", ".md"];
27
27
  var metaTypes = [".json", ".yaml"];
28
28
  function getTypeFromPath(path5) {
@@ -178,7 +178,7 @@ async function getCollectionFiles(collection) {
178
178
  const dirs = Array.isArray(collection.dir) ? collection.dir : [collection.dir];
179
179
  await Promise.all(
180
180
  dirs.map(async (dir) => {
181
- const result = await fg(collection.files ?? "**/*", {
181
+ const result = await glob(collection.files ?? "**/*", {
182
182
  cwd: path.resolve(dir),
183
183
  absolute: true
184
184
  });
@@ -253,7 +253,7 @@ async function start(dev, configPath, outDir2) {
253
253
  }
254
254
  await updateMapFile();
255
255
  if (dev) {
256
- const { watcher } = await import("../watcher-7O2HAQ63.js");
256
+ const { watcher } = await import("../watcher-4NDMOH4R.js");
257
257
  const instance = watcher(configPath, config, [outPath]);
258
258
  instance.on("ready", () => {
259
259
  console.log("[MDX] started dev server");
@@ -338,8 +338,8 @@ function createMDX({
338
338
  }
339
339
 
340
340
  // src/postinstall.ts
341
- import * as path4 from "node:path";
342
- import * as fs3 from "node:fs/promises";
341
+ import * as path4 from "path";
342
+ import * as fs3 from "fs/promises";
343
343
  async function postInstall(configPath = findConfigFile()) {
344
344
  const jsOut = path4.resolve(".source/index.ts");
345
345
  const hash = await getConfigHash(configPath);
@@ -1,5 +1,5 @@
1
- import { L as LoadedConfig, a as RuntimeAsync } from '../types-CY4MX9if.cjs';
2
- import '../define-Cbpc-b73.cjs';
1
+ import { L as LoadedConfig, a as RuntimeAsync } from '../types-Cph8Ml_K.cjs';
2
+ import '../define-uoePrCQ_.cjs';
3
3
  import '@mdx-js/mdx';
4
4
  import 'mdx/types';
5
5
  import 'fumadocs-core/mdx-plugins';
@@ -1,5 +1,5 @@
1
- import { L as LoadedConfig, a as RuntimeAsync } from '../types-DeEXKgfl.js';
2
- import '../define-Cbpc-b73.js';
1
+ import { L as LoadedConfig, a as RuntimeAsync } from '../types-BvEsyMKj.js';
2
+ import '../define-uoePrCQ_.js';
3
3
  import '@mdx-js/mdx';
4
4
  import 'mdx/types';
5
5
  import 'fumadocs-core/mdx-plugins';
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  _runtime,
3
3
  createMDXSource
4
- } from "../chunk-4LSNX4UE.js";
4
+ } from "../chunk-7SSA5RCV.js";
5
5
  import {
6
6
  remarkInclude
7
- } from "../chunk-MK7EXW7O.js";
7
+ } from "../chunk-3UUEUK4M.js";
8
8
  import {
9
9
  buildConfig
10
10
  } from "../chunk-DRVUBK5B.js";
@@ -1,4 +1,4 @@
1
- import { D as DocCollection, b as MetaCollection, c as DocsCollection, G as GlobalConfig, F as FileInfo, M as MarkdownProps, B as BaseCollectionEntry } from './define-Cbpc-b73.js';
1
+ import { D as DocCollection, b as MetaCollection, c as DocsCollection, G as GlobalConfig, F as FileInfo, M as MarkdownProps, B as BaseCollectionEntry } from './define-uoePrCQ_.js';
2
2
  import { StandardSchemaV1 } from '@standard-schema/spec';
3
3
  import { Source, PageData, MetaData } from 'fumadocs-core/source';
4
4
  import { ProcessorOptions } from '@mdx-js/mdx';
@@ -1,4 +1,4 @@
1
- import { D as DocCollection, b as MetaCollection, c as DocsCollection, G as GlobalConfig, F as FileInfo, M as MarkdownProps, B as BaseCollectionEntry } from './define-Cbpc-b73.cjs';
1
+ import { D as DocCollection, b as MetaCollection, c as DocsCollection, G as GlobalConfig, F as FileInfo, M as MarkdownProps, B as BaseCollectionEntry } from './define-uoePrCQ_.cjs';
2
2
  import { StandardSchemaV1 } from '@standard-schema/spec';
3
3
  import { Source, PageData, MetaData } from 'fumadocs-core/source';
4
4
  import { ProcessorOptions } from '@mdx-js/mdx';
@@ -0,0 +1,22 @@
1
+ // src/map/watcher.ts
2
+ import { FSWatcher } from "chokidar";
3
+ function watcher(configPath, config, ignored) {
4
+ const watcher2 = new FSWatcher({
5
+ ignoreInitial: true,
6
+ persistent: true,
7
+ ignored
8
+ });
9
+ watcher2.add(configPath);
10
+ for (const collection of config.collections.values()) {
11
+ if (collection.type === "docs") {
12
+ watcher2.add(collection.docs.dir);
13
+ watcher2.add(collection.meta.dir);
14
+ } else {
15
+ watcher2.add(collection.dir);
16
+ }
17
+ }
18
+ return watcher2;
19
+ }
20
+ export {
21
+ watcher
22
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-mdx",
3
- "version": "11.6.3",
3
+ "version": "11.6.5",
4
4
  "description": "The built-in source for Fumadocs",
5
5
  "keywords": [
6
6
  "NextJs",
@@ -47,29 +47,29 @@
47
47
  "chokidar": "^4.0.3",
48
48
  "cross-spawn": "^7.0.6",
49
49
  "esbuild": "^0.25.4",
50
- "estree-util-value-to-estree": "^3.3.3",
51
- "fast-glob": "^3.3.3",
50
+ "estree-util-value-to-estree": "^3.4.0",
52
51
  "gray-matter": "^4.0.3",
53
52
  "js-yaml": "^4.1.0",
54
53
  "lru-cache": "^11.1.0",
55
54
  "picocolors": "^1.1.1",
55
+ "tinyglobby": "^0.2.13",
56
56
  "unist-util-visit": "^5.0.0",
57
- "zod": "^3.24.4"
57
+ "zod": "^3.25.7"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@types/cross-spawn": "^6.0.6",
61
61
  "@types/js-yaml": "^4.0.9",
62
62
  "@types/mdast": "^4.0.3",
63
63
  "@types/mdx": "^2.0.13",
64
- "@types/react": "^19.1.3",
64
+ "@types/react": "^19.1.4",
65
65
  "mdast-util-mdx-jsx": "^3.2.0",
66
- "next": "^15.3.1",
66
+ "next": "^15.3.2",
67
67
  "unified": "^11.0.5",
68
68
  "vfile": "^6.0.3",
69
- "webpack": "^5.99.8",
70
- "@fumadocs/mdx-remote": "1.3.0",
69
+ "webpack": "^5.99.9",
70
+ "@fumadocs/mdx-remote": "1.3.2",
71
71
  "eslint-config-custom": "0.0.0",
72
- "fumadocs-core": "15.3.0",
72
+ "fumadocs-core": "15.3.4",
73
73
  "tsconfig": "0.0.0"
74
74
  },
75
75
  "peerDependencies": {
@@ -1,25 +0,0 @@
1
- // src/map/watcher.ts
2
- import { watch } from "chokidar";
3
- function watcher(configPath, config, ignored) {
4
- const deps = [configPath];
5
- function add(dir) {
6
- if (Array.isArray(dir)) deps.push(...dir);
7
- else deps.push(dir);
8
- }
9
- for (const collection of config.collections.values()) {
10
- if (collection.type === "docs") {
11
- add(collection.docs.dir);
12
- add(collection.meta.dir);
13
- } else {
14
- add(collection.dir);
15
- }
16
- }
17
- return watch(deps, {
18
- ignoreInitial: true,
19
- ignored,
20
- persistent: true
21
- });
22
- }
23
- export {
24
- watcher
25
- };