2026-01-06 19:56:22 +00:00
|
|
|
|
---
|
2026-01-16 22:41:49 +00:00
|
|
|
|
summary: "Bun workflow (experimental): installs and gotchas vs pnpm"
|
2026-01-06 19:56:22 +00:00
|
|
|
|
read_when:
|
|
|
|
|
|
- You want the fastest local dev loop (bun + watch)
|
|
|
|
|
|
- You hit Bun install/patch/lifecycle script issues
|
2026-01-31 16:04:03 -05:00
|
|
|
|
title: "Bun (Experimental)"
|
2026-01-06 19:56:22 +00:00
|
|
|
|
---
|
2026-01-06 03:30:33 +01:00
|
|
|
|
|
2026-01-13 07:58:47 +00:00
|
|
|
|
# Bun (experimental)
|
2026-01-06 19:56:22 +00:00
|
|
|
|
|
2026-01-13 07:58:47 +00:00
|
|
|
|
Goal: run this repo with **Bun** (optional, not recommended for WhatsApp/Telegram)
|
2026-01-16 22:41:49 +00:00
|
|
|
|
without diverging from pnpm workflows.
|
2026-01-13 07:58:47 +00:00
|
|
|
|
|
|
|
|
|
|
⚠️ **Not recommended for Gateway runtime** (WhatsApp/Telegram bugs). Use Node for production.
|
2026-01-06 03:30:33 +01:00
|
|
|
|
|
|
|
|
|
|
## Status
|
|
|
|
|
|
|
2026-01-06 23:48:22 +00:00
|
|
|
|
- Bun is an optional local runtime for running TypeScript directly (`bun run …`, `bun --watch …`).
|
|
|
|
|
|
- `pnpm` is the default for builds and remains fully supported (and used by some docs tooling).
|
2026-01-06 19:56:22 +00:00
|
|
|
|
- Bun cannot use `pnpm-lock.yaml` and will ignore it.
|
2026-01-06 03:30:33 +01:00
|
|
|
|
|
2026-01-06 19:56:22 +00:00
|
|
|
|
## Install
|
2026-01-06 03:30:33 +01:00
|
|
|
|
|
2026-01-06 19:56:22 +00:00
|
|
|
|
Default:
|
2026-01-06 03:30:33 +01:00
|
|
|
|
|
|
|
|
|
|
```sh
|
2026-01-06 19:56:22 +00:00
|
|
|
|
bun install
|
2026-01-06 03:30:33 +01:00
|
|
|
|
```
|
|
|
|
|
|
|
2026-01-31 21:13:13 +09:00
|
|
|
|
Note: `bun.lock`/`bun.lockb` are gitignored, so there’s no repo churn either way. If you want _no lockfile writes_:
|
2026-01-06 19:56:22 +00:00
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
|
bun install --no-save
|
|
|
|
|
|
```
|
2026-01-06 03:30:33 +01:00
|
|
|
|
|
|
|
|
|
|
## Build / Test (Bun)
|
|
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
|
bun run build
|
|
|
|
|
|
bun run vitest run
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
## 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:
|
|
|
|
|
|
|
2026-03-12 15:24:54 +03:00
|
|
|
|
- `@whiskeysockets/baileys` `preinstall`: checks Node major >= 20 (OpenClaw defaults to Node 24 and still supports Node 22 LTS, currently `22.16+`).
|
2026-01-06 03:30:33 +01:00
|
|
|
|
- `protobufjs` `postinstall`: emits warnings about incompatible version schemes (no build artifacts).
|
|
|
|
|
|
|
|
|
|
|
|
If you hit a real runtime issue that requires these scripts, trust them explicitly:
|
|
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
|
bun pm trust @whiskeysockets/baileys protobufjs
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
## Caveats
|
|
|
|
|
|
|
|
|
|
|
|
- Some scripts still hardcode pnpm (e.g. `docs:build`, `ui:*`, `protocol:check`). Run those via pnpm for now.
|