From 4b34895945fd827a3a5c44103bbef8d9dee73942 Mon Sep 17 00:00:00 2001 From: Alice GG Date: Fri, 16 Jun 2023 09:57:18 +0200 Subject: [PATCH] Update frontend deps --- frontend/Dockerfile | 2 +- frontend/package-lock.json | 45 +++++++++++--------------------------- frontend/package.json | 13 +++++------ frontend/preact.config.js | 15 +++++++++++++ 4 files changed, 35 insertions(+), 40 deletions(-) create mode 100644 frontend/preact.config.js diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 00e6887..2519e91 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -1,4 +1,4 @@ -FROM node:19-alpine +FROM node:20-alpine WORKDIR /app diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 0be7d33..914541a 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -9,12 +9,11 @@ "version": "0.0.0", "license": "MIT", "dependencies": { - "preact": "^10.11.3", - "preact-render-to-string": "^5.2.6", - "preact-router": "^3.2.1" + "preact": "^10.15.1", + "preact-render-to-string": "5.1.9", + "preact-router": "^4.1.1" }, "devDependencies": { - "cross-env": "^7.0.3", "enzyme": "^3.11.0", "enzyme-adapter-preact-pure": "^4.0.0", "eslint": "^8.30.0", @@ -22,7 +21,7 @@ "eslint-config-prettier": "^8.8.0", "jest": "^27.0.0", "jest-preset-preact": "^4.0.5", - "preact-cli": "^3.4.2", + "preact-cli": "^3.4.5", "prettier": "2.8.7", "sirv-cli": "^2.0.2", "unimported": "^1.26.0" @@ -6634,24 +6633,6 @@ "async-limiter": "~1.0.0" } }, - "node_modules/cross-env": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", - "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", - "dev": true, - "dependencies": { - "cross-spawn": "^7.0.1" - }, - "bin": { - "cross-env": "src/bin/cross-env.js", - "cross-env-shell": "src/bin/cross-env-shell.js" - }, - "engines": { - "node": ">=10.14", - "npm": ">=6", - "yarn": ">=1" - } - }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -16421,9 +16402,9 @@ "dev": true }, "node_modules/preact": { - "version": "10.13.1", - "resolved": "https://registry.npmjs.org/preact/-/preact-10.13.1.tgz", - "integrity": "sha512-KyoXVDU5OqTpG9LXlB3+y639JAGzl8JSBXLn1J9HTSB3gbKcuInga7bZnXLlxmK94ntTs1EFeZp0lrja2AuBYQ==", + "version": "10.15.1", + "resolved": "https://registry.npmjs.org/preact/-/preact-10.15.1.tgz", + "integrity": "sha512-qs2ansoQEwzNiV5eAcRT1p1EC/dmEzaATVDJNiB3g2sRDWdA7b7MurXdJjB2+/WQktGWZwxvDrnuRFbWuIr64g==", "funding": { "type": "opencollective", "url": "https://opencollective.com/preact" @@ -16604,9 +16585,9 @@ } }, "node_modules/preact-render-to-string": { - "version": "5.2.6", - "resolved": "https://registry.npmjs.org/preact-render-to-string/-/preact-render-to-string-5.2.6.tgz", - "integrity": "sha512-JyhErpYOvBV1hEPwIxc/fHWXPfnEGdRKxc8gFdAZ7XV4tlzyzG847XAyEZqoDnynP88akM4eaHcSOzNcLWFguw==", + "version": "5.1.9", + "resolved": "https://registry.npmjs.org/preact-render-to-string/-/preact-render-to-string-5.1.9.tgz", + "integrity": "sha512-fuuZP/nBcsYvfI5Mjs8R0wVA8jPbnAsr/UQ5Y5/p9Qg4HAz9vSVJ03iejBVw4YGV8jkUCJv0++k4zwp6qjx2Kg==", "dependencies": { "pretty-format": "^3.8.0" }, @@ -16620,9 +16601,9 @@ "integrity": "sha512-WuxUnVtlWL1OfZFQFuqvnvs6MiAGk9UNsBostyBOB0Is9wb5uRESevA6rnl/rkksXaGX3GzZhPup5d6Vp1nFew==" }, "node_modules/preact-router": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/preact-router/-/preact-router-3.2.1.tgz", - "integrity": "sha512-KEN2VN1DxUlTwzW5IFkF13YIA2OdQ2OvgJTkQREF+AA2NrHRLaGbB68EjS4IeZOa1shvQ1FvEm3bSLta4sXBhg==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/preact-router/-/preact-router-4.1.1.tgz", + "integrity": "sha512-+LGrB3b2nR7+8vzyHw8i2/TjZazs3oMJovIEgBChPBXMDSISmwj2WDynZh8KDxZRK2GuXlqHPk15mMjaYWZH4g==", "peerDependencies": { "preact": ">=10" } diff --git a/frontend/package.json b/frontend/package.json index 469df38..d91acc2 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -4,9 +4,9 @@ "version": "0.0.0", "license": "MIT", "scripts": { - "build": "cross-env NODE_OPTIONS=--openssl-legacy-provider preact build", + "build": "preact build", "serve": "sirv build --port 5000 --cors --single --host 0.0.0.0", - "dev": "cross-env NODE_OPTIONS=--openssl-legacy-provider preact watch -p 5000", + "dev": "preact watch -p 5000", "lint": "eslint src", "fix-lint": "eslint --fix src", "test": "jest", @@ -23,7 +23,6 @@ ] }, "devDependencies": { - "cross-env": "^7.0.3", "enzyme": "^3.11.0", "enzyme-adapter-preact-pure": "^4.0.0", "eslint": "^8.30.0", @@ -31,15 +30,15 @@ "eslint-config-prettier": "^8.8.0", "jest": "^27.0.0", "jest-preset-preact": "^4.0.5", - "preact-cli": "^3.4.2", + "preact-cli": "^3.4.5", "prettier": "2.8.7", "sirv-cli": "^2.0.2", "unimported": "^1.26.0" }, "dependencies": { - "preact": "^10.11.3", - "preact-render-to-string": "^5.2.6", - "preact-router": "^3.2.1" + "preact": "^10.15.1", + "preact-render-to-string": "5.1.9", + "preact-router": "^4.1.1" }, "jest": { "preset": "jest-preset-preact", diff --git a/frontend/preact.config.js b/frontend/preact.config.js new file mode 100644 index 0000000..b2203cf --- /dev/null +++ b/frontend/preact.config.js @@ -0,0 +1,15 @@ +const crypto = require("crypto"); + +/** + * md4 algorithm is not available anymore in NodeJS 17+ (because of lib SSL 3). + * In that case, silently replace md4 by md5 algorithm. + */ +try { + crypto.createHash('md4'); +} catch (e) { + console.warn('Crypto "md4" is not supported anymore by this Node version'); + const origCreateHash = crypto.createHash; + crypto.createHash = (alg, opts) => { + return origCreateHash(alg === 'md4' ? 'md5' : alg, opts); + }; +}