From f12fb351b0b4226d40ccc3d23b82b41187dcd2da Mon Sep 17 00:00:00 2001
From: Volker Schukai <volker.schukai@schukai.com>
Date: Wed, 19 Jun 2024 12:50:52 +0200
Subject: [PATCH] fix: switch nodejs_22 to nodejs_20

---
 nix/config/common-packages.nix             | 2 +-
 nix/scripts/build-and-publish.nix          | 2 +-
 nix/scripts/build-stylesheets.nix          | 2 +-
 nix/scripts/create-new-component-class.nix | 2 +-
 nix/scripts/release.nix                    | 2 +-
 nix/scripts/run-ci-web-tests.nix           | 2 +-
 nix/scripts/run-web-tests.nix              | 2 +-
 nix/scripts/start-server.nix               | 2 +-
 nix/scripts/update-web-test.nix            | 4 ++--
 9 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/nix/config/common-packages.nix b/nix/config/common-packages.nix
index 5c85bedb8..bf07ee34e 100644
--- a/nix/config/common-packages.nix
+++ b/nix/config/common-packages.nix
@@ -25,7 +25,7 @@ with pkgs'; [
   libffi
   logrotate
   meld
-  nodejs_22
+  nodejs_20
   open-sans
   plantuml
   ranger
diff --git a/nix/scripts/build-and-publish.nix b/nix/scripts/build-and-publish.nix
index 23f61671a..e16391987 100644
--- a/nix/scripts/build-and-publish.nix
+++ b/nix/scripts/build-and-publish.nix
@@ -16,7 +16,7 @@ in
     archive=$(ls ${monster} | grep tgz)
  
     ## npm instead of pnpm because of https://github.com/pnpm/pnpm/issues/7950
-    if ! publishingResult=$(${pkgs'.nodejs_22}/bin/npm publish "${monster}/$archive" --json --dry-run --no-git-checks --access public)
+    if ! publishingResult=$(${pkgs'.nodejs_20}/bin/npm publish "${monster}/$archive" --json --dry-run --no-git-checks --access public)
     then
       echo_fail "Failed to publish the project."
       exit 1
diff --git a/nix/scripts/build-stylesheets.nix b/nix/scripts/build-stylesheets.nix
index 74ccd42c0..6b69d264c 100644
--- a/nix/scripts/build-stylesheets.nix
+++ b/nix/scripts/build-stylesheets.nix
@@ -13,7 +13,7 @@ in
         source ${pkgs'.common}/bin/common
         local prefix="''${sourcePath}/"
         echo_step "build stylesheet ''${1#$prefix}"
-        ${pkgs'.nodejs_22}/bin/node ./development/scripts/buildStylesheets.mjs "$1"
+        ${pkgs'.nodejs_20}/bin/node ./development/scripts/buildStylesheets.mjs "$1"
     }
 
     export -f build
diff --git a/nix/scripts/create-new-component-class.nix b/nix/scripts/create-new-component-class.nix
index 92393f417..7b2da894e 100644
--- a/nix/scripts/create-new-component-class.nix
+++ b/nix/scripts/create-new-component-class.nix
@@ -6,7 +6,7 @@
     echo_hint "The command is executed in the current working directory and not in a nix derivation."
     cd_working_dir
 
-    if ! ${pkgs'.nodejs_22}/bin/node development/scripts/createNewComponentClass.mjs "$@"
+    if ! ${pkgs'.nodejs_20}/bin/node development/scripts/createNewComponentClass.mjs "$@"
     then
       echo_fail "script createNewClass.mjs failed, check your JS!"
       exit 1
diff --git a/nix/scripts/release.nix b/nix/scripts/release.nix
index dd1b8c4e4..c5fe369b4 100644
--- a/nix/scripts/release.nix
+++ b/nix/scripts/release.nix
@@ -58,7 +58,7 @@ in
     export MNEMONIC=$(echo $NAME | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]//g')
     ${pkgs'.envsubst}/bin/envsubst < ./nix/config/release.nix.template > ./nix/config/release.nix
     
-    if ! ${pkgs'.nodejs_22}/bin/npm version "$gitVersion" --no-git-tag-version; then
+    if ! ${pkgs'.nodejs_20}/bin/npm version "$gitVersion" --no-git-tag-version; then
         echo_fail "Error: Could not write project version."
         exit 1
     fi
diff --git a/nix/scripts/run-ci-web-tests.nix b/nix/scripts/run-ci-web-tests.nix
index f5f9c36c4..0f801080d 100644
--- a/nix/scripts/run-ci-web-tests.nix
+++ b/nix/scripts/run-ci-web-tests.nix
@@ -22,7 +22,7 @@
        exit 1
     fi
 
-    if ! ${pkgs'.nodejs_22}/bin/node "''${TEST_CASES_PATH}/puppeteer.mjs" --browser ${pkgs'.chromium}/bin/chromium --path "''${TEST_CASES_PATH}/test.html"
+    if ! ${pkgs'.nodejs_20}/bin/node "''${TEST_CASES_PATH}/puppeteer.mjs" --browser ${pkgs'.chromium}/bin/chromium --path "''${TEST_CASES_PATH}/test.html"
     then
        echo "Tests failed, check your JS!"
        exit 1
diff --git a/nix/scripts/run-web-tests.nix b/nix/scripts/run-web-tests.nix
index ebfb770c9..028ef6b13 100644
--- a/nix/scripts/run-web-tests.nix
+++ b/nix/scripts/run-web-tests.nix
@@ -8,7 +8,7 @@ in
     echo_hint "The command is executed in the current working directory and not in a nix derivation."
     cd_working_dir
 
-    if ! ${pkgs'.nodejs_22}/bin/node "$(pwd)/test/web/puppeteer.mjs" --browser ${pkgs'.ungoogled-chromium}/bin/chromium --path "$(pwd)/test/web/test.html"
+    if ! ${pkgs'.nodejs_20}/bin/node "$(pwd)/test/web/puppeteer.mjs" --browser ${pkgs'.ungoogled-chromium}/bin/chromium --path "$(pwd)/test/web/test.html"
     then
        echo_fail "Tests failed, check your JS!"
        exit 1
diff --git a/nix/scripts/start-server.nix b/nix/scripts/start-server.nix
index 31a749266..4b0d6968b 100644
--- a/nix/scripts/start-server.nix
+++ b/nix/scripts/start-server.nix
@@ -29,7 +29,7 @@ in
     export COMMIT=${releaseInfo.commit}
     
     export PNPX_BIN=${pkgs'.nodePackages.pnpm}/bin/pnpx
-    export NODE_BIN=${pkgs'.nodejs_22}/bin/node
+    export NODE_BIN=${pkgs'.nodejs_20}/bin/node
 
     cd development
 
diff --git a/nix/scripts/update-web-test.nix b/nix/scripts/update-web-test.nix
index f44394556..477ad41b3 100644
--- a/nix/scripts/update-web-test.nix
+++ b/nix/scripts/update-web-test.nix
@@ -40,7 +40,7 @@ in
       exit 1
     fi
 
-    url="$(${pkgs'.nodejs_22}/bin/npx create-polyfill-service-url analyse --cwd="''${TMPDIR}" --file=monster.js)"
+    url="$(${pkgs'.nodejs_20}/bin/npx create-polyfill-service-url analyse --cwd="''${TMPDIR}" --file=monster.js)"
     ${pkgs'.coreutils}/bin/rm  ''${TMPDIR}/monster.js
     ${pkgs'.coreutils}/bin/rm -rf ''${TMPDIR}/js*
     ${pkgs'.coreutils}/bin/rmdir ''${TMPDIR}
@@ -57,7 +57,7 @@ in
     ${pkgs'.gnused}/bin/sed -i "1 i import \"./prepare.js\";" ''${TEST_WEB_PATH}/import.js
     ${pkgs'.gnused}/bin/sed -i "1 i /** this file was created automatically by the run-web-tests script */" ''${TEST_WEB_PATH}/import.js
 
-    if ! ${pkgs'.nodejs_22}/bin/npx esbuild --platform=browser --sourcemap=inline --external:ws \
+    if ! ${pkgs'.nodejs_20}/bin/npx esbuild --platform=browser --sourcemap=inline --external:ws \
              --external:jsdom --external:fs --external:process --external:crypto --bundle ''${TEST_WEB_PATH}/import.js --outfile=''${TEST_WEB_PATH}/tests.js
     then
       echo "ERROR: esbuild failed, check your JS!"
-- 
GitLab