oxc-transform 0.87.0 → 0.89.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.js +195 -31
- package/package.json +16 -16
package/index.js
CHANGED
|
@@ -67,7 +67,7 @@ const isMuslFromChildProcess = () => {
|
|
|
67
67
|
function requireNative() {
|
|
68
68
|
if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) {
|
|
69
69
|
try {
|
|
70
|
-
|
|
70
|
+
return require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH);
|
|
71
71
|
} catch (err) {
|
|
72
72
|
loadErrors.push(err)
|
|
73
73
|
}
|
|
@@ -79,7 +79,12 @@ function requireNative() {
|
|
|
79
79
|
loadErrors.push(e)
|
|
80
80
|
}
|
|
81
81
|
try {
|
|
82
|
-
|
|
82
|
+
const binding = require('@oxc-transform/binding-android-arm64')
|
|
83
|
+
const bindingPackageVersion = require('@oxc-transform/binding-android-arm64/package.json').version
|
|
84
|
+
if (bindingPackageVersion !== '0.88.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
85
|
+
throw new Error(`Native binding package version mismatch, expected 0.88.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
86
|
+
}
|
|
87
|
+
return binding
|
|
83
88
|
} catch (e) {
|
|
84
89
|
loadErrors.push(e)
|
|
85
90
|
}
|
|
@@ -90,7 +95,12 @@ function requireNative() {
|
|
|
90
95
|
loadErrors.push(e)
|
|
91
96
|
}
|
|
92
97
|
try {
|
|
93
|
-
|
|
98
|
+
const binding = require('@oxc-transform/binding-android-arm-eabi')
|
|
99
|
+
const bindingPackageVersion = require('@oxc-transform/binding-android-arm-eabi/package.json').version
|
|
100
|
+
if (bindingPackageVersion !== '0.88.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
101
|
+
throw new Error(`Native binding package version mismatch, expected 0.88.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
102
|
+
}
|
|
103
|
+
return binding
|
|
94
104
|
} catch (e) {
|
|
95
105
|
loadErrors.push(e)
|
|
96
106
|
}
|
|
@@ -105,7 +115,12 @@ function requireNative() {
|
|
|
105
115
|
loadErrors.push(e)
|
|
106
116
|
}
|
|
107
117
|
try {
|
|
108
|
-
|
|
118
|
+
const binding = require('@oxc-transform/binding-win32-x64-msvc')
|
|
119
|
+
const bindingPackageVersion = require('@oxc-transform/binding-win32-x64-msvc/package.json').version
|
|
120
|
+
if (bindingPackageVersion !== '0.88.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
121
|
+
throw new Error(`Native binding package version mismatch, expected 0.88.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
122
|
+
}
|
|
123
|
+
return binding
|
|
109
124
|
} catch (e) {
|
|
110
125
|
loadErrors.push(e)
|
|
111
126
|
}
|
|
@@ -116,7 +131,12 @@ function requireNative() {
|
|
|
116
131
|
loadErrors.push(e)
|
|
117
132
|
}
|
|
118
133
|
try {
|
|
119
|
-
|
|
134
|
+
const binding = require('@oxc-transform/binding-win32-ia32-msvc')
|
|
135
|
+
const bindingPackageVersion = require('@oxc-transform/binding-win32-ia32-msvc/package.json').version
|
|
136
|
+
if (bindingPackageVersion !== '0.88.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
137
|
+
throw new Error(`Native binding package version mismatch, expected 0.88.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
138
|
+
}
|
|
139
|
+
return binding
|
|
120
140
|
} catch (e) {
|
|
121
141
|
loadErrors.push(e)
|
|
122
142
|
}
|
|
@@ -127,7 +147,12 @@ function requireNative() {
|
|
|
127
147
|
loadErrors.push(e)
|
|
128
148
|
}
|
|
129
149
|
try {
|
|
130
|
-
|
|
150
|
+
const binding = require('@oxc-transform/binding-win32-arm64-msvc')
|
|
151
|
+
const bindingPackageVersion = require('@oxc-transform/binding-win32-arm64-msvc/package.json').version
|
|
152
|
+
if (bindingPackageVersion !== '0.88.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
153
|
+
throw new Error(`Native binding package version mismatch, expected 0.88.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
154
|
+
}
|
|
155
|
+
return binding
|
|
131
156
|
} catch (e) {
|
|
132
157
|
loadErrors.push(e)
|
|
133
158
|
}
|
|
@@ -141,7 +166,12 @@ function requireNative() {
|
|
|
141
166
|
loadErrors.push(e)
|
|
142
167
|
}
|
|
143
168
|
try {
|
|
144
|
-
|
|
169
|
+
const binding = require('@oxc-transform/binding-darwin-universal')
|
|
170
|
+
const bindingPackageVersion = require('@oxc-transform/binding-darwin-universal/package.json').version
|
|
171
|
+
if (bindingPackageVersion !== '0.88.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
172
|
+
throw new Error(`Native binding package version mismatch, expected 0.88.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
173
|
+
}
|
|
174
|
+
return binding
|
|
145
175
|
} catch (e) {
|
|
146
176
|
loadErrors.push(e)
|
|
147
177
|
}
|
|
@@ -152,7 +182,12 @@ function requireNative() {
|
|
|
152
182
|
loadErrors.push(e)
|
|
153
183
|
}
|
|
154
184
|
try {
|
|
155
|
-
|
|
185
|
+
const binding = require('@oxc-transform/binding-darwin-x64')
|
|
186
|
+
const bindingPackageVersion = require('@oxc-transform/binding-darwin-x64/package.json').version
|
|
187
|
+
if (bindingPackageVersion !== '0.88.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
188
|
+
throw new Error(`Native binding package version mismatch, expected 0.88.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
189
|
+
}
|
|
190
|
+
return binding
|
|
156
191
|
} catch (e) {
|
|
157
192
|
loadErrors.push(e)
|
|
158
193
|
}
|
|
@@ -163,7 +198,12 @@ function requireNative() {
|
|
|
163
198
|
loadErrors.push(e)
|
|
164
199
|
}
|
|
165
200
|
try {
|
|
166
|
-
|
|
201
|
+
const binding = require('@oxc-transform/binding-darwin-arm64')
|
|
202
|
+
const bindingPackageVersion = require('@oxc-transform/binding-darwin-arm64/package.json').version
|
|
203
|
+
if (bindingPackageVersion !== '0.88.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
204
|
+
throw new Error(`Native binding package version mismatch, expected 0.88.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
205
|
+
}
|
|
206
|
+
return binding
|
|
167
207
|
} catch (e) {
|
|
168
208
|
loadErrors.push(e)
|
|
169
209
|
}
|
|
@@ -178,7 +218,12 @@ function requireNative() {
|
|
|
178
218
|
loadErrors.push(e)
|
|
179
219
|
}
|
|
180
220
|
try {
|
|
181
|
-
|
|
221
|
+
const binding = require('@oxc-transform/binding-freebsd-x64')
|
|
222
|
+
const bindingPackageVersion = require('@oxc-transform/binding-freebsd-x64/package.json').version
|
|
223
|
+
if (bindingPackageVersion !== '0.88.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
224
|
+
throw new Error(`Native binding package version mismatch, expected 0.88.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
225
|
+
}
|
|
226
|
+
return binding
|
|
182
227
|
} catch (e) {
|
|
183
228
|
loadErrors.push(e)
|
|
184
229
|
}
|
|
@@ -189,7 +234,12 @@ function requireNative() {
|
|
|
189
234
|
loadErrors.push(e)
|
|
190
235
|
}
|
|
191
236
|
try {
|
|
192
|
-
|
|
237
|
+
const binding = require('@oxc-transform/binding-freebsd-arm64')
|
|
238
|
+
const bindingPackageVersion = require('@oxc-transform/binding-freebsd-arm64/package.json').version
|
|
239
|
+
if (bindingPackageVersion !== '0.88.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
240
|
+
throw new Error(`Native binding package version mismatch, expected 0.88.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
241
|
+
}
|
|
242
|
+
return binding
|
|
193
243
|
} catch (e) {
|
|
194
244
|
loadErrors.push(e)
|
|
195
245
|
}
|
|
@@ -205,7 +255,12 @@ function requireNative() {
|
|
|
205
255
|
loadErrors.push(e)
|
|
206
256
|
}
|
|
207
257
|
try {
|
|
208
|
-
|
|
258
|
+
const binding = require('@oxc-transform/binding-linux-x64-musl')
|
|
259
|
+
const bindingPackageVersion = require('@oxc-transform/binding-linux-x64-musl/package.json').version
|
|
260
|
+
if (bindingPackageVersion !== '0.88.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
261
|
+
throw new Error(`Native binding package version mismatch, expected 0.88.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
262
|
+
}
|
|
263
|
+
return binding
|
|
209
264
|
} catch (e) {
|
|
210
265
|
loadErrors.push(e)
|
|
211
266
|
}
|
|
@@ -216,7 +271,12 @@ function requireNative() {
|
|
|
216
271
|
loadErrors.push(e)
|
|
217
272
|
}
|
|
218
273
|
try {
|
|
219
|
-
|
|
274
|
+
const binding = require('@oxc-transform/binding-linux-x64-gnu')
|
|
275
|
+
const bindingPackageVersion = require('@oxc-transform/binding-linux-x64-gnu/package.json').version
|
|
276
|
+
if (bindingPackageVersion !== '0.88.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
277
|
+
throw new Error(`Native binding package version mismatch, expected 0.88.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
278
|
+
}
|
|
279
|
+
return binding
|
|
220
280
|
} catch (e) {
|
|
221
281
|
loadErrors.push(e)
|
|
222
282
|
}
|
|
@@ -229,7 +289,12 @@ function requireNative() {
|
|
|
229
289
|
loadErrors.push(e)
|
|
230
290
|
}
|
|
231
291
|
try {
|
|
232
|
-
|
|
292
|
+
const binding = require('@oxc-transform/binding-linux-arm64-musl')
|
|
293
|
+
const bindingPackageVersion = require('@oxc-transform/binding-linux-arm64-musl/package.json').version
|
|
294
|
+
if (bindingPackageVersion !== '0.88.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
295
|
+
throw new Error(`Native binding package version mismatch, expected 0.88.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
296
|
+
}
|
|
297
|
+
return binding
|
|
233
298
|
} catch (e) {
|
|
234
299
|
loadErrors.push(e)
|
|
235
300
|
}
|
|
@@ -240,7 +305,12 @@ function requireNative() {
|
|
|
240
305
|
loadErrors.push(e)
|
|
241
306
|
}
|
|
242
307
|
try {
|
|
243
|
-
|
|
308
|
+
const binding = require('@oxc-transform/binding-linux-arm64-gnu')
|
|
309
|
+
const bindingPackageVersion = require('@oxc-transform/binding-linux-arm64-gnu/package.json').version
|
|
310
|
+
if (bindingPackageVersion !== '0.88.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
311
|
+
throw new Error(`Native binding package version mismatch, expected 0.88.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
312
|
+
}
|
|
313
|
+
return binding
|
|
244
314
|
} catch (e) {
|
|
245
315
|
loadErrors.push(e)
|
|
246
316
|
}
|
|
@@ -253,7 +323,12 @@ function requireNative() {
|
|
|
253
323
|
loadErrors.push(e)
|
|
254
324
|
}
|
|
255
325
|
try {
|
|
256
|
-
|
|
326
|
+
const binding = require('@oxc-transform/binding-linux-arm-musleabihf')
|
|
327
|
+
const bindingPackageVersion = require('@oxc-transform/binding-linux-arm-musleabihf/package.json').version
|
|
328
|
+
if (bindingPackageVersion !== '0.88.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
329
|
+
throw new Error(`Native binding package version mismatch, expected 0.88.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
330
|
+
}
|
|
331
|
+
return binding
|
|
257
332
|
} catch (e) {
|
|
258
333
|
loadErrors.push(e)
|
|
259
334
|
}
|
|
@@ -264,7 +339,46 @@ function requireNative() {
|
|
|
264
339
|
loadErrors.push(e)
|
|
265
340
|
}
|
|
266
341
|
try {
|
|
267
|
-
|
|
342
|
+
const binding = require('@oxc-transform/binding-linux-arm-gnueabihf')
|
|
343
|
+
const bindingPackageVersion = require('@oxc-transform/binding-linux-arm-gnueabihf/package.json').version
|
|
344
|
+
if (bindingPackageVersion !== '0.88.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
345
|
+
throw new Error(`Native binding package version mismatch, expected 0.88.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
346
|
+
}
|
|
347
|
+
return binding
|
|
348
|
+
} catch (e) {
|
|
349
|
+
loadErrors.push(e)
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
} else if (process.arch === 'loong64') {
|
|
353
|
+
if (isMusl()) {
|
|
354
|
+
try {
|
|
355
|
+
return require('./transform.linux-loong64-musl.node')
|
|
356
|
+
} catch (e) {
|
|
357
|
+
loadErrors.push(e)
|
|
358
|
+
}
|
|
359
|
+
try {
|
|
360
|
+
const binding = require('@oxc-transform/binding-linux-loong64-musl')
|
|
361
|
+
const bindingPackageVersion = require('@oxc-transform/binding-linux-loong64-musl/package.json').version
|
|
362
|
+
if (bindingPackageVersion !== '0.88.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
363
|
+
throw new Error(`Native binding package version mismatch, expected 0.88.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
364
|
+
}
|
|
365
|
+
return binding
|
|
366
|
+
} catch (e) {
|
|
367
|
+
loadErrors.push(e)
|
|
368
|
+
}
|
|
369
|
+
} else {
|
|
370
|
+
try {
|
|
371
|
+
return require('./transform.linux-loong64-gnu.node')
|
|
372
|
+
} catch (e) {
|
|
373
|
+
loadErrors.push(e)
|
|
374
|
+
}
|
|
375
|
+
try {
|
|
376
|
+
const binding = require('@oxc-transform/binding-linux-loong64-gnu')
|
|
377
|
+
const bindingPackageVersion = require('@oxc-transform/binding-linux-loong64-gnu/package.json').version
|
|
378
|
+
if (bindingPackageVersion !== '0.88.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
379
|
+
throw new Error(`Native binding package version mismatch, expected 0.88.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
380
|
+
}
|
|
381
|
+
return binding
|
|
268
382
|
} catch (e) {
|
|
269
383
|
loadErrors.push(e)
|
|
270
384
|
}
|
|
@@ -277,7 +391,12 @@ function requireNative() {
|
|
|
277
391
|
loadErrors.push(e)
|
|
278
392
|
}
|
|
279
393
|
try {
|
|
280
|
-
|
|
394
|
+
const binding = require('@oxc-transform/binding-linux-riscv64-musl')
|
|
395
|
+
const bindingPackageVersion = require('@oxc-transform/binding-linux-riscv64-musl/package.json').version
|
|
396
|
+
if (bindingPackageVersion !== '0.88.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
397
|
+
throw new Error(`Native binding package version mismatch, expected 0.88.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
398
|
+
}
|
|
399
|
+
return binding
|
|
281
400
|
} catch (e) {
|
|
282
401
|
loadErrors.push(e)
|
|
283
402
|
}
|
|
@@ -288,7 +407,12 @@ function requireNative() {
|
|
|
288
407
|
loadErrors.push(e)
|
|
289
408
|
}
|
|
290
409
|
try {
|
|
291
|
-
|
|
410
|
+
const binding = require('@oxc-transform/binding-linux-riscv64-gnu')
|
|
411
|
+
const bindingPackageVersion = require('@oxc-transform/binding-linux-riscv64-gnu/package.json').version
|
|
412
|
+
if (bindingPackageVersion !== '0.88.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
413
|
+
throw new Error(`Native binding package version mismatch, expected 0.88.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
414
|
+
}
|
|
415
|
+
return binding
|
|
292
416
|
} catch (e) {
|
|
293
417
|
loadErrors.push(e)
|
|
294
418
|
}
|
|
@@ -300,7 +424,12 @@ function requireNative() {
|
|
|
300
424
|
loadErrors.push(e)
|
|
301
425
|
}
|
|
302
426
|
try {
|
|
303
|
-
|
|
427
|
+
const binding = require('@oxc-transform/binding-linux-ppc64-gnu')
|
|
428
|
+
const bindingPackageVersion = require('@oxc-transform/binding-linux-ppc64-gnu/package.json').version
|
|
429
|
+
if (bindingPackageVersion !== '0.88.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
430
|
+
throw new Error(`Native binding package version mismatch, expected 0.88.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
431
|
+
}
|
|
432
|
+
return binding
|
|
304
433
|
} catch (e) {
|
|
305
434
|
loadErrors.push(e)
|
|
306
435
|
}
|
|
@@ -311,7 +440,12 @@ function requireNative() {
|
|
|
311
440
|
loadErrors.push(e)
|
|
312
441
|
}
|
|
313
442
|
try {
|
|
314
|
-
|
|
443
|
+
const binding = require('@oxc-transform/binding-linux-s390x-gnu')
|
|
444
|
+
const bindingPackageVersion = require('@oxc-transform/binding-linux-s390x-gnu/package.json').version
|
|
445
|
+
if (bindingPackageVersion !== '0.88.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
446
|
+
throw new Error(`Native binding package version mismatch, expected 0.88.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
447
|
+
}
|
|
448
|
+
return binding
|
|
315
449
|
} catch (e) {
|
|
316
450
|
loadErrors.push(e)
|
|
317
451
|
}
|
|
@@ -321,34 +455,49 @@ function requireNative() {
|
|
|
321
455
|
} else if (process.platform === 'openharmony') {
|
|
322
456
|
if (process.arch === 'arm64') {
|
|
323
457
|
try {
|
|
324
|
-
return require('./transform.
|
|
458
|
+
return require('./transform.openharmony-arm64.node')
|
|
325
459
|
} catch (e) {
|
|
326
460
|
loadErrors.push(e)
|
|
327
461
|
}
|
|
328
462
|
try {
|
|
329
|
-
|
|
463
|
+
const binding = require('@oxc-transform/binding-openharmony-arm64')
|
|
464
|
+
const bindingPackageVersion = require('@oxc-transform/binding-openharmony-arm64/package.json').version
|
|
465
|
+
if (bindingPackageVersion !== '0.88.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
466
|
+
throw new Error(`Native binding package version mismatch, expected 0.88.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
467
|
+
}
|
|
468
|
+
return binding
|
|
330
469
|
} catch (e) {
|
|
331
470
|
loadErrors.push(e)
|
|
332
471
|
}
|
|
333
472
|
} else if (process.arch === 'x64') {
|
|
334
473
|
try {
|
|
335
|
-
return require('./transform.
|
|
474
|
+
return require('./transform.openharmony-x64.node')
|
|
336
475
|
} catch (e) {
|
|
337
476
|
loadErrors.push(e)
|
|
338
477
|
}
|
|
339
478
|
try {
|
|
340
|
-
|
|
479
|
+
const binding = require('@oxc-transform/binding-openharmony-x64')
|
|
480
|
+
const bindingPackageVersion = require('@oxc-transform/binding-openharmony-x64/package.json').version
|
|
481
|
+
if (bindingPackageVersion !== '0.88.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
482
|
+
throw new Error(`Native binding package version mismatch, expected 0.88.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
483
|
+
}
|
|
484
|
+
return binding
|
|
341
485
|
} catch (e) {
|
|
342
486
|
loadErrors.push(e)
|
|
343
487
|
}
|
|
344
488
|
} else if (process.arch === 'arm') {
|
|
345
489
|
try {
|
|
346
|
-
return require('./transform.
|
|
490
|
+
return require('./transform.openharmony-arm.node')
|
|
347
491
|
} catch (e) {
|
|
348
492
|
loadErrors.push(e)
|
|
349
493
|
}
|
|
350
494
|
try {
|
|
351
|
-
|
|
495
|
+
const binding = require('@oxc-transform/binding-openharmony-arm')
|
|
496
|
+
const bindingPackageVersion = require('@oxc-transform/binding-openharmony-arm/package.json').version
|
|
497
|
+
if (bindingPackageVersion !== '0.88.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
498
|
+
throw new Error(`Native binding package version mismatch, expected 0.88.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
499
|
+
}
|
|
500
|
+
return binding
|
|
352
501
|
} catch (e) {
|
|
353
502
|
loadErrors.push(e)
|
|
354
503
|
}
|
|
@@ -363,22 +512,32 @@ function requireNative() {
|
|
|
363
512
|
nativeBinding = requireNative()
|
|
364
513
|
|
|
365
514
|
if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
|
|
515
|
+
let wasiBinding = null
|
|
516
|
+
let wasiBindingError = null
|
|
366
517
|
try {
|
|
367
|
-
|
|
518
|
+
wasiBinding = require('./transform.wasi.cjs')
|
|
519
|
+
nativeBinding = wasiBinding
|
|
368
520
|
} catch (err) {
|
|
369
521
|
if (process.env.NAPI_RS_FORCE_WASI) {
|
|
370
|
-
|
|
522
|
+
wasiBindingError = err
|
|
371
523
|
}
|
|
372
524
|
}
|
|
373
525
|
if (!nativeBinding) {
|
|
374
526
|
try {
|
|
375
|
-
|
|
527
|
+
wasiBinding = require('@oxc-transform/binding-wasm32-wasi')
|
|
528
|
+
nativeBinding = wasiBinding
|
|
376
529
|
} catch (err) {
|
|
377
530
|
if (process.env.NAPI_RS_FORCE_WASI) {
|
|
531
|
+
wasiBindingError.cause = err
|
|
378
532
|
loadErrors.push(err)
|
|
379
533
|
}
|
|
380
534
|
}
|
|
381
535
|
}
|
|
536
|
+
if (process.env.NAPI_RS_FORCE_WASI === 'error' && !wasiBinding) {
|
|
537
|
+
const error = new Error('WASI binding not found and NAPI_RS_FORCE_WASI is set to error')
|
|
538
|
+
error.cause = wasiBindingError
|
|
539
|
+
throw error
|
|
540
|
+
}
|
|
382
541
|
}
|
|
383
542
|
|
|
384
543
|
if (!nativeBinding && globalThis.process?.versions?.["webcontainer"]) {
|
|
@@ -395,7 +554,12 @@ if (!nativeBinding) {
|
|
|
395
554
|
`Cannot find native binding. ` +
|
|
396
555
|
`npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). ` +
|
|
397
556
|
'Please try `npm i` again after removing both package-lock.json and node_modules directory.',
|
|
398
|
-
{
|
|
557
|
+
{
|
|
558
|
+
cause: loadErrors.reduce((err, cur) => {
|
|
559
|
+
cur.cause = err
|
|
560
|
+
return cur
|
|
561
|
+
}),
|
|
562
|
+
},
|
|
399
563
|
)
|
|
400
564
|
}
|
|
401
565
|
throw new Error(`Failed to load native binding`)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oxc-transform",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.89.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"browser": "browser.js",
|
|
@@ -65,21 +65,21 @@
|
|
|
65
65
|
}
|
|
66
66
|
},
|
|
67
67
|
"optionalDependencies": {
|
|
68
|
-
"@oxc-transform/binding-win32-x64-msvc": "0.
|
|
69
|
-
"@oxc-transform/binding-win32-arm64-msvc": "0.
|
|
70
|
-
"@oxc-transform/binding-linux-x64-gnu": "0.
|
|
71
|
-
"@oxc-transform/binding-linux-x64-musl": "0.
|
|
72
|
-
"@oxc-transform/binding-freebsd-x64": "0.
|
|
73
|
-
"@oxc-transform/binding-linux-arm64-gnu": "0.
|
|
74
|
-
"@oxc-transform/binding-linux-arm64-musl": "0.
|
|
75
|
-
"@oxc-transform/binding-linux-arm-gnueabihf": "0.
|
|
76
|
-
"@oxc-transform/binding-linux-arm-musleabihf": "0.
|
|
77
|
-
"@oxc-transform/binding-linux-s390x-gnu": "0.
|
|
78
|
-
"@oxc-transform/binding-linux-riscv64-gnu": "0.
|
|
79
|
-
"@oxc-transform/binding-darwin-x64": "0.
|
|
80
|
-
"@oxc-transform/binding-darwin-arm64": "0.
|
|
81
|
-
"@oxc-transform/binding-android-arm64": "0.
|
|
82
|
-
"@oxc-transform/binding-wasm32-wasi": "0.
|
|
68
|
+
"@oxc-transform/binding-win32-x64-msvc": "0.89.0",
|
|
69
|
+
"@oxc-transform/binding-win32-arm64-msvc": "0.89.0",
|
|
70
|
+
"@oxc-transform/binding-linux-x64-gnu": "0.89.0",
|
|
71
|
+
"@oxc-transform/binding-linux-x64-musl": "0.89.0",
|
|
72
|
+
"@oxc-transform/binding-freebsd-x64": "0.89.0",
|
|
73
|
+
"@oxc-transform/binding-linux-arm64-gnu": "0.89.0",
|
|
74
|
+
"@oxc-transform/binding-linux-arm64-musl": "0.89.0",
|
|
75
|
+
"@oxc-transform/binding-linux-arm-gnueabihf": "0.89.0",
|
|
76
|
+
"@oxc-transform/binding-linux-arm-musleabihf": "0.89.0",
|
|
77
|
+
"@oxc-transform/binding-linux-s390x-gnu": "0.89.0",
|
|
78
|
+
"@oxc-transform/binding-linux-riscv64-gnu": "0.89.0",
|
|
79
|
+
"@oxc-transform/binding-darwin-x64": "0.89.0",
|
|
80
|
+
"@oxc-transform/binding-darwin-arm64": "0.89.0",
|
|
81
|
+
"@oxc-transform/binding-android-arm64": "0.89.0",
|
|
82
|
+
"@oxc-transform/binding-wasm32-wasi": "0.89.0"
|
|
83
83
|
},
|
|
84
84
|
"scripts": {
|
|
85
85
|
"build-dev": "napi build --esm --platform",
|