oven-sh / bun

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

bun-pm: `prefer-local-packages` #9285

Open juliusmarminge opened 6 months ago

juliusmarminge commented 6 months ago

What is the problem this feature would solve?

if a workspace has package:1.0.0 on npm, and then bumps package to 1.0.1 locally, bun cannot resolve the package anymore since it's looking on npm where the version doesn't exist yet (i guess) (see example failing case here: https://github.com/pingdotgg/uploadthing/actions/runs/8179543913 - changeset bumped versions but then when it went to install the packages and release, it failed to resolve them)

this can be solved by usign the workspace: protocol, but then you lose the ability to have your examples easily cloneable and runnable in sandboxes etc etc.

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

pnpm has prefer-local-packages which resolves the local package even if there is a different version on npm. would be nice with something similar in bun

What alternatives have you considered?

No response

juliusmarminge commented 6 months ago

perhaps unrelated but it seems like after it has failed to resolve, it's just stuck on Resolving for a while. Is this a bad cache behavior? CleanShot 2024-03-07 at 01 02 01