Skip to content

Commit

Permalink
chore: upgrade to Node.js 22 (CircuitVerse#5367)
Browse files Browse the repository at this point in the history
  • Loading branch information
gitsofaryan authored Feb 3, 2025
1 parent 8590b54 commit cff2c44
Show file tree
Hide file tree
Showing 15 changed files with 51 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ FROM ruby:3.2.1-slim
RUN apt-get update -qq && apt-get install -y build-essential ca-certificates curl gnupg imagemagick shared-mime-info cmake cmake-data netcat libvips libpq-dev pkg-config git \
&& mkdir -p /etc/apt/keyrings \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_22.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
&& apt-get update && apt-get install -y nodejs && apt-get autoremove && apt-get clean && apt-get autoremove && rm -rf /var/lib/apt/lists/* \
&& npm install -g yarn
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
node-version: '22'

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
19 changes: 13 additions & 6 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
node-version: '22'
cache: 'yarn' # Added caching for faster builds

- name: Copy sample database configuration
Expand All @@ -50,6 +50,11 @@ jobs:
gnupg \
build-essential
- name: Install Dependencies for canvas
run: |
sudo apt-get update
sudo apt-get install -y libcairo2-dev libjpeg-dev libpango1.0-dev libgif-dev build-essential g++
# Install the cosign tool except on PR
# https://github.com/sigstore/cosign-installer
- name: Install cosign
Expand All @@ -76,8 +81,6 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4
Expand All @@ -87,8 +90,12 @@ jobs:
- name: LowerCase repository name
run: echo IMAGE_REPOSITORY=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV

# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Update yarn.lock if outdated
run: yarn install

- name: Install dependencies with frozen lockfile
run: yarn install --frozen-lockfile --network-timeout 1000000 && yarn cache clean

- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v3
Expand All @@ -100,4 +107,4 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64, linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
cache-to: type=gha,mode=max
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
node-version: '22'

- name: jsdocs-dep
run: npm install
run: npm install --legacy-peer-deps

- name: jsdocs-generate
run: node ./node_modules/jsdoc/jsdoc.js ./simulator/src -r -c ./conf.json -t ./node_modules/better-docs -d ./out
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/jest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,14 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
node-version: '22'
cache: 'yarn'

- name: Install Dependencies for canvas
run: |
sudo apt-get update
sudo apt-get install -y libcairo2-dev libjpeg-dev libpango1.0-dev libgif-dev build-essential g++
- name: Install Dependencies
run: yarn

Expand Down
20 changes: 12 additions & 8 deletions .github/workflows/percy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,18 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
node-version: "22"
cache: "yarn"

- name: Install Dependencies for canvas
run: |
sudo apt-get update
sudo apt-get install -y libcairo2-dev libjpeg-dev libpango1.0-dev libgif-dev build-essential g++
- name: Install Percy CLI
run: npm install --save-dev @percy/cli
run: |
npm install @percy/cli --legacy-peer-deps
npm install --save-dev @percy/cli
- name: Install Gems
run: bundle install
Expand All @@ -59,11 +66,8 @@ jobs:
run: |
bin/rails db:schema:load
bin/rails data:migrate
- name: Configure keys
run: |
openssl genrsa -out config/private.pem 2048
openssl rsa -in config/private.pem -outform PEM -pubout -out config/public.pem
- name: Configure keys
- name: Configure RSA keys
run: |
openssl genrsa -out config/private.pem 2048
openssl rsa -in config/private.pem -outform PEM -pubout -out config/public.pem
Expand All @@ -74,4 +78,4 @@ jobs:
- name: Run tests with Percy
env:
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
run: npx percy exec -- bundle exec rspec
run: npx percy exec -- bundle exec rspec
4 changes: 2 additions & 2 deletions .github/workflows/rubyonrails.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
node-version: '22'
cache: 'yarn'

- name: Install Dependencies for canvas
Expand All @@ -53,7 +53,7 @@ jobs:
with:
reviewdog_version: latest

- run: yarn install --frozen-lockfile --immutable
- run: yarn install

- name: Copy the sample ENV Config
run: cp .env.example .env
Expand Down
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
nodejs 18.18.2
nodejs 22.13.0
ruby 3.3.0
yarn 1.22.19
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ RUN apt-get update -qq && \
# Setup nodejs and yarn
RUN mkdir -p /etc/apt/keyrings \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_22.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
&& apt-get update && apt-get install -y nodejs && apt-get autoremove && apt-get clean && apt-get autoremove && rm -rf /var/lib/apt/lists/* \
&& npm install -g yarn

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.production
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ ARG REDIS_URL="redis://localhost:6379"


RUN apt-get update -qq && apt upgrade -y && apt-get install -y --no-install-recommends --auto-remove curl \
&& curl -fsSL https://deb.nodesource.com/setup_16.x | bash - \
&& curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
&& apt-get update -qq && apt-get install -y --no-install-recommends --auto-remove nodejs imagemagick libpq5 libcurl4 libjemalloc2 \
&& apt-get clean \
&& rm -rf /var/cache/apt/archives/* \
Expand Down
4 changes: 2 additions & 2 deletions installation_docs/manual/linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ cd CircuitVerse
```bash
sudo apt install imagemagick
```
- [Node.js 16.x](https://nodejs.org/it/download)
- [Node.js 22.x](https://nodejs.org/it/download)
```bash
curl -sL https://deb.nodesource.com/setup_16.x | sudo bash
curl -sL https://deb.nodesource.com/setup_22.x | sudo bash
sudo apt-get update && sudo apt-get install -y nodejs
```
- [Yarn](https://yarnpkg.com/getting-started/install)
Expand Down
2 changes: 1 addition & 1 deletion installation_docs/manual/mac.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ cd CircuitVerse
```
- [Redis 7.0 [atleast]](https://redis.io/docs/getting-started/installation/install-redis-on-linux/)
- [ImageMagick](https://imagemagick.org/) - Image manipulation library
- [Node.js 16.x](https://nodejs.org/it/download)
- [Node.js 22.x](https://nodejs.org/it/download)
- [Yarn](https://yarnpkg.com/getting-started/install)
- [CMAKE](https://cmake.org/install/)
- OpenSSL
Expand Down
6 changes: 3 additions & 3 deletions installation_docs/manual/windows-wsl.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ cd CircuitVerse
```bash
sudo apt install imagemagick
```
- [Node.js 20.x](https://nodejs.org/en/download/)
- [Node.js 22.x](https://nodejs.org/en/download/)
```bash
# Install Node.js 20.x using nvm (Node Version Manager)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
source ~/.bashrc
nvm install 20
nvm use 20
nvm install 22
nvm use 22
```
- [Yarn](https://yarnpkg.com/getting-started/install)
```bash
Expand Down
2 changes: 1 addition & 1 deletion installation_docs/manual/windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ cd CircuitVerse
- Download the installer from [here](https://www.memurai.com/get-memurai)
- Run the installer
- [ImageMagick](https://imagemagick.org/) - Image manipulation library
- [Node.js 16.x](https://nodejs.org/it/download)
- [Node.js 22.x](https://nodejs.org/it/download)
- [Yarn](https://yarnpkg.com/getting-started/install)
- [CMAKE](https://cmake.org/install/)
- OpenSSL
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"build": "node esbuild.config.js"
},
"devDependencies": {
"@babel/preset-env": "^7.26.0",
"@babel/preset-env": "^7.26.7",
"@commitlint/cli": "^17.5.0",
"@commitlint/config-conventional": "^17.4.4",
"@jsdoc/salty": "^0.2.9",
Expand All @@ -30,13 +30,13 @@
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jsdoc": "3.6.10",
"lint-staged": ">=15",
"lint-staged": ">=15.4.2",
"livereload": "^0.9.3",
"nodemon": "^2.0.21",
"postcss-flexbugs-fixes": "^5.0.2",
"postcss-import": "^15.1.0",
"postcss-preset-env": "^8.4.2",
"vite": "^5.4.9",
"vite": "^5.4.14",
"vite-plugin-ruby": "^5.1.1"
},
"dependencies": {
Expand All @@ -61,7 +61,7 @@
"jquery-ujs": "^1.2.3",
"jsdoc-export-default-interop": "^0.3.1",
"opencollective-postinstall": "^2.0.3",
"sass": "^1.83.0",
"sass": "^1.83.4",
"stimulus": "^3.2.2",
"stylelint": "^15.11.0",
"stylelint-config-standard-scss": "^11.1.0",
Expand Down

0 comments on commit cff2c44

Please sign in to comment.