@rolldown/browser 1.0.0-beta.44 → 1.0.0-beta.46

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.
Files changed (30) hide show
  1. package/dist/cli-setup.mjs +4 -3
  2. package/dist/cli.mjs +8 -7
  3. package/dist/config.d.mts +2 -2
  4. package/dist/config.mjs +5 -4
  5. package/dist/experimental-index.browser.mjs +58 -8
  6. package/dist/experimental-index.d.mts +4 -4
  7. package/dist/experimental-index.mjs +61 -10
  8. package/dist/experimental-runtime-types.d.ts +16 -5
  9. package/dist/filter-index.d.mts +2 -2
  10. package/dist/filter-index.mjs +1 -1
  11. package/dist/index.browser.mjs +2 -1
  12. package/dist/index.d.mts +2 -2
  13. package/dist/index.mjs +5 -3
  14. package/dist/parallel-plugin-worker.mjs +6 -5
  15. package/dist/parallel-plugin.d.mts +2 -2
  16. package/dist/parse-ast-index.d.mts +3 -3
  17. package/dist/parse-ast-index.mjs +2 -1
  18. package/dist/rolldown-binding.wasi-browser.js +0 -1
  19. package/dist/rolldown-binding.wasi.cjs +0 -1
  20. package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
  21. package/dist/shared/binding-BeWSOIj5.mjs +578 -0
  22. package/dist/shared/{binding-0m41EAn-.d.mts → binding-CCMrV5an.d.mts} +48 -32
  23. package/dist/shared/{dist-DNFKY37q.mjs → composable-filters-CgRsnfr3.mjs} +1 -1
  24. package/dist/shared/{define-config-BbwLmCDX.d.mts → define-config-Bj-neIhz.d.mts} +83 -17
  25. package/dist/shared/{load-config-B3FsKQ_6.mjs → load-config-DnUAKl9P.mjs} +4 -4
  26. package/dist/shared/{parse-ast-index-Ck5SwMSC.mjs → parse-ast-index-DMI5m8Lk.mjs} +11 -5
  27. package/dist/shared/{src-BnIhK3nA.mjs → src-B8saaB3b.mjs} +559 -299
  28. package/dist/{src-CIeG_TGR.js → src-B-7Hrt6w.js} +1158 -344
  29. package/package.json +1 -1
  30. /package/dist/shared/{prompt-BDwA3jSr.mjs → prompt-YGfbLmz5.mjs} +0 -0
@@ -1,7 +1,558 @@
1
- import { BindingAttachDebugInfo, BindingBundler, BindingCallableBuiltinPlugin, BindingChunkModuleOrderBy, BindingLogLevel, BindingMagicString, BindingMagicString as BindingMagicString$1, BindingPluginOrder, BindingPropertyReadSideEffects, BindingPropertyWriteSideEffects, BindingWatcher, parseSync, shutdownAsyncRuntime, startAsyncRuntime } from "./rolldown-binding.wasi-browser.js";
1
+ //#region rolldown:runtime
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __commonJS = (cb, mod) => function() {
9
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n$1 = keys.length, key; i < n$1; i++) {
13
+ key = keys[i];
14
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
15
+ get: ((k) => from[k]).bind(null, key),
16
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
+ });
18
+ }
19
+ return to;
20
+ };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
22
+ value: mod,
23
+ enumerable: true
24
+ }) : target, mod));
25
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof require !== "undefined" ? require : a)[b] }) : x)(function(x) {
26
+ if (typeof require !== "undefined") return require.apply(this, arguments);
27
+ throw Error("Calling `require` for \"" + x + "\" in an environment that doesn't expose the `require` function.");
28
+ });
29
+
30
+ //#endregion
31
+ //#region src/binding.cjs
32
+ var require_binding = /* @__PURE__ */ __commonJS({ "src/binding.cjs": ((exports, module) => {
33
+ const { readFileSync } = __require("node:fs");
34
+ let nativeBinding = null;
35
+ const loadErrors = [];
36
+ const isMusl = () => {
37
+ let musl = false;
38
+ if (process.platform === "linux") {
39
+ musl = isMuslFromFilesystem();
40
+ if (musl === null) musl = isMuslFromReport();
41
+ if (musl === null) musl = isMuslFromChildProcess();
42
+ }
43
+ return musl;
44
+ };
45
+ const isFileMusl = (f) => f.includes("libc.musl-") || f.includes("ld-musl-");
46
+ const isMuslFromFilesystem = () => {
47
+ try {
48
+ return readFileSync("/usr/bin/ldd", "utf-8").includes("musl");
49
+ } catch {
50
+ return null;
51
+ }
52
+ };
53
+ const isMuslFromReport = () => {
54
+ let report = null;
55
+ if (typeof process.report?.getReport === "function") {
56
+ process.report.excludeNetwork = true;
57
+ report = process.report.getReport();
58
+ }
59
+ if (!report) return null;
60
+ if (report.header && report.header.glibcVersionRuntime) return false;
61
+ if (Array.isArray(report.sharedObjects)) {
62
+ if (report.sharedObjects.some(isFileMusl)) return true;
63
+ }
64
+ return false;
65
+ };
66
+ const isMuslFromChildProcess = () => {
67
+ try {
68
+ return __require("child_process").execSync("ldd --version", { encoding: "utf8" }).includes("musl");
69
+ } catch (e$1) {
70
+ return false;
71
+ }
72
+ };
73
+ function requireNative() {
74
+ if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) try {
75
+ return __require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH);
76
+ } catch (err) {
77
+ loadErrors.push(err);
78
+ }
79
+ else if (process.platform === "android") if (process.arch === "arm64") {
80
+ try {
81
+ return __require("./rolldown-binding.android-arm64.node");
82
+ } catch (e$1) {
83
+ loadErrors.push(e$1);
84
+ }
85
+ try {
86
+ const binding = __require("@rolldown/binding-android-arm64");
87
+ const bindingPackageVersion = __require("@rolldown/binding-android-arm64/package.json").version;
88
+ if (bindingPackageVersion !== "1.0.0-beta.46" && 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.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
89
+ return binding;
90
+ } catch (e$1) {
91
+ loadErrors.push(e$1);
92
+ }
93
+ } else if (process.arch === "arm") {
94
+ try {
95
+ return __require("./rolldown-binding.android-arm-eabi.node");
96
+ } catch (e$1) {
97
+ loadErrors.push(e$1);
98
+ }
99
+ try {
100
+ const binding = __require("@rolldown/binding-android-arm-eabi");
101
+ const bindingPackageVersion = __require("@rolldown/binding-android-arm-eabi/package.json").version;
102
+ if (bindingPackageVersion !== "1.0.0-beta.46" && 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.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
103
+ return binding;
104
+ } catch (e$1) {
105
+ loadErrors.push(e$1);
106
+ }
107
+ } else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on Android ${process.arch}`));
108
+ 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") {
109
+ try {
110
+ return __require("./rolldown-binding.win32-x64-gnu.node");
111
+ } catch (e$1) {
112
+ loadErrors.push(e$1);
113
+ }
114
+ try {
115
+ const binding = __require("@rolldown/binding-win32-x64-gnu");
116
+ const bindingPackageVersion = __require("@rolldown/binding-win32-x64-gnu/package.json").version;
117
+ if (bindingPackageVersion !== "1.0.0-beta.46" && 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.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
118
+ return binding;
119
+ } catch (e$1) {
120
+ loadErrors.push(e$1);
121
+ }
122
+ } else {
123
+ try {
124
+ return __require("./rolldown-binding.win32-x64-msvc.node");
125
+ } catch (e$1) {
126
+ loadErrors.push(e$1);
127
+ }
128
+ try {
129
+ const binding = __require("@rolldown/binding-win32-x64-msvc");
130
+ const bindingPackageVersion = __require("@rolldown/binding-win32-x64-msvc/package.json").version;
131
+ if (bindingPackageVersion !== "1.0.0-beta.46" && 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.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
132
+ return binding;
133
+ } catch (e$1) {
134
+ loadErrors.push(e$1);
135
+ }
136
+ }
137
+ else if (process.arch === "ia32") {
138
+ try {
139
+ return __require("./rolldown-binding.win32-ia32-msvc.node");
140
+ } catch (e$1) {
141
+ loadErrors.push(e$1);
142
+ }
143
+ try {
144
+ const binding = __require("@rolldown/binding-win32-ia32-msvc");
145
+ const bindingPackageVersion = __require("@rolldown/binding-win32-ia32-msvc/package.json").version;
146
+ if (bindingPackageVersion !== "1.0.0-beta.46" && 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.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
147
+ return binding;
148
+ } catch (e$1) {
149
+ loadErrors.push(e$1);
150
+ }
151
+ } else if (process.arch === "arm64") {
152
+ try {
153
+ return __require("./rolldown-binding.win32-arm64-msvc.node");
154
+ } catch (e$1) {
155
+ loadErrors.push(e$1);
156
+ }
157
+ try {
158
+ const binding = __require("@rolldown/binding-win32-arm64-msvc");
159
+ const bindingPackageVersion = __require("@rolldown/binding-win32-arm64-msvc/package.json").version;
160
+ if (bindingPackageVersion !== "1.0.0-beta.46" && 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.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
161
+ return binding;
162
+ } catch (e$1) {
163
+ loadErrors.push(e$1);
164
+ }
165
+ } else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on Windows: ${process.arch}`));
166
+ else if (process.platform === "darwin") {
167
+ try {
168
+ return __require("./rolldown-binding.darwin-universal.node");
169
+ } catch (e$1) {
170
+ loadErrors.push(e$1);
171
+ }
172
+ try {
173
+ const binding = __require("@rolldown/binding-darwin-universal");
174
+ const bindingPackageVersion = __require("@rolldown/binding-darwin-universal/package.json").version;
175
+ if (bindingPackageVersion !== "1.0.0-beta.46" && 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.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
176
+ return binding;
177
+ } catch (e$1) {
178
+ loadErrors.push(e$1);
179
+ }
180
+ if (process.arch === "x64") {
181
+ try {
182
+ return __require("./rolldown-binding.darwin-x64.node");
183
+ } catch (e$1) {
184
+ loadErrors.push(e$1);
185
+ }
186
+ try {
187
+ const binding = __require("@rolldown/binding-darwin-x64");
188
+ const bindingPackageVersion = __require("@rolldown/binding-darwin-x64/package.json").version;
189
+ if (bindingPackageVersion !== "1.0.0-beta.46" && 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.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
190
+ return binding;
191
+ } catch (e$1) {
192
+ loadErrors.push(e$1);
193
+ }
194
+ } else if (process.arch === "arm64") {
195
+ try {
196
+ return __require("./rolldown-binding.darwin-arm64.node");
197
+ } catch (e$1) {
198
+ loadErrors.push(e$1);
199
+ }
200
+ try {
201
+ const binding = __require("@rolldown/binding-darwin-arm64");
202
+ const bindingPackageVersion = __require("@rolldown/binding-darwin-arm64/package.json").version;
203
+ if (bindingPackageVersion !== "1.0.0-beta.46" && 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.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
204
+ return binding;
205
+ } catch (e$1) {
206
+ loadErrors.push(e$1);
207
+ }
208
+ } else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on macOS: ${process.arch}`));
209
+ } else if (process.platform === "freebsd") if (process.arch === "x64") {
210
+ try {
211
+ return __require("./rolldown-binding.freebsd-x64.node");
212
+ } catch (e$1) {
213
+ loadErrors.push(e$1);
214
+ }
215
+ try {
216
+ const binding = __require("@rolldown/binding-freebsd-x64");
217
+ const bindingPackageVersion = __require("@rolldown/binding-freebsd-x64/package.json").version;
218
+ if (bindingPackageVersion !== "1.0.0-beta.46" && 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.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
219
+ return binding;
220
+ } catch (e$1) {
221
+ loadErrors.push(e$1);
222
+ }
223
+ } else if (process.arch === "arm64") {
224
+ try {
225
+ return __require("./rolldown-binding.freebsd-arm64.node");
226
+ } catch (e$1) {
227
+ loadErrors.push(e$1);
228
+ }
229
+ try {
230
+ const binding = __require("@rolldown/binding-freebsd-arm64");
231
+ const bindingPackageVersion = __require("@rolldown/binding-freebsd-arm64/package.json").version;
232
+ if (bindingPackageVersion !== "1.0.0-beta.46" && 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.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
233
+ return binding;
234
+ } catch (e$1) {
235
+ loadErrors.push(e$1);
236
+ }
237
+ } else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on FreeBSD: ${process.arch}`));
238
+ else if (process.platform === "linux") if (process.arch === "x64") if (isMusl()) {
239
+ try {
240
+ return __require("./rolldown-binding.linux-x64-musl.node");
241
+ } catch (e$1) {
242
+ loadErrors.push(e$1);
243
+ }
244
+ try {
245
+ const binding = __require("@rolldown/binding-linux-x64-musl");
246
+ const bindingPackageVersion = __require("@rolldown/binding-linux-x64-musl/package.json").version;
247
+ if (bindingPackageVersion !== "1.0.0-beta.46" && 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.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
248
+ return binding;
249
+ } catch (e$1) {
250
+ loadErrors.push(e$1);
251
+ }
252
+ } else {
253
+ try {
254
+ return __require("./rolldown-binding.linux-x64-gnu.node");
255
+ } catch (e$1) {
256
+ loadErrors.push(e$1);
257
+ }
258
+ try {
259
+ const binding = __require("@rolldown/binding-linux-x64-gnu");
260
+ const bindingPackageVersion = __require("@rolldown/binding-linux-x64-gnu/package.json").version;
261
+ if (bindingPackageVersion !== "1.0.0-beta.46" && 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.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
262
+ return binding;
263
+ } catch (e$1) {
264
+ loadErrors.push(e$1);
265
+ }
266
+ }
267
+ else if (process.arch === "arm64") if (isMusl()) {
268
+ try {
269
+ return __require("./rolldown-binding.linux-arm64-musl.node");
270
+ } catch (e$1) {
271
+ loadErrors.push(e$1);
272
+ }
273
+ try {
274
+ const binding = __require("@rolldown/binding-linux-arm64-musl");
275
+ const bindingPackageVersion = __require("@rolldown/binding-linux-arm64-musl/package.json").version;
276
+ if (bindingPackageVersion !== "1.0.0-beta.46" && 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.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
277
+ return binding;
278
+ } catch (e$1) {
279
+ loadErrors.push(e$1);
280
+ }
281
+ } else {
282
+ try {
283
+ return __require("./rolldown-binding.linux-arm64-gnu.node");
284
+ } catch (e$1) {
285
+ loadErrors.push(e$1);
286
+ }
287
+ try {
288
+ const binding = __require("@rolldown/binding-linux-arm64-gnu");
289
+ const bindingPackageVersion = __require("@rolldown/binding-linux-arm64-gnu/package.json").version;
290
+ if (bindingPackageVersion !== "1.0.0-beta.46" && 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.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
291
+ return binding;
292
+ } catch (e$1) {
293
+ loadErrors.push(e$1);
294
+ }
295
+ }
296
+ else if (process.arch === "arm") if (isMusl()) {
297
+ try {
298
+ return __require("./rolldown-binding.linux-arm-musleabihf.node");
299
+ } catch (e$1) {
300
+ loadErrors.push(e$1);
301
+ }
302
+ try {
303
+ const binding = __require("@rolldown/binding-linux-arm-musleabihf");
304
+ const bindingPackageVersion = __require("@rolldown/binding-linux-arm-musleabihf/package.json").version;
305
+ if (bindingPackageVersion !== "1.0.0-beta.46" && 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.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
306
+ return binding;
307
+ } catch (e$1) {
308
+ loadErrors.push(e$1);
309
+ }
310
+ } else {
311
+ try {
312
+ return __require("./rolldown-binding.linux-arm-gnueabihf.node");
313
+ } catch (e$1) {
314
+ loadErrors.push(e$1);
315
+ }
316
+ try {
317
+ const binding = __require("@rolldown/binding-linux-arm-gnueabihf");
318
+ const bindingPackageVersion = __require("@rolldown/binding-linux-arm-gnueabihf/package.json").version;
319
+ if (bindingPackageVersion !== "1.0.0-beta.46" && 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.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
320
+ return binding;
321
+ } catch (e$1) {
322
+ loadErrors.push(e$1);
323
+ }
324
+ }
325
+ else if (process.arch === "loong64") if (isMusl()) {
326
+ try {
327
+ return __require("./rolldown-binding.linux-loong64-musl.node");
328
+ } catch (e$1) {
329
+ loadErrors.push(e$1);
330
+ }
331
+ try {
332
+ const binding = __require("@rolldown/binding-linux-loong64-musl");
333
+ const bindingPackageVersion = __require("@rolldown/binding-linux-loong64-musl/package.json").version;
334
+ if (bindingPackageVersion !== "1.0.0-beta.46" && 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.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
335
+ return binding;
336
+ } catch (e$1) {
337
+ loadErrors.push(e$1);
338
+ }
339
+ } else {
340
+ try {
341
+ return __require("./rolldown-binding.linux-loong64-gnu.node");
342
+ } catch (e$1) {
343
+ loadErrors.push(e$1);
344
+ }
345
+ try {
346
+ const binding = __require("@rolldown/binding-linux-loong64-gnu");
347
+ const bindingPackageVersion = __require("@rolldown/binding-linux-loong64-gnu/package.json").version;
348
+ if (bindingPackageVersion !== "1.0.0-beta.46" && 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.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
349
+ return binding;
350
+ } catch (e$1) {
351
+ loadErrors.push(e$1);
352
+ }
353
+ }
354
+ else if (process.arch === "riscv64") if (isMusl()) {
355
+ try {
356
+ return __require("./rolldown-binding.linux-riscv64-musl.node");
357
+ } catch (e$1) {
358
+ loadErrors.push(e$1);
359
+ }
360
+ try {
361
+ const binding = __require("@rolldown/binding-linux-riscv64-musl");
362
+ const bindingPackageVersion = __require("@rolldown/binding-linux-riscv64-musl/package.json").version;
363
+ if (bindingPackageVersion !== "1.0.0-beta.46" && 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.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
364
+ return binding;
365
+ } catch (e$1) {
366
+ loadErrors.push(e$1);
367
+ }
368
+ } else {
369
+ try {
370
+ return __require("./rolldown-binding.linux-riscv64-gnu.node");
371
+ } catch (e$1) {
372
+ loadErrors.push(e$1);
373
+ }
374
+ try {
375
+ const binding = __require("@rolldown/binding-linux-riscv64-gnu");
376
+ const bindingPackageVersion = __require("@rolldown/binding-linux-riscv64-gnu/package.json").version;
377
+ if (bindingPackageVersion !== "1.0.0-beta.46" && 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.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
378
+ return binding;
379
+ } catch (e$1) {
380
+ loadErrors.push(e$1);
381
+ }
382
+ }
383
+ else if (process.arch === "ppc64") {
384
+ try {
385
+ return __require("./rolldown-binding.linux-ppc64-gnu.node");
386
+ } catch (e$1) {
387
+ loadErrors.push(e$1);
388
+ }
389
+ try {
390
+ const binding = __require("@rolldown/binding-linux-ppc64-gnu");
391
+ const bindingPackageVersion = __require("@rolldown/binding-linux-ppc64-gnu/package.json").version;
392
+ if (bindingPackageVersion !== "1.0.0-beta.46" && 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.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
393
+ return binding;
394
+ } catch (e$1) {
395
+ loadErrors.push(e$1);
396
+ }
397
+ } else if (process.arch === "s390x") {
398
+ try {
399
+ return __require("./rolldown-binding.linux-s390x-gnu.node");
400
+ } catch (e$1) {
401
+ loadErrors.push(e$1);
402
+ }
403
+ try {
404
+ const binding = __require("@rolldown/binding-linux-s390x-gnu");
405
+ const bindingPackageVersion = __require("@rolldown/binding-linux-s390x-gnu/package.json").version;
406
+ if (bindingPackageVersion !== "1.0.0-beta.46" && 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.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
407
+ return binding;
408
+ } catch (e$1) {
409
+ loadErrors.push(e$1);
410
+ }
411
+ } else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on Linux: ${process.arch}`));
412
+ else if (process.platform === "openharmony") if (process.arch === "arm64") {
413
+ try {
414
+ return __require("./rolldown-binding.openharmony-arm64.node");
415
+ } catch (e$1) {
416
+ loadErrors.push(e$1);
417
+ }
418
+ try {
419
+ const binding = __require("@rolldown/binding-openharmony-arm64");
420
+ const bindingPackageVersion = __require("@rolldown/binding-openharmony-arm64/package.json").version;
421
+ if (bindingPackageVersion !== "1.0.0-beta.46" && 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.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
422
+ return binding;
423
+ } catch (e$1) {
424
+ loadErrors.push(e$1);
425
+ }
426
+ } else if (process.arch === "x64") {
427
+ try {
428
+ return __require("./rolldown-binding.openharmony-x64.node");
429
+ } catch (e$1) {
430
+ loadErrors.push(e$1);
431
+ }
432
+ try {
433
+ const binding = __require("@rolldown/binding-openharmony-x64");
434
+ const bindingPackageVersion = __require("@rolldown/binding-openharmony-x64/package.json").version;
435
+ if (bindingPackageVersion !== "1.0.0-beta.46" && 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.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
436
+ return binding;
437
+ } catch (e$1) {
438
+ loadErrors.push(e$1);
439
+ }
440
+ } else if (process.arch === "arm") {
441
+ try {
442
+ return __require("./rolldown-binding.openharmony-arm.node");
443
+ } catch (e$1) {
444
+ loadErrors.push(e$1);
445
+ }
446
+ try {
447
+ const binding = __require("@rolldown/binding-openharmony-arm");
448
+ const bindingPackageVersion = __require("@rolldown/binding-openharmony-arm/package.json").version;
449
+ if (bindingPackageVersion !== "1.0.0-beta.46" && 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.46 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
450
+ return binding;
451
+ } catch (e$1) {
452
+ loadErrors.push(e$1);
453
+ }
454
+ } else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`));
455
+ else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`));
456
+ }
457
+ nativeBinding = requireNative();
458
+ if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
459
+ let wasiBinding = null;
460
+ let wasiBindingError = null;
461
+ try {
462
+ wasiBinding = __require("./rolldown-binding.wasi.cjs");
463
+ nativeBinding = wasiBinding;
464
+ } catch (err) {
465
+ if (process.env.NAPI_RS_FORCE_WASI) wasiBindingError = err;
466
+ }
467
+ if (!nativeBinding) try {
468
+ wasiBinding = __require("@rolldown/binding-wasm32-wasi");
469
+ nativeBinding = wasiBinding;
470
+ } catch (err) {
471
+ if (process.env.NAPI_RS_FORCE_WASI) {
472
+ wasiBindingError.cause = err;
473
+ loadErrors.push(err);
474
+ }
475
+ }
476
+ if (process.env.NAPI_RS_FORCE_WASI === "error" && !wasiBinding) {
477
+ const error$1 = /* @__PURE__ */ new Error("WASI binding not found and NAPI_RS_FORCE_WASI is set to error");
478
+ error$1.cause = wasiBindingError;
479
+ throw error$1;
480
+ }
481
+ }
482
+ if (!nativeBinding) {
483
+ if (loadErrors.length > 0) throw new Error("Cannot find native binding. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try `npm i` again after removing both package-lock.json and node_modules directory.", { cause: loadErrors.reduce((err, cur) => {
484
+ cur.cause = err;
485
+ return cur;
486
+ }) });
487
+ throw new Error(`Failed to load native binding`);
488
+ }
489
+ module.exports = nativeBinding;
490
+ module.exports.minify = nativeBinding.minify;
491
+ module.exports.Severity = nativeBinding.Severity;
492
+ module.exports.ParseResult = nativeBinding.ParseResult;
493
+ module.exports.ExportExportNameKind = nativeBinding.ExportExportNameKind;
494
+ module.exports.ExportImportNameKind = nativeBinding.ExportImportNameKind;
495
+ module.exports.ExportLocalNameKind = nativeBinding.ExportLocalNameKind;
496
+ module.exports.ImportNameKind = nativeBinding.ImportNameKind;
497
+ module.exports.parseAsync = nativeBinding.parseAsync;
498
+ module.exports.parseSync = nativeBinding.parseSync;
499
+ module.exports.rawTransferSupported = nativeBinding.rawTransferSupported;
500
+ module.exports.ResolverFactory = nativeBinding.ResolverFactory;
501
+ module.exports.EnforceExtension = nativeBinding.EnforceExtension;
502
+ module.exports.ModuleType = nativeBinding.ModuleType;
503
+ module.exports.sync = nativeBinding.sync;
504
+ module.exports.HelperMode = nativeBinding.HelperMode;
505
+ module.exports.isolatedDeclaration = nativeBinding.isolatedDeclaration;
506
+ module.exports.moduleRunnerTransform = nativeBinding.moduleRunnerTransform;
507
+ module.exports.transform = nativeBinding.transform;
508
+ module.exports.transformAsync = nativeBinding.transformAsync;
509
+ module.exports.BindingBundleEndEventData = nativeBinding.BindingBundleEndEventData;
510
+ module.exports.BindingBundleErrorEventData = nativeBinding.BindingBundleErrorEventData;
511
+ module.exports.BindingBundler = nativeBinding.BindingBundler;
512
+ module.exports.BindingBundlerImpl = nativeBinding.BindingBundlerImpl;
513
+ module.exports.BindingCallableBuiltinPlugin = nativeBinding.BindingCallableBuiltinPlugin;
514
+ module.exports.BindingChunkingContext = nativeBinding.BindingChunkingContext;
515
+ module.exports.BindingDevEngine = nativeBinding.BindingDevEngine;
516
+ module.exports.BindingMagicString = nativeBinding.BindingMagicString;
517
+ module.exports.BindingModuleInfo = nativeBinding.BindingModuleInfo;
518
+ module.exports.BindingNormalizedOptions = nativeBinding.BindingNormalizedOptions;
519
+ module.exports.BindingOutputAsset = nativeBinding.BindingOutputAsset;
520
+ module.exports.BindingOutputChunk = nativeBinding.BindingOutputChunk;
521
+ module.exports.BindingPluginContext = nativeBinding.BindingPluginContext;
522
+ module.exports.BindingRenderedChunk = nativeBinding.BindingRenderedChunk;
523
+ module.exports.BindingRenderedChunkMeta = nativeBinding.BindingRenderedChunkMeta;
524
+ module.exports.BindingRenderedModule = nativeBinding.BindingRenderedModule;
525
+ module.exports.BindingTransformPluginContext = nativeBinding.BindingTransformPluginContext;
526
+ module.exports.BindingUrlResolver = nativeBinding.BindingUrlResolver;
527
+ module.exports.BindingWatcher = nativeBinding.BindingWatcher;
528
+ module.exports.BindingWatcherChangeData = nativeBinding.BindingWatcherChangeData;
529
+ module.exports.BindingWatcherEvent = nativeBinding.BindingWatcherEvent;
530
+ module.exports.ParallelJsPluginRegistry = nativeBinding.ParallelJsPluginRegistry;
531
+ module.exports.ScheduledBuild = nativeBinding.ScheduledBuild;
532
+ module.exports.TraceSubscriberGuard = nativeBinding.TraceSubscriberGuard;
533
+ module.exports.BindingAttachDebugInfo = nativeBinding.BindingAttachDebugInfo;
534
+ module.exports.BindingBuiltinPluginName = nativeBinding.BindingBuiltinPluginName;
535
+ module.exports.BindingChunkModuleOrderBy = nativeBinding.BindingChunkModuleOrderBy;
536
+ module.exports.BindingLogLevel = nativeBinding.BindingLogLevel;
537
+ module.exports.BindingPluginOrder = nativeBinding.BindingPluginOrder;
538
+ module.exports.BindingPropertyReadSideEffects = nativeBinding.BindingPropertyReadSideEffects;
539
+ module.exports.BindingPropertyWriteSideEffects = nativeBinding.BindingPropertyWriteSideEffects;
540
+ module.exports.BindingRebuildStrategy = nativeBinding.BindingRebuildStrategy;
541
+ module.exports.createTokioRuntime = nativeBinding.createTokioRuntime;
542
+ module.exports.FilterTokenKind = nativeBinding.FilterTokenKind;
543
+ module.exports.initTraceSubscriber = nativeBinding.initTraceSubscriber;
544
+ module.exports.registerPlugins = nativeBinding.registerPlugins;
545
+ module.exports.shutdownAsyncRuntime = nativeBinding.shutdownAsyncRuntime;
546
+ module.exports.startAsyncRuntime = nativeBinding.startAsyncRuntime;
547
+ }) });
548
+
549
+ //#endregion
550
+ //#region src/setup.ts
551
+ var import_binding$9 = /* @__PURE__ */ __toESM(require_binding(), 1);
2
552
 
553
+ //#endregion
3
554
  //#region package.json
4
- var version = "1.0.0-beta.44";
555
+ var version = "1.0.0-beta.46";
5
556
 
6
557
  //#endregion
7
558
  //#region src/utils/code-frame.ts
@@ -227,6 +778,7 @@ function augmentCodeLocation(properties, pos, source, id$1) {
227
778
 
228
779
  //#endregion
229
780
  //#region src/builtin-plugin/utils.ts
781
+ var import_binding$8 = /* @__PURE__ */ __toESM(require_binding(), 1);
230
782
  var BuiltinPlugin = class {
231
783
  constructor(name, _options) {
232
784
  this.name = name;
@@ -234,7 +786,7 @@ var BuiltinPlugin = class {
234
786
  }
235
787
  };
236
788
  function makeBuiltinPluginCallable(plugin) {
237
- let callablePlugin = new BindingCallableBuiltinPlugin(bindingifyBuiltInPlugin(plugin));
789
+ let callablePlugin = new import_binding$8.BindingCallableBuiltinPlugin(bindingifyBuiltInPlugin(plugin));
238
790
  const wrappedPlugin = plugin;
239
791
  for (const key in callablePlugin) wrappedPlugin[key] = async function(...args$1) {
240
792
  try {
@@ -1833,6 +2385,25 @@ function tuple(items, message2) {
1833
2385
  };
1834
2386
  }
1835
2387
  /* @__NO_SIDE_EFFECTS__ */
2388
+ function undefined_(message2) {
2389
+ return {
2390
+ kind: "schema",
2391
+ type: "undefined",
2392
+ reference: undefined_,
2393
+ expects: "undefined",
2394
+ async: false,
2395
+ message: message2,
2396
+ get "~standard"() {
2397
+ return /* @__PURE__ */ _getStandardProps(this);
2398
+ },
2399
+ "~run"(dataset, config2) {
2400
+ if (dataset.value === void 0) dataset.typed = true;
2401
+ else _addIssue(this, "type", dataset, config2);
2402
+ return dataset;
2403
+ }
2404
+ };
2405
+ }
2406
+ /* @__NO_SIDE_EFFECTS__ */
1836
2407
  function _subIssues(datasets) {
1837
2408
  let issues;
1838
2409
  if (datasets) for (const dataset of datasets) if (issues) issues.push(...dataset.issues);
@@ -2015,6 +2586,9 @@ function safeParse(schema, input, config2) {
2015
2586
  //#endregion
2016
2587
  //#region src/utils/validator.ts
2017
2588
  const StringOrRegExpSchema = union([string(), instance(RegExp)]);
2589
+ function vFunction() {
2590
+ return function_();
2591
+ }
2018
2592
  const LogLevelSchema = union([
2019
2593
  literal("debug"),
2020
2594
  literal("info"),
@@ -2029,14 +2603,15 @@ const InputOptionSchema = union([
2029
2603
  array(string()),
2030
2604
  record(string(), string())
2031
2605
  ]);
2032
- const ExternalSchema = union([
2606
+ const ExternalOptionFunctionSchema = pipe(vFunction(), args(tuple([
2607
+ string(),
2608
+ optional(string()),
2609
+ boolean()
2610
+ ])), returns(nullish(boolean())));
2611
+ const ExternalOptionSchema = union([
2033
2612
  StringOrRegExpSchema,
2034
2613
  array(StringOrRegExpSchema),
2035
- pipe(function_(), args(tuple([
2036
- string(),
2037
- optional(string()),
2038
- boolean()
2039
- ])), returns(nullish(boolean())))
2614
+ ExternalOptionFunctionSchema
2040
2615
  ]);
2041
2616
  const ModuleTypesSchema = record(string(), union([
2042
2617
  literal("asset"),
@@ -2055,7 +2630,7 @@ const ModuleTypesSchema = record(string(), union([
2055
2630
  const JsxOptionsSchema = strictObject({
2056
2631
  runtime: pipe(optional(union([literal("classic"), literal("automatic")])), description("Which runtime to use")),
2057
2632
  development: pipe(optional(boolean()), description("Development specific information")),
2058
- throwIfNamespace: pipe(optional(string()), description("Toggles whether to throw an error when a tag name uses an XML namespace")),
2633
+ throwIfNamespace: pipe(optional(boolean()), description("Toggles whether to throw an error when a tag name uses an XML namespace")),
2059
2634
  importSource: pipe(optional(string()), description("Import the factory of element and fragment if mode is classic")),
2060
2635
  pragma: pipe(optional(string()), description("Jsx element transformation")),
2061
2636
  pragmaFrag: pipe(optional(string()), description("Jsx fragment transformation")),
@@ -2096,7 +2671,13 @@ const TransformOptionsSchema = object({
2096
2671
  typescript: optional(TypescriptSchema),
2097
2672
  helpers: optional(HelpersSchema),
2098
2673
  decorators: optional(DecoratorOptionSchema),
2099
- jsx: optional(union([literal("preserve"), JsxOptionsSchema])),
2674
+ jsx: optional(union([
2675
+ literal(false),
2676
+ literal("preserve"),
2677
+ literal("react"),
2678
+ literal("react-jsx"),
2679
+ JsxOptionsSchema
2680
+ ])),
2100
2681
  target: pipe(optional(union([string(), array(string())])), description("The JavaScript target environment")),
2101
2682
  define: optional(record(string(), string())),
2102
2683
  inject: optional(record(string(), union([string(), tuple([string(), string()])]))),
@@ -2131,8 +2712,8 @@ const ChecksOptionsSchema = strictObject({
2131
2712
  preferBuiltinFeature: pipe(optional(boolean()), description("Whether to emit warning when detecting prefer builtin feature"))
2132
2713
  });
2133
2714
  const CompressOptionsKeepNamesSchema = strictObject({
2134
- function: optional(boolean()),
2135
- class: optional(boolean())
2715
+ function: boolean(),
2716
+ class: boolean()
2136
2717
  });
2137
2718
  const CompressOptionsSchema = strictObject({
2138
2719
  target: optional(union([
@@ -2154,8 +2735,8 @@ const CompressOptionsSchema = strictObject({
2154
2735
  unused: optional(union([boolean(), literal("keep_assign")]))
2155
2736
  });
2156
2737
  const MangleOptionsKeepNamesSchema = strictObject({
2157
- function: optional(boolean()),
2158
- class: optional(boolean())
2738
+ function: boolean(),
2739
+ class: boolean()
2159
2740
  });
2160
2741
  const MangleOptionsSchema = strictObject({
2161
2742
  toplevel: optional(boolean()),
@@ -2194,22 +2775,19 @@ const TreeshakingOptionsSchema = union([boolean(), looseObject({
2194
2775
  propertyWriteSideEffects: optional(union([literal(false), literal("always")]))
2195
2776
  })]);
2196
2777
  const OptimizationOptionsSchema = strictObject({
2197
- inlineConst: pipe(optional(union([
2198
- boolean(),
2199
- literal("smart"),
2200
- strictObject({
2201
- mode: optional(union([literal("all"), literal("smart")])),
2202
- pass: optional(number())
2203
- })
2204
- ])), description("Enable crossmodule constant inlining")),
2778
+ inlineConst: pipe(optional(union([boolean(), strictObject({
2779
+ mode: optional(union([literal("all"), literal("smart")])),
2780
+ pass: optional(number())
2781
+ })])), description("Enable crossmodule constant inlining")),
2205
2782
  pifeForModuleWrappers: pipe(optional(boolean()), description("Use PIFE pattern for module wrappers"))
2206
2783
  });
2207
- const OnLogSchema = pipe(function_(), args(tuple([
2784
+ const LogOrStringHandlerSchema = pipe(vFunction(), args(tuple([LogLevelWithErrorSchema, RollupLogWithStringSchema])));
2785
+ const OnLogSchema = pipe(vFunction(), args(tuple([
2208
2786
  LogLevelSchema,
2209
2787
  RollupLogSchema,
2210
- pipe(function_(), args(tuple([LogLevelWithErrorSchema, RollupLogWithStringSchema])))
2788
+ LogOrStringHandlerSchema
2211
2789
  ])));
2212
- const OnwarnSchema = pipe(function_(), args(tuple([RollupLogSchema, pipe(function_(), args(tuple([union([RollupLogWithStringSchema, pipe(function_(), returns(RollupLogWithStringSchema))])])))])));
2790
+ const OnwarnSchema = pipe(vFunction(), args(tuple([RollupLogSchema, pipe(vFunction(), args(tuple([union([RollupLogWithStringSchema, pipe(vFunction(), returns(RollupLogWithStringSchema))])])))])));
2213
2791
  const HmrSchema = union([boolean(), strictObject({
2214
2792
  new: optional(boolean()),
2215
2793
  port: optional(number()),
@@ -2219,7 +2797,7 @@ const HmrSchema = union([boolean(), strictObject({
2219
2797
  const InputOptionsSchema = strictObject({
2220
2798
  input: optional(InputOptionSchema),
2221
2799
  plugins: optional(custom(() => true)),
2222
- external: optional(ExternalSchema),
2800
+ external: optional(ExternalOptionSchema),
2223
2801
  makeAbsoluteExternalsRelative: optional(union([boolean(), literal("ifRelativeSource")])),
2224
2802
  resolve: optional(ResolveOptionsSchema),
2225
2803
  cwd: pipe(optional(string()), description("Current working directory")),
@@ -2303,12 +2881,22 @@ const ModuleFormatSchema = union([
2303
2881
  literal("iife"),
2304
2882
  literal("umd")
2305
2883
  ]);
2306
- const AddonFunctionSchema = pipe(function_(), args(tuple([custom(() => true)])), returnsAsync(unionAsync([string(), pipeAsync(promise(), awaitAsync(), string())])));
2307
- const ChunkFileNamesSchema = union([string(), pipe(function_(), args(tuple([custom(() => true)])), returns(string()))]);
2308
- const AssetFileNamesSchema = union([string(), pipe(function_(), args(tuple([custom(() => true)])), returns(string()))]);
2309
- const SanitizeFileNameSchema = union([boolean(), pipe(function_(), args(tuple([string()])), returns(string()))]);
2310
- const GlobalsFunctionSchema = pipe(function_(), args(tuple([string()])), returns(string()));
2311
- const PathsFunctionSchema = pipe(function_(), args(tuple([string()])), returns(string()));
2884
+ const AddonFunctionSchema = pipe(vFunction(), args(tuple([custom(() => true)])), returnsAsync(unionAsync([string(), pipeAsync(promise(), awaitAsync(), string())])));
2885
+ const ChunkFileNamesFunctionSchema = pipe(vFunction(), args(tuple([custom(() => true)])), returns(string()));
2886
+ const ChunkFileNamesSchema = union([string(), ChunkFileNamesFunctionSchema]);
2887
+ const AssetFileNamesFunctionSchema = pipe(vFunction(), args(tuple([custom(() => true)])), returns(string()));
2888
+ const AssetFileNamesSchema = union([string(), AssetFileNamesFunctionSchema]);
2889
+ const SanitizeFileNameFunctionSchema = pipe(vFunction(), args(tuple([string()])), returns(string()));
2890
+ const SanitizeFileNameSchema = union([boolean(), SanitizeFileNameFunctionSchema]);
2891
+ const GlobalsFunctionSchema = pipe(vFunction(), args(tuple([string()])), returns(string()));
2892
+ const PathsFunctionSchema = pipe(vFunction(), args(tuple([string()])), returns(string()));
2893
+ const ManualChunksFunctionSchema = pipe(vFunction(), args(tuple([string(), object({})])), returns(nullish(string())));
2894
+ const AdvancedChunksNameFunctionSchema = pipe(vFunction(), args(tuple([string(), object({})])), returns(nullish(string())));
2895
+ const AdvancedChunksTestFunctionSchema = pipe(vFunction(), args(tuple([string()])), returns(union([
2896
+ boolean(),
2897
+ void_(),
2898
+ undefined_()
2899
+ ])));
2312
2900
  const AdvancedChunksSchema = strictObject({
2313
2901
  includeDependenciesRecursively: optional(boolean()),
2314
2902
  minSize: optional(number()),
@@ -2317,12 +2905,8 @@ const AdvancedChunksSchema = strictObject({
2317
2905
  maxModuleSize: optional(number()),
2318
2906
  minShareCount: optional(number()),
2319
2907
  groups: optional(array(strictObject({
2320
- name: union([string(), pipe(function_(), args(tuple([string()])), returns(nullish(string())))]),
2321
- test: optional(union([
2322
- string(),
2323
- instance(RegExp),
2324
- pipe(function_(), args(tuple([string()])), returns(union([nullish(boolean()), void_()])))
2325
- ])),
2908
+ name: union([string(), AdvancedChunksNameFunctionSchema]),
2909
+ test: optional(union([StringOrRegExpSchema, AdvancedChunksTestFunctionSchema])),
2326
2910
  priority: optional(number()),
2327
2911
  minSize: optional(number()),
2328
2912
  minShareCount: optional(number()),
@@ -2379,7 +2963,7 @@ const OutputOptionsSchema = strictObject({
2379
2963
  sanitizeFileName: optional(SanitizeFileNameSchema),
2380
2964
  minify: pipe(optional(union([
2381
2965
  boolean(),
2382
- string("dce-only"),
2966
+ literal("dce-only"),
2383
2967
  MinifyOptionsSchema
2384
2968
  ])), description("Minify the bundled file")),
2385
2969
  name: pipe(optional(string()), description("Name for UMD / IIFE format outputs")),
@@ -2388,15 +2972,12 @@ const OutputOptionsSchema = strictObject({
2388
2972
  generatedCode: pipe(optional(partial(GeneratedCodeOptionsSchema)), description("Generated code options")),
2389
2973
  externalLiveBindings: pipe(optional(boolean()), description("external live bindings")),
2390
2974
  inlineDynamicImports: pipe(optional(boolean()), description("Inline dynamic imports")),
2391
- manualChunks: optional(pipe(function_(), args(tuple([string(), object({})])), returns(union([string(), nullish(string())])))),
2975
+ manualChunks: optional(ManualChunksFunctionSchema),
2392
2976
  advancedChunks: optional(AdvancedChunksSchema),
2393
2977
  legalComments: pipe(optional(union([literal("none"), literal("inline")])), description("Control comments in the output")),
2394
2978
  plugins: optional(custom(() => true)),
2395
2979
  polyfillRequire: pipe(optional(boolean()), description("Disable require polyfill injection")),
2396
- hoistTransitiveImports: optional(custom((input) => {
2397
- if (input) return false;
2398
- return true;
2399
- }, () => `The 'true' value is not supported`)),
2980
+ hoistTransitiveImports: optional(literal(false)),
2400
2981
  preserveModules: pipe(optional(boolean()), description("Preserve module structure")),
2401
2982
  preserveModulesRoot: pipe(optional(string()), description("Put preserved modules under this path at root level")),
2402
2983
  virtualDirname: optional(string()),
@@ -2475,44 +3056,503 @@ function validateOption(key, options) {
2475
3056
  }
2476
3057
 
2477
3058
  //#endregion
2478
- //#region ../../node_modules/.pnpm/oxc-parser@0.95.0/node_modules/oxc-parser/src-js/wrap.js
2479
- function wrap$1(result) {
2480
- let program, module, comments, errors;
2481
- return {
2482
- get program() {
2483
- if (!program) program = jsonParseAst(result.program);
2484
- return program;
2485
- },
2486
- get module() {
2487
- if (!module) module = result.module;
2488
- return module;
2489
- },
2490
- get comments() {
2491
- if (!comments) comments = result.comments;
2492
- return comments;
2493
- },
2494
- get errors() {
2495
- if (!errors) errors = result.errors;
2496
- return errors;
2497
- }
3059
+ //#region src/decorators/lazy.ts
3060
+ const LAZY_FIELDS_KEY = Symbol("__lazy_fields__");
3061
+ const LAZY_CACHE_PREFIX = "__cached_";
3062
+ /**
3063
+ * Legacy decorator that makes a getter lazy-evaluated and cached.
3064
+ * Also auto-registers the field for batch prefetching.
3065
+ *
3066
+ * @example
3067
+ * ```typescript
3068
+ * class MyClass {
3069
+ * @lazy
3070
+ * get expensiveValue() {
3071
+ * return someExpensiveComputation();
3072
+ * }
3073
+ * }
3074
+ * ```
3075
+ */
3076
+ function lazy(target, propertyKey, descriptor) {
3077
+ if (!target.constructor[LAZY_FIELDS_KEY]) target.constructor[LAZY_FIELDS_KEY] = /* @__PURE__ */ new Set();
3078
+ target.constructor[LAZY_FIELDS_KEY].add(propertyKey);
3079
+ const originalGetter = descriptor.get;
3080
+ const cacheKey = LAZY_CACHE_PREFIX + propertyKey;
3081
+ descriptor.get = function() {
3082
+ if (!(cacheKey in this)) this[cacheKey] = originalGetter.call(this);
3083
+ return this[cacheKey];
2498
3084
  };
3085
+ return descriptor;
2499
3086
  }
2500
- function jsonParseAst(programJson) {
2501
- const { node: program, fixes } = JSON.parse(programJson);
2502
- for (const fixPath of fixes) applyFix(program, fixPath);
2503
- return program;
3087
+ /**
3088
+ * Get all lazy field names from a class instance.
3089
+ *
3090
+ * @param instance - Instance to inspect
3091
+ * @returns Set of lazy property names
3092
+ */
3093
+ function getLazyFields(instance$1) {
3094
+ return instance$1.constructor[LAZY_FIELDS_KEY] || /* @__PURE__ */ new Set();
2504
3095
  }
2505
- function applyFix(program, fixPath) {
2506
- let node = program;
2507
- for (const key of fixPath) node = node[key];
2508
- if (node.bigint) node.value = BigInt(node.bigint);
2509
- else try {
2510
- node.value = RegExp(node.regex.pattern, node.regex.flags);
2511
- } catch (_err) {}
3096
+
3097
+ //#endregion
3098
+ //#region src/decorators/non-enumerable.ts
3099
+ /**
3100
+ * Decorator that makes a property or method non-enumerable.
3101
+ * This hides the property from enumeration (e.g., Object.keys(), for...in loops).
3102
+ *
3103
+ * @example
3104
+ * ```typescript
3105
+ * class MyClass {
3106
+ * @nonEnumerable
3107
+ * hiddenMethod() {
3108
+ * return 'This method will not show up in Object.keys()';
3109
+ * }
3110
+ * }
3111
+ * ```
3112
+ */
3113
+ function nonEnumerable(target, propertyKey, descriptor) {
3114
+ descriptor.enumerable = false;
3115
+ return descriptor;
3116
+ }
3117
+
3118
+ //#endregion
3119
+ //#region src/utils/asset-source.ts
3120
+ function transformAssetSource(bindingAssetSource$1) {
3121
+ return bindingAssetSource$1.inner;
3122
+ }
3123
+ function bindingAssetSource(source) {
3124
+ return { inner: source };
3125
+ }
3126
+
3127
+ //#endregion
3128
+ //#region \0@oxc-project+runtime@0.96.0/helpers/decorate.js
3129
+ function __decorate(decorators, target, key, desc) {
3130
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3131
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
3132
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
3133
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
3134
+ }
3135
+
3136
+ //#endregion
3137
+ //#region src/types/output-asset-impl.ts
3138
+ var OutputAssetImpl = class {
3139
+ type = "asset";
3140
+ constructor(bindingAsset) {
3141
+ this.bindingAsset = bindingAsset;
3142
+ }
3143
+ get fileName() {
3144
+ return this.bindingAsset.getFileName();
3145
+ }
3146
+ get originalFileName() {
3147
+ return this.bindingAsset.getOriginalFileName() || null;
3148
+ }
3149
+ get originalFileNames() {
3150
+ return this.bindingAsset.getOriginalFileNames();
3151
+ }
3152
+ get name() {
3153
+ return this.bindingAsset.getName() ?? void 0;
3154
+ }
3155
+ get names() {
3156
+ return this.bindingAsset.getNames();
3157
+ }
3158
+ get source() {
3159
+ return transformAssetSource(this.bindingAsset.getSource());
3160
+ }
3161
+ __rolldown_external_memory_handle__(keepDataAlive) {
3162
+ if (keepDataAlive) this.#evaluateAllLazyFields();
3163
+ return this.bindingAsset.dropInner();
3164
+ }
3165
+ #evaluateAllLazyFields() {
3166
+ for (const field of getLazyFields(this)) this[field];
3167
+ }
3168
+ };
3169
+ __decorate([lazy], OutputAssetImpl.prototype, "fileName", null);
3170
+ __decorate([lazy], OutputAssetImpl.prototype, "originalFileName", null);
3171
+ __decorate([lazy], OutputAssetImpl.prototype, "originalFileNames", null);
3172
+ __decorate([lazy], OutputAssetImpl.prototype, "name", null);
3173
+ __decorate([lazy], OutputAssetImpl.prototype, "names", null);
3174
+ __decorate([lazy], OutputAssetImpl.prototype, "source", null);
3175
+ __decorate([nonEnumerable], OutputAssetImpl.prototype, "__rolldown_external_memory_handle__", null);
3176
+
3177
+ //#endregion
3178
+ //#region src/utils/transform-rendered-module.ts
3179
+ function transformToRenderedModule(bindingRenderedModule) {
3180
+ return {
3181
+ get code() {
3182
+ return bindingRenderedModule.code;
3183
+ },
3184
+ get renderedLength() {
3185
+ return bindingRenderedModule.code?.length || 0;
3186
+ },
3187
+ get renderedExports() {
3188
+ return bindingRenderedModule.renderedExports;
3189
+ }
3190
+ };
3191
+ }
3192
+
3193
+ //#endregion
3194
+ //#region src/utils/transform-rendered-chunk.ts
3195
+ function transformRenderedChunk(chunk) {
3196
+ let modules = null;
3197
+ return {
3198
+ type: "chunk",
3199
+ get name() {
3200
+ return chunk.name;
3201
+ },
3202
+ get isEntry() {
3203
+ return chunk.isEntry;
3204
+ },
3205
+ get isDynamicEntry() {
3206
+ return chunk.isDynamicEntry;
3207
+ },
3208
+ get facadeModuleId() {
3209
+ return chunk.facadeModuleId;
3210
+ },
3211
+ get moduleIds() {
3212
+ return chunk.moduleIds;
3213
+ },
3214
+ get exports() {
3215
+ return chunk.exports;
3216
+ },
3217
+ get fileName() {
3218
+ return chunk.fileName;
3219
+ },
3220
+ get imports() {
3221
+ return chunk.imports;
3222
+ },
3223
+ get dynamicImports() {
3224
+ return chunk.dynamicImports;
3225
+ },
3226
+ get modules() {
3227
+ if (!modules) modules = transformChunkModules(chunk.modules);
3228
+ return modules;
3229
+ }
3230
+ };
3231
+ }
3232
+ function transformChunkModules(modules) {
3233
+ const result = {};
3234
+ for (let i = 0; i < modules.values.length; i++) {
3235
+ let key = modules.keys[i];
3236
+ const mod = modules.values[i];
3237
+ result[key] = transformToRenderedModule(mod);
3238
+ }
3239
+ return result;
3240
+ }
3241
+
3242
+ //#endregion
3243
+ //#region src/types/output-chunk-impl.ts
3244
+ var OutputChunkImpl = class {
3245
+ type = "chunk";
3246
+ constructor(bindingChunk) {
3247
+ this.bindingChunk = bindingChunk;
3248
+ }
3249
+ get fileName() {
3250
+ return this.bindingChunk.getFileName();
3251
+ }
3252
+ get name() {
3253
+ return this.bindingChunk.getName();
3254
+ }
3255
+ get exports() {
3256
+ return this.bindingChunk.getExports();
3257
+ }
3258
+ get isEntry() {
3259
+ return this.bindingChunk.getIsEntry();
3260
+ }
3261
+ get facadeModuleId() {
3262
+ return this.bindingChunk.getFacadeModuleId() || null;
3263
+ }
3264
+ get isDynamicEntry() {
3265
+ return this.bindingChunk.getIsDynamicEntry();
3266
+ }
3267
+ get sourcemapFileName() {
3268
+ return this.bindingChunk.getSourcemapFileName() || null;
3269
+ }
3270
+ get preliminaryFileName() {
3271
+ return this.bindingChunk.getPreliminaryFileName();
3272
+ }
3273
+ get code() {
3274
+ return this.bindingChunk.getCode();
3275
+ }
3276
+ get modules() {
3277
+ return transformChunkModules(this.bindingChunk.getModules());
3278
+ }
3279
+ get imports() {
3280
+ return this.bindingChunk.getImports();
3281
+ }
3282
+ get dynamicImports() {
3283
+ return this.bindingChunk.getDynamicImports();
3284
+ }
3285
+ get moduleIds() {
3286
+ return this.bindingChunk.getModuleIds();
3287
+ }
3288
+ get map() {
3289
+ const mapString = this.bindingChunk.getMap();
3290
+ return mapString ? transformToRollupSourceMap(mapString) : null;
3291
+ }
3292
+ __rolldown_external_memory_handle__(keepDataAlive) {
3293
+ if (keepDataAlive) this.#evaluateAllLazyFields();
3294
+ return this.bindingChunk.dropInner();
3295
+ }
3296
+ #evaluateAllLazyFields() {
3297
+ for (const field of getLazyFields(this)) this[field];
3298
+ }
3299
+ };
3300
+ __decorate([lazy], OutputChunkImpl.prototype, "fileName", null);
3301
+ __decorate([lazy], OutputChunkImpl.prototype, "name", null);
3302
+ __decorate([lazy], OutputChunkImpl.prototype, "exports", null);
3303
+ __decorate([lazy], OutputChunkImpl.prototype, "isEntry", null);
3304
+ __decorate([lazy], OutputChunkImpl.prototype, "facadeModuleId", null);
3305
+ __decorate([lazy], OutputChunkImpl.prototype, "isDynamicEntry", null);
3306
+ __decorate([lazy], OutputChunkImpl.prototype, "sourcemapFileName", null);
3307
+ __decorate([lazy], OutputChunkImpl.prototype, "preliminaryFileName", null);
3308
+ __decorate([lazy], OutputChunkImpl.prototype, "code", null);
3309
+ __decorate([lazy], OutputChunkImpl.prototype, "modules", null);
3310
+ __decorate([lazy], OutputChunkImpl.prototype, "imports", null);
3311
+ __decorate([lazy], OutputChunkImpl.prototype, "dynamicImports", null);
3312
+ __decorate([lazy], OutputChunkImpl.prototype, "moduleIds", null);
3313
+ __decorate([lazy], OutputChunkImpl.prototype, "map", null);
3314
+ __decorate([nonEnumerable], OutputChunkImpl.prototype, "__rolldown_external_memory_handle__", null);
3315
+
3316
+ //#endregion
3317
+ //#region src/types/sourcemap.ts
3318
+ function bindingifySourcemap$1(map) {
3319
+ if (map == null) return;
3320
+ return { inner: typeof map === "string" ? map : {
3321
+ file: map.file ?? void 0,
3322
+ mappings: map.mappings,
3323
+ sourceRoot: "sourceRoot" in map ? map.sourceRoot ?? void 0 : void 0,
3324
+ sources: map.sources?.map((s) => s ?? void 0),
3325
+ sourcesContent: map.sourcesContent?.map((s) => s ?? void 0),
3326
+ names: map.names,
3327
+ x_google_ignoreList: map.x_google_ignoreList,
3328
+ debugId: "debugId" in map ? map.debugId : void 0
3329
+ } };
3330
+ }
3331
+
3332
+ //#endregion
3333
+ //#region src/utils/transform-to-rollup-output.ts
3334
+ function transformToRollupSourceMap(map) {
3335
+ const obj = {
3336
+ ...JSON.parse(map),
3337
+ toString() {
3338
+ return JSON.stringify(obj);
3339
+ },
3340
+ toUrl() {
3341
+ return `data:application/json;charset=utf-8;base64,${Buffer.from(obj.toString(), "utf-8").toString("base64")}`;
3342
+ }
3343
+ };
3344
+ return obj;
3345
+ }
3346
+ function transformToRollupOutputChunk(bindingChunk) {
3347
+ return new OutputChunkImpl(bindingChunk);
3348
+ }
3349
+ function transformToMutableRollupOutputChunk(bindingChunk, changed) {
3350
+ const chunk = {
3351
+ type: "chunk",
3352
+ get code() {
3353
+ return bindingChunk.getCode();
3354
+ },
3355
+ fileName: bindingChunk.getFileName(),
3356
+ name: bindingChunk.getName(),
3357
+ get modules() {
3358
+ return transformChunkModules(bindingChunk.getModules());
3359
+ },
3360
+ get imports() {
3361
+ return bindingChunk.getImports();
3362
+ },
3363
+ get dynamicImports() {
3364
+ return bindingChunk.getDynamicImports();
3365
+ },
3366
+ exports: bindingChunk.getExports(),
3367
+ isEntry: bindingChunk.getIsEntry(),
3368
+ facadeModuleId: bindingChunk.getFacadeModuleId() || null,
3369
+ isDynamicEntry: bindingChunk.getIsDynamicEntry(),
3370
+ get moduleIds() {
3371
+ return bindingChunk.getModuleIds();
3372
+ },
3373
+ get map() {
3374
+ const map = bindingChunk.getMap();
3375
+ return map ? transformToRollupSourceMap(map) : null;
3376
+ },
3377
+ sourcemapFileName: bindingChunk.getSourcemapFileName() || null,
3378
+ preliminaryFileName: bindingChunk.getPreliminaryFileName()
3379
+ };
3380
+ const cache = {};
3381
+ return new Proxy(chunk, {
3382
+ get(target, p) {
3383
+ if (p in cache) return cache[p];
3384
+ const value = target[p];
3385
+ cache[p] = value;
3386
+ return value;
3387
+ },
3388
+ set(_target, p, newValue) {
3389
+ cache[p] = newValue;
3390
+ changed.updated.add(bindingChunk.getFileName());
3391
+ return true;
3392
+ },
3393
+ has(target, p) {
3394
+ if (p in cache) return true;
3395
+ return p in target;
3396
+ }
3397
+ });
3398
+ }
3399
+ function transformToRollupOutputAsset(bindingAsset) {
3400
+ return new OutputAssetImpl(bindingAsset);
3401
+ }
3402
+ function transformToMutableRollupOutputAsset(bindingAsset, changed) {
3403
+ const asset = {
3404
+ type: "asset",
3405
+ fileName: bindingAsset.getFileName(),
3406
+ originalFileName: bindingAsset.getOriginalFileName() || null,
3407
+ originalFileNames: bindingAsset.getOriginalFileNames(),
3408
+ get source() {
3409
+ return transformAssetSource(bindingAsset.getSource());
3410
+ },
3411
+ name: bindingAsset.getName() ?? void 0,
3412
+ names: bindingAsset.getNames()
3413
+ };
3414
+ const cache = {};
3415
+ return new Proxy(asset, {
3416
+ get(target, p) {
3417
+ if (p in cache) return cache[p];
3418
+ const value = target[p];
3419
+ cache[p] = value;
3420
+ return value;
3421
+ },
3422
+ set(_target, p, newValue) {
3423
+ cache[p] = newValue;
3424
+ changed.updated.add(bindingAsset.getFileName());
3425
+ return true;
3426
+ }
3427
+ });
3428
+ }
3429
+ function transformToRollupOutput(output) {
3430
+ const { chunks, assets } = output;
3431
+ return { output: [...chunks.map((chunk) => transformToRollupOutputChunk(chunk)), ...assets.map((asset) => transformToRollupOutputAsset(asset))] };
3432
+ }
3433
+ function transformToMutableRollupOutput(output, changed) {
3434
+ const { chunks, assets } = output;
3435
+ return { output: [...chunks.map((chunk) => transformToMutableRollupOutputChunk(chunk, changed)), ...assets.map((asset) => transformToMutableRollupOutputAsset(asset, changed))] };
3436
+ }
3437
+ function transformToOutputBundle(context, output, changed) {
3438
+ const bundle = Object.fromEntries(transformToMutableRollupOutput(output, changed).output.map((item) => [item.fileName, item]));
3439
+ return new Proxy(bundle, {
3440
+ set(_target, _p, _newValue, _receiver) {
3441
+ const originalStackTraceLimit = Error.stackTraceLimit;
3442
+ Error.stackTraceLimit = 2;
3443
+ const message = "This plugin assigns to bundle variable. This is discouraged by Rollup and is not supported by Rolldown. This will be ignored. https://rollupjs.org/plugin-development/#generatebundle:~:text=DANGER,this.emitFile.";
3444
+ const stack = new Error(message).stack ?? message;
3445
+ Error.stackTraceLimit = originalStackTraceLimit;
3446
+ context.warn({
3447
+ message: stack,
3448
+ code: "UNSUPPORTED_BUNDLE_ASSIGNMENT"
3449
+ });
3450
+ return true;
3451
+ },
3452
+ deleteProperty(target, property) {
3453
+ if (typeof property === "string") changed.deleted.add(property);
3454
+ return true;
3455
+ }
3456
+ });
3457
+ }
3458
+ function collectChangedBundle(changed, bundle) {
3459
+ const changes = {};
3460
+ for (const key in bundle) {
3461
+ if (changed.deleted.has(key) || !changed.updated.has(key)) continue;
3462
+ const item = bundle[key];
3463
+ if (item.type === "asset") changes[key] = {
3464
+ filename: item.fileName,
3465
+ originalFileNames: item.originalFileNames,
3466
+ source: bindingAssetSource(item.source),
3467
+ names: item.names
3468
+ };
3469
+ else changes[key] = {
3470
+ code: item.code,
3471
+ filename: item.fileName,
3472
+ name: item.name,
3473
+ isEntry: item.isEntry,
3474
+ exports: item.exports,
3475
+ modules: {},
3476
+ imports: item.imports,
3477
+ dynamicImports: item.dynamicImports,
3478
+ facadeModuleId: item.facadeModuleId || void 0,
3479
+ isDynamicEntry: item.isDynamicEntry,
3480
+ moduleIds: item.moduleIds,
3481
+ map: bindingifySourcemap$1(item.map),
3482
+ sourcemapFilename: item.sourcemapFileName || void 0,
3483
+ preliminaryFilename: item.preliminaryFileName
3484
+ };
3485
+ }
3486
+ return {
3487
+ changes,
3488
+ deleted: changed.deleted
3489
+ };
3490
+ }
3491
+
3492
+ //#endregion
3493
+ //#region src/types/rolldown-output-impl.ts
3494
+ var RolldownOutputImpl = class {
3495
+ constructor(bindingOutputs) {
3496
+ this.bindingOutputs = bindingOutputs;
3497
+ }
3498
+ get output() {
3499
+ return transformToRollupOutput(this.bindingOutputs).output;
3500
+ }
3501
+ __rolldown_external_memory_handle__(keepDataAlive) {
3502
+ const results = this.output.map((item) => item.__rolldown_external_memory_handle__(keepDataAlive));
3503
+ if (!results.every((r) => r.freed)) {
3504
+ const reasons = results.filter((r) => !r.freed).map((r) => r.reason).filter(Boolean);
3505
+ return {
3506
+ freed: false,
3507
+ reason: `Failed to free ${reasons.length} item(s): ${reasons.join("; ")}`
3508
+ };
3509
+ }
3510
+ return { freed: true };
3511
+ }
3512
+ };
3513
+ __decorate([lazy], RolldownOutputImpl.prototype, "output", null);
3514
+ __decorate([nonEnumerable], RolldownOutputImpl.prototype, "__rolldown_external_memory_handle__", null);
3515
+
3516
+ //#endregion
3517
+ //#region ../../node_modules/.pnpm/oxc-parser@0.96.0/node_modules/oxc-parser/src-js/wrap.js
3518
+ function wrap$1(result) {
3519
+ let program, module$1, comments, errors;
3520
+ return {
3521
+ get program() {
3522
+ if (!program) program = jsonParseAst(result.program);
3523
+ return program;
3524
+ },
3525
+ get module() {
3526
+ if (!module$1) module$1 = result.module;
3527
+ return module$1;
3528
+ },
3529
+ get comments() {
3530
+ if (!comments) comments = result.comments;
3531
+ return comments;
3532
+ },
3533
+ get errors() {
3534
+ if (!errors) errors = result.errors;
3535
+ return errors;
3536
+ }
3537
+ };
3538
+ }
3539
+ function jsonParseAst(programJson) {
3540
+ const { node: program, fixes } = JSON.parse(programJson);
3541
+ for (const fixPath of fixes) applyFix(program, fixPath);
3542
+ return program;
3543
+ }
3544
+ function applyFix(program, fixPath) {
3545
+ let node = program;
3546
+ for (const key of fixPath) node = node[key];
3547
+ if (node.bigint) node.value = BigInt(node.bigint);
3548
+ else try {
3549
+ node.value = RegExp(node.regex.pattern, node.regex.flags);
3550
+ } catch {}
2512
3551
  }
2513
3552
 
2514
3553
  //#endregion
2515
3554
  //#region src/parse-ast-index.ts
3555
+ var import_binding$7 = /* @__PURE__ */ __toESM(require_binding(), 1);
2516
3556
  function wrap(result, sourceText) {
2517
3557
  result = wrap$1(result);
2518
3558
  if (result.errors.length > 0) return normalizeParseError(sourceText, result.errors);
@@ -2539,28 +3579,12 @@ const defaultParserOptions = {
2539
3579
  preserveParens: false
2540
3580
  };
2541
3581
  function parseAst(sourceText, options, filename) {
2542
- return wrap(parseSync(filename ?? "file.js", sourceText, {
3582
+ return wrap((0, import_binding$7.parseSync)(filename ?? "file.js", sourceText, {
2543
3583
  ...defaultParserOptions,
2544
3584
  ...options
2545
3585
  }), sourceText);
2546
3586
  }
2547
3587
 
2548
- //#endregion
2549
- //#region src/types/sourcemap.ts
2550
- function bindingifySourcemap$1(map) {
2551
- if (map == null) return;
2552
- return { inner: typeof map === "string" ? map : {
2553
- file: map.file ?? void 0,
2554
- mappings: map.mappings,
2555
- sourceRoot: "sourceRoot" in map ? map.sourceRoot ?? void 0 : void 0,
2556
- sources: map.sources?.map((s) => s ?? void 0),
2557
- sourcesContent: map.sourcesContent?.map((s) => s ?? void 0),
2558
- names: map.names,
2559
- x_google_ignoreList: map.x_google_ignoreList,
2560
- debugId: "debugId" in map ? map.debugId : void 0
2561
- } };
2562
- }
2563
-
2564
3588
  //#endregion
2565
3589
  //#region src/utils/error.ts
2566
3590
  function unwrapBindingResult(container) {
@@ -2663,7 +3687,7 @@ function normalizeTransformHookSourcemap(id$1, originalCode, rawMap) {
2663
3687
  }
2664
3688
 
2665
3689
  //#endregion
2666
- //#region ../pluginutils/dist/index.mjs
3690
+ //#region ../pluginutils/dist/composable-filters.js
2667
3691
  var And = class {
2668
3692
  kind;
2669
3693
  args;
@@ -2912,28 +3936,20 @@ function bindingifyRenderChunkFilter(filterOption) {
2912
3936
 
2913
3937
  //#endregion
2914
3938
  //#region src/plugin/bindingify-plugin-hook-meta.ts
3939
+ var import_binding$6 = /* @__PURE__ */ __toESM(require_binding(), 1);
2915
3940
  function bindingifyPluginHookMeta(options) {
2916
3941
  return { order: bindingPluginOrder(options.order) };
2917
3942
  }
2918
3943
  function bindingPluginOrder(order) {
2919
3944
  switch (order) {
2920
- case "post": return BindingPluginOrder.Post;
2921
- case "pre": return BindingPluginOrder.Pre;
3945
+ case "post": return import_binding$6.BindingPluginOrder.Post;
3946
+ case "pre": return import_binding$6.BindingPluginOrder.Pre;
2922
3947
  case null:
2923
3948
  case void 0: return;
2924
3949
  default: throw new Error(`Unknown plugin order: ${order}`);
2925
3950
  }
2926
3951
  }
2927
3952
 
2928
- //#endregion
2929
- //#region src/utils/asset-source.ts
2930
- function transformAssetSource(bindingAssetSource$1) {
2931
- return bindingAssetSource$1.inner;
2932
- }
2933
- function bindingAssetSource(source) {
2934
- return { inner: source };
2935
- }
2936
-
2937
3953
  //#endregion
2938
3954
  //#region src/plugin/fs.ts
2939
3955
  const fsModule = {
@@ -3093,6 +4109,7 @@ var TransformPluginContextImpl = class extends PluginContextImpl {
3093
4109
 
3094
4110
  //#endregion
3095
4111
  //#region src/plugin/bindingify-build-hooks.ts
4112
+ var import_binding$5 = /* @__PURE__ */ __toESM(require_binding(), 1);
3096
4113
  function bindingifyBuildStart(args$1) {
3097
4114
  const hook = args$1.plugin.buildStart;
3098
4115
  if (!hook) return {};
@@ -3190,7 +4207,7 @@ function bindingifyTransform(args$1) {
3190
4207
  plugin: async (ctx, code$1, id$1, meta$1) => {
3191
4208
  Object.defineProperties(meta$1, {
3192
4209
  magicString: { get() {
3193
- return new BindingMagicString(code$1);
4210
+ return new import_binding$5.BindingMagicString(code$1);
3194
4211
  } },
3195
4212
  ast: { get() {
3196
4213
  let lang = "js";
@@ -3221,7 +4238,7 @@ function bindingifyTransform(args$1) {
3221
4238
  let normalizedCode = void 0;
3222
4239
  let map = ret.map;
3223
4240
  if (typeof ret.code === "string") normalizedCode = ret.code;
3224
- else if (ret.code instanceof BindingMagicString) {
4241
+ else if (ret.code instanceof import_binding$5.BindingMagicString) {
3225
4242
  let magicString = ret.code;
3226
4243
  normalizedCode = magicString.toString();
3227
4244
  let fallbackSourcemap = ctx.sendMagicString(magicString);
@@ -3286,220 +4303,6 @@ function bindingifyModuleParsed(args$1) {
3286
4303
  };
3287
4304
  }
3288
4305
 
3289
- //#endregion
3290
- //#region src/utils/transform-rendered-module.ts
3291
- function transformToRenderedModule(bindingRenderedModule) {
3292
- return {
3293
- get code() {
3294
- return bindingRenderedModule.code;
3295
- },
3296
- get renderedLength() {
3297
- return bindingRenderedModule.code?.length || 0;
3298
- },
3299
- get renderedExports() {
3300
- return bindingRenderedModule.renderedExports;
3301
- }
3302
- };
3303
- }
3304
-
3305
- //#endregion
3306
- //#region src/utils/transform-rendered-chunk.ts
3307
- function transformRenderedChunk(chunk) {
3308
- let modules = null;
3309
- return {
3310
- type: "chunk",
3311
- get name() {
3312
- return chunk.name;
3313
- },
3314
- get isEntry() {
3315
- return chunk.isEntry;
3316
- },
3317
- get isDynamicEntry() {
3318
- return chunk.isDynamicEntry;
3319
- },
3320
- get facadeModuleId() {
3321
- return chunk.facadeModuleId;
3322
- },
3323
- get moduleIds() {
3324
- return chunk.moduleIds;
3325
- },
3326
- get exports() {
3327
- return chunk.exports;
3328
- },
3329
- get fileName() {
3330
- return chunk.fileName;
3331
- },
3332
- get imports() {
3333
- return chunk.imports;
3334
- },
3335
- get dynamicImports() {
3336
- return chunk.dynamicImports;
3337
- },
3338
- get modules() {
3339
- if (!modules) modules = transformChunkModules(chunk.modules);
3340
- return modules;
3341
- }
3342
- };
3343
- }
3344
- function transformChunkModules(modules) {
3345
- const result = {};
3346
- for (let i = 0; i < modules.values.length; i++) {
3347
- let key = modules.keys[i];
3348
- const mod = modules.values[i];
3349
- result[key] = transformToRenderedModule(mod);
3350
- }
3351
- return result;
3352
- }
3353
-
3354
- //#endregion
3355
- //#region src/utils/transform-to-rollup-output.ts
3356
- function transformToRollupSourceMap(map) {
3357
- const obj = {
3358
- ...JSON.parse(map),
3359
- toString() {
3360
- return JSON.stringify(obj);
3361
- },
3362
- toUrl() {
3363
- return `data:application/json;charset=utf-8;base64,${Buffer.from(obj.toString(), "utf-8").toString("base64")}`;
3364
- }
3365
- };
3366
- return obj;
3367
- }
3368
- function transformToRollupOutputChunk(bindingChunk, changed) {
3369
- const chunk = {
3370
- type: "chunk",
3371
- get code() {
3372
- return bindingChunk.code;
3373
- },
3374
- fileName: bindingChunk.fileName,
3375
- name: bindingChunk.name,
3376
- get modules() {
3377
- return transformChunkModules(bindingChunk.modules);
3378
- },
3379
- get imports() {
3380
- return bindingChunk.imports;
3381
- },
3382
- get dynamicImports() {
3383
- return bindingChunk.dynamicImports;
3384
- },
3385
- exports: bindingChunk.exports,
3386
- isEntry: bindingChunk.isEntry,
3387
- facadeModuleId: bindingChunk.facadeModuleId || null,
3388
- isDynamicEntry: bindingChunk.isDynamicEntry,
3389
- get moduleIds() {
3390
- return bindingChunk.moduleIds;
3391
- },
3392
- get map() {
3393
- return bindingChunk.map ? transformToRollupSourceMap(bindingChunk.map) : null;
3394
- },
3395
- sourcemapFileName: bindingChunk.sourcemapFileName || null,
3396
- preliminaryFileName: bindingChunk.preliminaryFileName
3397
- };
3398
- const cache = {};
3399
- return new Proxy(chunk, {
3400
- get(target, p) {
3401
- if (p in cache) return cache[p];
3402
- const value = target[p];
3403
- cache[p] = value;
3404
- return value;
3405
- },
3406
- set(_target, p, newValue) {
3407
- cache[p] = newValue;
3408
- changed?.updated.add(bindingChunk.fileName);
3409
- return true;
3410
- },
3411
- has(target, p) {
3412
- if (p in cache) return true;
3413
- return p in target;
3414
- }
3415
- });
3416
- }
3417
- function transformToRollupOutputAsset(bindingAsset, changed) {
3418
- const asset = {
3419
- type: "asset",
3420
- fileName: bindingAsset.fileName,
3421
- originalFileName: bindingAsset.originalFileName || null,
3422
- originalFileNames: bindingAsset.originalFileNames,
3423
- get source() {
3424
- return transformAssetSource(bindingAsset.source);
3425
- },
3426
- name: bindingAsset.name ?? void 0,
3427
- names: bindingAsset.names
3428
- };
3429
- const cache = {};
3430
- return new Proxy(asset, {
3431
- get(target, p) {
3432
- if (p in cache) return cache[p];
3433
- const value = target[p];
3434
- cache[p] = value;
3435
- return value;
3436
- },
3437
- set(_target, p, newValue) {
3438
- cache[p] = newValue;
3439
- changed?.updated.add(bindingAsset.fileName);
3440
- return true;
3441
- }
3442
- });
3443
- }
3444
- function transformToRollupOutput(output, changed) {
3445
- const { chunks, assets } = output;
3446
- return { output: [...chunks.map((chunk) => transformToRollupOutputChunk(chunk, changed)), ...assets.map((asset) => transformToRollupOutputAsset(asset, changed))] };
3447
- }
3448
- function transformToOutputBundle(context, output, changed) {
3449
- const bundle = Object.fromEntries(transformToRollupOutput(output, changed).output.map((item) => [item.fileName, item]));
3450
- return new Proxy(bundle, {
3451
- set(_target, _p, _newValue, _receiver) {
3452
- const originalStackTraceLimit = Error.stackTraceLimit;
3453
- Error.stackTraceLimit = 2;
3454
- const message = "This plugin assigns to bundle variable. This is discouraged by Rollup and is not supported by Rolldown. This will be ignored. https://rollupjs.org/plugin-development/#generatebundle:~:text=DANGER,this.emitFile.";
3455
- const stack = new Error(message).stack ?? message;
3456
- Error.stackTraceLimit = originalStackTraceLimit;
3457
- context.warn({
3458
- message: stack,
3459
- code: "UNSUPPORTED_BUNDLE_ASSIGNMENT"
3460
- });
3461
- return true;
3462
- },
3463
- deleteProperty(target, property) {
3464
- if (typeof property === "string") changed.deleted.add(property);
3465
- return true;
3466
- }
3467
- });
3468
- }
3469
- function collectChangedBundle(changed, bundle) {
3470
- const changes = {};
3471
- for (const key in bundle) {
3472
- if (changed.deleted.has(key) || !changed.updated.has(key)) continue;
3473
- const item = bundle[key];
3474
- if (item.type === "asset") changes[key] = {
3475
- filename: item.fileName,
3476
- originalFileNames: item.originalFileNames,
3477
- source: bindingAssetSource(item.source),
3478
- names: item.names
3479
- };
3480
- else changes[key] = {
3481
- code: item.code,
3482
- filename: item.fileName,
3483
- name: item.name,
3484
- isEntry: item.isEntry,
3485
- exports: item.exports,
3486
- modules: {},
3487
- imports: item.imports,
3488
- dynamicImports: item.dynamicImports,
3489
- facadeModuleId: item.facadeModuleId || void 0,
3490
- isDynamicEntry: item.isDynamicEntry,
3491
- moduleIds: item.moduleIds,
3492
- map: bindingifySourcemap$1(item.map),
3493
- sourcemapFilename: item.sourcemapFileName || void 0,
3494
- preliminaryFilename: item.preliminaryFileName
3495
- };
3496
- }
3497
- return {
3498
- changes,
3499
- deleted: changed.deleted
3500
- };
3501
- }
3502
-
3503
4306
  //#endregion
3504
4307
  //#region src/plugin/bindingify-output-hooks.ts
3505
4308
  function bindingifyRenderStart(args$1) {
@@ -3539,7 +4342,7 @@ function bindingifyAugmentChunkHash(args$1) {
3539
4342
  const { handler, meta } = normalizeHook(hook);
3540
4343
  return {
3541
4344
  plugin: async (ctx, chunk) => {
3542
- return await handler.call(new PluginContextImpl(args$1.outputOptions, ctx, args$1.plugin, args$1.pluginContextData, args$1.onLog, args$1.logLevel, args$1.watchMode), transformRenderedChunk(chunk));
4345
+ return handler.call(new PluginContextImpl(args$1.outputOptions, ctx, args$1.plugin, args$1.pluginContextData, args$1.onLog, args$1.logLevel, args$1.watchMode), transformRenderedChunk(chunk));
3543
4346
  },
3544
4347
  meta: bindingifyPluginHookMeta(meta)
3545
4348
  };
@@ -4164,6 +4967,7 @@ function normalizeTransformOptions(inputOptions, onLog) {
4164
4967
 
4165
4968
  //#endregion
4166
4969
  //#region src/utils/bindingify-input-options.ts
4970
+ var import_binding$4 = /* @__PURE__ */ __toESM(require_binding(), 1);
4167
4971
  function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normalizedOutputPlugins, onLog, logLevel, watchMode) {
4168
4972
  const pluginContextData = new PluginContextData(onLog, outputOptions, normalizedOutputPlugins);
4169
4973
  const plugins = rawPlugins.map((plugin) => {
@@ -4233,9 +5037,9 @@ function bindingifyHmr(hmr) {
4233
5037
  function bindingifyAttachDebugInfo(attachDebugInfo) {
4234
5038
  switch (attachDebugInfo) {
4235
5039
  case void 0: return;
4236
- case "full": return BindingAttachDebugInfo.Full;
4237
- case "simple": return BindingAttachDebugInfo.Simple;
4238
- case "none": return BindingAttachDebugInfo.None;
5040
+ case "full": return import_binding$4.BindingAttachDebugInfo.Full;
5041
+ case "simple": return import_binding$4.BindingAttachDebugInfo.Simple;
5042
+ case "none": return import_binding$4.BindingAttachDebugInfo.None;
4239
5043
  }
4240
5044
  }
4241
5045
  function bindingifyExternal(external) {
@@ -4248,13 +5052,13 @@ function bindingifyExternal(external) {
4248
5052
  }
4249
5053
  }
4250
5054
  function bindingifyExperimental(experimental) {
4251
- let chunkModulesOrder = BindingChunkModuleOrderBy.ExecOrder;
5055
+ let chunkModulesOrder = import_binding$4.BindingChunkModuleOrderBy.ExecOrder;
4252
5056
  if (experimental?.chunkModulesOrder) switch (experimental.chunkModulesOrder) {
4253
5057
  case "exec-order":
4254
- chunkModulesOrder = BindingChunkModuleOrderBy.ExecOrder;
5058
+ chunkModulesOrder = import_binding$4.BindingChunkModuleOrderBy.ExecOrder;
4255
5059
  break;
4256
5060
  case "module-id":
4257
- chunkModulesOrder = BindingChunkModuleOrderBy.ModuleId;
5061
+ chunkModulesOrder = import_binding$4.BindingChunkModuleOrderBy.ModuleId;
4258
5062
  break;
4259
5063
  default: throw new Error(`Unexpected chunkModulesOrder: ${experimental.chunkModulesOrder}`);
4260
5064
  }
@@ -4314,10 +5118,10 @@ function bindingifyInject(inject) {
4314
5118
  }
4315
5119
  function bindingifyLogLevel(logLevel) {
4316
5120
  switch (logLevel) {
4317
- case "silent": return BindingLogLevel.Silent;
4318
- case "debug": return BindingLogLevel.Debug;
4319
- case "warn": return BindingLogLevel.Warn;
4320
- case "info": return BindingLogLevel.Info;
5121
+ case "silent": return import_binding$4.BindingLogLevel.Silent;
5122
+ case "debug": return import_binding$4.BindingLogLevel.Debug;
5123
+ case "warn": return import_binding$4.BindingLogLevel.Warn;
5124
+ case "info": return import_binding$4.BindingLogLevel.Info;
4321
5125
  default: throw new Error(`Unexpected log level: ${logLevel}`);
4322
5126
  }
4323
5127
  }
@@ -4353,19 +5157,19 @@ function bindingifyTreeshakeOptions(config) {
4353
5157
  };
4354
5158
  switch (config.propertyReadSideEffects) {
4355
5159
  case "always":
4356
- normalizedConfig.propertyReadSideEffects = BindingPropertyReadSideEffects.Always;
5160
+ normalizedConfig.propertyReadSideEffects = import_binding$4.BindingPropertyReadSideEffects.Always;
4357
5161
  break;
4358
5162
  case false:
4359
- normalizedConfig.propertyReadSideEffects = BindingPropertyReadSideEffects.False;
5163
+ normalizedConfig.propertyReadSideEffects = import_binding$4.BindingPropertyReadSideEffects.False;
4360
5164
  break;
4361
5165
  default:
4362
5166
  }
4363
5167
  switch (config.propertyWriteSideEffects) {
4364
5168
  case "always":
4365
- normalizedConfig.propertyWriteSideEffects = BindingPropertyWriteSideEffects.Always;
5169
+ normalizedConfig.propertyWriteSideEffects = import_binding$4.BindingPropertyWriteSideEffects.Always;
4366
5170
  break;
4367
5171
  case false:
4368
- normalizedConfig.propertyWriteSideEffects = BindingPropertyWriteSideEffects.False;
5172
+ normalizedConfig.propertyWriteSideEffects = import_binding$4.BindingPropertyWriteSideEffects.False;
4369
5173
  break;
4370
5174
  default:
4371
5175
  }
@@ -4523,6 +5327,10 @@ function bindingifyAdvancedChunks(advancedChunks, manualChunks) {
4523
5327
  };
4524
5328
  }
4525
5329
 
5330
+ //#endregion
5331
+ //#region src/utils/initialize-parallel-plugins.ts
5332
+ var import_binding$3 = /* @__PURE__ */ __toESM(require_binding(), 1);
5333
+
4526
5334
  //#endregion
4527
5335
  //#region src/utils/create-bundler-option.ts
4528
5336
  async function createBundlerOptions(inputOptions, outputOptions, watchMode) {
@@ -4553,6 +5361,7 @@ async function createBundlerOptions(inputOptions, outputOptions, watchMode) {
4553
5361
 
4554
5362
  //#endregion
4555
5363
  //#region src/api/rolldown/rolldown-build.ts
5364
+ var import_binding$2 = /* @__PURE__ */ __toESM(require_binding(), 1);
4556
5365
  Symbol.asyncDispose ??= Symbol("Symbol.asyncDispose");
4557
5366
  var RolldownBuild = class RolldownBuild {
4558
5367
  #inputOptions;
@@ -4561,7 +5370,7 @@ var RolldownBuild = class RolldownBuild {
4561
5370
  static asyncRuntimeShutdown = false;
4562
5371
  constructor(inputOptions) {
4563
5372
  this.#inputOptions = inputOptions;
4564
- this.#bundler = new BindingBundler();
5373
+ this.#bundler = new import_binding$2.BindingBundler();
4565
5374
  }
4566
5375
  get closed() {
4567
5376
  return this.#bundlerImpl?.impl.closed ?? true;
@@ -4569,13 +5378,13 @@ var RolldownBuild = class RolldownBuild {
4569
5378
  async #getBundlerWithStopWorker(outputOptions) {
4570
5379
  if (this.#bundlerImpl) await this.#bundlerImpl.stopWorkers?.();
4571
5380
  const option = await createBundlerOptions(this.#inputOptions, outputOptions, false);
4572
- if (RolldownBuild.asyncRuntimeShutdown) startAsyncRuntime();
5381
+ if (RolldownBuild.asyncRuntimeShutdown) (0, import_binding$2.startAsyncRuntime)();
4573
5382
  try {
4574
5383
  return this.#bundlerImpl = {
4575
5384
  impl: this.#bundler.createImpl(option.bundlerOptions),
4576
5385
  stopWorkers: option.stopWorkers,
4577
5386
  shutdown: () => {
4578
- shutdownAsyncRuntime();
5387
+ (0, import_binding$2.shutdownAsyncRuntime)();
4579
5388
  RolldownBuild.asyncRuntimeShutdown = true;
4580
5389
  }
4581
5390
  };
@@ -4591,13 +5400,16 @@ var RolldownBuild = class RolldownBuild {
4591
5400
  async generate(outputOptions = {}) {
4592
5401
  validateOption("output", outputOptions);
4593
5402
  const { impl } = await this.#getBundlerWithStopWorker(outputOptions);
4594
- return transformToRollupOutput(unwrapBindingResult(await impl.generate()));
5403
+ return new RolldownOutputImpl(unwrapBindingResult(await impl.generate()));
4595
5404
  }
4596
5405
  async write(outputOptions = {}) {
4597
5406
  validateOption("output", outputOptions);
4598
5407
  const { impl } = await this.#getBundlerWithStopWorker(outputOptions);
4599
- return transformToRollupOutput(unwrapBindingResult(await impl.write()));
5408
+ return new RolldownOutputImpl(unwrapBindingResult(await impl.write()));
4600
5409
  }
5410
+ /**
5411
+ * Close the build and free resources.
5412
+ */
4601
5413
  async close() {
4602
5414
  if (this.#bundlerImpl) {
4603
5415
  await this.#bundlerImpl.stopWorkers?.();
@@ -4712,6 +5524,7 @@ var WatcherEmitter = class {
4712
5524
 
4713
5525
  //#endregion
4714
5526
  //#region src/api/watch/watcher.ts
5527
+ var import_binding$1 = /* @__PURE__ */ __toESM(require_binding(), 1);
4715
5528
  var Watcher = class {
4716
5529
  closed;
4717
5530
  inner;
@@ -4733,7 +5546,7 @@ var Watcher = class {
4733
5546
  this.closed = true;
4734
5547
  for (const stop of this.stopWorkers) await stop?.();
4735
5548
  await this.inner.close();
4736
- shutdownAsyncRuntime();
5549
+ (0, import_binding$1.shutdownAsyncRuntime)();
4737
5550
  }
4738
5551
  start() {
4739
5552
  process.nextTick(() => this.inner.start(this.emitter.onEvent.bind(this.emitter)));
@@ -4745,7 +5558,7 @@ async function createWatcher(emitter, input) {
4745
5558
  return createBundlerOptions(await PluginDriver.callOptionsHook(option, true), output, true);
4746
5559
  })).flat());
4747
5560
  const notifyOptions = getValidNotifyOption(bundlerOptions);
4748
- new Watcher(emitter, new BindingWatcher(bundlerOptions.map((option) => option.bundlerOptions), notifyOptions), bundlerOptions.map((option) => option.stopWorkers)).start();
5561
+ new Watcher(emitter, new import_binding$1.BindingWatcher(bundlerOptions.map((option) => option.bundlerOptions), notifyOptions), bundlerOptions.map((option) => option.stopWorkers)).start();
4749
5562
  }
4750
5563
  function getValidNotifyOption(bundlerOptions) {
4751
5564
  let result;
@@ -4774,7 +5587,8 @@ function defineConfig(config) {
4774
5587
 
4775
5588
  //#endregion
4776
5589
  //#region src/index.ts
5590
+ var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
4777
5591
  const VERSION = version;
4778
5592
 
4779
5593
  //#endregion
4780
- export { build as a, createBundlerOptions as c, normalizeBindingResult as d, bindingifySourcemap$1 as f, makeBuiltinPluginCallable as h, watch as i, normalizedStringOrRegex as l, BuiltinPlugin as m, VERSION as n, rolldown as o, PluginDriver as p, defineConfig as r, RolldownBuild as s, BindingMagicString$1 as t, transformToRollupOutput as u };
5594
+ export { __toESM as _, build as a, createBundlerOptions as c, transformToRollupOutput as d, bindingifySourcemap$1 as f, require_binding as g, makeBuiltinPluginCallable as h, watch as i, normalizedStringOrRegex as l, BuiltinPlugin as m, import_binding as n, rolldown as o, PluginDriver as p, defineConfig as r, RolldownBuild as s, VERSION as t, normalizeBindingResult as u };