@rolldown/browser 1.0.0-beta.34 → 1.0.0-beta.35

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 (36) hide show
  1. package/dist/cli.cjs +215 -210
  2. package/dist/cli.mjs +203 -203
  3. package/dist/config.cjs +3 -3
  4. package/dist/config.d.cts +1 -1
  5. package/dist/config.d.mts +1 -1
  6. package/dist/config.mjs +2 -2
  7. package/dist/experimental-index.browser.mjs +20 -6
  8. package/dist/experimental-index.cjs +25 -9
  9. package/dist/experimental-index.d.cts +13 -4
  10. package/dist/experimental-index.d.mts +13 -4
  11. package/dist/experimental-index.mjs +20 -6
  12. package/dist/filter-index.d.cts +1 -1
  13. package/dist/filter-index.d.mts +1 -1
  14. package/dist/index.browser.mjs +1 -1
  15. package/dist/index.cjs +2 -2
  16. package/dist/index.d.cts +1 -1
  17. package/dist/index.d.mts +1 -1
  18. package/dist/index.mjs +1 -1
  19. package/dist/parallel-plugin-worker.cjs +6 -4
  20. package/dist/parallel-plugin-worker.mjs +2 -2
  21. package/dist/parallel-plugin.d.cts +1 -1
  22. package/dist/parallel-plugin.d.mts +1 -1
  23. package/dist/parse-ast-index.cjs +1 -1
  24. package/dist/rolldown-binding.wasi-browser.js +4 -0
  25. package/dist/rolldown-binding.wasi.cjs +4 -0
  26. package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
  27. package/dist/shared/{define-config-DzIQxNqU.d.mts → define-config-DJXaSinS.d.mts} +29 -2
  28. package/dist/shared/{define-config-D5AluabE.d.cts → define-config-DhrkZ_o7.d.cts} +29 -2
  29. package/dist/shared/{load-config--VYNOtUY.mjs → load-config-BCjD-AGJ.mjs} +1 -1
  30. package/dist/shared/{load-config-DfHD1OI9.cjs → load-config-BJKhRKZL.cjs} +11 -6
  31. package/dist/shared/{parse-ast-index-ChWj_C49.cjs → parse-ast-index-J0xVKZRe.cjs} +2 -1
  32. package/dist/shared/{prompt-QNI93ne7.cjs → prompt-Q05EYrFb.cjs} +8 -4
  33. package/dist/shared/{src-B4V64IkU.mjs → src-B0RCtUy7.mjs} +75 -31
  34. package/dist/shared/{src-McCMqGpa.cjs → src-Bd4BGX4v.cjs} +91 -41
  35. package/dist/{src-Bl12Y5ab.js → src-C8U06Im1.js} +73 -29
  36. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -1,13 +1,214 @@
1
- import { __commonJS, __toESM, ansis_default, description, getInputCliKeys, getJsonSchema, getOutputCliKeys, rolldown, validateCliOptions, version, watch } from "./shared/src-B4V64IkU.mjs";
1
+ import { __commonJS, __toESM, ansis_default, description, getInputCliKeys, getJsonSchema, getOutputCliKeys, rolldown, validateCliOptions, version, watch } from "./shared/src-B0RCtUy7.mjs";
2
2
  import "./shared/parse-ast-index-C_CZT4St.mjs";
3
3
  import { arraify } from "./shared/dist-ByKQkexh.mjs";
4
- import { loadConfig } from "./shared/load-config--VYNOtUY.mjs";
4
+ import { loadConfig } from "./shared/load-config-BCjD-AGJ.mjs";
5
5
  import path, { sep } from "node:path";
6
6
  import process$1 from "node:process";
7
7
  import { formatWithOptions, parseArgs } from "node:util";
8
8
  import * as tty from "node:tty";
9
9
  import { performance } from "node:perf_hooks";
10
10
 
11
+ //#region ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js
12
+ /**
13
+ * This is not the set of all possible signals.
14
+ *
15
+ * It IS, however, the set of all signals that trigger
16
+ * an exit on either Linux or BSD systems. Linux is a
17
+ * superset of the signal names supported on BSD, and
18
+ * the unknown signals just fail to register, so we can
19
+ * catch that easily enough.
20
+ *
21
+ * Windows signals are a different set, since there are
22
+ * signals that terminate Windows processes, but don't
23
+ * terminate (or don't even exist) on Posix systems.
24
+ *
25
+ * Don't bother with SIGKILL. It's uncatchable, which
26
+ * means that we can't fire any callbacks anyway.
27
+ *
28
+ * If a user does happen to register a handler on a non-
29
+ * fatal signal like SIGWINCH or something, and then
30
+ * exit, it'll end up firing `process.emit('exit')`, so
31
+ * the handler will be fired anyway.
32
+ *
33
+ * SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
34
+ * artificially, inherently leave the process in a
35
+ * state from which it is not safe to try and enter JS
36
+ * listeners.
37
+ */
38
+ const signals = [];
39
+ signals.push("SIGHUP", "SIGINT", "SIGTERM");
40
+ if (process.platform !== "win32") signals.push("SIGALRM", "SIGABRT", "SIGVTALRM", "SIGXCPU", "SIGXFSZ", "SIGUSR2", "SIGTRAP", "SIGSYS", "SIGQUIT", "SIGIOT");
41
+ if (process.platform === "linux") signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
42
+
43
+ //#endregion
44
+ //#region ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js
45
+ const processOk = (process$3) => !!process$3 && typeof process$3 === "object" && typeof process$3.removeListener === "function" && typeof process$3.emit === "function" && typeof process$3.reallyExit === "function" && typeof process$3.listeners === "function" && typeof process$3.kill === "function" && typeof process$3.pid === "number" && typeof process$3.on === "function";
46
+ const kExitEmitter = Symbol.for("signal-exit emitter");
47
+ const global = globalThis;
48
+ const ObjectDefineProperty = Object.defineProperty.bind(Object);
49
+ var Emitter = class {
50
+ emitted = {
51
+ afterExit: false,
52
+ exit: false
53
+ };
54
+ listeners = {
55
+ afterExit: [],
56
+ exit: []
57
+ };
58
+ count = 0;
59
+ id = Math.random();
60
+ constructor() {
61
+ if (global[kExitEmitter]) return global[kExitEmitter];
62
+ ObjectDefineProperty(global, kExitEmitter, {
63
+ value: this,
64
+ writable: false,
65
+ enumerable: false,
66
+ configurable: false
67
+ });
68
+ }
69
+ on(ev, fn) {
70
+ this.listeners[ev].push(fn);
71
+ }
72
+ removeListener(ev, fn) {
73
+ const list = this.listeners[ev];
74
+ const i$1 = list.indexOf(fn);
75
+ /* c8 ignore start */
76
+ if (i$1 === -1) return;
77
+ /* c8 ignore stop */
78
+ if (i$1 === 0 && list.length === 1) list.length = 0;
79
+ else list.splice(i$1, 1);
80
+ }
81
+ emit(ev, code, signal) {
82
+ if (this.emitted[ev]) return false;
83
+ this.emitted[ev] = true;
84
+ let ret = false;
85
+ for (const fn of this.listeners[ev]) ret = fn(code, signal) === true || ret;
86
+ if (ev === "exit") ret = this.emit("afterExit", code, signal) || ret;
87
+ return ret;
88
+ }
89
+ };
90
+ var SignalExitBase = class {};
91
+ const signalExitWrap = (handler) => {
92
+ return {
93
+ onExit(cb, opts) {
94
+ return handler.onExit(cb, opts);
95
+ },
96
+ load() {
97
+ return handler.load();
98
+ },
99
+ unload() {
100
+ return handler.unload();
101
+ }
102
+ };
103
+ };
104
+ var SignalExitFallback = class extends SignalExitBase {
105
+ onExit() {
106
+ return () => {};
107
+ }
108
+ load() {}
109
+ unload() {}
110
+ };
111
+ var SignalExit = class extends SignalExitBase {
112
+ /* c8 ignore start */
113
+ #hupSig = process$2.platform === "win32" ? "SIGINT" : "SIGHUP";
114
+ /* c8 ignore stop */
115
+ #emitter = new Emitter();
116
+ #process;
117
+ #originalProcessEmit;
118
+ #originalProcessReallyExit;
119
+ #sigListeners = {};
120
+ #loaded = false;
121
+ constructor(process$3) {
122
+ super();
123
+ this.#process = process$3;
124
+ this.#sigListeners = {};
125
+ for (const sig of signals) this.#sigListeners[sig] = () => {
126
+ const listeners = this.#process.listeners(sig);
127
+ let { count } = this.#emitter;
128
+ /* c8 ignore start */
129
+ const p = process$3;
130
+ if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") count += p.__signal_exit_emitter__.count;
131
+ /* c8 ignore stop */
132
+ if (listeners.length === count) {
133
+ this.unload();
134
+ const ret = this.#emitter.emit("exit", null, sig);
135
+ /* c8 ignore start */
136
+ const s$1 = sig === "SIGHUP" ? this.#hupSig : sig;
137
+ if (!ret) process$3.kill(process$3.pid, s$1);
138
+ }
139
+ };
140
+ this.#originalProcessReallyExit = process$3.reallyExit;
141
+ this.#originalProcessEmit = process$3.emit;
142
+ }
143
+ onExit(cb, opts) {
144
+ /* c8 ignore start */
145
+ if (!processOk(this.#process)) return () => {};
146
+ /* c8 ignore stop */
147
+ if (this.#loaded === false) this.load();
148
+ const ev = opts?.alwaysLast ? "afterExit" : "exit";
149
+ this.#emitter.on(ev, cb);
150
+ return () => {
151
+ this.#emitter.removeListener(ev, cb);
152
+ if (this.#emitter.listeners["exit"].length === 0 && this.#emitter.listeners["afterExit"].length === 0) this.unload();
153
+ };
154
+ }
155
+ load() {
156
+ if (this.#loaded) return;
157
+ this.#loaded = true;
158
+ this.#emitter.count += 1;
159
+ for (const sig of signals) try {
160
+ const fn = this.#sigListeners[sig];
161
+ if (fn) this.#process.on(sig, fn);
162
+ } catch (_$1) {}
163
+ this.#process.emit = (ev, ...a$1) => {
164
+ return this.#processEmit(ev, ...a$1);
165
+ };
166
+ this.#process.reallyExit = (code) => {
167
+ return this.#processReallyExit(code);
168
+ };
169
+ }
170
+ unload() {
171
+ if (!this.#loaded) return;
172
+ this.#loaded = false;
173
+ signals.forEach((sig) => {
174
+ const listener = this.#sigListeners[sig];
175
+ /* c8 ignore start */
176
+ if (!listener) throw new Error("Listener not defined for signal: " + sig);
177
+ /* c8 ignore stop */
178
+ try {
179
+ this.#process.removeListener(sig, listener);
180
+ } catch (_$1) {}
181
+ /* c8 ignore stop */
182
+ });
183
+ this.#process.emit = this.#originalProcessEmit;
184
+ this.#process.reallyExit = this.#originalProcessReallyExit;
185
+ this.#emitter.count -= 1;
186
+ }
187
+ #processReallyExit(code) {
188
+ /* c8 ignore start */
189
+ if (!processOk(this.#process)) return 0;
190
+ this.#process.exitCode = code || 0;
191
+ /* c8 ignore stop */
192
+ this.#emitter.emit("exit", this.#process.exitCode, null);
193
+ return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);
194
+ }
195
+ #processEmit(ev, ...args) {
196
+ const og = this.#originalProcessEmit;
197
+ if (ev === "exit" && processOk(this.#process)) {
198
+ if (typeof args[0] === "number") this.#process.exitCode = args[0];
199
+ /* c8 ignore start */
200
+ const ret = og.call(this.#process, ev, ...args);
201
+ /* c8 ignore start */
202
+ this.#emitter.emit("exit", this.#process.exitCode, null);
203
+ /* c8 ignore stop */
204
+ return ret;
205
+ } else return og.call(this.#process, ev, ...args);
206
+ }
207
+ };
208
+ const process$2 = globalThis.process;
209
+ const { onExit, load, unload } = signalExitWrap(processOk(process$2) ? new SignalExit(process$2) : new SignalExitFallback());
210
+
211
+ //#endregion
11
212
  //#region ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/core.mjs
12
213
  const LogLevels = {
13
214
  silent: Number.NEGATIVE_INFINITY,
@@ -1220,207 +1421,6 @@ function parseCliArguments() {
1220
1421
  return normalizeCliOptions(values, positionals);
1221
1422
  }
1222
1423
 
1223
- //#endregion
1224
- //#region ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js
1225
- /**
1226
- * This is not the set of all possible signals.
1227
- *
1228
- * It IS, however, the set of all signals that trigger
1229
- * an exit on either Linux or BSD systems. Linux is a
1230
- * superset of the signal names supported on BSD, and
1231
- * the unknown signals just fail to register, so we can
1232
- * catch that easily enough.
1233
- *
1234
- * Windows signals are a different set, since there are
1235
- * signals that terminate Windows processes, but don't
1236
- * terminate (or don't even exist) on Posix systems.
1237
- *
1238
- * Don't bother with SIGKILL. It's uncatchable, which
1239
- * means that we can't fire any callbacks anyway.
1240
- *
1241
- * If a user does happen to register a handler on a non-
1242
- * fatal signal like SIGWINCH or something, and then
1243
- * exit, it'll end up firing `process.emit('exit')`, so
1244
- * the handler will be fired anyway.
1245
- *
1246
- * SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
1247
- * artificially, inherently leave the process in a
1248
- * state from which it is not safe to try and enter JS
1249
- * listeners.
1250
- */
1251
- const signals = [];
1252
- signals.push("SIGHUP", "SIGINT", "SIGTERM");
1253
- if (process.platform !== "win32") signals.push("SIGALRM", "SIGABRT", "SIGVTALRM", "SIGXCPU", "SIGXFSZ", "SIGUSR2", "SIGTRAP", "SIGSYS", "SIGQUIT", "SIGIOT");
1254
- if (process.platform === "linux") signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
1255
-
1256
- //#endregion
1257
- //#region ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js
1258
- const processOk = (process$3) => !!process$3 && typeof process$3 === "object" && typeof process$3.removeListener === "function" && typeof process$3.emit === "function" && typeof process$3.reallyExit === "function" && typeof process$3.listeners === "function" && typeof process$3.kill === "function" && typeof process$3.pid === "number" && typeof process$3.on === "function";
1259
- const kExitEmitter = Symbol.for("signal-exit emitter");
1260
- const global = globalThis;
1261
- const ObjectDefineProperty = Object.defineProperty.bind(Object);
1262
- var Emitter = class {
1263
- emitted = {
1264
- afterExit: false,
1265
- exit: false
1266
- };
1267
- listeners = {
1268
- afterExit: [],
1269
- exit: []
1270
- };
1271
- count = 0;
1272
- id = Math.random();
1273
- constructor() {
1274
- if (global[kExitEmitter]) return global[kExitEmitter];
1275
- ObjectDefineProperty(global, kExitEmitter, {
1276
- value: this,
1277
- writable: false,
1278
- enumerable: false,
1279
- configurable: false
1280
- });
1281
- }
1282
- on(ev, fn) {
1283
- this.listeners[ev].push(fn);
1284
- }
1285
- removeListener(ev, fn) {
1286
- const list = this.listeners[ev];
1287
- const i$1 = list.indexOf(fn);
1288
- /* c8 ignore start */
1289
- if (i$1 === -1) return;
1290
- /* c8 ignore stop */
1291
- if (i$1 === 0 && list.length === 1) list.length = 0;
1292
- else list.splice(i$1, 1);
1293
- }
1294
- emit(ev, code, signal) {
1295
- if (this.emitted[ev]) return false;
1296
- this.emitted[ev] = true;
1297
- let ret = false;
1298
- for (const fn of this.listeners[ev]) ret = fn(code, signal) === true || ret;
1299
- if (ev === "exit") ret = this.emit("afterExit", code, signal) || ret;
1300
- return ret;
1301
- }
1302
- };
1303
- var SignalExitBase = class {};
1304
- const signalExitWrap = (handler) => {
1305
- return {
1306
- onExit(cb, opts) {
1307
- return handler.onExit(cb, opts);
1308
- },
1309
- load() {
1310
- return handler.load();
1311
- },
1312
- unload() {
1313
- return handler.unload();
1314
- }
1315
- };
1316
- };
1317
- var SignalExitFallback = class extends SignalExitBase {
1318
- onExit() {
1319
- return () => {};
1320
- }
1321
- load() {}
1322
- unload() {}
1323
- };
1324
- var SignalExit = class extends SignalExitBase {
1325
- /* c8 ignore start */
1326
- #hupSig = process$2.platform === "win32" ? "SIGINT" : "SIGHUP";
1327
- /* c8 ignore stop */
1328
- #emitter = new Emitter();
1329
- #process;
1330
- #originalProcessEmit;
1331
- #originalProcessReallyExit;
1332
- #sigListeners = {};
1333
- #loaded = false;
1334
- constructor(process$3) {
1335
- super();
1336
- this.#process = process$3;
1337
- this.#sigListeners = {};
1338
- for (const sig of signals) this.#sigListeners[sig] = () => {
1339
- const listeners = this.#process.listeners(sig);
1340
- let { count } = this.#emitter;
1341
- /* c8 ignore start */
1342
- const p = process$3;
1343
- if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") count += p.__signal_exit_emitter__.count;
1344
- /* c8 ignore stop */
1345
- if (listeners.length === count) {
1346
- this.unload();
1347
- const ret = this.#emitter.emit("exit", null, sig);
1348
- /* c8 ignore start */
1349
- const s$1 = sig === "SIGHUP" ? this.#hupSig : sig;
1350
- if (!ret) process$3.kill(process$3.pid, s$1);
1351
- }
1352
- };
1353
- this.#originalProcessReallyExit = process$3.reallyExit;
1354
- this.#originalProcessEmit = process$3.emit;
1355
- }
1356
- onExit(cb, opts) {
1357
- /* c8 ignore start */
1358
- if (!processOk(this.#process)) return () => {};
1359
- /* c8 ignore stop */
1360
- if (this.#loaded === false) this.load();
1361
- const ev = opts?.alwaysLast ? "afterExit" : "exit";
1362
- this.#emitter.on(ev, cb);
1363
- return () => {
1364
- this.#emitter.removeListener(ev, cb);
1365
- if (this.#emitter.listeners["exit"].length === 0 && this.#emitter.listeners["afterExit"].length === 0) this.unload();
1366
- };
1367
- }
1368
- load() {
1369
- if (this.#loaded) return;
1370
- this.#loaded = true;
1371
- this.#emitter.count += 1;
1372
- for (const sig of signals) try {
1373
- const fn = this.#sigListeners[sig];
1374
- if (fn) this.#process.on(sig, fn);
1375
- } catch (_$1) {}
1376
- this.#process.emit = (ev, ...a$1) => {
1377
- return this.#processEmit(ev, ...a$1);
1378
- };
1379
- this.#process.reallyExit = (code) => {
1380
- return this.#processReallyExit(code);
1381
- };
1382
- }
1383
- unload() {
1384
- if (!this.#loaded) return;
1385
- this.#loaded = false;
1386
- signals.forEach((sig) => {
1387
- const listener = this.#sigListeners[sig];
1388
- /* c8 ignore start */
1389
- if (!listener) throw new Error("Listener not defined for signal: " + sig);
1390
- /* c8 ignore stop */
1391
- try {
1392
- this.#process.removeListener(sig, listener);
1393
- } catch (_$1) {}
1394
- /* c8 ignore stop */
1395
- });
1396
- this.#process.emit = this.#originalProcessEmit;
1397
- this.#process.reallyExit = this.#originalProcessReallyExit;
1398
- this.#emitter.count -= 1;
1399
- }
1400
- #processReallyExit(code) {
1401
- /* c8 ignore start */
1402
- if (!processOk(this.#process)) return 0;
1403
- this.#process.exitCode = code || 0;
1404
- /* c8 ignore stop */
1405
- this.#emitter.emit("exit", this.#process.exitCode, null);
1406
- return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);
1407
- }
1408
- #processEmit(ev, ...args) {
1409
- const og = this.#originalProcessEmit;
1410
- if (ev === "exit" && processOk(this.#process)) {
1411
- if (typeof args[0] === "number") this.#process.exitCode = args[0];
1412
- /* c8 ignore start */
1413
- const ret = og.call(this.#process, ev, ...args);
1414
- /* c8 ignore start */
1415
- this.#emitter.emit("exit", this.#process.exitCode, null);
1416
- /* c8 ignore stop */
1417
- return ret;
1418
- } else return og.call(this.#process, ev, ...args);
1419
- }
1420
- };
1421
- const process$2 = globalThis.process;
1422
- const { onExit, load, unload } = signalExitWrap(processOk(process$2) ? new SignalExit(process$2) : new SignalExitFallback());
1423
-
1424
1424
  //#endregion
1425
1425
  //#region src/utils/clear-screen.ts
1426
1426
  const CLEAR_SCREEN = "\x1Bc";
package/dist/config.cjs CHANGED
@@ -1,7 +1,7 @@
1
- const require_src = require('./shared/src-McCMqGpa.cjs');
2
- require('./shared/parse-ast-index-ChWj_C49.cjs');
1
+ const require_src = require('./shared/src-Bd4BGX4v.cjs');
2
+ require('./shared/parse-ast-index-J0xVKZRe.cjs');
3
3
  require('./shared/dist-CK0hotcm.cjs');
4
- const require_load_config = require('./shared/load-config-DfHD1OI9.cjs');
4
+ const require_load_config = require('./shared/load-config-BJKhRKZL.cjs');
5
5
 
6
6
  //#region src/config.ts
7
7
  const VERSION = require_src.version;
package/dist/config.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import "./shared/binding-D13M6Llu.cjs";
2
- import { ConfigExport, defineConfig } from "./shared/define-config-D5AluabE.cjs";
2
+ import { ConfigExport, defineConfig } from "./shared/define-config-DhrkZ_o7.cjs";
3
3
 
4
4
  //#region src/utils/load-config.d.ts
5
5
  declare function loadConfig(configPath: string): Promise<ConfigExport>;
package/dist/config.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import "./shared/binding-9k0egz6L.mjs";
2
- import { ConfigExport, defineConfig } from "./shared/define-config-DzIQxNqU.mjs";
2
+ import { ConfigExport, defineConfig } from "./shared/define-config-DJXaSinS.mjs";
3
3
 
4
4
  //#region src/utils/load-config.d.ts
5
5
  declare function loadConfig(configPath: string): Promise<ConfigExport>;
package/dist/config.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { defineConfig, version } from "./shared/src-B4V64IkU.mjs";
1
+ import { defineConfig, version } from "./shared/src-B0RCtUy7.mjs";
2
2
  import "./shared/parse-ast-index-C_CZT4St.mjs";
3
3
  import "./shared/dist-ByKQkexh.mjs";
4
- import { loadConfig } from "./shared/load-config--VYNOtUY.mjs";
4
+ import { loadConfig } from "./shared/load-config-BCjD-AGJ.mjs";
5
5
 
6
6
  //#region src/config.ts
7
7
  const VERSION = version;
@@ -1,14 +1,19 @@
1
- import { BuiltinPlugin, PluginDriver, assetPlugin, buildImportAnalysisPlugin, createBundlerImpl, createBundlerOptions, dynamicImportVarsPlugin, esmExternalRequirePlugin, handleOutputErrors, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, reporterPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, webWorkerPostPlugin } from "./src-Bl12Y5ab.js";
1
+ import { PluginDriver, assetPlugin, buildImportAnalysisPlugin, createBuiltinPlugin, createBundlerImpl, createBundlerOptions, dynamicImportVarsPlugin, esmExternalRequirePlugin, handleOutputErrors, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, reporterPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, webWorkerPostPlugin } from "./src-C8U06Im1.js";
2
2
  import { BindingBundler, BindingDevEngine, ResolverFactory, isolatedDeclaration, moduleRunnerTransform, transform } from "./rolldown-binding.wasi-browser.js";
3
3
 
4
4
  //#region src/api/dev/dev-engine.ts
5
5
  var DevEngine = class DevEngine {
6
6
  #inner;
7
7
  #cachedBuildFinishPromise = null;
8
- static async create(inputOptions, outputOptions) {
8
+ static async create(inputOptions, outputOptions = {}, devOptions = {}) {
9
9
  inputOptions = await PluginDriver.callOptionsHook(inputOptions);
10
10
  const options = await createBundlerOptions(inputOptions, outputOptions, false);
11
- const inner = new BindingDevEngine(options.bundlerOptions);
11
+ const bindingDevOptions = {
12
+ onHmrUpdates: devOptions.onHmrUpdates,
13
+ usePolling: devOptions.usePolling,
14
+ pollInterval: devOptions.pollInterval
15
+ };
16
+ const inner = new BindingDevEngine(options.bundlerOptions, bindingDevOptions);
12
17
  return new DevEngine(inner);
13
18
  }
14
19
  constructor(inner) {
@@ -25,6 +30,12 @@ var DevEngine = class DevEngine {
25
30
  this.#cachedBuildFinishPromise = promise;
26
31
  return promise;
27
32
  }
33
+ async ensureLatestBuild() {
34
+ await this.#inner.ensureLatestBuild();
35
+ }
36
+ async invalidate(file, firstInvalidatedBy) {
37
+ return this.#inner.invalidate(file, firstInvalidatedBy);
38
+ }
28
39
  };
29
40
 
30
41
  //#endregion
@@ -55,7 +66,7 @@ function defineParallelPlugin(pluginPath) {
55
66
  //#endregion
56
67
  //#region src/builtin-plugin/alias-plugin.ts
57
68
  function aliasPlugin(config) {
58
- return new BuiltinPlugin("builtin:alias", config);
69
+ return createBuiltinPlugin("builtin:alias", config);
59
70
  }
60
71
 
61
72
  //#endregion
@@ -83,7 +94,10 @@ function aliasPlugin(config) {
83
94
  * ```
84
95
  */
85
96
  function replacePlugin(values = {}, options = {}) {
86
- return new BuiltinPlugin("builtin:replace", {
97
+ Object.keys(values).forEach((key) => {
98
+ values[key] = values[key].toString();
99
+ });
100
+ return createBuiltinPlugin("builtin:replace", {
87
101
  ...options,
88
102
  values
89
103
  });
@@ -99,7 +113,7 @@ function transformPlugin(config) {
99
113
  jsxRefreshInclude: normalizedStringOrRegex(config.jsxRefreshInclude),
100
114
  jsxRefreshExclude: normalizedStringOrRegex(config.jsxRefreshExclude)
101
115
  };
102
- return new BuiltinPlugin("builtin:transform", config);
116
+ return createBuiltinPlugin("builtin:transform", config);
103
117
  }
104
118
 
105
119
  //#endregion
@@ -1,18 +1,25 @@
1
1
  const require_chunk = require('./shared/chunk-DDkG_k5U.cjs');
2
- const require_src = require('./shared/src-McCMqGpa.cjs');
3
- require('./shared/parse-ast-index-ChWj_C49.cjs');
2
+ const require_src = require('./shared/src-Bd4BGX4v.cjs');
3
+ require('./shared/parse-ast-index-J0xVKZRe.cjs');
4
4
  require('./shared/dist-CK0hotcm.cjs');
5
- const src_rolldown_binding_wasi_cjs = require_chunk.__toESM(require("./rolldown-binding.wasi.cjs"));
6
- const node_url = require_chunk.__toESM(require("node:url"));
5
+ let src_rolldown_binding_wasi_cjs = require("./rolldown-binding.wasi.cjs");
6
+ src_rolldown_binding_wasi_cjs = require_chunk.__toESM(src_rolldown_binding_wasi_cjs);
7
+ let node_url = require("node:url");
8
+ node_url = require_chunk.__toESM(node_url);
7
9
 
8
10
  //#region src/api/dev/dev-engine.ts
9
11
  var DevEngine = class DevEngine {
10
12
  #inner;
11
13
  #cachedBuildFinishPromise = null;
12
- static async create(inputOptions, outputOptions) {
14
+ static async create(inputOptions, outputOptions = {}, devOptions = {}) {
13
15
  inputOptions = await require_src.PluginDriver.callOptionsHook(inputOptions);
14
16
  const options = await require_src.createBundlerOptions(inputOptions, outputOptions, false);
15
- const inner = new src_rolldown_binding_wasi_cjs.BindingDevEngine(options.bundlerOptions);
17
+ const bindingDevOptions = {
18
+ onHmrUpdates: devOptions.onHmrUpdates,
19
+ usePolling: devOptions.usePolling,
20
+ pollInterval: devOptions.pollInterval
21
+ };
22
+ const inner = new src_rolldown_binding_wasi_cjs.BindingDevEngine(options.bundlerOptions, bindingDevOptions);
16
23
  return new DevEngine(inner);
17
24
  }
18
25
  constructor(inner) {
@@ -29,6 +36,12 @@ var DevEngine = class DevEngine {
29
36
  this.#cachedBuildFinishPromise = promise;
30
37
  return promise;
31
38
  }
39
+ async ensureLatestBuild() {
40
+ await this.#inner.ensureLatestBuild();
41
+ }
42
+ async invalidate(file, firstInvalidatedBy) {
43
+ return this.#inner.invalidate(file, firstInvalidatedBy);
44
+ }
32
45
  };
33
46
 
34
47
  //#endregion
@@ -64,7 +77,7 @@ function defineParallelPlugin(pluginPath) {
64
77
  //#endregion
65
78
  //#region src/builtin-plugin/alias-plugin.ts
66
79
  function aliasPlugin(config) {
67
- return new require_src.BuiltinPlugin("builtin:alias", config);
80
+ return require_src.createBuiltinPlugin("builtin:alias", config);
68
81
  }
69
82
 
70
83
  //#endregion
@@ -92,7 +105,10 @@ function aliasPlugin(config) {
92
105
  * ```
93
106
  */
94
107
  function replacePlugin(values = {}, options = {}) {
95
- return new require_src.BuiltinPlugin("builtin:replace", {
108
+ Object.keys(values).forEach((key) => {
109
+ values[key] = values[key].toString();
110
+ });
111
+ return require_src.createBuiltinPlugin("builtin:replace", {
96
112
  ...options,
97
113
  values
98
114
  });
@@ -108,7 +124,7 @@ function transformPlugin(config) {
108
124
  jsxRefreshInclude: require_src.normalizedStringOrRegex(config.jsxRefreshInclude),
109
125
  jsxRefreshExclude: require_src.normalizedStringOrRegex(config.jsxRefreshExclude)
110
126
  };
111
- return new require_src.BuiltinPlugin("builtin:transform", config);
127
+ return require_src.createBuiltinPlugin("builtin:transform", config);
112
128
  }
113
129
 
114
130
  //#endregion
@@ -1,13 +1,22 @@
1
- import { BindingAssetPluginConfig, BindingBuildImportAnalysisPluginConfig, BindingDynamicImportVarsPluginConfig, BindingEsmExternalRequirePluginConfig, BindingImportGlobPluginConfig, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingManifestPluginConfig, BindingModulePreloadPolyfillPluginConfig, BindingReplacePluginConfig, BindingReporterPluginConfig, BindingTransformPluginConfig, BindingViteResolvePluginConfig, BindingWasmHelperPluginConfig, IsolatedDeclarationsOptions, IsolatedDeclarationsResult, NapiResolveOptions, ResolveResult, ResolverFactory, TransformOptions, TransformResult, isolatedDeclaration, moduleRunnerTransform, transform } from "./shared/binding-D13M6Llu.cjs";
2
- import { BuiltinPlugin, InputOptions, OutputOptions, StringOrRegExp, defineParallelPlugin } from "./shared/define-config-D5AluabE.cjs";
1
+ import { BindingAssetPluginConfig, BindingBuildImportAnalysisPluginConfig, BindingDynamicImportVarsPluginConfig, BindingEsmExternalRequirePluginConfig, BindingHmrUpdate, BindingImportGlobPluginConfig, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingManifestPluginConfig, BindingModulePreloadPolyfillPluginConfig, BindingReplacePluginConfig, BindingReporterPluginConfig, BindingTransformPluginConfig, BindingViteResolvePluginConfig, BindingWasmHelperPluginConfig, IsolatedDeclarationsOptions, IsolatedDeclarationsResult, NapiResolveOptions, ResolveResult, ResolverFactory, TransformOptions, TransformResult, isolatedDeclaration, moduleRunnerTransform, transform } from "./shared/binding-D13M6Llu.cjs";
2
+ import { BuiltinPlugin, InputOptions, OutputOptions, StringOrRegExp, defineParallelPlugin } from "./shared/define-config-DhrkZ_o7.cjs";
3
3
 
4
+ //#region src/api/dev/dev-options.d.ts
5
+ interface DevOptions {
6
+ onHmrUpdates?: (updates: BindingHmrUpdate[]) => void | Promise<void>;
7
+ usePolling?: boolean;
8
+ pollInterval?: number;
9
+ }
10
+ //#endregion
4
11
  //#region src/api/dev/dev-engine.d.ts
5
12
  declare class DevEngine {
6
13
  #private;
7
- static create(inputOptions: InputOptions, outputOptions: OutputOptions): Promise<DevEngine>;
14
+ static create(inputOptions: InputOptions, outputOptions?: OutputOptions, devOptions?: DevOptions): Promise<DevEngine>;
8
15
  private constructor();
9
16
  run(): Promise<void>;
10
17
  ensureCurrentBuildFinish(): Promise<void>;
18
+ ensureLatestBuild(): Promise<void>;
19
+ invalidate(file: string, firstInvalidatedBy?: string): Promise<BindingHmrUpdate>;
11
20
  }
12
21
  //#endregion
13
22
  //#region src/api/dev/index.d.ts
@@ -87,4 +96,4 @@ type TransformPluginConfig = Omit<BindingTransformPluginConfig, "include" | "exc
87
96
  };
88
97
  declare function transformPlugin(config?: TransformPluginConfig): BuiltinPlugin;
89
98
  //#endregion
90
- export { DevEngine, type IsolatedDeclarationsOptions, type IsolatedDeclarationsResult, type NapiResolveOptions as ResolveOptions, type ResolveResult, ResolverFactory, type TransformOptions, type TransformResult, aliasPlugin, assetPlugin, buildImportAnalysisPlugin, defineParallelPlugin, dev, dynamicImportVarsPlugin, esmExternalRequirePlugin, importGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, moduleRunnerTransform, replacePlugin, reporterPlugin, experimental_scan as scan, transform, transformPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, webWorkerPostPlugin };
99
+ export { DevEngine, type DevOptions, type IsolatedDeclarationsOptions, type IsolatedDeclarationsResult, type NapiResolveOptions as ResolveOptions, type ResolveResult, ResolverFactory, type TransformOptions, type TransformResult, aliasPlugin, assetPlugin, buildImportAnalysisPlugin, defineParallelPlugin, dev, dynamicImportVarsPlugin, esmExternalRequirePlugin, importGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, moduleRunnerTransform, replacePlugin, reporterPlugin, experimental_scan as scan, transform, transformPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, webWorkerPostPlugin };
@@ -1,13 +1,22 @@
1
- import { BindingAssetPluginConfig, BindingBuildImportAnalysisPluginConfig, BindingDynamicImportVarsPluginConfig, BindingEsmExternalRequirePluginConfig, BindingImportGlobPluginConfig, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingManifestPluginConfig, BindingModulePreloadPolyfillPluginConfig, BindingReplacePluginConfig, BindingReporterPluginConfig, BindingTransformPluginConfig, BindingViteResolvePluginConfig, BindingWasmHelperPluginConfig, IsolatedDeclarationsOptions, IsolatedDeclarationsResult, NapiResolveOptions, ResolveResult, ResolverFactory, TransformOptions, TransformResult, isolatedDeclaration, moduleRunnerTransform, transform } from "./shared/binding-9k0egz6L.mjs";
2
- import { BuiltinPlugin, InputOptions, OutputOptions, StringOrRegExp, defineParallelPlugin } from "./shared/define-config-DzIQxNqU.mjs";
1
+ import { BindingAssetPluginConfig, BindingBuildImportAnalysisPluginConfig, BindingDynamicImportVarsPluginConfig, BindingEsmExternalRequirePluginConfig, BindingHmrUpdate, BindingImportGlobPluginConfig, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingManifestPluginConfig, BindingModulePreloadPolyfillPluginConfig, BindingReplacePluginConfig, BindingReporterPluginConfig, BindingTransformPluginConfig, BindingViteResolvePluginConfig, BindingWasmHelperPluginConfig, IsolatedDeclarationsOptions, IsolatedDeclarationsResult, NapiResolveOptions, ResolveResult, ResolverFactory, TransformOptions, TransformResult, isolatedDeclaration, moduleRunnerTransform, transform } from "./shared/binding-9k0egz6L.mjs";
2
+ import { BuiltinPlugin, InputOptions, OutputOptions, StringOrRegExp, defineParallelPlugin } from "./shared/define-config-DJXaSinS.mjs";
3
3
 
4
+ //#region src/api/dev/dev-options.d.ts
5
+ interface DevOptions {
6
+ onHmrUpdates?: (updates: BindingHmrUpdate[]) => void | Promise<void>;
7
+ usePolling?: boolean;
8
+ pollInterval?: number;
9
+ }
10
+ //#endregion
4
11
  //#region src/api/dev/dev-engine.d.ts
5
12
  declare class DevEngine {
6
13
  #private;
7
- static create(inputOptions: InputOptions, outputOptions: OutputOptions): Promise<DevEngine>;
14
+ static create(inputOptions: InputOptions, outputOptions?: OutputOptions, devOptions?: DevOptions): Promise<DevEngine>;
8
15
  private constructor();
9
16
  run(): Promise<void>;
10
17
  ensureCurrentBuildFinish(): Promise<void>;
18
+ ensureLatestBuild(): Promise<void>;
19
+ invalidate(file: string, firstInvalidatedBy?: string): Promise<BindingHmrUpdate>;
11
20
  }
12
21
  //#endregion
13
22
  //#region src/api/dev/index.d.ts
@@ -87,4 +96,4 @@ type TransformPluginConfig = Omit<BindingTransformPluginConfig, "include" | "exc
87
96
  };
88
97
  declare function transformPlugin(config?: TransformPluginConfig): BuiltinPlugin;
89
98
  //#endregion
90
- export { DevEngine, type IsolatedDeclarationsOptions, type IsolatedDeclarationsResult, type NapiResolveOptions as ResolveOptions, type ResolveResult, ResolverFactory, type TransformOptions, type TransformResult, aliasPlugin, assetPlugin, buildImportAnalysisPlugin, defineParallelPlugin, dev, dynamicImportVarsPlugin, esmExternalRequirePlugin, importGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, moduleRunnerTransform, replacePlugin, reporterPlugin, experimental_scan as scan, transform, transformPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, webWorkerPostPlugin };
99
+ export { DevEngine, type DevOptions, type IsolatedDeclarationsOptions, type IsolatedDeclarationsResult, type NapiResolveOptions as ResolveOptions, type ResolveResult, ResolverFactory, type TransformOptions, type TransformResult, aliasPlugin, assetPlugin, buildImportAnalysisPlugin, defineParallelPlugin, dev, dynamicImportVarsPlugin, esmExternalRequirePlugin, importGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, moduleRunnerTransform, replacePlugin, reporterPlugin, experimental_scan as scan, transform, transformPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, webWorkerPostPlugin };