fumadocs-mdx 15.0.4 → 15.0.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.
package/bin.js CHANGED
File without changes
package/dist/bin.js CHANGED
File without changes
@@ -1,4 +1,4 @@
1
- import { r as CoreOptions } from "../core-DAna8bb8.js";
1
+ import { r as CoreOptions } from "../core-DM-l-bvr.js";
2
2
  import { BunPlugin } from "bun";
3
3
 
4
4
  //#region src/bun/index.d.ts
@@ -1,2 +1,2 @@
1
- import { A as DocCollection, B as MDXPresetOptions, D as AnyCollection, E as remarkInclude, F as defineConfig, I as defineDocs, M as GlobalConfig, N as MetaCollection, O as BaseCollection, P as defineCollections, R as PostprocessOptions, T as metaSchema, V as applyMdxPreset, j as DocsCollection, k as CollectionSchema, w as frontmatterSchema, z as DefaultMDXOptions } from "../core-DAna8bb8.js";
1
+ import { A as DocCollection, B as MDXPresetOptions, D as AnyCollection, E as remarkInclude, F as defineConfig, I as defineDocs, M as GlobalConfig, N as MetaCollection, O as BaseCollection, P as defineCollections, R as PostprocessOptions, T as metaSchema, V as applyMdxPreset, j as DocsCollection, k as CollectionSchema, w as frontmatterSchema, z as DefaultMDXOptions } from "../core-DM-l-bvr.js";
2
2
  export { AnyCollection, BaseCollection, CollectionSchema, DefaultMDXOptions, DocCollection, DocsCollection, GlobalConfig, MDXPresetOptions, MetaCollection, PostprocessOptions, applyMdxPreset, defineCollections, defineConfig, defineDocs, frontmatterSchema, metaSchema, remarkInclude };
@@ -197,13 +197,17 @@ declare const metaSchema$1: _$zod.ZodObject<{
197
197
  //#region src/runtime/server.d.ts
198
198
  type MetaCollectionEntry<Data> = Data & MetaMethods;
199
199
  type DocCollectionEntry<Name extends string = string, Frontmatter = unknown, TC extends InternalTypeConfig = InternalTypeConfig> = DocData & DocMethods & Frontmatter & TC['DocData'][Name];
200
+ interface ToFumadocsSourceOptions {
201
+ /** base directory for virtual file paths */
202
+ baseDir?: string;
203
+ }
200
204
  type AsyncDocCollectionEntry<Name extends string = string, Frontmatter = unknown, TC extends InternalTypeConfig = InternalTypeConfig> = {
201
205
  load: () => Promise<DocData & TC['DocData'][Name]>;
202
206
  } & DocMethods & Frontmatter;
203
207
  interface DocsCollectionEntry<Name extends string = string, Frontmatter extends PageData = PageData, Meta extends MetaData = MetaData, TC extends InternalTypeConfig = InternalTypeConfig> {
204
208
  docs: DocCollectionEntry<Name, Frontmatter, TC>[];
205
209
  meta: MetaCollectionEntry<Meta>[];
206
- toFumadocsSource: () => Source<{
210
+ toFumadocsSource: (options?: ToFumadocsSourceOptions) => Source<{
207
211
  pageData: DocCollectionEntry<Name, Frontmatter, TC>;
208
212
  metaData: MetaCollectionEntry<Meta>;
209
213
  }>;
@@ -211,7 +215,7 @@ interface DocsCollectionEntry<Name extends string = string, Frontmatter extends
211
215
  interface AsyncDocsCollectionEntry<Name extends string = string, Frontmatter extends PageData = PageData, Meta extends MetaData = MetaData, TC extends InternalTypeConfig = InternalTypeConfig> {
212
216
  docs: AsyncDocCollectionEntry<Name, Frontmatter, TC>[];
213
217
  meta: MetaCollectionEntry<Meta>[];
214
- toFumadocsSource: () => Source<{
218
+ toFumadocsSource: (options?: ToFumadocsSourceOptions) => Source<{
215
219
  pageData: AsyncDocCollectionEntry<Name, Frontmatter, TC>;
216
220
  metaData: MetaCollectionEntry<Meta>;
217
221
  }>;
@@ -230,7 +234,7 @@ declare function server<Config, TC extends InternalTypeConfig>(options?: ServerO
230
234
  docs<Name extends keyof Config & string>(name: Name, base: string, metaGlob: AwaitableGlobEntries<unknown>, docGlob: AwaitableGlobEntries<unknown>): Promise<Config[Name] extends DocsCollection<infer Page extends StandardSchemaV1<unknown, unknown>, infer Meta extends StandardSchemaV1<unknown, unknown>> ? StandardSchemaV1.InferOutput<Page> extends PageData ? StandardSchemaV1.InferOutput<Meta> extends MetaData ? DocsCollectionEntry<Name, StandardSchemaV1.InferOutput<Page>, StandardSchemaV1.InferOutput<Meta>, TC> : never : never : never>;
231
235
  docsLazy<Name extends keyof Config & string>(name: Name, base: string, metaGlob: AwaitableGlobEntries<unknown>, docHeadGlob: AwaitableGlobEntries<unknown>, docBodyGlob: Record<string, () => Promise<unknown>>): Promise<Config[Name] extends DocsCollection<infer Page extends StandardSchemaV1<unknown, unknown>, infer Meta extends StandardSchemaV1<unknown, unknown>> ? StandardSchemaV1.InferOutput<Page> extends PageData ? StandardSchemaV1.InferOutput<Meta> extends MetaData ? AsyncDocsCollectionEntry<Name, StandardSchemaV1.InferOutput<Page>, StandardSchemaV1.InferOutput<Meta>, TC> : never : never : never>;
232
236
  };
233
- declare function toFumadocsSource<Page extends DocMethods & PageData, Meta extends MetaMethods & MetaData>(pages: Page[], metas: Meta[]): Source<{
237
+ declare function toFumadocsSource<Page extends DocMethods & PageData, Meta extends MetaMethods & MetaData>(pages: Page[], metas: Meta[], options?: ToFumadocsSourceOptions): Source<{
234
238
  pageData: Page;
235
239
  metaData: Meta;
236
240
  }>;
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { L as ExtractedReference, a as EmitOptions, c as PluginContext, d as TransformOptions, i as EmitEntry, l as PluginOption, n as Core, o as EmitOutput, r as CoreOptions, s as Plugin, t as CompilationContext, u as ServerContext } from "./core-DAna8bb8.js";
1
+ import { L as ExtractedReference, a as EmitOptions, c as PluginContext, d as TransformOptions, i as EmitEntry, l as PluginOption, n as Core, o as EmitOutput, r as CoreOptions, s as Plugin, t as CompilationContext, u as ServerContext } from "./core-DM-l-bvr.js";
2
2
  import { t as CompiledMDXProperties } from "./build-mdx-CAXqH1_C.js";
3
3
  export { type CompilationContext, type CompiledMDXProperties, type Core, type CoreOptions, type EmitEntry, type EmitOptions, type EmitOutput, type ExtractedReference, type Plugin, type PluginContext, type PluginOption, type ServerContext, type TransformOptions };
@@ -1,4 +1,4 @@
1
- import { p as IndexFilePluginOptions } from "../core-DAna8bb8.js";
1
+ import { p as IndexFilePluginOptions } from "../core-DM-l-bvr.js";
2
2
  import { NextConfig } from "next";
3
3
 
4
4
  //#region src/next/index.d.ts
@@ -1,4 +1,4 @@
1
- import { r as CoreOptions } from "../core-DAna8bb8.js";
1
+ import { r as CoreOptions } from "../core-DM-l-bvr.js";
2
2
 
3
3
  //#region src/node/index.d.ts
4
4
  interface NodeLoaderOptions extends Partial<CoreOptions> {
@@ -1,2 +1,2 @@
1
- import { f as IndexFilePlugin, m as indexFile, p as IndexFilePluginOptions } from "../core-DAna8bb8.js";
1
+ import { f as IndexFilePlugin, m as indexFile, p as IndexFilePluginOptions } from "../core-DM-l-bvr.js";
2
2
  export { IndexFilePlugin, IndexFilePluginOptions, indexFile as default };
@@ -1,4 +1,4 @@
1
- import { s as Plugin } from "../core-DAna8bb8.js";
1
+ import { s as Plugin } from "../core-DM-l-bvr.js";
2
2
 
3
3
  //#region src/plugins/json-schema.d.ts
4
4
  interface JSONSchemaOptions {
@@ -1,4 +1,4 @@
1
- import { s as Plugin } from "../core-DAna8bb8.js";
1
+ import { s as Plugin } from "../core-DM-l-bvr.js";
2
2
 
3
3
  //#region src/plugins/last-modified.d.ts
4
4
  type VersionControlFn = (filePath: string) => Promise<Date | null | undefined>;
@@ -1,4 +1,4 @@
1
- import { A as DocCollection, j as DocsCollection } from "../core-DAna8bb8.js";
1
+ import { A as DocCollection, j as DocsCollection } from "../core-DM-l-bvr.js";
2
2
  import { i as InternalTypeConfig } from "../types-DRpz2Vq2.js";
3
3
  import { t as CompiledMDXProperties } from "../build-mdx-CAXqH1_C.js";
4
4
  import { FC, ReactNode } from "react";
@@ -1,4 +1,4 @@
1
- import { A as DocCollection, g as AsyncDocsCollectionEntry, h as AsyncDocCollectionEntry, j as DocsCollection, r as CoreOptions, x as ServerOptions } from "../core-DAna8bb8.js";
1
+ import { A as DocCollection, g as AsyncDocsCollectionEntry, h as AsyncDocCollectionEntry, j as DocsCollection, r as CoreOptions, x as ServerOptions } from "../core-DM-l-bvr.js";
2
2
  import { i as InternalTypeConfig, r as FileInfo } from "../types-DRpz2Vq2.js";
3
3
  import * as _$_standard_schema_spec0 from "@standard-schema/spec";
4
4
  import * as _$fumadocs_core_source0 from "fumadocs-core/source";
@@ -1,2 +1,2 @@
1
- import { C as toFumadocsSource, S as server, _ as DocCollectionEntry, b as ServerCreate, g as AsyncDocsCollectionEntry, h as AsyncDocCollectionEntry, v as DocsCollectionEntry, x as ServerOptions, y as MetaCollectionEntry } from "../core-DAna8bb8.js";
1
+ import { C as toFumadocsSource, S as server, _ as DocCollectionEntry, b as ServerCreate, g as AsyncDocsCollectionEntry, h as AsyncDocCollectionEntry, v as DocsCollectionEntry, x as ServerOptions, y as MetaCollectionEntry } from "../core-DM-l-bvr.js";
2
2
  export { AsyncDocCollectionEntry, AsyncDocsCollectionEntry, DocCollectionEntry, DocsCollectionEntry, MetaCollectionEntry, ServerCreate, ServerOptions, server, toFumadocsSource };
@@ -56,8 +56,8 @@ function server(options = {}) {
56
56
  return {
57
57
  docs: await this.doc(name, base, docGlob),
58
58
  meta: await this.meta(name, base, metaGlob),
59
- toFumadocsSource() {
60
- return toFumadocsSource(this.docs, this.meta);
59
+ toFumadocsSource(options) {
60
+ return toFumadocsSource(this.docs, this.meta, options);
61
61
  }
62
62
  };
63
63
  },
@@ -65,24 +65,25 @@ function server(options = {}) {
65
65
  return {
66
66
  docs: await this.docLazy(name, base, docHeadGlob, docBodyGlob),
67
67
  meta: await this.meta(name, base, metaGlob),
68
- toFumadocsSource() {
69
- return toFumadocsSource(this.docs, this.meta);
68
+ toFumadocsSource(options) {
69
+ return toFumadocsSource(this.docs, this.meta, options);
70
70
  }
71
71
  };
72
72
  }
73
73
  };
74
74
  }
75
- function toFumadocsSource(pages, metas) {
75
+ function toFumadocsSource(pages, metas, options) {
76
+ const baseDir = options?.baseDir;
76
77
  const files = [];
77
78
  for (const entry of pages) files.push({
78
79
  type: "page",
79
- path: entry.info.path,
80
+ path: baseDir ? path$1.join(baseDir, entry.info.path) : entry.info.path,
80
81
  absolutePath: entry.info.fullPath,
81
82
  data: entry
82
83
  });
83
84
  for (const entry of metas) files.push({
84
85
  type: "meta",
85
- path: entry.info.path,
86
+ path: baseDir ? path$1.join(baseDir, entry.info.path) : entry.info.path,
86
87
  absolutePath: entry.info.fullPath,
87
88
  data: entry
88
89
  });
@@ -1,4 +1,4 @@
1
- import { p as IndexFilePluginOptions } from "../core-DAna8bb8.js";
1
+ import { p as IndexFilePluginOptions } from "../core-DM-l-bvr.js";
2
2
  import { Plugin } from "vite";
3
3
 
4
4
  //#region src/vite/index.d.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-mdx",
3
- "version": "15.0.4",
3
+ "version": "15.0.5",
4
4
  "description": "The built-in source for Fumadocs",
5
5
  "keywords": [
6
6
  "Docs",
@@ -11,7 +11,7 @@
11
11
  "author": "Fuma Nama",
12
12
  "repository": "github:fuma-nama/fumadocs",
13
13
  "bin": {
14
- "fumadocs-mdx": "./dist/bin.js"
14
+ "fumadocs-mdx": "./bin.js"
15
15
  },
16
16
  "files": [
17
17
  "dist",
@@ -80,7 +80,7 @@
80
80
  "vite": "^8.0.12",
81
81
  "webpack": "^5.106.2",
82
82
  "@fumadocs/vite": "0.0.1",
83
- "fumadocs-core": "16.8.10",
83
+ "fumadocs-core": "16.8.11",
84
84
  "tsconfig": "0.0.0"
85
85
  },
86
86
  "peerDependencies": {