Closed kennyadsl closed 4 years ago
@kennyadsl how about moving decorators into their own directory (like we do in app
) and having a structure like the following instead?
lib/controllers/backend
lib/decorators/backend
So, basically, the pattern is: lib/[file type]/[solidus engine]
.
This creates a very clean visual separation for developers and also makes sure we don't add decorator files to paths['app/controllers']
.
If you think this structure works, I would suggest adding this to solidus_support instead. A lot of extensions could benefit from this pattern.
We'd still need to differentiate the type of decorator in an inner folder, so it would be:
lib/controllers/backend
lib/decorators/backend/controllers/...
So it's a bit more complex, but maybe the best path.
I think that works, even if it's not exactly beautiful, and it's basically the same structure we have in app/decorators
so it's also consistent.
Decorator files are now correctly added to the autoloader and are also loaded on engine boot. This extension is quite unique since it conditionally loads frontend and backend so we can't use the Engine helpers recently added in
solidus_support
.This PR is also removing useless assets compilation and refactoring the Engine a little bit.