Skip to content

Commit

Permalink
BREAKING: drop support for Node.js v16; add support for ^20,>=22 (#245)
Browse files Browse the repository at this point in the history
* chore(yarnrc): ignore-engines=true due to devDep

* chore(devDeps): @types/node@^17.0.23->^18.16

https://github.com/DefinitelyTyped/DefinitelyTyped?tab=readme-ov-file#how-do-definitely-typed-package-versions-relate-to-versions-of-the-corresponding-library

---------

Co-authored-by: Elliot Winkler <elliot.winkler@gmail.com>
  • Loading branch information
legobeat and mcmire authored Jun 12, 2024
1 parent a2ad9e3 commit b089e70
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
node-version: [16.x, 18.x]
node-version: [18.x, 20.x, 22.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v16
lts/*
1 change: 1 addition & 0 deletions .yarnrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
ignore-engines true
ignore-scripts true
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ blockTracker.on('error', (err) => console.error(err));

### Setup

- Install [Node.js](https://nodejs.org) version 16 or greater
- Install the current LTS version of [Node.js](https://nodejs.org)
- If you are using [nvm](https://github.com/creationix/nvm#installation) (recommended) running `nvm use` will automatically choose the right node version for you.
- Install [Yarn v1](https://yarnpkg.com/en/docs/install)
- Run `yarn setup` to install dependencies and run any requried post-install scripts
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@metamask/json-rpc-engine": "^8.0.2",
"@types/jest": "^29.1.2",
"@types/json-rpc-random-id": "^1.0.1",
"@types/node": "^17.0.23",
"@types/node": "^18.16",
"@types/pify": "^5.0.1",
"@typescript-eslint/eslint-plugin": "^5.61.0",
"@typescript-eslint/parser": "^5.61.0",
Expand All @@ -63,7 +63,7 @@
"typescript": "~4.8.4"
},
"engines": {
"node": ">=16.20 || ^18.16"
"node": "^18.16 || ^20 || >=22"
},
"publishConfig": {
"access": "public",
Expand Down
4 changes: 3 additions & 1 deletion tests/recordCallsToSetTimeout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,9 @@ class SetTimeoutRecorder {
*
* @param timeout - A Timeout object as returned by `setTimeout`.
*/
_mockClearTimeoutImplementation = (timeout: NodeJS.Timeout): void => {
_mockClearTimeoutImplementation = (
timeout?: NodeJS.Timeout | string | number,
): void => {
const index = this.calls.findIndex((c) => c.timeout === timeout);

if (index !== -1) {
Expand Down
15 changes: 11 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -995,10 +995,12 @@
resolved "https://registry.yarnpkg.com/@types/ms/-/ms-0.7.31.tgz#31b7ca6407128a3d2bbc27fe2d21b345397f6197"
integrity sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==

"@types/node@*", "@types/node@^17.0.23":
version "17.0.23"
resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.23.tgz#3b41a6e643589ac6442bdbd7a4a3ded62f33f7da"
integrity sha512-UxDxWn7dl97rKVeVS61vErvw086aCYhDLyvRQZ5Rk65rZKepaFdm53GeqXaKBuOhED4e9uWq34IC3TdSdJJ2Gw==
"@types/node@*", "@types/node@^18.16":
version "18.19.34"
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.19.34.tgz#c3fae2bbbdb94b4a52fe2d229d0dccce02ef3d27"
integrity sha512-eXF4pfBNV5DAMKGbI02NnDtWrQ40hAN558/2vvS4gMpMIxaf6JmD7YjnZbq0Q9TDSSkKBamime8ewRoomHdt4g==
dependencies:
undici-types "~5.26.4"

"@types/pify@^5.0.1":
version "5.0.1"
Expand Down Expand Up @@ -4155,6 +4157,11 @@ unbox-primitive@^1.0.1:
has-symbols "^1.0.2"
which-boxed-primitive "^1.0.2"

undici-types@~5.26.4:
version "5.26.5"
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617"
integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==

unique-filename@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/unique-filename/-/unique-filename-2.0.1.tgz#e785f8675a9a7589e0ac77e0b5c34d2eaeac6da2"
Expand Down

0 comments on commit b089e70

Please sign in to comment.