Skip to content

Commit

Permalink
chore: update node to v22 (LTS) and pnpm v9
Browse files Browse the repository at this point in the history
  • Loading branch information
OliverDudgeon committed Nov 7, 2024
1 parent a3804aa commit 8a6af22
Show file tree
Hide file tree
Showing 7 changed files with 6,372 additions and 4,939 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"image": "mcr.microsoft.com/devcontainers/javascript-node:0-18",
"features": {
"ghcr.io/devcontainers-contrib/features/pnpm:2": {
"version": "8.15.4"
"version": "9.12.3"
}
},
// Features to add to the dev container. More info: https://containers.dev/features.
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ name: lint
on:
push:


jobs:
Lint:
runs-on: ubuntu-latest
Expand All @@ -28,7 +29,7 @@ jobs:
uses: actions/checkout@v4
- uses: pnpm/action-setup@v3.0.0
with:
version: 8.15.4
version: 9.12.3
run_install: false
- name: Setup Node
uses: actions/setup-node@v4
Expand All @@ -47,7 +48,7 @@ jobs:
uses: actions/checkout@v4
- uses: pnpm/action-setup@v3.0.0
with:
version: 8.15.4
version: 9.12.3
run_install: false
- name: Setup Node
uses: actions/setup-node@v4
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/nextjs_bundle_analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- master # change this if your default branch is named differently
workflow_dispatch:


defaults:
run:
# change this if your nextjs app does not live at the root of the repo
Expand All @@ -19,7 +20,7 @@ jobs:

- uses: pnpm/action-setup@v3.0.0
with:
version: 8.15.4
version: 9.12.3
run_install: false
- name: Setup Node
uses: actions/setup-node@v4
Expand Down
17 changes: 11 additions & 6 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ name: test
on:
push:


jobs:
# check that both APIs are responding normally before running tests
check-api:
Expand All @@ -48,7 +49,7 @@ jobs:
uses: actions/checkout@v4
- uses: pnpm/action-setup@v3.0.0
with:
version: 8.15.4
version: 9.12.3
run_install: false
- name: Setup Node
uses: actions/setup-node@v4
Expand All @@ -66,7 +67,8 @@ jobs:
path: |
${{ github.workspace }}/.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-${{
hashFiles('**.[jt]s', '**.[jt]sx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-
Expand Down Expand Up @@ -98,7 +100,8 @@ jobs:
DONT_USE_STANDALONE_OUTPUT: true
DANGEROUS__DISABLE_SSL_CERT_CHECK_IN_API_PROXY: 1
DATA_MANAGER_API_SERVER: "https://data-manager-test.xchem-dev.diamond.ac.uk/data-manager-api"
ACCOUNT_SERVER_API_SERVER: "https://account-server-test.xchem-dev.diamond.ac.uk/account-server-api"
ACCOUNT_SERVER_API_SERVER: "https://account-server-test.xchem-dev.diamond.ac.uk\
/account-server-api"
KEYCLOAK_URL: "https://keycloak-test.xchem-dev.diamond.ac.uk/auth/realms/squonk"
PW_USERNAME: "dmit-user-a"
PW_PASSWORD: "${{ secrets.DMIT_USER_A_PASSWORD }}"
Expand All @@ -120,7 +123,7 @@ jobs:
uses: actions/checkout@v4
- uses: pnpm/action-setup@v3.0.0
with:
version: 8.15.4
version: 9.12.3
run_install: false
- name: Setup Node
uses: actions/setup-node@v4
Expand All @@ -138,7 +141,8 @@ jobs:
path: |
${{ github.workspace }}/.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-${{
hashFiles('**.[jt]s', '**.[jt]sx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-
Expand Down Expand Up @@ -167,7 +171,8 @@ jobs:
DANGEROUS__DISABLE_SSL_CERT_CHECK_IN_API_PROXY: 1
BASE_PATH: ""
DATA_MANAGER_API_SERVER: "https://data-manager-test.xchem-dev.diamond.ac.uk/data-manager-api"
ACCOUNT_SERVER_API_SERVER: "https://account-server-test.xchem-dev.diamond.ac.uk/account-server-api"
ACCOUNT_SERVER_API_SERVER: "https://account-server-test.xchem-dev.diamond.ac.uk\
/account-server-api"
KEYCLOAK_URL: "https://keycloak-test.xchem-dev.diamond.ac.uk/auth/realms/squonk"
PW_USERNAME: "dmit-user-a"
PW_PASSWORD: "${{ secrets.DMIT_USER_A_PASSWORD }}"
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Install dependencies only when needed
FROM node:20.11.1-alpine3.18 AS base
FROM node:22.11.0-a1pine3.20 AS base

FROM base AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
Expand All @@ -12,7 +12,7 @@ ARG SKIP_CHECKS
ENV SKIP_CHECKS=${SKIP_CHECKS:-0}
RUN echo "SKIP_CHECKS=${SKIP_CHECKS}"

RUN npm i -g pnpm@8.15.4
RUN npm i -g pnpm@9.12.3
RUN if $SKIP_CHECKS; then pnpm fetch --prod; else pnpm fetch; fi
RUN if $SKIP_CHECKS; \
then pnpm i -P --frozen-lockfile --offline --ignore-scripts; \
Expand Down Expand Up @@ -40,7 +40,7 @@ ENV GIT_SHA=${GIT_SHA:-""}
ARG BASE_PATH
ENV BASE_PATH=${BASE_PATH}

# RUN npm i -g pnpm@8.15.4
# RUN npm i -g pnpm@9.12.3
RUN echo "GIT_SHA=${GIT_SHA}" && npm run build

# If using npm comment out above and use below instead
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"@tanstack/react-query-devtools": "5.59.20",
"@tanstack/react-table": "8.20.5",
"@types/lodash-es": "4.17.12",
"@types/node": "20.11.26",
"@types/node": "22.9.0",
"@types/plotly.js-basic-dist": "1.54.4",
"@types/prismjs": "1.26.5",
"@types/react": "18.3.12",
Expand Down
Loading

0 comments on commit 8a6af22

Please sign in to comment.