From a76545383f75e81058cf34861d9dcdf1869f7531 Mon Sep 17 00:00:00 2001 From: Meik Date: Mon, 10 Nov 2025 10:10:57 +0100 Subject: [PATCH] refactoring node 24 --- .nvmrc | 1 + Dockerfile | 2 +- README.md | 12 ++++++++++++ package-lock.json | 28 +++++++++------------------- package.json | 3 +++ src/setupTests.js | 25 +++++++++++++++++++++++++ 6 files changed, 51 insertions(+), 20 deletions(-) create mode 100644 .nvmrc diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..c519bf5 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v24.11.0 diff --git a/Dockerfile b/Dockerfile index 198f842..717a57a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:18-alpine AS base +FROM node:24.11.0-alpine AS base WORKDIR /app # 1) Install dependencies (cached until package files change) diff --git a/README.md b/README.md index e69de29..2335b70 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,12 @@ +## Development Requirements + +- Node.js v24.11.0 (see `.nvmrc` for quick switching with nvm) +- npm 11+ (bundled with Node 24) + +After switching to the required Node version run: + +```bash +npm ci +``` + +This installs dependencies in a clean state that matches the lock file used by the Docker build. diff --git a/package-lock.json b/package-lock.json index d630e5f..9792f28 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,6 +25,9 @@ "react-scripts": "5.0.1", "uuid": "^11.0.3", "web-vitals": "^2.1.4" + }, + "engines": { + "node": ">=24.11.0" } }, "node_modules/@adobe/css-tools": { @@ -4030,7 +4033,6 @@ "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz", "integrity": "sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==", "license": "MIT", - "peer": true, "dependencies": { "@eslint-community/regexpp": "^4.4.0", "@typescript-eslint/scope-manager": "5.62.0", @@ -16368,20 +16370,6 @@ } } }, - "node_modules/tailwindcss/node_modules/yaml": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.1.tgz", - "integrity": "sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw==", - "license": "ISC", - "optional": true, - "peer": true, - "bin": { - "yaml": "bin.mjs" - }, - "engines": { - "node": ">= 14.6" - } - }, "node_modules/tapable": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.0.tgz", @@ -16722,6 +16710,7 @@ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", "license": "(MIT OR CC0-1.0)", + "peer": true, "engines": { "node": ">=10" }, @@ -16826,9 +16815,9 @@ } }, "node_modules/typescript": { - "version": "5.9.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", - "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", "license": "Apache-2.0", "peer": true, "bin": { @@ -16836,7 +16825,7 @@ "tsserver": "bin/tsserver" }, "engines": { - "node": ">=14.17" + "node": ">=4.2.0" } }, "node_modules/unbox-primitive": { @@ -17227,6 +17216,7 @@ "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-4.15.2.tgz", "integrity": "sha512-0XavAZbNJ5sDrCbkpWL8mia0o5WPOd2YGtxrEiZkBK9FjLppIUK2TgxK6qGD2P3hUXTJNNPVibrerKcx5WkR1g==", "license": "MIT", + "peer": true, "dependencies": { "@types/bonjour": "^3.5.9", "@types/connect-history-api-fallback": "^1.3.5", diff --git a/package.json b/package.json index e5ad54c..8795cdb 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,9 @@ "uuid": "^11.0.3", "web-vitals": "^2.1.4" }, + "engines": { + "node": ">=24.11.0" + }, "scripts": { "start": "react-scripts start", "build": "react-scripts build", diff --git a/src/setupTests.js b/src/setupTests.js index 8f2609b..0819a68 100644 --- a/src/setupTests.js +++ b/src/setupTests.js @@ -3,3 +3,28 @@ // expect(element).toHaveTextContent(/react/i) // learn more: https://github.com/testing-library/jest-dom import '@testing-library/jest-dom'; +import React from 'react'; + +jest.mock('react-router-dom', () => { + const navigate = jest.fn(); + + const PassThrough = ({ children }) => <>{children}; + + const Route = ({ element = null, children = null }) => element || children || null; + + const Link = ({ children, ...props }) => ( + + {children} + + ); + + return { + BrowserRouter: PassThrough, + Routes: PassThrough, + Route, + Navigate: () => null, + Link, + useLocation: () => ({ pathname: '/' }), + useNavigate: () => navigate + }; +}, { virtual: true });