fumadocs-core 16.19.6 → 16.19.7

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.
@@ -5,7 +5,7 @@ function pickTranslations(full, keys) {
5
5
  return result;
6
6
  }
7
7
  function defineI18n(config) {
8
- return {
8
+ const api = {
9
9
  ...config,
10
10
  translations() {
11
11
  const translations = {};
@@ -35,6 +35,7 @@ function defineI18n(config) {
35
35
  };
36
36
  }
37
37
  };
38
+ return Object.defineProperty(api, "translations", { enumerable: false });
38
39
  }
39
40
  /** create translations API without i18n */
40
41
  function defineTranslations() {
package/dist/mcp.js CHANGED
@@ -33,8 +33,11 @@ function registerSourceTools(mcp, source, llms) {
33
33
  description: "Get the Markdown content of a docs page by its pathname (URL)",
34
34
  inputSchema: z.object({ url: z.string() })
35
35
  }, async ({ url }) => {
36
- const page = (typeof source === "function" ? await source() : source).getPageByUrl(url.replace(/[?#].*$/, ""));
37
- if (!page) return {
36
+ const loader = typeof source === "function" ? await source() : source;
37
+ const pathname = url.replace(/[?#].*$/, "");
38
+ const page = loader.getPageByUrl(pathname);
39
+ const text = page ? await llms.page(page) : pathname.endsWith(".md") ? await (await llms.serve(pathname))?.text() : void 0;
40
+ if (text === void 0) return {
38
41
  content: [{
39
42
  type: "text",
40
43
  text: `page not found: ${url}`
@@ -43,7 +46,7 @@ function registerSourceTools(mcp, source, llms) {
43
46
  };
44
47
  return { content: [{
45
48
  type: "text",
46
- text: await llms.page(page)
49
+ text
47
50
  }] };
48
51
  });
49
52
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-core",
3
- "version": "16.19.6",
3
+ "version": "16.19.7",
4
4
  "description": "The React.js library for building a documentation website",
5
5
  "keywords": [
6
6
  "Docs",
@@ -92,6 +92,8 @@
92
92
  "./search/orama-cloud-legacy": "./dist/search/orama-cloud-legacy.js",
93
93
  "./search/server": "./dist/search/server.js",
94
94
  "./server": {
95
+ "workerd": "./dist/server.js",
96
+ "edge-light": "./dist/server.js",
95
97
  "browser": "./dist/server.browser.js",
96
98
  "import": "./dist/server.js"
97
99
  },