Skip to content

Add bun.lock for faster local installs; drop stale package-lock.json - #160

Merged
cultron merged 1 commit into
mainfrom
chore/bun-install
Oct 27, 2026
Merged

cultron merged 1 commit into
mainfrom
chore/bun-install

Conversation

@cultron

@cultron cultron commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Why

bun install takes about 5 s cold and under 0.2 s warm, against 5 to 9 s for npm ci. CI and publishing are unchanged: they still use npm ci and npm-shrinkwrap.json.

What

  • bun.lock, generated from npm-shrinkwrap.json (Bun 1.4.4).
  • Removed package-lock.json. It disagreed with the shrinkwrap on 57 versions, and npm never reads it while the shrinkwrap exists. Bun migrated from it and picked the wrong versions.
  • bun-lockfile workflow: bun install --frozen-lockfile on PRs that touch package.json, npm-shrinkwrap.json or bun.lock, so a dependency change without a bun.lock update fails.
  • CLAUDE.md: install with bun install or npm ci; after npm install <pkg>, run bun install and commit both lockfiles.
  • scripts/secret-scan.sh skips bun.lock like other lockfiles.

Tested

  • Every production package Bun installs matches the version in npm-shrinkwrap.json. The only differences are duplicate nested copies of dev tooling that npm keeps and Bun dedupes.
  • Jest 390/390 on the Bun-installed tree; bun run build and npm ci both work; secret scan clean.
  • Bun blocks two install scripts by default (Biome postinstall, Yarn preinstall). Biome 1.9.4 still runs.

Known gap

npm update changes only the shrinkwrap, so bun.lock can fall behind without this check catching it.

…k.json

bun install takes about 2 s warm against 5 to 9 s for npm ci. CI and
publishing still use npm ci and npm-shrinkwrap.json.

package-lock.json disagreed with npm-shrinkwrap.json on 57 versions and npm
never reads it while the shrinkwrap exists. Bun migrated from it and picked
the wrong versions, so it is removed and bun.lock was generated from the
shrinkwrap. Every production package now matches the shrinkwrap.

A bun-lockfile workflow fails a PR that changes package.json without
updating bun.lock.
@cultron
cultron merged commit 89fe9ca into main Oct 27, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant