Skip to content

Commit 5cb1356

Browse files
committed
Issue #3109556 by finnsky, nod_, longwave, effulgentsia, Ambient.Impact: Update from Yarn 1 to Yarn 4
1 parent 2f16ed9 commit 5cb1356

File tree

7 files changed

+8644
-6027
lines changed

7 files changed

+8644
-6027
lines changed

.cspell.json

+2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
"MAINTAINERS.txt",
3838
"package.json",
3939
"yarn.lock",
40+
".yarnrc.yml",
41+
".yarn/*",
4042
"misc/cspell/dictionary.txt",
4143
"phpstan*"
4244
],

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
node_modules
44
yarn-error.log
55

6+
# Ignore yarn files
7+
# @see https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
8+
.yarn/*
9+
610
# Ignore overrides of core's phpcs.xml.dist and phpunit.xml.dist.
711
phpcs.xml
812
phpunit.xml

.yarnrc.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodeLinker: node-modules

misc/cspell/drupal-dictionary.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
bartik
2+
corepack
23
dblog
34
dependee
45
dependee's

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"license": "GPL-2.0",
55
"private": true,
66
"engines": {
7-
"yarn": ">= 1.6",
7+
"yarn": ">= 4.1.1",
88
"node": ">= 18.0"
99
},
1010
"scripts": {
@@ -21,9 +21,9 @@
2121
"test:nightwatch": "node -r dotenv-safe/config ./node_modules/.bin/nightwatch --config ./tests/Drupal/Nightwatch/nightwatch.conf.js",
2222
"prettier": "prettier --write \"./**/*.js\"",
2323
"spellcheck": "cspell -c .cspell.json --cache",
24-
"spellcheck:make-dict": "rm -f misc/cspell/dictionary.txt && touch misc/cspell/dictionary.txt && yarn -s spellcheck:core --unique --words-only | perl -Mopen=locale -pe '$_=lc$_' | LC_ALL=en_US.UTF-8 tr -d \\\\\\\\ | LC_ALL=C sort -u -o misc/cspell/dictionary.txt",
24+
"spellcheck:make-dict": "rm -f misc/cspell/dictionary.txt && touch misc/cspell/dictionary.txt && yarn spellcheck:core --unique --words-only | perl -Mopen=locale -pe '$_=lc$_' | LC_ALL=en_US.UTF-8 tr -d \\\\\\\\ | LC_ALL=C sort -u -o misc/cspell/dictionary.txt",
2525
"spellcheck:core": "cspell -c .cspell.json --root .. --cache --cache-location core/.cspellcache \"core/**/*\" \"composer/**/*\" \"composer.json\" \".gitlab-ci/*\" \".gitlab-ci.yml\"",
26-
"spellcheck:make-drupal-dict": "rm -f misc/cspell/drupal-dictionary.txt && touch misc/cspell/drupal-dictionary.txt && yarn -s spellcheck:core --unique --words-only | perl -Mopen=locale -pe '$_=lc$_' | LC_ALL=en_US.UTF-8 tr -d \\\\\\\\ | LC_ALL=C sort -u -o misc/cspell/drupal-dictionary.txt",
26+
"spellcheck:make-drupal-dict": "rm -f misc/cspell/drupal-dictionary.txt && touch misc/cspell/drupal-dictionary.txt && yarn spellcheck:core --unique --words-only | perl -Mopen=locale -pe '$_=lc$_' | LC_ALL=en_US.UTF-8 tr -d \\\\\\\\ | LC_ALL=C sort -u -o misc/cspell/drupal-dictionary.txt",
2727
"vendor-update": "node ./scripts/js/vendor-update.js",
2828
"watch:ckeditor5": "webpack --config ./modules/ckeditor5/webpack.config.js --watch",
2929
"build:ckeditor5": "webpack --config ./modules/ckeditor5/webpack.config.js",
@@ -118,5 +118,5 @@
118118
"last 1 Samsung version",
119119
"Firefox ESR"
120120
],
121-
"packageManager": "yarn@1.22.22"
121+
"packageManager": "yarn@4.1.1"
122122
}

scripts/dev/commit-code-check.sh

+7-14
Original file line numberDiff line numberDiff line change
@@ -205,25 +205,18 @@ fi
205205
cd "$TOP_LEVEL/core"
206206

207207
# Ensure JavaScript development dependencies are installed.
208-
yarn check -s 2>/dev/null
209-
if [ "$?" -ne "0" ]; then
210-
printf "Drupal's JavaScript development dependencies are not installed or cannot be resolved. Run 'yarn install' inside the core directory, or 'yarn check -s' to list other errors.\n"
211-
DEPENDENCIES_NEED_INSTALLING=1;
212-
fi
213-
214-
if [ $DEPENDENCIES_NEED_INSTALLING -ne 0 ]; then
215-
exit 1;
216-
fi
208+
yarn --version
209+
yarn >/dev/null
217210

218211
# Check all files for spelling in one go for better performance.
219212
if [[ $CSPELL_DICTIONARY_FILE_CHANGED == "1" ]] ; then
220213
printf "\nRunning spellcheck on *all* files.\n"
221-
yarn run -s spellcheck:core --no-must-find-files --no-progress
214+
yarn run spellcheck:core --no-must-find-files --no-progress
222215
else
223216
# Check all files for spelling in one go for better performance. We pipe the
224217
# list files in so we obey the globs set on the spellcheck:core command in
225218
# core/package.json.
226-
echo "${ABS_FILES}" | tr ' ' '\n' | yarn run -s spellcheck:core --no-must-find-files --file-list stdin
219+
echo "${ABS_FILES}" | tr ' ' '\n' | yarn run spellcheck:core --no-must-find-files --root --file-list $TOP_LEVEL $ABS_FILES >/dev/null stdin
227220
fi
228221

229222
if [ "$?" -ne "0" ]; then
@@ -285,7 +278,7 @@ fi
285278
# When the eslint config has been changed, then eslint must check all files.
286279
if [[ $ESLINT_CONFIG_PASSING_FILE_CHANGED == "1" ]]; then
287280
cd "$TOP_LEVEL/core"
288-
yarn run -s lint:core-js-passing "$TOP_LEVEL/core"
281+
yarn run lint:core-js-passing "$TOP_LEVEL/core"
289282
CORRECTJS=$?
290283
if [ "$CORRECTJS" -ne "0" ]; then
291284
# If there are failures set the status to a number other than 0.
@@ -304,7 +297,7 @@ fi
304297
# When the stylelint config has been changed, then stylelint must check all files.
305298
if [[ $STYLELINT_CONFIG_FILE_CHANGED == "1" ]]; then
306299
cd "$TOP_LEVEL/core"
307-
yarn run -s lint:css
300+
yarn run lint:css
308301
if [ "$?" -ne "0" ]; then
309302
# If there are failures set the status to a number other than 0.
310303
FINAL_STATUS=1
@@ -325,7 +318,7 @@ fi
325318
# is in sync and conform to expectations.
326319
if [[ "$DRUPALCI" == "1" ]] && [[ $CKEDITOR5_PLUGINS_CHANGED == "1" ]]; then
327320
cd "$TOP_LEVEL/core"
328-
yarn run -s check:ckeditor5
321+
yarn run check:ckeditor5
329322
if [ "$?" -ne "0" ]; then
330323
# If there are failures set the status to a number other than 0.
331324
FINAL_STATUS=1

0 commit comments

Comments
 (0)