Great work!
If you would like to install the select2 library with composer, you will need to add the following to the composer.json file into the repositories array:
{
"type": "package",
"package": {
"name": "jquery/select2",
"version": "4.0.5",
"type": "drupal-library",
"dist": {
"url": "https://github.com/select2/select2/archive/4.0.5.zip",
"type": "zip"
}
}
}
After this you can install the library with "composer require jquery/select2" and the library will be downloaded into the libraries folder.
Maybe this could be added to the documentation?
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | select2_composer-library-2990299-4.patch | 696 bytes | heliogabal |
Comments
Comment #1
Anonymous (not verified) commentedjoep.hendrix created an issue. See original summary.
Comment #2
Anonymous (not verified) commentedComment #3
heliogabalI think rather than add this to the documentation, this should be patched to avoid manual work. I created a patch from your code so this can be tested and merged.
Comment #4
heliogabalsorry, wrong patch, I hope this one works.
Comment #5
Anonymous (not verified) commentedNo, this should go into the root composer.json. The module composer.json is not used by composer.
Comment #6
Anonymous (not verified) commentedComment #7
heliogabalYeah sorry, I found that out as well: apparently, the repositories array can only be added to the main composer.json as it is not resolved recursively: https://getcomposer.org/doc/04-schema.md#repositories
It seems there is no easy way to do this right now, as described in this comment: https://www.drupal.org/project/drupal/issues/2873160#comment-12571586
Setting this to postponed, hope this is the right way to do it. If there is a solution upstream, this can be fixed later.
Comment #8
Anonymous (not verified) commentedComment #9
Anonymous (not verified) commentedPlease ad this to the documentation.
Comment #10
chr.fritschI added that to the module description page.
Thx