Skip to content

Commit

Permalink
fix(build): build issue with bun
Browse files Browse the repository at this point in the history
astro/starlight plugin tries to import a jsonc file with `?raw`, but bun
seems to parse it directly. This causes a build issue. This patch fixes
the issue by adding a patch to the starlight plugin.

Signed-off-by: SoulHarsh007 <[email protected]>
  • Loading branch information
SoulHarsh007 committed Jan 20, 2025
1 parent 9f33cff commit 2b10a15
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
Binary file modified bun.lockb
Binary file not shown.
14 changes: 11 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/react": "^4.1.4",
"@astrojs/starlight": "^0.31.0",
"@astrojs/react": "^4.1.5",
"@astrojs/starlight": "^0.31.1",
"@astrojs/starlight-tailwind": "^3.0.0",
"@astrojs/tailwind": "^5.1.4",
"@types/react": "^19.0.7",
"@types/react-dom": "^19.0.3",
"astro": "^5.1.6",
"astro": "^5.1.7",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-image-previewer": "^1.1.6",
Expand All @@ -36,5 +36,13 @@
"prettier": "^3.4.2",
"prettier-plugin-astro": "^0.14.1",
"typescript-eslint": "^8.20.0"
},
"trustedDependencies": [
"esbuild",
"sharp",
"styled-components"
],
"patchedDependencies": {
"@astrojs/[email protected]": "patches/@astrojs%[email protected]"
}
}
13 changes: 13 additions & 0 deletions patches/@astrojs%[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/integrations/expressive-code/theming.ts b/integrations/expressive-code/theming.ts
index e207aac3895cf5dd41dcef13bed2b1345b1e18ac..19121a26ea7c2bc6088e6748e30e946587761679 100644
--- a/integrations/expressive-code/theming.ts
+++ b/integrations/expressive-code/theming.ts
@@ -22,7 +22,7 @@ export function preprocessThemes(
// If the current entry is the name of a bundled theme, load it
if (theme === 'starlight-dark' || theme === 'starlight-light') {
const bundledTheme = theme === 'starlight-dark' ? nightOwlDark : nightOwlLight;
- return customizeBundledTheme(ExpressiveCodeTheme.fromJSONString(bundledTheme));
+ return customizeBundledTheme(ExpressiveCodeTheme.fromJSONString(JSON.stringify(bundledTheme)));
}
// Otherwise, just pass it through
return theme;

0 comments on commit 2b10a15

Please sign in to comment.