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

Issues with deno outdated #27025

Closed
kuchta opened this issue Nov 23, 2024 · 3 comments
Closed

Issues with deno outdated #27025

kuchta opened this issue Nov 23, 2024 · 3 comments
Assignees
Labels
needs discussion this topic needs further discussion to determine what action to take outdated Related to `deno outdated` tool

Comments

@kuchta
Copy link

kuchta commented Nov 23, 2024

Version: Deno 2.1.0

deno outdated is very useful command, but either it's documentation could be improved or it's behavior, because right now, it's a bit confusing.

Running deno outdated --latest errors with

error: the following required arguments were not provided:
  --update

But my understanding is --latest is basically counterpart of --compatible flag that can be run without --update flag.

The documentation for --compatible is also a bit confusing, as it often expands the selection, not narrows it as the only word suggests.
--compatible Only output versions that satisfy semver requirements

Running outdated with any selection modifier without --update flag is in it's current implementation quite important, because --update don't ask for any confirmation, which it probably should.

Anyway, I'd rather call this command update since users are used to it from other package managers and get rid of the --update flag and just ask the user for confirmation or introduce --print flag for just printing.

@bartlomieju bartlomieju added needs discussion this topic needs further discussion to determine what action to take outdated Related to `deno outdated` tool labels Nov 26, 2024
@nathanwhit
Copy link
Member

But my understanding is --latest is basically counterpart of --compatible flag that can be run without --update flag.

Ah this is a bit of a misunderstanding, deno outdated without --update already displays dependencies with new latest versions. In other words, adding --latest wouldn't do anything, as it's already the default behavior.

That being said, it's true that it doesn't need to be an error. I'll open a PR to allow it.

The documentation for --compatible is also a bit confusing, as it often expands the selection, not narrows it as the only word suggests.

It should only narrow the selection, if it expands the selection that's a bug. Do you have an example of where that happens? I'm aware of #27038 (where pre release versions are involved), but is there another case you've encountered?

Running outdated with any selection modifier without --update flag is in it's current implementation quite important, because --update don't ask for any confirmation, which it probably should.

Most other tools I'm aware of don't ask for confirmation when updating. Instead, the plan is to add an --interactive flag in Deno 2.2 to allow interactively selecting which versions to update. This is also what most other tools do.

Anyway, I'd rather call this command update since users are used to it from other package managers and get rid of the --update flag and just ask the user for confirmation or introduce --print flag for just printing.

That was an idea we had considered, but the consensus was that deno update would be confusing since it appears similar to deno upgrade (but would behave very differently). But I do understand that it may be different from what people are used to

nathanwhit added a commit that referenced this issue Dec 4, 2024
Ref #27025.

it does nothing (it's the default behavior) but it doesn't hurt to allow
it
bartlomieju pushed a commit that referenced this issue Dec 5, 2024
Ref #27025.

it does nothing (it's the default behavior) but it doesn't hurt to allow
it
@kuchta
Copy link
Author

kuchta commented Dec 9, 2024

Ah this is a bit of a misunderstanding, deno outdated without --update already displays dependencies with new latest versions. In other words, adding --latest wouldn't do anything, as it's already the default behavior.

Ah okay, makes sense...

The documentation for --compatible is also a bit confusing, as it often expands the selection, not narrows it as the only word suggests.

It should only narrow the selection, if it expands the selection that's a bug. Do you have an example of where that happens? I'm aware of #27038 (where pre release versions are involved), but is there another case you've encountered?

Yes, it actually happens with pre-release versions...

Most other tools I'm aware of don't ask for confirmation when updating. Instead, the plan is to add an --interactive flag in Deno 2.2 to allow interactively selecting which versions to update. This is also what most other tools do.

That would probably also do...

Anyway, I'd rather call this command update since users are used to it from other package managers and get rid of the --update flag and just ask the user for confirmation or introduce --print flag for just printing.

That was an idea we had considered, but the consensus was that deno update would be confusing since it appears similar to deno upgrade (but would behave very differently). But I do understand that it may be different from what people are used to

Most other tools I'm aware of (apt-get, HomeBrew) also has this distinction, but I understand that you may not want to do that. It would probably be best if deno upgrade was changed to something that could manage multiple versions and call it that way...

@kuchta
Copy link
Author

kuchta commented Dec 15, 2024

I've found another confusing behavior of deno outdated

: deno outdated                   
: deno outdated --compatible
┌─────────────┬────────────────┬────────────────┬─────────┐
│ Package     │ Current        │ Update         │ Latest  │
├─────────────┼────────────────┼────────────────┼─────────┤
│ npm:daisyui │ 5.0.0-alpha.47 │ 5.0.0-alpha.48 │ 4.12.22 │
└─────────────┴────────────────┴────────────────┴─────────┘

Run deno outdated --update to update to the latest compatible versions,
or deno outdated --help for more information.
: deno outdated --compatible -u
error: the argument '--compatible' cannot be used with '--update'

Usage: deno outdated --compatible [filters]...
: deno outdated  -u
Updated 1 dependency:
 - npm:daisyui 5.0.0-alpha.47 -> 5.0.0-alpha.48

I would expect deno outdated -u to do nothing if deno outdated outputs nothing and deno outdated --compatible -u to update daisyui to the update version outputed by deno outdated --compatible but -u doesn't work with --compatible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs discussion this topic needs further discussion to determine what action to take outdated Related to `deno outdated` tool
Projects
None yet
Development

No branches or pull requests

3 participants