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
fix: clean overrides for removed dependencies #13170
Conversation
Overrides should also automatically be cleaned from the package.json if there is no dependency that the override would be targeting.
flow-server/src/main/java/com/vaadin/flow/server/frontend/TaskUpdatePackages.java
Show resolved
Hide resolved
flow-server/src/main/java/com/vaadin/flow/server/frontend/NodeUpdater.java
Outdated
Show resolved
Hide resolved
if (!(dependencies.hasKey(dependency) | ||
|| devDependencies.hasKey(dependency)) | ||
&& overridesSection.getString(dependency).startsWith("$")) { | ||
overridesSection.remove(dependency); |
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.
Does it mean that any $
-overrides will be removed, even some added by the user?
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.
(Note: certainly not blocking, as this may not be a real issue as this mechanism is unlikely to be used much in Flow projects, just asking for the record)
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.
This checks the dependencies and devDependencies sections, right? So if I have a dependency on foo
I can define an override for foo
without this removing 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.
So it will remove overrides starting with $
that are not in dependencies
or devDependencies
. As such a configuration would cause npm to raise an error anyway this is probably unlikely to be an issue ever.
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Overrides should also automatically be cleaned from the package.json if there is no dependency that the override would be targeting.
Overrides should also automatically
be cleaned from the package.json
if there is no dependency that the
override would be targeting.