To install the library using the same setup as the webform module, we should add a composer.libraries.json file to the module.

See https://www.drupal.org/docs/8/modules/webform/webform-frequently-asked-q...

Comments

jcnventura created an issue. See original summary.

jcnventura’s picture

Status: Active » Needs review
StatusFileSize
new1.35 KB
kevinquillen’s picture

Lets be sure to update the README too to match.

jcnventura’s picture

Status: Needs review » Needs work

As per #3

kevinquillen’s picture

LGTM, how does this work exactly? How can I test the process?

jcnventura’s picture

You need to composer require wikimedia/composer-merge-plugin

and add the following to the site's composer.json:

        "merge-plugin": {
            "include": [
                "[docroot]/modules/contrib/ckwordcount/composer.libraries.json"
            ]
        },

Where [docroot] is your site's root (web/docroot).

jcnventura’s picture

Issue summary: View changes
kevinquillen’s picture

All seems good to me if both ways work for folks.

  • jcnventura authored 6ea13af on 8.x-1.x
    Issue #3200823 by jcnventura, kevinquillen: Create a composer.libraries....
jcnventura’s picture

Status: Needs work » Fixed
hchonov’s picture

Status: Fixed » Needs work

That was a BC break and should've required a new major version. Sites that used to retrieve the library aren't retrieving it anymore. I am re-openning the ticket for eventual revert.

jcnventura’s picture

Status: Needs work » Fixed

Sorry @hchonov, but the previous composer.json dependency never worked correctly, so it's not a real BC-break. See #3172165: Composer setup does not install the plugin in the libraries folder

It only worked if you used the mnsami/composer-custom-directory-installer plugin and had prepared the composer.json like in the previous instructions. And yes, I do realize a few select sites might be in that situation. The solution for those is to fix those site's composer.json. Reverting is not an option.

  • jcnventura authored e3567b2 on 8.x-1.x
    Issue #3200823 by jcnventura: Restore the w8tcha/ckeditor-wordcount-...
jcnventura’s picture

I've created a 1.4 release that re-introduces the dependency on w8tcha/ckeditor-wordcount-plugin

jcnventura’s picture

Status: Fixed » Needs work

OK. So version 1.4 is even worse as it triggers a problem in one of the composer plugins (not sure if mnsami/composer-custom-directory-installer, or oomphinc/composer-installers-extender or wikimedia/composer-merge-plugin), that results in the library not being installed.

At this point, I don't think that it is possible to keep the composer.libraries.json in the 1.x branch. I'll create a 1.5 release that removes it, and
then a 2.0 release that uses it and will be almost exactly the same as version 1.3.

Sorry about this mess everyone.

  • jcnventura authored 98818a5 on 8.x-1.x
    Issue #3200823 by jcnventura: Revert the composer.libraries.json file
    
jcnventura’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

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