Skip to content

Commit 24b785c

Browse files
authored
Update shiki to fix diff code highlighting (#2338)
1 parent acc3f2f commit 24b785c

File tree

6 files changed

+28
-1
lines changed

6 files changed

+28
-1
lines changed

.changeset/lucky-feet-lick.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'gitbook': minor
3+
---
4+
5+
Update shiki for code block syntax highlighting, with support for more languages and fixes for diffs. It also patches the deployment on Cloudflare to support edge functions larger than 4MB.

bun.lockb

632 Bytes
Binary file not shown.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,8 @@
2323
"@changesets/cli": "^2.27.7",
2424
"prettier": "^3.0.3",
2525
"turbo": "^2.0.9"
26+
},
27+
"patchedDependencies": {
28+
"@vercel/[email protected]": "patches/@vercel%[email protected]"
2629
}
2730
}

packages/gitbook/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"remark-rehype": "^11.1.0",
5656
"rison": "^0.1.1",
5757
"server-only": "^0.0.1",
58-
"shiki": "^1.2.0",
58+
"shiki": "^1.11.1",
5959
"tailwind-merge": "^2.2.0",
6060
"tailwind-shades": "^1.1.2",
6161
"unified": "^11.0.4",

packages/gitbook/src/components/DocumentView/CodeBlock/theme.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
--shiki-token-string-expression: #6a4906;
1010
--shiki-token-punctuation: theme('colors.pomegranate.700/.92');
1111
--shiki-token-link: theme('colors.dark.DEFAULT');
12+
--shiki-token-inserted: #22863a;
13+
--shiki-token-deleted: #b31d28;
14+
--shiki-token-changed: #8250df;
1215
}
1316

1417
html.dark {
@@ -22,4 +25,7 @@ html.dark {
2225
--shiki-token-string-expression: theme('colors.light.4');
2326
--shiki-token-punctuation: #acc6ee;
2427
--shiki-token-link: theme('colors.pomegranate.400');
28+
--shiki-token-inserted: #85e89d;
29+
--shiki-token-deleted: #fdaeb7;
30+
--shiki-token-changed: #56b6c2;
2531
}

patches/@vercel%[email protected]

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/dist/index.js b/dist/index.js
2+
index 7f9eaa2526e5fad42420f590bb733e5670766e63..302274144d28dde2b9ba8f9018281d2867f79299 100644
3+
--- a/dist/index.js
4+
+++ b/dist/index.js
5+
@@ -9484,7 +9484,7 @@ var import_path = require("path");
6+
// src/constants.ts
7+
var KIB = 1024;
8+
var MIB = 1024 * KIB;
9+
-var EDGE_FUNCTION_SIZE_LIMIT = 4 * MIB;
10+
+var EDGE_FUNCTION_SIZE_LIMIT = 10 * MIB;
11+
var MAX_UNCOMPRESSED_LAMBDA_SIZE = 250 * MIB;
12+
var LAMBDA_RESERVED_UNCOMPRESSED_SIZE = 2.5 * MIB;
13+
var LAMBDA_RESERVED_COMPRESSED_SIZE = 250 * KIB;

0 commit comments

Comments
 (0)