oxc-transform-relay 0.150.0 → 0.151.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +8 -0
- package/index.js +71 -55
- package/package.json +21 -21
package/index.d.ts
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
/* auto-generated by NAPI-RS */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Which binding artifact the generated loader actually loaded: `'native'` for
|
|
6
|
+
* a native addon, otherwise the `platformArchABI` of the WASI flavor. Every
|
|
7
|
+
* flavor napi-rs can build is listed, because `NAPI_RS_NATIVE_LIBRARY_PATH`
|
|
8
|
+
* can point the loader at a WASI artifact this package does not build itself.
|
|
9
|
+
*/
|
|
10
|
+
export declare const __napiBindingTarget: 'native' | 'wasm32-wasi' | 'wasm32-wasip1'
|
|
11
|
+
|
|
4
12
|
export interface Comment {
|
|
5
13
|
type: 'Line' | 'Block'
|
|
6
14
|
value: string
|
package/index.js
CHANGED
|
@@ -7,6 +7,10 @@ const require = createRequire(import.meta.url)
|
|
|
7
7
|
|
|
8
8
|
const { readFileSync } = require('fs')
|
|
9
9
|
let nativeBinding = null
|
|
10
|
+
// Which artifact actually loaded. The WASI fallback chain overwrites it with
|
|
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.
|
|
13
|
+
let __napiLoadedBindingTarget = 'native'
|
|
10
14
|
const loadErrors = []
|
|
11
15
|
|
|
12
16
|
const isMusl = () => {
|
|
@@ -65,7 +69,16 @@ const isMuslFromChildProcess = () => {
|
|
|
65
69
|
function requireNative() {
|
|
66
70
|
if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) {
|
|
67
71
|
try {
|
|
68
|
-
|
|
72
|
+
const overrideBinding = require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH)
|
|
73
|
+
// The override may be a generated WASI loader, which already reports its
|
|
74
|
+
// own flavor. Adopt it: `module.exports` aliases this object, so claiming
|
|
75
|
+
// 'native' would both misreport the artifact and overwrite the loader's
|
|
76
|
+
// marker through the alias.
|
|
77
|
+
__napiLoadedBindingTarget =
|
|
78
|
+
overrideBinding && typeof overrideBinding.__napiBindingTarget === 'string'
|
|
79
|
+
? overrideBinding.__napiBindingTarget
|
|
80
|
+
: 'native'
|
|
81
|
+
return overrideBinding
|
|
69
82
|
} catch (err) {
|
|
70
83
|
loadErrors.push(err)
|
|
71
84
|
}
|
|
@@ -79,8 +92,8 @@ function requireNative() {
|
|
|
79
92
|
try {
|
|
80
93
|
const binding = require('@oxc-transform-relay/binding-android-arm64')
|
|
81
94
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-android-arm64/package.json').version
|
|
82
|
-
if (bindingPackageVersion !== '0.
|
|
83
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
95
|
+
if (bindingPackageVersion !== '0.151.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
96
|
+
throw new Error(`Native binding package version mismatch, expected 0.151.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
84
97
|
}
|
|
85
98
|
return binding
|
|
86
99
|
} catch (e) {
|
|
@@ -95,8 +108,8 @@ function requireNative() {
|
|
|
95
108
|
try {
|
|
96
109
|
const binding = require('@oxc-transform-relay/binding-android-arm-eabi')
|
|
97
110
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-android-arm-eabi/package.json').version
|
|
98
|
-
if (bindingPackageVersion !== '0.
|
|
99
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
111
|
+
if (bindingPackageVersion !== '0.151.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
112
|
+
throw new Error(`Native binding package version mismatch, expected 0.151.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
100
113
|
}
|
|
101
114
|
return binding
|
|
102
115
|
} catch (e) {
|
|
@@ -116,8 +129,8 @@ function requireNative() {
|
|
|
116
129
|
try {
|
|
117
130
|
const binding = require('@oxc-transform-relay/binding-win32-x64-gnu')
|
|
118
131
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-win32-x64-gnu/package.json').version
|
|
119
|
-
if (bindingPackageVersion !== '0.
|
|
120
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
132
|
+
if (bindingPackageVersion !== '0.151.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
133
|
+
throw new Error(`Native binding package version mismatch, expected 0.151.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
121
134
|
}
|
|
122
135
|
return binding
|
|
123
136
|
} catch (e) {
|
|
@@ -132,8 +145,8 @@ function requireNative() {
|
|
|
132
145
|
try {
|
|
133
146
|
const binding = require('@oxc-transform-relay/binding-win32-x64-msvc')
|
|
134
147
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-win32-x64-msvc/package.json').version
|
|
135
|
-
if (bindingPackageVersion !== '0.
|
|
136
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
148
|
+
if (bindingPackageVersion !== '0.151.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
149
|
+
throw new Error(`Native binding package version mismatch, expected 0.151.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
137
150
|
}
|
|
138
151
|
return binding
|
|
139
152
|
} catch (e) {
|
|
@@ -149,8 +162,8 @@ function requireNative() {
|
|
|
149
162
|
try {
|
|
150
163
|
const binding = require('@oxc-transform-relay/binding-win32-ia32-msvc')
|
|
151
164
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-win32-ia32-msvc/package.json').version
|
|
152
|
-
if (bindingPackageVersion !== '0.
|
|
153
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
165
|
+
if (bindingPackageVersion !== '0.151.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
166
|
+
throw new Error(`Native binding package version mismatch, expected 0.151.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
154
167
|
}
|
|
155
168
|
return binding
|
|
156
169
|
} catch (e) {
|
|
@@ -165,8 +178,8 @@ function requireNative() {
|
|
|
165
178
|
try {
|
|
166
179
|
const binding = require('@oxc-transform-relay/binding-win32-arm64-msvc')
|
|
167
180
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-win32-arm64-msvc/package.json').version
|
|
168
|
-
if (bindingPackageVersion !== '0.
|
|
169
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
181
|
+
if (bindingPackageVersion !== '0.151.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
182
|
+
throw new Error(`Native binding package version mismatch, expected 0.151.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
170
183
|
}
|
|
171
184
|
return binding
|
|
172
185
|
} catch (e) {
|
|
@@ -184,8 +197,8 @@ function requireNative() {
|
|
|
184
197
|
try {
|
|
185
198
|
const binding = require('@oxc-transform-relay/binding-darwin-universal')
|
|
186
199
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-darwin-universal/package.json').version
|
|
187
|
-
if (bindingPackageVersion !== '0.
|
|
188
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
200
|
+
if (bindingPackageVersion !== '0.151.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
201
|
+
throw new Error(`Native binding package version mismatch, expected 0.151.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
189
202
|
}
|
|
190
203
|
return binding
|
|
191
204
|
} catch (e) {
|
|
@@ -200,8 +213,8 @@ function requireNative() {
|
|
|
200
213
|
try {
|
|
201
214
|
const binding = require('@oxc-transform-relay/binding-darwin-x64')
|
|
202
215
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-darwin-x64/package.json').version
|
|
203
|
-
if (bindingPackageVersion !== '0.
|
|
204
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
216
|
+
if (bindingPackageVersion !== '0.151.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
217
|
+
throw new Error(`Native binding package version mismatch, expected 0.151.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
205
218
|
}
|
|
206
219
|
return binding
|
|
207
220
|
} catch (e) {
|
|
@@ -216,8 +229,8 @@ function requireNative() {
|
|
|
216
229
|
try {
|
|
217
230
|
const binding = require('@oxc-transform-relay/binding-darwin-arm64')
|
|
218
231
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-darwin-arm64/package.json').version
|
|
219
|
-
if (bindingPackageVersion !== '0.
|
|
220
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
232
|
+
if (bindingPackageVersion !== '0.151.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
233
|
+
throw new Error(`Native binding package version mismatch, expected 0.151.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
221
234
|
}
|
|
222
235
|
return binding
|
|
223
236
|
} catch (e) {
|
|
@@ -236,8 +249,8 @@ function requireNative() {
|
|
|
236
249
|
try {
|
|
237
250
|
const binding = require('@oxc-transform-relay/binding-freebsd-x64')
|
|
238
251
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-freebsd-x64/package.json').version
|
|
239
|
-
if (bindingPackageVersion !== '0.
|
|
240
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
252
|
+
if (bindingPackageVersion !== '0.151.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
253
|
+
throw new Error(`Native binding package version mismatch, expected 0.151.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
241
254
|
}
|
|
242
255
|
return binding
|
|
243
256
|
} catch (e) {
|
|
@@ -252,8 +265,8 @@ function requireNative() {
|
|
|
252
265
|
try {
|
|
253
266
|
const binding = require('@oxc-transform-relay/binding-freebsd-arm64')
|
|
254
267
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-freebsd-arm64/package.json').version
|
|
255
|
-
if (bindingPackageVersion !== '0.
|
|
256
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
268
|
+
if (bindingPackageVersion !== '0.151.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
269
|
+
throw new Error(`Native binding package version mismatch, expected 0.151.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
257
270
|
}
|
|
258
271
|
return binding
|
|
259
272
|
} catch (e) {
|
|
@@ -273,8 +286,8 @@ function requireNative() {
|
|
|
273
286
|
try {
|
|
274
287
|
const binding = require('@oxc-transform-relay/binding-linux-x64-musl')
|
|
275
288
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-linux-x64-musl/package.json').version
|
|
276
|
-
if (bindingPackageVersion !== '0.
|
|
277
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
289
|
+
if (bindingPackageVersion !== '0.151.0' && 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.151.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
278
291
|
}
|
|
279
292
|
return binding
|
|
280
293
|
} catch (e) {
|
|
@@ -289,8 +302,8 @@ function requireNative() {
|
|
|
289
302
|
try {
|
|
290
303
|
const binding = require('@oxc-transform-relay/binding-linux-x64-gnu')
|
|
291
304
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-linux-x64-gnu/package.json').version
|
|
292
|
-
if (bindingPackageVersion !== '0.
|
|
293
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
305
|
+
if (bindingPackageVersion !== '0.151.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
306
|
+
throw new Error(`Native binding package version mismatch, expected 0.151.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
294
307
|
}
|
|
295
308
|
return binding
|
|
296
309
|
} catch (e) {
|
|
@@ -307,8 +320,8 @@ function requireNative() {
|
|
|
307
320
|
try {
|
|
308
321
|
const binding = require('@oxc-transform-relay/binding-linux-arm64-musl')
|
|
309
322
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-linux-arm64-musl/package.json').version
|
|
310
|
-
if (bindingPackageVersion !== '0.
|
|
311
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
323
|
+
if (bindingPackageVersion !== '0.151.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
324
|
+
throw new Error(`Native binding package version mismatch, expected 0.151.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
312
325
|
}
|
|
313
326
|
return binding
|
|
314
327
|
} catch (e) {
|
|
@@ -323,8 +336,8 @@ function requireNative() {
|
|
|
323
336
|
try {
|
|
324
337
|
const binding = require('@oxc-transform-relay/binding-linux-arm64-gnu')
|
|
325
338
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-linux-arm64-gnu/package.json').version
|
|
326
|
-
if (bindingPackageVersion !== '0.
|
|
327
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
339
|
+
if (bindingPackageVersion !== '0.151.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
340
|
+
throw new Error(`Native binding package version mismatch, expected 0.151.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
328
341
|
}
|
|
329
342
|
return binding
|
|
330
343
|
} catch (e) {
|
|
@@ -341,8 +354,8 @@ function requireNative() {
|
|
|
341
354
|
try {
|
|
342
355
|
const binding = require('@oxc-transform-relay/binding-linux-arm-musleabihf')
|
|
343
356
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-linux-arm-musleabihf/package.json').version
|
|
344
|
-
if (bindingPackageVersion !== '0.
|
|
345
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
357
|
+
if (bindingPackageVersion !== '0.151.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
358
|
+
throw new Error(`Native binding package version mismatch, expected 0.151.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
346
359
|
}
|
|
347
360
|
return binding
|
|
348
361
|
} catch (e) {
|
|
@@ -357,8 +370,8 @@ function requireNative() {
|
|
|
357
370
|
try {
|
|
358
371
|
const binding = require('@oxc-transform-relay/binding-linux-arm-gnueabihf')
|
|
359
372
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-linux-arm-gnueabihf/package.json').version
|
|
360
|
-
if (bindingPackageVersion !== '0.
|
|
361
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
373
|
+
if (bindingPackageVersion !== '0.151.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
374
|
+
throw new Error(`Native binding package version mismatch, expected 0.151.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
362
375
|
}
|
|
363
376
|
return binding
|
|
364
377
|
} catch (e) {
|
|
@@ -375,8 +388,8 @@ function requireNative() {
|
|
|
375
388
|
try {
|
|
376
389
|
const binding = require('@oxc-transform-relay/binding-linux-loong64-musl')
|
|
377
390
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-linux-loong64-musl/package.json').version
|
|
378
|
-
if (bindingPackageVersion !== '0.
|
|
379
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
391
|
+
if (bindingPackageVersion !== '0.151.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
392
|
+
throw new Error(`Native binding package version mismatch, expected 0.151.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
380
393
|
}
|
|
381
394
|
return binding
|
|
382
395
|
} catch (e) {
|
|
@@ -391,8 +404,8 @@ function requireNative() {
|
|
|
391
404
|
try {
|
|
392
405
|
const binding = require('@oxc-transform-relay/binding-linux-loong64-gnu')
|
|
393
406
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-linux-loong64-gnu/package.json').version
|
|
394
|
-
if (bindingPackageVersion !== '0.
|
|
395
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
407
|
+
if (bindingPackageVersion !== '0.151.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
408
|
+
throw new Error(`Native binding package version mismatch, expected 0.151.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
396
409
|
}
|
|
397
410
|
return binding
|
|
398
411
|
} catch (e) {
|
|
@@ -409,8 +422,8 @@ function requireNative() {
|
|
|
409
422
|
try {
|
|
410
423
|
const binding = require('@oxc-transform-relay/binding-linux-riscv64-musl')
|
|
411
424
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-linux-riscv64-musl/package.json').version
|
|
412
|
-
if (bindingPackageVersion !== '0.
|
|
413
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
425
|
+
if (bindingPackageVersion !== '0.151.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
426
|
+
throw new Error(`Native binding package version mismatch, expected 0.151.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
414
427
|
}
|
|
415
428
|
return binding
|
|
416
429
|
} catch (e) {
|
|
@@ -425,8 +438,8 @@ function requireNative() {
|
|
|
425
438
|
try {
|
|
426
439
|
const binding = require('@oxc-transform-relay/binding-linux-riscv64-gnu')
|
|
427
440
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-linux-riscv64-gnu/package.json').version
|
|
428
|
-
if (bindingPackageVersion !== '0.
|
|
429
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
441
|
+
if (bindingPackageVersion !== '0.151.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
442
|
+
throw new Error(`Native binding package version mismatch, expected 0.151.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
430
443
|
}
|
|
431
444
|
return binding
|
|
432
445
|
} catch (e) {
|
|
@@ -442,8 +455,8 @@ function requireNative() {
|
|
|
442
455
|
try {
|
|
443
456
|
const binding = require('@oxc-transform-relay/binding-linux-ppc64-gnu')
|
|
444
457
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-linux-ppc64-gnu/package.json').version
|
|
445
|
-
if (bindingPackageVersion !== '0.
|
|
446
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
458
|
+
if (bindingPackageVersion !== '0.151.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
459
|
+
throw new Error(`Native binding package version mismatch, expected 0.151.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
447
460
|
}
|
|
448
461
|
return binding
|
|
449
462
|
} catch (e) {
|
|
@@ -458,8 +471,8 @@ function requireNative() {
|
|
|
458
471
|
try {
|
|
459
472
|
const binding = require('@oxc-transform-relay/binding-linux-s390x-gnu')
|
|
460
473
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-linux-s390x-gnu/package.json').version
|
|
461
|
-
if (bindingPackageVersion !== '0.
|
|
462
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
474
|
+
if (bindingPackageVersion !== '0.151.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
475
|
+
throw new Error(`Native binding package version mismatch, expected 0.151.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
463
476
|
}
|
|
464
477
|
return binding
|
|
465
478
|
} catch (e) {
|
|
@@ -478,8 +491,8 @@ function requireNative() {
|
|
|
478
491
|
try {
|
|
479
492
|
const binding = require('@oxc-transform-relay/binding-openharmony-arm64')
|
|
480
493
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-openharmony-arm64/package.json').version
|
|
481
|
-
if (bindingPackageVersion !== '0.
|
|
482
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
494
|
+
if (bindingPackageVersion !== '0.151.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
495
|
+
throw new Error(`Native binding package version mismatch, expected 0.151.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
483
496
|
}
|
|
484
497
|
return binding
|
|
485
498
|
} catch (e) {
|
|
@@ -494,8 +507,8 @@ function requireNative() {
|
|
|
494
507
|
try {
|
|
495
508
|
const binding = require('@oxc-transform-relay/binding-openharmony-x64')
|
|
496
509
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-openharmony-x64/package.json').version
|
|
497
|
-
if (bindingPackageVersion !== '0.
|
|
498
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
510
|
+
if (bindingPackageVersion !== '0.151.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
511
|
+
throw new Error(`Native binding package version mismatch, expected 0.151.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
499
512
|
}
|
|
500
513
|
return binding
|
|
501
514
|
} catch (e) {
|
|
@@ -510,8 +523,8 @@ function requireNative() {
|
|
|
510
523
|
try {
|
|
511
524
|
const binding = require('@oxc-transform-relay/binding-openharmony-arm')
|
|
512
525
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-openharmony-arm/package.json').version
|
|
513
|
-
if (bindingPackageVersion !== '0.
|
|
514
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
526
|
+
if (bindingPackageVersion !== '0.151.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
527
|
+
throw new Error(`Native binding package version mismatch, expected 0.151.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
515
528
|
}
|
|
516
529
|
return binding
|
|
517
530
|
} catch (e) {
|
|
@@ -630,6 +643,7 @@ if (!nativeBinding || forceWasi) {
|
|
|
630
643
|
if (!candidateFailed) {
|
|
631
644
|
wasiBinding = require('./transform-relay.wasi.cjs')
|
|
632
645
|
nativeBinding = wasiBinding
|
|
646
|
+
__napiLoadedBindingTarget = 'wasm32-wasi'
|
|
633
647
|
wasiBindingLoaded = true
|
|
634
648
|
}
|
|
635
649
|
} catch (err) {
|
|
@@ -650,12 +664,13 @@ if (!nativeBinding || forceWasi) {
|
|
|
650
664
|
if (!candidateFailed) {
|
|
651
665
|
if (process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
652
666
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-wasm32-wasi/package.json').version
|
|
653
|
-
if (bindingPackageVersion !== '0.
|
|
654
|
-
throw new Error(`WASI binding package version mismatch, expected 0.
|
|
667
|
+
if (bindingPackageVersion !== '0.151.0') {
|
|
668
|
+
throw new Error(`WASI binding package version mismatch, expected 0.151.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
655
669
|
}
|
|
656
670
|
}
|
|
657
671
|
wasiBinding = require('@oxc-transform-relay/binding-wasm32-wasi')
|
|
658
672
|
nativeBinding = wasiBinding
|
|
673
|
+
__napiLoadedBindingTarget = 'wasm32-wasi'
|
|
659
674
|
wasiBindingLoaded = true
|
|
660
675
|
}
|
|
661
676
|
} catch (err) {
|
|
@@ -713,3 +728,4 @@ const { Severity, transform, transformSync } = nativeBinding
|
|
|
713
728
|
export { Severity }
|
|
714
729
|
export { transform }
|
|
715
730
|
export { transformSync }
|
|
731
|
+
export const __napiBindingTarget = __napiLoadedBindingTarget
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oxc-transform-relay",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.151.0",
|
|
4
4
|
"description": "Oxc Relay Transform Node API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"graphql",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@emnapi/core": "2.0.0-alpha.3",
|
|
41
41
|
"@emnapi/runtime": "2.0.0-alpha.3",
|
|
42
|
-
"@napi-rs/cli": "3.
|
|
42
|
+
"@napi-rs/cli": "3.10.4",
|
|
43
43
|
"@types/node": "24.1.0",
|
|
44
44
|
"publint": "0.3.24",
|
|
45
45
|
"vitest": "5.0.0"
|
|
@@ -79,25 +79,25 @@
|
|
|
79
79
|
"node": "^20.19.0 || >=22.12.0"
|
|
80
80
|
},
|
|
81
81
|
"optionalDependencies": {
|
|
82
|
-
"@oxc-transform-relay/binding-darwin-arm64": "0.
|
|
83
|
-
"@oxc-transform-relay/binding-android-arm64": "0.
|
|
84
|
-
"@oxc-transform-relay/binding-win32-arm64-msvc": "0.
|
|
85
|
-
"@oxc-transform-relay/binding-linux-arm64-gnu": "0.
|
|
86
|
-
"@oxc-transform-relay/binding-linux-arm64-musl": "0.
|
|
87
|
-
"@oxc-transform-relay/binding-openharmony-arm64": "0.
|
|
88
|
-
"@oxc-transform-relay/binding-android-arm-eabi": "0.
|
|
89
|
-
"@oxc-transform-relay/binding-linux-arm-gnueabihf": "0.
|
|
90
|
-
"@oxc-transform-relay/binding-linux-arm-musleabihf": "0.
|
|
91
|
-
"@oxc-transform-relay/binding-win32-ia32-msvc": "0.
|
|
92
|
-
"@oxc-transform-relay/binding-linux-ppc64-gnu": "0.
|
|
93
|
-
"@oxc-transform-relay/binding-linux-riscv64-gnu": "0.
|
|
94
|
-
"@oxc-transform-relay/binding-linux-riscv64-musl": "0.
|
|
95
|
-
"@oxc-transform-relay/binding-linux-s390x-gnu": "0.
|
|
96
|
-
"@oxc-transform-relay/binding-darwin-x64": "0.
|
|
97
|
-
"@oxc-transform-relay/binding-win32-x64-msvc": "0.
|
|
98
|
-
"@oxc-transform-relay/binding-freebsd-x64": "0.
|
|
99
|
-
"@oxc-transform-relay/binding-linux-x64-gnu": "0.
|
|
100
|
-
"@oxc-transform-relay/binding-linux-x64-musl": "0.
|
|
82
|
+
"@oxc-transform-relay/binding-darwin-arm64": "0.151.0",
|
|
83
|
+
"@oxc-transform-relay/binding-android-arm64": "0.151.0",
|
|
84
|
+
"@oxc-transform-relay/binding-win32-arm64-msvc": "0.151.0",
|
|
85
|
+
"@oxc-transform-relay/binding-linux-arm64-gnu": "0.151.0",
|
|
86
|
+
"@oxc-transform-relay/binding-linux-arm64-musl": "0.151.0",
|
|
87
|
+
"@oxc-transform-relay/binding-openharmony-arm64": "0.151.0",
|
|
88
|
+
"@oxc-transform-relay/binding-android-arm-eabi": "0.151.0",
|
|
89
|
+
"@oxc-transform-relay/binding-linux-arm-gnueabihf": "0.151.0",
|
|
90
|
+
"@oxc-transform-relay/binding-linux-arm-musleabihf": "0.151.0",
|
|
91
|
+
"@oxc-transform-relay/binding-win32-ia32-msvc": "0.151.0",
|
|
92
|
+
"@oxc-transform-relay/binding-linux-ppc64-gnu": "0.151.0",
|
|
93
|
+
"@oxc-transform-relay/binding-linux-riscv64-gnu": "0.151.0",
|
|
94
|
+
"@oxc-transform-relay/binding-linux-riscv64-musl": "0.151.0",
|
|
95
|
+
"@oxc-transform-relay/binding-linux-s390x-gnu": "0.151.0",
|
|
96
|
+
"@oxc-transform-relay/binding-darwin-x64": "0.151.0",
|
|
97
|
+
"@oxc-transform-relay/binding-win32-x64-msvc": "0.151.0",
|
|
98
|
+
"@oxc-transform-relay/binding-freebsd-x64": "0.151.0",
|
|
99
|
+
"@oxc-transform-relay/binding-linux-x64-gnu": "0.151.0",
|
|
100
|
+
"@oxc-transform-relay/binding-linux-x64-musl": "0.151.0"
|
|
101
101
|
},
|
|
102
102
|
"scripts": {
|
|
103
103
|
"build-dev": "napi build --esm --platform",
|