Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bun update: update all dependencies to latest version #1372

Closed
paperclover opened this issue Oct 23, 2022 · 7 comments
Closed

bun update: update all dependencies to latest version #1372

paperclover opened this issue Oct 23, 2022 · 7 comments
Labels
bun install Something that relates to the npm-compatible client enhancement New feature or request

Comments

@paperclover
Copy link
Member

paperclover commented Oct 23, 2022

What is the problem this feature would solve?

easily updating all dependencies of your project to the latest version. removing the lockfile will do this, but it doesnt update package.json with the new versions. it's handy to be able to see what version of a package you're using by looking into package.json, and bumping thse values manually or by bun install package1 package2 package3 package4 ... is tedious. currently, bun update is aliased to install, and this works for passing package names directly, but i propose adding real command to update all packages.

i brought it in the discord here

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

i'm proposing an api similar/identical to pnpm update:

  • bun update with no extra arguments would update all packages to the latest version allowed by the specifier in package.json, then bump up the entry in package.json to only allow that version and newer ones; as in, rewrite ^1.0.0 to ^1.5.0, not ^2.0.0.

  • at the same time, it would be useful if this told the user if the latest tag of each package was newer than the range the package specifies. something like how pnpm will do this "(v is available)" message.
    image
    this would be useful as when installing a package, the specifier doesnt allow for major versions to get bumped, so a little note that a major update exists may be helpful.

    • unlike pnpm update / pnpm install, i think bun's implementation should always show any major out of date packages, so the user is aware of the package releases. while testing behavior of various package managers, i just now learned that formdata-node@5 was released two months ago.
  • a --latest flag which does updates each package to it's latest tag.

What alternatives have you considered?

  • external script which pulls from package.json and runs bun install <every package name> to achieve similar behavior
  • dealing with bun install a b c d e ...
@paperclover paperclover added the enhancement New feature or request label Oct 23, 2022
@jakeboone02
Copy link
Contributor

This issue and #1223 are quite similar, and my comment on 1223 is relevant here:

As an additional request, something like Yarn v2's upgrade-interactive plugin would be really nice.

image

@ImBIOS
Copy link
Contributor

ImBIOS commented Jul 25, 2023

For the fastest implementation, I made a PR in ncu:

@Electroid
Copy link
Contributor

This was introduced in Bun 0.8! 🎉

@michaelhays
Copy link

Glad to see bun update land, but AFAIK there's still no option to replicate the pnpm update --latest functionality, right?

--latest is super useful because it allows you to view the diff of all of your dependencies in package.json, so that you can go through and read the changelogs for any relevant library updates.

@jakeboone02
Copy link
Contributor

@michaelhays the upcoming bun outdated command (see #1223) isn't exactly the same but might help.

@Electroid Electroid added the bun install Something that relates to the npm-compatible client label Oct 9, 2023
@ctison
Copy link

ctison commented Oct 17, 2023

A nice tool is npm-check-updates:

bun x npm-check-updates -ui

It even works in workspaces!

bun x npm-check-updates -ui -ws

@ThatOneCalculator
Copy link
Contributor

bun update -f can probably handle this nowdays

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bun install Something that relates to the npm-compatible client enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants