Open itsezc opened 1 year ago
As an additional request, something like Yarn v2's upgrade-interactive
plugin would be really nice.
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.
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
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 🤣
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.
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
I guess this is technically "do the update" instead of "check for updates", but I wonder if that's fine?
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?
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
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
?
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.
sounds good, we'll do bun outdated
and leave bun pm
namespace for the more obscure commands that potentially conflict with script names
'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
?
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
@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! ❤️
+1 for bun update --interactive
it would be nice to have something like this package natively on bun:
Hello there, just saying but I really second having an interactive CLI interface for outdated packages like yarn's yarn upgrade-interactive --latest
Compared to a more simple statement of outdated packages like npm outdated
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
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.
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
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.
@Jarred-Sumner is there any plan to implement this?
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.
I am not sure why we need
bun outdated
instead ofbun 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?
@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.
Yep, that issue is frustrating for me too, you can track #4312 for that.
This is really the one thing stopping me from trying bun for package management...
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.
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.
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
1+
Please deliver "bun outdated" command, same as "pnpm outdated".
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.
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.
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.
Confirmed npm-check-updates
works (as a work-around), hopefully Bun's own implementation would be faster.
bunx npm-check-updates
voting this up. really needed feature. I don't want to update dependencies if I can't see what's outdated
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.
For the moment you could simply create a terminal alias for
bunx npm-check-updates
calledbun 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.
btw for global install you can run
bunx npm-check-updates -p bun --cwd $USERPROFILE/.bun/install/global
Another alternative is https://github.com/antfu-collective/taze
bunx taze -I -r
(bunx taze --interactive --recursive
)
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