oxc-transform-relay 0.149.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 +12 -1
- package/index.js +97 -82
- package/package.json +21 -21
package/index.d.ts
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
/* auto-generated by NAPI-RS */
|
|
2
2
|
/* eslint-disable */
|
|
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
|
+
|
|
3
12
|
export interface Comment {
|
|
4
13
|
type: 'Line' | 'Block'
|
|
5
14
|
value: string
|
|
@@ -24,8 +33,9 @@ export interface OxcError {
|
|
|
24
33
|
export declare const enum Severity {
|
|
25
34
|
Error = 'Error',
|
|
26
35
|
Warning = 'Warning',
|
|
27
|
-
Advice = 'Advice'
|
|
36
|
+
Advice = 'Advice',
|
|
28
37
|
}
|
|
38
|
+
|
|
29
39
|
export interface SourceMap {
|
|
30
40
|
file?: string
|
|
31
41
|
mappings: string
|
|
@@ -36,6 +46,7 @@ export interface SourceMap {
|
|
|
36
46
|
version: number
|
|
37
47
|
x_google_ignoreList?: Array<number>
|
|
38
48
|
}
|
|
49
|
+
|
|
39
50
|
/**
|
|
40
51
|
* Apply the Relay `graphql` tagged template transform asynchronously.
|
|
41
52
|
*
|
package/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// prettier-ignore
|
|
2
1
|
/* eslint-disable */
|
|
3
2
|
// @ts-nocheck
|
|
4
3
|
/* auto-generated by NAPI-RS */
|
|
@@ -8,6 +7,10 @@ const require = createRequire(import.meta.url)
|
|
|
8
7
|
|
|
9
8
|
const { readFileSync } = require('fs')
|
|
10
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'
|
|
11
14
|
const loadErrors = []
|
|
12
15
|
|
|
13
16
|
const isMusl = () => {
|
|
@@ -66,7 +69,16 @@ const isMuslFromChildProcess = () => {
|
|
|
66
69
|
function requireNative() {
|
|
67
70
|
if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) {
|
|
68
71
|
try {
|
|
69
|
-
|
|
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
|
|
70
82
|
} catch (err) {
|
|
71
83
|
loadErrors.push(err)
|
|
72
84
|
}
|
|
@@ -80,8 +92,8 @@ function requireNative() {
|
|
|
80
92
|
try {
|
|
81
93
|
const binding = require('@oxc-transform-relay/binding-android-arm64')
|
|
82
94
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-android-arm64/package.json').version
|
|
83
|
-
if (bindingPackageVersion !== '0.
|
|
84
|
-
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.`)
|
|
85
97
|
}
|
|
86
98
|
return binding
|
|
87
99
|
} catch (e) {
|
|
@@ -96,8 +108,8 @@ function requireNative() {
|
|
|
96
108
|
try {
|
|
97
109
|
const binding = require('@oxc-transform-relay/binding-android-arm-eabi')
|
|
98
110
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-android-arm-eabi/package.json').version
|
|
99
|
-
if (bindingPackageVersion !== '0.
|
|
100
|
-
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.`)
|
|
101
113
|
}
|
|
102
114
|
return binding
|
|
103
115
|
} catch (e) {
|
|
@@ -110,36 +122,36 @@ function requireNative() {
|
|
|
110
122
|
if (process.arch === 'x64') {
|
|
111
123
|
if ((process.config && process.config.variables && process.config.variables.shlib_suffix === 'dll.a') || (process.config && process.config.variables && process.config.variables.node_target_type === 'shared_library')) {
|
|
112
124
|
try {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
125
|
+
return require('./transform-relay.win32-x64-gnu.node')
|
|
126
|
+
} catch (e) {
|
|
127
|
+
loadErrors.push(e)
|
|
128
|
+
}
|
|
129
|
+
try {
|
|
130
|
+
const binding = require('@oxc-transform-relay/binding-win32-x64-gnu')
|
|
131
|
+
const bindingPackageVersion = require('@oxc-transform-relay/binding-win32-x64-gnu/package.json').version
|
|
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.`)
|
|
134
|
+
}
|
|
135
|
+
return binding
|
|
136
|
+
} catch (e) {
|
|
137
|
+
loadErrors.push(e)
|
|
122
138
|
}
|
|
123
|
-
return binding
|
|
124
|
-
} catch (e) {
|
|
125
|
-
loadErrors.push(e)
|
|
126
|
-
}
|
|
127
139
|
} else {
|
|
128
140
|
try {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
141
|
+
return require('./transform-relay.win32-x64-msvc.node')
|
|
142
|
+
} catch (e) {
|
|
143
|
+
loadErrors.push(e)
|
|
144
|
+
}
|
|
145
|
+
try {
|
|
146
|
+
const binding = require('@oxc-transform-relay/binding-win32-x64-msvc')
|
|
147
|
+
const bindingPackageVersion = require('@oxc-transform-relay/binding-win32-x64-msvc/package.json').version
|
|
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.`)
|
|
150
|
+
}
|
|
151
|
+
return binding
|
|
152
|
+
} catch (e) {
|
|
153
|
+
loadErrors.push(e)
|
|
138
154
|
}
|
|
139
|
-
return binding
|
|
140
|
-
} catch (e) {
|
|
141
|
-
loadErrors.push(e)
|
|
142
|
-
}
|
|
143
155
|
}
|
|
144
156
|
} else if (process.arch === 'ia32') {
|
|
145
157
|
try {
|
|
@@ -150,8 +162,8 @@ function requireNative() {
|
|
|
150
162
|
try {
|
|
151
163
|
const binding = require('@oxc-transform-relay/binding-win32-ia32-msvc')
|
|
152
164
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-win32-ia32-msvc/package.json').version
|
|
153
|
-
if (bindingPackageVersion !== '0.
|
|
154
|
-
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.`)
|
|
155
167
|
}
|
|
156
168
|
return binding
|
|
157
169
|
} catch (e) {
|
|
@@ -166,8 +178,8 @@ function requireNative() {
|
|
|
166
178
|
try {
|
|
167
179
|
const binding = require('@oxc-transform-relay/binding-win32-arm64-msvc')
|
|
168
180
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-win32-arm64-msvc/package.json').version
|
|
169
|
-
if (bindingPackageVersion !== '0.
|
|
170
|
-
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.`)
|
|
171
183
|
}
|
|
172
184
|
return binding
|
|
173
185
|
} catch (e) {
|
|
@@ -185,8 +197,8 @@ function requireNative() {
|
|
|
185
197
|
try {
|
|
186
198
|
const binding = require('@oxc-transform-relay/binding-darwin-universal')
|
|
187
199
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-darwin-universal/package.json').version
|
|
188
|
-
if (bindingPackageVersion !== '0.
|
|
189
|
-
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.`)
|
|
190
202
|
}
|
|
191
203
|
return binding
|
|
192
204
|
} catch (e) {
|
|
@@ -201,8 +213,8 @@ function requireNative() {
|
|
|
201
213
|
try {
|
|
202
214
|
const binding = require('@oxc-transform-relay/binding-darwin-x64')
|
|
203
215
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-darwin-x64/package.json').version
|
|
204
|
-
if (bindingPackageVersion !== '0.
|
|
205
|
-
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.`)
|
|
206
218
|
}
|
|
207
219
|
return binding
|
|
208
220
|
} catch (e) {
|
|
@@ -217,8 +229,8 @@ function requireNative() {
|
|
|
217
229
|
try {
|
|
218
230
|
const binding = require('@oxc-transform-relay/binding-darwin-arm64')
|
|
219
231
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-darwin-arm64/package.json').version
|
|
220
|
-
if (bindingPackageVersion !== '0.
|
|
221
|
-
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.`)
|
|
222
234
|
}
|
|
223
235
|
return binding
|
|
224
236
|
} catch (e) {
|
|
@@ -237,8 +249,8 @@ function requireNative() {
|
|
|
237
249
|
try {
|
|
238
250
|
const binding = require('@oxc-transform-relay/binding-freebsd-x64')
|
|
239
251
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-freebsd-x64/package.json').version
|
|
240
|
-
if (bindingPackageVersion !== '0.
|
|
241
|
-
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.`)
|
|
242
254
|
}
|
|
243
255
|
return binding
|
|
244
256
|
} catch (e) {
|
|
@@ -253,8 +265,8 @@ function requireNative() {
|
|
|
253
265
|
try {
|
|
254
266
|
const binding = require('@oxc-transform-relay/binding-freebsd-arm64')
|
|
255
267
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-freebsd-arm64/package.json').version
|
|
256
|
-
if (bindingPackageVersion !== '0.
|
|
257
|
-
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.`)
|
|
258
270
|
}
|
|
259
271
|
return binding
|
|
260
272
|
} catch (e) {
|
|
@@ -274,8 +286,8 @@ function requireNative() {
|
|
|
274
286
|
try {
|
|
275
287
|
const binding = require('@oxc-transform-relay/binding-linux-x64-musl')
|
|
276
288
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-linux-x64-musl/package.json').version
|
|
277
|
-
if (bindingPackageVersion !== '0.
|
|
278
|
-
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.`)
|
|
279
291
|
}
|
|
280
292
|
return binding
|
|
281
293
|
} catch (e) {
|
|
@@ -290,8 +302,8 @@ function requireNative() {
|
|
|
290
302
|
try {
|
|
291
303
|
const binding = require('@oxc-transform-relay/binding-linux-x64-gnu')
|
|
292
304
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-linux-x64-gnu/package.json').version
|
|
293
|
-
if (bindingPackageVersion !== '0.
|
|
294
|
-
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.`)
|
|
295
307
|
}
|
|
296
308
|
return binding
|
|
297
309
|
} catch (e) {
|
|
@@ -308,8 +320,8 @@ function requireNative() {
|
|
|
308
320
|
try {
|
|
309
321
|
const binding = require('@oxc-transform-relay/binding-linux-arm64-musl')
|
|
310
322
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-linux-arm64-musl/package.json').version
|
|
311
|
-
if (bindingPackageVersion !== '0.
|
|
312
|
-
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.`)
|
|
313
325
|
}
|
|
314
326
|
return binding
|
|
315
327
|
} catch (e) {
|
|
@@ -324,8 +336,8 @@ function requireNative() {
|
|
|
324
336
|
try {
|
|
325
337
|
const binding = require('@oxc-transform-relay/binding-linux-arm64-gnu')
|
|
326
338
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-linux-arm64-gnu/package.json').version
|
|
327
|
-
if (bindingPackageVersion !== '0.
|
|
328
|
-
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.`)
|
|
329
341
|
}
|
|
330
342
|
return binding
|
|
331
343
|
} catch (e) {
|
|
@@ -342,8 +354,8 @@ function requireNative() {
|
|
|
342
354
|
try {
|
|
343
355
|
const binding = require('@oxc-transform-relay/binding-linux-arm-musleabihf')
|
|
344
356
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-linux-arm-musleabihf/package.json').version
|
|
345
|
-
if (bindingPackageVersion !== '0.
|
|
346
|
-
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.`)
|
|
347
359
|
}
|
|
348
360
|
return binding
|
|
349
361
|
} catch (e) {
|
|
@@ -358,8 +370,8 @@ function requireNative() {
|
|
|
358
370
|
try {
|
|
359
371
|
const binding = require('@oxc-transform-relay/binding-linux-arm-gnueabihf')
|
|
360
372
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-linux-arm-gnueabihf/package.json').version
|
|
361
|
-
if (bindingPackageVersion !== '0.
|
|
362
|
-
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.`)
|
|
363
375
|
}
|
|
364
376
|
return binding
|
|
365
377
|
} catch (e) {
|
|
@@ -376,8 +388,8 @@ function requireNative() {
|
|
|
376
388
|
try {
|
|
377
389
|
const binding = require('@oxc-transform-relay/binding-linux-loong64-musl')
|
|
378
390
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-linux-loong64-musl/package.json').version
|
|
379
|
-
if (bindingPackageVersion !== '0.
|
|
380
|
-
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.`)
|
|
381
393
|
}
|
|
382
394
|
return binding
|
|
383
395
|
} catch (e) {
|
|
@@ -392,8 +404,8 @@ function requireNative() {
|
|
|
392
404
|
try {
|
|
393
405
|
const binding = require('@oxc-transform-relay/binding-linux-loong64-gnu')
|
|
394
406
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-linux-loong64-gnu/package.json').version
|
|
395
|
-
if (bindingPackageVersion !== '0.
|
|
396
|
-
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.`)
|
|
397
409
|
}
|
|
398
410
|
return binding
|
|
399
411
|
} catch (e) {
|
|
@@ -410,8 +422,8 @@ function requireNative() {
|
|
|
410
422
|
try {
|
|
411
423
|
const binding = require('@oxc-transform-relay/binding-linux-riscv64-musl')
|
|
412
424
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-linux-riscv64-musl/package.json').version
|
|
413
|
-
if (bindingPackageVersion !== '0.
|
|
414
|
-
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.`)
|
|
415
427
|
}
|
|
416
428
|
return binding
|
|
417
429
|
} catch (e) {
|
|
@@ -426,8 +438,8 @@ function requireNative() {
|
|
|
426
438
|
try {
|
|
427
439
|
const binding = require('@oxc-transform-relay/binding-linux-riscv64-gnu')
|
|
428
440
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-linux-riscv64-gnu/package.json').version
|
|
429
|
-
if (bindingPackageVersion !== '0.
|
|
430
|
-
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.`)
|
|
431
443
|
}
|
|
432
444
|
return binding
|
|
433
445
|
} catch (e) {
|
|
@@ -443,8 +455,8 @@ function requireNative() {
|
|
|
443
455
|
try {
|
|
444
456
|
const binding = require('@oxc-transform-relay/binding-linux-ppc64-gnu')
|
|
445
457
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-linux-ppc64-gnu/package.json').version
|
|
446
|
-
if (bindingPackageVersion !== '0.
|
|
447
|
-
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.`)
|
|
448
460
|
}
|
|
449
461
|
return binding
|
|
450
462
|
} catch (e) {
|
|
@@ -459,8 +471,8 @@ function requireNative() {
|
|
|
459
471
|
try {
|
|
460
472
|
const binding = require('@oxc-transform-relay/binding-linux-s390x-gnu')
|
|
461
473
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-linux-s390x-gnu/package.json').version
|
|
462
|
-
if (bindingPackageVersion !== '0.
|
|
463
|
-
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.`)
|
|
464
476
|
}
|
|
465
477
|
return binding
|
|
466
478
|
} catch (e) {
|
|
@@ -479,8 +491,8 @@ function requireNative() {
|
|
|
479
491
|
try {
|
|
480
492
|
const binding = require('@oxc-transform-relay/binding-openharmony-arm64')
|
|
481
493
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-openharmony-arm64/package.json').version
|
|
482
|
-
if (bindingPackageVersion !== '0.
|
|
483
|
-
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.`)
|
|
484
496
|
}
|
|
485
497
|
return binding
|
|
486
498
|
} catch (e) {
|
|
@@ -495,8 +507,8 @@ function requireNative() {
|
|
|
495
507
|
try {
|
|
496
508
|
const binding = require('@oxc-transform-relay/binding-openharmony-x64')
|
|
497
509
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-openharmony-x64/package.json').version
|
|
498
|
-
if (bindingPackageVersion !== '0.
|
|
499
|
-
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.`)
|
|
500
512
|
}
|
|
501
513
|
return binding
|
|
502
514
|
} catch (e) {
|
|
@@ -511,8 +523,8 @@ function requireNative() {
|
|
|
511
523
|
try {
|
|
512
524
|
const binding = require('@oxc-transform-relay/binding-openharmony-arm')
|
|
513
525
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-openharmony-arm/package.json').version
|
|
514
|
-
if (bindingPackageVersion !== '0.
|
|
515
|
-
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.`)
|
|
516
528
|
}
|
|
517
529
|
return binding
|
|
518
530
|
} catch (e) {
|
|
@@ -553,7 +565,7 @@ function createLoadErrorChain(errors) {
|
|
|
553
565
|
//
|
|
554
566
|
// NAPI_RS_WASI_FLAVOR selects one exact generated flavor and implies strict
|
|
555
567
|
// WASI loading. It never crosses into another flavor or falls back to native.
|
|
556
|
-
const __napiWasiFlavors = [
|
|
568
|
+
const __napiWasiFlavors = ['wasm32-wasi']
|
|
557
569
|
const __napiWasiFlavor = process.env.NAPI_RS_WASI_FLAVOR
|
|
558
570
|
const __napiWasiFlavorRequested =
|
|
559
571
|
typeof __napiWasiFlavor === 'string' && __napiWasiFlavor.length > 0
|
|
@@ -622,15 +634,16 @@ if (!nativeBinding || forceWasi) {
|
|
|
622
634
|
}
|
|
623
635
|
return null
|
|
624
636
|
}
|
|
625
|
-
if (!wasiBindingLoaded && (!__napiWasiFlavorRequested || __napiWasiFlavor ===
|
|
637
|
+
if (!wasiBindingLoaded && (!__napiWasiFlavorRequested || __napiWasiFlavor === 'wasm32-wasi')) {
|
|
626
638
|
let candidateError = null
|
|
627
639
|
let candidateFailed = false
|
|
628
640
|
try {
|
|
629
|
-
candidateError = __napiWasiResolveCandidate('./transform-relay.wasi.cjs', false, [
|
|
641
|
+
candidateError = __napiWasiResolveCandidate('./transform-relay.wasi.cjs', false, ['./transform-relay.wasm32-wasi.debug.wasm', './transform-relay.wasm32-wasi.wasm'])
|
|
630
642
|
candidateFailed = candidateError !== null
|
|
631
643
|
if (!candidateFailed) {
|
|
632
644
|
wasiBinding = require('./transform-relay.wasi.cjs')
|
|
633
645
|
nativeBinding = wasiBinding
|
|
646
|
+
__napiLoadedBindingTarget = 'wasm32-wasi'
|
|
634
647
|
wasiBindingLoaded = true
|
|
635
648
|
}
|
|
636
649
|
} catch (err) {
|
|
@@ -642,7 +655,7 @@ if (!nativeBinding || forceWasi) {
|
|
|
642
655
|
loadErrors.push(candidateError)
|
|
643
656
|
}
|
|
644
657
|
}
|
|
645
|
-
if (!wasiBindingLoaded && (!__napiWasiFlavorRequested || __napiWasiFlavor ===
|
|
658
|
+
if (!wasiBindingLoaded && (!__napiWasiFlavorRequested || __napiWasiFlavor === 'wasm32-wasi')) {
|
|
646
659
|
let candidateError = null
|
|
647
660
|
let candidateFailed = false
|
|
648
661
|
try {
|
|
@@ -651,12 +664,13 @@ if (!nativeBinding || forceWasi) {
|
|
|
651
664
|
if (!candidateFailed) {
|
|
652
665
|
if (process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
653
666
|
const bindingPackageVersion = require('@oxc-transform-relay/binding-wasm32-wasi/package.json').version
|
|
654
|
-
if (bindingPackageVersion !== '0.
|
|
655
|
-
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.`)
|
|
656
669
|
}
|
|
657
670
|
}
|
|
658
671
|
wasiBinding = require('@oxc-transform-relay/binding-wasm32-wasi')
|
|
659
672
|
nativeBinding = wasiBinding
|
|
673
|
+
__napiLoadedBindingTarget = 'wasm32-wasi'
|
|
660
674
|
wasiBindingLoaded = true
|
|
661
675
|
}
|
|
662
676
|
} catch (err) {
|
|
@@ -714,3 +728,4 @@ const { Severity, transform, transformSync } = nativeBinding
|
|
|
714
728
|
export { Severity }
|
|
715
729
|
export { transform }
|
|
716
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",
|