oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
73.64k stars 2.72k forks source link

force "resolutions" support in bun install #4685

Closed hb1998 closed 1 year ago

hb1998 commented 1 year ago

What is the problem this feature would solve?

we are migrating from yarn berry to bun, I see that there is no way to use our existing lock file with bun, so I did a new install with bun, which bumped versions in many packages, with yarn we were forcing the resolutions of some packages, but in bun there seems no way to achieve it

What is the feature you are proposing to solve the problem?

if bun can respect "resolutions" in package.json and resolve the nested deps based on that, it would be great. https://classic.yarnpkg.com/lang/en/docs/selective-version-resolutions/#toc-how-to-use-it

What alternatives have you considered?

No response

dstaver commented 1 year ago

We would also need this to be able to migrate from yarn to bun.

We've had numerous issues in the past with multiple incompatible versions of a package being installed through nested dependencies and the wrong version getting picked up for some reason. Forcing resolution to a specific version has solved those issues.

On a related note we have also been using yarn-deduplicate to fix unnecessary duplicate installs where a package could should have been resolved to a single version. I'm not sure if this is an issue with Bun though. Apparently it's specific to Yarn 1.

chrisheninger commented 1 year ago

Similar to https://github.com/oven-sh/bun/issues/1751

hb1998 commented 1 year ago

Similar to #1751

yeah, its similar, using resolutions would be a different way of solving it, for us at least.

Hebilicious commented 1 year ago

duplicate #1134

hb1998 commented 1 year ago

Closing as duplicate of https://github.com/oven-sh/bun/issues/1134