#!/bin/sh # Clone Claro contrib theme into core/themes/claro pushd core/modules git clone --branch 1.0.x https://git.drupalcode.org/project/ckeditor5.git pushd ckeditor5 curl https://www.drupal.org/files/issues/2021-11-08/3227826-63-CKE5.patch | git apply -3v # Remove the contrib module's git history. rm -rf .git # Move the js/build, js/drupal and js/scripts directories into core/assets/vendor/ckeditor5. mkdir ../../assets/vendor/ckeditor5 mv js/build ../../assets/vendor/ckeditor5/ mv js/ckeditor5_plugins ../../assets/vendor/ckeditor5/ mv scripts ../../assets/vendor/ckeditor5/ # Remove unwanted files. rm drupalci.yml rm .eslintignore rm .gitignore rm package.json rm yarn.lock rm README.md rm -r ckeditor5_plugin_starter_template rm -rf modules rm tests/src/Kernel/StarterTemplateTest.php # Remove drush commands files. rm drush.services.yml rm -rf src/Commands mv webpack.config.js ../../ # Change file type of all JS files to .es6.js. pushd js for file in $(find . -name '*.js' -maxdepth 1) do mv $file $(echo "$file" | sed 's|.js|.es6.js|g') done popd # Change file type of all Nightwatch JS files to .es6.js. pushd tests/src/Nightwatch/Tests for file in $(find . -name '*.js' -maxdepth 1) do mv $file $(echo "$file" | sed 's|.js|.es6.js|g') done popd # Return to the Drupal root directory. cd `dirs -l -0` # Make the presence of this new core module known to Composer. git apply << EOF diff --git a/core/composer.json b/core/composer.json index 17365aabdb..96628a2a32 100644 --- a/core/composer.json +++ b/core/composer.json @@ -64,6 +64,7 @@ "drupal/book": "self.version", "drupal/breakpoint": "self.version", "drupal/ckeditor": "self.version", + "drupal/ckeditor5": "self.version", "drupal/claro": "self.version", "drupal/classy": "self.version", "drupal/color": "self.version", EOF curl https://www.drupal.org/files/issues/2021-11-05/3227826-54-core.patch | git apply -3v # Update composer.lock — see https://www.drupal.org/about/core/policies/core-dependencies-policies/managing-composer-updates-for-drupal-core COMPOSER_ROOT_VERSION=9.3.x-dev composer update drupal/core # Run yarn prettier. pushd core yarn install yarn lint:core-js-passing --fix yarn prettier yarn build:js yarn ckeditor5:build # Return to the Drupal root directory. cd `dirs -l -0` # Create patch. git add core/assets/vendor/ckeditor5 git add core/modules/ckeditor5 git add core/composer.json git add composer.lock git add core/package.json git add core/yarn.lock git add core/.eslintignore git add core/webpack.config.js git diff --staged -C -C > ckeditor5-CID.patch # Clean up. git reset --hard HEAD