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

Request: outdated CLI command #1223

Closed
itsezc opened this issue Sep 10, 2022 · 47 comments · Fixed by #13461
Closed

Request: outdated CLI command #1223

itsezc opened this issue Sep 10, 2022 · 47 comments · Fixed by #13461
Assignees
Labels
enhancement New feature or request npm Something that relates to the npm-compatible client

Comments

@itsezc
Copy link

itsezc commented Sep 10, 2022

What is the problem this feature will solve?

Currently there is no way to view outdated packages in a project like one can with NPM's CLI.

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

A new command has to be implemented that would show a similar result (perhaps better formatted) that shows any out dated packages within a project.

What alternatives have you considered?

N/A

@itsezc itsezc added the enhancement New feature or request label Sep 10, 2022
@itsezc itsezc changed the title outdated CLI command Request: outdated CLI command Sep 10, 2022
@Electroid Electroid added the npm Something that relates to the npm-compatible client label Nov 3, 2022
@jakeboone02
Copy link
Contributor

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

image

@jack-weilage
Copy link

Bumping this issue to ask: Is this feature being considered/worked on? This and #1372 are basically the only reasons that I haven't adopted bun for anything besides task running.

@kenbankspeng
Copy link

kenbankspeng commented Jul 5, 2023

My mitigation for the missing bun pm outdated CLI is to use ncu, which just focuses on maintenance of package versions within package.json.

ncu
ncu -u or ncu -u <package>
bun install

@ImBIOS
Copy link
Contributor

ImBIOS commented Jul 16, 2023

Currently I'm using this script:

...
"deps:update": "npx npm-check-updates --interactive --format group"
...

When I run it using bun run deps:update:

   bun run deps:update 
$ bun x npm-check-updates --interactive --format group

It'll auto-convert npx to bun x, pretty awesome! but ncu is using normal npm under the hood 🤣

@ImBIOS
Copy link
Contributor

ImBIOS commented Jul 25, 2023

For fastest implementation, I made a PR in ncu:

At the moment, it's not support bun yet for installation after dependency update. That's the main point of my PR.

@Jarred-Sumner
Copy link
Collaborator

Bun v0.7.4 gets bun update which does this

You can use it to update all your dependencies via:

bun update

or you can update just a single dependency via

bun update <my-package-name>

Thanks to @alexlamsl #4046

@Jarred-Sumner
Copy link
Collaborator

I guess this is technically "do the update" instead of "check for updates", but I wonder if that's fine?

@jack-weilage
Copy link

jack-weilage commented Aug 8, 2023

In my opinion, this is still a valuable issue and shouldn't be closed. bun outdated meets a different need than bun update, so it shouldn't be bundled like this. Maybe a flag like bun update --dry if you don't want to add more subcommands?

@Jarred-Sumner Jarred-Sumner reopened this Aug 8, 2023
@Jarred-Sumner
Copy link
Collaborator

Jarred-Sumner commented Aug 8, 2023

There is bun update --dry-run but it does the wrong thing right now (it prints out every version of instead of only changes, which is nonsensical)

I think we should do bun pm outdated

@jack-weilage
Copy link

bun pm outdated sounds good, but I feel that the pm subcommand confuses things. Why are update/add/remove the same as npm, but outdated goes under pm?

@jakeboone02
Copy link
Contributor

Agree with @jack-weilage—this should not be closed yet. bun outdated should show the actual installed versions per the lock file, the latest versions that match the respective semver strings in package.json, and the absolute latest versions. It would be primarily informational but could be interactive.

Sounds like bun update <package> will just bump it to the latest semver-matching version.

@Jarred-Sumner
Copy link
Collaborator

sounds good, we'll do bun outdated and leave bun pm namespace for the more obscure commands that potentially conflict with script names

@kenbankspeng
Copy link

'ls' is used for 'list', ok, a little off-beat from npm but makes sense. But I see it only available using bun pm ls. Any hope of moving this to bun ls?

@saturnonearth
Copy link

pnpm's pnpm up -L -i is something I can't live without. It lists all packages and shows which ones are outdated, regardless of semvar verisons in package.json, and allows you to choose which ones to update - then, once chosen, updates the packages accordingly and updates the package.json file.

This is needed

@oedotme
Copy link

oedotme commented Sep 10, 2023

@saturnonearth This command is so underrated!

I've been using --recursive with it as well, to list and update all packages from all (monorepo) workspaces:

pnpm update --latest --interactive --recursive

Would be great to have something similar in Bun! ❤️

@azat-io
Copy link

azat-io commented Sep 10, 2023

+1 for bun update --interactive

@danielbarion
Copy link

it would be nice to have something like this package natively on bun:

https://www.npmjs.com/package/npm-check

@wJoenn
Copy link

wJoenn commented Sep 22, 2023

Hello there, just saying but I really second having an interactive CLI interface for outdated packages like yarn's yarn upgrade-interactive --latest
image

Compared to a more simple statement of outdated packages like npm outdated
image

Being able to both check versions and hand pick those we want to update with a single command is such a pleasant DX utility.
The caviar would be a link to the actual changelogs though I have no idea whether that's dealt by the package manager or the package itself

@deadcoder0904
Copy link

i use 2 commands with pnpm as bun isn't available directly on windows without wsl:

pnpm outdated & pnpm update --latest

i would love to have this in bun so i can fully replace pnpm with bun otherwise i have to find a workaround for this using ncu which i used to use previously before i learned about the respective pnpm commands.

definitely a must-have for me.

@bkniffler
Copy link

bkniffler commented Nov 14, 2023

Seems like someone added a tool based on npm-check: https://www.npmjs.com/package/npm-check-bun

bunx run npm-check-bun -u

(I'm not affiliated with the author, found it randomly)

would love to see this built-in though, but looks like a good intermediate solution

@bkniffler
Copy link

bkniffler commented Nov 18, 2023

Found another alternative FYI in case you use workspace:*: https://www.npmjs.com/package/npm-check-updates#npm-check-updates

npx npm-check-updates -ws --root --format group -i

Works good with workspaces and has an interactive mode.

@toniengelhardt
Copy link

This is really the one thing stopping me from trying bun for package management...

@nahoc
Copy link

nahoc commented Feb 29, 2024

This is really the one thing stopping me from trying bun for package management...

It really shouldn't be -- like others mentionned, just do

  "scripts": {
    "update-deps": "bunx npm-check-updates --root --format group -i"
  }

And you're good.

@wottpal
Copy link

wottpal commented Mar 10, 2024

Still bun should have a native interactive updater. This is one of the best things about pnpm that this things works so smoothly out of the box.

@fungilation
Copy link

Ya I moved all my projects over to pnpm now. It got performance (not as blazing fast as bun but next best) and it got useful management cmds like outdated, up interactive

Would love to have bun as the 0 compromise package manager and runtime

@Barzi-Ahmed
Copy link

1+

Please deliver "bun outdated" command, same as "pnpm outdated".

@deadcoder0904
Copy link

now that windows is out, would love bun outdated & bun up --latest command to update it to latest dependencies.

for reference, check out how pnpm does it. its the only thing i do daily with pnpm.

@Scc33
Copy link

Scc33 commented Apr 3, 2024

This is really the one thing stopping me from trying bun for package management...

It really shouldn't be -- like others mentionned, just do

  "scripts": {
    "update-deps": "bunx npm-check-updates --root --format group -i"
  }

And you're good.

Thanks for sharing. This is awesome. Since bun is supposed to be all-in-one it would be great if native support is still added.

@KieranP
Copy link

KieranP commented Apr 5, 2024

Facing the same issue as others. Bun runs my Typescript project just fine, but lack of bun outdated is holding me back from switching from NodeJS/PNPM to just Bun. Once bun outdated is implemented, this will fill the remaining gap.

lukasjuhrich added a commit to agdsn/pycroft that referenced this issue Apr 13, 2024
…as there is no `bun outdated` script yet[1].

[1] oven-sh/bun#1223
lukasjuhrich added a commit to agdsn/pycroft that referenced this issue Apr 13, 2024
…as there is no `bun outdated` script yet[1].

[1] oven-sh/bun#1223
lukasjuhrich added a commit to agdsn/pycroft that referenced this issue Apr 13, 2024
…as there is no `bun outdated` script yet[1].

[1] oven-sh/bun#1223
lukasjuhrich added a commit to agdsn/pycroft that referenced this issue Apr 14, 2024
…as there is no `bun outdated` script yet[1].

[1] oven-sh/bun#1223
@Blankeos
Copy link

Blankeos commented Apr 14, 2024

Confirmed npm-check-updates works (as a work-around), hopefully Bun's own implementation would be faster.

bunx npm-check-updates
image

@RubyDorian
Copy link

voting this up. really needed feature. I don't want to update dependencies if I can't see what's outdated

@felixranesberger
Copy link

For the moment you could simply create a terminal alias for bunx npm-check-updates called bun outdated. You would have to make sure to remove it, when this feature is available in bun directly, so calling it something else would probably be better.

@dylan-conway dylan-conway self-assigned this Jun 13, 2024
@Araxeus
Copy link

Araxeus commented Jun 23, 2024

For the moment you could simply create a terminal alias for bunx npm-check-updates called bun outdated. You would have to make sure to remove it, when this feature is available in bun directly, so calling it something else would probably be better.

image

btw for global install you can run

bunx npm-check-updates -p bun --cwd $USERPROFILE/.bun/install/global

@Dimava
Copy link

Dimava commented Jul 3, 2024

Another alternative is https://github.com/antfu-collective/taze
bunx taze -I -r (bunx taze --interactive --recursive)

@lubuzzo
Copy link

lubuzzo commented Jul 29, 2024

+1 for bun outdated

@darklight9811
Copy link

if you try to run the command it shows its reserved, so they intend to do this feature and its already scoped, its just not the priority right now.

The taze alternative does cover this necessity for the time being

@ken717w
Copy link

ken717w commented Aug 20, 2024

Wondering why such a core feature of package management was not implemented in the first place, is there any story behind it?

@birkskyum
Copy link
Collaborator

birkskyum commented Aug 22, 2024

Having tried taze for a bit, it feels like update and update --latest just are less intuitive ways of saying minor and major.

Also, it would be great to ignore pinned packages, because in a repo that uses a pre-release like "convert-units": "3.0.0-beta.6", running bun update --latest will set it to "2.3.4", and then I have to manually revert that one package... interactive mode could ofc. make it less problematic, because it then wouldn't be bumped in the first place, but it's probably a good idea to treat pinned ones a bit differently (there's often a reason behind the pin), maybe ignore by default and have a flag to include..

@Araxeus
Copy link

Araxeus commented Aug 22, 2024

ignore by default and have a flag to include

@dylan-conway Would be nice if you would take this into account in your PR. The norm for packages is to specify a version range, and usually if there is a specific version instead of a range - there's a good reason for it.

@Jarred-Sumner
Copy link
Collaborator

This feature will be part of the Bun v1.1.26 release, thanks to @dylan-conway in #13461

@gitblit
Copy link

gitblit commented Aug 23, 2024

I'm very happy to see a native outdated command! 🎉 But I really wish it supported workspaces (really important, imo) & interactivity (bonus/nth).

@Barzi-Ahmed
Copy link

@Jarred-Sumner How do I check for outdated globally installed packages!? Something like pnpm -g outdated? No mentioning here or in docs

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

Successfully merging a pull request may close this issue.