07-26-2023, 11:23 PM
What is the best way to install a third party library in Drupal 8 that is not on packagist?
For example I have the [Color Field module][1], which can use the [jQuery Simple Color Picker library][2] to provide a better user experience.
The most obvious solution is to just add the library manually, but that's not really maintainable.
My second idea was to add the git repository to my composer.json, as shown below, but it doesn't work because the target repository doesn't have a composer.json file.
"repositories": [
{
"name": "jquery-simple-color",
"type": "git",
"url": "https://github.com/recurser/jquery-simple-color.git"
}
],
"require": {
"jquery-simple-color/": "1.2.1"
}
Should I just fork the git repository and add a composer.json file there?
[1]:
For example I have the [Color Field module][1], which can use the [jQuery Simple Color Picker library][2] to provide a better user experience.
The most obvious solution is to just add the library manually, but that's not really maintainable.
My second idea was to add the git repository to my composer.json, as shown below, but it doesn't work because the target repository doesn't have a composer.json file.
"repositories": [
{
"name": "jquery-simple-color",
"type": "git",
"url": "https://github.com/recurser/jquery-simple-color.git"
}
],
"require": {
"jquery-simple-color/": "1.2.1"
}
Should I just fork the git repository and add a composer.json file there?
[1]:
[To see links please register here]
[2]:[To see links please register here]