fumadocs-core 12.0.4 → 12.0.6

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.
@@ -31,7 +31,7 @@ interface GetGithubLastCommitOptions {
31
31
  */
32
32
  path: string;
33
33
  /**
34
- * Github access token
34
+ * GitHub access token
35
35
  */
36
36
  token?: string;
37
37
  /**
@@ -41,7 +41,10 @@ interface GetGithubLastCommitOptions {
41
41
  options?: RequestInit;
42
42
  }
43
43
  /**
44
- * Get the last edit time of a file
44
+ * Get the last edit time of a file using GitHub API
45
+ *
46
+ * By default, this will cache the result forever.
47
+ * Set `options.next.revalidate` to customise this.
45
48
  */
46
49
  declare function getGithubLastEdit({ repo, token, owner, path, options, params: customParams, }: GetGithubLastCommitOptions): Promise<Date | null>;
47
50
 
@@ -2,7 +2,9 @@ import {
2
2
  remarkHeading
3
3
  } from "../chunk-QRNTLL6S.js";
4
4
  import {
5
- __async
5
+ __async,
6
+ __spreadProps,
7
+ __spreadValues
6
8
  } from "../chunk-CWMXXUWU.js";
7
9
 
8
10
  // src/server/get-toc.ts
@@ -64,6 +66,7 @@ function getGithubLastEdit(_0) {
64
66
  options = {},
65
67
  params: customParams = {}
66
68
  }) {
69
+ const headers = new Headers(options.headers);
67
70
  const params = new URLSearchParams();
68
71
  params.set("path", path);
69
72
  params.set("page", "1");
@@ -72,12 +75,15 @@ function getGithubLastEdit(_0) {
72
75
  params.set(key, value);
73
76
  }
74
77
  if (token) {
75
- options.headers = new Headers(options.headers);
76
- options.headers.append("authorization", token);
78
+ headers.append("authorization", token);
77
79
  }
78
80
  const res = yield fetch(
79
81
  `https://api.github.com/repos/${owner}/${repo}/commits?${params.toString()}`,
80
- options
82
+ __spreadProps(__spreadValues({
83
+ cache: "force-cache"
84
+ }, options), {
85
+ headers
86
+ })
81
87
  );
82
88
  if (!res.ok)
83
89
  throw new Error(
@@ -397,6 +397,7 @@ function createOutput({
397
397
  getLanguages() {
398
398
  const list = [];
399
399
  for (const [language, pages] of i18nMap) {
400
+ if (language === "") continue;
400
401
  list.push({
401
402
  language,
402
403
  pages: Array.from(pages.values())
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-core",
3
- "version": "12.0.4",
3
+ "version": "12.0.6",
4
4
  "description": "The library for building a documentation website in Next.js",
5
5
  "keywords": [
6
6
  "NextJs",