Skip to content

Commit

Permalink
feat!: bump engines requirement to Node 22
Browse files Browse the repository at this point in the history
  • Loading branch information
erikian committed Jan 11, 2025
1 parent 7b18a69 commit 08d0177
Show file tree
Hide file tree
Showing 11 changed files with 228 additions and 231 deletions.
31 changes: 1 addition & 30 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,6 @@ workflows:
name: test-<< matrix.executor >>-<< matrix.node-version >>
pre-steps:
- run: git config --global core.autocrlf input
- when:
condition:
or:
- and:
- equal: [ node/macos, << matrix.executor >> ]
- equal: [ '14.16', << matrix.node-version >> ]
- and:
- equal: [ node/macos, << matrix.executor >> ]
- equal: [ '12.22', << matrix.node-version >> ]
steps:
- node/install-rosetta
- when:
condition:
equal: [ windows, << matrix.executor >> ]
Expand All @@ -45,14 +34,6 @@ workflows:
command: pip3 install setuptools
shell: powershell.exe
test-steps:
- when:
condition:
or:
- equal: [ '14.16', << matrix.node-version >> ]
- equal: [ '12.22', << matrix.node-version >> ]
steps:
# Update npm so it works with latest Python 3
- run: npm install -g npm@8
- run: yarn run lint
- run:
name: Tests with code coverage
Expand All @@ -69,17 +50,7 @@ workflows:
- node/macos
- windows
node-version:
- '20.9'
- '18.17'
- '16.20'
# Stay below 14.17.0 or nvm tries to download arm64 artifacts which don't exist
- '14.16'
- '12.22'
exclude:
- executor: windows
node-version: '14.16'
- executor: windows
node-version: '12.22'
- '22.0.0'
- cfa/release:
requires:
- test
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22.0.0
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ npm run rebuild

### What are the requirements?

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

Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
},
"homepage": "https://github.com/electron/rebuild",
"engines": {
"node": ">=12.13.0"
"node": ">=22.0.0"
},
"dependencies": {
"@electron/node-gyp": "https://github.com/electron/node-gyp#06b29aafb7708acef8b3669835c8a7857ebc92d2",
Expand All @@ -64,7 +64,7 @@
"@types/debug": "^4.1.5",
"@types/fs-extra": "^9.0.1",
"@types/mocha": "^9.0.0",
"@types/node": "^17.0.8",
"@types/node": "^22.10.5",
"@types/node-abi": "^3.0.0",
"@types/semver": "^7.3.9",
"@types/tar": "^6.1.0",
Expand All @@ -81,12 +81,12 @@
"mocha": "^9.0.1",
"nyc": "^15.1.0",
"ts-node": "^10.0.0",
"typescript": "^4.0.2"
"typescript": "^5.7.3"
},
"eslintConfig": {
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2019,
"ecmaVersion": 2025,
"sourceType": "module"
},
"plugins": [
Expand Down
4 changes: 2 additions & 2 deletions src/clang-fetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const d = debug('electron-rebuild');
const CDS_URL = 'https://commondatastorage.googleapis.com/chromium-browser-clang';

function getPlatformUrlPrefix(hostOS: string, hostArch: string) {
const prefixMap = {
const prefixMap: Record<string, string> = {
'linux': 'Linux_x64',
'darwin': 'Mac',
'win32': 'Win',
Expand Down Expand Up @@ -102,7 +102,7 @@ async function downloadClangVersion(electronVersion: string) {
d('fetching clang:', clangVersionString);

const clangDownloadURL = getClangDownloadURL('clang', clangVersionString, process.platform, process.arch);

const contents = await fetch(clangDownloadURL, 'buffer');
d('deflating clang');
zlib.deflateSync(contents);
Expand Down
2 changes: 1 addition & 1 deletion src/sysroot-fetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { fetch } from './fetcher';

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

const sysrootArchAliases = {
const sysrootArchAliases: Record<string, string> = {
x64: 'amd64',
ia32: 'i386',
};
Expand Down
5 changes: 3 additions & 2 deletions test/fixture/native-app1/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"dependencies": {
"@newrelic/native-metrics": "5.3.0",
"farmhash": "3.2.1",
"farmhash": "3.3.1",
"level": "6.0.0",
"native-hello-world": "2.0.0",
"ref-napi": "1.4.2",
Expand All @@ -29,6 +29,7 @@
"bcrypt": "5.0.0"
},
"resolutions": {
"bcrypt/nan": "2.17.0"
"bcrypt/nan": "2.17.0",
"node-gyp": "https://github.com/electron/node-gyp#06b29aafb7708acef8b3669835c8a7857ebc92d2"
}
}
Loading

0 comments on commit 08d0177

Please sign in to comment.