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
chore(cli): better group handling #1204
chore(cli): better group handling #1204
Conversation
Thank you for your pull request! The most important CI builds succeeded, we’ll review the pull request soon. |
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 refactor!
Have left a review.
Co-Authored-By: Rishabh Chawla <rishabh31121999@gmail.com>
Co-Authored-By: Rishabh Chawla <rishabh31121999@gmail.com>
Co-Authored-By: Rishabh Chawla <rishabh31121999@gmail.com>
Co-Authored-By: Rishabh Chawla <rishabh31121999@gmail.com>
…webpack-cli into feature/better-group-handling # Conflicts: # lib/utils/GroupHelper.js
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.
Left a couple of comments.
@ematipico Thanks for your update. I labeled the Pull Request so reviewers will review it again. @jamesgeorge007 Please review the new changes. |
Thanks everyone! |
What kind of change does this PR introduce?
A refactor of how configuration and arguments are handled and creating the final configuration to pass to webpack compiler
Did you add tests for your changes?
It's a refactor and all the existing tests are still passing
If relevant, did you update the documentation?
Yes, I added JSDoc to help the refactor
Summary
The problem of the current logic is that all the group helpers are randomly created and with a simple loop their logic is run. Which mean there's no order and we don't know which options comes first and which after.
For example, we have a group helper responsible to handle the configuration object (
ConfigHelper
) and we have a group helper responsible of the output (OutputHelper
).If
OutputHelper
is run first andConfigHelper
second, the information that we have inside the configuration will override the one inside the output, which is not the behaviour that the CLI should have.The arguments passed via CLI have to override the one that we have inside the configuration. So now the order is the following:
Does this PR introduce a breaking change?
Nope
Other information