From 280e7d9d998a10425d241766a266be19e4718710 Mon Sep 17 00:00:00 2001 From: Walter Moar Date: Tue, 17 Dec 2024 22:59:01 +0000 Subject: [PATCH 1/3] fix: FORMS-1588 update node to v20 Node v20 is now in LTS, and we will switch to it to remain current. --- .devcontainer/Dockerfile | 2 +- .devcontainer/devcontainer.json | 2 +- Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 5871b2903..333f2d9df 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,4 +1,4 @@ -ARG VARIANT="18.20.4-bookworm" +ARG VARIANT="20.18.1-bookworm" FROM node:${VARIANT} # not much in here, could acheive this another way for sure... diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 124f8664e..49030ca11 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -6,7 +6,7 @@ "dockerfile": "Dockerfile", "context": "..", "args": { - "VARIANT": "18.20.4-bookworm" + "VARIANT": "20.18.1-bookworm" } }, diff --git a/Dockerfile b/Dockerfile index bc4883790..44e2addeb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM docker.io/node:18.20.4-alpine3.20 +FROM docker.io/node:20.18.1-alpine3.21 ENV NO_UPDATE_NOTIFIER=true WORKDIR /opt/app-root/src/app From 48e777f9883bddb10f4d4badcd3d32c3c5d3b880 Mon Sep 17 00:00:00 2001 From: Walter Moar Date: Tue, 17 Dec 2024 23:32:42 +0000 Subject: [PATCH 2/3] fix: update the Node version in the Actions --- .github/workflows/unit-tests.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/unit-tests.yaml b/.github/workflows/unit-tests.yaml index 407a63a58..6285c91e8 100644 --- a/.github/workflows/unit-tests.yaml +++ b/.github/workflows/unit-tests.yaml @@ -18,7 +18,7 @@ jobs: strategy: fail-fast: true matrix: - version: [18] + version: [20] steps: - name: Checkout Repository uses: actions/checkout@v4 @@ -49,14 +49,14 @@ jobs: env: CI: true - name: Save Coverage Results - if: matrix.version == 18 + if: matrix.version == 20 uses: actions/upload-artifact@v4 with: name: coverage-app path: ${{ github.workspace }}/app/coverage retention-days: 1 - name: Monitor Coverage - if: "matrix.version == 18 && ! github.event.pull_request.head.repo.fork" + if: "matrix.version == 20 && ! github.event.pull_request.head.repo.fork" uses: slavcodev/coverage-monitor-action@v1 with: comment_mode: update @@ -78,7 +78,7 @@ jobs: strategy: fail-fast: true matrix: - version: [18] + version: [20] steps: - name: Checkout Repository uses: actions/checkout@v4 @@ -106,14 +106,14 @@ jobs: env: CI: true - name: Save Coverage Results - if: matrix.version == 18 + if: matrix.version == 20 uses: actions/upload-artifact@v4 with: name: coverage-frontend path: ${{ github.workspace }}/app/frontend/coverage retention-days: 1 - name: Monitor Coverage - if: "matrix.version == 18 && ! github.event.pull_request.head.repo.fork" + if: "matrix.version == 20 && ! github.event.pull_request.head.repo.fork" uses: slavcodev/coverage-monitor-action@v1 with: comment_mode: update From 95a21b38a1738f22dd259a5fb2fa7b319144be54 Mon Sep 17 00:00:00 2001 From: Walter Moar Date: Wed, 18 Dec 2024 00:03:18 +0000 Subject: [PATCH 3/3] test: fix node 20 complaint about setting global --- .../designer/settings/FormEventStreamSettings.spec.js | 4 ---- app/frontend/vite.config.mjs | 2 -- 2 files changed, 6 deletions(-) diff --git a/app/frontend/tests/unit/components/designer/settings/FormEventStreamSettings.spec.js b/app/frontend/tests/unit/components/designer/settings/FormEventStreamSettings.spec.js index f52009267..1993ffd76 100644 --- a/app/frontend/tests/unit/components/designer/settings/FormEventStreamSettings.spec.js +++ b/app/frontend/tests/unit/components/designer/settings/FormEventStreamSettings.spec.js @@ -8,10 +8,6 @@ import { useFormStore } from '~/store/form'; import FormEventStreamSettings from '~/components/designer/settings/FormEventStreamSettings.vue'; describe('FormEventStreamSettings.vue', () => { - const crypto = require('crypto').webcrypto; - // Shims the crypto property onto global - global.crypto = crypto; - const pinia = createTestingPinia(); setActivePinia(pinia); diff --git a/app/frontend/vite.config.mjs b/app/frontend/vite.config.mjs index baab82126..d8fa83e94 100644 --- a/app/frontend/vite.config.mjs +++ b/app/frontend/vite.config.mjs @@ -33,8 +33,6 @@ export default defineConfig(({ command, mode }) => { '~formiojs': resolve(__dirname, './node_modules/formiojs'), '~font-awesome': resolve(__dirname, './node_modules/font-awesome'), '~vuetify': resolve(__dirname, './node_modules/vuetify'), - // no clue why crypto is required, but unit tests will not run without it - crypto: 'crypto-js', }, }, test: {