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 18, 2025
1 parent 8e8e6f9 commit 9e52f83
Show file tree
Hide file tree
Showing 11 changed files with 229 additions and 213 deletions.
14 changes: 2 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ jobs:
strategy:
matrix:
node-version:
- '20.9'
- '18.17'
- '16.20'
- '14.16'
- '22.0.0'
os:
- macos-latest
- ubuntu-latest
Expand All @@ -33,9 +30,6 @@ jobs:
GYP_MSVS_VERSION: '2022'
steps:
- run: git config --global core.autocrlf input
- name: Install Rosetta
if: ${{ matrix.os == 'macos-latest' && (matrix.node-version == '14.16' || matrix.node-version == '12.22') }}
run: /usr/sbin/softwareupdate --install-rosetta --agree-to-license
- name: Enable Long Paths (Windows)
if : ${{ matrix.os == 'windows-latest' }}
run: |
Expand All @@ -53,11 +47,7 @@ jobs:
with:
node-version: "${{ matrix.node-version }}"
cache: 'yarn'
architecture: ${{ matrix.os == 'macos-latest' && (matrix.node-version == '14.16' || matrix.node-version == '12.22') && 'x64' || env.RUNNER_ARCH }}
- name: Update npm
if: ${{ matrix.node-version == '14.16' || matrix.node-version == '12.22' }}
run: npm install -g npm@8 # Update npm so it works with latest Python 3
- name: Install
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Lint
run: yarn run lint
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"
},
"publishConfig": {
"provenance": true
Expand Down Expand Up @@ -67,7 +67,7 @@
"@types/debug": "^4.1.5",
"@types/fs-extra": "^9.0.1",
"@types/mocha": "^10.0.10",
"@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 @@ -83,12 +83,12 @@
"mocha": "^10.8.2",
"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 9e52f83

Please sign in to comment.