@unownplain/anthelion-komac 0.0.73 → 0.0.76
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 +112 -55
- package/package.json +10 -10
package/index.js
CHANGED
|
@@ -9,8 +9,13 @@ const { readFileSync } = require('fs')
|
|
|
9
9
|
let nativeBinding = null
|
|
10
10
|
// Which artifact actually loaded. The WASI fallback chain overwrites it with
|
|
11
11
|
// the flavor it resolved; the late native retry below leaves it alone because
|
|
12
|
-
// it only runs while no WASI candidate has been loaded.
|
|
12
|
+
// it only runs while no WASI candidate has been loaded. The take-over check
|
|
13
|
+
// after the load-failure block can also set it.
|
|
13
14
|
let __napiLoadedBindingTarget = 'native'
|
|
15
|
+
// What this loader's own `requireNative()` calls returned. The check after
|
|
16
|
+
// the load-failure block compares it with `nativeBinding` to tell a binding
|
|
17
|
+
// this loader loaded from one that code outside it put in its place.
|
|
18
|
+
let __napiRequiredNativeBinding = null
|
|
14
19
|
const loadErrors = []
|
|
15
20
|
|
|
16
21
|
const isMusl = () => {
|
|
@@ -92,8 +97,8 @@ function requireNative() {
|
|
|
92
97
|
try {
|
|
93
98
|
const binding = require('@unownplain/anthelion-komac-android-arm64')
|
|
94
99
|
const bindingPackageVersion = require('@unownplain/anthelion-komac-android-arm64/package.json').version
|
|
95
|
-
if (bindingPackageVersion !== '0.0.
|
|
96
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
100
|
+
if (bindingPackageVersion !== '0.0.76' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
101
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.76 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
97
102
|
}
|
|
98
103
|
return binding
|
|
99
104
|
} catch (e) {
|
|
@@ -108,8 +113,8 @@ function requireNative() {
|
|
|
108
113
|
try {
|
|
109
114
|
const binding = require('@unownplain/anthelion-komac-android-arm-eabi')
|
|
110
115
|
const bindingPackageVersion = require('@unownplain/anthelion-komac-android-arm-eabi/package.json').version
|
|
111
|
-
if (bindingPackageVersion !== '0.0.
|
|
112
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
116
|
+
if (bindingPackageVersion !== '0.0.76' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
117
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.76 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
113
118
|
}
|
|
114
119
|
return binding
|
|
115
120
|
} catch (e) {
|
|
@@ -129,8 +134,8 @@ function requireNative() {
|
|
|
129
134
|
try {
|
|
130
135
|
const binding = require('@unownplain/anthelion-komac-win32-x64-gnu')
|
|
131
136
|
const bindingPackageVersion = require('@unownplain/anthelion-komac-win32-x64-gnu/package.json').version
|
|
132
|
-
if (bindingPackageVersion !== '0.0.
|
|
133
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
137
|
+
if (bindingPackageVersion !== '0.0.76' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
138
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.76 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
134
139
|
}
|
|
135
140
|
return binding
|
|
136
141
|
} catch (e) {
|
|
@@ -145,8 +150,8 @@ function requireNative() {
|
|
|
145
150
|
try {
|
|
146
151
|
const binding = require('@unownplain/anthelion-komac-win32-x64-msvc')
|
|
147
152
|
const bindingPackageVersion = require('@unownplain/anthelion-komac-win32-x64-msvc/package.json').version
|
|
148
|
-
if (bindingPackageVersion !== '0.0.
|
|
149
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
153
|
+
if (bindingPackageVersion !== '0.0.76' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
154
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.76 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
150
155
|
}
|
|
151
156
|
return binding
|
|
152
157
|
} catch (e) {
|
|
@@ -162,8 +167,8 @@ function requireNative() {
|
|
|
162
167
|
try {
|
|
163
168
|
const binding = require('@unownplain/anthelion-komac-win32-ia32-msvc')
|
|
164
169
|
const bindingPackageVersion = require('@unownplain/anthelion-komac-win32-ia32-msvc/package.json').version
|
|
165
|
-
if (bindingPackageVersion !== '0.0.
|
|
166
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
170
|
+
if (bindingPackageVersion !== '0.0.76' && 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.0.76 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
167
172
|
}
|
|
168
173
|
return binding
|
|
169
174
|
} catch (e) {
|
|
@@ -178,8 +183,8 @@ function requireNative() {
|
|
|
178
183
|
try {
|
|
179
184
|
const binding = require('@unownplain/anthelion-komac-win32-arm64-msvc')
|
|
180
185
|
const bindingPackageVersion = require('@unownplain/anthelion-komac-win32-arm64-msvc/package.json').version
|
|
181
|
-
if (bindingPackageVersion !== '0.0.
|
|
182
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
186
|
+
if (bindingPackageVersion !== '0.0.76' && 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.0.76 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
183
188
|
}
|
|
184
189
|
return binding
|
|
185
190
|
} catch (e) {
|
|
@@ -197,8 +202,8 @@ function requireNative() {
|
|
|
197
202
|
try {
|
|
198
203
|
const binding = require('@unownplain/anthelion-komac-darwin-universal')
|
|
199
204
|
const bindingPackageVersion = require('@unownplain/anthelion-komac-darwin-universal/package.json').version
|
|
200
|
-
if (bindingPackageVersion !== '0.0.
|
|
201
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
205
|
+
if (bindingPackageVersion !== '0.0.76' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
206
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.76 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
202
207
|
}
|
|
203
208
|
return binding
|
|
204
209
|
} catch (e) {
|
|
@@ -213,8 +218,8 @@ function requireNative() {
|
|
|
213
218
|
try {
|
|
214
219
|
const binding = require('@unownplain/anthelion-komac-darwin-x64')
|
|
215
220
|
const bindingPackageVersion = require('@unownplain/anthelion-komac-darwin-x64/package.json').version
|
|
216
|
-
if (bindingPackageVersion !== '0.0.
|
|
217
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
221
|
+
if (bindingPackageVersion !== '0.0.76' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
222
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.76 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
218
223
|
}
|
|
219
224
|
return binding
|
|
220
225
|
} catch (e) {
|
|
@@ -229,8 +234,8 @@ function requireNative() {
|
|
|
229
234
|
try {
|
|
230
235
|
const binding = require('@unownplain/anthelion-komac-darwin-arm64')
|
|
231
236
|
const bindingPackageVersion = require('@unownplain/anthelion-komac-darwin-arm64/package.json').version
|
|
232
|
-
if (bindingPackageVersion !== '0.0.
|
|
233
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
237
|
+
if (bindingPackageVersion !== '0.0.76' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
238
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.76 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
234
239
|
}
|
|
235
240
|
return binding
|
|
236
241
|
} catch (e) {
|
|
@@ -249,8 +254,8 @@ function requireNative() {
|
|
|
249
254
|
try {
|
|
250
255
|
const binding = require('@unownplain/anthelion-komac-freebsd-x64')
|
|
251
256
|
const bindingPackageVersion = require('@unownplain/anthelion-komac-freebsd-x64/package.json').version
|
|
252
|
-
if (bindingPackageVersion !== '0.0.
|
|
253
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
257
|
+
if (bindingPackageVersion !== '0.0.76' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
258
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.76 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
254
259
|
}
|
|
255
260
|
return binding
|
|
256
261
|
} catch (e) {
|
|
@@ -265,8 +270,24 @@ function requireNative() {
|
|
|
265
270
|
try {
|
|
266
271
|
const binding = require('@unownplain/anthelion-komac-freebsd-arm64')
|
|
267
272
|
const bindingPackageVersion = require('@unownplain/anthelion-komac-freebsd-arm64/package.json').version
|
|
268
|
-
if (bindingPackageVersion !== '0.0.
|
|
269
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
273
|
+
if (bindingPackageVersion !== '0.0.76' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
274
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.76 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
275
|
+
}
|
|
276
|
+
return binding
|
|
277
|
+
} catch (e) {
|
|
278
|
+
loadErrors.push(e)
|
|
279
|
+
}
|
|
280
|
+
} else if (process.arch === 'ppc64') {
|
|
281
|
+
try {
|
|
282
|
+
return require('./anthelion-komac.freebsd-ppc64.node')
|
|
283
|
+
} catch (e) {
|
|
284
|
+
loadErrors.push(e)
|
|
285
|
+
}
|
|
286
|
+
try {
|
|
287
|
+
const binding = require('@unownplain/anthelion-komac-freebsd-ppc64')
|
|
288
|
+
const bindingPackageVersion = require('@unownplain/anthelion-komac-freebsd-ppc64/package.json').version
|
|
289
|
+
if (bindingPackageVersion !== '0.0.76' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
290
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.76 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
270
291
|
}
|
|
271
292
|
return binding
|
|
272
293
|
} catch (e) {
|
|
@@ -286,8 +307,8 @@ function requireNative() {
|
|
|
286
307
|
try {
|
|
287
308
|
const binding = require('@unownplain/anthelion-komac-linux-x64-musl')
|
|
288
309
|
const bindingPackageVersion = require('@unownplain/anthelion-komac-linux-x64-musl/package.json').version
|
|
289
|
-
if (bindingPackageVersion !== '0.0.
|
|
290
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
310
|
+
if (bindingPackageVersion !== '0.0.76' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
311
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.76 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
291
312
|
}
|
|
292
313
|
return binding
|
|
293
314
|
} catch (e) {
|
|
@@ -302,8 +323,8 @@ function requireNative() {
|
|
|
302
323
|
try {
|
|
303
324
|
const binding = require('@unownplain/anthelion-komac-linux-x64-gnu')
|
|
304
325
|
const bindingPackageVersion = require('@unownplain/anthelion-komac-linux-x64-gnu/package.json').version
|
|
305
|
-
if (bindingPackageVersion !== '0.0.
|
|
306
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
326
|
+
if (bindingPackageVersion !== '0.0.76' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
327
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.76 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
307
328
|
}
|
|
308
329
|
return binding
|
|
309
330
|
} catch (e) {
|
|
@@ -320,8 +341,8 @@ function requireNative() {
|
|
|
320
341
|
try {
|
|
321
342
|
const binding = require('@unownplain/anthelion-komac-linux-arm64-musl')
|
|
322
343
|
const bindingPackageVersion = require('@unownplain/anthelion-komac-linux-arm64-musl/package.json').version
|
|
323
|
-
if (bindingPackageVersion !== '0.0.
|
|
324
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
344
|
+
if (bindingPackageVersion !== '0.0.76' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
345
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.76 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
325
346
|
}
|
|
326
347
|
return binding
|
|
327
348
|
} catch (e) {
|
|
@@ -336,8 +357,8 @@ function requireNative() {
|
|
|
336
357
|
try {
|
|
337
358
|
const binding = require('@unownplain/anthelion-komac-linux-arm64-gnu')
|
|
338
359
|
const bindingPackageVersion = require('@unownplain/anthelion-komac-linux-arm64-gnu/package.json').version
|
|
339
|
-
if (bindingPackageVersion !== '0.0.
|
|
340
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
360
|
+
if (bindingPackageVersion !== '0.0.76' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
361
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.76 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
341
362
|
}
|
|
342
363
|
return binding
|
|
343
364
|
} catch (e) {
|
|
@@ -354,8 +375,8 @@ function requireNative() {
|
|
|
354
375
|
try {
|
|
355
376
|
const binding = require('@unownplain/anthelion-komac-linux-arm-musleabihf')
|
|
356
377
|
const bindingPackageVersion = require('@unownplain/anthelion-komac-linux-arm-musleabihf/package.json').version
|
|
357
|
-
if (bindingPackageVersion !== '0.0.
|
|
358
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
378
|
+
if (bindingPackageVersion !== '0.0.76' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
379
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.76 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
359
380
|
}
|
|
360
381
|
return binding
|
|
361
382
|
} catch (e) {
|
|
@@ -370,8 +391,8 @@ function requireNative() {
|
|
|
370
391
|
try {
|
|
371
392
|
const binding = require('@unownplain/anthelion-komac-linux-arm-gnueabihf')
|
|
372
393
|
const bindingPackageVersion = require('@unownplain/anthelion-komac-linux-arm-gnueabihf/package.json').version
|
|
373
|
-
if (bindingPackageVersion !== '0.0.
|
|
374
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
394
|
+
if (bindingPackageVersion !== '0.0.76' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
395
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.76 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
375
396
|
}
|
|
376
397
|
return binding
|
|
377
398
|
} catch (e) {
|
|
@@ -388,8 +409,8 @@ function requireNative() {
|
|
|
388
409
|
try {
|
|
389
410
|
const binding = require('@unownplain/anthelion-komac-linux-loong64-musl')
|
|
390
411
|
const bindingPackageVersion = require('@unownplain/anthelion-komac-linux-loong64-musl/package.json').version
|
|
391
|
-
if (bindingPackageVersion !== '0.0.
|
|
392
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
412
|
+
if (bindingPackageVersion !== '0.0.76' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
413
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.76 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
393
414
|
}
|
|
394
415
|
return binding
|
|
395
416
|
} catch (e) {
|
|
@@ -404,8 +425,8 @@ function requireNative() {
|
|
|
404
425
|
try {
|
|
405
426
|
const binding = require('@unownplain/anthelion-komac-linux-loong64-gnu')
|
|
406
427
|
const bindingPackageVersion = require('@unownplain/anthelion-komac-linux-loong64-gnu/package.json').version
|
|
407
|
-
if (bindingPackageVersion !== '0.0.
|
|
408
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
428
|
+
if (bindingPackageVersion !== '0.0.76' && 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.0.76 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
409
430
|
}
|
|
410
431
|
return binding
|
|
411
432
|
} catch (e) {
|
|
@@ -422,8 +443,8 @@ function requireNative() {
|
|
|
422
443
|
try {
|
|
423
444
|
const binding = require('@unownplain/anthelion-komac-linux-riscv64-musl')
|
|
424
445
|
const bindingPackageVersion = require('@unownplain/anthelion-komac-linux-riscv64-musl/package.json').version
|
|
425
|
-
if (bindingPackageVersion !== '0.0.
|
|
426
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
446
|
+
if (bindingPackageVersion !== '0.0.76' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
447
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.76 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
427
448
|
}
|
|
428
449
|
return binding
|
|
429
450
|
} catch (e) {
|
|
@@ -438,8 +459,8 @@ function requireNative() {
|
|
|
438
459
|
try {
|
|
439
460
|
const binding = require('@unownplain/anthelion-komac-linux-riscv64-gnu')
|
|
440
461
|
const bindingPackageVersion = require('@unownplain/anthelion-komac-linux-riscv64-gnu/package.json').version
|
|
441
|
-
if (bindingPackageVersion !== '0.0.
|
|
442
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
462
|
+
if (bindingPackageVersion !== '0.0.76' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
463
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.76 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
443
464
|
}
|
|
444
465
|
return binding
|
|
445
466
|
} catch (e) {
|
|
@@ -455,8 +476,8 @@ function requireNative() {
|
|
|
455
476
|
try {
|
|
456
477
|
const binding = require('@unownplain/anthelion-komac-linux-ppc64-gnu')
|
|
457
478
|
const bindingPackageVersion = require('@unownplain/anthelion-komac-linux-ppc64-gnu/package.json').version
|
|
458
|
-
if (bindingPackageVersion !== '0.0.
|
|
459
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
479
|
+
if (bindingPackageVersion !== '0.0.76' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
480
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.76 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
460
481
|
}
|
|
461
482
|
return binding
|
|
462
483
|
} catch (e) {
|
|
@@ -471,8 +492,8 @@ function requireNative() {
|
|
|
471
492
|
try {
|
|
472
493
|
const binding = require('@unownplain/anthelion-komac-linux-s390x-gnu')
|
|
473
494
|
const bindingPackageVersion = require('@unownplain/anthelion-komac-linux-s390x-gnu/package.json').version
|
|
474
|
-
if (bindingPackageVersion !== '0.0.
|
|
475
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
495
|
+
if (bindingPackageVersion !== '0.0.76' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
496
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.76 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
476
497
|
}
|
|
477
498
|
return binding
|
|
478
499
|
} catch (e) {
|
|
@@ -491,8 +512,8 @@ function requireNative() {
|
|
|
491
512
|
try {
|
|
492
513
|
const binding = require('@unownplain/anthelion-komac-openharmony-arm64')
|
|
493
514
|
const bindingPackageVersion = require('@unownplain/anthelion-komac-openharmony-arm64/package.json').version
|
|
494
|
-
if (bindingPackageVersion !== '0.0.
|
|
495
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
515
|
+
if (bindingPackageVersion !== '0.0.76' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
516
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.76 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
496
517
|
}
|
|
497
518
|
return binding
|
|
498
519
|
} catch (e) {
|
|
@@ -507,8 +528,8 @@ function requireNative() {
|
|
|
507
528
|
try {
|
|
508
529
|
const binding = require('@unownplain/anthelion-komac-openharmony-x64')
|
|
509
530
|
const bindingPackageVersion = require('@unownplain/anthelion-komac-openharmony-x64/package.json').version
|
|
510
|
-
if (bindingPackageVersion !== '0.0.
|
|
511
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
531
|
+
if (bindingPackageVersion !== '0.0.76' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
532
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.76 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
512
533
|
}
|
|
513
534
|
return binding
|
|
514
535
|
} catch (e) {
|
|
@@ -523,8 +544,8 @@ function requireNative() {
|
|
|
523
544
|
try {
|
|
524
545
|
const binding = require('@unownplain/anthelion-komac-openharmony-arm')
|
|
525
546
|
const bindingPackageVersion = require('@unownplain/anthelion-komac-openharmony-arm/package.json').version
|
|
526
|
-
if (bindingPackageVersion !== '0.0.
|
|
527
|
-
throw new Error(`Native binding package version mismatch, expected 0.0.
|
|
547
|
+
if (bindingPackageVersion !== '0.0.76' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
548
|
+
throw new Error(`Native binding package version mismatch, expected 0.0.76 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
528
549
|
}
|
|
529
550
|
return binding
|
|
530
551
|
} catch (e) {
|
|
@@ -588,6 +609,7 @@ const forceWasi =
|
|
|
588
609
|
|
|
589
610
|
if (!forceWasi) {
|
|
590
611
|
nativeBinding = requireNative()
|
|
612
|
+
__napiRequiredNativeBinding = nativeBinding
|
|
591
613
|
}
|
|
592
614
|
|
|
593
615
|
if (!nativeBinding || forceWasi) {
|
|
@@ -664,8 +686,8 @@ if (!nativeBinding || forceWasi) {
|
|
|
664
686
|
if (!candidateFailed) {
|
|
665
687
|
if (process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
666
688
|
const bindingPackageVersion = require('@unownplain/anthelion-komac-wasm32-wasi/package.json').version
|
|
667
|
-
if (bindingPackageVersion !== '0.0.
|
|
668
|
-
throw new Error(`WASI binding package version mismatch, expected 0.0.
|
|
689
|
+
if (bindingPackageVersion !== '0.0.76') {
|
|
690
|
+
throw new Error(`WASI binding package version mismatch, expected 0.0.76 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
669
691
|
}
|
|
670
692
|
}
|
|
671
693
|
wasiBinding = require('@unownplain/anthelion-komac-wasm32-wasi')
|
|
@@ -689,6 +711,7 @@ if (!nativeBinding || forceWasi) {
|
|
|
689
711
|
!__napiWasiFlavorRequested
|
|
690
712
|
) {
|
|
691
713
|
nativeBinding = requireNative()
|
|
714
|
+
__napiRequiredNativeBinding = nativeBinding
|
|
692
715
|
}
|
|
693
716
|
if ((forceWasiError || __napiWasiFlavorRequested) && !wasiBindingLoaded) {
|
|
694
717
|
const error = new Error(
|
|
@@ -716,6 +739,40 @@ if (!nativeBinding) {
|
|
|
716
739
|
throw new Error(`Failed to load native binding`)
|
|
717
740
|
}
|
|
718
741
|
|
|
742
|
+
// A package can patch its own fallback in front of the load-failure check
|
|
743
|
+
// above, e.g. a WebContainer download through `napi-postinstall/fallback`.
|
|
744
|
+
// That fallback swaps `nativeBinding` for a generated WASI loader, which has
|
|
745
|
+
// already stamped its own flavor, while the target above still says 'native'.
|
|
746
|
+
// Take that flavor over, or the CommonJS stamp throws a conflict and the ESM
|
|
747
|
+
// export reports the wrong artifact. Three limits keep the conflict check:
|
|
748
|
+
// - only a binding this loader did not load itself, so a native addon whose
|
|
749
|
+
// `#[napi(module_exports)]` hook claims the name is still rejected;
|
|
750
|
+
// - only an own data property, read through its descriptor, so no addon
|
|
751
|
+
// getter runs here, and it must read back the same, as the stamp reads it;
|
|
752
|
+
// - only a flavor in `__napiWasiFlavors`, the ones this loader's own WASI
|
|
753
|
+
// chain can report ('wasm32-wasi' for a package without a WASI target).
|
|
754
|
+
// This is metadata and never fails a load: a throwing Proxy trap keeps 'native'.
|
|
755
|
+
if (
|
|
756
|
+
__napiLoadedBindingTarget === 'native' &&
|
|
757
|
+
nativeBinding !== __napiRequiredNativeBinding
|
|
758
|
+
) {
|
|
759
|
+
try {
|
|
760
|
+
const __napiBindingTargetDescriptor = Object.getOwnPropertyDescriptor(
|
|
761
|
+
nativeBinding,
|
|
762
|
+
'__napiBindingTarget',
|
|
763
|
+
)
|
|
764
|
+
if (
|
|
765
|
+
__napiBindingTargetDescriptor &&
|
|
766
|
+
__napiWasiFlavors.indexOf(__napiBindingTargetDescriptor.value) !== -1 &&
|
|
767
|
+
nativeBinding.__napiBindingTarget === __napiBindingTargetDescriptor.value
|
|
768
|
+
) {
|
|
769
|
+
__napiLoadedBindingTarget = __napiBindingTargetDescriptor.value
|
|
770
|
+
}
|
|
771
|
+
} catch {
|
|
772
|
+
// keep 'native'
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
|
|
719
776
|
const { Komac, parseYaml, releaseNotesToPlainText } = nativeBinding
|
|
720
777
|
export { Komac }
|
|
721
778
|
export { parseYaml }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unownplain/anthelion-komac",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.76",
|
|
4
4
|
"description": "komac JS bindings for Anthelion",
|
|
5
5
|
"license": "GPL-3.0-or-later",
|
|
6
6
|
"repository": {
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"version": "napi version"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@napi-rs/cli": "3.10.
|
|
25
|
+
"@napi-rs/cli": "3.10.9"
|
|
26
26
|
},
|
|
27
27
|
"napi": {
|
|
28
28
|
"binaryName": "anthelion-komac",
|
|
@@ -41,13 +41,13 @@
|
|
|
41
41
|
"node": ">=22.0.0"
|
|
42
42
|
},
|
|
43
43
|
"optionalDependencies": {
|
|
44
|
-
"@unownplain/anthelion-komac-win32-x64-msvc": "0.0.
|
|
45
|
-
"@unownplain/anthelion-komac-darwin-x64": "0.0.
|
|
46
|
-
"@unownplain/anthelion-komac-linux-x64-gnu": "0.0.
|
|
47
|
-
"@unownplain/anthelion-komac-linux-x64-musl": "0.0.
|
|
48
|
-
"@unownplain/anthelion-komac-darwin-arm64": "0.0.
|
|
49
|
-
"@unownplain/anthelion-komac-linux-arm64-gnu": "0.0.
|
|
50
|
-
"@unownplain/anthelion-komac-linux-arm64-musl": "0.0.
|
|
51
|
-
"@unownplain/anthelion-komac-win32-arm64-msvc": "0.0.
|
|
44
|
+
"@unownplain/anthelion-komac-win32-x64-msvc": "0.0.76",
|
|
45
|
+
"@unownplain/anthelion-komac-darwin-x64": "0.0.76",
|
|
46
|
+
"@unownplain/anthelion-komac-linux-x64-gnu": "0.0.76",
|
|
47
|
+
"@unownplain/anthelion-komac-linux-x64-musl": "0.0.76",
|
|
48
|
+
"@unownplain/anthelion-komac-darwin-arm64": "0.0.76",
|
|
49
|
+
"@unownplain/anthelion-komac-linux-arm64-gnu": "0.0.76",
|
|
50
|
+
"@unownplain/anthelion-komac-linux-arm64-musl": "0.0.76",
|
|
51
|
+
"@unownplain/anthelion-komac-win32-arm64-msvc": "0.0.76"
|
|
52
52
|
}
|
|
53
53
|
}
|