Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: define module overlap finders as functions Since now, have multiple criteria to find different module overlaps. Each one can be represented with its own matching function. * fix: detect overlapping `targetPath`s in `generateFiles` * refactor: extract module sorting comparator as lambda * chore: introduce module overlap type To render different kinds of overlaps properly. * refactor: move module overlap detection code to a separate file * refactor: move module overlap error rendering function to `module-overlap.ts` * refactor: move some stateless helpers to the root level Closure-free lambdas can be declared only once. * refactor: named interface for overlap error description * refactor: change `makePathOverlapError` to return list of errors Also renamed it to `makePathOverlapErrors`. * chore: render all types of module overlap errors * chore: remove `switch` and reduce code duplication DRY and more types for safety. * chore: fail-fast check for module overlap handler availability * chore: more specific error details Print the list of intersecting modules. * test: fix trivial assertion failures Use explicit types for expected values to ensure that all required fields are set. * chore: print overlapping paths in `generateFiles[].targetPath` * refactor: rename `module` to `config` in `ModuleOverlap` Because its type is `ModuleConfig`, not `GardenModule`. * refactor: rename local variable * refactor: rename `matches` to `overlaps` in anonymous return type * chore: remove outdated todo-comment * refactor: extract function DRY + some cleanup. * refactor(test): introduce surrounding test context * test: test module intersection by `generateFiles[].targetPath` * test: mix of different types of module overlaps * perf: halve the number of module overlap checks * refactor: move lambdas outside the overlap detection function Also introduced parameter object for `ModuleOverlapFinder`. Additionally, made lambdas closure-free. * refactor: change the shape of `ModuleOverlapFinderResult` * fix: ensure commutativity of `ModuleOverlapMatcher` functions * refactor: simplified error detail rendering No need to traverse all possible overlap types. * refactor: named interfaces for better readability * chore: print all found module overlapping errors * chore: fix typo * fix: `generateFiles` presence check * test: fix assertions Now module overlap detector prints more details. * fix: report no overlap on non-intersecting `generateFiles` * perf: remove unnecessary sorting The module overlap lists are constructed as sorted ones. * chore: re-arranged code --------- Co-authored-by: Thorarinn Sigurdsson <[email protected]>
- Loading branch information