Fix caniuse-lite update for Bun - #88
Merged
Merged
Conversation
LabinatorSolutions
force-pushed
the
main
branch
from
August 10, 2026 05:28
1994e28 to
0e0934d
Compare
LabinatorSolutions
force-pushed
the
main
branch
from
August 10, 2026 05:36
0e0934d to
54453ba
Compare
Member
|
Thanks. Released in 1.3.1. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix
caniuse-liteupdate for BunProblem
The Bun branch is a single
updateWithcall:bun update <name>only operates on direct dependencies.caniuse-liteisalmost always transitive, so instead of updating it, Bun adds it — and
baseline-browser-mapping— topackage.jsonas new direct dependencies at thelatest version, and leaves every nested copy on the old one.
Two consequences:
package.jsongains two dependencies the project never asked for, onevery run. Every other branch avoids this:
denofollowsdeno addwithdeno remove,pnpmpasses--no-save, and the manual path follows itsinstall with
<pm> uninstall. Only the Bun branch adds without removing.caniuse-lite has been successfully updatedwhile the version that actuallyresolves at runtime is unchanged.
Reproduction
Using this repository's own
test/fixtures/update-bun(its lockfile pinscaniuse-lite@1.0.30001639), after running the current code:The three nested copies — the ones Node actually resolves — are untouched. The
existing test passes because it asserts
bun pm lscontains the latestversion, which the newly added hoisted copy satisfies.
Why not
--no-saveBun's
--no-saveis not pnpm's. Bun documents it as "Don't update package.jsonor save a lockfile", and it behaves that way — with
--no-save, no lockfileis written at all, so there is nothing left to update.
Fix
Apply a temporary
overridesentry, runbun install, then restorepackage.jsonbyte for byte and install once more. The override reaches nestedcopies, and the resolutions survive its removal because the new version still
satisfies the parents' ranges.
Output becomes:
package.jsonis restored in the failure path too, so an interrupted installcannot leave an override behind.
Test
The existing Bun test is extended to assert what the old code got wrong:
caniuse-litein the tree is at the latest version, nested copiesincluded — not merely that one of them is;
package.jsonis byte-identical to the fixture afterwards.Verified it fails on the current code (
(16 / 17), the Bun test failing) andpasses with the change (
30 / 30across the whole suite).oxlintandPrettier are clean.