summaryrefslogtreecommitdiffstatshomepage
path: root/core/scripts/dev/commit-code-check.sh
diff options
context:
space:
mode:
authorLauri Eskola <lauri.eskola@acquia.com>2022-03-15 20:15:22 +0200
committerLauri Eskola <lauri.eskola@acquia.com>2022-03-15 20:15:22 +0200
commitda12af1477184a98e7e16241d71a2145adeeaa58 (patch)
treeabeb0726a480eecda48c14a3136368f2336d9583 /core/scripts/dev/commit-code-check.sh
parentdcc51c80a2ee2a26dd39732b9eef4c6c7df1ffeb (diff)
downloaddrupal-da12af1477184a98e7e16241d71a2145adeeaa58.tar.gz
drupal-da12af1477184a98e7e16241d71a2145adeeaa58.zip
Issue #3267721 by nod_, Wim Leers: Add DrupalCI step for ensuring that CKEditor 5 build files are build correctly
Diffstat (limited to 'core/scripts/dev/commit-code-check.sh')
-rwxr-xr-xcore/scripts/dev/commit-code-check.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/core/scripts/dev/commit-code-check.sh b/core/scripts/dev/commit-code-check.sh
index d09af83e5e6e..2d434fa7201e 100755
--- a/core/scripts/dev/commit-code-check.sh
+++ b/core/scripts/dev/commit-code-check.sh
@@ -128,6 +128,10 @@ ESLINT_CONFIG_PASSING_FILE_CHANGED=0
# - core/.stylelintrc.json
STYLELINT_CONFIG_FILE_CHANGED=0
+# This variable will be set when a Drupal-specific CKEditor 5 plugin has changed
+# it is used to make sure the compiled JS is valid.
+CKEDITOR5_PLUGINS_CHANGED=0
+
# Build up a list of absolute file names.
ABS_FILES=
for FILE in $FILES; do
@@ -156,6 +160,10 @@ for FILE in $FILES; do
ESLINT_CONFIG_PASSING_FILE_CHANGED=1;
STYLELINT_CONFIG_FILE_CHANGED=1;
fi;
+
+ if [[ -f "$TOP_LEVEL/$FILE" ]] && [[ $FILE =~ \.js$ ]] && [[ $FILE =~ ^core/modules/ckeditor5/js/build || $FILE =~ ^core/modules/ckeditor5/js/ckeditor5_plugins ]]; then
+ CKEDITOR5_PLUGINS_CHANGED=1;
+ fi;
done
# Exit early if there are no files.
@@ -285,6 +293,27 @@ if [[ $STYLELINT_CONFIG_FILE_CHANGED == "1" ]]; then
printf "\n"
fi
+# When a Drupal-specific CKEditor 5 plugin changed ensure that it is compiled
+# properly. Only check on DrupalCI, since we're concerned about the build being
+# run with the expected package versions and making sure the result of the build
+# is in sync and conform to expectations.
+if [[ "$DRUPALCI" == "1" ]] && [[ $CKEDITOR5_PLUGINS_CHANGED == "1" ]]; then
+ cd "$TOP_LEVEL/core"
+ yarn run -s check:ckeditor5
+ if [ "$?" -ne "0" ]; then
+ # If there are failures set the status to a number other than 0.
+ FINAL_STATUS=1
+ printf "\nDrupal-specific CKEditor 5 plugins: ${red}failed${reset}\n"
+ else
+ printf "\nDrupal-specific CKEditor 5 plugins: ${green}passed${reset}\n"
+ fi
+ cd $TOP_LEVEL
+ # Add a separator line to make the output easier to read.
+ printf "\n"
+ printf -- '-%.0s' {1..100}
+ printf "\n"
+fi
+
for FILE in $FILES; do
STATUS=0;
# Print a line to separate spellcheck output from per file output.