- Issue created by @SirClickALot
- 🇭🇺Hungary nagy.balint
Hi!
run
composer require drupal/chosen:5.0.0 drupal/chosen_lib:5.0.0 -W
But also make sure that you have the related library, as 5.0.0 uses a fork of chosen without jQuery.
- 🇬🇧United Kingdom SirClickALot Somerset
Hi nagy.balint,
Thanks for your guidance here but can you please be more specific about precisely which version I should be using?
In the past (for some reason?) I have been manually downloading and adding the Chosen JS library but once I am clear about the precise version, is it OK for me to add it into my sites'
composer.json
using similar lines these I use for some other libraries..."npm-asset/lazysizes": "^5.3", "npm-asset/select2": "^4.0", "npm-asset/superfish": "^1.7",
Thanks a lot.
- 🇭🇺Hungary nagy.balint
I usually add the library into the repositories section of the composer.json
{ "type": "package", "package": { "name": "noli42/chosen", "version": "3.0.0", "type": "drupal-library", "dist": { "url": "https://github.com/noli42/chosen/releases/download/3.0.0/chosen-assets-v3.0.0.zip", "type": "zip" } } },
and then i can just do composer require noli42/chosen
- 🇬🇧United Kingdom SirClickALot Somerset
Thanks again!
For consistency in my
composer.json
, am I able to use annpm-asset
-style line as above in my question.Notwithstanding any individual's work, I would rather use a reference to the node asset library if possible and if so, might it simply be...
"npm-asset/chosen": "^3.0"
? - 🇭🇺Hungary nagy.balint
For that the library would need to be published under npm-asset which is not the case currently.
- 🇭🇺Hungary nagy.balint
npm-asset/chosen is already taken.
I could try registering at https://packagist.org/ so then it would be possible to install the lib without the repositories section as composer require noli42/chosen.
And then it will only need one line at
"installer-paths": {
"docroot/libraries/{$name}": [something like
"vendor:noli42",to make sure that it is installed at the right place.