Bun v1.1.39 introduced
bun.lock, a JSONC formatted lockfile. bun.lock is human-readable and git-diffable without
configuration, at no cost to performance. In 1.2.0+ it is the default format for new projects. See the lockfile
docs.To teach
git how to generate a human-readable diff of Bun’s binary lockfile format (.lockb), add the following to your local or global .gitattributes file:
gitattributes
Then add the following to your local git config:
terminal
To configure this for every repository, add the following to your global git config:
terminal
How this works
textconvtells git to run bun on the file before diffingbinarytells git to treat the file as binary (so it doesn’t try to diff it line-by-line)
bun ./bun.lockb) prints a human-readable version of it, which git diff then diffs.