Skip to content

Commit

Permalink
upgrade to node 20
Browse files Browse the repository at this point in the history
  • Loading branch information
kahlstrm authored and joonatanaatos committed May 19, 2024
1 parent d6c6a5d commit 793e8fb
Show file tree
Hide file tree
Showing 9 changed files with 1,750 additions and 1,647 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/npm-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ jobs:
packages: write
contents: read
steps:

- name: Check out the repo
uses: actions/checkout@v4

Expand All @@ -19,9 +18,9 @@ jobs:
- name: Setup Node.js for NPM
uses: actions/setup-node@v4
with:
registry-url: 'https://registry.npmjs.org'
node-version-file: '.nvmrc'
cache: 'pnpm'
registry-url: "https://registry.npmjs.org"
node-version-file: ".nvmrc"
cache: "pnpm"

- name: Install dependencies
run: pnpm install --frozen-lockfile
Expand All @@ -41,7 +40,7 @@ jobs:
- name: Setup Node.js for GitHub Packages
uses: actions/setup-node@v4
with:
registry-url: 'https://npm.pkg.github.com'
registry-url: "https://npm.pkg.github.com"

- name: Publish to GitHub Packages
run: |
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18
20
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Build stage:
FROM node:18-alpine as builder

FROM node:20-alpine as builder
RUN apk add --no-cache brotli

# Build-time env variables
Expand Down Expand Up @@ -33,7 +32,7 @@ RUN find packages/ilmomasiina-frontend/build -type f\
-regex ".*\.\(js\|json\|html\|map\|css\|svg\|ico\|txt\)" -exec gzip -k "{}" \; -exec brotli "{}" \;

# Main stage:
FROM node:18-alpine
FROM node:20-alpine

# Accept VERSION at build time, pass to backend server
ARG VERSION
Expand Down
26 changes: 13 additions & 13 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Node modules will be installed at the build phase and included in the container image.
# Sources and other files are intended to be provided using bind mounts.

FROM node:18-alpine
FROM node:20-alpine

WORKDIR /opt/ilmomasiina

Expand All @@ -13,27 +13,27 @@ COPY .eslint* package.json pnpm-*.yaml ./

# Copy static resources from each package
COPY packages/ilmomasiina-frontend/package.json \
packages/ilmomasiina-frontend/tsconfig.json \
packages/ilmomasiina-frontend/.eslint* \
packages/ilmomasiina-frontend/
packages/ilmomasiina-frontend/tsconfig.json \
packages/ilmomasiina-frontend/.eslint* \
packages/ilmomasiina-frontend/

COPY packages/ilmomasiina-components/package.json \
packages/ilmomasiina-components/tsconfig.json \
packages/ilmomasiina-components/.eslint* \
packages/ilmomasiina-components/
packages/ilmomasiina-components/tsconfig.json \
packages/ilmomasiina-components/.eslint* \
packages/ilmomasiina-components/

COPY packages/ilmomasiina-backend/package.json \
packages/ilmomasiina-backend/tsconfig.json \
packages/ilmomasiina-backend/.eslint* \
packages/ilmomasiina-backend/
packages/ilmomasiina-backend/tsconfig.json \
packages/ilmomasiina-backend/.eslint* \
packages/ilmomasiina-backend/

COPY packages/ilmomasiina-models/package.json \
packages/ilmomasiina-models/tsconfig.json \
packages/ilmomasiina-models/
packages/ilmomasiina-models/tsconfig.json \
packages/ilmomasiina-models/

ENV NODE_ENV=development

ENV HOST=0.0.0.0

# Install dependencies (we're running as root, so the postinstall script doesn't run automatically)
RUN npm install -g pnpm@8 && pnpm install --frozen-lockfile
RUN corepack enable && pnpm install --frozen-lockfile
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
"private": true,
"license": "MIT",
"engines": {
"node": "^18",
"npm": "^7"
"node": "^20"
},
"packageManager": "[email protected]",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/ilmomasiina-backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
"@types/http-errors": "^2.0.4",
"@types/k6": "^0.51.0",
"@types/lodash": "^4.14.202",
"@types/node": "^18",
"@types/node": "^20.12.11",
"@types/node-cron": "^3.0.11",
"@types/nodemailer": "^6.4.14",
"@types/nodemailer-mailgun-transport": "^1.4.6",
Expand Down
6 changes: 3 additions & 3 deletions packages/ilmomasiina-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
},
"dependencies": {
"@tietokilta/ilmomasiina-models": "workspace:2.0.0-alpha13",
"@types/lodash-es": "^4.17.12",
"@types/react": "^17.0.75",
"bootstrap": "^4.6.2",
"final-form": "^4.20.10",
"i18next": "^23.10.0",
Expand All @@ -46,6 +44,8 @@
},
"devDependencies": {
"rimraf": "^5.0.5",
"typescript": "~5.2.2"
"typescript": "~5.2.2",
"@types/lodash-es": "^4.17.12",
"@types/react": "^17.0.75"
}
}
28 changes: 14 additions & 14 deletions packages/ilmomasiina-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,6 @@
"@sentry/browser": "^6.19.7",
"@tietokilta/ilmomasiina-components": "workspace:2.0.0-alpha13",
"@tietokilta/ilmomasiina-models": "workspace:2.0.0-alpha13",
"@types/history": "^4.7.11",
"@types/lodash-es": "^4.17.12",
"@types/node": "^18",
"@types/node-sass": "^4.11.7",
"@types/react": "^17.0.75",
"@types/react-datepicker": "^4.19.6",
"@types/react-dom": "^17.0.25",
"@types/react-redux": "^7.1.33",
"@types/react-router-dom": "^5.3.3",
"@vitejs/plugin-react": "^4.2.1",
"bootstrap": "^4.6.2",
"connected-react-router": "^6.9.3",
"csv-stringify": "^6.4.5",
Expand Down Expand Up @@ -57,14 +47,24 @@
"redux-persist": "^6.0.0",
"redux-thunk": "^2.4.2",
"reselect": "^4.1.8",
"sass": "^1.71.1",
"sass": "^1.71.1"
},
"devDependencies": {
"ts-node": "^10.9.2",
"typescript": "~5.2.2",
"vite": "^5.1.4",
"vite-plugin-checker": "^0.6.4",
"vite-tsconfig-paths": "^4.3.1"
},
"devDependencies": {
"vite-tsconfig-paths": "^4.3.1",
"@types/history": "^4.7.11",
"@types/lodash-es": "^4.17.12",
"@types/node": "^20.12.11",
"@types/node-sass": "^4.11.7",
"@types/react": "^17.0.75",
"@types/react-datepicker": "^4.19.6",
"@types/react-dom": "^17.0.25",
"@types/react-redux": "^7.1.33",
"@types/react-router-dom": "^5.3.3",
"@vitejs/plugin-react": "^4.2.1",
"rimraf": "^5.0.5"
}
}
Loading

0 comments on commit 793e8fb

Please sign in to comment.