Bun
Goal: run this repo with Bun (optional) without losing pnpm patch behavior.Status
- Bun is an optional local runtime for running TypeScript directly (
bun run …,bun --watch …). pnpmis the default for builds and remains fully supported (and used by some docs tooling).- Bun cannot use
pnpm-lock.yamland will ignore it.
Install
Default:bun.lock/bun.lockb are gitignored, so there’s no repo churn either way. If you want no lockfile writes:
Build / Test (Bun)
pnpm patchedDependencies under Bun
pnpm supportspackage.json#pnpm.patchedDependencies and records it in pnpm-lock.yaml.
Bun does not support pnpm patches, so we apply them in postinstall when Bun is detected:
scripts/postinstall.jsruns only for Bun installs and applies every entry frompackage.json#pnpm.patchedDependenciesintonode_modules/...usinggit apply(idempotent).
- Add an entry to
package.json#pnpm.patchedDependencies - Add the patch file under
patches/ - Run
pnpm install(updatespnpm-lock.yamlpatch hash)
Bun lifecycle scripts (blocked by default)
Bun may block dependency lifecycle scripts unless explicitly trusted (bun pm untrusted / bun pm trust).
For this repo, the commonly blocked scripts are not required:
@whiskeysockets/baileyspreinstall: checks Node major >= 20 (we run Node 22+).protobufjspostinstall: emits warnings about incompatible version schemes (no build artifacts).
Caveats
- Some scripts still hardcode pnpm (e.g.
docs:build,ui:*,protocol:check). Run those via pnpm for now.