From c7357398f1dbcccdfe2f6240ca9adc362ef87e1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Such=C3=BD?= Date: Thu, 6 Jun 2024 13:31:19 +0200 Subject: [PATCH] chore(repo): upgrade to Node20 (#12037) --- .nvmrc | 2 +- docker/ci-base/Dockerfile | 2 +- package.json | 4 +- .../src/workers/solana/index.ts | 4 +- .../tests/client/coordinatorRequest.test.ts | 2 +- .../e2e/support/networkAnalyzer.ts | 2 +- shell.nix | 2 +- yarn.lock | 86 +++++-------------- 8 files changed, 29 insertions(+), 75 deletions(-) diff --git a/.nvmrc b/.nvmrc index 7ec56198d37..5802c69cb8f 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -18.17.1 \ No newline at end of file +20.12.2 \ No newline at end of file diff --git a/docker/ci-base/Dockerfile b/docker/ci-base/Dockerfile index 95583c68771..ce9b24e8520 100644 --- a/docker/ci-base/Dockerfile +++ b/docker/ci-base/Dockerfile @@ -97,7 +97,7 @@ ENV LC_ALL C.UTF-8 ENV LANG C.UTF-8 # Install and use correct version of node - should match witch Nix and .nvmrc -ENV NODE_VERSION 18.17.1 +ENV NODE_VERSION 20.12.2 # Out of the blue, we started to run into CI failures. All of them had one thing in common. # Some of our dependencies postinstall scripts tried to execute a binary in ./node_modules/.bin/ diff --git a/package.json b/package.json index 646762d1e92..aab02870902 100644 --- a/package.json +++ b/package.json @@ -100,7 +100,7 @@ "electron": "27.3.8", "webpack": "^5.90.1", "html-webpack-plugin": "^5.6.0", - "@types/node": "18.17.15", + "@types/node": "20.12.7", "@types/react": "18.2.55", "@sentry/types": "7.92.0", "bn.js": "5.2.1" @@ -118,7 +118,7 @@ "@babel/runtime": "^7.23.9", "@suite-common/wallet-types": "workspace:*", "@types/jest": "29.5.12", - "@types/node": "18.17.15", + "@types/node": "20.12.7", "@types/prettier": "^3.0.0", "@types/semver": "^7.5.6", "@types/tar": "^6.1.11", diff --git a/packages/blockchain-link/src/workers/solana/index.ts b/packages/blockchain-link/src/workers/solana/index.ts index a58ab617c33..a9fc0ea92e3 100644 --- a/packages/blockchain-link/src/workers/solana/index.ts +++ b/packages/blockchain-link/src/workers/solana/index.ts @@ -320,7 +320,7 @@ const subscribeBlock = async ({ state, connect, post }: Context) => { const unsubscribeBlock = ({ state }: Context) => { if (!state.getSubscription('block')) return; - const interval = state.getSubscription('block') as NodeJS.Timer; + const interval = state.getSubscription('block') as ReturnType; clearInterval(interval); state.removeSubscription('block'); }; @@ -565,7 +565,7 @@ class SolanaWorker extends BaseWorker { ); if (this.state.getSubscription('block')) { - const interval = this.state.getSubscription('block') as NodeJS.Timer; + const interval = this.state.getSubscription('block') as ReturnType; clearInterval(interval); this.state.removeSubscription('block'); } diff --git a/packages/coinjoin/tests/client/coordinatorRequest.test.ts b/packages/coinjoin/tests/client/coordinatorRequest.test.ts index 5c6041f8d4b..e7065315a06 100644 --- a/packages/coinjoin/tests/client/coordinatorRequest.test.ts +++ b/packages/coinjoin/tests/client/coordinatorRequest.test.ts @@ -126,7 +126,7 @@ describe('http', () => { {}, { baseUrl: 'https://localhost/', deadline: Date.now() + 50000 }, ), - ).rejects.toThrow('ECONNREFUSED'); + ).rejects.toThrow(); }); it('aborted request', async () => { diff --git a/packages/suite-desktop-core/e2e/support/networkAnalyzer.ts b/packages/suite-desktop-core/e2e/support/networkAnalyzer.ts index 4ba03f99304..e94550b9cfd 100644 --- a/packages/suite-desktop-core/e2e/support/networkAnalyzer.ts +++ b/packages/suite-desktop-core/e2e/support/networkAnalyzer.ts @@ -1,7 +1,7 @@ import { exec } from 'child_process'; export class NetworkAnalyzer { - interval?: string | number | NodeJS.Timer; + interval?: string | number | ReturnType; tcp: string[]; constructor() { diff --git a/shell.nix b/shell.nix index 98db461e307..0ac78127e10 100644 --- a/shell.nix +++ b/shell.nix @@ -9,7 +9,7 @@ with import let # unstable packages electron = electron_27; # use the same version as defined in packages/suite-desktop/package.json - nodejs = nodejs_18; + nodejs = nodejs_20; # use older gcc. 10.2.0 with glibc 2.32 for node_modules bindings. # electron-builder is packing the app with glibc 2.32, bindings should not be compiled with newer version. gccPkgs = import (builtins.fetchTarball { diff --git a/yarn.lock b/yarn.lock index 0178f96985d..5f910ec727f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -104,17 +104,7 @@ __metadata: languageName: node linkType: hard -"@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.10.4, @babel/code-frame@npm:^7.12.13, @babel/code-frame@npm:^7.16.7, @babel/code-frame@npm:^7.21.4, @babel/code-frame@npm:^7.23.5": - version: 7.23.5 - resolution: "@babel/code-frame@npm:7.23.5" - dependencies: - "@babel/highlight": "npm:^7.23.4" - chalk: "npm:^2.4.2" - checksum: 10/44e58529c9d93083288dc9e649c553c5ba997475a7b0758cc3ddc4d77b8a7d985dbe78cc39c9bbc61f26d50af6da1ddf0a3427eae8cc222a9370619b671ed8f5 - languageName: node - linkType: hard - -"@babel/code-frame@npm:^7.18.6": +"@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.10.4, @babel/code-frame@npm:^7.12.13, @babel/code-frame@npm:^7.16.7, @babel/code-frame@npm:^7.18.6, @babel/code-frame@npm:^7.21.4, @babel/code-frame@npm:^7.23.5": version: 7.24.2 resolution: "@babel/code-frame@npm:7.24.2" dependencies: @@ -413,14 +403,7 @@ __metadata: languageName: node linkType: hard -"@babel/helper-validator-identifier@npm:^7.18.6, @babel/helper-validator-identifier@npm:^7.22.20": - version: 7.22.20 - resolution: "@babel/helper-validator-identifier@npm:7.22.20" - checksum: 10/df882d2675101df2d507b95b195ca2f86a3ef28cb711c84f37e79ca23178e13b9f0d8b522774211f51e40168bf5142be4c1c9776a150cddb61a0d5bf3e95750b - languageName: node - linkType: hard - -"@babel/helper-validator-identifier@npm:^7.24.5": +"@babel/helper-validator-identifier@npm:^7.18.6, @babel/helper-validator-identifier@npm:^7.22.20, @babel/helper-validator-identifier@npm:^7.24.5": version: 7.24.5 resolution: "@babel/helper-validator-identifier@npm:7.24.5" checksum: 10/38aaf6a64a0ea2e84766165b461deda3c24fd2173dff18419a2cc9e1ea1d3e709039aee94db29433a07011492717c80900a5eb564cdca7d137757c3c69e26898 @@ -456,18 +439,7 @@ __metadata: languageName: node linkType: hard -"@babel/highlight@npm:^7.10.4, @babel/highlight@npm:^7.23.4": - version: 7.23.4 - resolution: "@babel/highlight@npm:7.23.4" - dependencies: - "@babel/helper-validator-identifier": "npm:^7.22.20" - chalk: "npm:^2.4.2" - js-tokens: "npm:^4.0.0" - checksum: 10/62fef9b5bcea7131df4626d009029b1ae85332042f4648a4ce6e740c3fd23112603c740c45575caec62f260c96b11054d3be5987f4981a5479793579c3aac71f - languageName: node - linkType: hard - -"@babel/highlight@npm:^7.24.2": +"@babel/highlight@npm:^7.10.4, @babel/highlight@npm:^7.24.2": version: 7.24.5 resolution: "@babel/highlight@npm:7.24.5" dependencies: @@ -1823,16 +1795,7 @@ __metadata: languageName: node linkType: hard -"@babel/runtime@npm:^7.0.0, @babel/runtime@npm:^7.1.2, @babel/runtime@npm:^7.12.0, @babel/runtime@npm:^7.12.1, @babel/runtime@npm:^7.12.13, @babel/runtime@npm:^7.12.5, @babel/runtime@npm:^7.13.10, @babel/runtime@npm:^7.17.2, @babel/runtime@npm:^7.17.8, @babel/runtime@npm:^7.18.3, @babel/runtime@npm:^7.20.0, @babel/runtime@npm:^7.21.0, @babel/runtime@npm:^7.23.2, @babel/runtime@npm:^7.23.4, @babel/runtime@npm:^7.23.8, @babel/runtime@npm:^7.23.9, @babel/runtime@npm:^7.5.5, @babel/runtime@npm:^7.8.4, @babel/runtime@npm:^7.8.7, @babel/runtime@npm:^7.9.2": - version: 7.24.0 - resolution: "@babel/runtime@npm:7.24.0" - dependencies: - regenerator-runtime: "npm:^0.14.0" - checksum: 10/8d32c7e116606ea322b89f9fde8ffae6be9503b549dc0d0abb38bd9dc26e87469b9fb7a66964cc089ee558fd0a97d304fb0a3cfec140694764fb0d71b6a6f5e4 - languageName: node - linkType: hard - -"@babel/runtime@npm:^7.15.4, @babel/runtime@npm:^7.23.5": +"@babel/runtime@npm:^7.0.0, @babel/runtime@npm:^7.1.2, @babel/runtime@npm:^7.12.0, @babel/runtime@npm:^7.12.1, @babel/runtime@npm:^7.12.13, @babel/runtime@npm:^7.12.5, @babel/runtime@npm:^7.13.10, @babel/runtime@npm:^7.15.4, @babel/runtime@npm:^7.17.2, @babel/runtime@npm:^7.17.8, @babel/runtime@npm:^7.18.3, @babel/runtime@npm:^7.18.6, @babel/runtime@npm:^7.20.0, @babel/runtime@npm:^7.21.0, @babel/runtime@npm:^7.23.2, @babel/runtime@npm:^7.23.4, @babel/runtime@npm:^7.23.5, @babel/runtime@npm:^7.23.8, @babel/runtime@npm:^7.23.9, @babel/runtime@npm:^7.5.5, @babel/runtime@npm:^7.8.4, @babel/runtime@npm:^7.8.7, @babel/runtime@npm:^7.9.2": version: 7.24.6 resolution: "@babel/runtime@npm:7.24.6" dependencies: @@ -1841,15 +1804,6 @@ __metadata: languageName: node linkType: hard -"@babel/runtime@npm:^7.18.6": - version: 7.24.4 - resolution: "@babel/runtime@npm:7.24.4" - dependencies: - regenerator-runtime: "npm:^0.14.0" - checksum: 10/8ec8ce2c145bc7e31dd39ab66df124f357f65c11489aefacb30f431bae913b9aaa66aa5efe5321ea2bf8878af3fcee338c87e7599519a952e3a6f83aa1b03308 - languageName: node - linkType: hard - "@babel/template@npm:^7.0.0, @babel/template@npm:^7.16.7, @babel/template@npm:^7.22.15, @babel/template@npm:^7.24.0, @babel/template@npm:^7.3.3": version: 7.24.0 resolution: "@babel/template@npm:7.24.0" @@ -12706,10 +12660,12 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:18.17.15": - version: 18.17.15 - resolution: "@types/node@npm:18.17.15" - checksum: 10/5b28c68f44657399264efb1308cf87ddbf065299aa9e75abbd9f4d96785e5d7f1fdb0b263f3d7080b89036845e0d907c3edc51f75813c099a7ec311660188928 +"@types/node@npm:20.12.7": + version: 20.12.7 + resolution: "@types/node@npm:20.12.7" + dependencies: + undici-types: "npm:~5.26.4" + checksum: 10/b4a28a3b593a9bdca5650880b6a9acef46911d58cf7cfa57268f048e9a7157a7c3196421b96cea576850ddb732e3b54bc982c8eb5e1e5ef0635d4424c2fce801 languageName: node linkType: hard @@ -35774,7 +35730,7 @@ __metadata: languageName: node linkType: hard -"rimraf@npm:^3.0.0, rimraf@npm:^3.0.2": +"rimraf@npm:^3.0.2": version: 3.0.2 resolution: "rimraf@npm:3.0.2" dependencies: @@ -38668,16 +38624,7 @@ __metadata: languageName: node linkType: hard -"tmp@npm:^0.2.0, tmp@npm:^0.2.1, tmp@npm:~0.2.1": - version: 0.2.1 - resolution: "tmp@npm:0.2.1" - dependencies: - rimraf: "npm:^3.0.0" - checksum: 10/445148d72df3ce99356bc89a7857a0c5c3b32958697a14e50952c6f7cf0a8016e746ababe9a74c1aa52f04c526661992f14659eba34d3c6701d49ba2f3cf781b - languageName: node - linkType: hard - -"tmp@npm:^0.2.3": +"tmp@npm:^0.2.0, tmp@npm:^0.2.1, tmp@npm:^0.2.3, tmp@npm:~0.2.1": version: 0.2.3 resolution: "tmp@npm:0.2.3" checksum: 10/7b13696787f159c9754793a83aa79a24f1522d47b87462ddb57c18ee93ff26c74cbb2b8d9138f571d2e0e765c728fb2739863a672b280528512c6d83d511c6fa @@ -38869,7 +38816,7 @@ __metadata: "@babel/runtime": "npm:^7.23.9" "@suite-common/wallet-types": "workspace:*" "@types/jest": "npm:29.5.12" - "@types/node": "npm:18.17.15" + "@types/node": "npm:20.12.7" "@types/prettier": "npm:^3.0.0" "@types/semver": "npm:^7.5.6" "@types/tar": "npm:^6.1.11" @@ -39445,6 +39392,13 @@ __metadata: languageName: node linkType: hard +"undici-types@npm:~5.26.4": + version: 5.26.5 + resolution: "undici-types@npm:5.26.5" + checksum: 10/0097779d94bc0fd26f0418b3a05472410408877279141ded2bd449167be1aed7ea5b76f756562cb3586a07f251b90799bab22d9019ceba49c037c76445f7cddd + languageName: node + linkType: hard + "undici@npm:^6.10.1": version: 6.18.2 resolution: "undici@npm:6.18.2"