Skip to content

Commit 1110248

Browse files
authored
chore: upgrade node to 20.16.0 (#5688)
* nooOoOoOOoOoode * ci * nvm * env is back baby, cache * cache name, restore keys * remove restore keys * package lock * conditional node setup * unnecessary assertion * update rule * lock
1 parent fe7a67d commit 1110248

14 files changed

Lines changed: 12712 additions & 5760 deletions

File tree

.github/workflows/monkey-ci.yml

Lines changed: 20 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Monkey CI
22

33
env:
4-
NODE_VERSION: "18.20.4"
4+
NODE_VERSION: "20.16.0"
55
RECAPTCHA_SITE_KEY: "6Lc-V8McAAAAAJ7s6LGNe7MBZnRiwbsbiWts87aj"
66

77
permissions:
@@ -68,6 +68,7 @@ jobs:
6868
needs: [pre-ci]
6969
if: needs.pre-ci.outputs.should-build-be == 'true' || needs.pre-ci.outputs.should-build-fe == 'true' || needs.pre-ci.outputs.should-build-pkg == 'true' || needs.pre-ci.outputs.assets-json == 'true'
7070
steps:
71+
7172
- name: Checkout package-lock
7273
uses: actions/checkout@v4
7374
with:
@@ -78,19 +79,21 @@ jobs:
7879
id: cache-npm
7980
uses: actions/cache@v4
8081
env:
81-
cache-name: cache-node-modules
82+
cache-name: node-modules
8283
with:
8384
path: ~/.npm
84-
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }}
85-
restore-keys: |
86-
${{ runner.os }}-build-${{ env.cache-name }}-
87-
${{ runner.os }}-build-
88-
${{ runner.os }}-
85+
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-build-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }}
8986

9087
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
9188
name: Full checkout
9289
uses: actions/checkout@v4
9390

91+
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
92+
name: Set up Node.js
93+
uses: actions/setup-node@v4
94+
with:
95+
node-version: ${{ env.NODE_VERSION }}
96+
9497
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
9598
name: Install dependencies
9699
run: npm install --prefer-offline --no-audit
@@ -111,14 +114,10 @@ jobs:
111114
id: cache-npm
112115
uses: actions/cache@v4
113116
env:
114-
cache-name: cache-node-modules
117+
cache-name: node-modules
115118
with:
116119
path: ~/.npm
117-
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }}
118-
restore-keys: |
119-
${{ runner.os }}-build-${{ env.cache-name }}-
120-
${{ runner.os }}-build-
121-
${{ runner.os }}-
120+
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-build-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }}
122121

123122
- name: Install dependencies
124123
run: npm install --prefer-offline --no-audit
@@ -159,14 +158,10 @@ jobs:
159158
id: cache-npm
160159
uses: actions/cache@v4
161160
env:
162-
cache-name: cache-node-modules
161+
cache-name: node-modules
163162
with:
164163
path: ~/.npm
165-
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }}
166-
restore-keys: |
167-
${{ runner.os }}-build-${{ env.cache-name }}-
168-
${{ runner.os }}-build-
169-
${{ runner.os }}-
164+
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-build-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }}
170165

171166
- name: Install dependencies
172167
run: npm install --prefer-offline --no-audit
@@ -200,14 +195,10 @@ jobs:
200195
id: cache-npm
201196
uses: actions/cache@v4
202197
env:
203-
cache-name: cache-node-modules
198+
cache-name: node-modules
204199
with:
205200
path: ~/.npm
206-
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }}
207-
restore-keys: |
208-
${{ runner.os }}-build-${{ env.cache-name }}-
209-
${{ runner.os }}-build-
210-
${{ runner.os }}-
201+
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-build-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }}
211202

212203
- name: Install dependencies
213204
run: npm install --prefer-offline --no-audit
@@ -251,14 +242,10 @@ jobs:
251242
id: cache-npm
252243
uses: actions/cache@v4
253244
env:
254-
cache-name: cache-node-modules
245+
cache-name: node-modules
255246
with:
256247
path: ~/.npm
257-
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }}
258-
restore-keys: |
259-
${{ runner.os }}-build-${{ env.cache-name }}-
260-
${{ runner.os }}-build-
261-
${{ runner.os }}-
248+
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-build-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }}
262249

263250
- name: Install dependencies
264251
run: npm install --prefer-offline --no-audit
@@ -294,14 +281,10 @@ jobs:
294281
id: cache-npm
295282
uses: actions/cache@v4
296283
env:
297-
cache-name: cache-node-modules
284+
cache-name: node-modules
298285
with:
299286
path: ~/.npm
300-
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }}
301-
restore-keys: |
302-
${{ runner.os }}-build-${{ env.cache-name }}-
303-
${{ runner.os }}-build-
304-
${{ runner.os }}-
287+
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-build-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }}
305288

306289
- name: Install dependencies
307290
run: npm install --prefer-offline --no-audit

.github/workflows/pretty-fix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Set up Node.js
2424
uses: actions/setup-node@v4
2525
with:
26-
node-version: "18.20.4"
26+
node-version: "20.16.0"
2727

2828
- name: Install dependencies
2929
run: npm i prettier@2.5.1 --save-dev --save-exact

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
18.20.4
1+
20.16.0

backend/docker/compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ services:
2121

2222
api-server:
2323
container_name: monkeytype-api-server
24-
image: node:18.20.4
24+
image: node:20.16.0
2525
user: "node" ##this works as long as your local user has uid=1000
2626
restart: on-failure
2727
depends_on:

backend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"gen-docs": "tsx scripts/openapi.ts dist/static/api/openapi.json && redocly build-docs -o dist/static/api/internal.html internal@v2 && redocly bundle -o dist/static/api/public.json public-filter && redocly build-docs -o dist/static/api/public.html public@v2"
2020
},
2121
"engines": {
22-
"node": "18.20.4"
22+
"node": "20.16.0"
2323
},
2424
"dependencies": {
2525
"@date-fns/utc": "1.2.0",

backend/src/api/ts-rest-adapter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export function callController<
2828
status: 200 as TStatus,
2929
body: {
3030
message: result.message,
31-
data: result.data as TResponse,
31+
data: result.data,
3232
},
3333
};
3434

docker/backend/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
FROM node:18.20.4-alpine3.19
2+
FROM node:20.16.0-alpine3.19
33

44
##install wget, used by the applyConfig script
55
RUN apk add wget

docker/frontend/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:18.20.4-alpine3.19 AS builder
1+
FROM node:20.16.0-alpine3.19 AS builder
22
WORKDIR /app
33

44
#ENV

docs/CONTRIBUTING_ADVANCED.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
## Prerequisites
2323

24-
This contribution guide is for cases in which you need to test the functionality of your changes, or if you need to take screenshots of your changes. You will need a computer with a stable internet connection, a text editor, Git, and NodeJS with version 18.20.4. There are some additional requirements depending on what you're looking to contribute, such as Firebase for authentication, and Mongo and Docker for the backend. Read the below sections to understand how to set up each of these tools.
24+
This contribution guide is for cases in which you need to test the functionality of your changes, or if you need to take screenshots of your changes. You will need a computer with a stable internet connection, a text editor, Git, and NodeJS with version 20.16.0. There are some additional requirements depending on what you're looking to contribute, such as Firebase for authentication, and Mongo and Docker for the backend. Read the below sections to understand how to set up each of these tools.
2525

2626
### Git
2727

@@ -33,9 +33,9 @@ Git is optional but we recommend you utilize it. Monkeytype uses the Git source
3333

3434
### NodeJS and NPM
3535

36-
Currently, the project is using version `18.20.4 LTS`.
36+
Currently, the project is using version `20.16.0 LTS`.
3737

38-
If you use `nvm` (if you use Windows, use [nvm-windows](https://github.com/coreybutler/nvm-windows)) then you can run `nvm install` and `nvm use` (you might need to specify the exact version eg: `nvm install 18.20.4` then `nvm use 18.20.4`) to use the version of Node.js in the `.nvmrc` file.
38+
If you use `nvm` (if you use Windows, use [nvm-windows](https://github.com/coreybutler/nvm-windows)) then you can run `nvm install` and `nvm use` (you might need to specify the exact version eg: `nvm install 20.16.0` then `nvm use 20.16.0`) to use the version of Node.js in the `.nvmrc` file.
3939

4040
Alternatively, you can navigate to the NodeJS [website](https://nodejs.org/en/) to download it from there.
4141

frontend/docker/compose.dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: monkeytype
22
services:
33
frontend:
44
container_name: monkeytype-frontend
5-
image: node:18.20.4
5+
image: node:20.16.0
66
user: "node" ##this works as long as your local user has uid=1000
77
# restart: on-failure
88
environment:

0 commit comments

Comments
 (0)