-
Notifications
You must be signed in to change notification settings - Fork 119
Description
We have a monolithic codebase which we're trying to modularise into engines, using Packwerk to define and enforce the dependencies between them.
Moving our app code into the engines is usually pretty straightforward, but the tests are a problem. In a lot of places, the model code works generically without reference to the types of input it gets, but the tests define the behaviour using concrete examples of inputs using classes from outside the engine. We work with non-technical domain experts to write these tests, and they work almost exclusively with concrete examples, so rewriting them with dummy classes isn't a long-term solution.
What I'd really like is to be able to define one set of dependencies for the app code in each engine, and have Packwerk enforce those for the code under engines/whatever/app; and another looser set of dependencies for the spec code, and have Packwerk enforce those for the code under engines/whatever/spec. That way, we could move our test files across unaltered. Ideally, I'd do this in a single package.yml file:
enforce-dependencies: true
dependencies:
- app
- engines/base
- engines/engine1
- spec
- engines/base
- engines/engine1
- engines/engine2This could then be simplified using YAML anchors etc...
Hope that makes sense! Apologies if this is already possible and I've missed how to do it.