node-abi 3.2.0 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.circleci/config.yml +7 -1
- package/.releaserc.json +1 -1
- package/abi_registry.json +15 -1
- package/index.js +5 -2
- package/package.json +1 -1
- package/test/index.js +7 -15
package/.circleci/config.yml
CHANGED
|
@@ -29,6 +29,10 @@ jobs:
|
|
|
29
29
|
docker:
|
|
30
30
|
- image: circleci/node:14
|
|
31
31
|
<<: *steps-test
|
|
32
|
+
test-linux-16:
|
|
33
|
+
docker:
|
|
34
|
+
- image: circleci/node:16
|
|
35
|
+
<<: *steps-test
|
|
32
36
|
|
|
33
37
|
release:
|
|
34
38
|
docker:
|
|
@@ -46,12 +50,14 @@ workflows:
|
|
|
46
50
|
- test-linux-10
|
|
47
51
|
- test-linux-12
|
|
48
52
|
- test-linux-14
|
|
53
|
+
- test-linux-16
|
|
49
54
|
- release:
|
|
50
55
|
requires:
|
|
51
56
|
- test-linux-10
|
|
52
57
|
- test-linux-12
|
|
53
58
|
- test-linux-14
|
|
59
|
+
- test-linux-16
|
|
54
60
|
filters:
|
|
55
61
|
branches:
|
|
56
62
|
only:
|
|
57
|
-
-
|
|
63
|
+
- main
|
package/.releaserc.json
CHANGED
package/abi_registry.json
CHANGED
|
@@ -50,6 +50,13 @@
|
|
|
50
50
|
"future": false,
|
|
51
51
|
"abi": "93"
|
|
52
52
|
},
|
|
53
|
+
{
|
|
54
|
+
"runtime": "node",
|
|
55
|
+
"target": "17.0.0",
|
|
56
|
+
"lts": false,
|
|
57
|
+
"future": false,
|
|
58
|
+
"abi": "102"
|
|
59
|
+
},
|
|
53
60
|
{
|
|
54
61
|
"abi": "70",
|
|
55
62
|
"future": false,
|
|
@@ -141,6 +148,13 @@
|
|
|
141
148
|
"runtime": "electron",
|
|
142
149
|
"target": "14.0.0-beta.1"
|
|
143
150
|
},
|
|
151
|
+
{
|
|
152
|
+
"abi": "97",
|
|
153
|
+
"future": false,
|
|
154
|
+
"lts": false,
|
|
155
|
+
"runtime": "electron",
|
|
156
|
+
"target": "14.0.2"
|
|
157
|
+
},
|
|
144
158
|
{
|
|
145
159
|
"abi": "98",
|
|
146
160
|
"future": false,
|
|
@@ -150,7 +164,7 @@
|
|
|
150
164
|
},
|
|
151
165
|
{
|
|
152
166
|
"abi": "99",
|
|
153
|
-
"future":
|
|
167
|
+
"future": false,
|
|
154
168
|
"lts": false,
|
|
155
169
|
"runtime": "electron",
|
|
156
170
|
"target": "16.0.0-alpha.1"
|
package/index.js
CHANGED
|
@@ -24,12 +24,15 @@ function getAbi (target, runtime) {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
var abi
|
|
27
|
+
var lastTarget
|
|
27
28
|
|
|
28
29
|
for (var i = 0; i < allTargets.length; i++) {
|
|
29
30
|
var t = allTargets[i]
|
|
30
31
|
if (t.runtime !== runtime) continue
|
|
31
|
-
if (semver.lte(t.target, target)
|
|
32
|
-
|
|
32
|
+
if (semver.lte(t.target, target) && (!lastTarget || semver.gte(t.target, lastTarget))) {
|
|
33
|
+
abi = t.abi
|
|
34
|
+
lastTarget = t.target
|
|
35
|
+
}
|
|
33
36
|
}
|
|
34
37
|
|
|
35
38
|
if (abi && semver.lt(target, getNextTarget(runtime))) return abi
|
package/package.json
CHANGED
package/test/index.js
CHANGED
|
@@ -41,6 +41,7 @@ test('getTarget calculates correct Electron target', function (t) {
|
|
|
41
41
|
t.equal(getTarget('50', 'electron'), '1.4.0')
|
|
42
42
|
t.equal(getTarget('76', 'electron'), '8.0.0')
|
|
43
43
|
t.equal(getTarget('82', 'electron'), '10.0.0')
|
|
44
|
+
t.equal(getTarget('89', 'electron'), '13.0.0')
|
|
44
45
|
t.end()
|
|
45
46
|
})
|
|
46
47
|
|
|
@@ -99,7 +100,12 @@ test('getAbi calculates correct Node ABI', function (t) {
|
|
|
99
100
|
test('getAbi calculates correct Electron ABI', function (t) {
|
|
100
101
|
t.throws(function () { getAbi(undefined, 'electron') })
|
|
101
102
|
t.throws(function () { getAbi(getNextTarget('electron'), 'electron') })
|
|
102
|
-
t.equal(getAbi('
|
|
103
|
+
t.equal(getAbi('15.0.0-beta.1', 'electron'), '89')
|
|
104
|
+
t.equal(getAbi('14.1.1', 'electron'), '97')
|
|
105
|
+
t.equal(getAbi('14.0.0', 'electron'), '89')
|
|
106
|
+
t.equal(getAbi('13.0.0', 'electron'), '89')
|
|
107
|
+
t.equal(getAbi('12.0.0', 'electron'), '87')
|
|
108
|
+
t.equal(getAbi('11.0.0', 'electron'), '85')
|
|
103
109
|
t.equal(getAbi('10.0.0', 'electron'), '82')
|
|
104
110
|
t.equal(getAbi('9.0.0', 'electron'), '80')
|
|
105
111
|
t.equal(getAbi('8.0.0', 'electron'), '76')
|
|
@@ -158,17 +164,3 @@ test('getAbi returns abi if passed as target', function (t) {
|
|
|
158
164
|
t.equal(getAbi('57'), '57')
|
|
159
165
|
t.end()
|
|
160
166
|
})
|
|
161
|
-
|
|
162
|
-
test('allTargets are sorted', function (t) {
|
|
163
|
-
var electron = allTargets.filter(function (t) { return t.runtime === 'electron' })
|
|
164
|
-
var node = allTargets.filter(function (t) { return t.runtime === 'node' })
|
|
165
|
-
var nodeWebkit = allTargets.filter(function (t) { return t.runtime === 'node-webkit' })
|
|
166
|
-
function sort (t1, t2) {
|
|
167
|
-
return semver.compare(t1.target, t2.target)
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
t.deepEqual(electron, electron.slice().sort(sort), 'electron targets are sorted')
|
|
171
|
-
t.deepEqual(node, node.slice().sort(sort), 'node targets are sorted')
|
|
172
|
-
t.deepEqual(nodeWebkit, nodeWebkit.slice().sort(sort), 'node-webkit targets are sorted')
|
|
173
|
-
t.end()
|
|
174
|
-
})
|