drupal-ckeditor-libraries-group composer installation support

Created on 6 March 2020, almost 5 years ago
Updated 21 September 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

RTBC

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

Merge Requests

Comments & Activities

Not all content is available!

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

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia praveenpb Bangalore

    Just created a patch from the MR.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia praveenpb Bangalore
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States Webbeh Georgia, USA

    Why did you create two patches from the MR?

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia praveenpb Bangalore

    @Webbeh, I thought to update the patch file name so uploaded a second one but I already removed the first one from display.

  • ๐Ÿ‡ง๐Ÿ‡ฌBulgaria pfrenssen Sofia

    @praveenpb FYI it's not needed to manually create patches from the MR, you can directly link to the auto-generated patch: https://git.drupalcode.org/project/fakeobjects/-/merge_requests/1.diff - see the "plain diff" link in the MR section above.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia praveenpb Bangalore

    @pfrenssen, The problem of using auto-generated patch is that it changes whenever someone pushed something to the MR, and it will be applied to our project when we run composer install/update without our knowledge. If someone pushes a buggy code it is not safe to use it, but if you create a patch manually, it will not change that patch.

  • ๐Ÿ‡ง๐Ÿ‡ฌBulgaria pfrenssen Sofia

    @praveenpb fair enough, but you can just commit it locally in your project if you want to pin a specific version of a MR, or use the branch from the issue fork directly and pin the commit in composer.json.

  • First commit to issue fork.
  • ๐Ÿ‡จ๐Ÿ‡ฆCanada xmacinfo Canada

    I was not able to try this to check if the package was downloaded to the library folder instead of the vendor folder before doing the commit. I faced a catch-22. Information on proper testing that type of composer.json changes would be appreciated.

    However, this change looks a straightforward change so I did the commit.

  • ๐Ÿ‡จ๐Ÿ‡ฆCanada xmacinfo Canada

    Tested the dev branch successfully.

    composer require 'drupal/fakeobjects:1.x-dev@dev'
    ./composer.json has been updated
    Running composer update drupal/fakeobjects
    > DrupalProject\composer\ScriptHandler::checkComposerVersion
    Loading composer repositories with package information
    Updating dependencies
    Lock file operations: 2 installs, 0 updates, 0 removals
      - Locking drupal-ckeditor-libraries-group/fakeobjects (4.22.1)
      - Locking drupal/fakeobjects (dev-1.x 31878af)
    Writing lock file
    Installing dependencies from lock file (including require-dev)
    Package operations: 2 installs, 0 updates, 0 removals
      - Syncing drupal/fakeobjects (dev-1.x 31878af) into cache
      - Installing drupal-ckeditor-libraries-group/fakeobjects (4.22.1): Extracting archive
      - Installing drupal/fakeobjects (dev-1.x 31878af): Cloning 31878af419 from cache
    $ libraries ls
    fakeobjects

    After enabling the module, the Status Reports displays:

    FakeObjects Plugin detected

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

Production build 0.71.5 2024