fix: 🐛 Fix LogTape expecting a Deno global to exist (patch)

This commit is contained in:
Jesse Wierzbinski 2024-06-26 15:06:57 -10:00
parent 3004ec2350
commit 556ef83ecf
No known key found for this signature in database
3 changed files with 6 additions and 0 deletions

BIN
bun.lockb

Binary file not shown.

View file

@ -38,6 +38,7 @@
"cli": "bun run cli/index.ts",
"prune": "ts-prune | grep -v server/ | grep -v dist/ | grep -v '(used in module)'",
"check": "bunx tsc -p .",
"postinstall": "bun run patches/patch.ts",
"prepare": "bunx husky"
},
"trustedDependencies": [

5
patches/patch.ts Normal file
View file

@ -0,0 +1,5 @@
import { $ } from "bun";
// Replace all occurrences of 'Deno' with '{}' in node_modules/@logtape/logtape/logtape/filesink.deno.js
// LogTape assumes a Deno global exists which causes it to break in Bun
await $`sed -i 's/Deno/{}/g' '${import.meta.dir}/../node_modules/@logtape/logtape/logtape/filesink.deno.js'`;