oven-sh / bun

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

Interactive dependency update #10341

Open ebeloded opened 2 months ago

ebeloded commented 2 months ago

What is the problem this feature would solve?

Updating dependencies in projects, especially those with a large number of dependencies or in a workspace setup, can be daunting. It's challenging to know which updates are safe to apply without potentially breaking the application. Currently, Bun does not offer an interactive update experience that allows developers to review, select, or skip updates for each dependency individually, similar to what pnpm upgrade --latest --interactive offers. This feature would significantly improve the developer experience by providing more control and visibility during the update process.

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

I propose Bun introduces an interactive dependency update experience, similar to pnpm's --interactive option for the upgrade command. This feature should allow developers to:

What alternatives have you considered?

The main alternative currently is manually reviewing each dependency's latest version and updating them one by one in the package.json, which is time-consuming and error-prone. Another alternative is running a full update without the interactive feature, which lacks the control and oversight that might be necessary for critical or large-scale applications. While these methods work, they do not provide the efficiency, ease of use, and safety net that an interactive update process could offer.

chneau commented 1 month ago

To add a grain of salt there, I'm using https://www.npmjs.com/package/npm-check-updates and always adding this script to my projects: npm-check-updates --upgrade --install=always --packageManager=bun and when major updates are too complicated to deal with at the time, I add the --target=minor. Since https://bun.sh/blog/bun-v1.1.11 there is the possibility to bun update --latest which is great for most of my use cases.

I have never used the interactive mode of npm-check-updates which I believe is very similar to pnpm upgrade --latest --interactive, but I have used --filter to filter out the problematic dependencies that need to be pined.

ebeloded commented 1 month ago

Thanks @chneau. ncu is a great alternative and it works with Bun