Description
We're running into situations where packwerk check
or packs check
returns incorrect results in some situations, like after changing branches. I believe that this is due to an interaction (or lack thereof) between packs-rails
and spring
.
Is anyone else seeing this problem?
I just (seemingly) fixed this on a project I am working on.
It looks like the explanation is the following:
packs-rails
sets up autoload paths by detecting package.yml
s. So moving packs around, renaming them, deleting packs or creating new ones leads to the autoload paths being changed. The application has to be restarted for that. Which means spring
needs to watch all the package.yml
s. I just did a Dir["packs/**/package.yml"],each { |f| Spring.watch(f) }
to fix it for us.
But if this is the actual explanation, everybody setting up packs-rails
naively should have this problem, and I haven't been hearing much about it. Does this ring a bell for anyone?
If this is actually a common problem, maybe we can have packs-rails
set up the spring watches implicitly?