oven-sh / bun

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

Request: `outdated` CLI command #1223

Open itsezc opened 1 year ago

itsezc commented 1 year ago

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

jakeboone02 commented 1 year ago

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

image

jack-weilage commented 1 year ago

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 commented 12 months ago

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 commented 11 months ago

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 commented 11 months ago

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 commented 11 months ago

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 commented 11 months ago

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

jack-weilage commented 11 months ago

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 commented 11 months ago

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 commented 11 months ago

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 commented 11 months ago

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 commented 11 months ago

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

kenbankspeng commented 10 months ago

'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 commented 10 months ago

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 commented 9 months ago

@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 commented 9 months ago

+1 for bun update --interactive

danielbarion commented 9 months ago

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

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

wJoenn commented 9 months ago

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 commented 8 months ago

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 commented 7 months ago

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 commented 7 months ago

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.

nijikon commented 6 months ago

@Jarred-Sumner is there any plan to implement this?

itsjavi commented 5 months ago

I use pnpm update --latest to upgrade all deps in my package.json, then I clean up node_modules and run bun install.

I don't know if there is a cleaner way to do this, but bun update -f isn't updating the package.json, and I am not sure why we need bun outdated instead of bun update --outdated, I'd rather have readable explicit behavior.

silvenon commented 5 months ago

I am not sure why we need bun outdated instead of bun update --outdated, I'd rather have readable explicit behavior.

Because outdated is a command we're very much used to from npm and yarn. The two command you specified sound different to me, what would the latter one do? It sounds like it updates outdated dependencies, which is what bun update already does anyway.

And what is the relation between that and the pnpm example you specify?

itsjavi commented 5 months ago

@silvenon that's right. I guess I got confused (lack of sleep :D). What I tried to say is that it seems there is no way to update the package.json after the dependencies have been updated. Unless I am missing something. But I think this is not the right issue to discuss this.

silvenon commented 5 months ago

Yep, that issue is frustrating for me too, you can track #4312 for that.

toniengelhardt commented 4 months ago

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

nahoc commented 4 months ago

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 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

1+

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

deadcoder0904 commented 3 months ago

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 commented 3 months ago

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 commented 2 months ago

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.

Blankeos commented 2 months ago

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

bunx npm-check-updates
image
RubyDorian commented 1 month ago

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

felixranesberger commented 3 weeks ago

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.

Araxeus commented 1 week ago

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 commented 3 hours ago

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