Started reworking the component replacement implementation according to the dev list discussion. First, extracted an interface. I want to inject ConflictHandler into DependencyGraphBuilder.
ConflictHandler is injected into DependencyGraphBuilder. The classes are now decoupled and I'm able to remove the 'prefer' API from the dependency resolve rules.
Stopped using resolution rules for component replacement. Now the component replacement is configured via a dsl on dependencies.components and the model passed to the DependencyGraphBuilder behind the ConflictHandler. Tidy-ups pending. DSL changes do not touch public interfaces yet.
Added coverage into the DependencyGraphBuilder, related to new component replacement feature. It's not great because we're using concrete implementation of the ConflictHandler for now.
Rename job:
1. ModuleMetadataProcessor->ModuleMetadataHandler, because it needs to do more than just metadata manipulation. Later, I'll extract ModuleMetadataProcessor and see if it makes sense to introduce it.
2. ModuleMetadataHandler.process -> ModuleMetadataHandler.processMetadata, as it makes more sense now after renaming the class (also one-word methods are not easy to work with in large codebase that includes dynamic languages).
Added back the ModuleMetadataProcessor, in the spirit of interface segregation. It is also more consistent with the codebase before my refactorings so it should easier to grasp for devs involved in this area.
Improved the integ test coverage for the component replacement. Reduced the duplication.
Updated the spec according to latest discussion conclusion on the dev list.
Started adding some more corner-case style integ test coverage for the component replacement feature.
Component replacement chains are not working correctly at the moment. I'm adding more coverage until I'm ready to fix this.
Reduced the complexity of DefaultConflictHandler by pushing it out to a separate class. This way, I can add more coverage much cleanly.
Added more coverage, documentation and simplified the code around conflict processing.
Finally fixed the problem with chained replacedBy declarations for the component replacement feature. Improved the internal model, too, and the coverage.
Refactoring and rename job for better clarity.
More modelling, avoided using null for informing that there is no conflict.
Documented public interfaces exposed in this package.
Reworked the coverage. Since we have that covered elsewhere (ConflictContainerTest), no need to maintain comprehensive (and complicated) tests in DefaultConflictHandlerTest.
Fixed a problem I have introduced in one of the previous refactorings. Thank you, tests.