From 367f3ddc45c423a402b48743dd6b97f4ce1b0d12 Mon Sep 17 00:00:00 2001 From: Meis Date: Fri, 20 Dec 2024 14:35:27 -0700 Subject: [PATCH] Upgrade to Node 22 (2nd attempt) (#1097) Closes #1040 ## Changes - Updated Dockerfile to use new `ghcr.io/cfpb/regtech/sbl/node-js-alpine:3.20` (node 22) base image. - Updated `package.json -> engines` to use Node v22 - Updated `.nvmrc` to use `v22` ## How to test this PR 1. Pull branch 2. `nvm use` 3. `yarn start` to easily launch all backend services 4. `yarn docker-build-and-run` to run the container version of the Frontend 5. Update your `.env` file to run tests against the container version ``` SBL_PLAYWRIGHT_TEST_TARGET="http://localhost:8085" ``` 6. `yarn playwright test --workers 4` 7. Verify all tests pass --- .nvmrc | 2 +- Dockerfile | 5 ++++- README.md | 2 +- package.json | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.nvmrc b/.nvmrc index 3f430af82..53d1c14db 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v18 +v22 diff --git a/Dockerfile b/Dockerfile index 0d62abef2..3d625a90f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,13 @@ -FROM ghcr.io/cfpb/regtech/sbl/nodejs-alpine:3.20 as build-stage +FROM ghcr.io/cfpb/regtech/sbl/node-js-alpine:3.20 as build-stage WORKDIR /usr/src/app ARG DOCKER_TAG="latest" # build import-meta-env for alpine for later env var injection RUN npm i -D @import-meta-env/cli RUN npm i -D @import-meta-env/unplugin + +# TODO: Find a way to update the target node version for import-meta-env +# https://github.com/cfpb/sbl-frontend/issues/1061 RUN npx pkg ./node_modules/@import-meta-env/cli/bin/import-meta-env.js \ -t node18-alpine-x64 \ -o import-meta-env-alpine diff --git a/README.md b/README.md index 15ded682b..0ba800d65 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ The frontend of the Small Business Lending Data Filing Platform. ## Getting started (Updated 12/13/2023) -1. Install Node v18.2+: `nvm install 18 && nvm use 18` +1. Install Node v22+: `nvm install 22 && nvm use 22` 1. Enable [corepack](https://yarnpkg.com/getting-started/install): `corepack enable`. 1. [Docker](https://docs.docker.com/get-docker/) engine version 1.13.0+ with docker compose version 3.0+ support needs to be installed to run all the containerized support services. 1. Have the six repos [sbl-frontend](https://github.com/cfpb/sbl-frontend), [sbl-project](https://github.com/cfpb/sbl-project), [regtech-user-fi-management](https://github.com/cfpb/regtech-user-fi-management), [sbl-filing-api](https://github.com/cfpb/sbl-filing-api/), [regtech-mail-api](https://github.com/cfpb/regtech-mail-api), and [regtech-cleanup-api](https://github.com/cfpb/regtech-cleanup-api) as **sibling directories**. diff --git a/package.json b/package.json index 77731e6c3..bc01e1863 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "private": true, "version": "0.0.0", "engines": { - "node": ">=18.20.4 <19.0.0", + "node": ">=22", "yarn": ">=3.6.1" }, "scripts": {