Skip to content

Commit 08d0177

Browse files
committed
feat!: bump engines requirement to Node 22
1 parent 7b18a69 commit 08d0177

11 files changed

+228
-231
lines changed

.circleci/config.yml

+1-30
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,6 @@ workflows:
2121
name: test-<< matrix.executor >>-<< matrix.node-version >>
2222
pre-steps:
2323
- run: git config --global core.autocrlf input
24-
- when:
25-
condition:
26-
or:
27-
- and:
28-
- equal: [ node/macos, << matrix.executor >> ]
29-
- equal: [ '14.16', << matrix.node-version >> ]
30-
- and:
31-
- equal: [ node/macos, << matrix.executor >> ]
32-
- equal: [ '12.22', << matrix.node-version >> ]
33-
steps:
34-
- node/install-rosetta
3524
- when:
3625
condition:
3726
equal: [ windows, << matrix.executor >> ]
@@ -45,14 +34,6 @@ workflows:
4534
command: pip3 install setuptools
4635
shell: powershell.exe
4736
test-steps:
48-
- when:
49-
condition:
50-
or:
51-
- equal: [ '14.16', << matrix.node-version >> ]
52-
- equal: [ '12.22', << matrix.node-version >> ]
53-
steps:
54-
# Update npm so it works with latest Python 3
55-
- run: npm install -g npm@8
5637
- run: yarn run lint
5738
- run:
5839
name: Tests with code coverage
@@ -69,17 +50,7 @@ workflows:
6950
- node/macos
7051
- windows
7152
node-version:
72-
- '20.9'
73-
- '18.17'
74-
- '16.20'
75-
# Stay below 14.17.0 or nvm tries to download arm64 artifacts which don't exist
76-
- '14.16'
77-
- '12.22'
78-
exclude:
79-
- executor: windows
80-
node-version: '14.16'
81-
- executor: windows
82-
node-version: '12.22'
53+
- '22.0.0'
8354
- cfa/release:
8455
requires:
8556
- test

.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22.0.0

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ npm run rebuild
4444

4545
### What are the requirements?
4646

47-
Node v12.13.0 or higher is required. Building native modules from source uses
47+
Node v22.0.0 or higher is required. Building native modules from source uses
4848
[`node-gyp`](https://github.com/nodejs/node-gyp#installation), refer to the link for its
4949
installation/runtime requirements.
5050

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
},
4040
"homepage": "https://github.com/electron/rebuild",
4141
"engines": {
42-
"node": ">=12.13.0"
42+
"node": ">=22.0.0"
4343
},
4444
"dependencies": {
4545
"@electron/node-gyp": "https://github.com/electron/node-gyp#06b29aafb7708acef8b3669835c8a7857ebc92d2",
@@ -64,7 +64,7 @@
6464
"@types/debug": "^4.1.5",
6565
"@types/fs-extra": "^9.0.1",
6666
"@types/mocha": "^9.0.0",
67-
"@types/node": "^17.0.8",
67+
"@types/node": "^22.10.5",
6868
"@types/node-abi": "^3.0.0",
6969
"@types/semver": "^7.3.9",
7070
"@types/tar": "^6.1.0",
@@ -81,12 +81,12 @@
8181
"mocha": "^9.0.1",
8282
"nyc": "^15.1.0",
8383
"ts-node": "^10.0.0",
84-
"typescript": "^4.0.2"
84+
"typescript": "^5.7.3"
8585
},
8686
"eslintConfig": {
8787
"parser": "@typescript-eslint/parser",
8888
"parserOptions": {
89-
"ecmaVersion": 2019,
89+
"ecmaVersion": 2025,
9090
"sourceType": "module"
9191
},
9292
"plugins": [

src/clang-fetcher.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const d = debug('electron-rebuild');
1313
const CDS_URL = 'https://commondatastorage.googleapis.com/chromium-browser-clang';
1414

1515
function getPlatformUrlPrefix(hostOS: string, hostArch: string) {
16-
const prefixMap = {
16+
const prefixMap: Record<string, string> = {
1717
'linux': 'Linux_x64',
1818
'darwin': 'Mac',
1919
'win32': 'Win',
@@ -102,7 +102,7 @@ async function downloadClangVersion(electronVersion: string) {
102102
d('fetching clang:', clangVersionString);
103103

104104
const clangDownloadURL = getClangDownloadURL('clang', clangVersionString, process.platform, process.arch);
105-
105+
106106
const contents = await fetch(clangDownloadURL, 'buffer');
107107
d('deflating clang');
108108
zlib.deflateSync(contents);

src/sysroot-fetcher.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { fetch } from './fetcher';
99

1010
const d = debug('electron-rebuild');
1111

12-
const sysrootArchAliases = {
12+
const sysrootArchAliases: Record<string, string> = {
1313
x64: 'amd64',
1414
ia32: 'i386',
1515
};

test/fixture/native-app1/package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
},
2020
"dependencies": {
2121
"@newrelic/native-metrics": "5.3.0",
22-
"farmhash": "3.2.1",
22+
"farmhash": "3.3.1",
2323
"level": "6.0.0",
2424
"native-hello-world": "2.0.0",
2525
"ref-napi": "1.4.2",
@@ -29,6 +29,7 @@
2929
"bcrypt": "5.0.0"
3030
},
3131
"resolutions": {
32-
"bcrypt/nan": "2.17.0"
32+
"bcrypt/nan": "2.17.0",
33+
"node-gyp": "https://github.com/electron/node-gyp#06b29aafb7708acef8b3669835c8a7857ebc92d2"
3334
}
3435
}

0 commit comments

Comments
 (0)