For Drupal 8 users that want to maintain their site dependencies with composer and want to use the composer - npm / bower integration plug-in fxp/composer-asset-plugin then according to the INSTALL.txt instructions they are out of luck. They will have to go through the complicated process to create a custom composer install script to either move or symlink from web/libraries/masonry/dist/masonry.pkgd.min.js to the required web/libraries/masonry/masonry.pkgd.min.js
My feature request is that this module would support both locations.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | composer_support-2955243-3.patch | 5.34 KB | matthiasm11 |
Comments
Comment #2
danielveza+1. Would love this fixed. Will need it for at least one of our sites.
I'll look into providing a patch when we are closer to live if nothing has come of this by that point.
Comment #3
matthiasm11 commentedThe "sites/all/libraries/masonry/masonry.pkgd.min.js" (mentioned in the INSTALL.txt) is definitely a left-over from the D7 module.
Since D8 is all about using composer to manage modules and their dependencies, and I do not know of a way to add a fallback in masonry.libraries.yml, I've created a patch containing /libraries/masonry/dist/masonry.pkgd.min.js as the correct path. This ensures one can install the masonry module and libraries by composer.
If using the http://drupal.org/project/libraries module (not required for the masonry module), it may be possible to alter the path conditionally with a file_exists(). However, the functions libraries_load(), libraries_detect() and libraries_get_path() are all deprecated, so I doubt we should go that way.
Comment #4
japicoder commentedI did a review over #3 patch and this is IMHO needed. The Masonry 3.x versions and even the latest versions all of them provide the .pkgd.min.js file into the /dist folder, which means it is not detected by the module even when it's there.
+1 to have this patch commited.
Needless to say that patch #3 works for me.
Comment #5
markdcPatch works. Thank you.
Comment #6
jcmartinez#3 Works for me.
Comment #7
farnoosh commented# 3 worked for me as well.
Comment #8
farnoosh commentedFor anyone trying to install front-end JavaScript libraries that are required for this module: I followed this article for an Acquia/lightning project: http://lightning.acquia.com/blog/round-your-front-end-javascript-librari...
Hope it helps.
Comment #9
farnoosh commentedComment #10
dom. commentedHi !
I may be wrong but I wonder why we should have the masonry in the /dist folder.
Also, this is really interesting but maybe coupled with #3112871: Add dependent libraries via composer
The install.txt misses a little change because a /sites/all/libraries is left.
I will continue with a follow-up to not depend on the libraries module. It feels useless to me here.
Thanks A LOT for contribution :)
I will also report majid.ali as a contributer to this because of his contribution at #3112871: Add dependent libraries via composer.
Comment #12
dom. commentedComment #14
dom. commentedAdding a follow-up : #3156318: Handle Masonry and Imagesloaded libraries via composer