From b9ff4ca1feef1124a266daaa9e8f0155b9365b16 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 12 Jan 2026 01:20:41 +0000 Subject: [PATCH] docs: clarify bun patch fallback --- docs/install/bun.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/install/bun.md b/docs/install/bun.md index 08d844f12..3128443ad 100644 --- a/docs/install/bun.md +++ b/docs/install/bun.md @@ -39,9 +39,10 @@ bun run vitest run ## pnpm patchedDependencies under Bun pnpm supports `package.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: +Bun (and npm/yarn) do not support pnpm patches, so we apply them in `postinstall` when pnpm is **not** the installer: -- [`scripts/postinstall.js`](https://github.com/clawdbot/clawdbot/blob/main/scripts/postinstall.js) runs only for Bun installs and applies every entry from `package.json#pnpm.patchedDependencies` into `node_modules/...` using `git apply` (idempotent). +- [`scripts/postinstall.js`](https://github.com/clawdbot/clawdbot/blob/main/scripts/postinstall.js) detects the package manager via `npm_config_user_agent` and applies every entry from `package.json#pnpm.patchedDependencies` into `node_modules/...` using a built-in JS patcher (no `git`/system `patch` dependency). +- Under pnpm, this fallback is skipped because pnpm already applies `patchedDependencies` itself. To add a new patch that works in both pnpm + Bun: