Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Composer install paths should not be alphabetized #699

Closed
FlorentTorregrosa opened this issue Feb 27, 2021 · 3 comments
Closed

Composer install paths should not be alphabetized #699

FlorentTorregrosa opened this issue Feb 27, 2021 · 3 comments
Assignees
Labels

Comments

@FlorentTorregrosa
Copy link

Steps required to reproduce the problem

When using composer installer to specify paths for certain packages, sometimes you want to override the default folder name of the package, but you need to specify the rule after the generic one.

Therefore you end up with non alphabetically sorted keys.

Below is my usage with jquery-easing and slick.

Expected Result

        "installer-paths": {
            "app/core": [
                "type:drupal-core"
            ],
            "app/libraries/{$name}": [
                "type:drupal-library",
                "type:bower-asset",
                "type:npm-asset"
            ],
            "app/libraries/jquery.easing": [
                "bower-asset/jquery-easing-original"
            ],
            "app/libraries/slick": [
                "bower-asset/slick-carousel"
            ],
            "app/modules/contrib/{$name}": [
                "type:drupal-module"
            ],
            "app/modules/custom/{$name}": [
                "type:drupal-custom-module"
            ],
            "app/profiles/contrib/{$name}": [
                "type:drupal-profile"
            ],
            "app/profiles/custom/{$name}": [
                "type:drupal-custom-profile"
            ],
            "app/themes/contrib/{$name}": [
                "type:drupal-theme"
            ],
            "app/themes/custom/{$name}": [
                "type:drupal-custom-theme"
            ],
            "drush/Commands/contrib/{$name}": [
                "type:drupal-drush"
            ]
        },

Actual Result

Composer normalize wants:

        "installer-paths": {
            "app/core": [
                "type:drupal-core"
            ],
            "app/libraries/jquery.easing": [
                "bower-asset/jquery-easing-original"
            ],
            "app/libraries/slick": [
                "bower-asset/slick-carousel"
            ],
            "app/libraries/{$name}": [
                "type:drupal-library",
                "type:bower-asset",
                "type:npm-asset"
            ],
            "app/modules/contrib/{$name}": [
                "type:drupal-module"
            ],
            "app/modules/custom/{$name}": [
                "type:drupal-custom-module"
            ],
            "app/profiles/contrib/{$name}": [
                "type:drupal-profile"
            ],
            "app/profiles/custom/{$name}": [
                "type:drupal-custom-profile"
            ],
            "app/themes/contrib/{$name}": [
                "type:drupal-theme"
            ],
            "app/themes/custom/{$name}": [
                "type:drupal-custom-theme"
            ],
            "drush/Commands/contrib/{$name}": [
                "type:drupal-drush"
            ]
        },
@localheinz localheinz self-assigned this Mar 1, 2021
@localheinz localheinz added the bug label Mar 1, 2021
@FlorentTorregrosa
Copy link
Author

I was going to provide a patch in the concerned Drupal module to make it uses the default folder names, but when looking at the code I realised that the module dynamically checks several folder names to find the libraries, among which the default ones.

So I no more need this workaround.

You can close the issue if you want.

@ergebnis-bot
Copy link
Member

Since this issue has not had any activity within the last 180 days, I have marked it as stale.

I will close it if no further activity occurs within the next 14 days.

@localheinz
Copy link
Member

Thank you, @FlorentTorregrosa!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants