-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
feat: subcommand to view and update outdated dependencies #26942
feat: subcommand to view and update outdated dependencies #26942
Conversation
Does this only show changes for packages that actually have newer versions? I have a project like this:
Running
There's no information for |
Yeah, only if the currently locked version is out of date. I went with that since that's what e.g. npm and pnpm do. It's easy if we want to change that though |
Obviously - I had a test repo for this feature and I removed my lockfile before running the command, so it first installed latest semver versions and there was nothing to upgrade 👍 |
@@ -32,10 +33,13 @@ use crate::jsr::JsrFetchResolver; | |||
use crate::npm::NpmFetchResolver; | |||
|
|||
mod cache_deps; | |||
pub(crate) mod deps; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, there's not much point to pub(crate)
in the CLI crate. I remove it whenever I see it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. LGTM!
pub latest: Option<PackageNv>, | ||
} | ||
|
||
pub struct DepManager { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe DepUpdater
? Generally Manager
is a term that's avoided because it means the struct has more than one responsibility.
deps: Vec<Dep>, | ||
resolved_versions: Vec<Option<PackageNv>>, | ||
latest_versions: Vec<PackageLatestVersion>, | ||
|
||
pending_changes: Vec<Change>, | ||
|
||
dependencies_resolved: AtomicBool, | ||
module_load_preparer: Arc<ModuleLoadPreparer>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the future, it might be beneficial to separate the state out of this struct then have the "service struct" operate on the state. That way we could make everything be constructed in the factory.
|
||
dependencies_resolved: AtomicBool, | ||
module_load_preparer: Arc<ModuleLoadPreparer>, | ||
// TODO(nathanwhit): probably shouldn't be pub |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, generally passing dependencies around horizontally in the code is not great, but this is fine for now.
Closes #20487
Currently spelled
and
Works across package.json and deno.json, and in workspaces.
There's a bit of duplicated code, I'll refactor to reduce this in follow ups
Currently supported:
Printing outdated deps (current output below which basically mimics pnpm, but requesting feedback / suggestions)
Updating deps
semver compatible:
latest:
current output is basic, again would love suggestions
Filters
Update to specific versions
Include all workspace members
Future work
Known issues (to be fixed in follow ups):
TODO (in this PR):
spec tests for filtersspec test for mixed workspace (have tested manually)deno update