jazz-napi 2.0.0-alpha.15 → 2.0.0-alpha.16
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 +68 -57
- package/package.json +5 -5
package/index.js
CHANGED
|
@@ -6,6 +6,13 @@
|
|
|
6
6
|
const { readFileSync } = require('node:fs')
|
|
7
7
|
let nativeBinding = null;
|
|
8
8
|
const loadErrors = [];
|
|
9
|
+
const NATIVE_BINDING_PACKAGE_SCOPE = "@garden-co";
|
|
10
|
+
const resolveNativeBindingPackage = (name) =>
|
|
11
|
+
`${NATIVE_BINDING_PACKAGE_SCOPE}/${name}`;
|
|
12
|
+
const requireNativeBindingPackage = (name) =>
|
|
13
|
+
require(resolveNativeBindingPackage(name));
|
|
14
|
+
const getNativeBindingPackageVersion = (name) =>
|
|
15
|
+
require(`${resolveNativeBindingPackage(name)}/package.json`).version;
|
|
9
16
|
|
|
10
17
|
const isMusl = () => {
|
|
11
18
|
let musl = false;
|
|
@@ -77,8 +84,8 @@ function requireNative() {
|
|
|
77
84
|
loadErrors.push(e);
|
|
78
85
|
}
|
|
79
86
|
try {
|
|
80
|
-
const binding =
|
|
81
|
-
const bindingPackageVersion =
|
|
87
|
+
const binding = requireNativeBindingPackage("jazz-napi-android-arm64");
|
|
88
|
+
const bindingPackageVersion = getNativeBindingPackageVersion("jazz-napi-android-arm64");
|
|
82
89
|
if (
|
|
83
90
|
bindingPackageVersion !== "2.0.0-alpha.14" &&
|
|
84
91
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
@@ -99,8 +106,8 @@ function requireNative() {
|
|
|
99
106
|
loadErrors.push(e);
|
|
100
107
|
}
|
|
101
108
|
try {
|
|
102
|
-
const binding =
|
|
103
|
-
const bindingPackageVersion =
|
|
109
|
+
const binding = requireNativeBindingPackage("jazz-napi-android-arm-eabi");
|
|
110
|
+
const bindingPackageVersion = getNativeBindingPackageVersion("jazz-napi-android-arm-eabi");
|
|
104
111
|
if (
|
|
105
112
|
bindingPackageVersion !== "2.0.0-alpha.14" &&
|
|
106
113
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
@@ -129,8 +136,8 @@ function requireNative() {
|
|
|
129
136
|
loadErrors.push(e);
|
|
130
137
|
}
|
|
131
138
|
try {
|
|
132
|
-
const binding =
|
|
133
|
-
const bindingPackageVersion =
|
|
139
|
+
const binding = requireNativeBindingPackage("jazz-napi-win32-x64-gnu");
|
|
140
|
+
const bindingPackageVersion = getNativeBindingPackageVersion("jazz-napi-win32-x64-gnu");
|
|
134
141
|
if (
|
|
135
142
|
bindingPackageVersion !== "2.0.0-alpha.14" &&
|
|
136
143
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
@@ -151,8 +158,8 @@ function requireNative() {
|
|
|
151
158
|
loadErrors.push(e);
|
|
152
159
|
}
|
|
153
160
|
try {
|
|
154
|
-
const binding =
|
|
155
|
-
const bindingPackageVersion =
|
|
161
|
+
const binding = requireNativeBindingPackage("jazz-napi-win32-x64-msvc");
|
|
162
|
+
const bindingPackageVersion = getNativeBindingPackageVersion("jazz-napi-win32-x64-msvc");
|
|
156
163
|
if (
|
|
157
164
|
bindingPackageVersion !== "2.0.0-alpha.14" &&
|
|
158
165
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
@@ -174,8 +181,8 @@ function requireNative() {
|
|
|
174
181
|
loadErrors.push(e);
|
|
175
182
|
}
|
|
176
183
|
try {
|
|
177
|
-
const binding =
|
|
178
|
-
const bindingPackageVersion =
|
|
184
|
+
const binding = requireNativeBindingPackage("jazz-napi-win32-ia32-msvc");
|
|
185
|
+
const bindingPackageVersion = getNativeBindingPackageVersion("jazz-napi-win32-ia32-msvc");
|
|
179
186
|
if (
|
|
180
187
|
bindingPackageVersion !== "2.0.0-alpha.14" &&
|
|
181
188
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
@@ -196,8 +203,8 @@ function requireNative() {
|
|
|
196
203
|
loadErrors.push(e);
|
|
197
204
|
}
|
|
198
205
|
try {
|
|
199
|
-
const binding =
|
|
200
|
-
const bindingPackageVersion =
|
|
206
|
+
const binding = requireNativeBindingPackage("jazz-napi-win32-arm64-msvc");
|
|
207
|
+
const bindingPackageVersion = getNativeBindingPackageVersion("jazz-napi-win32-arm64-msvc");
|
|
201
208
|
if (
|
|
202
209
|
bindingPackageVersion !== "2.0.0-alpha.14" &&
|
|
203
210
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
@@ -221,8 +228,8 @@ function requireNative() {
|
|
|
221
228
|
loadErrors.push(e);
|
|
222
229
|
}
|
|
223
230
|
try {
|
|
224
|
-
const binding =
|
|
225
|
-
const bindingPackageVersion =
|
|
231
|
+
const binding = requireNativeBindingPackage("jazz-napi-darwin-universal");
|
|
232
|
+
const bindingPackageVersion = getNativeBindingPackageVersion("jazz-napi-darwin-universal");
|
|
226
233
|
if (
|
|
227
234
|
bindingPackageVersion !== "2.0.0-alpha.14" &&
|
|
228
235
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
@@ -243,8 +250,8 @@ function requireNative() {
|
|
|
243
250
|
loadErrors.push(e);
|
|
244
251
|
}
|
|
245
252
|
try {
|
|
246
|
-
const binding =
|
|
247
|
-
const bindingPackageVersion =
|
|
253
|
+
const binding = requireNativeBindingPackage("jazz-napi-darwin-x64");
|
|
254
|
+
const bindingPackageVersion = getNativeBindingPackageVersion("jazz-napi-darwin-x64");
|
|
248
255
|
if (
|
|
249
256
|
bindingPackageVersion !== "2.0.0-alpha.14" &&
|
|
250
257
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
@@ -265,8 +272,8 @@ function requireNative() {
|
|
|
265
272
|
loadErrors.push(e);
|
|
266
273
|
}
|
|
267
274
|
try {
|
|
268
|
-
const binding =
|
|
269
|
-
const bindingPackageVersion =
|
|
275
|
+
const binding = requireNativeBindingPackage("jazz-napi-darwin-arm64");
|
|
276
|
+
const bindingPackageVersion = getNativeBindingPackageVersion("jazz-napi-darwin-arm64");
|
|
270
277
|
if (
|
|
271
278
|
bindingPackageVersion !== "2.0.0-alpha.14" &&
|
|
272
279
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
@@ -291,8 +298,8 @@ function requireNative() {
|
|
|
291
298
|
loadErrors.push(e);
|
|
292
299
|
}
|
|
293
300
|
try {
|
|
294
|
-
const binding =
|
|
295
|
-
const bindingPackageVersion =
|
|
301
|
+
const binding = requireNativeBindingPackage("jazz-napi-freebsd-x64");
|
|
302
|
+
const bindingPackageVersion = getNativeBindingPackageVersion("jazz-napi-freebsd-x64");
|
|
296
303
|
if (
|
|
297
304
|
bindingPackageVersion !== "2.0.0-alpha.14" &&
|
|
298
305
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
@@ -313,8 +320,8 @@ function requireNative() {
|
|
|
313
320
|
loadErrors.push(e);
|
|
314
321
|
}
|
|
315
322
|
try {
|
|
316
|
-
const binding =
|
|
317
|
-
const bindingPackageVersion =
|
|
323
|
+
const binding = requireNativeBindingPackage("jazz-napi-freebsd-arm64");
|
|
324
|
+
const bindingPackageVersion = getNativeBindingPackageVersion("jazz-napi-freebsd-arm64");
|
|
318
325
|
if (
|
|
319
326
|
bindingPackageVersion !== "2.0.0-alpha.14" &&
|
|
320
327
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
@@ -340,8 +347,8 @@ function requireNative() {
|
|
|
340
347
|
loadErrors.push(e);
|
|
341
348
|
}
|
|
342
349
|
try {
|
|
343
|
-
const binding =
|
|
344
|
-
const bindingPackageVersion =
|
|
350
|
+
const binding = requireNativeBindingPackage("jazz-napi-linux-x64-musl");
|
|
351
|
+
const bindingPackageVersion = getNativeBindingPackageVersion("jazz-napi-linux-x64-musl");
|
|
345
352
|
if (
|
|
346
353
|
bindingPackageVersion !== "2.0.0-alpha.14" &&
|
|
347
354
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
@@ -362,8 +369,8 @@ function requireNative() {
|
|
|
362
369
|
loadErrors.push(e);
|
|
363
370
|
}
|
|
364
371
|
try {
|
|
365
|
-
const binding =
|
|
366
|
-
const bindingPackageVersion =
|
|
372
|
+
const binding = requireNativeBindingPackage("jazz-napi-linux-x64-gnu");
|
|
373
|
+
const bindingPackageVersion = getNativeBindingPackageVersion("jazz-napi-linux-x64-gnu");
|
|
367
374
|
if (
|
|
368
375
|
bindingPackageVersion !== "2.0.0-alpha.14" &&
|
|
369
376
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
@@ -386,8 +393,8 @@ function requireNative() {
|
|
|
386
393
|
loadErrors.push(e);
|
|
387
394
|
}
|
|
388
395
|
try {
|
|
389
|
-
const binding =
|
|
390
|
-
const bindingPackageVersion =
|
|
396
|
+
const binding = requireNativeBindingPackage("jazz-napi-linux-arm64-musl");
|
|
397
|
+
const bindingPackageVersion = getNativeBindingPackageVersion("jazz-napi-linux-arm64-musl");
|
|
391
398
|
if (
|
|
392
399
|
bindingPackageVersion !== "2.0.0-alpha.14" &&
|
|
393
400
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
@@ -408,8 +415,8 @@ function requireNative() {
|
|
|
408
415
|
loadErrors.push(e);
|
|
409
416
|
}
|
|
410
417
|
try {
|
|
411
|
-
const binding =
|
|
412
|
-
const bindingPackageVersion =
|
|
418
|
+
const binding = requireNativeBindingPackage("jazz-napi-linux-arm64-gnu");
|
|
419
|
+
const bindingPackageVersion = getNativeBindingPackageVersion("jazz-napi-linux-arm64-gnu");
|
|
413
420
|
if (
|
|
414
421
|
bindingPackageVersion !== "2.0.0-alpha.14" &&
|
|
415
422
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
@@ -432,9 +439,10 @@ function requireNative() {
|
|
|
432
439
|
loadErrors.push(e);
|
|
433
440
|
}
|
|
434
441
|
try {
|
|
435
|
-
const binding =
|
|
436
|
-
const bindingPackageVersion =
|
|
437
|
-
|
|
442
|
+
const binding = requireNativeBindingPackage("jazz-napi-linux-arm-musleabihf");
|
|
443
|
+
const bindingPackageVersion = getNativeBindingPackageVersion(
|
|
444
|
+
"jazz-napi-linux-arm-musleabihf",
|
|
445
|
+
);
|
|
438
446
|
if (
|
|
439
447
|
bindingPackageVersion !== "2.0.0-alpha.14" &&
|
|
440
448
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
@@ -455,9 +463,10 @@ function requireNative() {
|
|
|
455
463
|
loadErrors.push(e);
|
|
456
464
|
}
|
|
457
465
|
try {
|
|
458
|
-
const binding =
|
|
459
|
-
const bindingPackageVersion =
|
|
460
|
-
|
|
466
|
+
const binding = requireNativeBindingPackage("jazz-napi-linux-arm-gnueabihf");
|
|
467
|
+
const bindingPackageVersion = getNativeBindingPackageVersion(
|
|
468
|
+
"jazz-napi-linux-arm-gnueabihf",
|
|
469
|
+
);
|
|
461
470
|
if (
|
|
462
471
|
bindingPackageVersion !== "2.0.0-alpha.14" &&
|
|
463
472
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
@@ -480,9 +489,10 @@ function requireNative() {
|
|
|
480
489
|
loadErrors.push(e);
|
|
481
490
|
}
|
|
482
491
|
try {
|
|
483
|
-
const binding =
|
|
484
|
-
const bindingPackageVersion =
|
|
485
|
-
|
|
492
|
+
const binding = requireNativeBindingPackage("jazz-napi-linux-loong64-musl");
|
|
493
|
+
const bindingPackageVersion = getNativeBindingPackageVersion(
|
|
494
|
+
"jazz-napi-linux-loong64-musl",
|
|
495
|
+
);
|
|
486
496
|
if (
|
|
487
497
|
bindingPackageVersion !== "2.0.0-alpha.14" &&
|
|
488
498
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
@@ -503,8 +513,8 @@ function requireNative() {
|
|
|
503
513
|
loadErrors.push(e);
|
|
504
514
|
}
|
|
505
515
|
try {
|
|
506
|
-
const binding =
|
|
507
|
-
const bindingPackageVersion =
|
|
516
|
+
const binding = requireNativeBindingPackage("jazz-napi-linux-loong64-gnu");
|
|
517
|
+
const bindingPackageVersion = getNativeBindingPackageVersion("jazz-napi-linux-loong64-gnu");
|
|
508
518
|
if (
|
|
509
519
|
bindingPackageVersion !== "2.0.0-alpha.14" &&
|
|
510
520
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
@@ -527,9 +537,10 @@ function requireNative() {
|
|
|
527
537
|
loadErrors.push(e);
|
|
528
538
|
}
|
|
529
539
|
try {
|
|
530
|
-
const binding =
|
|
531
|
-
const bindingPackageVersion =
|
|
532
|
-
|
|
540
|
+
const binding = requireNativeBindingPackage("jazz-napi-linux-riscv64-musl");
|
|
541
|
+
const bindingPackageVersion = getNativeBindingPackageVersion(
|
|
542
|
+
"jazz-napi-linux-riscv64-musl",
|
|
543
|
+
);
|
|
533
544
|
if (
|
|
534
545
|
bindingPackageVersion !== "2.0.0-alpha.14" &&
|
|
535
546
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
@@ -550,8 +561,8 @@ function requireNative() {
|
|
|
550
561
|
loadErrors.push(e);
|
|
551
562
|
}
|
|
552
563
|
try {
|
|
553
|
-
const binding =
|
|
554
|
-
const bindingPackageVersion =
|
|
564
|
+
const binding = requireNativeBindingPackage("jazz-napi-linux-riscv64-gnu");
|
|
565
|
+
const bindingPackageVersion = getNativeBindingPackageVersion("jazz-napi-linux-riscv64-gnu");
|
|
555
566
|
if (
|
|
556
567
|
bindingPackageVersion !== "2.0.0-alpha.14" &&
|
|
557
568
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
@@ -573,8 +584,8 @@ function requireNative() {
|
|
|
573
584
|
loadErrors.push(e);
|
|
574
585
|
}
|
|
575
586
|
try {
|
|
576
|
-
const binding =
|
|
577
|
-
const bindingPackageVersion =
|
|
587
|
+
const binding = requireNativeBindingPackage("jazz-napi-linux-ppc64-gnu");
|
|
588
|
+
const bindingPackageVersion = getNativeBindingPackageVersion("jazz-napi-linux-ppc64-gnu");
|
|
578
589
|
if (
|
|
579
590
|
bindingPackageVersion !== "2.0.0-alpha.14" &&
|
|
580
591
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
@@ -595,8 +606,8 @@ function requireNative() {
|
|
|
595
606
|
loadErrors.push(e);
|
|
596
607
|
}
|
|
597
608
|
try {
|
|
598
|
-
const binding =
|
|
599
|
-
const bindingPackageVersion =
|
|
609
|
+
const binding = requireNativeBindingPackage("jazz-napi-linux-s390x-gnu");
|
|
610
|
+
const bindingPackageVersion = getNativeBindingPackageVersion("jazz-napi-linux-s390x-gnu");
|
|
600
611
|
if (
|
|
601
612
|
bindingPackageVersion !== "2.0.0-alpha.14" &&
|
|
602
613
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
@@ -621,8 +632,8 @@ function requireNative() {
|
|
|
621
632
|
loadErrors.push(e);
|
|
622
633
|
}
|
|
623
634
|
try {
|
|
624
|
-
const binding =
|
|
625
|
-
const bindingPackageVersion =
|
|
635
|
+
const binding = requireNativeBindingPackage("jazz-napi-openharmony-arm64");
|
|
636
|
+
const bindingPackageVersion = getNativeBindingPackageVersion("jazz-napi-openharmony-arm64");
|
|
626
637
|
if (
|
|
627
638
|
bindingPackageVersion !== "2.0.0-alpha.14" &&
|
|
628
639
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
@@ -643,8 +654,8 @@ function requireNative() {
|
|
|
643
654
|
loadErrors.push(e);
|
|
644
655
|
}
|
|
645
656
|
try {
|
|
646
|
-
const binding =
|
|
647
|
-
const bindingPackageVersion =
|
|
657
|
+
const binding = requireNativeBindingPackage("jazz-napi-openharmony-x64");
|
|
658
|
+
const bindingPackageVersion = getNativeBindingPackageVersion("jazz-napi-openharmony-x64");
|
|
648
659
|
if (
|
|
649
660
|
bindingPackageVersion !== "2.0.0-alpha.14" &&
|
|
650
661
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
@@ -665,8 +676,8 @@ function requireNative() {
|
|
|
665
676
|
loadErrors.push(e);
|
|
666
677
|
}
|
|
667
678
|
try {
|
|
668
|
-
const binding =
|
|
669
|
-
const bindingPackageVersion =
|
|
679
|
+
const binding = requireNativeBindingPackage("jazz-napi-openharmony-arm");
|
|
680
|
+
const bindingPackageVersion = getNativeBindingPackageVersion("jazz-napi-openharmony-arm");
|
|
670
681
|
if (
|
|
671
682
|
bindingPackageVersion !== "2.0.0-alpha.14" &&
|
|
672
683
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
@@ -705,7 +716,7 @@ if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
|
|
|
705
716
|
}
|
|
706
717
|
if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
|
|
707
718
|
try {
|
|
708
|
-
wasiBinding =
|
|
719
|
+
wasiBinding = requireNativeBindingPackage("jazz-napi-wasm32-wasi");
|
|
709
720
|
nativeBinding = wasiBinding;
|
|
710
721
|
} catch (err) {
|
|
711
722
|
if (process.env.NAPI_RS_FORCE_WASI) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jazz-napi",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.16",
|
|
4
4
|
"description": "Native Node.js bindings for Jazz runtime",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -30,10 +30,10 @@
|
|
|
30
30
|
]
|
|
31
31
|
},
|
|
32
32
|
"optionalDependencies": {
|
|
33
|
-
"@garden-co/jazz-napi-darwin-arm64": "2.0.0-alpha.
|
|
34
|
-
"@garden-co/jazz-napi-darwin-x64": "2.0.0-alpha.
|
|
35
|
-
"@garden-co/jazz-napi-linux-x64-gnu": "2.0.0-alpha.
|
|
36
|
-
"@garden-co/jazz-napi-win32-x64-msvc": "2.0.0-alpha.
|
|
33
|
+
"@garden-co/jazz-napi-darwin-arm64": "2.0.0-alpha.16",
|
|
34
|
+
"@garden-co/jazz-napi-darwin-x64": "2.0.0-alpha.16",
|
|
35
|
+
"@garden-co/jazz-napi-linux-x64-gnu": "2.0.0-alpha.16",
|
|
36
|
+
"@garden-co/jazz-napi-win32-x64-msvc": "2.0.0-alpha.16"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"build": "node scripts/build.js",
|