-
Notifications
You must be signed in to change notification settings - Fork 12k
As a CLI user, I want ng update
to also update dependencies IF they're present.
#13015
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
Comments
I like the solution B myself. The relationship between So it means |
Solution B seems somewhat neater and indeed some packages are not a direct dependency. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This requires a field similar to
peerDependencies
, but those are required by Node, so only looked at by the update schematics. So something likeoptionalPeerDependencies
that is read by ng update, and if the dependency is there treat it as a peer deps, otherwise ignore the field.This is useful because we want
ng update @angular/cli
to update build-angular and other packages automatically, but still let the user remove them from their projects if they’re not needed (so not directly depend on them). Same for angular.Solution A: add a new
dependencies
to theng-update
field in package.json. This has similar semantics todependencies
in the root package.json object, but would be only used by ng update itself.Solution B (recommended): Considering we already support
packageGroup
, I suggest reusing it instead. Right now, thepackageGroup
field in theng-update
field in thepackage.json
is typedstring[]
and does not support setting different versions of it. Reusing that field to type itstring[] | { [name: string]: string }
where the value is a version range (similar to dependencies) would fix this the right way, while keeping backward compatibility AND keeping the change scoped to ng-update itself.The second solution would take less than a day to build, test and release.
Please discuss.
The text was updated successfully, but these errors were encountered: