drupal-ckeditor-libraries-group composer installation support

Created on 6 March 2020, over 4 years ago
Updated 6 June 2023, over 1 year ago

Problem/Motivation

With an increasing usage of Drupal 8/9 composer installation, configuration, and updates, composer support for CKEditor 4 plugins have been mediocre at best. With the deprecation of #2912387: Stop using wikimedia/composer-merge-plugin , we need a composer installation solution that eases the library burden for new installations.

CKEditor 4.x is epected to be replaced by CKEditor 5.x in Drupal 10: #2966864: Add optional support for CKEditor 5 in D9 so we can remove CKE 4 from Drupal 10

Proposed resolution

Based on the work in #3104018: Support library auto install via composer in asset dir , we would like to request the Drupl CKEditor contrib module community collaborate and centralize composer repos under an auto-install method, rather than requiring additional root directory composer.json configurations or modules such as drupal_libraries .

We have begun a drupal-ckeditor-libraries-group packagist repo to house these packages, and would like to have other CKEditor module contrib join this collection and make composer installs as easy as possible.

Big kudos to @voleger for the original request and partnerships to get the initial work done on this.

Remaining tasks

1. Confirm whether this would be appropriate for composer installs of this module.
2. Create a module owned Github repo to house a local copy of the required ckeditor plugin.
3. Create a packagist account.
4. Contact either @voleger and @Webbeh on adding a GitHub repo to the packagist account, and setting your local Github and packagist account to the repo.
5. After the repo is in place, create a patch (a la 3104018-31.patch) to update composer.json to point to the new repo.
6. Success!

User interface changes

TBD.

Feature request
Status

Needs work

Version

1.0

Component

Code

Created by

🇺🇸United States Webbeh Georgia, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇺🇸United States Poindexterous

    I've got the patch installed, but the library still doesn't seem to be getting installed automatically by composer in the /library directory (even after running composer update or composer install). Any ideas on whether I'm missing something perhaps? I could install the library on my local environment manually, however the codebase I'm working with doesn't commit libraries or modules to the repo- it uses a composer build step on the cloud side instead. So unless I can get composer to work with installing the library I'd be unable to use the module in my project. Any ideas on what I might be missing?

  • 🇺🇸United States Poindexterous

    I did some experimenting and I think it might be an issue with the drupal-ckeditor-libraries-group/colorbutton package. I'm experimenting with other CKeditor modules and have the ckedtior_format_button module in my project, which uccessfully installed the "drupal-ckeditor-libraries-group/format_buttons" package in the library folder when I installed the module with composer.

    In the colorbutton composer.json I swapped out the colorbutton ckeditor library for the format_buttons one just to see (more to rule out whether it was an issue with the library or perhaps something else in the module), and the latter did install. So it does look like there may be an issue with composer not being able to discover and fetch the drupal-ckeditor-libraries-group/colorbutton library. When running any composer command like composer update --lock or composer require in verbose mode, I will see some output like "Downloading https://repo.packagist.org/p2/drupal-ckeditor-libraries-group/format_but... if modified" and "[304] https://repo.packagist.org/p2/drupal-ckeditor-libraries-group/format_but..." but with the drupal-ckeditor-libraries-group/colorbutton present in the colorbutton composer.json, I still don't see this package listed anywhere in the output, but I haven't seen any errors either so the fetching of the package may be failing silently somewhere.

    I'm still not sure if this is just me (I'm going to continue to do some digging), but if anyone else is experiencing this let me know.

Production build 0.71.5 2024