Open sminnee opened 7 years ago
I would prefer the latter. A composer update should fix it imo, adding more overhead of another composer command sounds tedious.
I don't see this as being an issue that warrants our effort. If someone is using a module in the way described it should be added to their repositories
section of composer.json
so they don't rely on packagist.
Whilst coping missing assets would be nice, I don't think that this context is so important.
Context
When you first create a module and it's not on packagist yet, you'll most likely add it to a project without composer require. (Forcing the use of composer's repositories section would be awful, and at the very start of dev it might not even be available in a remote repo)
For most SilverStripe behaviour this is okay — the manifest-based autoloader can be used in place of composer's PSR-4 one, and SilverStripe will find the module folder either in the root, or in vendor/.
However, if you've put your module into vendor then the resources will need to be copied out .
Proposed solutions
Either of the following would work:
composer add-module <path>
where you could execute its behaviour on an additional module.resources/
on demand. This would be a reasonable default for dev environments, and the problem described in this ticket doesn't apply to prod environments