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.
Issue fork anchor_link-3118314
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
oliverpolden commentedThe https://www.drupal.org/docs/8/core/modules/ckeditor/managing-ckeditor-pl... link should be as it is here. (It has a double quote at the end so you get a 404).
Comment #3
WebbehComment #4
WebbehLink plugin now in composer via `drupal-ckeditor-libraries-group/link`: https://packagist.org/packages/drupal-ckeditor-libraries-group/link
Comment #7
mingsongCreate a merge request.
Comment #8
alex_optimWork for me.
Comment #9
jastraat commentedJust for reference, it does seem like webform is going to continue to use the composer merge plugin for the foreseeable future unless there's been some collaboration between modules that isn't apparent in the issue queues. https://www.drupal.org/project/webform/issues/3088336
That would mean that all the applicable ckeditor libraries would still have to be duplicated in the libraries directory since each module will expect it in a different place.
Comment #10
volegerWhy do we need to follow some workarounds done by webform?
Drupal has a dependency on the composer/installer plugin. It covers all required tasks regarding installation location.
The CKEditor plugin is currently available in Packagist's repository, so there is no need to deal with the repositories definition of the project.
CKEditor Anchor Link just declares the dependency on the CKEditor plugin, and that's all. There is no need to deal with the wikimedia merge plugin, which significantly affects the composer's runtime performance.
We don't change the location of the uploaded libraries. It stays as it is.
Comment #11
rajab natshahThanks a lot for reporting and patching and reviewing.
No recommending to use the drupal-ckeditor-libraries-group repository
Switching to the way the Webfrom module is managing this.
Which version of CKEditor Anchor Link you are using?
Using
"drupal/anchor_link": "~1.0"Link and fakeobjects are attached in the module
https://git.drupalcode.org/project/anchor_link/-/tree/8.x-1.x/js/plugins
I had them listed in the Drupal.org Library Packaging Allowlist
#2888309: CKEditor Anchor link
#2940014: CKEditor Fake Objects
In
drupal/anchor_link": "~1.0"we have the libraries in the module.In
drupal/anchor_link": "~2.0"you manage that yourself in the project.In
drupal/anchor_link": "~3.0"switching to use the Webform way of managing that and more integration with the Linkit moduleComment #12
rajab natshahComment #13
rajab natshah#3204935: Adjust composer.libraries.json to match webform standards and prevent webform issues
Comment #14
rajab natshah#3262011: Ditch the requirement of using the drupal-ckeditor-plugins repository