Skip to content

Commit 3a704cc

Browse files
authored
Support Node.js 18 and 19 (#82)
* Pass openssl_fips as a variable to support building older node versions on newer node versions See nodejs/node-gyp#2534 and nodejs/node-gyp#2673 for more context on this issue * Update dependencies * Add support for Node.js 18 and 19 As node-pre-gyp is no longer maintained this is the path of least resistance to adding new versions, we include a patch within this project that updates the abi_crosswalk file within node-pre-gyp that is used to map the versions of node to their module/v8 versions. Then in run.js we call patch-package before spawning anything to ensure that our patches are applied correctly. This isn't by any means perfect but it's the quickest way to update the supported versions of node without having to go and make any major refactors to the setup here, or the code in ioslib/the SDK
1 parent ab6029f commit 3a704cc

File tree

5 files changed

+323
-10
lines changed

5 files changed

+323
-10
lines changed

bin/run.js

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ if (process.platform !== 'darwin') {
77
}
88

99
const spawnSync = require('child_process').spawnSync;
10+
11+
spawnSync('patch-package', { stdio: 'inherit' });
12+
1013
const args = process.argv.slice(2);
1114
const cmd = args.shift();
1215

binding.gyp

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
'v8_enable_pointer_compression': 'false',
55
'v8_enable_31bit_smis_on_64bit_arch': 'false',
66
'mobiledevice_framework_location': '/System/Library/PrivateFrameworks/MobileDevice.framework',
7-
'new_mobiledevice_framework_location': '/Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework'
7+
'new_mobiledevice_framework_location': '/Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework',
8+
'openssl_fips' : ''
89
},
910
'conditions': [
1011
['OS=="mac"', {

package.json

+7-4
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@
2424
"gypfile": true,
2525
"main": "./ios-device",
2626
"dependencies": {
27-
"@mapbox/node-pre-gyp": "^1.0.8",
27+
"@mapbox/node-pre-gyp": "^1.0.10",
2828
"debug": "^4.3.4",
29-
"nan": "^2.15.0",
30-
"node-pre-gyp-init": "^1.2.1"
29+
"nan": "^2.17.0",
30+
"node-pre-gyp-init": "^1.2.1",
31+
"patch-package": "^6.5.1"
3132
},
3233
"devDependencies": {
3334
"@octokit/rest": "^18.12.0"
@@ -54,7 +55,9 @@
5455
"14.19.1": 83,
5556
"15.14.0": 88,
5657
"16.14.2": 93,
57-
"17.7.2": 102
58+
"17.7.2": 102,
59+
"18.13.0": 108,
60+
"19.4.0": 111
5861
}
5962
},
6063
"engines": {
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
diff --git a/node_modules/@mapbox/node-pre-gyp/lib/util/abi_crosswalk.json b/node_modules/@mapbox/node-pre-gyp/lib/util/abi_crosswalk.json
2+
index 7f52972..089c6e9 100644
3+
--- a/node_modules/@mapbox/node-pre-gyp/lib/util/abi_crosswalk.json
4+
+++ b/node_modules/@mapbox/node-pre-gyp/lib/util/abi_crosswalk.json
5+
@@ -2598,5 +2598,13 @@
6+
"17.1.0": {
7+
"node_abi": 102,
8+
"v8": "9.5"
9+
+ },
10+
+ "18.13.0":{
11+
+ "node_abi": 108,
12+
+ "v8": "10.2"
13+
+ } ,
14+
+ "19.4.0": {
15+
+ "node_abi": 111,
16+
+ "v8": "10.8"
17+
}
18+
}
19+
\ No newline at end of file

0 commit comments

Comments
 (0)