Problem/Motivation

Currently the 2 custom CK5 plugins are hosted on Github.
This is nice for development but confusing when the minified file gets updated in the module without any explanation or clear connection to source code changes.
Also, the environment for working on these projects is unclear. Currently it's necessary to have a directory structure where the plugins are adjacent to a ckeditor5 repo checked out to a specific version, and with the dll:build command already run to generate the json manifest file and the other js files. Then, the minified js file must be manually copied into the module.

Proposed resolution

Move the source code for

into this module, add a webpack config & package.json file to build the minified files that currently live in js/build

Remaining tasks

Decide on directory structure for source and built js
adapt the proof of concept https://github.com/bbenjamin/cke5-multi-plugin-env

User interface changes

API changes

Data model changes

Issue fork ckeditor5-3215005

Command icon 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

zrpnr created an issue. See original summary.

zrpnr’s picture

Status: Active » Needs review

Got a start on this from @bnjmnm 's https://github.com/bbenjamin/cke5-multi-plugin-env
which in turn is based on @Reinmar 's example plugin environment https://github.com/Reinmar/ckeditor5-plugin-env

This moves the 2 github repos into a new folder in the module, and uses a script to generate a manifest file from a specific tag of ckeditor5.
Then, the webpack script runs for each plugin and outputs the contents into the js/build directory.

wim leers’s picture

Related issues: +#3209613: Add "Table" plugin

I expect that somewhere in here we explicitly list all of the CKEditor 5 plugins that we are compiling into our build. For example, in #3209613: Add "Table" plugin we are adding the table plugin. How would that be reflected here?

(For CKEditor 4 we had core/assets/vendor/ckeditor/build-config.js to track this.)

wim leers’s picture

Assigned: Unassigned » lauriii

@lauriii Can you respond to @zrpnr's question at https://www.drupal.org/project/ckeditor5/issues/3215005#mr34-note26285? 🙏

wim leers’s picture

Assigned: lauriii » Unassigned

@lauriii posted that information.

Lauri and Peter are gonna pair on figuring out why it's working in one environment but not the other 👍

zrpnr’s picture

I upgraded my version of node to match @lauriii

v15.12.0
and already had the same version of yarn, 1.22.10

From a fresh copy of this branch, no node_modules folder, I cd'd into ckeditor5/js/drupal and ran:

  1. yarn install
  2. yarn build
lauriii’s picture

I was able to get this to work by reinstalling xcode. 🎉 I'm wondering if this would fix it for @Wim Leers too.

wim leers’s picture

I was able to get this to work by reinstalling xcode. 🎉 I'm wondering if this would fix it for @Wim Leers too.

That's absolutely bizarre! 🤪

Just tried that too. Still won't work.

But then I spotted in #7 that the first step according to @zrpnr is yarn install. I did not do that before: I always assume that if dependencies are missing that I will get a helpful error message.

So I did that, and it seemed to not do anything:

$ yarn install
yarn install v1.17.3
[1/4] 🔍  Resolving packages...
success Already up-to-date.
✨  Done in 0.39s.

… so surely yarn build will still do the same, right?

WRONG! 😬

$ yarn build
yarn run v1.17.3
$ yarn manifest && webpack
$ node scripts/manifest.js
CKEditor manifest not available. Generating one now. This takes a while, but should only need to happen once.
info No lockfile found.
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
[4/5] Linking dependencies...
[5/5] Building fresh packages...
success Saved lockfile.

<SNIP>

✨  Done in 202.31s.

Can we document this super duper explicitly? (Or better yet: make manifest.js do some sanity checks?)

In any case: 🥳🥳🥳

zrpnr’s picture

Added docs,

wim leers’s picture

Status: Needs review » Reviewed & tested by the community

I think we should merge this ASAP since this represents a huge leap forward. It makes it 💯 times easier to connect all dots!

I just left two remaining questions that I'd like to see answered, but they're docs-only aspects.

  • zrpnr committed f8b78b4 on 1.0.x
    Issue #3215005 by zrpnr, Wim Leers, lauriii: Move custom CKEditor 5...
zrpnr’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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

wim leers’s picture

We forgot one small but important thing that's only becoming obvious now that we're moving it into Drupal core: #3231400: Follow-up for #3215005: update library definitions to not point to @zrpnr's GitHub repos anymore 🙈