diff --git a/.changeset/lucky-feet-lick.md b/.changeset/lucky-feet-lick.md new file mode 100644 index 000000000..637db34ce --- /dev/null +++ b/.changeset/lucky-feet-lick.md @@ -0,0 +1,5 @@ +--- +'gitbook': minor +--- + +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. diff --git a/bun.lockb b/bun.lockb index 53e274ad2..d7620a634 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 1b075094d..b37c6cd24 100644 --- a/package.json +++ b/package.json @@ -23,5 +23,8 @@ "@changesets/cli": "^2.27.7", "prettier": "^3.0.3", "turbo": "^2.0.9" + }, + "patchedDependencies": { + "@vercel/next@4.0.15": "patches/@vercel%2Fnext@4.0.15.patch" } } diff --git a/packages/gitbook/package.json b/packages/gitbook/package.json index 0f0861f98..b186cb0ff 100644 --- a/packages/gitbook/package.json +++ b/packages/gitbook/package.json @@ -55,7 +55,7 @@ "remark-rehype": "^11.1.0", "rison": "^0.1.1", "server-only": "^0.0.1", - "shiki": "^1.2.0", + "shiki": "^1.11.1", "tailwind-merge": "^2.2.0", "tailwind-shades": "^1.1.2", "unified": "^11.0.4", diff --git a/packages/gitbook/src/components/DocumentView/CodeBlock/theme.css b/packages/gitbook/src/components/DocumentView/CodeBlock/theme.css index 0e21f1101..d2954e2c0 100644 --- a/packages/gitbook/src/components/DocumentView/CodeBlock/theme.css +++ b/packages/gitbook/src/components/DocumentView/CodeBlock/theme.css @@ -9,6 +9,9 @@ --shiki-token-string-expression: #6a4906; --shiki-token-punctuation: theme('colors.pomegranate.700/.92'); --shiki-token-link: theme('colors.dark.DEFAULT'); + --shiki-token-inserted: #22863a; + --shiki-token-deleted: #b31d28; + --shiki-token-changed: #8250df; } html.dark { @@ -22,4 +25,7 @@ html.dark { --shiki-token-string-expression: theme('colors.light.4'); --shiki-token-punctuation: #acc6ee; --shiki-token-link: theme('colors.pomegranate.400'); + --shiki-token-inserted: #85e89d; + --shiki-token-deleted: #fdaeb7; + --shiki-token-changed: #56b6c2; } diff --git a/patches/@vercel%2Fnext@4.0.15.patch b/patches/@vercel%2Fnext@4.0.15.patch new file mode 100644 index 000000000..18b28d03f --- /dev/null +++ b/patches/@vercel%2Fnext@4.0.15.patch @@ -0,0 +1,13 @@ +diff --git a/dist/index.js b/dist/index.js +index 7f9eaa2526e5fad42420f590bb733e5670766e63..302274144d28dde2b9ba8f9018281d2867f79299 100644 +--- a/dist/index.js ++++ b/dist/index.js +@@ -9484,7 +9484,7 @@ var import_path = require("path"); + // src/constants.ts + var KIB = 1024; + var MIB = 1024 * KIB; +-var EDGE_FUNCTION_SIZE_LIMIT = 4 * MIB; ++var EDGE_FUNCTION_SIZE_LIMIT = 10 * MIB; + var MAX_UNCOMPRESSED_LAMBDA_SIZE = 250 * MIB; + var LAMBDA_RESERVED_UNCOMPRESSED_SIZE = 2.5 * MIB; + var LAMBDA_RESERVED_COMPRESSED_SIZE = 250 * KIB;