@shined/doctor-binding 0.1.2-canary.2 → 0.1.2-canary.3
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/index.js +195 -31
- package/package.json +9 -9
package/index.js
CHANGED
|
@@ -66,7 +66,7 @@ const isMuslFromChildProcess = () => {
|
|
|
66
66
|
function requireNative() {
|
|
67
67
|
if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) {
|
|
68
68
|
try {
|
|
69
|
-
|
|
69
|
+
return require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH);
|
|
70
70
|
} catch (err) {
|
|
71
71
|
loadErrors.push(err)
|
|
72
72
|
}
|
|
@@ -78,7 +78,12 @@ function requireNative() {
|
|
|
78
78
|
loadErrors.push(e)
|
|
79
79
|
}
|
|
80
80
|
try {
|
|
81
|
-
|
|
81
|
+
const binding = require('@shined/doctor-binding-android-arm64')
|
|
82
|
+
const bindingPackageVersion = require('@shined/doctor-binding-android-arm64/package.json').version
|
|
83
|
+
if (bindingPackageVersion !== '0.1.2-canary.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
84
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.2-canary.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
85
|
+
}
|
|
86
|
+
return binding
|
|
82
87
|
} catch (e) {
|
|
83
88
|
loadErrors.push(e)
|
|
84
89
|
}
|
|
@@ -89,7 +94,12 @@ function requireNative() {
|
|
|
89
94
|
loadErrors.push(e)
|
|
90
95
|
}
|
|
91
96
|
try {
|
|
92
|
-
|
|
97
|
+
const binding = require('@shined/doctor-binding-android-arm-eabi')
|
|
98
|
+
const bindingPackageVersion = require('@shined/doctor-binding-android-arm-eabi/package.json').version
|
|
99
|
+
if (bindingPackageVersion !== '0.1.2-canary.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
100
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.2-canary.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
101
|
+
}
|
|
102
|
+
return binding
|
|
93
103
|
} catch (e) {
|
|
94
104
|
loadErrors.push(e)
|
|
95
105
|
}
|
|
@@ -104,7 +114,12 @@ function requireNative() {
|
|
|
104
114
|
loadErrors.push(e)
|
|
105
115
|
}
|
|
106
116
|
try {
|
|
107
|
-
|
|
117
|
+
const binding = require('@shined/doctor-binding-win32-x64-msvc')
|
|
118
|
+
const bindingPackageVersion = require('@shined/doctor-binding-win32-x64-msvc/package.json').version
|
|
119
|
+
if (bindingPackageVersion !== '0.1.2-canary.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
120
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.2-canary.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
121
|
+
}
|
|
122
|
+
return binding
|
|
108
123
|
} catch (e) {
|
|
109
124
|
loadErrors.push(e)
|
|
110
125
|
}
|
|
@@ -115,7 +130,12 @@ function requireNative() {
|
|
|
115
130
|
loadErrors.push(e)
|
|
116
131
|
}
|
|
117
132
|
try {
|
|
118
|
-
|
|
133
|
+
const binding = require('@shined/doctor-binding-win32-ia32-msvc')
|
|
134
|
+
const bindingPackageVersion = require('@shined/doctor-binding-win32-ia32-msvc/package.json').version
|
|
135
|
+
if (bindingPackageVersion !== '0.1.2-canary.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
136
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.2-canary.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
137
|
+
}
|
|
138
|
+
return binding
|
|
119
139
|
} catch (e) {
|
|
120
140
|
loadErrors.push(e)
|
|
121
141
|
}
|
|
@@ -126,7 +146,12 @@ function requireNative() {
|
|
|
126
146
|
loadErrors.push(e)
|
|
127
147
|
}
|
|
128
148
|
try {
|
|
129
|
-
|
|
149
|
+
const binding = require('@shined/doctor-binding-win32-arm64-msvc')
|
|
150
|
+
const bindingPackageVersion = require('@shined/doctor-binding-win32-arm64-msvc/package.json').version
|
|
151
|
+
if (bindingPackageVersion !== '0.1.2-canary.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
152
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.2-canary.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
153
|
+
}
|
|
154
|
+
return binding
|
|
130
155
|
} catch (e) {
|
|
131
156
|
loadErrors.push(e)
|
|
132
157
|
}
|
|
@@ -140,7 +165,12 @@ function requireNative() {
|
|
|
140
165
|
loadErrors.push(e)
|
|
141
166
|
}
|
|
142
167
|
try {
|
|
143
|
-
|
|
168
|
+
const binding = require('@shined/doctor-binding-darwin-universal')
|
|
169
|
+
const bindingPackageVersion = require('@shined/doctor-binding-darwin-universal/package.json').version
|
|
170
|
+
if (bindingPackageVersion !== '0.1.2-canary.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
171
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.2-canary.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
172
|
+
}
|
|
173
|
+
return binding
|
|
144
174
|
} catch (e) {
|
|
145
175
|
loadErrors.push(e)
|
|
146
176
|
}
|
|
@@ -151,7 +181,12 @@ function requireNative() {
|
|
|
151
181
|
loadErrors.push(e)
|
|
152
182
|
}
|
|
153
183
|
try {
|
|
154
|
-
|
|
184
|
+
const binding = require('@shined/doctor-binding-darwin-x64')
|
|
185
|
+
const bindingPackageVersion = require('@shined/doctor-binding-darwin-x64/package.json').version
|
|
186
|
+
if (bindingPackageVersion !== '0.1.2-canary.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
187
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.2-canary.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
188
|
+
}
|
|
189
|
+
return binding
|
|
155
190
|
} catch (e) {
|
|
156
191
|
loadErrors.push(e)
|
|
157
192
|
}
|
|
@@ -162,7 +197,12 @@ function requireNative() {
|
|
|
162
197
|
loadErrors.push(e)
|
|
163
198
|
}
|
|
164
199
|
try {
|
|
165
|
-
|
|
200
|
+
const binding = require('@shined/doctor-binding-darwin-arm64')
|
|
201
|
+
const bindingPackageVersion = require('@shined/doctor-binding-darwin-arm64/package.json').version
|
|
202
|
+
if (bindingPackageVersion !== '0.1.2-canary.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
203
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.2-canary.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
204
|
+
}
|
|
205
|
+
return binding
|
|
166
206
|
} catch (e) {
|
|
167
207
|
loadErrors.push(e)
|
|
168
208
|
}
|
|
@@ -177,7 +217,12 @@ function requireNative() {
|
|
|
177
217
|
loadErrors.push(e)
|
|
178
218
|
}
|
|
179
219
|
try {
|
|
180
|
-
|
|
220
|
+
const binding = require('@shined/doctor-binding-freebsd-x64')
|
|
221
|
+
const bindingPackageVersion = require('@shined/doctor-binding-freebsd-x64/package.json').version
|
|
222
|
+
if (bindingPackageVersion !== '0.1.2-canary.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
223
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.2-canary.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
224
|
+
}
|
|
225
|
+
return binding
|
|
181
226
|
} catch (e) {
|
|
182
227
|
loadErrors.push(e)
|
|
183
228
|
}
|
|
@@ -188,7 +233,12 @@ function requireNative() {
|
|
|
188
233
|
loadErrors.push(e)
|
|
189
234
|
}
|
|
190
235
|
try {
|
|
191
|
-
|
|
236
|
+
const binding = require('@shined/doctor-binding-freebsd-arm64')
|
|
237
|
+
const bindingPackageVersion = require('@shined/doctor-binding-freebsd-arm64/package.json').version
|
|
238
|
+
if (bindingPackageVersion !== '0.1.2-canary.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
239
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.2-canary.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
240
|
+
}
|
|
241
|
+
return binding
|
|
192
242
|
} catch (e) {
|
|
193
243
|
loadErrors.push(e)
|
|
194
244
|
}
|
|
@@ -204,7 +254,12 @@ function requireNative() {
|
|
|
204
254
|
loadErrors.push(e)
|
|
205
255
|
}
|
|
206
256
|
try {
|
|
207
|
-
|
|
257
|
+
const binding = require('@shined/doctor-binding-linux-x64-musl')
|
|
258
|
+
const bindingPackageVersion = require('@shined/doctor-binding-linux-x64-musl/package.json').version
|
|
259
|
+
if (bindingPackageVersion !== '0.1.2-canary.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
260
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.2-canary.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
261
|
+
}
|
|
262
|
+
return binding
|
|
208
263
|
} catch (e) {
|
|
209
264
|
loadErrors.push(e)
|
|
210
265
|
}
|
|
@@ -215,7 +270,12 @@ function requireNative() {
|
|
|
215
270
|
loadErrors.push(e)
|
|
216
271
|
}
|
|
217
272
|
try {
|
|
218
|
-
|
|
273
|
+
const binding = require('@shined/doctor-binding-linux-x64-gnu')
|
|
274
|
+
const bindingPackageVersion = require('@shined/doctor-binding-linux-x64-gnu/package.json').version
|
|
275
|
+
if (bindingPackageVersion !== '0.1.2-canary.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
276
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.2-canary.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
277
|
+
}
|
|
278
|
+
return binding
|
|
219
279
|
} catch (e) {
|
|
220
280
|
loadErrors.push(e)
|
|
221
281
|
}
|
|
@@ -228,7 +288,12 @@ function requireNative() {
|
|
|
228
288
|
loadErrors.push(e)
|
|
229
289
|
}
|
|
230
290
|
try {
|
|
231
|
-
|
|
291
|
+
const binding = require('@shined/doctor-binding-linux-arm64-musl')
|
|
292
|
+
const bindingPackageVersion = require('@shined/doctor-binding-linux-arm64-musl/package.json').version
|
|
293
|
+
if (bindingPackageVersion !== '0.1.2-canary.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
294
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.2-canary.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
295
|
+
}
|
|
296
|
+
return binding
|
|
232
297
|
} catch (e) {
|
|
233
298
|
loadErrors.push(e)
|
|
234
299
|
}
|
|
@@ -239,7 +304,12 @@ function requireNative() {
|
|
|
239
304
|
loadErrors.push(e)
|
|
240
305
|
}
|
|
241
306
|
try {
|
|
242
|
-
|
|
307
|
+
const binding = require('@shined/doctor-binding-linux-arm64-gnu')
|
|
308
|
+
const bindingPackageVersion = require('@shined/doctor-binding-linux-arm64-gnu/package.json').version
|
|
309
|
+
if (bindingPackageVersion !== '0.1.2-canary.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
310
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.2-canary.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
311
|
+
}
|
|
312
|
+
return binding
|
|
243
313
|
} catch (e) {
|
|
244
314
|
loadErrors.push(e)
|
|
245
315
|
}
|
|
@@ -252,7 +322,12 @@ function requireNative() {
|
|
|
252
322
|
loadErrors.push(e)
|
|
253
323
|
}
|
|
254
324
|
try {
|
|
255
|
-
|
|
325
|
+
const binding = require('@shined/doctor-binding-linux-arm-musleabihf')
|
|
326
|
+
const bindingPackageVersion = require('@shined/doctor-binding-linux-arm-musleabihf/package.json').version
|
|
327
|
+
if (bindingPackageVersion !== '0.1.2-canary.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
328
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.2-canary.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
329
|
+
}
|
|
330
|
+
return binding
|
|
256
331
|
} catch (e) {
|
|
257
332
|
loadErrors.push(e)
|
|
258
333
|
}
|
|
@@ -263,7 +338,46 @@ function requireNative() {
|
|
|
263
338
|
loadErrors.push(e)
|
|
264
339
|
}
|
|
265
340
|
try {
|
|
266
|
-
|
|
341
|
+
const binding = require('@shined/doctor-binding-linux-arm-gnueabihf')
|
|
342
|
+
const bindingPackageVersion = require('@shined/doctor-binding-linux-arm-gnueabihf/package.json').version
|
|
343
|
+
if (bindingPackageVersion !== '0.1.2-canary.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
344
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.2-canary.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
345
|
+
}
|
|
346
|
+
return binding
|
|
347
|
+
} catch (e) {
|
|
348
|
+
loadErrors.push(e)
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
} else if (process.arch === 'loong64') {
|
|
352
|
+
if (isMusl()) {
|
|
353
|
+
try {
|
|
354
|
+
return require('./doctor-binding.linux-loong64-musl.node')
|
|
355
|
+
} catch (e) {
|
|
356
|
+
loadErrors.push(e)
|
|
357
|
+
}
|
|
358
|
+
try {
|
|
359
|
+
const binding = require('@shined/doctor-binding-linux-loong64-musl')
|
|
360
|
+
const bindingPackageVersion = require('@shined/doctor-binding-linux-loong64-musl/package.json').version
|
|
361
|
+
if (bindingPackageVersion !== '0.1.2-canary.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
362
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.2-canary.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
363
|
+
}
|
|
364
|
+
return binding
|
|
365
|
+
} catch (e) {
|
|
366
|
+
loadErrors.push(e)
|
|
367
|
+
}
|
|
368
|
+
} else {
|
|
369
|
+
try {
|
|
370
|
+
return require('./doctor-binding.linux-loong64-gnu.node')
|
|
371
|
+
} catch (e) {
|
|
372
|
+
loadErrors.push(e)
|
|
373
|
+
}
|
|
374
|
+
try {
|
|
375
|
+
const binding = require('@shined/doctor-binding-linux-loong64-gnu')
|
|
376
|
+
const bindingPackageVersion = require('@shined/doctor-binding-linux-loong64-gnu/package.json').version
|
|
377
|
+
if (bindingPackageVersion !== '0.1.2-canary.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
378
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.2-canary.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
379
|
+
}
|
|
380
|
+
return binding
|
|
267
381
|
} catch (e) {
|
|
268
382
|
loadErrors.push(e)
|
|
269
383
|
}
|
|
@@ -276,7 +390,12 @@ function requireNative() {
|
|
|
276
390
|
loadErrors.push(e)
|
|
277
391
|
}
|
|
278
392
|
try {
|
|
279
|
-
|
|
393
|
+
const binding = require('@shined/doctor-binding-linux-riscv64-musl')
|
|
394
|
+
const bindingPackageVersion = require('@shined/doctor-binding-linux-riscv64-musl/package.json').version
|
|
395
|
+
if (bindingPackageVersion !== '0.1.2-canary.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
396
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.2-canary.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
397
|
+
}
|
|
398
|
+
return binding
|
|
280
399
|
} catch (e) {
|
|
281
400
|
loadErrors.push(e)
|
|
282
401
|
}
|
|
@@ -287,7 +406,12 @@ function requireNative() {
|
|
|
287
406
|
loadErrors.push(e)
|
|
288
407
|
}
|
|
289
408
|
try {
|
|
290
|
-
|
|
409
|
+
const binding = require('@shined/doctor-binding-linux-riscv64-gnu')
|
|
410
|
+
const bindingPackageVersion = require('@shined/doctor-binding-linux-riscv64-gnu/package.json').version
|
|
411
|
+
if (bindingPackageVersion !== '0.1.2-canary.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
412
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.2-canary.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
413
|
+
}
|
|
414
|
+
return binding
|
|
291
415
|
} catch (e) {
|
|
292
416
|
loadErrors.push(e)
|
|
293
417
|
}
|
|
@@ -299,7 +423,12 @@ function requireNative() {
|
|
|
299
423
|
loadErrors.push(e)
|
|
300
424
|
}
|
|
301
425
|
try {
|
|
302
|
-
|
|
426
|
+
const binding = require('@shined/doctor-binding-linux-ppc64-gnu')
|
|
427
|
+
const bindingPackageVersion = require('@shined/doctor-binding-linux-ppc64-gnu/package.json').version
|
|
428
|
+
if (bindingPackageVersion !== '0.1.2-canary.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
429
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.2-canary.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
430
|
+
}
|
|
431
|
+
return binding
|
|
303
432
|
} catch (e) {
|
|
304
433
|
loadErrors.push(e)
|
|
305
434
|
}
|
|
@@ -310,7 +439,12 @@ function requireNative() {
|
|
|
310
439
|
loadErrors.push(e)
|
|
311
440
|
}
|
|
312
441
|
try {
|
|
313
|
-
|
|
442
|
+
const binding = require('@shined/doctor-binding-linux-s390x-gnu')
|
|
443
|
+
const bindingPackageVersion = require('@shined/doctor-binding-linux-s390x-gnu/package.json').version
|
|
444
|
+
if (bindingPackageVersion !== '0.1.2-canary.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
445
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.2-canary.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
446
|
+
}
|
|
447
|
+
return binding
|
|
314
448
|
} catch (e) {
|
|
315
449
|
loadErrors.push(e)
|
|
316
450
|
}
|
|
@@ -320,34 +454,49 @@ function requireNative() {
|
|
|
320
454
|
} else if (process.platform === 'openharmony') {
|
|
321
455
|
if (process.arch === 'arm64') {
|
|
322
456
|
try {
|
|
323
|
-
return require('./doctor-binding.
|
|
457
|
+
return require('./doctor-binding.openharmony-arm64.node')
|
|
324
458
|
} catch (e) {
|
|
325
459
|
loadErrors.push(e)
|
|
326
460
|
}
|
|
327
461
|
try {
|
|
328
|
-
|
|
462
|
+
const binding = require('@shined/doctor-binding-openharmony-arm64')
|
|
463
|
+
const bindingPackageVersion = require('@shined/doctor-binding-openharmony-arm64/package.json').version
|
|
464
|
+
if (bindingPackageVersion !== '0.1.2-canary.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
465
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.2-canary.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
466
|
+
}
|
|
467
|
+
return binding
|
|
329
468
|
} catch (e) {
|
|
330
469
|
loadErrors.push(e)
|
|
331
470
|
}
|
|
332
471
|
} else if (process.arch === 'x64') {
|
|
333
472
|
try {
|
|
334
|
-
return require('./doctor-binding.
|
|
473
|
+
return require('./doctor-binding.openharmony-x64.node')
|
|
335
474
|
} catch (e) {
|
|
336
475
|
loadErrors.push(e)
|
|
337
476
|
}
|
|
338
477
|
try {
|
|
339
|
-
|
|
478
|
+
const binding = require('@shined/doctor-binding-openharmony-x64')
|
|
479
|
+
const bindingPackageVersion = require('@shined/doctor-binding-openharmony-x64/package.json').version
|
|
480
|
+
if (bindingPackageVersion !== '0.1.2-canary.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
481
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.2-canary.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
482
|
+
}
|
|
483
|
+
return binding
|
|
340
484
|
} catch (e) {
|
|
341
485
|
loadErrors.push(e)
|
|
342
486
|
}
|
|
343
487
|
} else if (process.arch === 'arm') {
|
|
344
488
|
try {
|
|
345
|
-
return require('./doctor-binding.
|
|
489
|
+
return require('./doctor-binding.openharmony-arm.node')
|
|
346
490
|
} catch (e) {
|
|
347
491
|
loadErrors.push(e)
|
|
348
492
|
}
|
|
349
493
|
try {
|
|
350
|
-
|
|
494
|
+
const binding = require('@shined/doctor-binding-openharmony-arm')
|
|
495
|
+
const bindingPackageVersion = require('@shined/doctor-binding-openharmony-arm/package.json').version
|
|
496
|
+
if (bindingPackageVersion !== '0.1.2-canary.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
497
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.2-canary.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
498
|
+
}
|
|
499
|
+
return binding
|
|
351
500
|
} catch (e) {
|
|
352
501
|
loadErrors.push(e)
|
|
353
502
|
}
|
|
@@ -362,22 +511,32 @@ function requireNative() {
|
|
|
362
511
|
nativeBinding = requireNative()
|
|
363
512
|
|
|
364
513
|
if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
|
|
514
|
+
let wasiBinding = null
|
|
515
|
+
let wasiBindingError = null
|
|
365
516
|
try {
|
|
366
|
-
|
|
517
|
+
wasiBinding = require('./doctor-binding.wasi.cjs')
|
|
518
|
+
nativeBinding = wasiBinding
|
|
367
519
|
} catch (err) {
|
|
368
520
|
if (process.env.NAPI_RS_FORCE_WASI) {
|
|
369
|
-
|
|
521
|
+
wasiBindingError = err
|
|
370
522
|
}
|
|
371
523
|
}
|
|
372
524
|
if (!nativeBinding) {
|
|
373
525
|
try {
|
|
374
|
-
|
|
526
|
+
wasiBinding = require('@shined/doctor-binding-wasm32-wasi')
|
|
527
|
+
nativeBinding = wasiBinding
|
|
375
528
|
} catch (err) {
|
|
376
529
|
if (process.env.NAPI_RS_FORCE_WASI) {
|
|
530
|
+
wasiBindingError.cause = err
|
|
377
531
|
loadErrors.push(err)
|
|
378
532
|
}
|
|
379
533
|
}
|
|
380
534
|
}
|
|
535
|
+
if (process.env.NAPI_RS_FORCE_WASI === 'error' && !wasiBinding) {
|
|
536
|
+
const error = new Error('WASI binding not found and NAPI_RS_FORCE_WASI is set to error')
|
|
537
|
+
error.cause = wasiBindingError
|
|
538
|
+
throw error
|
|
539
|
+
}
|
|
381
540
|
}
|
|
382
541
|
|
|
383
542
|
if (!nativeBinding) {
|
|
@@ -386,7 +545,12 @@ if (!nativeBinding) {
|
|
|
386
545
|
`Cannot find native binding. ` +
|
|
387
546
|
`npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). ` +
|
|
388
547
|
'Please try `npm i` again after removing both package-lock.json and node_modules directory.',
|
|
389
|
-
{
|
|
548
|
+
{
|
|
549
|
+
cause: loadErrors.reduce((err, cur) => {
|
|
550
|
+
cur.cause = err
|
|
551
|
+
return cur
|
|
552
|
+
}),
|
|
553
|
+
},
|
|
390
554
|
)
|
|
391
555
|
}
|
|
392
556
|
throw new Error(`Failed to load native binding`)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shined/doctor-binding",
|
|
3
|
-
"version": "0.1.2-canary.
|
|
3
|
+
"version": "0.1.2-canary.3",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"repository": {
|
|
@@ -20,13 +20,13 @@
|
|
|
20
20
|
},
|
|
21
21
|
"homepage": "https://github.com/sheinsight/doctor-engine#readme",
|
|
22
22
|
"optionalDependencies": {
|
|
23
|
-
"@shined/doctor-binding-darwin-x64": "0.1.2-canary.
|
|
24
|
-
"@shined/doctor-binding-darwin-arm64": "0.1.2-canary.
|
|
25
|
-
"@shined/doctor-binding-win32-x64-msvc": "0.1.2-canary.
|
|
26
|
-
"@shined/doctor-binding-win32-arm64-msvc": "0.1.2-canary.
|
|
27
|
-
"@shined/doctor-binding-linux-x64-gnu": "0.1.2-canary.
|
|
28
|
-
"@shined/doctor-binding-linux-x64-musl": "0.1.2-canary.
|
|
29
|
-
"@shined/doctor-binding-linux-arm64-gnu": "0.1.2-canary.
|
|
30
|
-
"@shined/doctor-binding-linux-arm64-musl": "0.1.2-canary.
|
|
23
|
+
"@shined/doctor-binding-darwin-x64": "0.1.2-canary.3",
|
|
24
|
+
"@shined/doctor-binding-darwin-arm64": "0.1.2-canary.3",
|
|
25
|
+
"@shined/doctor-binding-win32-x64-msvc": "0.1.2-canary.3",
|
|
26
|
+
"@shined/doctor-binding-win32-arm64-msvc": "0.1.2-canary.3",
|
|
27
|
+
"@shined/doctor-binding-linux-x64-gnu": "0.1.2-canary.3",
|
|
28
|
+
"@shined/doctor-binding-linux-x64-musl": "0.1.2-canary.3",
|
|
29
|
+
"@shined/doctor-binding-linux-arm64-gnu": "0.1.2-canary.3",
|
|
30
|
+
"@shined/doctor-binding-linux-arm64-musl": "0.1.2-canary.3"
|
|
31
31
|
}
|
|
32
32
|
}
|