oxc-transform-relay 0.150.0 → 0.152.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/browser.js +1 -1
- package/index.d.ts +42 -1
- package/index.js +120 -56
- package/package.json +54 -23
- package/transform-relay.wasm32-wasip1.wasm +0 -0
- package/transform-relay.wasm32-wasip1.wasm.d.mts +6 -0
- package/transform-relay.wasm32-wasip1.workerd.d.mts +2 -0
- package/transform-relay.wasm32-wasip1.workerd.mjs +2 -0
package/browser.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from '@oxc-transform-relay/binding-wasm32-
|
|
1
|
+
export * from '@oxc-transform-relay/binding-wasm32-wasip1'
|
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
|
|
@@ -28,6 +36,39 @@ export declare const enum Severity {
|
|
|
28
36
|
Advice = 'Advice',
|
|
29
37
|
}
|
|
30
38
|
|
|
39
|
+
/** See <https://tc39.es/ecma426/#sec-source-map-format>. */
|
|
40
|
+
export interface JSONSourceMap {
|
|
41
|
+
/** The version field, must be 3. */
|
|
42
|
+
version: number
|
|
43
|
+
/** An optional name of the generated code that this source map is associated with. */
|
|
44
|
+
file?: string
|
|
45
|
+
/** A string with the encoded mapping data. */
|
|
46
|
+
mappings: string
|
|
47
|
+
/**
|
|
48
|
+
* An optional source root, useful for relocating source files on a server or removing repeated values in the "sources" entry.
|
|
49
|
+
* This value is prepended to the individual entries in the "source" field.
|
|
50
|
+
*/
|
|
51
|
+
sourceRoot?: string
|
|
52
|
+
/** A list of original sources used by the "mappings" entry. */
|
|
53
|
+
sources: Array<string>
|
|
54
|
+
/**
|
|
55
|
+
* An optional list of source content, useful when the "source" can't be hosted.
|
|
56
|
+
* The contents are listed in the same order as the sources in line 5. "null" may be used if some original sources should be retrieved by name.
|
|
57
|
+
*/
|
|
58
|
+
sourcesContent?: Array<string | undefined | null>
|
|
59
|
+
/** A list of symbol names used by the "mappings" entry. */
|
|
60
|
+
names: Array<string>
|
|
61
|
+
/** An optional field containing the debugId for this sourcemap. */
|
|
62
|
+
debugId?: string
|
|
63
|
+
/**
|
|
64
|
+
* Identifies third-party sources (such as framework code or bundler-generated code), allowing developers to avoid code that they don't want to see or step through, without having to configure this beforehand.
|
|
65
|
+
* The `ignoreList` field refers to the `sources` array, and lists the indices of all the known third-party sources in that source map.
|
|
66
|
+
* When parsing the source map, developer tools can use this to determine sections of the code that the browser loads and runs that could be automatically ignore-listed.
|
|
67
|
+
* JSON input falls back to the deprecated `x_google_ignoreList` when `ignoreList` is missing or null.
|
|
68
|
+
*/
|
|
69
|
+
ignoreList?: Array<number>
|
|
70
|
+
}
|
|
71
|
+
|
|
31
72
|
export interface SourceMap {
|
|
32
73
|
file?: string
|
|
33
74
|
mappings: string
|
|
@@ -36,7 +77,7 @@ export interface SourceMap {
|
|
|
36
77
|
sources: Array<string>
|
|
37
78
|
sourcesContent?: Array<string>
|
|
38
79
|
version: number
|
|
39
|
-
|
|
80
|
+
ignoreList?: Array<number>
|
|
40
81
|
}
|
|
41
82
|
|
|
42
83
|
/**
|
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.152.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.152.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.152.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.152.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.152.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.152.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.152.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.152.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.152.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.152.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.152.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.152.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.152.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.152.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.152.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.152.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.152.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.152.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.152.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.152.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.152.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.152.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.152.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.152.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.152.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.152.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.152.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.152.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.152.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.152.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.152.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.152.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.152.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.152.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.152.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.152.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.152.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.152.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.152.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.152.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.152.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.152.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.152.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.152.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.152.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.152.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.152.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.152.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.152.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.152.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.152.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.152.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
515
528
|
}
|
|
516
529
|
return binding
|
|
517
530
|
} catch (e) {
|
|
@@ -552,7 +565,7 @@ function createLoadErrorChain(errors) {
|
|
|
552
565
|
//
|
|
553
566
|
// NAPI_RS_WASI_FLAVOR selects one exact generated flavor and implies strict
|
|
554
567
|
// WASI loading. It never crosses into another flavor or falls back to native.
|
|
555
|
-
const __napiWasiFlavors = ['wasm32-wasi']
|
|
568
|
+
const __napiWasiFlavors = ['wasm32-wasi', 'wasm32-wasip1']
|
|
556
569
|
const __napiWasiFlavor = process.env.NAPI_RS_WASI_FLAVOR
|
|
557
570
|
const __napiWasiFlavorRequested =
|
|
558
571
|
typeof __napiWasiFlavor === 'string' && __napiWasiFlavor.length > 0
|
|
@@ -630,6 +643,28 @@ if (!nativeBinding || forceWasi) {
|
|
|
630
643
|
if (!candidateFailed) {
|
|
631
644
|
wasiBinding = require('./transform-relay.wasi.cjs')
|
|
632
645
|
nativeBinding = wasiBinding
|
|
646
|
+
__napiLoadedBindingTarget = 'wasm32-wasi'
|
|
647
|
+
wasiBindingLoaded = true
|
|
648
|
+
}
|
|
649
|
+
} catch (err) {
|
|
650
|
+
candidateError = err
|
|
651
|
+
candidateFailed = true
|
|
652
|
+
}
|
|
653
|
+
if (candidateFailed) {
|
|
654
|
+
wasiBindingErrors.push(candidateError)
|
|
655
|
+
loadErrors.push(candidateError)
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
if (!wasiBindingLoaded && (!__napiWasiFlavorRequested || __napiWasiFlavor === 'wasm32-wasip1')) {
|
|
659
|
+
let candidateError = null
|
|
660
|
+
let candidateFailed = false
|
|
661
|
+
try {
|
|
662
|
+
candidateError = __napiWasiResolveCandidate('./transform-relay.wasip1.cjs', false, ['./transform-relay.wasm32-wasip1.debug.wasm', './transform-relay.wasm32-wasip1.wasm'])
|
|
663
|
+
candidateFailed = candidateError !== null
|
|
664
|
+
if (!candidateFailed) {
|
|
665
|
+
wasiBinding = require('./transform-relay.wasip1.cjs')
|
|
666
|
+
nativeBinding = wasiBinding
|
|
667
|
+
__napiLoadedBindingTarget = 'wasm32-wasip1'
|
|
633
668
|
wasiBindingLoaded = true
|
|
634
669
|
}
|
|
635
670
|
} catch (err) {
|
|
@@ -650,12 +685,40 @@ if (!nativeBinding || forceWasi) {
|
|
|
650
685
|
if (!candidateFailed) {
|
|
651
686
|
if (process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
652
687
|
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.
|
|
688
|
+
if (bindingPackageVersion !== '0.152.0') {
|
|
689
|
+
throw new Error(`WASI binding package version mismatch, expected 0.152.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
655
690
|
}
|
|
656
691
|
}
|
|
657
692
|
wasiBinding = require('@oxc-transform-relay/binding-wasm32-wasi')
|
|
658
693
|
nativeBinding = wasiBinding
|
|
694
|
+
__napiLoadedBindingTarget = 'wasm32-wasi'
|
|
695
|
+
wasiBindingLoaded = true
|
|
696
|
+
}
|
|
697
|
+
} catch (err) {
|
|
698
|
+
candidateError = err
|
|
699
|
+
candidateFailed = true
|
|
700
|
+
}
|
|
701
|
+
if (candidateFailed) {
|
|
702
|
+
wasiBindingErrors.push(candidateError)
|
|
703
|
+
loadErrors.push(candidateError)
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
if (!wasiBindingLoaded && (!__napiWasiFlavorRequested || __napiWasiFlavor === 'wasm32-wasip1')) {
|
|
707
|
+
let candidateError = null
|
|
708
|
+
let candidateFailed = false
|
|
709
|
+
try {
|
|
710
|
+
candidateError = __napiWasiResolveCandidate('@oxc-transform-relay/binding-wasm32-wasip1', true, undefined)
|
|
711
|
+
candidateFailed = candidateError !== null
|
|
712
|
+
if (!candidateFailed) {
|
|
713
|
+
if (process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
714
|
+
const bindingPackageVersion = require('@oxc-transform-relay/binding-wasm32-wasip1/package.json').version
|
|
715
|
+
if (bindingPackageVersion !== '0.152.0') {
|
|
716
|
+
throw new Error(`WASI binding package version mismatch, expected 0.152.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
wasiBinding = require('@oxc-transform-relay/binding-wasm32-wasip1')
|
|
720
|
+
nativeBinding = wasiBinding
|
|
721
|
+
__napiLoadedBindingTarget = 'wasm32-wasip1'
|
|
659
722
|
wasiBindingLoaded = true
|
|
660
723
|
}
|
|
661
724
|
} catch (err) {
|
|
@@ -713,3 +776,4 @@ const { Severity, transform, transformSync } = nativeBinding
|
|
|
713
776
|
export { Severity }
|
|
714
777
|
export { transform }
|
|
715
778
|
export { transformSync }
|
|
779
|
+
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.152.0",
|
|
4
4
|
"description": "Oxc Relay Transform Node API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"graphql",
|
|
@@ -26,7 +26,11 @@
|
|
|
26
26
|
"browser.js",
|
|
27
27
|
"index.d.ts",
|
|
28
28
|
"index.js",
|
|
29
|
-
"webcontainer-fallback.cjs"
|
|
29
|
+
"webcontainer-fallback.cjs",
|
|
30
|
+
"transform-relay.wasm32-wasip1.workerd.mjs",
|
|
31
|
+
"transform-relay.wasm32-wasip1.workerd.d.mts",
|
|
32
|
+
"transform-relay.wasm32-wasip1.wasm",
|
|
33
|
+
"transform-relay.wasm32-wasip1.wasm.d.mts"
|
|
30
34
|
],
|
|
31
35
|
"type": "module",
|
|
32
36
|
"sideEffects": false,
|
|
@@ -39,10 +43,10 @@
|
|
|
39
43
|
"devDependencies": {
|
|
40
44
|
"@emnapi/core": "2.0.0-alpha.3",
|
|
41
45
|
"@emnapi/runtime": "2.0.0-alpha.3",
|
|
42
|
-
"@napi-rs/cli": "3.
|
|
46
|
+
"@napi-rs/cli": "3.10.5",
|
|
43
47
|
"@types/node": "24.1.0",
|
|
44
48
|
"publint": "0.3.24",
|
|
45
|
-
"vitest": "5.0.
|
|
49
|
+
"vitest": "5.0.1"
|
|
46
50
|
},
|
|
47
51
|
"napi": {
|
|
48
52
|
"binaryName": "transform-relay",
|
|
@@ -62,6 +66,7 @@
|
|
|
62
66
|
"riscv64gc-unknown-linux-gnu",
|
|
63
67
|
"riscv64gc-unknown-linux-musl",
|
|
64
68
|
"s390x-unknown-linux-gnu",
|
|
69
|
+
"wasm32-wasip1",
|
|
65
70
|
"wasm32-wasip1-threads",
|
|
66
71
|
"x86_64-apple-darwin",
|
|
67
72
|
"x86_64-pc-windows-msvc",
|
|
@@ -79,25 +84,49 @@
|
|
|
79
84
|
"node": "^20.19.0 || >=22.12.0"
|
|
80
85
|
},
|
|
81
86
|
"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.
|
|
87
|
+
"@oxc-transform-relay/binding-darwin-arm64": "0.152.0",
|
|
88
|
+
"@oxc-transform-relay/binding-android-arm64": "0.152.0",
|
|
89
|
+
"@oxc-transform-relay/binding-win32-arm64-msvc": "0.152.0",
|
|
90
|
+
"@oxc-transform-relay/binding-linux-arm64-gnu": "0.152.0",
|
|
91
|
+
"@oxc-transform-relay/binding-linux-arm64-musl": "0.152.0",
|
|
92
|
+
"@oxc-transform-relay/binding-openharmony-arm64": "0.152.0",
|
|
93
|
+
"@oxc-transform-relay/binding-android-arm-eabi": "0.152.0",
|
|
94
|
+
"@oxc-transform-relay/binding-linux-arm-gnueabihf": "0.152.0",
|
|
95
|
+
"@oxc-transform-relay/binding-linux-arm-musleabihf": "0.152.0",
|
|
96
|
+
"@oxc-transform-relay/binding-win32-ia32-msvc": "0.152.0",
|
|
97
|
+
"@oxc-transform-relay/binding-linux-ppc64-gnu": "0.152.0",
|
|
98
|
+
"@oxc-transform-relay/binding-linux-riscv64-gnu": "0.152.0",
|
|
99
|
+
"@oxc-transform-relay/binding-linux-riscv64-musl": "0.152.0",
|
|
100
|
+
"@oxc-transform-relay/binding-linux-s390x-gnu": "0.152.0",
|
|
101
|
+
"@oxc-transform-relay/binding-darwin-x64": "0.152.0",
|
|
102
|
+
"@oxc-transform-relay/binding-win32-x64-msvc": "0.152.0",
|
|
103
|
+
"@oxc-transform-relay/binding-freebsd-x64": "0.152.0",
|
|
104
|
+
"@oxc-transform-relay/binding-linux-x64-gnu": "0.152.0",
|
|
105
|
+
"@oxc-transform-relay/binding-linux-x64-musl": "0.152.0"
|
|
106
|
+
},
|
|
107
|
+
"exports": {
|
|
108
|
+
".": {
|
|
109
|
+
"browser": "./browser.js",
|
|
110
|
+
"import": "./index.js",
|
|
111
|
+
"node": "./index.js",
|
|
112
|
+
"default": "./index.js"
|
|
113
|
+
},
|
|
114
|
+
"./*": "./*",
|
|
115
|
+
"./browser": "./browser.js",
|
|
116
|
+
"./index": "./index.js",
|
|
117
|
+
"./package": "./package.json",
|
|
118
|
+
"./workerd": {
|
|
119
|
+
"types": "./transform-relay.wasm32-wasip1.workerd.d.mts",
|
|
120
|
+
"default": "./transform-relay.wasm32-wasip1.workerd.mjs"
|
|
121
|
+
},
|
|
122
|
+
"./wasm": {
|
|
123
|
+
"types": "./transform-relay.wasm32-wasip1.wasm.d.mts",
|
|
124
|
+
"default": "./transform-relay.wasm32-wasip1.wasm"
|
|
125
|
+
},
|
|
126
|
+
"./wasm.wasm": {
|
|
127
|
+
"types": "./transform-relay.wasm32-wasip1.wasm.d.mts",
|
|
128
|
+
"default": "./transform-relay.wasm32-wasip1.wasm"
|
|
129
|
+
}
|
|
101
130
|
},
|
|
102
131
|
"scripts": {
|
|
103
132
|
"build-dev": "napi build --esm --platform",
|
|
@@ -107,6 +136,8 @@
|
|
|
107
136
|
"postbuild-dev": "node scripts/patch.js",
|
|
108
137
|
"build-wasm": "pnpm run build-wasm-dev --release",
|
|
109
138
|
"build-wasm-dev": "pnpm run build-dev --target wasm32-wasip1-threads --dts transform-relay.wasi.d.cts",
|
|
139
|
+
"build-wasip1": "pnpm run build-wasip1-dev --release",
|
|
140
|
+
"build-wasip1-dev": "pnpm run build-dev --target wasm32-wasip1 --dts transform-relay.wasip1.d.cts",
|
|
110
141
|
"test": "vitest run --dir ./test"
|
|
111
142
|
}
|
|
112
143
|
}
|
|
Binary file
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// napi-rs-wasi-root-facade:{"version":1,"flavorPackage":"@oxc-transform-relay/binding-wasm32-wasip1","wasmSha256":"f7581b8e02682252f2ba279277d32081599391098f5aad3008dc527e4d9795f7"}
|
|
2
|
+
/* auto-generated by NAPI-RS */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
|
|
5
|
+
declare const wasmModule: WebAssembly.Module
|
|
6
|
+
export default wasmModule
|