Problem/Motivation

When installing the Slick library using composer it'll download to "libraries/slick-carousel". This is different to the path the module requires - "libraries/slick".

Proposed resolution

Document how to change the installation path.

User interface changes

n/a

API changes

n/a

Data model changes

n/a

CommentFileSizeAuthor
#6 slick-n3284411-6.patch1.07 KBdamienmckenna

Comments

DamienMcKenna created an issue. See original summary.

damienmckenna’s picture

The fix is to change composer.json so that it has this section:

    "extra": {
        "installer-paths": {
...
            "libraries/slick": [
                "npm-asset/slick-carousel"
            ],
            "libraries/{$name}": [
                "type:drupal-library",
                "type:npm-asset"
            ],

This will install Slick to /libraries/slick as is required.

gausarts’s picture

Thank you.

Both locations are supported via a hook_alter, and the hook_install will adjust it based on it.

I don't understand the problem, please clarify.

damienmckenna’s picture

I did not test the module with the path "slick-carousel", I just reviewed the libraries.yml file and saw what happened when I used composer to download the library.

If the module supports both paths, it might be worth documenting this somewhere?

gausarts’s picture

I think I got the point :)

Currently the README.md file was indeed hidden at /docs as seen at https://git.drupalcode.org/project/slick home, but accessible via /admin/help/slick_ui.

Thalles already asked to move the file into the top level, but I refused it due to there are many doc files and easy edits at one location. I was inspired by Drush docs to declutter top level folder.

The required lines you mentioned are here:
https://git.drupalcode.org/project/slick/-/blob/8.x-2.x/docs/README.md#r...

It was also directed to Blazy for more details to DRY at all Blazy ecosystem.
https://git.drupalcode.org/project/slick/-/blob/8.x-2.x/docs/README.md#i...

https://git.drupalcode.org/project/slick/8.x-2.x/admin/help/blazy_ui#com...

If however they are not clear, poorly worded, or need more prominent placements, etc., I am happy to include your suggestions or patches on the next rewriting of the docs.

Thanks.

damienmckenna’s picture

Status: Active » Needs review
StatusFileSize
new1.07 KB

Ah. Yes, the wording was not clear to me.

Would this work?

   * If using composer the library will be downoaded to the directory
     `slick-carousel`; this is fine, the module will still be able to find the
     library, it does not have to be moved or renamed.
gausarts’s picture

Yes, more prominent.

Greggles and some other users here also suggested some improvements on the docs. I will incorporate yours along theirs on the next round.

Please allow me some delay to get back to it.

Thanks again.

damienmckenna’s picture

No problem, thank you!

  • gausarts committed 299c592 on 8.x-2.x
    Issue #3284411 by DamienMcKenna: Document how to make Composer download...
gausarts’s picture

Status: Needs review » Fixed

Committed. Thank you for contribution and patience.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.