node-datachannel 0.2.1 → 0.2.4
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/.github/workflows/build-linux.yml +2 -0
- package/.github/workflows/build-win.yml +1 -7
- package/CMakeLists.txt +2 -2
- package/README.md +18 -3
- package/lib/datachannel-stream.js +86 -0
- package/lib/index.d.ts +16 -2
- package/lib/index.js +3 -1
- package/node_modules/decompress-response/index.d.ts +14 -21
- package/node_modules/decompress-response/index.js +34 -16
- package/node_modules/decompress-response/license +1 -1
- package/node_modules/decompress-response/package.json +23 -17
- package/node_modules/decompress-response/readme.md +2 -6
- package/node_modules/detect-libc/README.md +124 -42
- package/node_modules/detect-libc/index.d.ts +11 -0
- package/node_modules/detect-libc/lib/detect-libc.js +166 -80
- package/node_modules/detect-libc/lib/process.js +16 -0
- package/node_modules/detect-libc/package.json +20 -20
- package/node_modules/{semver → lru-cache}/LICENSE +0 -0
- package/node_modules/lru-cache/README.md +166 -0
- package/node_modules/lru-cache/index.js +334 -0
- package/node_modules/lru-cache/node_modules/yallist/LICENSE +15 -0
- package/node_modules/lru-cache/node_modules/yallist/README.md +204 -0
- package/node_modules/lru-cache/node_modules/yallist/iterator.js +8 -0
- package/node_modules/lru-cache/node_modules/yallist/package.json +65 -0
- package/node_modules/lru-cache/node_modules/yallist/yallist.js +426 -0
- package/node_modules/lru-cache/package.json +74 -0
- package/node_modules/mimic-response/index.d.ts +2 -2
- package/node_modules/mimic-response/index.js +41 -2
- package/node_modules/mimic-response/package.json +17 -17
- package/node_modules/mimic-response/readme.md +22 -1
- package/node_modules/node-abi/.circleci/config.yml +63 -0
- package/node_modules/node-abi/.releaserc.json +9 -0
- package/node_modules/node-abi/abi_registry.json +45 -3
- package/node_modules/node-abi/index.js +5 -2
- package/node_modules/node-abi/node_modules/semver/CHANGELOG.md +111 -0
- package/node_modules/node-abi/node_modules/semver/LICENSE +15 -0
- package/node_modules/{semver → node-abi/node_modules/semver}/README.md +180 -26
- package/node_modules/node-abi/node_modules/semver/bin/semver.js +173 -0
- package/node_modules/node-abi/node_modules/semver/classes/comparator.js +135 -0
- package/node_modules/node-abi/node_modules/semver/classes/index.js +5 -0
- package/node_modules/node-abi/node_modules/semver/classes/range.js +510 -0
- package/node_modules/node-abi/node_modules/semver/classes/semver.js +287 -0
- package/node_modules/node-abi/node_modules/semver/functions/clean.js +6 -0
- package/node_modules/node-abi/node_modules/semver/functions/cmp.js +48 -0
- package/node_modules/node-abi/node_modules/semver/functions/coerce.js +51 -0
- package/node_modules/node-abi/node_modules/semver/functions/compare-build.js +7 -0
- package/node_modules/node-abi/node_modules/semver/functions/compare-loose.js +3 -0
- package/node_modules/node-abi/node_modules/semver/functions/compare.js +5 -0
- package/node_modules/node-abi/node_modules/semver/functions/diff.js +23 -0
- package/node_modules/node-abi/node_modules/semver/functions/eq.js +3 -0
- package/node_modules/node-abi/node_modules/semver/functions/gt.js +3 -0
- package/node_modules/node-abi/node_modules/semver/functions/gte.js +3 -0
- package/node_modules/node-abi/node_modules/semver/functions/inc.js +15 -0
- package/node_modules/node-abi/node_modules/semver/functions/lt.js +3 -0
- package/node_modules/node-abi/node_modules/semver/functions/lte.js +3 -0
- package/node_modules/node-abi/node_modules/semver/functions/major.js +3 -0
- package/node_modules/node-abi/node_modules/semver/functions/minor.js +3 -0
- package/node_modules/node-abi/node_modules/semver/functions/neq.js +3 -0
- package/node_modules/node-abi/node_modules/semver/functions/parse.js +33 -0
- package/node_modules/node-abi/node_modules/semver/functions/patch.js +3 -0
- package/node_modules/node-abi/node_modules/semver/functions/prerelease.js +6 -0
- package/node_modules/node-abi/node_modules/semver/functions/rcompare.js +3 -0
- package/node_modules/node-abi/node_modules/semver/functions/rsort.js +3 -0
- package/node_modules/node-abi/node_modules/semver/functions/satisfies.js +10 -0
- package/node_modules/node-abi/node_modules/semver/functions/sort.js +3 -0
- package/node_modules/node-abi/node_modules/semver/functions/valid.js +6 -0
- package/node_modules/node-abi/node_modules/semver/index.js +48 -0
- package/node_modules/node-abi/node_modules/semver/internal/constants.js +17 -0
- package/node_modules/node-abi/node_modules/semver/internal/debug.js +9 -0
- package/node_modules/node-abi/node_modules/semver/internal/identifiers.js +23 -0
- package/node_modules/node-abi/node_modules/semver/internal/parse-options.js +11 -0
- package/node_modules/node-abi/node_modules/semver/internal/re.js +182 -0
- package/node_modules/{semver → node-abi/node_modules/semver}/package.json +32 -23
- package/node_modules/node-abi/node_modules/semver/preload.js +2 -0
- package/node_modules/{semver → node-abi/node_modules/semver}/range.bnf +0 -0
- package/node_modules/node-abi/node_modules/semver/ranges/gtr.js +4 -0
- package/node_modules/node-abi/node_modules/semver/ranges/intersects.js +7 -0
- package/node_modules/node-abi/node_modules/semver/ranges/ltr.js +4 -0
- package/node_modules/node-abi/node_modules/semver/ranges/max-satisfying.js +25 -0
- package/node_modules/node-abi/node_modules/semver/ranges/min-satisfying.js +24 -0
- package/node_modules/node-abi/node_modules/semver/ranges/min-version.js +60 -0
- package/node_modules/node-abi/node_modules/semver/ranges/outside.js +80 -0
- package/node_modules/node-abi/node_modules/semver/ranges/simplify.js +44 -0
- package/node_modules/node-abi/node_modules/semver/ranges/subset.js +222 -0
- package/node_modules/node-abi/node_modules/semver/ranges/to-comparators.js +8 -0
- package/node_modules/node-abi/node_modules/semver/ranges/valid.js +11 -0
- package/node_modules/node-abi/package.json +20 -17
- package/node_modules/node-abi/test/index.js +7 -15
- package/node_modules/prebuild-install/CHANGELOG.md +24 -7
- package/node_modules/prebuild-install/README.md +24 -4
- package/node_modules/prebuild-install/asset.js +10 -10
- package/node_modules/prebuild-install/bin.js +13 -13
- package/node_modules/prebuild-install/download.js +22 -22
- package/node_modules/prebuild-install/log.js +4 -4
- package/node_modules/prebuild-install/package.json +18 -19
- package/node_modules/prebuild-install/proxy.js +10 -10
- package/node_modules/prebuild-install/rc.js +12 -12
- package/node_modules/prebuild-install/util.js +14 -14
- package/node_modules/simple-get/.github/dependabot.yml +15 -0
- package/node_modules/simple-get/.github/workflows/ci.yml +23 -0
- package/node_modules/simple-get/README.md +17 -3
- package/node_modules/simple-get/index.js +9 -0
- package/node_modules/simple-get/package.json +27 -13
- package/package.json +6 -5
- package/src/media-audio-wrapper.cpp +2 -2
- package/src/peer-connection-wrapper.cpp +63 -10
- package/src/peer-connection-wrapper.h +7 -2
- package/test/test.js +45 -0
- package/node_modules/detect-libc/.npmignore +0 -7
- package/node_modules/detect-libc/bin/detect-libc.js +0 -18
- package/node_modules/node-abi/.travis.yml +0 -17
- package/node_modules/semver/CHANGELOG.md +0 -39
- package/node_modules/semver/bin/semver +0 -160
- package/node_modules/semver/semver.js +0 -1483
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
const Range = require('../classes/range.js')
|
|
2
|
+
const Comparator = require('../classes/comparator.js')
|
|
3
|
+
const { ANY } = Comparator
|
|
4
|
+
const satisfies = require('../functions/satisfies.js')
|
|
5
|
+
const compare = require('../functions/compare.js')
|
|
6
|
+
|
|
7
|
+
// Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff:
|
|
8
|
+
// - Every simple range `r1, r2, ...` is a null set, OR
|
|
9
|
+
// - Every simple range `r1, r2, ...` which is not a null set is a subset of
|
|
10
|
+
// some `R1, R2, ...`
|
|
11
|
+
//
|
|
12
|
+
// Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff:
|
|
13
|
+
// - If c is only the ANY comparator
|
|
14
|
+
// - If C is only the ANY comparator, return true
|
|
15
|
+
// - Else if in prerelease mode, return false
|
|
16
|
+
// - else replace c with `[>=0.0.0]`
|
|
17
|
+
// - If C is only the ANY comparator
|
|
18
|
+
// - if in prerelease mode, return true
|
|
19
|
+
// - else replace C with `[>=0.0.0]`
|
|
20
|
+
// - Let EQ be the set of = comparators in c
|
|
21
|
+
// - If EQ is more than one, return true (null set)
|
|
22
|
+
// - Let GT be the highest > or >= comparator in c
|
|
23
|
+
// - Let LT be the lowest < or <= comparator in c
|
|
24
|
+
// - If GT and LT, and GT.semver > LT.semver, return true (null set)
|
|
25
|
+
// - If any C is a = range, and GT or LT are set, return false
|
|
26
|
+
// - If EQ
|
|
27
|
+
// - If GT, and EQ does not satisfy GT, return true (null set)
|
|
28
|
+
// - If LT, and EQ does not satisfy LT, return true (null set)
|
|
29
|
+
// - If EQ satisfies every C, return true
|
|
30
|
+
// - Else return false
|
|
31
|
+
// - If GT
|
|
32
|
+
// - If GT.semver is lower than any > or >= comp in C, return false
|
|
33
|
+
// - If GT is >=, and GT.semver does not satisfy every C, return false
|
|
34
|
+
// - If GT.semver has a prerelease, and not in prerelease mode
|
|
35
|
+
// - If no C has a prerelease and the GT.semver tuple, return false
|
|
36
|
+
// - If LT
|
|
37
|
+
// - If LT.semver is greater than any < or <= comp in C, return false
|
|
38
|
+
// - If LT is <=, and LT.semver does not satisfy every C, return false
|
|
39
|
+
// - If GT.semver has a prerelease, and not in prerelease mode
|
|
40
|
+
// - If no C has a prerelease and the LT.semver tuple, return false
|
|
41
|
+
// - Else return true
|
|
42
|
+
|
|
43
|
+
const subset = (sub, dom, options = {}) => {
|
|
44
|
+
if (sub === dom)
|
|
45
|
+
return true
|
|
46
|
+
|
|
47
|
+
sub = new Range(sub, options)
|
|
48
|
+
dom = new Range(dom, options)
|
|
49
|
+
let sawNonNull = false
|
|
50
|
+
|
|
51
|
+
OUTER: for (const simpleSub of sub.set) {
|
|
52
|
+
for (const simpleDom of dom.set) {
|
|
53
|
+
const isSub = simpleSubset(simpleSub, simpleDom, options)
|
|
54
|
+
sawNonNull = sawNonNull || isSub !== null
|
|
55
|
+
if (isSub)
|
|
56
|
+
continue OUTER
|
|
57
|
+
}
|
|
58
|
+
// the null set is a subset of everything, but null simple ranges in
|
|
59
|
+
// a complex range should be ignored. so if we saw a non-null range,
|
|
60
|
+
// then we know this isn't a subset, but if EVERY simple range was null,
|
|
61
|
+
// then it is a subset.
|
|
62
|
+
if (sawNonNull)
|
|
63
|
+
return false
|
|
64
|
+
}
|
|
65
|
+
return true
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const simpleSubset = (sub, dom, options) => {
|
|
69
|
+
if (sub === dom)
|
|
70
|
+
return true
|
|
71
|
+
|
|
72
|
+
if (sub.length === 1 && sub[0].semver === ANY) {
|
|
73
|
+
if (dom.length === 1 && dom[0].semver === ANY)
|
|
74
|
+
return true
|
|
75
|
+
else if (options.includePrerelease)
|
|
76
|
+
sub = [ new Comparator('>=0.0.0-0') ]
|
|
77
|
+
else
|
|
78
|
+
sub = [ new Comparator('>=0.0.0') ]
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (dom.length === 1 && dom[0].semver === ANY) {
|
|
82
|
+
if (options.includePrerelease)
|
|
83
|
+
return true
|
|
84
|
+
else
|
|
85
|
+
dom = [ new Comparator('>=0.0.0') ]
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const eqSet = new Set()
|
|
89
|
+
let gt, lt
|
|
90
|
+
for (const c of sub) {
|
|
91
|
+
if (c.operator === '>' || c.operator === '>=')
|
|
92
|
+
gt = higherGT(gt, c, options)
|
|
93
|
+
else if (c.operator === '<' || c.operator === '<=')
|
|
94
|
+
lt = lowerLT(lt, c, options)
|
|
95
|
+
else
|
|
96
|
+
eqSet.add(c.semver)
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if (eqSet.size > 1)
|
|
100
|
+
return null
|
|
101
|
+
|
|
102
|
+
let gtltComp
|
|
103
|
+
if (gt && lt) {
|
|
104
|
+
gtltComp = compare(gt.semver, lt.semver, options)
|
|
105
|
+
if (gtltComp > 0)
|
|
106
|
+
return null
|
|
107
|
+
else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<='))
|
|
108
|
+
return null
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// will iterate one or zero times
|
|
112
|
+
for (const eq of eqSet) {
|
|
113
|
+
if (gt && !satisfies(eq, String(gt), options))
|
|
114
|
+
return null
|
|
115
|
+
|
|
116
|
+
if (lt && !satisfies(eq, String(lt), options))
|
|
117
|
+
return null
|
|
118
|
+
|
|
119
|
+
for (const c of dom) {
|
|
120
|
+
if (!satisfies(eq, String(c), options))
|
|
121
|
+
return false
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return true
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
let higher, lower
|
|
128
|
+
let hasDomLT, hasDomGT
|
|
129
|
+
// if the subset has a prerelease, we need a comparator in the superset
|
|
130
|
+
// with the same tuple and a prerelease, or it's not a subset
|
|
131
|
+
let needDomLTPre = lt &&
|
|
132
|
+
!options.includePrerelease &&
|
|
133
|
+
lt.semver.prerelease.length ? lt.semver : false
|
|
134
|
+
let needDomGTPre = gt &&
|
|
135
|
+
!options.includePrerelease &&
|
|
136
|
+
gt.semver.prerelease.length ? gt.semver : false
|
|
137
|
+
// exception: <1.2.3-0 is the same as <1.2.3
|
|
138
|
+
if (needDomLTPre && needDomLTPre.prerelease.length === 1 &&
|
|
139
|
+
lt.operator === '<' && needDomLTPre.prerelease[0] === 0) {
|
|
140
|
+
needDomLTPre = false
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
for (const c of dom) {
|
|
144
|
+
hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>='
|
|
145
|
+
hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<='
|
|
146
|
+
if (gt) {
|
|
147
|
+
if (needDomGTPre) {
|
|
148
|
+
if (c.semver.prerelease && c.semver.prerelease.length &&
|
|
149
|
+
c.semver.major === needDomGTPre.major &&
|
|
150
|
+
c.semver.minor === needDomGTPre.minor &&
|
|
151
|
+
c.semver.patch === needDomGTPre.patch) {
|
|
152
|
+
needDomGTPre = false
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
if (c.operator === '>' || c.operator === '>=') {
|
|
156
|
+
higher = higherGT(gt, c, options)
|
|
157
|
+
if (higher === c && higher !== gt)
|
|
158
|
+
return false
|
|
159
|
+
} else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options))
|
|
160
|
+
return false
|
|
161
|
+
}
|
|
162
|
+
if (lt) {
|
|
163
|
+
if (needDomLTPre) {
|
|
164
|
+
if (c.semver.prerelease && c.semver.prerelease.length &&
|
|
165
|
+
c.semver.major === needDomLTPre.major &&
|
|
166
|
+
c.semver.minor === needDomLTPre.minor &&
|
|
167
|
+
c.semver.patch === needDomLTPre.patch) {
|
|
168
|
+
needDomLTPre = false
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
if (c.operator === '<' || c.operator === '<=') {
|
|
172
|
+
lower = lowerLT(lt, c, options)
|
|
173
|
+
if (lower === c && lower !== lt)
|
|
174
|
+
return false
|
|
175
|
+
} else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options))
|
|
176
|
+
return false
|
|
177
|
+
}
|
|
178
|
+
if (!c.operator && (lt || gt) && gtltComp !== 0)
|
|
179
|
+
return false
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// if there was a < or >, and nothing in the dom, then must be false
|
|
183
|
+
// UNLESS it was limited by another range in the other direction.
|
|
184
|
+
// Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0
|
|
185
|
+
if (gt && hasDomLT && !lt && gtltComp !== 0)
|
|
186
|
+
return false
|
|
187
|
+
|
|
188
|
+
if (lt && hasDomGT && !gt && gtltComp !== 0)
|
|
189
|
+
return false
|
|
190
|
+
|
|
191
|
+
// we needed a prerelease range in a specific tuple, but didn't get one
|
|
192
|
+
// then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0,
|
|
193
|
+
// because it includes prereleases in the 1.2.3 tuple
|
|
194
|
+
if (needDomGTPre || needDomLTPre)
|
|
195
|
+
return false
|
|
196
|
+
|
|
197
|
+
return true
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// >=1.2.3 is lower than >1.2.3
|
|
201
|
+
const higherGT = (a, b, options) => {
|
|
202
|
+
if (!a)
|
|
203
|
+
return b
|
|
204
|
+
const comp = compare(a.semver, b.semver, options)
|
|
205
|
+
return comp > 0 ? a
|
|
206
|
+
: comp < 0 ? b
|
|
207
|
+
: b.operator === '>' && a.operator === '>=' ? b
|
|
208
|
+
: a
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
// <=1.2.3 is higher than <1.2.3
|
|
212
|
+
const lowerLT = (a, b, options) => {
|
|
213
|
+
if (!a)
|
|
214
|
+
return b
|
|
215
|
+
const comp = compare(a.semver, b.semver, options)
|
|
216
|
+
return comp < 0 ? a
|
|
217
|
+
: comp > 0 ? b
|
|
218
|
+
: b.operator === '<' && a.operator === '<=' ? b
|
|
219
|
+
: a
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
module.exports = subset
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const Range = require('../classes/range')
|
|
2
|
+
|
|
3
|
+
// Mostly just for testing and legacy API reasons
|
|
4
|
+
const toComparators = (range, options) =>
|
|
5
|
+
new Range(range, options).set
|
|
6
|
+
.map(comp => comp.map(c => c.value).join(' ').trim().split(' '))
|
|
7
|
+
|
|
8
|
+
module.exports = toComparators
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const Range = require('../classes/range')
|
|
2
|
+
const validRange = (range, options) => {
|
|
3
|
+
try {
|
|
4
|
+
// Return '*' instead of '' so that truthiness works.
|
|
5
|
+
// This will throw if it's invalid anyway
|
|
6
|
+
return new Range(range, options).range || '*'
|
|
7
|
+
} catch (er) {
|
|
8
|
+
return null
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
module.exports = validRange
|
|
@@ -1,31 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_args": [
|
|
3
3
|
[
|
|
4
|
-
"node-abi@
|
|
4
|
+
"node-abi@3.8.0",
|
|
5
5
|
"/home/runner/work/node-datachannel/node-datachannel"
|
|
6
6
|
]
|
|
7
7
|
],
|
|
8
|
-
"_from": "node-abi@
|
|
9
|
-
"_id": "node-abi@
|
|
8
|
+
"_from": "node-abi@3.8.0",
|
|
9
|
+
"_id": "node-abi@3.8.0",
|
|
10
10
|
"_inBundle": false,
|
|
11
|
-
"_integrity": "sha512
|
|
11
|
+
"_integrity": "sha512-tzua9qWWi7iW4I42vUPKM+SfaF0vQSLAm4yO5J83mSwB7GeoWrDKC/K+8YCnYNwqP5duwazbw2X9l4m8SC2cUw==",
|
|
12
12
|
"_location": "/node-abi",
|
|
13
|
-
"_phantomChildren": {
|
|
13
|
+
"_phantomChildren": {
|
|
14
|
+
"lru-cache": "6.0.0"
|
|
15
|
+
},
|
|
14
16
|
"_requested": {
|
|
15
17
|
"type": "version",
|
|
16
18
|
"registry": true,
|
|
17
|
-
"raw": "node-abi@
|
|
19
|
+
"raw": "node-abi@3.8.0",
|
|
18
20
|
"name": "node-abi",
|
|
19
21
|
"escapedName": "node-abi",
|
|
20
|
-
"rawSpec": "
|
|
22
|
+
"rawSpec": "3.8.0",
|
|
21
23
|
"saveSpec": null,
|
|
22
|
-
"fetchSpec": "
|
|
24
|
+
"fetchSpec": "3.8.0"
|
|
23
25
|
},
|
|
24
26
|
"_requiredBy": [
|
|
25
27
|
"/prebuild-install"
|
|
26
28
|
],
|
|
27
|
-
"_resolved": "https://registry.npmjs.org/node-abi/-/node-abi-
|
|
28
|
-
"_spec": "
|
|
29
|
+
"_resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.8.0.tgz",
|
|
30
|
+
"_spec": "3.8.0",
|
|
29
31
|
"_where": "/home/runner/work/node-datachannel/node-datachannel",
|
|
30
32
|
"author": {
|
|
31
33
|
"name": "Lukas Geiger"
|
|
@@ -34,14 +36,16 @@
|
|
|
34
36
|
"url": "https://github.com/lgeiger/node-abi/issues"
|
|
35
37
|
},
|
|
36
38
|
"dependencies": {
|
|
37
|
-
"semver": "^
|
|
39
|
+
"semver": "^7.3.5"
|
|
38
40
|
},
|
|
39
41
|
"description": "Get the Node ABI for a given target and runtime, and vice versa.",
|
|
40
42
|
"devDependencies": {
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"tape": "^
|
|
44
|
-
|
|
43
|
+
"@continuous-auth/semantic-release-npm": "^2.0.0",
|
|
44
|
+
"got": "^11.8.2",
|
|
45
|
+
"tape": "^5.3.1"
|
|
46
|
+
},
|
|
47
|
+
"engines": {
|
|
48
|
+
"node": ">=10"
|
|
45
49
|
},
|
|
46
50
|
"homepage": "https://github.com/lgeiger/node-abi#readme",
|
|
47
51
|
"keywords": [
|
|
@@ -61,8 +65,7 @@
|
|
|
61
65
|
"scripts": {
|
|
62
66
|
"semantic-release": "semantic-release",
|
|
63
67
|
"test": "tape test/index.js",
|
|
64
|
-
"travis-deploy-once": "travis-deploy-once",
|
|
65
68
|
"update-abi-registry": "node --unhandled-rejections=strict scripts/update-abi-registry.js"
|
|
66
69
|
},
|
|
67
|
-
"version": "
|
|
70
|
+
"version": "3.8.0"
|
|
68
71
|
}
|
|
@@ -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
|
-
})
|
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [7.0.1] - 2022-01-28
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- Upgrade to the latest version of `detect-libc` ([#166](https://github.com/prebuild/prebuild-install/issues/166)) ([`f71c6b9`](https://github.com/prebuild/prebuild-install/commit/f71c6b9)) (Lovell Fuller).
|
|
8
|
+
|
|
9
|
+
## [7.0.0] - 2021-11-12
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- **Breaking:** bump `node-abi` so that Electron 14+ gets correct ABI ([#161](https://github.com/prebuild/prebuild-install/issues/161)) ([`477f347`](https://github.com/prebuild/prebuild-install/commit/477f347)) (csett86). Drops support of Node.js < 10.
|
|
14
|
+
- Bump `simple-get` ([`7468c14`](https://github.com/prebuild/prebuild-install/commit/7468c14)) (Vincent Weevers).
|
|
15
|
+
|
|
3
16
|
## [6.1.4] - 2021-08-11
|
|
4
17
|
|
|
5
18
|
### Fixed
|
|
@@ -64,18 +77,22 @@
|
|
|
64
77
|
|
|
65
78
|
- Replace `mkdirp` dependency with `mkdirp-classic` ([**@ralphtheninja**](https://github.com/ralphtheninja))
|
|
66
79
|
|
|
67
|
-
[
|
|
80
|
+
[7.0.1]: https://github.com/prebuild/prebuild-install/releases/tag/v7.0.1
|
|
81
|
+
|
|
82
|
+
[7.0.0]: https://github.com/prebuild/prebuild-install/releases/tag/v7.0.0
|
|
83
|
+
|
|
84
|
+
[6.1.4]: https://github.com/prebuild/prebuild-install/releases/tag/v6.1.4
|
|
68
85
|
|
|
69
|
-
[6.1.3]: https://github.com/prebuild/prebuild-install/
|
|
86
|
+
[6.1.3]: https://github.com/prebuild/prebuild-install/releases/tag/v6.1.3
|
|
70
87
|
|
|
71
|
-
[6.1.2]: https://github.com/prebuild/prebuild-install/
|
|
88
|
+
[6.1.2]: https://github.com/prebuild/prebuild-install/releases/tag/v6.1.2
|
|
72
89
|
|
|
73
|
-
[6.1.1]: https://github.com/prebuild/prebuild-install/
|
|
90
|
+
[6.1.1]: https://github.com/prebuild/prebuild-install/releases/tag/v6.1.1
|
|
74
91
|
|
|
75
|
-
[6.1.0]: https://github.com/prebuild/prebuild-install/
|
|
92
|
+
[6.1.0]: https://github.com/prebuild/prebuild-install/releases/tag/v6.1.0
|
|
76
93
|
|
|
77
|
-
[6.0.1]: https://github.com/prebuild/prebuild-install/
|
|
94
|
+
[6.0.1]: https://github.com/prebuild/prebuild-install/releases/tag/v6.0.1
|
|
78
95
|
|
|
79
|
-
[6.0.0]: https://github.com/prebuild/prebuild-install/
|
|
96
|
+
[6.0.0]: https://github.com/prebuild/prebuild-install/releases/tag/v6.0.0
|
|
80
97
|
|
|
81
98
|
[5.3.6]: https://github.com/prebuild/prebuild-install/releases/tag/v5.3.6
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
|
|
6
6
|
[](https://www.npmjs.com/package/prebuild-install)
|
|
7
7
|

|
|
8
|
-
[](https://github.com/prebuild/prebuild-install/actions/workflows/test.yml)
|
|
9
|
+
[](https://standardjs.com)
|
|
10
|
+
[](https://common-changelog.org)
|
|
11
11
|
|
|
12
12
|
## Note
|
|
13
13
|
|
|
@@ -40,6 +40,18 @@ Use [`prebuild`](https://github.com/prebuild/prebuild) to create and upload preb
|
|
|
40
40
|
}
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
+
When a consumer then installs your package with npm thus triggering the above install script, `prebuild-install` will download a suitable prebuilt binary, or exit with a non-zero exit code if there is none, which triggers `node-gyp rebuild` in order to build from source.
|
|
44
|
+
|
|
45
|
+
Options (see below) can be passed to `prebuild-install` like so:
|
|
46
|
+
|
|
47
|
+
```json
|
|
48
|
+
{
|
|
49
|
+
"scripts": {
|
|
50
|
+
"install": "prebuild-install -r napi || node-gyp rebuild"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
43
55
|
### Help
|
|
44
56
|
|
|
45
57
|
```
|
|
@@ -134,6 +146,14 @@ All prebuilt binaries are cached to minimize traffic. So first `prebuild-install
|
|
|
134
146
|
- `${APP_DATA}/npm-cache/_prebuilds`
|
|
135
147
|
- `${HOME}/.npm/_prebuilds`
|
|
136
148
|
|
|
149
|
+
## Install
|
|
150
|
+
|
|
151
|
+
With [npm](https://npmjs.org) do:
|
|
152
|
+
|
|
153
|
+
```
|
|
154
|
+
npm install prebuild-install
|
|
155
|
+
```
|
|
156
|
+
|
|
137
157
|
## License
|
|
138
158
|
|
|
139
|
-
MIT
|
|
159
|
+
[MIT](./LICENSE)
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
const get = require('simple-get')
|
|
2
|
+
const util = require('./util')
|
|
3
|
+
const proxy = require('./proxy')
|
|
4
4
|
|
|
5
5
|
function findAssetId (opts, cb) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
const downloadUrl = util.getDownloadUrl(opts)
|
|
7
|
+
const apiUrl = util.getApiUrl(opts)
|
|
8
|
+
const log = opts.log || util.noopLogger
|
|
9
9
|
|
|
10
10
|
log.http('request', 'GET ' + apiUrl)
|
|
11
|
-
|
|
11
|
+
const reqOpts = proxy({
|
|
12
12
|
url: apiUrl,
|
|
13
13
|
json: true,
|
|
14
14
|
headers: {
|
|
@@ -17,15 +17,15 @@ function findAssetId (opts, cb) {
|
|
|
17
17
|
}
|
|
18
18
|
}, opts)
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
const req = get.concat(reqOpts, function (err, res, data) {
|
|
21
21
|
if (err) return cb(err)
|
|
22
22
|
log.http(res.statusCode, apiUrl)
|
|
23
23
|
if (res.statusCode !== 200) return cb(err)
|
|
24
24
|
|
|
25
25
|
// Find asset id in release
|
|
26
|
-
for (
|
|
26
|
+
for (const release of data) {
|
|
27
27
|
if (release.tag_name === opts['tag-prefix'] + opts.pkg.version) {
|
|
28
|
-
for (
|
|
28
|
+
for (const asset of release.assets) {
|
|
29
29
|
if (asset.browser_download_url === downloadUrl) {
|
|
30
30
|
return cb(null, asset.id)
|
|
31
31
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
const path = require('path')
|
|
4
|
+
const fs = require('fs')
|
|
5
|
+
const napi = require('napi-build-utils')
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
const pkg = require(path.resolve('package.json'))
|
|
8
|
+
const rc = require('./rc')(pkg)
|
|
9
|
+
const log = require('./log')(rc, process.env)
|
|
10
|
+
const download = require('./download')
|
|
11
|
+
const asset = require('./asset')
|
|
12
|
+
const util = require('./util')
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
const prebuildClientVersion = require('./package.json').version
|
|
15
15
|
if (rc.version) {
|
|
16
16
|
console.log(prebuildClientVersion)
|
|
17
17
|
process.exit(0)
|
|
@@ -37,11 +37,11 @@ if (rc.help) {
|
|
|
37
37
|
|
|
38
38
|
log.info('begin', 'Prebuild-install version', prebuildClientVersion)
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
const opts = Object.assign({}, rc, { pkg: pkg, log: log })
|
|
41
41
|
|
|
42
42
|
if (napi.isNapiRuntime(rc.runtime)) napi.logUnsupportedVersion(rc.target, log)
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
const origin = util.packageOrigin(process.env, pkg)
|
|
45
45
|
|
|
46
46
|
if (opts.force) {
|
|
47
47
|
log.warn('install', 'prebuilt binaries enforced with --force!')
|
|
@@ -54,7 +54,7 @@ if (opts.force) {
|
|
|
54
54
|
process.exit(1)
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
const startDownload = function (downloadUrl) {
|
|
58
58
|
download(downloadUrl, opts, function (err) {
|
|
59
59
|
if (err) {
|
|
60
60
|
log.warn('install', err.message)
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
const path = require('path')
|
|
2
|
+
const fs = require('fs')
|
|
3
|
+
const get = require('simple-get')
|
|
4
|
+
const pump = require('pump')
|
|
5
|
+
const tfs = require('tar-fs')
|
|
6
|
+
const zlib = require('zlib')
|
|
7
|
+
const util = require('./util')
|
|
8
|
+
const error = require('./error')
|
|
9
|
+
const proxy = require('./proxy')
|
|
10
|
+
const mkdirp = require('mkdirp-classic')
|
|
11
11
|
|
|
12
12
|
function downloadPrebuild (downloadUrl, opts, cb) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
let cachedPrebuild = util.cachedPrebuild(downloadUrl)
|
|
14
|
+
const localPrebuild = util.localPrebuild(downloadUrl, opts)
|
|
15
|
+
const tempFile = util.tempFile(cachedPrebuild)
|
|
16
|
+
const log = opts.log || util.noopLogger
|
|
17
17
|
|
|
18
18
|
if (opts.nolocal) return download()
|
|
19
19
|
|
|
@@ -40,7 +40,7 @@ function downloadPrebuild (downloadUrl, opts, cb) {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
log.http('request', 'GET ' + downloadUrl)
|
|
43
|
-
|
|
43
|
+
const reqOpts = proxy({ url: downloadUrl }, opts)
|
|
44
44
|
|
|
45
45
|
if (opts.token) {
|
|
46
46
|
reqOpts.headers = {
|
|
@@ -50,7 +50,7 @@ function downloadPrebuild (downloadUrl, opts, cb) {
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
const req = get(reqOpts, function (err, res) {
|
|
54
54
|
if (err) return onerror(err)
|
|
55
55
|
log.http(res.statusCode, downloadUrl)
|
|
56
56
|
if (res.statusCode !== 200) return onerror()
|
|
@@ -81,26 +81,26 @@ function downloadPrebuild (downloadUrl, opts, cb) {
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
function unpack () {
|
|
84
|
-
|
|
84
|
+
let binaryName
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
const updateName = opts.updateName || function (entry) {
|
|
87
87
|
if (/\.node$/i.test(entry.name)) binaryName = entry.name
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
log.info('unpacking @', cachedPrebuild)
|
|
91
91
|
|
|
92
|
-
|
|
92
|
+
const options = {
|
|
93
93
|
readable: true,
|
|
94
94
|
writable: true,
|
|
95
95
|
hardlinkAsFilesFallback: true
|
|
96
96
|
}
|
|
97
|
-
|
|
97
|
+
const extract = tfs.extract(opts.path, options).on('entry', updateName)
|
|
98
98
|
|
|
99
99
|
pump(fs.createReadStream(cachedPrebuild), zlib.createGunzip(), extract,
|
|
100
100
|
function (err) {
|
|
101
101
|
if (err) return cb(err)
|
|
102
102
|
|
|
103
|
-
|
|
103
|
+
let resolved
|
|
104
104
|
if (binaryName) {
|
|
105
105
|
try {
|
|
106
106
|
resolved = path.resolve(opts.path || '.', binaryName)
|
|
@@ -124,7 +124,7 @@ function downloadPrebuild (downloadUrl, opts, cb) {
|
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
function ensureNpmCacheDir (cb) {
|
|
127
|
-
|
|
127
|
+
const cacheFolder = util.npmCache()
|
|
128
128
|
fs.access(cacheFolder, fs.R_OK | fs.W_OK, function (err) {
|
|
129
129
|
if (err && err.code === 'ENOENT') {
|
|
130
130
|
return makeNpmCacheDir()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
const log = require('npmlog')
|
|
2
|
+
const fs = require('fs')
|
|
3
|
+
const path = require('path')
|
|
4
4
|
|
|
5
5
|
module.exports = function (rc, env) {
|
|
6
6
|
log.heading = 'prebuild-install'
|
|
@@ -13,7 +13,7 @@ module.exports = function (rc, env) {
|
|
|
13
13
|
|
|
14
14
|
// Temporary workaround for npm 7 which swallows our output
|
|
15
15
|
if (process.env.npm_config_prebuild_install_logfile) {
|
|
16
|
-
|
|
16
|
+
const fp = path.resolve(process.env.npm_config_prebuild_install_logfile)
|
|
17
17
|
|
|
18
18
|
log.on('log', function (msg) {
|
|
19
19
|
// Only for tests, don't care about performance
|