- Issue created by @pameeela
- π©πͺGermany jurgenhaas Gottmadingen
Thanks @pameeela for introducing this.
Happy to help out with this, if maintainers agree to proceed with this. Here is what we've done in other places like Fullcallendar β or Klaro β :
- Create a general project on d.o as a mirror of the remote library
- Add a composer.json to that repository, set the name to
drupal/NAMEOFLIB
and set the type todrupal-library
, also add the installer-name in the extra section to the name of the directory into which this library needs to be installed - Push that code and create a release, ideally with the same version number as the referencing upstream library
The packaging system from d.o will publish that project to Packagist and you can now add
drupal/NAMEOFLIB
to require section of the composer.json of this project. From now on, the library will be installed automatically without the user having to do anything manually. - π¦πΊAustralia pameeela
Changing tag to target since this is a pretty last-minute request and is not trivial.
- πΊπΈUnited States smustgrave
Would it be easier to add a composer.libraries file?
- π©πͺGermany jurgenhaas Gottmadingen
@smustgrave it won't help. The problem is that composer can't load the required library without the declaration of an extra repository. And that needs to be done manually in the root composer.json file, i.e. that's manual work and therefore not a solution for Drupal CMS.
As composer already knows about the repository of packagist.org, we can easily make the libraries available there and every composer can require them without any extra or manual setup. In addition to that, this approach also solves the need that the libraries then get installed in the right directory as well, i.e.
/web/libraries
. Also without any extra configuration.