Skip to content

Issue installing library with their own composer.json #435

Open
@jurgenhaas

Description

@jurgenhaas

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions