rolldown 1.0.0-beta.43 → 1.0.0-beta.45
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/bin/cli.mjs +1 -0
- package/dist/cli-setup.d.mts +1 -0
- package/dist/cli-setup.mjs +16 -0
- package/dist/cli.mjs +1050 -76
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +5 -4
- package/dist/experimental-index.d.mts +21 -6
- package/dist/experimental-index.mjs +40 -16
- package/dist/filter-index.d.mts +2 -2
- package/dist/filter-index.mjs +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +4 -3
- package/dist/parallel-plugin-worker.mjs +4 -3
- package/dist/parallel-plugin.d.mts +2 -2
- package/dist/parse-ast-index.d.mts +3 -3
- package/dist/parse-ast-index.mjs +2 -1
- package/dist/shared/{parse-ast-index-DkUtf7vl.mjs → binding-D7oxcV7l.mjs} +152 -377
- package/dist/shared/{binding-BkaKdpud.d.mts → binding-S7w0fEEX.d.mts} +98 -22
- package/dist/shared/{define-config-BGtNx9V_.d.mts → define-config-BhR6ffrr.d.mts} +217 -99
- package/dist/shared/{load-config-CLB1MN5j.mjs → load-config-jm5iO_Ww.mjs} +4 -4
- package/dist/shared/{misc-CQeo-AFx.mjs → misc-usdOVIou.mjs} +1 -1
- package/dist/shared/parse-ast-index-lp33x2Wb.mjs +297 -0
- package/dist/shared/{prompt-B4e-jZUR.mjs → prompt-YGfbLmz5.mjs} +1 -1
- package/dist/shared/{src-DucjDcdj.mjs → src-CPA2meNe.mjs} +461 -356
- package/package.json +22 -25
- package/dist/shared/logger-B83ocDok.mjs +0 -985
|
@@ -37,13 +37,13 @@ var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
|
37
37
|
function getPostMessage(options) {
|
|
38
38
|
return typeof (options === null || options === void 0 ? void 0 : options.postMessage) === "function" ? options.postMessage : typeof postMessage === "function" ? postMessage : void 0;
|
|
39
39
|
}
|
|
40
|
-
function serizeErrorToBuffer(sab, code, error
|
|
40
|
+
function serizeErrorToBuffer(sab, code, error) {
|
|
41
41
|
var i32array = new Int32Array(sab);
|
|
42
42
|
Atomics.store(i32array, 0, code);
|
|
43
|
-
if (code > 1 && error
|
|
44
|
-
var name_1 = error
|
|
45
|
-
var message = error
|
|
46
|
-
var stack = error
|
|
43
|
+
if (code > 1 && error) {
|
|
44
|
+
var name_1 = error.name;
|
|
45
|
+
var message = error.message;
|
|
46
|
+
var stack = error.stack;
|
|
47
47
|
var nameBuffer = new TextEncoder().encode(name_1);
|
|
48
48
|
var messageBuffer = new TextEncoder().encode(message);
|
|
49
49
|
var stackBuffer = new TextEncoder().encode(stack);
|
|
@@ -70,14 +70,14 @@ function deserizeErrorFromBuffer(sab) {
|
|
|
70
70
|
var name = new TextDecoder().decode(nameBuffer);
|
|
71
71
|
var message = new TextDecoder().decode(messageBuffer);
|
|
72
72
|
var stack = new TextDecoder().decode(stackBuffer);
|
|
73
|
-
var error
|
|
74
|
-
Object.defineProperty(error
|
|
73
|
+
var error = new ((_a = globalThis[name]) !== null && _a !== void 0 ? _a : name === "RuntimeError" ? (_b = _WebAssembly$2.RuntimeError) !== null && _b !== void 0 ? _b : Error : Error)(message);
|
|
74
|
+
Object.defineProperty(error, "stack", {
|
|
75
75
|
value: stack,
|
|
76
76
|
writable: true,
|
|
77
77
|
enumerable: false,
|
|
78
78
|
configurable: true
|
|
79
79
|
});
|
|
80
|
-
return error
|
|
80
|
+
return error;
|
|
81
81
|
}
|
|
82
82
|
/** @public */
|
|
83
83
|
function isSharedArrayBuffer(value) {
|
|
@@ -222,9 +222,9 @@ function setupInstance(wasi, instance) {
|
|
|
222
222
|
wasi[kInstance$1] = instance;
|
|
223
223
|
wasi[kSetMemory$1](instance.exports.memory);
|
|
224
224
|
}
|
|
225
|
-
function notifyPthreadCreateResult(sab, result, error
|
|
225
|
+
function notifyPthreadCreateResult(sab, result, error) {
|
|
226
226
|
if (sab) {
|
|
227
|
-
serizeErrorToBuffer(sab.buffer, result, error
|
|
227
|
+
serizeErrorToBuffer(sab.buffer, result, error);
|
|
228
228
|
Atomics.notify(sab, 0);
|
|
229
229
|
}
|
|
230
230
|
}
|
|
@@ -812,7 +812,7 @@ var init_tslib_es6 = __esm({ "../../node_modules/.pnpm/tslib@2.8.1/node_modules/
|
|
|
812
812
|
}) });
|
|
813
813
|
|
|
814
814
|
//#endregion
|
|
815
|
-
//#region ../../node_modules/.pnpm/@emnapi+core@1.
|
|
815
|
+
//#region ../../node_modules/.pnpm/@emnapi+core@1.6.0/node_modules/@emnapi/core/dist/emnapi-core.esm-bundler.js
|
|
816
816
|
var emnapi_core_esm_bundler_exports = /* @__PURE__ */ __export({
|
|
817
817
|
MessageHandler: () => MessageHandler$1,
|
|
818
818
|
ThreadManager: () => ThreadManager,
|
|
@@ -2489,6 +2489,9 @@ function createNapiModule(options) {
|
|
|
2489
2489
|
emnapiExternalMemory.table = /* @__PURE__ */ new WeakMap();
|
|
2490
2490
|
emnapiExternalMemory.wasmMemoryViewTable = /* @__PURE__ */ new WeakMap();
|
|
2491
2491
|
},
|
|
2492
|
+
isSharedArrayBuffer: function(value) {
|
|
2493
|
+
return typeof SharedArrayBuffer === "function" && value instanceof SharedArrayBuffer || Object.prototype.toString.call(value) === "[object SharedArrayBuffer]";
|
|
2494
|
+
},
|
|
2492
2495
|
isDetachedArrayBuffer: function(arrayBuffer) {
|
|
2493
2496
|
if (arrayBuffer.byteLength === 0) try {
|
|
2494
2497
|
new Uint8Array(arrayBuffer);
|
|
@@ -2822,7 +2825,7 @@ function createNapiModule(options) {
|
|
|
2822
2825
|
envObject.checkGCAccess();
|
|
2823
2826
|
if (!arraybuffer) return envObject.setLastError(1);
|
|
2824
2827
|
var handle = emnapiCtx.handleStore.get(arraybuffer);
|
|
2825
|
-
if (!handle.isArrayBuffer()) return envObject.setLastError(1);
|
|
2828
|
+
if (!handle.isArrayBuffer() && !emnapiExternalMemory.isSharedArrayBuffer(handle.value)) return envObject.setLastError(1);
|
|
2826
2829
|
var HEAP_DATA_VIEW = new DataView(wasmMemory.buffer);
|
|
2827
2830
|
if (data) {
|
|
2828
2831
|
var p = emnapiExternalMemory.getArrayBufferPointer(handle.value, true).address;
|
|
@@ -3977,7 +3980,7 @@ function createNapiModule(options) {
|
|
|
3977
3980
|
offset = offset !== null && offset !== void 0 ? offset : 0;
|
|
3978
3981
|
offset = offset >>> 0;
|
|
3979
3982
|
var view;
|
|
3980
|
-
if (arrayBufferOrView instanceof ArrayBuffer) {
|
|
3983
|
+
if (arrayBufferOrView instanceof ArrayBuffer || emnapiExternalMemory.isSharedArrayBuffer(arrayBufferOrView)) {
|
|
3981
3984
|
var pointer = emnapiExternalMemory.getArrayBufferPointer(arrayBufferOrView, false).address;
|
|
3982
3985
|
if (!pointer) throw new Error("Unknown ArrayBuffer address");
|
|
3983
3986
|
if (typeof len !== "number" || len === -1) len = arrayBufferOrView.byteLength - offset;
|
|
@@ -4021,7 +4024,7 @@ function createNapiModule(options) {
|
|
|
4021
4024
|
var HEAP_DATA_VIEW = new DataView(wasmMemory.buffer);
|
|
4022
4025
|
var handleId = HEAP_DATA_VIEW.getUint32(arraybuffer_or_view, true);
|
|
4023
4026
|
var handle = envObject.ctx.handleStore.get(handleId);
|
|
4024
|
-
if (!handle.isArrayBuffer() && !handle.isTypedArray() && !handle.isDataView()) return envObject.setLastError(1);
|
|
4027
|
+
if (!handle.isArrayBuffer() && !handle.isTypedArray() && !handle.isDataView() && !emnapiExternalMemory.isSharedArrayBuffer(handle.value)) return envObject.setLastError(1);
|
|
4025
4028
|
var ret = $emnapiSyncMemory(Boolean(js_to_wasm), handle.value, offset, len);
|
|
4026
4029
|
if (handle.value !== ret) {
|
|
4027
4030
|
v = envObject.ensureHandleId(ret);
|
|
@@ -4036,7 +4039,7 @@ function createNapiModule(options) {
|
|
|
4036
4039
|
function $emnapiGetMemoryAddress(arrayBufferOrView) {
|
|
4037
4040
|
var isArrayBuffer = arrayBufferOrView instanceof ArrayBuffer;
|
|
4038
4041
|
var isDataView = arrayBufferOrView instanceof DataView;
|
|
4039
|
-
if (!isArrayBuffer && !(ArrayBuffer.isView(arrayBufferOrView) && !isDataView) && !isDataView) throw new TypeError("emnapiGetMemoryAddress expect ArrayBuffer or ArrayBufferView as first parameter");
|
|
4042
|
+
if (!isArrayBuffer && !(ArrayBuffer.isView(arrayBufferOrView) && !isDataView) && !isDataView && !emnapiExternalMemory.isSharedArrayBuffer(arrayBufferOrView)) throw new TypeError("emnapiGetMemoryAddress expect ArrayBuffer or ArrayBufferView as first parameter");
|
|
4040
4043
|
var info;
|
|
4041
4044
|
if (isArrayBuffer) info = emnapiExternalMemory.getArrayBufferPointer(arrayBufferOrView, false);
|
|
4042
4045
|
else info = emnapiExternalMemory.getViewPointer(arrayBufferOrView, false);
|
|
@@ -4138,9 +4141,9 @@ function createNapiModule(options) {
|
|
|
4138
4141
|
new DataView(wasmMemory.buffer).setUint32(result, value, true);
|
|
4139
4142
|
return envObject.clearLastError();
|
|
4140
4143
|
}
|
|
4141
|
-
function emnapiCreateArrayBuffer(byte_length, data) {
|
|
4144
|
+
function emnapiCreateArrayBuffer(byte_length, data, shared) {
|
|
4142
4145
|
byte_length = byte_length >>> 0;
|
|
4143
|
-
var arrayBuffer = new ArrayBuffer(byte_length);
|
|
4146
|
+
var arrayBuffer = shared ? new SharedArrayBuffer(byte_length) : new ArrayBuffer(byte_length);
|
|
4144
4147
|
if (data) {
|
|
4145
4148
|
var p = emnapiExternalMemory.getArrayBufferPointer(arrayBuffer, true).address;
|
|
4146
4149
|
new DataView(wasmMemory.buffer).setUint32(data, p, true);
|
|
@@ -4160,7 +4163,29 @@ function createNapiModule(options) {
|
|
|
4160
4163
|
envObject.clearLastError();
|
|
4161
4164
|
try {
|
|
4162
4165
|
if (!result) return envObject.setLastError(1);
|
|
4163
|
-
var arrayBuffer = emnapiCreateArrayBuffer(byte_length, data);
|
|
4166
|
+
var arrayBuffer = emnapiCreateArrayBuffer(byte_length, data, false);
|
|
4167
|
+
value = emnapiCtx.addToCurrentScope(arrayBuffer).id;
|
|
4168
|
+
new DataView(wasmMemory.buffer).setUint32(result, value, true);
|
|
4169
|
+
return envObject.getReturnStatus();
|
|
4170
|
+
} catch (err$1) {
|
|
4171
|
+
envObject.tryCatch.setError(err$1);
|
|
4172
|
+
return envObject.setLastError(10);
|
|
4173
|
+
}
|
|
4174
|
+
}
|
|
4175
|
+
/**
|
|
4176
|
+
* @__sig ipppp
|
|
4177
|
+
*/
|
|
4178
|
+
function node_api_create_sharedarraybuffer(env, byte_length, data, result) {
|
|
4179
|
+
var value;
|
|
4180
|
+
if (!env) return 1;
|
|
4181
|
+
var envObject = emnapiCtx.envStore.get(env);
|
|
4182
|
+
envObject.checkGCAccess();
|
|
4183
|
+
if (!envObject.tryCatch.isEmpty()) return envObject.setLastError(10);
|
|
4184
|
+
if (!envObject.canCallIntoJs()) return envObject.setLastError(envObject.moduleApiVersion >= 10 ? 23 : 10);
|
|
4185
|
+
envObject.clearLastError();
|
|
4186
|
+
try {
|
|
4187
|
+
if (!result) return envObject.setLastError(1);
|
|
4188
|
+
var arrayBuffer = emnapiCreateArrayBuffer(byte_length, data, true);
|
|
4164
4189
|
value = emnapiCtx.addToCurrentScope(arrayBuffer).id;
|
|
4165
4190
|
new DataView(wasmMemory.buffer).setUint32(result, value, true);
|
|
4166
4191
|
return envObject.getReturnStatus();
|
|
@@ -4424,7 +4449,7 @@ function createNapiModule(options) {
|
|
|
4424
4449
|
if (!result) return envObject.setLastError(1);
|
|
4425
4450
|
var Buffer$1 = emnapiCtx.feature.Buffer;
|
|
4426
4451
|
if (!Buffer$1) throw emnapiCtx.createNotSupportBufferError("napi_create_buffer_copy", "");
|
|
4427
|
-
var arrayBuffer = emnapiCreateArrayBuffer(length, result_data);
|
|
4452
|
+
var arrayBuffer = emnapiCreateArrayBuffer(length, result_data, false);
|
|
4428
4453
|
var buffer = Buffer$1.from(arrayBuffer);
|
|
4429
4454
|
buffer.set(new Uint8Array(wasmMemory.buffer).subarray(data, data + length));
|
|
4430
4455
|
value = emnapiCtx.addToCurrentScope(buffer).id;
|
|
@@ -4562,6 +4587,7 @@ function createNapiModule(options) {
|
|
|
4562
4587
|
napi_create_symbol,
|
|
4563
4588
|
napi_create_typedarray,
|
|
4564
4589
|
node_api_create_buffer_from_arraybuffer,
|
|
4590
|
+
node_api_create_sharedarraybuffer,
|
|
4565
4591
|
node_api_symbol_for
|
|
4566
4592
|
});
|
|
4567
4593
|
/** @__sig ipip */
|
|
@@ -4641,7 +4667,7 @@ function createNapiModule(options) {
|
|
|
4641
4667
|
HEAP_DATA_VIEW.setUint32(engine_reserved, engineReserved, true);
|
|
4642
4668
|
}
|
|
4643
4669
|
/** @__sig ipp */
|
|
4644
|
-
function napi_throw(env, error
|
|
4670
|
+
function napi_throw(env, error) {
|
|
4645
4671
|
if (!env) return 1;
|
|
4646
4672
|
var envObject = emnapiCtx.envStore.get(env);
|
|
4647
4673
|
envObject.checkGCAccess();
|
|
@@ -4649,8 +4675,8 @@ function createNapiModule(options) {
|
|
|
4649
4675
|
if (!envObject.canCallIntoJs()) return envObject.setLastError(envObject.moduleApiVersion >= 10 ? 23 : 10);
|
|
4650
4676
|
envObject.clearLastError();
|
|
4651
4677
|
try {
|
|
4652
|
-
if (!error
|
|
4653
|
-
envObject.tryCatch.setError(emnapiCtx.handleStore.get(error
|
|
4678
|
+
if (!error) return envObject.setLastError(1);
|
|
4679
|
+
envObject.tryCatch.setError(emnapiCtx.handleStore.get(error).value);
|
|
4654
4680
|
return envObject.clearLastError();
|
|
4655
4681
|
} catch (err$1) {
|
|
4656
4682
|
envObject.tryCatch.setError(err$1);
|
|
@@ -4667,9 +4693,9 @@ function createNapiModule(options) {
|
|
|
4667
4693
|
envObject.clearLastError();
|
|
4668
4694
|
try {
|
|
4669
4695
|
if (!msg) return envObject.setLastError(1);
|
|
4670
|
-
var error
|
|
4671
|
-
if (code) error
|
|
4672
|
-
envObject.tryCatch.setError(error
|
|
4696
|
+
var error = new Error(emnapiString.UTF8ToString(msg, -1));
|
|
4697
|
+
if (code) error.code = emnapiString.UTF8ToString(code, -1);
|
|
4698
|
+
envObject.tryCatch.setError(error);
|
|
4673
4699
|
return envObject.clearLastError();
|
|
4674
4700
|
} catch (err$1) {
|
|
4675
4701
|
envObject.tryCatch.setError(err$1);
|
|
@@ -4686,9 +4712,9 @@ function createNapiModule(options) {
|
|
|
4686
4712
|
envObject.clearLastError();
|
|
4687
4713
|
try {
|
|
4688
4714
|
if (!msg) return envObject.setLastError(1);
|
|
4689
|
-
var error
|
|
4690
|
-
if (code) error
|
|
4691
|
-
envObject.tryCatch.setError(error
|
|
4715
|
+
var error = new TypeError(emnapiString.UTF8ToString(msg, -1));
|
|
4716
|
+
if (code) error.code = emnapiString.UTF8ToString(code, -1);
|
|
4717
|
+
envObject.tryCatch.setError(error);
|
|
4692
4718
|
return envObject.clearLastError();
|
|
4693
4719
|
} catch (err$1) {
|
|
4694
4720
|
envObject.tryCatch.setError(err$1);
|
|
@@ -4705,9 +4731,9 @@ function createNapiModule(options) {
|
|
|
4705
4731
|
envObject.clearLastError();
|
|
4706
4732
|
try {
|
|
4707
4733
|
if (!msg) return envObject.setLastError(1);
|
|
4708
|
-
var error
|
|
4709
|
-
if (code) error
|
|
4710
|
-
envObject.tryCatch.setError(error
|
|
4734
|
+
var error = new RangeError(emnapiString.UTF8ToString(msg, -1));
|
|
4735
|
+
if (code) error.code = emnapiString.UTF8ToString(code, -1);
|
|
4736
|
+
envObject.tryCatch.setError(error);
|
|
4711
4737
|
return envObject.clearLastError();
|
|
4712
4738
|
} catch (err$1) {
|
|
4713
4739
|
envObject.tryCatch.setError(err$1);
|
|
@@ -4724,9 +4750,9 @@ function createNapiModule(options) {
|
|
|
4724
4750
|
envObject.clearLastError();
|
|
4725
4751
|
try {
|
|
4726
4752
|
if (!msg) return envObject.setLastError(1);
|
|
4727
|
-
var error
|
|
4728
|
-
if (code) error
|
|
4729
|
-
envObject.tryCatch.setError(error
|
|
4753
|
+
var error = new SyntaxError(emnapiString.UTF8ToString(msg, -1));
|
|
4754
|
+
if (code) error.code = emnapiString.UTF8ToString(code, -1);
|
|
4755
|
+
envObject.tryCatch.setError(error);
|
|
4730
4756
|
return envObject.clearLastError();
|
|
4731
4757
|
} catch (err$1) {
|
|
4732
4758
|
envObject.tryCatch.setError(err$1);
|
|
@@ -4752,13 +4778,13 @@ function createNapiModule(options) {
|
|
|
4752
4778
|
if (!result) return envObject.setLastError(1);
|
|
4753
4779
|
var msgValue = emnapiCtx.handleStore.get(msg).value;
|
|
4754
4780
|
if (typeof msgValue !== "string") return envObject.setLastError(3);
|
|
4755
|
-
var error
|
|
4781
|
+
var error = new Error(msgValue);
|
|
4756
4782
|
if (code) {
|
|
4757
4783
|
var codeValue = emnapiCtx.handleStore.get(code).value;
|
|
4758
4784
|
if (typeof codeValue !== "string") return envObject.setLastError(3);
|
|
4759
|
-
error
|
|
4785
|
+
error.code = codeValue;
|
|
4760
4786
|
}
|
|
4761
|
-
var value = emnapiCtx.addToCurrentScope(error
|
|
4787
|
+
var value = emnapiCtx.addToCurrentScope(error).id;
|
|
4762
4788
|
new DataView(wasmMemory.buffer).setUint32(result, value, true);
|
|
4763
4789
|
return envObject.clearLastError();
|
|
4764
4790
|
}
|
|
@@ -4771,13 +4797,13 @@ function createNapiModule(options) {
|
|
|
4771
4797
|
if (!result) return envObject.setLastError(1);
|
|
4772
4798
|
var msgValue = emnapiCtx.handleStore.get(msg).value;
|
|
4773
4799
|
if (typeof msgValue !== "string") return envObject.setLastError(3);
|
|
4774
|
-
var error
|
|
4800
|
+
var error = new TypeError(msgValue);
|
|
4775
4801
|
if (code) {
|
|
4776
4802
|
var codeValue = emnapiCtx.handleStore.get(code).value;
|
|
4777
4803
|
if (typeof codeValue !== "string") return envObject.setLastError(3);
|
|
4778
|
-
error
|
|
4804
|
+
error.code = codeValue;
|
|
4779
4805
|
}
|
|
4780
|
-
var value = emnapiCtx.addToCurrentScope(error
|
|
4806
|
+
var value = emnapiCtx.addToCurrentScope(error).id;
|
|
4781
4807
|
new DataView(wasmMemory.buffer).setUint32(result, value, true);
|
|
4782
4808
|
return envObject.clearLastError();
|
|
4783
4809
|
}
|
|
@@ -4790,13 +4816,13 @@ function createNapiModule(options) {
|
|
|
4790
4816
|
if (!result) return envObject.setLastError(1);
|
|
4791
4817
|
var msgValue = emnapiCtx.handleStore.get(msg).value;
|
|
4792
4818
|
if (typeof msgValue !== "string") return envObject.setLastError(3);
|
|
4793
|
-
var error
|
|
4819
|
+
var error = new RangeError(msgValue);
|
|
4794
4820
|
if (code) {
|
|
4795
4821
|
var codeValue = emnapiCtx.handleStore.get(code).value;
|
|
4796
4822
|
if (typeof codeValue !== "string") return envObject.setLastError(3);
|
|
4797
|
-
error
|
|
4823
|
+
error.code = codeValue;
|
|
4798
4824
|
}
|
|
4799
|
-
var value = emnapiCtx.addToCurrentScope(error
|
|
4825
|
+
var value = emnapiCtx.addToCurrentScope(error).id;
|
|
4800
4826
|
new DataView(wasmMemory.buffer).setUint32(result, value, true);
|
|
4801
4827
|
return envObject.clearLastError();
|
|
4802
4828
|
}
|
|
@@ -4809,13 +4835,13 @@ function createNapiModule(options) {
|
|
|
4809
4835
|
if (!result) return envObject.setLastError(1);
|
|
4810
4836
|
var msgValue = emnapiCtx.handleStore.get(msg).value;
|
|
4811
4837
|
if (typeof msgValue !== "string") return envObject.setLastError(3);
|
|
4812
|
-
var error
|
|
4838
|
+
var error = new SyntaxError(msgValue);
|
|
4813
4839
|
if (code) {
|
|
4814
4840
|
var codeValue = emnapiCtx.handleStore.get(code).value;
|
|
4815
4841
|
if (typeof codeValue !== "string") return envObject.setLastError(3);
|
|
4816
|
-
error
|
|
4842
|
+
error.code = codeValue;
|
|
4817
4843
|
}
|
|
4818
|
-
var value = emnapiCtx.addToCurrentScope(error
|
|
4844
|
+
var value = emnapiCtx.addToCurrentScope(error).id;
|
|
4819
4845
|
new DataView(wasmMemory.buffer).setUint32(result, value, true);
|
|
4820
4846
|
return envObject.clearLastError();
|
|
4821
4847
|
}
|
|
@@ -4854,9 +4880,9 @@ function createNapiModule(options) {
|
|
|
4854
4880
|
envObject.clearLastError();
|
|
4855
4881
|
try {
|
|
4856
4882
|
if (!err$1) return envObject.setLastError(1);
|
|
4857
|
-
var error
|
|
4883
|
+
var error = envObject.ctx.handleStore.get(err$1);
|
|
4858
4884
|
try {
|
|
4859
|
-
envObject.triggerFatalException(error
|
|
4885
|
+
envObject.triggerFatalException(error.value);
|
|
4860
4886
|
} catch (_) {
|
|
4861
4887
|
return envObject.setLastError(9);
|
|
4862
4888
|
}
|
|
@@ -5996,6 +6022,18 @@ function createNapiModule(options) {
|
|
|
5996
6022
|
return envObject.clearLastError();
|
|
5997
6023
|
}
|
|
5998
6024
|
/** @__sig ippp */
|
|
6025
|
+
function node_api_is_sharedarraybuffer(env, value, result) {
|
|
6026
|
+
if (!env) return 1;
|
|
6027
|
+
var envObject = emnapiCtx.envStore.get(env);
|
|
6028
|
+
envObject.checkGCAccess();
|
|
6029
|
+
if (!value) return envObject.setLastError(1);
|
|
6030
|
+
if (!result) return envObject.setLastError(1);
|
|
6031
|
+
var h = emnapiCtx.handleStore.get(value);
|
|
6032
|
+
var r = typeof SharedArrayBuffer === "function" && h.value instanceof SharedArrayBuffer || Object.prototype.toString.call(h.value) === "[object SharedArrayBuffer]" ? 1 : 0;
|
|
6033
|
+
new DataView(wasmMemory.buffer).setInt8(result, r, true);
|
|
6034
|
+
return envObject.clearLastError();
|
|
6035
|
+
}
|
|
6036
|
+
/** @__sig ippp */
|
|
5999
6037
|
function napi_is_date(env, value, result) {
|
|
6000
6038
|
if (!env) return 1;
|
|
6001
6039
|
var envObject = emnapiCtx.envStore.get(env);
|
|
@@ -6133,7 +6171,8 @@ function createNapiModule(options) {
|
|
|
6133
6171
|
napi_is_error,
|
|
6134
6172
|
napi_is_typedarray,
|
|
6135
6173
|
napi_strict_equals,
|
|
6136
|
-
napi_typeof
|
|
6174
|
+
napi_typeof,
|
|
6175
|
+
node_api_is_sharedarraybuffer
|
|
6137
6176
|
});
|
|
6138
6177
|
/** @__sig ipp */
|
|
6139
6178
|
function napi_get_version(env, result) {
|
|
@@ -6314,7 +6353,7 @@ function instantiateNapiModuleSync$1(wasmInput, options) {
|
|
|
6314
6353
|
return loadNapiModuleImpl(loadSyncCallback, void 0, wasmInput, options);
|
|
6315
6354
|
}
|
|
6316
6355
|
var _WebAssembly$1, MessageHandler$1, version$2;
|
|
6317
|
-
var init_emnapi_core_esm_bundler = __esm({ "../../node_modules/.pnpm/@emnapi+core@1.
|
|
6356
|
+
var init_emnapi_core_esm_bundler = __esm({ "../../node_modules/.pnpm/@emnapi+core@1.6.0/node_modules/@emnapi/core/dist/emnapi-core.esm-bundler.js": (() => {
|
|
6318
6357
|
init_wasi_threads_esm_bundler();
|
|
6319
6358
|
init_wasi_threads_esm_bundler();
|
|
6320
6359
|
init_tslib_es6();
|
|
@@ -6366,11 +6405,11 @@ var init_emnapi_core_esm_bundler = __esm({ "../../node_modules/.pnpm/@emnapi+cor
|
|
|
6366
6405
|
};
|
|
6367
6406
|
return MessageHandler$2;
|
|
6368
6407
|
}(ThreadMessageHandler);
|
|
6369
|
-
version$2 = "1.
|
|
6408
|
+
version$2 = "1.6.0";
|
|
6370
6409
|
}) });
|
|
6371
6410
|
|
|
6372
6411
|
//#endregion
|
|
6373
|
-
//#region ../../node_modules/.pnpm/@emnapi+runtime@1.
|
|
6412
|
+
//#region ../../node_modules/.pnpm/@emnapi+runtime@1.6.0/node_modules/@emnapi/runtime/dist/emnapi.esm-bundler.js
|
|
6374
6413
|
var emnapi_esm_bundler_exports = /* @__PURE__ */ __export({
|
|
6375
6414
|
ConstHandle: () => ConstHandle,
|
|
6376
6415
|
Context: () => Context,
|
|
@@ -6448,7 +6487,7 @@ function getDefaultContext$1() {
|
|
|
6448
6487
|
return defaultContext;
|
|
6449
6488
|
}
|
|
6450
6489
|
var externalValue, External, supportNewFunction, _global, TryCatch, canSetFunctionName, supportReflect, supportFinalizer, supportWeakSymbol, supportBigInt, _require, _MessageChannel, _setImmediate, _Buffer, version$1, NODE_API_SUPPORTED_VERSION_MIN, NODE_API_SUPPORTED_VERSION_MAX, NAPI_VERSION_EXPERIMENTAL, NODE_API_DEFAULT_MODULE_API_VERSION, Handle, ConstHandle, HandleStore, HandleScope, ScopeStore, RefTracker, Finalizer, TrackedFinalizer, Env, NodeEnv, EmnapiError, NotSupportWeakRefError, NotSupportBufferError, StrongRef, Persistent, ReferenceOwnership, Reference, ReferenceWithData, ReferenceWithFinalizer, Deferred, Store, CleanupHookCallback, CleanupQueue, NodejsWaitingRequestCounter, Context, defaultContext;
|
|
6451
|
-
var init_emnapi_esm_bundler = __esm({ "../../node_modules/.pnpm/@emnapi+runtime@1.
|
|
6490
|
+
var init_emnapi_esm_bundler = __esm({ "../../node_modules/.pnpm/@emnapi+runtime@1.6.0/node_modules/@emnapi/runtime/dist/emnapi.esm-bundler.js": (() => {
|
|
6452
6491
|
init_tslib_es6();
|
|
6453
6492
|
externalValue = /* @__PURE__ */ new WeakMap();
|
|
6454
6493
|
External = (function() {
|
|
@@ -6567,7 +6606,7 @@ var init_emnapi_esm_bundler = __esm({ "../../node_modules/.pnpm/@emnapi+runtime@
|
|
|
6567
6606
|
return _require("buffer").Buffer;
|
|
6568
6607
|
} catch (_) {}
|
|
6569
6608
|
})();
|
|
6570
|
-
version$1 = "1.
|
|
6609
|
+
version$1 = "1.6.0";
|
|
6571
6610
|
NODE_API_SUPPORTED_VERSION_MIN = 1;
|
|
6572
6611
|
NODE_API_SUPPORTED_VERSION_MAX = 10;
|
|
6573
6612
|
NAPI_VERSION_EXPERIMENTAL = 2147483647;
|
|
@@ -6873,16 +6912,16 @@ var init_emnapi_esm_bundler = __esm({ "../../node_modules/.pnpm/@emnapi+runtime@
|
|
|
6873
6912
|
};
|
|
6874
6913
|
TrackedFinalizer$1.prototype.finalize = function() {
|
|
6875
6914
|
this.unlink();
|
|
6876
|
-
var error
|
|
6915
|
+
var error;
|
|
6877
6916
|
var caught = false;
|
|
6878
6917
|
try {
|
|
6879
6918
|
this._finalizer.callFinalizer();
|
|
6880
6919
|
} catch (err) {
|
|
6881
6920
|
caught = true;
|
|
6882
|
-
error
|
|
6921
|
+
error = err;
|
|
6883
6922
|
}
|
|
6884
6923
|
this.dispose();
|
|
6885
|
-
if (caught) throw error
|
|
6924
|
+
if (caught) throw error;
|
|
6886
6925
|
};
|
|
6887
6926
|
return TrackedFinalizer$1;
|
|
6888
6927
|
}(RefTracker);
|
|
@@ -8223,9 +8262,9 @@ function validateOptions(options) {
|
|
|
8223
8262
|
_WASI
|
|
8224
8263
|
};
|
|
8225
8264
|
}
|
|
8226
|
-
function initWASI(setMemory, wrap
|
|
8265
|
+
function initWASI(setMemory, wrap) {
|
|
8227
8266
|
this[kSetMemory] = setMemory;
|
|
8228
|
-
this.wasiImport = wrap
|
|
8267
|
+
this.wasiImport = wrap;
|
|
8229
8268
|
this[kStarted] = false;
|
|
8230
8269
|
this[kExitCode] = 0;
|
|
8231
8270
|
this[kInstance] = void 0;
|
|
@@ -8242,11 +8281,11 @@ async function createAsyncWASI(options = kEmptyObject) {
|
|
|
8242
8281
|
validateObject(options.asyncify, "options.asyncify");
|
|
8243
8282
|
validateFunction(options.asyncify.wrapImportFunction, "options.asyncify.wrapImportFunction");
|
|
8244
8283
|
}
|
|
8245
|
-
const wrap
|
|
8246
|
-
const setMemory = wrap
|
|
8247
|
-
delete wrap
|
|
8248
|
-
initWASI.call(_this, setMemory, wrap
|
|
8249
|
-
if (options.returnOnExit) wrap
|
|
8284
|
+
const wrap = await _WASI.createAsync(args, env, preopens, stdio, options.fs, options.print, options.printErr, options.asyncify);
|
|
8285
|
+
const setMemory = wrap._setMemory;
|
|
8286
|
+
delete wrap._setMemory;
|
|
8287
|
+
initWASI.call(_this, setMemory, wrap);
|
|
8288
|
+
if (options.returnOnExit) wrap.proc_exit = wasiReturnOnProcExit.bind(_this);
|
|
8250
8289
|
return _this;
|
|
8251
8290
|
}
|
|
8252
8291
|
var _WebAssembly, ignoreNames, Asyncify, CHAR_DOT, CHAR_FORWARD_SLASH, WasiRights, WasiError, RIGHTS_ALL, BLOCK_DEVICE_BASE, BLOCK_DEVICE_INHERITING, CHARACTER_DEVICE_BASE, CHARACTER_DEVICE_INHERITING, REGULAR_FILE_BASE, REGULAR_FILE_INHERITING, DIRECTORY_BASE, DIRECTORY_INHERITING, SOCKET_BASE, SOCKET_INHERITING, TTY_BASE, TTY_INHERITING, FileDescriptor, StandardOutput, FileDescriptorTable, SyncTable, AsyncTable, WebAssemblyMemory, Memory, _memory, _wasi, _fs, encoder, decoder, INT64_MAX, WASI$1, kEmptyObject, kExitCode, kSetMemory, kStarted, kInstance, kBindingName, WASI$2;
|
|
@@ -8475,9 +8514,9 @@ var init_wasm_util_esm_bundler = __esm({ "../../node_modules/.pnpm/@tybys+wasm-u
|
|
|
8475
8514
|
insertStdio(fd, expected, name) {
|
|
8476
8515
|
const type = 2;
|
|
8477
8516
|
const { base, inheriting } = getRights(this.stdio, fd, 2, type);
|
|
8478
|
-
const wrap
|
|
8479
|
-
if (wrap
|
|
8480
|
-
return wrap
|
|
8517
|
+
const wrap = this.insert(fd, name, name, type, base, inheriting, 0);
|
|
8518
|
+
if (wrap.id !== expected) throw new WasiError(`id: ${wrap.id} !== expected: ${expected}`, 8);
|
|
8519
|
+
return wrap;
|
|
8481
8520
|
}
|
|
8482
8521
|
insert(fd, mappedPath, realPath, type, rightsBase, rightsInheriting, preopen) {
|
|
8483
8522
|
var _a, _b;
|
|
@@ -9526,13 +9565,13 @@ var init_wasm_util_esm_bundler = __esm({ "../../node_modules/.pnpm/@tybys+wasm-u
|
|
|
9526
9565
|
const filetype = wasi.fds.getFileTypeByFd(r);
|
|
9527
9566
|
if (filetype !== 3 && ((o_flags & 2) !== 0 || resolved_path.endsWith("/"))) return 54;
|
|
9528
9567
|
const { base: max_base, inheriting: max_inheriting } = getRights(wasi.fds.stdio, r, flagsRes, filetype);
|
|
9529
|
-
const wrap
|
|
9568
|
+
const wrap = wasi.fds.insert(r, resolved_path, resolved_path, filetype, fs_rights_base & max_base, fs_rights_inheriting & max_inheriting, 0);
|
|
9530
9569
|
const stat = fs$2.fstatSync(r, { bigint: true });
|
|
9531
9570
|
if (stat.isFile()) {
|
|
9532
|
-
wrap
|
|
9533
|
-
if ((flagsRes & 1024) !== 0) wrap
|
|
9571
|
+
wrap.size = stat.size;
|
|
9572
|
+
if ((flagsRes & 1024) !== 0) wrap.pos = stat.size;
|
|
9534
9573
|
}
|
|
9535
|
-
memory.view.setInt32(fd, wrap
|
|
9574
|
+
memory.view.setInt32(fd, wrap.id, true);
|
|
9536
9575
|
return 0;
|
|
9537
9576
|
}, async function path_open(dirfd, dirflags, path, path_len, o_flags, fs_rights_base, fs_rights_inheriting, fs_flags, fd) {
|
|
9538
9577
|
path = Number(path);
|
|
@@ -9553,13 +9592,13 @@ var init_wasm_util_esm_bundler = __esm({ "../../node_modules/.pnpm/@tybys+wasm-u
|
|
|
9553
9592
|
const filetype = await wasi.fds.getFileTypeByFd(r);
|
|
9554
9593
|
if ((o_flags & 2) !== 0 && filetype !== 3) return 54;
|
|
9555
9594
|
const { base: max_base, inheriting: max_inheriting } = getRights(wasi.fds.stdio, r.fd, flagsRes, filetype);
|
|
9556
|
-
const wrap
|
|
9595
|
+
const wrap = wasi.fds.insert(r, resolved_path, resolved_path, filetype, fs_rights_base & max_base, fs_rights_inheriting & max_inheriting, 0);
|
|
9557
9596
|
const stat = await r.stat({ bigint: true });
|
|
9558
9597
|
if (stat.isFile()) {
|
|
9559
|
-
wrap
|
|
9560
|
-
if ((flagsRes & 1024) !== 0) wrap
|
|
9598
|
+
wrap.size = stat.size;
|
|
9599
|
+
if ((flagsRes & 1024) !== 0) wrap.pos = stat.size;
|
|
9561
9600
|
}
|
|
9562
|
-
memory.view.setInt32(fd, wrap
|
|
9601
|
+
memory.view.setInt32(fd, wrap.id, true);
|
|
9563
9602
|
return 0;
|
|
9564
9603
|
}, [
|
|
9565
9604
|
"i32",
|
|
@@ -9799,11 +9838,11 @@ var init_wasm_util_esm_bundler = __esm({ "../../node_modules/.pnpm/@tybys+wasm-u
|
|
|
9799
9838
|
WASI$2 = class {
|
|
9800
9839
|
constructor(options = kEmptyObject) {
|
|
9801
9840
|
const { args, env, preopens, stdio, _WASI } = validateOptions.call(this, options);
|
|
9802
|
-
const wrap
|
|
9803
|
-
const setMemory = wrap
|
|
9804
|
-
delete wrap
|
|
9805
|
-
initWASI.call(this, setMemory, wrap
|
|
9806
|
-
if (options.returnOnExit) wrap
|
|
9841
|
+
const wrap = _WASI.createSync(args, env, preopens, stdio, options.fs, options.print, options.printErr);
|
|
9842
|
+
const setMemory = wrap._setMemory;
|
|
9843
|
+
delete wrap._setMemory;
|
|
9844
|
+
initWASI.call(this, setMemory, wrap);
|
|
9845
|
+
if (options.returnOnExit) wrap.proc_exit = wasiReturnOnProcExit.bind(this);
|
|
9807
9846
|
}
|
|
9808
9847
|
finalizeBindings(instance, _a) {
|
|
9809
9848
|
var _b;
|
|
@@ -10158,12 +10197,12 @@ var require_rolldown_binding_wasi = /* @__PURE__ */ __commonJS({ "src/rolldown-b
|
|
|
10158
10197
|
module.exports.BindingNormalizedOptions = __napiModule.exports.BindingNormalizedOptions;
|
|
10159
10198
|
module.exports.BindingOutputAsset = __napiModule.exports.BindingOutputAsset;
|
|
10160
10199
|
module.exports.BindingOutputChunk = __napiModule.exports.BindingOutputChunk;
|
|
10161
|
-
module.exports.BindingOutputs = __napiModule.exports.BindingOutputs;
|
|
10162
10200
|
module.exports.BindingPluginContext = __napiModule.exports.BindingPluginContext;
|
|
10163
10201
|
module.exports.BindingRenderedChunk = __napiModule.exports.BindingRenderedChunk;
|
|
10164
10202
|
module.exports.BindingRenderedChunkMeta = __napiModule.exports.BindingRenderedChunkMeta;
|
|
10165
10203
|
module.exports.BindingRenderedModule = __napiModule.exports.BindingRenderedModule;
|
|
10166
10204
|
module.exports.BindingTransformPluginContext = __napiModule.exports.BindingTransformPluginContext;
|
|
10205
|
+
module.exports.BindingUrlResolver = __napiModule.exports.BindingUrlResolver;
|
|
10167
10206
|
module.exports.BindingWatcher = __napiModule.exports.BindingWatcher;
|
|
10168
10207
|
module.exports.BindingWatcherChangeData = __napiModule.exports.BindingWatcherChangeData;
|
|
10169
10208
|
module.exports.BindingWatcherEvent = __napiModule.exports.BindingWatcherEvent;
|
|
@@ -10173,7 +10212,6 @@ var require_rolldown_binding_wasi = /* @__PURE__ */ __commonJS({ "src/rolldown-b
|
|
|
10173
10212
|
module.exports.BindingAttachDebugInfo = __napiModule.exports.BindingAttachDebugInfo;
|
|
10174
10213
|
module.exports.BindingBuiltinPluginName = __napiModule.exports.BindingBuiltinPluginName;
|
|
10175
10214
|
module.exports.BindingChunkModuleOrderBy = __napiModule.exports.BindingChunkModuleOrderBy;
|
|
10176
|
-
module.exports.BindingJsx = __napiModule.exports.BindingJsx;
|
|
10177
10215
|
module.exports.BindingLogLevel = __napiModule.exports.BindingLogLevel;
|
|
10178
10216
|
module.exports.BindingPluginOrder = __napiModule.exports.BindingPluginOrder;
|
|
10179
10217
|
module.exports.BindingPropertyReadSideEffects = __napiModule.exports.BindingPropertyReadSideEffects;
|
|
@@ -10269,7 +10307,7 @@ function requireNative() {
|
|
|
10269
10307
|
try {
|
|
10270
10308
|
const binding = __require("@rolldown/binding-android-arm64");
|
|
10271
10309
|
const bindingPackageVersion = __require("@rolldown/binding-android-arm64/package.json").version;
|
|
10272
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10310
|
+
if (bindingPackageVersion !== "1.0.0-beta.45" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.45 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10273
10311
|
return binding;
|
|
10274
10312
|
} catch (e) {
|
|
10275
10313
|
loadErrors.push(e);
|
|
@@ -10283,13 +10321,13 @@ function requireNative() {
|
|
|
10283
10321
|
try {
|
|
10284
10322
|
const binding = __require("@rolldown/binding-android-arm-eabi");
|
|
10285
10323
|
const bindingPackageVersion = __require("@rolldown/binding-android-arm-eabi/package.json").version;
|
|
10286
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10324
|
+
if (bindingPackageVersion !== "1.0.0-beta.45" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.45 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10287
10325
|
return binding;
|
|
10288
10326
|
} catch (e) {
|
|
10289
10327
|
loadErrors.push(e);
|
|
10290
10328
|
}
|
|
10291
10329
|
} else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on Android ${process.arch}`));
|
|
10292
|
-
else if (process.platform === "win32") if (process.arch === "x64") if (process.
|
|
10330
|
+
else if (process.platform === "win32") if (process.arch === "x64") if (process.config?.variables?.shlib_suffix === "dll.a" || process.config?.variables?.node_target_type === "shared_library") {
|
|
10293
10331
|
try {
|
|
10294
10332
|
return __require("../rolldown-binding.win32-x64-gnu.node");
|
|
10295
10333
|
} catch (e) {
|
|
@@ -10298,7 +10336,7 @@ function requireNative() {
|
|
|
10298
10336
|
try {
|
|
10299
10337
|
const binding = __require("@rolldown/binding-win32-x64-gnu");
|
|
10300
10338
|
const bindingPackageVersion = __require("@rolldown/binding-win32-x64-gnu/package.json").version;
|
|
10301
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10339
|
+
if (bindingPackageVersion !== "1.0.0-beta.45" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.45 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10302
10340
|
return binding;
|
|
10303
10341
|
} catch (e) {
|
|
10304
10342
|
loadErrors.push(e);
|
|
@@ -10312,7 +10350,7 @@ function requireNative() {
|
|
|
10312
10350
|
try {
|
|
10313
10351
|
const binding = __require("@rolldown/binding-win32-x64-msvc");
|
|
10314
10352
|
const bindingPackageVersion = __require("@rolldown/binding-win32-x64-msvc/package.json").version;
|
|
10315
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10353
|
+
if (bindingPackageVersion !== "1.0.0-beta.45" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.45 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10316
10354
|
return binding;
|
|
10317
10355
|
} catch (e) {
|
|
10318
10356
|
loadErrors.push(e);
|
|
@@ -10327,7 +10365,7 @@ function requireNative() {
|
|
|
10327
10365
|
try {
|
|
10328
10366
|
const binding = __require("@rolldown/binding-win32-ia32-msvc");
|
|
10329
10367
|
const bindingPackageVersion = __require("@rolldown/binding-win32-ia32-msvc/package.json").version;
|
|
10330
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10368
|
+
if (bindingPackageVersion !== "1.0.0-beta.45" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.45 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10331
10369
|
return binding;
|
|
10332
10370
|
} catch (e) {
|
|
10333
10371
|
loadErrors.push(e);
|
|
@@ -10341,7 +10379,7 @@ function requireNative() {
|
|
|
10341
10379
|
try {
|
|
10342
10380
|
const binding = __require("@rolldown/binding-win32-arm64-msvc");
|
|
10343
10381
|
const bindingPackageVersion = __require("@rolldown/binding-win32-arm64-msvc/package.json").version;
|
|
10344
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10382
|
+
if (bindingPackageVersion !== "1.0.0-beta.45" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.45 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10345
10383
|
return binding;
|
|
10346
10384
|
} catch (e) {
|
|
10347
10385
|
loadErrors.push(e);
|
|
@@ -10356,7 +10394,7 @@ function requireNative() {
|
|
|
10356
10394
|
try {
|
|
10357
10395
|
const binding = __require("@rolldown/binding-darwin-universal");
|
|
10358
10396
|
const bindingPackageVersion = __require("@rolldown/binding-darwin-universal/package.json").version;
|
|
10359
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10397
|
+
if (bindingPackageVersion !== "1.0.0-beta.45" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.45 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10360
10398
|
return binding;
|
|
10361
10399
|
} catch (e) {
|
|
10362
10400
|
loadErrors.push(e);
|
|
@@ -10370,7 +10408,7 @@ function requireNative() {
|
|
|
10370
10408
|
try {
|
|
10371
10409
|
const binding = __require("@rolldown/binding-darwin-x64");
|
|
10372
10410
|
const bindingPackageVersion = __require("@rolldown/binding-darwin-x64/package.json").version;
|
|
10373
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10411
|
+
if (bindingPackageVersion !== "1.0.0-beta.45" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.45 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10374
10412
|
return binding;
|
|
10375
10413
|
} catch (e) {
|
|
10376
10414
|
loadErrors.push(e);
|
|
@@ -10384,7 +10422,7 @@ function requireNative() {
|
|
|
10384
10422
|
try {
|
|
10385
10423
|
const binding = __require("@rolldown/binding-darwin-arm64");
|
|
10386
10424
|
const bindingPackageVersion = __require("@rolldown/binding-darwin-arm64/package.json").version;
|
|
10387
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10425
|
+
if (bindingPackageVersion !== "1.0.0-beta.45" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.45 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10388
10426
|
return binding;
|
|
10389
10427
|
} catch (e) {
|
|
10390
10428
|
loadErrors.push(e);
|
|
@@ -10399,7 +10437,7 @@ function requireNative() {
|
|
|
10399
10437
|
try {
|
|
10400
10438
|
const binding = __require("@rolldown/binding-freebsd-x64");
|
|
10401
10439
|
const bindingPackageVersion = __require("@rolldown/binding-freebsd-x64/package.json").version;
|
|
10402
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10440
|
+
if (bindingPackageVersion !== "1.0.0-beta.45" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.45 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10403
10441
|
return binding;
|
|
10404
10442
|
} catch (e) {
|
|
10405
10443
|
loadErrors.push(e);
|
|
@@ -10413,7 +10451,7 @@ function requireNative() {
|
|
|
10413
10451
|
try {
|
|
10414
10452
|
const binding = __require("@rolldown/binding-freebsd-arm64");
|
|
10415
10453
|
const bindingPackageVersion = __require("@rolldown/binding-freebsd-arm64/package.json").version;
|
|
10416
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10454
|
+
if (bindingPackageVersion !== "1.0.0-beta.45" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.45 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10417
10455
|
return binding;
|
|
10418
10456
|
} catch (e) {
|
|
10419
10457
|
loadErrors.push(e);
|
|
@@ -10428,7 +10466,7 @@ function requireNative() {
|
|
|
10428
10466
|
try {
|
|
10429
10467
|
const binding = __require("@rolldown/binding-linux-x64-musl");
|
|
10430
10468
|
const bindingPackageVersion = __require("@rolldown/binding-linux-x64-musl/package.json").version;
|
|
10431
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10469
|
+
if (bindingPackageVersion !== "1.0.0-beta.45" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.45 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10432
10470
|
return binding;
|
|
10433
10471
|
} catch (e) {
|
|
10434
10472
|
loadErrors.push(e);
|
|
@@ -10442,7 +10480,7 @@ function requireNative() {
|
|
|
10442
10480
|
try {
|
|
10443
10481
|
const binding = __require("@rolldown/binding-linux-x64-gnu");
|
|
10444
10482
|
const bindingPackageVersion = __require("@rolldown/binding-linux-x64-gnu/package.json").version;
|
|
10445
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10483
|
+
if (bindingPackageVersion !== "1.0.0-beta.45" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.45 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10446
10484
|
return binding;
|
|
10447
10485
|
} catch (e) {
|
|
10448
10486
|
loadErrors.push(e);
|
|
@@ -10457,7 +10495,7 @@ function requireNative() {
|
|
|
10457
10495
|
try {
|
|
10458
10496
|
const binding = __require("@rolldown/binding-linux-arm64-musl");
|
|
10459
10497
|
const bindingPackageVersion = __require("@rolldown/binding-linux-arm64-musl/package.json").version;
|
|
10460
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10498
|
+
if (bindingPackageVersion !== "1.0.0-beta.45" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.45 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10461
10499
|
return binding;
|
|
10462
10500
|
} catch (e) {
|
|
10463
10501
|
loadErrors.push(e);
|
|
@@ -10471,7 +10509,7 @@ function requireNative() {
|
|
|
10471
10509
|
try {
|
|
10472
10510
|
const binding = __require("@rolldown/binding-linux-arm64-gnu");
|
|
10473
10511
|
const bindingPackageVersion = __require("@rolldown/binding-linux-arm64-gnu/package.json").version;
|
|
10474
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10512
|
+
if (bindingPackageVersion !== "1.0.0-beta.45" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.45 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10475
10513
|
return binding;
|
|
10476
10514
|
} catch (e) {
|
|
10477
10515
|
loadErrors.push(e);
|
|
@@ -10486,7 +10524,7 @@ function requireNative() {
|
|
|
10486
10524
|
try {
|
|
10487
10525
|
const binding = __require("@rolldown/binding-linux-arm-musleabihf");
|
|
10488
10526
|
const bindingPackageVersion = __require("@rolldown/binding-linux-arm-musleabihf/package.json").version;
|
|
10489
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10527
|
+
if (bindingPackageVersion !== "1.0.0-beta.45" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.45 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10490
10528
|
return binding;
|
|
10491
10529
|
} catch (e) {
|
|
10492
10530
|
loadErrors.push(e);
|
|
@@ -10500,7 +10538,7 @@ function requireNative() {
|
|
|
10500
10538
|
try {
|
|
10501
10539
|
const binding = __require("@rolldown/binding-linux-arm-gnueabihf");
|
|
10502
10540
|
const bindingPackageVersion = __require("@rolldown/binding-linux-arm-gnueabihf/package.json").version;
|
|
10503
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10541
|
+
if (bindingPackageVersion !== "1.0.0-beta.45" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.45 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10504
10542
|
return binding;
|
|
10505
10543
|
} catch (e) {
|
|
10506
10544
|
loadErrors.push(e);
|
|
@@ -10515,7 +10553,7 @@ function requireNative() {
|
|
|
10515
10553
|
try {
|
|
10516
10554
|
const binding = __require("@rolldown/binding-linux-loong64-musl");
|
|
10517
10555
|
const bindingPackageVersion = __require("@rolldown/binding-linux-loong64-musl/package.json").version;
|
|
10518
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10556
|
+
if (bindingPackageVersion !== "1.0.0-beta.45" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.45 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10519
10557
|
return binding;
|
|
10520
10558
|
} catch (e) {
|
|
10521
10559
|
loadErrors.push(e);
|
|
@@ -10529,7 +10567,7 @@ function requireNative() {
|
|
|
10529
10567
|
try {
|
|
10530
10568
|
const binding = __require("@rolldown/binding-linux-loong64-gnu");
|
|
10531
10569
|
const bindingPackageVersion = __require("@rolldown/binding-linux-loong64-gnu/package.json").version;
|
|
10532
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10570
|
+
if (bindingPackageVersion !== "1.0.0-beta.45" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.45 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10533
10571
|
return binding;
|
|
10534
10572
|
} catch (e) {
|
|
10535
10573
|
loadErrors.push(e);
|
|
@@ -10544,7 +10582,7 @@ function requireNative() {
|
|
|
10544
10582
|
try {
|
|
10545
10583
|
const binding = __require("@rolldown/binding-linux-riscv64-musl");
|
|
10546
10584
|
const bindingPackageVersion = __require("@rolldown/binding-linux-riscv64-musl/package.json").version;
|
|
10547
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10585
|
+
if (bindingPackageVersion !== "1.0.0-beta.45" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.45 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10548
10586
|
return binding;
|
|
10549
10587
|
} catch (e) {
|
|
10550
10588
|
loadErrors.push(e);
|
|
@@ -10558,7 +10596,7 @@ function requireNative() {
|
|
|
10558
10596
|
try {
|
|
10559
10597
|
const binding = __require("@rolldown/binding-linux-riscv64-gnu");
|
|
10560
10598
|
const bindingPackageVersion = __require("@rolldown/binding-linux-riscv64-gnu/package.json").version;
|
|
10561
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10599
|
+
if (bindingPackageVersion !== "1.0.0-beta.45" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.45 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10562
10600
|
return binding;
|
|
10563
10601
|
} catch (e) {
|
|
10564
10602
|
loadErrors.push(e);
|
|
@@ -10573,7 +10611,7 @@ function requireNative() {
|
|
|
10573
10611
|
try {
|
|
10574
10612
|
const binding = __require("@rolldown/binding-linux-ppc64-gnu");
|
|
10575
10613
|
const bindingPackageVersion = __require("@rolldown/binding-linux-ppc64-gnu/package.json").version;
|
|
10576
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10614
|
+
if (bindingPackageVersion !== "1.0.0-beta.45" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.45 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10577
10615
|
return binding;
|
|
10578
10616
|
} catch (e) {
|
|
10579
10617
|
loadErrors.push(e);
|
|
@@ -10587,7 +10625,7 @@ function requireNative() {
|
|
|
10587
10625
|
try {
|
|
10588
10626
|
const binding = __require("@rolldown/binding-linux-s390x-gnu");
|
|
10589
10627
|
const bindingPackageVersion = __require("@rolldown/binding-linux-s390x-gnu/package.json").version;
|
|
10590
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10628
|
+
if (bindingPackageVersion !== "1.0.0-beta.45" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.45 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10591
10629
|
return binding;
|
|
10592
10630
|
} catch (e) {
|
|
10593
10631
|
loadErrors.push(e);
|
|
@@ -10602,7 +10640,7 @@ function requireNative() {
|
|
|
10602
10640
|
try {
|
|
10603
10641
|
const binding = __require("@rolldown/binding-openharmony-arm64");
|
|
10604
10642
|
const bindingPackageVersion = __require("@rolldown/binding-openharmony-arm64/package.json").version;
|
|
10605
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10643
|
+
if (bindingPackageVersion !== "1.0.0-beta.45" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.45 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10606
10644
|
return binding;
|
|
10607
10645
|
} catch (e) {
|
|
10608
10646
|
loadErrors.push(e);
|
|
@@ -10616,7 +10654,7 @@ function requireNative() {
|
|
|
10616
10654
|
try {
|
|
10617
10655
|
const binding = __require("@rolldown/binding-openharmony-x64");
|
|
10618
10656
|
const bindingPackageVersion = __require("@rolldown/binding-openharmony-x64/package.json").version;
|
|
10619
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10657
|
+
if (bindingPackageVersion !== "1.0.0-beta.45" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.45 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10620
10658
|
return binding;
|
|
10621
10659
|
} catch (e) {
|
|
10622
10660
|
loadErrors.push(e);
|
|
@@ -10630,7 +10668,7 @@ function requireNative() {
|
|
|
10630
10668
|
try {
|
|
10631
10669
|
const binding = __require("@rolldown/binding-openharmony-arm");
|
|
10632
10670
|
const bindingPackageVersion = __require("@rolldown/binding-openharmony-arm/package.json").version;
|
|
10633
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10671
|
+
if (bindingPackageVersion !== "1.0.0-beta.45" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.45 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10634
10672
|
return binding;
|
|
10635
10673
|
} catch (e) {
|
|
10636
10674
|
loadErrors.push(e);
|
|
@@ -10658,9 +10696,9 @@ if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
|
|
|
10658
10696
|
}
|
|
10659
10697
|
}
|
|
10660
10698
|
if (process.env.NAPI_RS_FORCE_WASI === "error" && !wasiBinding) {
|
|
10661
|
-
const error
|
|
10662
|
-
error
|
|
10663
|
-
throw error
|
|
10699
|
+
const error = /* @__PURE__ */ new Error("WASI binding not found and NAPI_RS_FORCE_WASI is set to error");
|
|
10700
|
+
error.cause = wasiBindingError;
|
|
10701
|
+
throw error;
|
|
10664
10702
|
}
|
|
10665
10703
|
}
|
|
10666
10704
|
if (!nativeBinding && globalThis.process?.versions?.["webcontainer"]) try {
|
|
@@ -10675,270 +10713,7 @@ if (!nativeBinding) {
|
|
|
10675
10713
|
}) });
|
|
10676
10714
|
throw new Error(`Failed to load native binding`);
|
|
10677
10715
|
}
|
|
10678
|
-
const { minify, Severity, ParseResult, ExportExportNameKind, ExportImportNameKind, ExportLocalNameKind, ImportNameKind, parseAsync, parseSync, rawTransferSupported, ResolverFactory, EnforceExtension, ModuleType, sync, HelperMode, isolatedDeclaration, moduleRunnerTransform, transform, transformAsync, BindingBundleEndEventData, BindingBundleErrorEventData, BindingBundler, BindingBundlerImpl, BindingCallableBuiltinPlugin, BindingChunkingContext, BindingDevEngine, BindingMagicString, BindingModuleInfo, BindingNormalizedOptions, BindingOutputAsset, BindingOutputChunk,
|
|
10679
|
-
|
|
10680
|
-
//#endregion
|
|
10681
|
-
//#region src/utils/code-frame.ts
|
|
10682
|
-
function spaces(index) {
|
|
10683
|
-
let result = "";
|
|
10684
|
-
while (index--) result += " ";
|
|
10685
|
-
return result;
|
|
10686
|
-
}
|
|
10687
|
-
function tabsToSpaces(value) {
|
|
10688
|
-
return value.replace(/^\t+/, (match) => match.split(" ").join(" "));
|
|
10689
|
-
}
|
|
10690
|
-
const LINE_TRUNCATE_LENGTH = 120;
|
|
10691
|
-
const MIN_CHARACTERS_SHOWN_AFTER_LOCATION = 10;
|
|
10692
|
-
const ELLIPSIS = "...";
|
|
10693
|
-
function getCodeFrame(source, line, column) {
|
|
10694
|
-
let lines = source.split("\n");
|
|
10695
|
-
if (line > lines.length) return "";
|
|
10696
|
-
const maxLineLength = Math.max(tabsToSpaces(lines[line - 1].slice(0, column)).length + MIN_CHARACTERS_SHOWN_AFTER_LOCATION + 3, LINE_TRUNCATE_LENGTH);
|
|
10697
|
-
const frameStart = Math.max(0, line - 3);
|
|
10698
|
-
let frameEnd = Math.min(line + 2, lines.length);
|
|
10699
|
-
lines = lines.slice(frameStart, frameEnd);
|
|
10700
|
-
while (!/\S/.test(lines[lines.length - 1])) {
|
|
10701
|
-
lines.pop();
|
|
10702
|
-
frameEnd -= 1;
|
|
10703
|
-
}
|
|
10704
|
-
const digits = String(frameEnd).length;
|
|
10705
|
-
return lines.map((sourceLine, index) => {
|
|
10706
|
-
const isErrorLine = frameStart + index + 1 === line;
|
|
10707
|
-
let lineNumber = String(index + frameStart + 1);
|
|
10708
|
-
while (lineNumber.length < digits) lineNumber = ` ${lineNumber}`;
|
|
10709
|
-
let displayedLine = tabsToSpaces(sourceLine);
|
|
10710
|
-
if (displayedLine.length > maxLineLength) displayedLine = `${displayedLine.slice(0, maxLineLength - 3)}${ELLIPSIS}`;
|
|
10711
|
-
if (isErrorLine) {
|
|
10712
|
-
const indicator = spaces(digits + 2 + tabsToSpaces(sourceLine.slice(0, column)).length) + "^";
|
|
10713
|
-
return `${lineNumber}: ${displayedLine}\n${indicator}`;
|
|
10714
|
-
}
|
|
10715
|
-
return `${lineNumber}: ${displayedLine}`;
|
|
10716
|
-
}).join("\n");
|
|
10717
|
-
}
|
|
10718
|
-
|
|
10719
|
-
//#endregion
|
|
10720
|
-
//#region src/log/locate-character/index.js
|
|
10721
|
-
/** @typedef {import('./types').Location} Location */
|
|
10722
|
-
/**
|
|
10723
|
-
* @param {import('./types').Range} range
|
|
10724
|
-
* @param {number} index
|
|
10725
|
-
*/
|
|
10726
|
-
function rangeContains(range, index) {
|
|
10727
|
-
return range.start <= index && index < range.end;
|
|
10728
|
-
}
|
|
10729
|
-
/**
|
|
10730
|
-
* @param {string} source
|
|
10731
|
-
* @param {import('./types').Options} [options]
|
|
10732
|
-
*/
|
|
10733
|
-
function getLocator(source, options = {}) {
|
|
10734
|
-
const { offsetLine = 0, offsetColumn = 0 } = options;
|
|
10735
|
-
let start = 0;
|
|
10736
|
-
const ranges = source.split("\n").map((line, i$1) => {
|
|
10737
|
-
const end = start + line.length + 1;
|
|
10738
|
-
/** @type {import('./types').Range} */
|
|
10739
|
-
const range = {
|
|
10740
|
-
start,
|
|
10741
|
-
end,
|
|
10742
|
-
line: i$1
|
|
10743
|
-
};
|
|
10744
|
-
start = end;
|
|
10745
|
-
return range;
|
|
10746
|
-
});
|
|
10747
|
-
let i = 0;
|
|
10748
|
-
/**
|
|
10749
|
-
* @param {string | number} search
|
|
10750
|
-
* @param {number} [index]
|
|
10751
|
-
* @returns {Location | undefined}
|
|
10752
|
-
*/
|
|
10753
|
-
function locator(search, index) {
|
|
10754
|
-
if (typeof search === "string") search = source.indexOf(search, index ?? 0);
|
|
10755
|
-
if (search === -1) return void 0;
|
|
10756
|
-
let range = ranges[i];
|
|
10757
|
-
const d = search >= range.end ? 1 : -1;
|
|
10758
|
-
while (range) {
|
|
10759
|
-
if (rangeContains(range, search)) return {
|
|
10760
|
-
line: offsetLine + range.line,
|
|
10761
|
-
column: offsetColumn + search - range.start,
|
|
10762
|
-
character: search
|
|
10763
|
-
};
|
|
10764
|
-
i += d;
|
|
10765
|
-
range = ranges[i];
|
|
10766
|
-
}
|
|
10767
|
-
}
|
|
10768
|
-
return locator;
|
|
10769
|
-
}
|
|
10770
|
-
/**
|
|
10771
|
-
* @param {string} source
|
|
10772
|
-
* @param {string | number} search
|
|
10773
|
-
* @param {import('./types').Options} [options]
|
|
10774
|
-
* @returns {Location | undefined}
|
|
10775
|
-
*/
|
|
10776
|
-
function locate(source, search, options) {
|
|
10777
|
-
return getLocator(source, options)(search, options && options.startIndex);
|
|
10778
|
-
}
|
|
10779
|
-
|
|
10780
|
-
//#endregion
|
|
10781
|
-
//#region src/log/logs.ts
|
|
10782
|
-
const INVALID_LOG_POSITION = "INVALID_LOG_POSITION", PLUGIN_ERROR = "PLUGIN_ERROR", INPUT_HOOK_IN_OUTPUT_PLUGIN = "INPUT_HOOK_IN_OUTPUT_PLUGIN", CYCLE_LOADING = "CYCLE_LOADING", MULTIPLY_NOTIFY_OPTION = "MULTIPLY_NOTIFY_OPTION", PARSE_ERROR = "PARSE_ERROR", DUPLICATE_JSX_CONFIG = "DUPLICATE_JSX_CONFIG", NO_FS_IN_BROWSER = "NO_FS_IN_BROWSER";
|
|
10783
|
-
function logParseError(message) {
|
|
10784
|
-
return {
|
|
10785
|
-
code: PARSE_ERROR,
|
|
10786
|
-
message
|
|
10787
|
-
};
|
|
10788
|
-
}
|
|
10789
|
-
function logInvalidLogPosition(pluginName) {
|
|
10790
|
-
return {
|
|
10791
|
-
code: INVALID_LOG_POSITION,
|
|
10792
|
-
message: `Plugin "${pluginName}" tried to add a file position to a log or warning. This is only supported in the "transform" hook at the moment and will be ignored.`
|
|
10793
|
-
};
|
|
10794
|
-
}
|
|
10795
|
-
function logInputHookInOutputPlugin(pluginName, hookName) {
|
|
10796
|
-
return {
|
|
10797
|
-
code: INPUT_HOOK_IN_OUTPUT_PLUGIN,
|
|
10798
|
-
message: `The "${hookName}" hook used by the output plugin ${pluginName} is a build time hook and will not be run for that plugin. Either this plugin cannot be used as an output plugin, or it should have an option to configure it as an output plugin.`
|
|
10799
|
-
};
|
|
10800
|
-
}
|
|
10801
|
-
function logCycleLoading(pluginName, moduleId) {
|
|
10802
|
-
return {
|
|
10803
|
-
code: CYCLE_LOADING,
|
|
10804
|
-
message: `Found the module "${moduleId}" cycle loading at ${pluginName} plugin, it maybe blocking fetching modules.`
|
|
10805
|
-
};
|
|
10806
|
-
}
|
|
10807
|
-
function logMultiplyNotifyOption() {
|
|
10808
|
-
return {
|
|
10809
|
-
code: MULTIPLY_NOTIFY_OPTION,
|
|
10810
|
-
message: `Found multiply notify option at watch options, using first one to start notify watcher.`
|
|
10811
|
-
};
|
|
10812
|
-
}
|
|
10813
|
-
function logDuplicateJsxConfig() {
|
|
10814
|
-
return {
|
|
10815
|
-
code: DUPLICATE_JSX_CONFIG,
|
|
10816
|
-
message: "Both `options.jsx` and `options.transform.jsx` are set so `options.jsx` is ignored"
|
|
10817
|
-
};
|
|
10818
|
-
}
|
|
10819
|
-
function logPluginError(error$1, plugin, { hook, id } = {}) {
|
|
10820
|
-
try {
|
|
10821
|
-
const code = error$1.code;
|
|
10822
|
-
if (!error$1.pluginCode && code != null && (typeof code !== "string" || !code.startsWith("PLUGIN_"))) error$1.pluginCode = code;
|
|
10823
|
-
error$1.code = PLUGIN_ERROR;
|
|
10824
|
-
error$1.plugin = plugin;
|
|
10825
|
-
if (hook) error$1.hook = hook;
|
|
10826
|
-
if (id) error$1.id = id;
|
|
10827
|
-
} catch (_) {} finally {
|
|
10828
|
-
return error$1;
|
|
10829
|
-
}
|
|
10830
|
-
}
|
|
10831
|
-
function error(base) {
|
|
10832
|
-
if (!(base instanceof Error)) {
|
|
10833
|
-
base = Object.assign(new Error(base.message), base);
|
|
10834
|
-
Object.defineProperty(base, "name", {
|
|
10835
|
-
value: "RollupError",
|
|
10836
|
-
writable: true
|
|
10837
|
-
});
|
|
10838
|
-
}
|
|
10839
|
-
throw base;
|
|
10840
|
-
}
|
|
10841
|
-
function augmentCodeLocation(properties, pos, source, id) {
|
|
10842
|
-
if (typeof pos === "object") {
|
|
10843
|
-
const { line, column } = pos;
|
|
10844
|
-
properties.loc = {
|
|
10845
|
-
column,
|
|
10846
|
-
file: id,
|
|
10847
|
-
line
|
|
10848
|
-
};
|
|
10849
|
-
} else {
|
|
10850
|
-
properties.pos = pos;
|
|
10851
|
-
const location = locate(source, pos, { offsetLine: 1 });
|
|
10852
|
-
if (!location) return;
|
|
10853
|
-
const { line, column } = location;
|
|
10854
|
-
properties.loc = {
|
|
10855
|
-
column,
|
|
10856
|
-
file: id,
|
|
10857
|
-
line
|
|
10858
|
-
};
|
|
10859
|
-
}
|
|
10860
|
-
if (properties.frame === void 0) {
|
|
10861
|
-
const { line, column } = properties.loc;
|
|
10862
|
-
properties.frame = getCodeFrame(source, line, column);
|
|
10863
|
-
}
|
|
10864
|
-
}
|
|
10865
|
-
|
|
10866
|
-
//#endregion
|
|
10867
|
-
//#region ../../node_modules/.pnpm/oxc-parser@0.94.0/node_modules/oxc-parser/src-js/wrap.js
|
|
10868
|
-
function wrap$1(result) {
|
|
10869
|
-
let program, module$1, comments, errors;
|
|
10870
|
-
return {
|
|
10871
|
-
get program() {
|
|
10872
|
-
if (!program) program = jsonParseAst(result.program);
|
|
10873
|
-
return program;
|
|
10874
|
-
},
|
|
10875
|
-
get module() {
|
|
10876
|
-
if (!module$1) module$1 = result.module;
|
|
10877
|
-
return module$1;
|
|
10878
|
-
},
|
|
10879
|
-
get comments() {
|
|
10880
|
-
if (!comments) comments = result.comments;
|
|
10881
|
-
return comments;
|
|
10882
|
-
},
|
|
10883
|
-
get errors() {
|
|
10884
|
-
if (!errors) errors = result.errors;
|
|
10885
|
-
return errors;
|
|
10886
|
-
}
|
|
10887
|
-
};
|
|
10888
|
-
}
|
|
10889
|
-
function jsonParseAst(programJson) {
|
|
10890
|
-
const { node: program, fixes } = JSON.parse(programJson);
|
|
10891
|
-
for (const fixPath of fixes) applyFix(program, fixPath);
|
|
10892
|
-
return program;
|
|
10893
|
-
}
|
|
10894
|
-
function applyFix(program, fixPath) {
|
|
10895
|
-
let node = program;
|
|
10896
|
-
for (const key of fixPath) node = node[key];
|
|
10897
|
-
if (node.bigint) node.value = BigInt(node.bigint);
|
|
10898
|
-
else try {
|
|
10899
|
-
node.value = RegExp(node.regex.pattern, node.regex.flags);
|
|
10900
|
-
} catch (_err) {}
|
|
10901
|
-
}
|
|
10902
|
-
|
|
10903
|
-
//#endregion
|
|
10904
|
-
//#region src/parse-ast-index.ts
|
|
10905
|
-
function wrap(result, sourceText) {
|
|
10906
|
-
result = wrap$1(result);
|
|
10907
|
-
if (result.errors.length > 0) return normalizeParseError(sourceText, result.errors);
|
|
10908
|
-
return result.program;
|
|
10909
|
-
}
|
|
10910
|
-
function normalizeParseError(sourceText, errors) {
|
|
10911
|
-
let message = `Parse failed with ${errors.length} error${errors.length < 2 ? "" : "s"}:\n`;
|
|
10912
|
-
for (let i = 0; i < errors.length; i++) {
|
|
10913
|
-
if (i >= 5) {
|
|
10914
|
-
message += "\n...";
|
|
10915
|
-
break;
|
|
10916
|
-
}
|
|
10917
|
-
const e = errors[i];
|
|
10918
|
-
message += e.message + "\n" + e.labels.map((label) => {
|
|
10919
|
-
const location = locate(sourceText, label.start, { offsetLine: 1 });
|
|
10920
|
-
if (!location) return;
|
|
10921
|
-
return getCodeFrame(sourceText, location.line, location.column);
|
|
10922
|
-
}).filter(Boolean).join("\n");
|
|
10923
|
-
}
|
|
10924
|
-
return error(logParseError(message));
|
|
10925
|
-
}
|
|
10926
|
-
const defaultParserOptions = {
|
|
10927
|
-
lang: "js",
|
|
10928
|
-
preserveParens: false
|
|
10929
|
-
};
|
|
10930
|
-
function parseAst(sourceText, options, filename) {
|
|
10931
|
-
return wrap(parseSync(filename ?? "file.js", sourceText, {
|
|
10932
|
-
...defaultParserOptions,
|
|
10933
|
-
...options
|
|
10934
|
-
}), sourceText);
|
|
10935
|
-
}
|
|
10936
|
-
async function parseAstAsync(sourceText, options, filename) {
|
|
10937
|
-
return wrap(await parseAsync(filename ?? "file.js", sourceText, {
|
|
10938
|
-
...defaultParserOptions,
|
|
10939
|
-
...options
|
|
10940
|
-
}), sourceText);
|
|
10941
|
-
}
|
|
10716
|
+
const { minify, Severity, ParseResult, ExportExportNameKind, ExportImportNameKind, ExportLocalNameKind, ImportNameKind, parseAsync, parseSync, rawTransferSupported, ResolverFactory, EnforceExtension, ModuleType, sync, HelperMode, isolatedDeclaration, moduleRunnerTransform, transform, transformAsync, BindingBundleEndEventData, BindingBundleErrorEventData, BindingBundler, BindingBundlerImpl, BindingCallableBuiltinPlugin, BindingChunkingContext, BindingDevEngine, BindingMagicString, BindingModuleInfo, BindingNormalizedOptions, BindingOutputAsset, BindingOutputChunk, BindingPluginContext, BindingRenderedChunk, BindingRenderedChunkMeta, BindingRenderedModule, BindingTransformPluginContext, BindingUrlResolver, BindingWatcher, BindingWatcherChangeData, BindingWatcherEvent, ParallelJsPluginRegistry, ScheduledBuild, TraceSubscriberGuard, BindingAttachDebugInfo, BindingBuiltinPluginName, BindingChunkModuleOrderBy, BindingLogLevel, BindingPluginOrder, BindingPropertyReadSideEffects, BindingPropertyWriteSideEffects, BindingRebuildStrategy, createTokioRuntime, FilterTokenKind, initTraceSubscriber, registerPlugins, shutdownAsyncRuntime, startAsyncRuntime } = nativeBinding;
|
|
10942
10717
|
|
|
10943
10718
|
//#endregion
|
|
10944
|
-
export {
|
|
10719
|
+
export { startAsyncRuntime as C, shutdownAsyncRuntime as S, isolatedDeclaration as _, BindingDevEngine as a, parseSync as b, BindingPluginOrder as c, BindingRebuildStrategy as d, BindingWatcher as f, initTraceSubscriber as g, createTokioRuntime as h, BindingChunkModuleOrderBy as i, BindingPropertyReadSideEffects as l, ResolverFactory as m, BindingBundler as n, BindingLogLevel as o, ParallelJsPluginRegistry as p, BindingCallableBuiltinPlugin as r, BindingMagicString as s, BindingAttachDebugInfo as t, BindingPropertyWriteSideEffects as u, moduleRunnerTransform as v, transform as w, registerPlugins as x, parseAsync as y };
|