fumadocs-mdx 15.6.1 → 15.6.2

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,4 +1,4 @@
1
- import { r as CoreOptions } from "../core-BItLItxM.js";
1
+ import { r as CoreOptions } from "../core-ikvOVBe5.js";
2
2
  import { n as ResolvedMacroOptions, t as MacroPluginOption } from "../options-BCId5Url.js";
3
3
  import { BunPlugin } from "bun";
4
4
  export interface MdxPluginOptions extends Pick<CoreOptions, 'configPath' | 'outDir' | 'plugins'> {
@@ -1,4 +1,4 @@
1
- import { C as DocsCollection, D as defineCollections, E as SatteriPresetOptions, F as DefaultMDXOptions, I as MDXPresetOptions, L as applyMdxPreset, O as defineConfig, P as PostprocessOptions, S as DocCollectionSatteri, T as MetaCollection, _ as BaseCollection, b as DocCollectionBase, g as AnyCollection, k as defineDocs, v as CollectionSchema, w as GlobalConfig, x as DocCollectionMdx, y as DocCollection } from "../core-BItLItxM.js";
1
+ import { C as DocsCollection, D as defineCollections, E as SatteriPresetOptions, F as DefaultMDXOptions, I as MDXPresetOptions, L as applyMdxPreset, O as defineConfig, P as PostprocessOptions, S as DocCollectionSatteri, T as MetaCollection, _ as BaseCollection, b as DocCollectionBase, g as AnyCollection, k as defineDocs, v as CollectionSchema, w as GlobalConfig, x as DocCollectionMdx, y as DocCollection } from "../core-ikvOVBe5.js";
2
2
  import { remarkInclude } from "fumadocs-core/mdx-plugins/remark-include";
3
3
  /** @deprecated import `pageSchema` from `fumadocs-core/source/schema` instead (since 16.2.3) */
4
4
  export declare const frontmatterSchema: import("zod").ZodObject<{
@@ -102,6 +102,13 @@ declare module 'satteri' {
102
102
  }
103
103
  type SatteriOptionsInput = SatteriPresetOptions$1 | ((environment: BuildEnvironment) => SatteriPresetOptions$1 | Promise<SatteriPresetOptions$1>) | undefined;
104
104
  type CollectionSchema<Schema extends StandardSchemaV1, Context> = Schema | ((ctx: Context) => Schema);
105
+ /** the file that a collection schema validates */
106
+ interface SchemaContext {
107
+ /** absolute path of the file */
108
+ path: string;
109
+ /** content of the file */
110
+ source: string;
111
+ }
105
112
  type AnyCollection = DocsCollection | DocCollection | MetaCollection;
106
113
  interface BaseCollection {
107
114
  dir: string;
@@ -109,19 +116,13 @@ interface BaseCollection {
109
116
  }
110
117
  interface MetaCollection<Schema extends StandardSchemaV1 = StandardSchemaV1> extends BaseCollection {
111
118
  type: 'meta';
112
- schema?: CollectionSchema<Schema, {
113
- path: string;
114
- source: string;
115
- }>;
119
+ schema?: CollectionSchema<Schema, SchemaContext>;
116
120
  }
117
121
  interface DocCollectionBase<Schema extends StandardSchemaV1 = StandardSchemaV1> extends BaseCollection {
118
122
  postprocess?: Partial<PostprocessOptions>;
119
123
  async?: boolean;
120
124
  dynamic?: boolean;
121
- schema?: CollectionSchema<Schema, {
122
- path: string;
123
- source: string;
124
- }>;
125
+ schema?: CollectionSchema<Schema, SchemaContext>;
125
126
  /**
126
127
  * Expose the last modified date of each document.
127
128
  *
@@ -1,4 +1,4 @@
1
- import "./core-BItLItxM.js";
1
+ import "./core-ikvOVBe5.js";
2
2
  interface WebpackLoaderOptions {
3
3
  type: 'webpack' | 'turbopack';
4
4
  /** absolute path */
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { N as ExtractedReference, a as EmitOptions, c as PluginContext, d as TransformOptions, i as EmitEntry, j as CompiledMDXProperties, l as PluginOption, n as Core, o as EmitOutput, r as CoreOptions, s as Plugin, t as CompilationContext, u as ServerContext } from "./core-BItLItxM.js";
1
+ import { N as ExtractedReference, a as EmitOptions, c as PluginContext, d as TransformOptions, i as EmitEntry, j as CompiledMDXProperties, l as PluginOption, n as Core, o as EmitOutput, r as CoreOptions, s as Plugin, t as CompilationContext, u as ServerContext } from "./core-ikvOVBe5.js";
2
2
  export type { CompilationContext, CompiledMDXProperties, Core, CoreOptions, EmitEntry, EmitOptions, EmitOutput, ExtractedReference, Plugin, PluginContext, PluginOption, ServerContext, TransformOptions };
@@ -1,4 +1,4 @@
1
- import { A as SatteriOptionsInput, N as ExtractedReference, P as PostprocessOptions, h as BuildEnvironment, v as CollectionSchema } from "../core-BItLItxM.js";
1
+ import { A as SatteriOptionsInput, N as ExtractedReference, P as PostprocessOptions, h as BuildEnvironment, v as CollectionSchema } from "../core-ikvOVBe5.js";
2
2
  import { MacroAsyncDocCollection, MacroAsyncDocsCollection, MacroDocCollection, MacroDocsCollection, MacroMetaCollection } from "../runtime/macro.js";
3
3
  import { MetaData, PageData } from "fumadocs-core/source";
4
4
  import { metaSchema, pageSchema } from "fumadocs-core/source/schema";
@@ -1,6 +1,6 @@
1
1
  // src/macro/index.ts
2
2
  function macroError() {
3
- return /* @__PURE__ */ new Error("[MDX] this macro was not compiled by the bundler plugin of `fumadocs-mdx`. To use `fumadocs-mdx/macro`, set the `include` option on your bundler plugin, and make sure this module matches its patterns.");
3
+ return /* @__PURE__ */ new Error("[MDX] this macro was not compiled by the bundler plugin of `fumadocs-mdx`. Outside the bundler, like in a script or a test, run it with the Bun or Node loader of `fumadocs-mdx`: https://fumadocs.dev/docs/mdx/loader. In the bundler, set the `include` option on your bundler plugin, and make sure this module matches its patterns.");
4
4
  }
5
5
  /**
6
6
  * Define a docs collection (doc + meta), compiled by the bundler plugin.
@@ -1,4 +1,4 @@
1
- import { p as IndexFilePluginOptions, r as CoreOptions } from "../core-BItLItxM.js";
1
+ import { p as IndexFilePluginOptions, r as CoreOptions } from "../core-ikvOVBe5.js";
2
2
  import { t as MacroPluginOption } from "../options-BCId5Url.js";
3
3
  import { NextConfig } from "next";
4
4
  export interface CreateMDXOptions extends Pick<CoreOptions, 'configPath' | 'outDir'> {
@@ -42,7 +42,7 @@ function createMDX(options = {}) {
42
42
  rules: {
43
43
  ...nextConfig.turbopack?.rules,
44
44
  ...macro ? Object.fromEntries(macro.include.map((pattern) => [pattern, {
45
- condition: { content: /['"]fumadocs-mdx\/macro['"]/ },
45
+ condition: { all: [{ not: "foreign" }, { content: /['"]fumadocs-mdx\/macro['"]/ }] },
46
46
  loaders: [{
47
47
  loader: "fumadocs-mdx/webpack/macro",
48
48
  options: turbopackLoaderOptions
@@ -1,4 +1,4 @@
1
- import { r as CoreOptions } from "../core-BItLItxM.js";
1
+ import { r as CoreOptions } from "../core-ikvOVBe5.js";
2
2
  import { t as MacroPluginOption } from "../options-BCId5Url.js";
3
3
  export interface NodeLoaderOptions extends Pick<CoreOptions, 'configPath' | 'outDir' | 'plugins'> {
4
4
  /**
@@ -1,2 +1,2 @@
1
- import { f as IndexFilePlugin, m as indexFile, p as IndexFilePluginOptions } from "../core-BItLItxM.js";
1
+ import { f as IndexFilePlugin, m as indexFile, p as IndexFilePluginOptions } from "../core-ikvOVBe5.js";
2
2
  export { IndexFilePlugin, IndexFilePluginOptions, indexFile as default };
@@ -1,4 +1,4 @@
1
- import { s as Plugin } from "../core-BItLItxM.js";
1
+ import { s as Plugin } from "../core-ikvOVBe5.js";
2
2
  export interface JSONSchemaOptions {
3
3
  /**
4
4
  * insert `$schema` field to JSON files on creation.
@@ -1,4 +1,4 @@
1
- import { M as LastModifiedFn, s as Plugin } from "../core-BItLItxM.js";
1
+ import { M as LastModifiedFn, s as Plugin } from "../core-ikvOVBe5.js";
2
2
  export interface LastModifiedPluginOptions {
3
3
  /**
4
4
  * Version control to obtain the last modified time.
@@ -1,4 +1,4 @@
1
- import { r as CoreOptions } from "../core-BItLItxM.js";
1
+ import { r as CoreOptions } from "../core-ikvOVBe5.js";
2
2
  import { t as MacroPluginOption } from "../options-BCId5Url.js";
3
3
  import { RolldownPlugin } from "rolldown";
4
4
  export interface PluginOptions extends Pick<CoreOptions, 'configPath' | 'outDir' | 'plugins'> {
@@ -1,4 +1,4 @@
1
- import { C as DocsCollection, N as ExtractedReference, j as CompiledMDXProperties, y as DocCollection } from "../core-BItLItxM.js";
1
+ import { C as DocsCollection, N as ExtractedReference, j as CompiledMDXProperties, y as DocCollection } from "../core-ikvOVBe5.js";
2
2
  import { a as InternalTypeConfig } from "../types-DfxNhkVk.js";
3
3
  import { FC, ReactNode } from "react";
4
4
  import { Params } from "fumadocs-core/source";
@@ -1,6 +1,6 @@
1
1
  import "../config/index.js";
2
2
  import { AsyncDocCollectionEntry, AsyncDocsCollectionEntry } from "./server.js";
3
- import { C as DocsCollection, r as CoreOptions, y as DocCollection } from "../core-BItLItxM.js";
3
+ import { C as DocsCollection, r as CoreOptions, y as DocCollection } from "../core-ikvOVBe5.js";
4
4
  import { a as InternalTypeConfig, r as FileInfo } from "../types-DfxNhkVk.js";
5
5
  export interface LazyEntry<Data = unknown> {
6
6
  info: FileInfo;
@@ -1,4 +1,4 @@
1
- import { C as DocsCollection, T as MetaCollection, y as DocCollection } from "../core-BItLItxM.js";
1
+ import { C as DocsCollection, T as MetaCollection, y as DocCollection } from "../core-ikvOVBe5.js";
2
2
  import "../config/index.js";
3
3
  import { a as InternalTypeConfig, n as DocMethods, o as MetaMethods, t as DocData } from "../types-DfxNhkVk.js";
4
4
  import { MetaData, PageData, Params, Source } from "fumadocs-core/source";
@@ -1,4 +1,4 @@
1
- import { p as IndexFilePluginOptions, r as CoreOptions, w as GlobalConfig } from "../core-BItLItxM.js";
1
+ import { p as IndexFilePluginOptions, r as CoreOptions, w as GlobalConfig } from "../core-ikvOVBe5.js";
2
2
  import { t as MacroPluginOption } from "../options-BCId5Url.js";
3
3
  import "../config/index.js";
4
4
  import { Plugin } from "vite";
@@ -1,4 +1,4 @@
1
- import { t as WebpackLoaderOptions } from "../index-CkRSCq_N.js";
1
+ import { t as WebpackLoaderOptions } from "../index-tRoEcGRV.js";
2
2
  import { LoaderDefinitionFunction } from "webpack";
3
3
  /**
4
4
  * Expand macro calls (`fumadocs-mdx/macro`) into static imports of content files.
@@ -1,4 +1,4 @@
1
- import { t as WebpackLoaderOptions } from "../index-CkRSCq_N.js";
1
+ import { t as WebpackLoaderOptions } from "../index-tRoEcGRV.js";
2
2
  import { LoaderDefinitionFunction } from "webpack";
3
3
  declare const loader: LoaderDefinitionFunction<WebpackLoaderOptions>;
4
4
  export { loader as default };
@@ -1,4 +1,4 @@
1
- import { t as WebpackLoaderOptions } from "../index-CkRSCq_N.js";
1
+ import { t as WebpackLoaderOptions } from "../index-tRoEcGRV.js";
2
2
  import { LoaderDefinitionFunction } from "webpack";
3
3
  declare const loader: LoaderDefinitionFunction<WebpackLoaderOptions>;
4
4
  export { loader as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-mdx",
3
- "version": "15.6.1",
3
+ "version": "15.6.2",
4
4
  "description": "The built-in source for Fumadocs",
5
5
  "keywords": [
6
6
  "Docs",
@@ -88,7 +88,7 @@
88
88
  "@types/picomatch": "^4.0.3",
89
89
  "@types/react": "^19.3.0",
90
90
  "@vitejs/plugin-rsc": "^0.5.39",
91
- "fumadocs-core": "16.19.0",
91
+ "fumadocs-core": "16.19.1",
92
92
  "mdast-util-directive": "^3.2.0",
93
93
  "next": "^16.4.6",
94
94
  "react": "^19.3.1",