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

Should dpx install latest if no version constraint is given? #11

Open
evanweible-wf opened this issue Jun 14, 2024 · 2 comments
Open

Should dpx install latest if no version constraint is given? #11

evanweible-wf opened this issue Jun 14, 2024 · 2 comments

Comments

@evanweible-wf
Copy link
Contributor

If you specify a version constraint when running a package executable, dpx will first check to see if you have a version of that package already globally activated that satisfies that version constraint:

dpx dependency_validator@^4.0.0

This makes the process faster by avoiding unnecessary network requests.

But, if you're omitting the version constraint for brevity, like this:

dpx dependency_validator

Then any version of that package, if already activated, will technically satisfy the omitted version constraint. That may be fine, but it may lead to confusing behavior if you were expecting to be able to use an option or some behavior that was only recently released.

Would a better default be to always try to install the latest version of a package if no version constraint is specified?

@greglittlefield-wf
Copy link

@evanweible-wf If we decide to stick with the current behavior, having a way to explicitly use the latest would be nice.

For example, something like:

dpx dependency_validator@latest

@matthewnitschke-wk
Copy link
Contributor

From what I can tell, this is a known issue in the npx world of things: https://stackoverflow.com/a/74855146, but they do support the @latest specification that greg mentioned

Parity with npx probably makes the most sense, but if we wanted to get fancy with it, some iterative checking could be interesting

Eg: only for the first execution per day, check version of the script being used. Otherwise just execute what's in the cache. Kind of like how homebrew does it, but during execution of a specific command

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants