fix(install): skip lifecycle script comparison for workspace packages
Closed
RO
7mo ago+166+166+012345678901234567890123456789-1-1-0123456789
Summary
Fixes #26070
Workspace packages with lifecycle scripts (e.g., prepare, postinstall) were incorrectly triggering dependency re-resolution and unnecessary HTTP requests to the npm registry when running bun install after the lockfile cache expired.
Root Cause
The Diff.generate() function in src/install/lockfile/Package.zig compared lifecycle scripts for all non-root packages, including workspace packages. Since workspace packages are freshly parsed from their package.json files during diff generation, this could produce false positives even when scripts hadn't changed.
Solution
Skip lifecycle script comparison for workspace packages since:
- Workspace packages are resolved locally from their package.json files
- Script changes don't affect dependency resolution
- Any actual script changes are still detected and run during script execution
Test plan
- Added regression test
test/regression/issue/26070.test.tsthat verifies:- Test fails with system bun (reproduces bug)
- Test passes with the fix
- Verified existing workspace tests pass (12 pre-existing failures due to network issues, no new failures)
š¤ Generated with Claude Code