fumadocs-core 14.7.4 → 14.7.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,9 +1,9 @@
1
1
  // src/utils/remove-undefined.ts
2
2
  function removeUndefined(value) {
3
3
  const obj = value;
4
- Object.keys(obj).forEach((key) => {
4
+ for (const key of Object.keys(obj)) {
5
5
  if (obj[key] === void 0) delete obj[key];
6
- });
6
+ }
7
7
  return value;
8
8
  }
9
9
 
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  removeUndefined
3
- } from "./chunk-2V6SCS43.js";
3
+ } from "./chunk-DELA6Z2I.js";
4
4
 
5
5
  // src/search/orama/search/simple.ts
6
6
  import { search } from "@orama/orama";
@@ -20,7 +20,7 @@ import {
20
20
  // src/mdx-plugins/rehype-code.ts
21
21
  import rehypeShikiFromHighlighter from "@shikijs/rehype/core";
22
22
 
23
- // ../../node_modules/.pnpm/shiki-transformers@1.0.1_shiki@1.27.0/node_modules/shiki-transformers/dist/index.js
23
+ // ../../node_modules/.pnpm/shiki-transformers@1.0.1_shiki@1.27.2/node_modules/shiki-transformers/dist/index.js
24
24
  var matchers = [
25
25
  [/^(<!--)(.+)(-->)$/, false],
26
26
  [/^(\/\*)(.+)(\*\/)$/, false],
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  removeUndefined
3
- } from "./chunk-2V6SCS43.js";
3
+ } from "./chunk-DELA6Z2I.js";
4
4
  import "./chunk-MLKGABMK.js";
5
5
 
6
6
  // src/search/client/orama-cloud.ts
@@ -64,10 +64,10 @@ function useDocsSearch(client, locale, tag, delayMs = 100, allowEmpty = false, k
64
64
  return searchDocs(index, debouncedValue, tag, rest);
65
65
  }
66
66
  if (client.type === "orama-cloud") {
67
- const { searchDocs } = await import("../orama-cloud-QNHGN6SO.js");
67
+ const { searchDocs } = await import("../orama-cloud-HAZVD2ZO.js");
68
68
  return searchDocs(debouncedValue, tag, client);
69
69
  }
70
- const { createStaticClient } = await import("../static-7O35FMI3.js");
70
+ const { createStaticClient } = await import("../static-KPGOHAZ2.js");
71
71
  if (!staticClient) staticClient = createStaticClient(client);
72
72
  return staticClient.search(debouncedValue, locale, tag);
73
73
  }
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  searchAdvanced,
3
3
  searchSimple
4
- } from "../chunk-BO6MEAPT.js";
5
- import "../chunk-2V6SCS43.js";
4
+ } from "../chunk-GIPLMX5F.js";
5
+ import "../chunk-DELA6Z2I.js";
6
6
  import "../chunk-MLKGABMK.js";
7
7
 
8
8
  // src/search/server.ts
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  removeUndefined
3
- } from "../chunk-2V6SCS43.js";
3
+ } from "../chunk-DELA6Z2I.js";
4
4
  import {
5
5
  resolvePath,
6
6
  slash,
@@ -17,13 +17,16 @@ var separator = /^---(?<name>.*?)---$/;
17
17
  var rest = "...";
18
18
  var extractPrefix = "...";
19
19
  var excludePrefix = "!";
20
+ function isPageFile(node) {
21
+ return "data" in node && node.format === "page";
22
+ }
20
23
  function buildAll(nodes, ctx, skipIndex) {
21
24
  const output = [];
22
25
  const folders = [];
23
26
  for (const node of [...nodes].sort(
24
27
  (a, b) => a.file.name.localeCompare(b.file.name)
25
28
  )) {
26
- if ("data" in node && node.format === "page" && !node.file.locale) {
29
+ if (isPageFile(node) && !node.file.locale) {
27
30
  const treeNode = buildFileNode(node, ctx);
28
31
  if (node.file.name === "index") {
29
32
  if (!skipIndex) output.unshift(treeNode);
@@ -32,7 +35,11 @@ function buildAll(nodes, ctx, skipIndex) {
32
35
  output.push(treeNode);
33
36
  }
34
37
  if ("children" in node) {
35
- folders.push(buildFolderNode(node, false, ctx));
38
+ if (node.children.length === 1 && node.children[0].file.name === "index" && isPageFile(node.children[0])) {
39
+ output.push(buildFileNode(node.children[0], ctx));
40
+ } else {
41
+ folders.push(buildFolderNode(node, false, ctx));
42
+ }
36
43
  }
37
44
  }
38
45
  output.push(...folders);
@@ -40,17 +47,17 @@ function buildAll(nodes, ctx, skipIndex) {
40
47
  }
41
48
  function resolveFolderItem(folder, item, ctx, addedNodePaths) {
42
49
  if (item === rest) return "...";
43
- const separateResult = separator.exec(item);
44
- if (separateResult?.groups) {
50
+ let match = separator.exec(item);
51
+ if (match?.groups) {
45
52
  const node = {
46
53
  type: "separator",
47
- name: separateResult.groups.name
54
+ name: match.groups.name
48
55
  };
49
56
  return [ctx.options.attachSeparator?.(node) ?? node];
50
57
  }
51
- const linkResult = link.exec(item);
52
- if (linkResult?.groups) {
53
- const { icon, url, name } = linkResult.groups;
58
+ match = link.exec(item);
59
+ if (match?.groups) {
60
+ const { icon, url, name } = match.groups;
54
61
  const isRelative = url.startsWith("/") || url.startsWith("#") || url.startsWith(".");
55
62
  const node = {
56
63
  type: "page",
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  searchAdvanced,
3
3
  searchSimple
4
- } from "./chunk-BO6MEAPT.js";
5
- import "./chunk-2V6SCS43.js";
4
+ } from "./chunk-GIPLMX5F.js";
5
+ import "./chunk-DELA6Z2I.js";
6
6
  import "./chunk-MLKGABMK.js";
7
7
 
8
8
  // src/search/client/static.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-core",
3
- "version": "14.7.4",
3
+ "version": "14.7.5",
4
4
  "description": "The library for building a documentation website in Next.js",
5
5
  "keywords": [
6
6
  "NextJs",
@@ -79,7 +79,7 @@
79
79
  "dependencies": {
80
80
  "@formatjs/intl-localematcher": "^0.5.10",
81
81
  "@orama/orama": "^2.1.1",
82
- "@shikijs/rehype": "^1.26.2",
82
+ "@shikijs/rehype": "^1.27.2",
83
83
  "github-slugger": "^2.0.0",
84
84
  "hast-util-to-estree": "^3.1.1",
85
85
  "hast-util-to-jsx-runtime": "^2.3.2",
@@ -89,7 +89,7 @@
89
89
  "remark": "^15.0.0",
90
90
  "remark-gfm": "^4.0.0",
91
91
  "scroll-into-view-if-needed": "^3.1.0",
92
- "shiki": "^1.27.0",
92
+ "shiki": "^1.27.2",
93
93
  "unist-util-visit": "^5.0.0"
94
94
  },
95
95
  "devDependencies": {
@@ -101,13 +101,13 @@
101
101
  "@types/hast": "^3.0.4",
102
102
  "@types/mdast": "^4.0.3",
103
103
  "@types/negotiator": "^0.6.3",
104
- "@types/node": "22.10.6",
104
+ "@types/node": "22.10.7",
105
105
  "@types/react": "^19.0.7",
106
106
  "@types/react-dom": "^19.0.3",
107
107
  "algoliasearch": "4.24.0",
108
108
  "mdast-util-mdx-jsx": "^3.2.0",
109
109
  "mdast-util-mdxjs-esm": "^2.0.1",
110
- "next": "^15.1.4",
110
+ "next": "^15.1.5",
111
111
  "remark-mdx": "^3.1.0",
112
112
  "remark-rehype": "^11.1.1",
113
113
  "shiki-transformers": "^1.0.1",