composer / composer/installers

Issue installing library with their own composer.json

Open
#435 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
1.4k
Forks
400
PR merge metrics
No merged PRs in 30d

Description

Used versions:

- PHP: 7.0
- composer: 1.8.6
- composer/installers: 1.7.0

Context: Drupal project

Here is an extract of my composer.json:

```
{
...
"repositories": [
{
"type": "composer",
"url": "https://packages.drupal.org/8"
},
{
"type": "package",
"package": {
"name": "ckeditorplugin/codesnippet",
"type": "drupal-library",
"version": "master",
"dist": {
"type": "zip",
"url": "https://download.ckeditor.com/codesnippet/releases/codesnippet_4.5.11.zip",
"reference": "master"
}
}
},
{
"type": "package",
"package": {
"name": "harvesthq/chosen",
"type": "drupal-library",
"version": "master",
"dist": {
"type": "zip",
"url": "https://github.com/harvesthq/chosen/releases/download/v1.8.7/chosen_v1.8.7.zip",
"reference": "master"
}
}
}
],
"require": {
"ckeditorplugin/codesnippet": "master",
"harvesthq/chosen": "^1.6",
...
},
"extra": {
"installer-paths": {
...
"web/libraries/{$name}": [
"type:drupal-library"
],
},
}
}
```

Expectation: both libraries should be installed in `web/libraries` but only codesnippet lands there and the chosen library goes into the `vendor` directory. I guess this is because that library comes with a composer.json which declares the type as library which seems to overwrite my type drupal-library.

I've then tried to add `"harvesthq/chosen"` to extra / installer-paths / web/libraries array but that made no difference.

My question is: how do I get the chosen library into the web/libraries path?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.