From e2746ad2d16e852578aa5da0998f44a0d2962bad Mon Sep 17 00:00:00 2001 From: Bartosz Prusinowski Date: Wed, 8 Jan 2025 14:36:45 +0100 Subject: [PATCH] chore: Update Node.js to v20 --- .dockerignore | 4 +++- .github/workflows/chromatic.yml | 2 +- .github/workflows/e2e.yml | 4 ++-- .github/workflows/lint-types.yml | 2 +- .github/workflows/preload-varnish-cache.yml | 2 +- .gitlab-ci.yml | 6 ++++-- Dockerfile | 4 ++-- app/package.json | 2 +- docker-compose.mitm.yml | 10 +++++++--- docker-compose.yml | 2 +- shell.nix | 2 +- yarn.lock | 17 ++++++++++++----- 12 files changed, 36 insertions(+), 21 deletions(-) diff --git a/.dockerignore b/.dockerignore index 9843c03ff..e90261987 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,5 @@ .git .next -*Dockerfile* \ No newline at end of file +*Dockerfile* +# Ignore node_modules to prevent issues with wrong binaries (e.g. sentry cli) +node_modules \ No newline at end of file diff --git a/.github/workflows/chromatic.yml b/.github/workflows/chromatic.yml index 45ba2f399..e2977bf71 100644 --- a/.github/workflows/chromatic.yml +++ b/.github/workflows/chromatic.yml @@ -14,7 +14,7 @@ jobs: - name: Setup node uses: actions/setup-node@v4 with: - node-version: 18.x + node-version: 20.x cache: "yarn" cache-dependency-path: "**/yarn.lock" - run: yarn install --immutable --prefer-offline diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index a57c5f520..de27280f6 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -17,7 +17,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-node@v4 with: - node-version: 18.x + node-version: 20.x cache: "yarn" cache-dependency-path: "**/yarn.lock" - name: Install dependencies @@ -54,7 +54,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-node@v4 with: - node-version: 18.x + node-version: 20.x cache: "yarn" cache-dependency-path: "**/yarn.lock" - name: Install dependencies diff --git a/.github/workflows/lint-types.yml b/.github/workflows/lint-types.yml index 61340d85c..c6b26312b 100644 --- a/.github/workflows/lint-types.yml +++ b/.github/workflows/lint-types.yml @@ -14,7 +14,7 @@ jobs: - name: Setup node uses: actions/setup-node@v4 with: - node-version: 18.x + node-version: 20.x cache: "yarn" cache-dependency-path: "**/yarn.lock" - run: yarn install --immutable --prefer-offline diff --git a/.github/workflows/preload-varnish-cache.yml b/.github/workflows/preload-varnish-cache.yml index 052588bc7..5fcba3e33 100644 --- a/.github/workflows/preload-varnish-cache.yml +++ b/.github/workflows/preload-varnish-cache.yml @@ -11,7 +11,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: 18.x + node-version: 20.x cache: "yarn" cache-dependency-path: "**/yarn.lock" - name: Install dependencies diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ed431bd7b..4cecc0026 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,7 +9,7 @@ variables: RELEASE_IMAGE_TAG: $CI_REGISTRY_IMAGE:release lint: - image: node:18 + image: node:20 stage: lint script: - yarn --frozen-lockfile @@ -33,7 +33,9 @@ release: - medium script: - pwd - - env DOCKER_IMAGE_TAGS="$RELEASE_IMAGE_TAG $CI_REGISTRY_IMAGE:$(./scripts/get-package-version.sh)" ./scripts/docker-build-push.sh + - env DOCKER_IMAGE_TAGS="$RELEASE_IMAGE_TAG + $CI_REGISTRY_IMAGE:$(./scripts/get-package-version.sh)" + ./scripts/docker-build-push.sh only: - /^v\d+\.\d+\.\d+$/ # use `yarn version` to create these tags except: diff --git a/Dockerfile b/Dockerfile index cf40fe303..faa541f06 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:18 +FROM node:20 RUN mkdir -p /usr/src/app WORKDIR /usr/src/app @@ -54,6 +54,6 @@ RUN yarn build # Install only prod dependencies and start app RUN yarn install --frozen-lockfile --production && yarn cache clean -CMD npm start +CMD yarn start EXPOSE 3000 \ No newline at end of file diff --git a/app/package.json b/app/package.json index af5f8fd4e..d56165c2e 100644 --- a/app/package.json +++ b/app/package.json @@ -163,7 +163,7 @@ "@types/jest": "^27.0.2", "@types/k6": "^0.45.0", "@types/lodash": "^4.14.165", - "@types/node": "^14.14.9", + "@types/node": "^20.17.12", "@types/nprogress": "^0.2.0", "@types/pg": "^8.6.0", "@types/pixelmatch": "^5.2.6", diff --git a/docker-compose.mitm.yml b/docker-compose.mitm.yml index 4044b0081..d85c4dad6 100644 --- a/docker-compose.mitm.yml +++ b/docker-compose.mitm.yml @@ -3,7 +3,7 @@ version: "3" services: ## Running in Docker slows down development a lot, so this is only kept for reference here. # nextjs: - # image: "node:18" + # image: "node:20" # ports: # - "3000:3000" # volumes: @@ -53,8 +53,12 @@ services: volumes: - "mitmproxy-config:/root/.mitmproxy/" user: root:root - command: ["sh", "-c", "cd && pwd && whoami && mitmweb --web-host 0.0.0.0 --no-web-open-browser"] - + command: + [ + "sh", + "-c", + "cd && pwd && whoami && mitmweb --web-host 0.0.0.0 --no-web-open-browser", + ] volumes: mitmproxy-config: diff --git a/docker-compose.yml b/docker-compose.yml index 1521a425c..c2eba873b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,7 +3,7 @@ version: "3" services: ## Running in Docker slows down development a lot, so this is only kept for reference here. # nextjs: - # image: "node:18" + # image: "node:20" # ports: # - "3000:3000" # volumes: diff --git a/shell.nix b/shell.nix index 475ff0dbf..ebf4c428c 100644 --- a/shell.nix +++ b/shell.nix @@ -1,6 +1,6 @@ let pkgs = import { }; - nodejs = pkgs.nodejs-18_x; + nodejs = pkgs.nodejs-20_x; in pkgs.mkShell { buildInputs = [ diff --git a/yarn.lock b/yarn.lock index 10f039e6c..a0e6f2e6b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9432,11 +9432,6 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-14.18.12.tgz#0d4557fd3b94497d793efd4e7d92df2f83b4ef24" integrity sha512-q4jlIR71hUpWTnGhXWcakgkZeHa3CCjcQcnuzU8M891BAWA2jHiziiWEPEkdS5pFsz7H9HJiy8BrK7tBRNrY7A== -"@types/node@^14.14.9": - version "14.17.3" - resolved "https://registry.npmjs.org/@types/node/-/node-14.17.3.tgz" - integrity sha512-e6ZowgGJmTuXa3GyaPbTGxX17tnThl2aSSizrFthQ7m9uLGZBXiGhgE55cjRZTF5kjZvYn9EOPOMljdjwbflxw== - "@types/node@^18.0.0": version "18.19.18" resolved "https://registry.yarnpkg.com/@types/node/-/node-18.19.18.tgz#7526471b28828d1fef1f7e4960fb9477e6e4369c" @@ -9444,6 +9439,13 @@ dependencies: undici-types "~5.26.4" +"@types/node@^20.17.12": + version "20.17.12" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.17.12.tgz#ee3b7d25a522fd95608c1b3f02921c97b93fcbd6" + integrity sha512-vo/wmBgMIiEA23A/knMfn/cf37VnuF52nZh5ZoW0GWt4e4sxNquibrMRJ7UQsA06+MBx9r/H1jsI9grYjQCQlw== + dependencies: + undici-types "~6.19.2" + "@types/normalize-package-data@^2.4.0": version "2.4.0" resolved "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz" @@ -24651,6 +24653,11 @@ undici-types@~5.26.4: resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== +undici-types@~6.19.2: + version "6.19.8" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.19.8.tgz#35111c9d1437ab83a7cdc0abae2f26d88eda0a02" + integrity sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw== + undici@^5.21.2: version "5.28.3" resolved "https://registry.yarnpkg.com/undici/-/undici-5.28.3.tgz#a731e0eff2c3fcfd41c1169a869062be222d1e5b"