Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade node to v18 #617

Merged
merged 5 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:

env:
HOWDJU_RUNNING_IN_GITHUB_WORKFLOW:
YARN_VERSION: 3.3.1
YARN_VERSION: 4.0.1

jobs:
premerge-checks:
Expand All @@ -32,7 +32,7 @@ jobs:
- name: Setup Node.JS
uses: actions/setup-node@v3
with:
node-version: 16.18.0
node-version: 18.18.2
cache: "yarn"
- name: Install Yarn
run: |
Expand Down Expand Up @@ -128,7 +128,7 @@ jobs:
- name: Setup Node.JS
uses: actions/setup-node@v3
with:
node-version: 14
node-version: 18.18.2
cache: "yarn"
- name: Install Yarn
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/flaky-tests-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Setup Node.JS
uses: actions/setup-node@v3
with:
node-version: 16.18.0
node-version: 18.18.2
cache: "yarn"
- name: Install Yarn
run: |
Expand Down
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.18.0
18.18.2
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.18.0
18.18.2
77 changes: 0 additions & 77 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

This file was deleted.

28 changes: 0 additions & 28 deletions .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

This file was deleted.

823 changes: 0 additions & 823 deletions .yarn/releases/yarn-3.3.1.cjs

This file was deleted.

893 changes: 893 additions & 0 deletions .yarn/releases/yarn-4.0.1.cjs

Large diffs are not rendered by default.

12 changes: 5 additions & 7 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
nodeLinker: node-modules
compressionLevel: mixed

enableGlobalCache: false

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: "@yarnpkg/plugin-workspace-tools"
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-3.3.1.cjs
yarnPath: .yarn/releases/yarn-4.0.1.cjs
2 changes: 1 addition & 1 deletion bin/check-flaky-test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# Usage:
# check-flaky-test.sh <total_runs> [<jest_args>]
Expand Down
2 changes: 1 addition & 1 deletion bin/check-pushed.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -e

Expand Down
2 changes: 1 addition & 1 deletion bin/check-test-db-dump-updated.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# gfind on macOS: `brew install findutils`
latest_migration_modification=$(gfind premiser-api/db/migrations -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f1 -d" ")
Expand Down
2 changes: 1 addition & 1 deletion bin/check-todo-format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if [[ $? -ne 0 ]]; then
exit 1
fi

echo "${output}" | grep '^+' | egrep '\bTODO\b' | egrep -v '\bTODO\(\#?[0-9]+(,#?[0-9]+)*\)'
echo "${output}" | grep '^+.*\bTODO\b' | egrep -v '\bTODO\(\#?[0-9]+(,#?[0-9]+)*\)'

# grep returns 0 if it found matches. It is an error if we found matches.
if [ $? -eq 0 ] ; then
Expand Down
2 changes: 2 additions & 0 deletions bin/delete-squash-merged-branches.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env bash

# https://stackoverflow.com/a/56026209
# https://github.com/not-an-aardvark/git-delete-squashed
git checkout -q master &&\
Expand Down
2 changes: 2 additions & 0 deletions bin/show-recent-branches.sh
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
#!/usr/bin/env bash

git for-each-ref --sort=-committerdate refs/heads/ | head
2 changes: 2 additions & 0 deletions bin/tree-js.sh
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
#!/usr/bin/env bash

tree -P '*.js' -I '**node_modules**' -I '**dist**' -I '**build**' -I '**coverage**' --prune | less
10 changes: 6 additions & 4 deletions docs/Development.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,17 @@ On macOS using `nodenv`, this could be:
```shell
brew install nodenv
nodenv init
nodenv install 16.18.0
nodenv install 18.18.2
# Activates this node version just for this shell via an env. var
nodenv shell 16.18.0
npm install -g yarn
nodenv shell 18.18.2
# Enable yarn
corepack enable
yarn set version 4.0.1
```

The correct node version should automatically activate due to the `.node-version`/`.nvmrc` files.

Note: `16.18.0` is the officially supported Node.js version, and we recommend that everyone use a
Note: `18.18.2` is the officially supported Node.js version, and we recommend that everyone use a
consistent version to avoid any issues with dependencies.

### Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion howdju-mobile-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Howdju React Native mobile app.
Start the bundler:

```shell
yarn run start
yarn run start
```

In another terminal, build and run the mobile app:
Expand Down
4 changes: 2 additions & 2 deletions howdju-mobile-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"debugger": "react-devtools",
"fix-format": "yarn run lint --fix && yarn run prettier --write .",
"install-pods": "npx pod-install",
"ios": "react-native run-ios",
"ios": "react-native run-ios --simulator='iPhone 14'",
"ios-release": "react-native run-ios --configuration Release",
"ios-release-device": "react-native run-ios --configuration Release --device ${0}",
"lint": "eslint --ignore-path=.gitignore .",
Expand Down Expand Up @@ -53,7 +53,7 @@
"@types/react-native-vector-icons": "^6.4.13",
"@types/react-test-renderer": "^17.0.1",
"babel-jest": "^29.0.3",
"babel-loader": "^8.2.5",
"babel-loader": "^9.1.3",
"eslint": "^8.27.0",
"eslint-plugin-jest": "^27.1.5",
"eslint-plugin-prettier": "^4.2.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
--

-- Dumped from database version 12.5 (Debian 12.5-1.pgdg100+1)
-- Dumped by pg_dump version 14.5 (Homebrew)
-- Dumped by pg_dump version 14.9 (Homebrew)

SET statement_timeout = 0;
SET lock_timeout = 0;
Expand Down
2 changes: 2 additions & 0 deletions howdju-text-fragments/bin/check-scripts-are-updated.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env bash

esbuild src/rangeToFragment.ts --bundle --outfile=dist/tmp/rangeToFragment.js --platform=browser --target=es2016
cmp --silent dist/rangeToFragment.js dist/tmp/rangeToFragment.js || {
echo "rangeToFragment.js is not up to date. Please run \`yarn run build:range-to-fragment-script\` and commit the changes."
Expand Down
2 changes: 1 addition & 1 deletion infra/modules/elasticstack/elasticstack_user_data.tpl.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

ensure_data_volume() {
if ! mountpoint -q ${data_mount_path}; then
Expand Down
2 changes: 2 additions & 0 deletions lambdas/bin/release.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env bash

set -e

script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"prettier": "2.7.1",
"typescript": "^4.9.4"
},
"packageManager": "yarn@3.3.1",
"packageManager": "yarn@4.0.1",
"resolutions": {
"react-native@^0.66": "patch:react-native@npm%3A0.66.5#./.yarn/patches/react-native-npm-0.66.5-22e5dd8ec5.patch",
"react-material-symbols@^4.1.1": "patch:react-material-symbols@npm%3A4.1.1#./.yarn/patches/react-material-symbols-npm-4.1.1-d06ca7bff7.patch",
Expand Down
2 changes: 2 additions & 0 deletions premiser-api/bin/db-tunnel.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env bash

trap "exit" INT TERM
trap "kill 0" EXIT

Expand Down
2 changes: 2 additions & 0 deletions premiser-api/db/export.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env bash

# everything:
pg_dump -h 127.0.0.1 -p 5433 premiser -U premiser_rds > premiser_prod_dump-$(date -u "+%Y-%m-%dT%H:%M:%SZ").sql

Expand Down
4 changes: 3 additions & 1 deletion premiser-api/db/import.sh
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
psql -h 127.0.0.1 -p 5433 -d howdju_pre_prod -U premiser_admin -f howdju.sql -v ON_ERROR_STOP=1
#!/usr/bin/env bash

psql -h 127.0.0.1 -p 5433 -d howdju_pre_prod -U premiser_admin -f howdju.sql -v ON_ERROR_STOP=1
2 changes: 1 addition & 1 deletion premiser-ext/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@babel/preset-react": "^7.13.13",
"@babel/runtime": "^7.13.10",
"@types/core-js": "^2.5.5",
"babel-loader": "^8.2.2",
"babel-loader": "^9.1.3",
"babel-plugin-module-resolver": "^4.1.0",
"babel-plugin-react-require": "^3.1.3",
"babel-plugin-transform-class-properties": "^6.24.1",
Expand Down
2 changes: 2 additions & 0 deletions premiser-processing/aws/scheduleJustificationVotes.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env bash

aws events put-rule \
--name scoreJustifications_scheduledRule_prod_2 \
--schedule-expression 'rate(5 minutes)' \
Expand Down
2 changes: 1 addition & 1 deletion premiser-ui/bin/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -e

Expand Down
4 changes: 2 additions & 2 deletions premiser-ui/config/webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,11 @@ const baseWebpackConfig = {
},
{
test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
use: "url-loader?limit=10000&mimetype=application/font-woff",
type: "asset/inline",
},
{
test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
use: "file-loader",
type: "asset/resource",
},
{
test: /\.md$/,
Expand Down
26 changes: 13 additions & 13 deletions premiser-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@
"typecheck": "tsc"
},
"devDependencies": {
"@babel/cli": "^7.16.0",
"@babel/core": "^7.20.2",
"@babel/plugin-transform-parameters": "^7.14.5",
"@babel/plugin-transform-runtime": "^7.22.9",
"@babel/preset-env": "^7.20.2",
"@babel/preset-react": "^7.13.13",
"@babel/preset-typescript": "^7.18.6",
"@babel/cli": "^7.23.0",
"@babel/core": "^7.23.2",
"@babel/plugin-transform-parameters": "^7.22.15",
"@babel/plugin-transform-runtime": "^7.23.2",
"@babel/preset-env": "^7.23.2",
"@babel/preset-react": "^7.22.15",
"@babel/preset-typescript": "^7.23.2",
"@statoscope/webpack-plugin": "^5.26.2",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^12",
Expand All @@ -69,8 +69,8 @@
"@typescript-eslint/parser": "^5.48.2",
"argparse": "^2.0.1",
"aws-sdk": "^2.890.0",
"babel-jest": "^29.3.1",
"babel-loader": "^8.2.2",
"babel-jest": "^29.7.0",
"babel-loader": "^9.1.3",
"copy-webpack-plugin": "^11.0.0",
"cross-env": "^7.0.3",
"css-loader": "^5.2.0",
Expand All @@ -80,7 +80,6 @@
"esbuild": "^0.15.10",
"eslint": "^8.27.0",
"eslint-config-howdju": "workspace:eslint-config-howdju",
"file-loader": "^6.2.0",
"howdju-ops": "workspace:howdju-ops",
"howdju-test-common": "workspace:howdju-test-common",
"html-loader": "^2.1.2",
Expand All @@ -96,14 +95,13 @@
"node-sass": "^8.0.0",
"prettier": "2.7.1",
"react-hot-loader": "^4.13.0",
"resolve-url-loader": "^3.1.2",
"resolve-url-loader": "^5.0.0",
"sass-loader": "^11.0.1",
"style-loader": "^2.0.0",
"terser-webpack-plugin": "^5.3.9",
"ts-node": "^10.9.1",
"typescript": "^4.9.4",
"uglify-js": "^3.0.18",
"url-loader": "^4.1.1",
"warnings-to-errors-webpack-plugin": "^2.3.0",
"webpack": "^5.76.0",
"webpack-bundle-analyzer": "^4.8.0",
Expand Down Expand Up @@ -141,6 +139,8 @@
"@sentry/browser": "^7.64.0",
"@sentry/tracing": "^7.64.0",
"axios": "^1.2.1",
"babel-plugin-module-resolver": "^5.0.0",
"babel-plugin-react-require": "^4.0.2",
"classnames": "^2.3.1",
"connected-react-router": "^6.9.1",
"deepmerge": "^4.3.1",
Expand All @@ -164,7 +164,7 @@
"react-dom": "^16.2.0",
"react-flip-move": "^3.0.1",
"react-helmet": "^6.1.0",
"react-material-symbols": "^4.1.1",
"react-material-symbols": "^4.2.2",
"react-redux": "^7.2.4",
"react-router": "^5.2.0",
"react-router-dom": "^5.2.0",
Expand Down
Loading