Closed claudio-silva closed 8 years ago
I've been thinking about this, and I guess my proposed solution might not be the best way to handle this, because even if bower-installer
copied files to a destination folder, one might still need to process those files afterwards (ex. minification, concatenation).
So, striving for a more generic solution, the list above might be simplified and reduced to:
extra.bower-extra
section on packages' composer.json
into bower.json
. These keys may be called install
(for use by bower-installer) or anyhting else (for use by other plugins).composer-extra-assets
runs bower
. This will allow the lauch of a build tool to process the assets installed by bower.And that's it. Point 2 is neccessary because:
post-update-cmd
) because we can't be sure composer-extra-assets
has changed anything.composer-extra-assets
has already run before that plugin.So, this solution would allow bower-installer
or any other build tool to run synchronized with composer-extra-assets
.
What do you think?
I can see you are very busy and this project seems to be somewhat stale. I had to create my own alternative to fit our needs. So, there's no need to keep this issue open. Regards
Sorry, I was on vacation when you created this issue and totally forgot about it :/
I think that could be implemented as composer plugin:
we can't just use one of composer's event scripts (like post-update-cmd) because we can't be sure composer-extra-assets has changed anything.
No real problem if it is done on every update/install - only a performance issue that can be solved by caching or remembering a state somewhere.
we can't just use another composer plugin because we can't be sure composer-extra-assets has already run before that plugin.
events have a priority, making sure the plugin gets called after composer-extra-assets can be done by using the right priority.
Ok, no problem. Thanks for your feedback. As I said, we had to develop our own solution because we were in a hurry.
We are also toying with a new possibility that Bower currently provides, which is the feature of requiring local folder as Bower packages. This way, there is no need for us to merge required frontend packages from multiple Composer packages, we can just add those Composer packages directly as Bower dependencies and Bower reads each Bower.json and joins all the requirements, solving version conflicts and prompting the user to help, if required. I didn't know it could do that, as there is no mention of it on the documentation. If you also don't know about it, we can read this thread. Perhaps it may be of use to you too.
Wow, interesting! Thank you for that information...
This is a suggestion. To really make this plugin the killer solution for managing bower dependencies on PHP projects, what's missing is an integration with bower-installer. This would allow the automatic copy of selected files from the bower-installed repositories into the application's public assets directory.
What would have to be added to this plugin:
bower-installer
, if not yet installed.install
section on the packages' composer.jsonextra
section.bower.json
'sinstall
section.bower-installer
whenevercomposer-extra-assets
runsbower
. This feature could be optional and enabled by a configuration setting for those people that need it.Would you consider implementing this feature or, at least, accepting a pull request implementing it?