Skip to content

Commit

Permalink
feat: add node v22 and npm v10 support (#2695)
Browse files Browse the repository at this point in the history
* add node 22 support

* add debug stuff

* try upgrading npm

* remove node 16

* debug

* remove tmux

* only allow 22.9 onwards

* try 22.8

* try 22.7

* test more 22.x versions

* test more versions

* switch back to 22.x, clean up

* update README
  • Loading branch information
mvadari authored Dec 12, 2024
1 parent 305f2c4 commit e42d418
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 21 deletions.
31 changes: 13 additions & 18 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

- name: Setup npm version 9
- name: Setup npm version 10
run: |
npm i -g npm@9 --registry=https://registry.npmjs.org
npm i -g npm@10 --registry=https://registry.npmjs.org
- name: Cache node modules
id: cache-nodemodules
Expand All @@ -45,7 +45,6 @@ jobs:
key: ${{ runner.os }}-deps-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-deps-${{ matrix.node-version }}-
${{ runner.os }}-deps-
- name: Install Dependencies
if: steps.cache-nodemodules.outputs.cache-hit != 'true'
Expand All @@ -60,7 +59,7 @@ jobs:

strategy:
matrix:
node-version: [18.x, 20.x]
node-version: [18.x, 20.x, 22.x]

steps:
- uses: actions/checkout@v3
Expand All @@ -69,9 +68,9 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

- name: Setup npm version 9
- name: Setup npm version 10
run: |
npm i -g npm@9 --registry=https://registry.npmjs.org
npm i -g npm@10 --registry=https://registry.npmjs.org
- name: Cache node modules
id: cache-nodemodules
Expand All @@ -86,7 +85,6 @@ jobs:
key: ${{ runner.os }}-deps-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-deps-${{ matrix.node-version }}-
${{ runner.os }}-deps-
- name: Install Dependencies
if: steps.cache-nodemodules.outputs.cache-hit != 'true'
Expand All @@ -101,7 +99,7 @@ jobs:

strategy:
matrix:
node-version: [18.x, 20.x]
node-version: [18.x, 20.x, 22.x]

steps:
- uses: actions/checkout@v3
Expand All @@ -115,9 +113,9 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

- name: Setup npm version 9
- name: Setup npm version 10
run: |
npm i -g npm@9 --registry=https://registry.npmjs.org
npm i -g npm@10 --registry=https://registry.npmjs.org
- name: Cache node modules
id: cache-nodemodules
Expand All @@ -132,7 +130,6 @@ jobs:
key: ${{ runner.os }}-deps-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-deps-${{ matrix.node-version }}-
${{ runner.os }}-deps-
- name: Install Dependencies
if: steps.cache-nodemodules.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -167,9 +164,9 @@ jobs:
run: |
docker run --detach --rm -p 6006:6006 --volume "${{ github.workspace }}/.ci-config/":"/etc/opt/ripple/" --name rippled-service --health-cmd="rippled server_nfo || exit 1" --health-interval=5s --health-retries=10 --health-timeout=2s --env GITHUB_ACTIONS=true --env CI=true --entrypoint bash ${{ env.RIPPLED_DOCKER_IMAGE }} -c "rippled -a"
- name: Setup npm version 9
- name: Setup npm version 10
run: |
npm i -g npm@9 --registry=https://registry.npmjs.org
npm i -g npm@10 --registry=https://registry.npmjs.org
- name: Cache node modules
id: cache-nodemodules
Expand All @@ -184,7 +181,6 @@ jobs:
key: ${{ runner.os }}-deps-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-deps-${{ matrix.node-version }}-
${{ runner.os }}-deps-
- name: Install Dependencies
if: steps.cache-nodemodules.outputs.cache-hit != 'true'
Expand All @@ -205,7 +201,7 @@ jobs:

strategy:
matrix:
node-version: [18.x, 20.x]
node-version: [18.x, 20.x, 22.x]

steps:
- uses: actions/checkout@v3
Expand All @@ -214,9 +210,9 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

- name: Setup npm version 9
- name: Setup npm version 10
run: |
npm i -g npm@9 --registry=https://registry.npmjs.org
npm i -g npm@10 --registry=https://registry.npmjs.org
- name: Cache node modules
id: cache-nodemodules
Expand All @@ -231,7 +227,6 @@ jobs:
key: ${{ runner.os }}-deps-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-deps-${{ matrix.node-version }}-
${{ runner.os }}-deps-
- name: Install Dependencies
if: steps.cache-nodemodules.outputs.cache-hit != 'true'
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ All of which works in Node.js (tested for v18+) & web browsers (tested for Chrom

### Requirements

+ **[Node.js v18](https://nodejs.org/)** is recommended. We also support v20. Other versions may work but are not frequently tested.
+ **[Node.js v18](https://nodejs.org/)** is recommended. We also support v20 and v22. Other versions may work but are not frequently tested.

### Installing xrpl.js

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,6 @@
],
"engines": {
"node": ">=18.0.0",
"npm": ">=7.10.0 < 10.0.0"
"npm": ">=7.10.0"
}
}

0 comments on commit e42d418

Please sign in to comment.