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
This commit is contained in:
Jack 2024-07-30 18:44:35 +02:00 committed by GitHub
parent fe7a67d0fb
commit 1110248f7b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 7043 additions and 91 deletions

View file

@ -1,7 +1,7 @@
name: Monkey CI
env:
NODE_VERSION: "18.20.4"
NODE_VERSION: "20.16.0"
RECAPTCHA_SITE_KEY: "6Lc-V8McAAAAAJ7s6LGNe7MBZnRiwbsbiWts87aj"
permissions:
@ -68,6 +68,7 @@ jobs:
needs: [pre-ci]
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'
steps:
- name: Checkout package-lock
uses: actions/checkout@v4
with:
@ -78,19 +79,21 @@ jobs:
id: cache-npm
uses: actions/cache@v4
env:
cache-name: cache-node-modules
cache-name: node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-build-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }}
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
name: Full checkout
uses: actions/checkout@v4
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
name: Install dependencies
run: npm install --prefer-offline --no-audit
@ -111,14 +114,10 @@ jobs:
id: cache-npm
uses: actions/cache@v4
env:
cache-name: cache-node-modules
cache-name: node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-build-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
run: npm install --prefer-offline --no-audit
@ -159,14 +158,10 @@ jobs:
id: cache-npm
uses: actions/cache@v4
env:
cache-name: cache-node-modules
cache-name: node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-build-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
run: npm install --prefer-offline --no-audit
@ -200,14 +195,10 @@ jobs:
id: cache-npm
uses: actions/cache@v4
env:
cache-name: cache-node-modules
cache-name: node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-build-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
run: npm install --prefer-offline --no-audit
@ -251,14 +242,10 @@ jobs:
id: cache-npm
uses: actions/cache@v4
env:
cache-name: cache-node-modules
cache-name: node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-build-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
run: npm install --prefer-offline --no-audit
@ -294,14 +281,10 @@ jobs:
id: cache-npm
uses: actions/cache@v4
env:
cache-name: cache-node-modules
cache-name: node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-build-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
run: npm install --prefer-offline --no-audit

View file

@ -23,7 +23,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "18.20.4"
node-version: "20.16.0"
- name: Install dependencies
run: npm i prettier@2.5.1 --save-dev --save-exact

2
.nvmrc
View file

@ -1 +1 @@
18.20.4
20.16.0

View file

@ -21,7 +21,7 @@ services:
api-server:
container_name: monkeytype-api-server
image: node:18.20.4
image: node:20.16.0
user: "node" ##this works as long as your local user has uid=1000
restart: on-failure
depends_on:

View file

@ -19,7 +19,7 @@
"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"
},
"engines": {
"node": "18.20.4"
"node": "20.16.0"
},
"dependencies": {
"@date-fns/utc": "1.2.0",

View file

@ -28,7 +28,7 @@ export function callController<
status: 200 as TStatus,
body: {
message: result.message,
data: result.data as TResponse,
data: result.data,
},
};

View file

@ -1,5 +1,5 @@
FROM node:18.20.4-alpine3.19
FROM node:20.16.0-alpine3.19
##install wget, used by the applyConfig script
RUN apk add wget

View file

@ -1,4 +1,4 @@
FROM node:18.20.4-alpine3.19 AS builder
FROM node:20.16.0-alpine3.19 AS builder
WORKDIR /app
#ENV

View file

@ -21,7 +21,7 @@
## Prerequisites
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.
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.
### Git
@ -33,9 +33,9 @@ Git is optional but we recommend you utilize it. Monkeytype uses the Git source
### NodeJS and NPM
Currently, the project is using version `18.20.4 LTS`.
Currently, the project is using version `20.16.0 LTS`.
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.
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.
Alternatively, you can navigate to the NodeJS [website](https://nodejs.org/en/) to download it from there.

View file

@ -2,7 +2,7 @@ name: monkeytype
services:
frontend:
container_name: monkeytype-frontend
image: node:18.20.4
image: node:20.16.0
user: "node" ##this works as long as your local user has uid=1000
# restart: on-failure
environment:

View file

@ -23,7 +23,7 @@
"docker": "docker compose -f docker/compose.dev.yml up"
},
"engines": {
"node": "18.20.4"
"node": "20.16.0"
},
"browserslist": [
"defaults"

7044
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -47,7 +47,7 @@
"pr-check-other-json": "cd frontend && npx gulp pr-check-other-json"
},
"engines": {
"node": "18.20.4"
"node": "20.16.0"
},
"devDependencies": {
"@commitlint/cli": "17.7.1",

View file

@ -77,12 +77,7 @@ module.exports = {
"@typescript-eslint/no-unsafe-member-access": "off", //~105
//
"@typescript-eslint/no-unnecessary-type-assertion": [
"error",
{
typesToIgnore: ["HTMLElement", "Element"],
},
],
"@typescript-eslint/no-unnecessary-type-assertion": "error",
"@typescript-eslint/no-confusing-void-expression": [
"error",
{ ignoreArrowShorthand: true },