rolldown 1.0.0-beta.6-commit.0fdc9f2 → 1.0.0-beta.60

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 (150) hide show
  1. package/README.md +11 -0
  2. package/bin/cli.mjs +3 -0
  3. package/dist/cli-setup.d.mts +1 -0
  4. package/dist/cli-setup.mjs +17 -0
  5. package/dist/cli.d.mts +1 -0
  6. package/dist/{esm/cli.mjs → cli.mjs} +405 -577
  7. package/dist/config.d.mts +10 -0
  8. package/dist/config.mjs +14 -0
  9. package/dist/experimental-index.d.mts +181 -0
  10. package/dist/experimental-index.mjs +266 -0
  11. package/dist/experimental-runtime-types.d.ts +92 -0
  12. package/dist/filter-index.d.mts +4 -0
  13. package/dist/filter-index.mjs +369 -0
  14. package/dist/get-log-filter.d.mts +7 -0
  15. package/dist/get-log-filter.mjs +48 -0
  16. package/dist/index.d.mts +4 -0
  17. package/dist/index.mjs +38 -0
  18. package/dist/parallel-plugin-worker.d.mts +1 -0
  19. package/dist/parallel-plugin-worker.mjs +32 -0
  20. package/dist/parallel-plugin.d.mts +14 -0
  21. package/dist/{esm/parallel-plugin.mjs → parallel-plugin.mjs} +0 -1
  22. package/dist/parse-ast-index.d.mts +8 -0
  23. package/dist/parse-ast-index.mjs +4 -0
  24. package/dist/plugins-index.d.mts +31 -0
  25. package/dist/plugins-index.mjs +40 -0
  26. package/dist/shared/binding-C9YdqoUG.d.mts +1657 -0
  27. package/dist/shared/binding-Duj6W4V2.mjs +583 -0
  28. package/dist/shared/bindingify-input-options-tKpsInTJ.mjs +2174 -0
  29. package/dist/shared/constructors-D3qJVJZC.d.mts +28 -0
  30. package/dist/shared/constructors-DPqxrdwc.mjs +61 -0
  31. package/dist/shared/define-config-BF4P-Pum.mjs +7 -0
  32. package/dist/shared/define-config-BgCyRzGF.d.mts +2567 -0
  33. package/dist/shared/load-config-scjTHwJI.mjs +114 -0
  34. package/dist/shared/logging-DsnCZi19.d.mts +42 -0
  35. package/dist/shared/logs-cyjC0SDv.mjs +183 -0
  36. package/dist/shared/misc-0HsaOsAX.mjs +22 -0
  37. package/dist/shared/normalize-string-or-regex-DJvwOt-n.mjs +61 -0
  38. package/dist/shared/parse-ast-index-BNL_NOzM.mjs +99 -0
  39. package/dist/shared/{prompt-C6jWWCza.mjs → prompt-5sWCM0jm.mjs} +255 -260
  40. package/dist/shared/rolldown-8Hs4IFju.mjs +11 -0
  41. package/dist/shared/rolldown-build-if4L5V_l.mjs +2293 -0
  42. package/dist/shared/watch-jle4g7Gt.mjs +351 -0
  43. package/package.json +89 -106
  44. package/bin/cli.js +0 -2
  45. package/dist/cjs/cli.cjs +0 -1757
  46. package/dist/cjs/experimental-index.cjs +0 -86
  47. package/dist/cjs/index.cjs +0 -8
  48. package/dist/cjs/parallel-plugin-worker.cjs +0 -41
  49. package/dist/cjs/parallel-plugin.cjs +0 -9
  50. package/dist/cjs/parse-ast-index.cjs +0 -4
  51. package/dist/esm/experimental-index.mjs +0 -57
  52. package/dist/esm/index.mjs +0 -4
  53. package/dist/esm/parallel-plugin-worker.mjs +0 -39
  54. package/dist/esm/parse-ast-index.mjs +0 -3
  55. package/dist/shared/chunk-qZFfknuJ.cjs +0 -40
  56. package/dist/shared/parse-ast-index-BN2JFoRu.mjs +0 -696
  57. package/dist/shared/parse-ast-index-C8v5UEr2.cjs +0 -741
  58. package/dist/shared/prompt-_yrURmmm.cjs +0 -855
  59. package/dist/shared/src-Cl1wUC1i.cjs +0 -3073
  60. package/dist/shared/src-Dt33DQSB.mjs +0 -2886
  61. package/dist/types/api/build.d.ts +0 -18
  62. package/dist/types/api/experimental.d.ts +0 -7
  63. package/dist/types/api/rolldown/index.d.ts +0 -3
  64. package/dist/types/api/rolldown/rolldown-build.d.ts +0 -13
  65. package/dist/types/api/watch/index.d.ts +0 -3
  66. package/dist/types/api/watch/watch-emitter.d.ts +0 -31
  67. package/dist/types/api/watch/watcher.d.ts +0 -13
  68. package/dist/types/binding.d.ts +0 -1478
  69. package/dist/types/builtin-plugin/alias-plugin.d.ts +0 -10
  70. package/dist/types/builtin-plugin/constructors.d.ts +0 -22
  71. package/dist/types/builtin-plugin/replace-plugin.d.ts +0 -28
  72. package/dist/types/builtin-plugin/transform-plugin.d.ts +0 -9
  73. package/dist/types/builtin-plugin/utils.d.ts +0 -8
  74. package/dist/types/cli/arguments/alias.d.ts +0 -16
  75. package/dist/types/cli/arguments/index.d.ts +0 -15
  76. package/dist/types/cli/arguments/normalize.d.ts +0 -12
  77. package/dist/types/cli/arguments/utils.d.ts +0 -8
  78. package/dist/types/cli/colors.d.ts +0 -11
  79. package/dist/types/cli/commands/bundle.d.ts +0 -3
  80. package/dist/types/cli/commands/help.d.ts +0 -1
  81. package/dist/types/cli/index.d.ts +0 -1
  82. package/dist/types/cli/load-config.d.ts +0 -5
  83. package/dist/types/cli/logger.d.ts +0 -5
  84. package/dist/types/constants/plugin-context.d.ts +0 -7
  85. package/dist/types/constants/plugin.d.ts +0 -45
  86. package/dist/types/experimental-index.d.ts +0 -9
  87. package/dist/types/index.d.ts +0 -30
  88. package/dist/types/log/log-handler.d.ts +0 -4
  89. package/dist/types/log/logger.d.ts +0 -6
  90. package/dist/types/log/logging.d.ts +0 -12
  91. package/dist/types/log/logs.d.ts +0 -18
  92. package/dist/types/options/generated/checks-options.d.ts +0 -57
  93. package/dist/types/options/input-options.d.ts +0 -177
  94. package/dist/types/options/normalized-input-options.d.ts +0 -18
  95. package/dist/types/options/normalized-output-options.d.ts +0 -70
  96. package/dist/types/options/output-options.d.ts +0 -182
  97. package/dist/types/options/watch-options.d.ts +0 -5
  98. package/dist/types/parallel-plugin-worker.d.ts +0 -1
  99. package/dist/types/parallel-plugin.d.ts +0 -1
  100. package/dist/types/parse-ast-index.d.ts +0 -5
  101. package/dist/types/plugin/bindingify-build-hooks.d.ts +0 -10
  102. package/dist/types/plugin/bindingify-hook-filter.d.ts +0 -7
  103. package/dist/types/plugin/bindingify-output-hooks.d.ts +0 -14
  104. package/dist/types/plugin/bindingify-plugin-hook-meta.d.ts +0 -8
  105. package/dist/types/plugin/bindingify-plugin.d.ts +0 -16
  106. package/dist/types/plugin/bindingify-watch-hooks.d.ts +0 -5
  107. package/dist/types/plugin/hook-filter.d.ts +0 -48
  108. package/dist/types/plugin/index.d.ts +0 -136
  109. package/dist/types/plugin/minimal-plugin-context.d.ts +0 -23
  110. package/dist/types/plugin/parallel-plugin-implementation.d.ts +0 -10
  111. package/dist/types/plugin/parallel-plugin.d.ts +0 -9
  112. package/dist/types/plugin/plugin-context-data.d.ts +0 -17
  113. package/dist/types/plugin/plugin-context.d.ts +0 -67
  114. package/dist/types/plugin/plugin-driver.d.ts +0 -8
  115. package/dist/types/plugin/transform-plugin-context.d.ts +0 -28
  116. package/dist/types/types/assert.d.ts +0 -14
  117. package/dist/types/types/config-export.d.ts +0 -5
  118. package/dist/types/types/misc.d.ts +0 -40
  119. package/dist/types/types/module-info.d.ts +0 -15
  120. package/dist/types/types/module-side-effects.d.ts +0 -12
  121. package/dist/types/types/output-bundle.d.ts +0 -4
  122. package/dist/types/types/rolldown-options.d.ts +0 -5
  123. package/dist/types/types/rolldown-output.d.ts +0 -66
  124. package/dist/types/types/schema.d.ts +0 -33
  125. package/dist/types/types/sourcemap.d.ts +0 -14
  126. package/dist/types/types/utils.d.ts +0 -13
  127. package/dist/types/utils/asset-source.d.ts +0 -4
  128. package/dist/types/utils/async-flatten.d.ts +0 -1
  129. package/dist/types/utils/bindingify-input-options.d.ts +0 -7
  130. package/dist/types/utils/bindingify-output-options.d.ts +0 -5
  131. package/dist/types/utils/code-frame.d.ts +0 -1
  132. package/dist/types/utils/compose-js-plugins.d.ts +0 -2
  133. package/dist/types/utils/create-bundler-option.d.ts +0 -11
  134. package/dist/types/utils/create-bundler.d.ts +0 -9
  135. package/dist/types/utils/define-config.d.ts +0 -5
  136. package/dist/types/utils/error.d.ts +0 -2
  137. package/dist/types/utils/initialize-parallel-plugins.d.ts +0 -19
  138. package/dist/types/utils/misc.d.ts +0 -6
  139. package/dist/types/utils/normalize-hook.d.ts +0 -7
  140. package/dist/types/utils/normalize-plugin-option.d.ts +0 -13
  141. package/dist/types/utils/normalize-string-or-regex.d.ts +0 -2
  142. package/dist/types/utils/plugin/index.d.ts +0 -2
  143. package/dist/types/utils/resolved-external.d.ts +0 -4
  144. package/dist/types/utils/transform-module-info.d.ts +0 -4
  145. package/dist/types/utils/transform-rendered-chunk.d.ts +0 -4
  146. package/dist/types/utils/transform-rendered-module.d.ts +0 -3
  147. package/dist/types/utils/transform-side-effects.d.ts +0 -3
  148. package/dist/types/utils/transform-sourcemap.d.ts +0 -3
  149. package/dist/types/utils/transform-to-rollup-output.d.ts +0 -11
  150. package/dist/types/utils/validator.d.ts +0 -6
@@ -0,0 +1,351 @@
1
+ import { n as __toESM, t as require_binding } from "./binding-Duj6W4V2.mjs";
2
+ import { o as logMultiplyNotifyOption } from "./logs-cyjC0SDv.mjs";
3
+ import { a as aggregateBindingErrorsIntoJsError, b as LOG_LEVEL_WARN } from "./bindingify-input-options-tKpsInTJ.mjs";
4
+ import { t as arraify } from "./misc-0HsaOsAX.mjs";
5
+ import { l as PluginDriver, n as createBundlerOptions } from "./rolldown-build-if4L5V_l.mjs";
6
+
7
+ //#region ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js
8
+ /**
9
+ * This is not the set of all possible signals.
10
+ *
11
+ * It IS, however, the set of all signals that trigger
12
+ * an exit on either Linux or BSD systems. Linux is a
13
+ * superset of the signal names supported on BSD, and
14
+ * the unknown signals just fail to register, so we can
15
+ * catch that easily enough.
16
+ *
17
+ * Windows signals are a different set, since there are
18
+ * signals that terminate Windows processes, but don't
19
+ * terminate (or don't even exist) on Posix systems.
20
+ *
21
+ * Don't bother with SIGKILL. It's uncatchable, which
22
+ * means that we can't fire any callbacks anyway.
23
+ *
24
+ * If a user does happen to register a handler on a non-
25
+ * fatal signal like SIGWINCH or something, and then
26
+ * exit, it'll end up firing `process.emit('exit')`, so
27
+ * the handler will be fired anyway.
28
+ *
29
+ * SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
30
+ * artificially, inherently leave the process in a
31
+ * state from which it is not safe to try and enter JS
32
+ * listeners.
33
+ */
34
+ const signals = [];
35
+ signals.push("SIGHUP", "SIGINT", "SIGTERM");
36
+ if (process.platform !== "win32") signals.push("SIGALRM", "SIGABRT", "SIGVTALRM", "SIGXCPU", "SIGXFSZ", "SIGUSR2", "SIGTRAP", "SIGSYS", "SIGQUIT", "SIGIOT");
37
+ if (process.platform === "linux") signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
38
+
39
+ //#endregion
40
+ //#region ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js
41
+ const processOk = (process) => !!process && typeof process === "object" && typeof process.removeListener === "function" && typeof process.emit === "function" && typeof process.reallyExit === "function" && typeof process.listeners === "function" && typeof process.kill === "function" && typeof process.pid === "number" && typeof process.on === "function";
42
+ const kExitEmitter = Symbol.for("signal-exit emitter");
43
+ const global = globalThis;
44
+ const ObjectDefineProperty = Object.defineProperty.bind(Object);
45
+ var Emitter = class {
46
+ emitted = {
47
+ afterExit: false,
48
+ exit: false
49
+ };
50
+ listeners = {
51
+ afterExit: [],
52
+ exit: []
53
+ };
54
+ count = 0;
55
+ id = Math.random();
56
+ constructor() {
57
+ if (global[kExitEmitter]) return global[kExitEmitter];
58
+ ObjectDefineProperty(global, kExitEmitter, {
59
+ value: this,
60
+ writable: false,
61
+ enumerable: false,
62
+ configurable: false
63
+ });
64
+ }
65
+ on(ev, fn) {
66
+ this.listeners[ev].push(fn);
67
+ }
68
+ removeListener(ev, fn) {
69
+ const list = this.listeners[ev];
70
+ const i = list.indexOf(fn);
71
+ /* c8 ignore start */
72
+ if (i === -1) return;
73
+ /* c8 ignore stop */
74
+ if (i === 0 && list.length === 1) list.length = 0;
75
+ else list.splice(i, 1);
76
+ }
77
+ emit(ev, code, signal) {
78
+ if (this.emitted[ev]) return false;
79
+ this.emitted[ev] = true;
80
+ let ret = false;
81
+ for (const fn of this.listeners[ev]) ret = fn(code, signal) === true || ret;
82
+ if (ev === "exit") ret = this.emit("afterExit", code, signal) || ret;
83
+ return ret;
84
+ }
85
+ };
86
+ var SignalExitBase = class {};
87
+ const signalExitWrap = (handler) => {
88
+ return {
89
+ onExit(cb, opts) {
90
+ return handler.onExit(cb, opts);
91
+ },
92
+ load() {
93
+ return handler.load();
94
+ },
95
+ unload() {
96
+ return handler.unload();
97
+ }
98
+ };
99
+ };
100
+ var SignalExitFallback = class extends SignalExitBase {
101
+ onExit() {
102
+ return () => {};
103
+ }
104
+ load() {}
105
+ unload() {}
106
+ };
107
+ var SignalExit = class extends SignalExitBase {
108
+ /* c8 ignore start */
109
+ #hupSig = process$1.platform === "win32" ? "SIGINT" : "SIGHUP";
110
+ /* c8 ignore stop */
111
+ #emitter = new Emitter();
112
+ #process;
113
+ #originalProcessEmit;
114
+ #originalProcessReallyExit;
115
+ #sigListeners = {};
116
+ #loaded = false;
117
+ constructor(process) {
118
+ super();
119
+ this.#process = process;
120
+ this.#sigListeners = {};
121
+ for (const sig of signals) this.#sigListeners[sig] = () => {
122
+ const listeners = this.#process.listeners(sig);
123
+ let { count } = this.#emitter;
124
+ /* c8 ignore start */
125
+ const p = process;
126
+ if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") count += p.__signal_exit_emitter__.count;
127
+ /* c8 ignore stop */
128
+ if (listeners.length === count) {
129
+ this.unload();
130
+ const ret = this.#emitter.emit("exit", null, sig);
131
+ /* c8 ignore start */
132
+ const s = sig === "SIGHUP" ? this.#hupSig : sig;
133
+ if (!ret) process.kill(process.pid, s);
134
+ }
135
+ };
136
+ this.#originalProcessReallyExit = process.reallyExit;
137
+ this.#originalProcessEmit = process.emit;
138
+ }
139
+ onExit(cb, opts) {
140
+ /* c8 ignore start */
141
+ if (!processOk(this.#process)) return () => {};
142
+ /* c8 ignore stop */
143
+ if (this.#loaded === false) this.load();
144
+ const ev = opts?.alwaysLast ? "afterExit" : "exit";
145
+ this.#emitter.on(ev, cb);
146
+ return () => {
147
+ this.#emitter.removeListener(ev, cb);
148
+ if (this.#emitter.listeners["exit"].length === 0 && this.#emitter.listeners["afterExit"].length === 0) this.unload();
149
+ };
150
+ }
151
+ load() {
152
+ if (this.#loaded) return;
153
+ this.#loaded = true;
154
+ this.#emitter.count += 1;
155
+ for (const sig of signals) try {
156
+ const fn = this.#sigListeners[sig];
157
+ if (fn) this.#process.on(sig, fn);
158
+ } catch (_) {}
159
+ this.#process.emit = (ev, ...a) => {
160
+ return this.#processEmit(ev, ...a);
161
+ };
162
+ this.#process.reallyExit = (code) => {
163
+ return this.#processReallyExit(code);
164
+ };
165
+ }
166
+ unload() {
167
+ if (!this.#loaded) return;
168
+ this.#loaded = false;
169
+ signals.forEach((sig) => {
170
+ const listener = this.#sigListeners[sig];
171
+ /* c8 ignore start */
172
+ if (!listener) throw new Error("Listener not defined for signal: " + sig);
173
+ /* c8 ignore stop */
174
+ try {
175
+ this.#process.removeListener(sig, listener);
176
+ } catch (_) {}
177
+ /* c8 ignore stop */
178
+ });
179
+ this.#process.emit = this.#originalProcessEmit;
180
+ this.#process.reallyExit = this.#originalProcessReallyExit;
181
+ this.#emitter.count -= 1;
182
+ }
183
+ #processReallyExit(code) {
184
+ /* c8 ignore start */
185
+ if (!processOk(this.#process)) return 0;
186
+ this.#process.exitCode = code || 0;
187
+ /* c8 ignore stop */
188
+ this.#emitter.emit("exit", this.#process.exitCode, null);
189
+ return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);
190
+ }
191
+ #processEmit(ev, ...args) {
192
+ const og = this.#originalProcessEmit;
193
+ if (ev === "exit" && processOk(this.#process)) {
194
+ if (typeof args[0] === "number") this.#process.exitCode = args[0];
195
+ /* c8 ignore start */
196
+ const ret = og.call(this.#process, ev, ...args);
197
+ /* c8 ignore start */
198
+ this.#emitter.emit("exit", this.#process.exitCode, null);
199
+ /* c8 ignore stop */
200
+ return ret;
201
+ } else return og.call(this.#process, ev, ...args);
202
+ }
203
+ };
204
+ const process$1 = globalThis.process;
205
+ const { onExit: onExit$1, load, unload } = signalExitWrap(processOk(process$1) ? new SignalExit(process$1) : new SignalExitFallback());
206
+
207
+ //#endregion
208
+ //#region src/utils/signal-exit.ts
209
+ function onExit(...args) {
210
+ if (typeof process === "object" && process.versions.webcontainer) {
211
+ process.on("exit", (code) => {
212
+ args[0](code, null);
213
+ });
214
+ return;
215
+ }
216
+ onExit$1(...args);
217
+ }
218
+
219
+ //#endregion
220
+ //#region src/api/watch/watch-emitter.ts
221
+ var import_binding = /* @__PURE__ */ __toESM(require_binding());
222
+ var WatcherEmitter = class {
223
+ listeners = /* @__PURE__ */ new Map();
224
+ timer;
225
+ constructor() {
226
+ this.timer = setInterval(() => {}, 1e9);
227
+ }
228
+ on(event, listener) {
229
+ const listeners = this.listeners.get(event);
230
+ if (listeners) listeners.push(listener);
231
+ else this.listeners.set(event, [listener]);
232
+ return this;
233
+ }
234
+ off(event, listener) {
235
+ const listeners = this.listeners.get(event);
236
+ if (listeners) {
237
+ const index = listeners.indexOf(listener);
238
+ if (index !== -1) listeners.splice(index, 1);
239
+ }
240
+ return this;
241
+ }
242
+ clear(event) {
243
+ if (this.listeners.has(event)) this.listeners.delete(event);
244
+ }
245
+ async onEvent(event) {
246
+ const listeners = this.listeners.get(event.eventKind());
247
+ if (listeners) switch (event.eventKind()) {
248
+ case "close":
249
+ case "restart":
250
+ for (const listener of listeners) await listener();
251
+ break;
252
+ case "event":
253
+ for (const listener of listeners) {
254
+ const code = event.bundleEventKind();
255
+ switch (code) {
256
+ case "BUNDLE_END":
257
+ const { duration, output, result } = event.bundleEndData();
258
+ await listener({
259
+ code: "BUNDLE_END",
260
+ duration,
261
+ output: [output],
262
+ result
263
+ });
264
+ break;
265
+ case "ERROR":
266
+ const data = event.bundleErrorData();
267
+ await listener({
268
+ code: "ERROR",
269
+ error: aggregateBindingErrorsIntoJsError(data.error),
270
+ result: data.result
271
+ });
272
+ break;
273
+ default:
274
+ await listener({ code });
275
+ break;
276
+ }
277
+ }
278
+ break;
279
+ case "change":
280
+ for (const listener of listeners) {
281
+ const { path, kind } = event.watchChangeData();
282
+ await listener(path, { event: kind });
283
+ }
284
+ break;
285
+ default: throw new Error(`Unknown event: ${event}`);
286
+ }
287
+ }
288
+ async close() {
289
+ clearInterval(this.timer);
290
+ }
291
+ };
292
+
293
+ //#endregion
294
+ //#region src/api/watch/watcher.ts
295
+ var Watcher = class {
296
+ closed;
297
+ inner;
298
+ emitter;
299
+ stopWorkers;
300
+ constructor(emitter, inner, stopWorkers) {
301
+ this.closed = false;
302
+ this.inner = inner;
303
+ this.emitter = emitter;
304
+ const originClose = emitter.close.bind(emitter);
305
+ emitter.close = async () => {
306
+ await this.close();
307
+ originClose();
308
+ };
309
+ this.stopWorkers = stopWorkers;
310
+ }
311
+ async close() {
312
+ if (this.closed) return;
313
+ this.closed = true;
314
+ for (const stop of this.stopWorkers) await stop?.();
315
+ await this.inner.close();
316
+ (0, import_binding.shutdownAsyncRuntime)();
317
+ }
318
+ start() {
319
+ process.nextTick(() => this.inner.start(this.emitter.onEvent.bind(this.emitter)));
320
+ }
321
+ };
322
+ async function createWatcher(emitter, input) {
323
+ const options = arraify(input);
324
+ const bundlerOptions = await Promise.all(options.map((option) => arraify(option.output || {}).map(async (output) => {
325
+ return createBundlerOptions(await PluginDriver.callOptionsHook(option, true), output, true);
326
+ })).flat());
327
+ const notifyOptions = getValidNotifyOption(bundlerOptions);
328
+ new Watcher(emitter, new import_binding.BindingWatcher(bundlerOptions.map((option) => option.bundlerOptions), notifyOptions), bundlerOptions.map((option) => option.stopWorkers)).start();
329
+ }
330
+ function getValidNotifyOption(bundlerOptions) {
331
+ let result;
332
+ for (const option of bundlerOptions) if (option.inputOptions.watch) {
333
+ const notifyOption = option.inputOptions.watch.notify;
334
+ if (notifyOption) if (result) {
335
+ option.onLog(LOG_LEVEL_WARN, logMultiplyNotifyOption());
336
+ return result;
337
+ } else result = notifyOption;
338
+ }
339
+ }
340
+
341
+ //#endregion
342
+ //#region src/api/watch/index.ts
343
+ /** @category Programmatic APIs */
344
+ const watch = (input) => {
345
+ const emitter = new WatcherEmitter();
346
+ createWatcher(emitter, input);
347
+ return emitter;
348
+ };
349
+
350
+ //#endregion
351
+ export { onExit as n, watch as t };
package/package.json CHANGED
@@ -1,65 +1,83 @@
1
1
  {
2
2
  "name": "rolldown",
3
- "version": "1.0.0-beta.6-commit.0fdc9f2",
3
+ "version": "1.0.0-beta.60",
4
4
  "description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
5
+ "keywords": [
6
+ "bundler",
7
+ "esbuild",
8
+ "parcel",
9
+ "rolldown",
10
+ "rollup",
11
+ "webpack"
12
+ ],
5
13
  "homepage": "https://rolldown.rs/",
14
+ "license": "MIT",
6
15
  "repository": {
7
16
  "type": "git",
8
17
  "url": "git+https://github.com/rolldown/rolldown.git",
9
18
  "directory": "packages/rolldown"
10
19
  },
11
- "license": "MIT",
12
- "keywords": [
13
- "webpack",
14
- "parcel",
15
- "esbuild",
16
- "rollup",
17
- "bundler",
18
- "rolldown"
19
- ],
20
+ "bin": {
21
+ "rolldown": "./bin/cli.mjs"
22
+ },
20
23
  "files": [
21
24
  "bin",
22
25
  "cli",
23
26
  "dist",
24
27
  "!dist/*.node"
25
28
  ],
26
- "bin": {
27
- "rolldown": "./bin/cli.js"
29
+ "type": "module",
30
+ "main": "./dist/index.mjs",
31
+ "module": "./dist/index.mjs",
32
+ "types": "./dist/index.d.mts",
33
+ "imports": {
34
+ "#parallel-plugin-worker": "./dist/parallel-plugin-worker.mjs"
28
35
  },
29
- "main": "./dist/cjs/index.cjs",
30
- "types": "./dist/types/index.d.ts",
31
36
  "exports": {
32
- ".": {
33
- "types": "./dist/types/index.d.ts",
34
- "require": "./dist/cjs/index.cjs",
35
- "import": "./dist/esm/index.mjs"
36
- },
37
- "./experimental": {
38
- "types": "./dist/types/experimental-index.d.ts",
39
- "require": "./dist/cjs/experimental-index.cjs",
40
- "import": "./dist/esm/experimental-index.mjs"
41
- },
42
- "./parallel-plugin": {
43
- "types": "./dist/types/parallel-plugin.d.ts",
44
- "require": "./dist/cjs/parallel-plugin.cjs",
45
- "import": "./dist/esm/parallel-plugin.mjs"
37
+ ".": "./dist/index.mjs",
38
+ "./config": "./dist/config.mjs",
39
+ "./experimental": "./dist/experimental-index.mjs",
40
+ "./experimental/runtime-types": {
41
+ "types": "./dist/experimental-runtime-types.d.ts"
46
42
  },
47
- "./parseAst": {
48
- "types": "./dist/types/parse-ast-index.d.ts",
49
- "require": "./dist/cjs/parse-ast-index.cjs",
50
- "import": "./dist/esm/parse-ast-index.mjs"
51
- },
52
- "./package.json": "./package.json"
53
- },
54
- "imports": {
55
- "#parallel-plugin-worker": "./dist/esm/parallel-plugin-worker.mjs"
43
+ "./filter": "./dist/filter-index.mjs",
44
+ "./getLogFilter": "./dist/get-log-filter.mjs",
45
+ "./parallelPlugin": "./dist/parallel-plugin.mjs",
46
+ "./parseAst": "./dist/parse-ast-index.mjs",
47
+ "./package.json": "./package.json",
48
+ "./plugins": "./dist/plugins-index.mjs"
56
49
  },
57
50
  "publishConfig": {
58
- "registry": "https://registry.npmjs.org/",
59
- "access": "public"
51
+ "access": "public",
52
+ "registry": "https://registry.npmjs.org/"
53
+ },
54
+ "dependencies": {
55
+ "@oxc-project/types": "=0.108.0",
56
+ "@rolldown/pluginutils": "1.0.0-beta.60"
57
+ },
58
+ "devDependencies": {
59
+ "@napi-rs/cli": "^3.4.1",
60
+ "@napi-rs/wasm-runtime": "^1.0.0",
61
+ "@oxc-node/cli": "^0.0.35",
62
+ "@rollup/plugin-json": "^6.1.0",
63
+ "buble": "^0.20.0",
64
+ "consola": "^3.4.2",
65
+ "execa": "^9.2.0",
66
+ "glob": "^13.0.0",
67
+ "oxc-parser": "=0.108.0",
68
+ "pathe": "^2.0.3",
69
+ "remeda": "^2.10.0",
70
+ "rolldown-plugin-dts": "^0.20.0",
71
+ "rollup": "^4.18.0",
72
+ "signal-exit": "4.1.0",
73
+ "source-map": "^0.7.6",
74
+ "typescript": "^5.8.3",
75
+ "valibot": "1.2.0",
76
+ "rolldown": "1.0.0-beta.60"
60
77
  },
61
78
  "napi": {
62
79
  "binaryName": "rolldown-binding",
80
+ "dtsHeader": "type MaybePromise<T> = T | Promise<T>\ntype Nullable<T> = T | null | undefined\ntype VoidNullable<T = void> = T | null | undefined | void\nexport type BindingStringOrRegex = string | RegExp\ntype BindingResult<T> = { errors: BindingError[], isBindingErrors: boolean } | T\n\n",
63
81
  "packageName": "@rolldown/binding",
64
82
  "targets": [
65
83
  "x86_64-apple-darwin",
@@ -67,96 +85,61 @@
67
85
  "x86_64-unknown-linux-gnu",
68
86
  "x86_64-unknown-linux-musl",
69
87
  "x86_64-unknown-freebsd",
70
- "i686-pc-windows-msvc",
71
88
  "armv7-unknown-linux-gnueabihf",
72
89
  "aarch64-unknown-linux-gnu",
73
90
  "aarch64-apple-darwin",
74
91
  "aarch64-unknown-linux-musl",
92
+ "aarch64-unknown-linux-ohos",
75
93
  "aarch64-pc-windows-msvc",
94
+ "aarch64-linux-android",
76
95
  "wasm32-wasip1-threads"
77
96
  ],
78
97
  "wasm": {
79
98
  "initialMemory": 16384,
80
99
  "browser": {
81
- "fs": true
100
+ "fs": true,
101
+ "asyncInit": true
82
102
  }
83
- },
84
- "dtsHeader": "type MaybePromise<T> = T | Promise<T>\ntype Nullable<T> = T | null | undefined\ntype VoidNullable<T = void> = T | null | undefined | void\nexport type BindingStringOrRegex = string | RegExp\n\n"
85
- },
86
- "dependencies": {
87
- "@oxc-project/types": "0.61.2",
88
- "@valibot/to-json-schema": "1.0.0",
89
- "valibot": "1.0.0"
90
- },
91
- "peerDependencies": {
92
- "@oxc-project/runtime": "0.61.2"
93
- },
94
- "peerDependenciesMeta": {
95
- "@oxc-project/runtime": {
96
- "optional": true
97
103
  }
98
104
  },
99
- "devDependencies": {
100
- "@jridgewell/sourcemap-codec": "^1.5.0",
101
- "@napi-rs/cli": "^3.0.0-alpha.74",
102
- "@napi-rs/wasm-runtime": "^0.2.4",
103
- "@oxc-node/core": "^0.0.21",
104
- "@types/fs-extra": "^11.0.4",
105
- "@types/lodash-es": "^4.17.12",
106
- "colorette": "^2.0.20",
107
- "consola": "^3.4.2",
108
- "emnapi": "^1.2.0",
109
- "execa": "^9.2.0",
110
- "fs-extra": "^11.2.0",
111
- "glob": "^11.0.0",
112
- "locate-character": "^3.0.0",
113
- "npm-run-all2": "^7.0.0",
114
- "oxc-parser": "^0.61.0",
115
- "remeda": "^2.10.0",
116
- "rollup": "^4.18.0",
117
- "signal-exit": "4.1.0",
118
- "source-map": "^0.7.4",
119
- "tsx": "^4.19.2",
120
- "type-fest": "^4.20.0",
121
- "typedoc": "^0.28.0",
122
- "typescript": "^5.7.3",
123
- "unbuild": "^3.0.0",
124
- "why-is-node-running": "^3.0.0",
125
- "@rolldown/testing": "0.0.1",
126
- "rolldown": "1.0.0-beta.6-commit.0fdc9f2"
105
+ "engines": {
106
+ "node": "^20.19.0 || >=22.12.0"
127
107
  },
128
108
  "optionalDependencies": {
129
- "@rolldown/binding-darwin-x64": "1.0.0-beta.6-commit.0fdc9f2",
130
- "@rolldown/binding-freebsd-x64": "1.0.0-beta.6-commit.0fdc9f2",
131
- "@rolldown/binding-darwin-arm64": "1.0.0-beta.6-commit.0fdc9f2",
132
- "@rolldown/binding-linux-arm64-gnu": "1.0.0-beta.6-commit.0fdc9f2",
133
- "@rolldown/binding-linux-arm-gnueabihf": "1.0.0-beta.6-commit.0fdc9f2",
134
- "@rolldown/binding-linux-arm64-musl": "1.0.0-beta.6-commit.0fdc9f2",
135
- "@rolldown/binding-linux-x64-gnu": "1.0.0-beta.6-commit.0fdc9f2",
136
- "@rolldown/binding-linux-x64-musl": "1.0.0-beta.6-commit.0fdc9f2",
137
- "@rolldown/binding-wasm32-wasi": "1.0.0-beta.6-commit.0fdc9f2",
138
- "@rolldown/binding-win32-arm64-msvc": "1.0.0-beta.6-commit.0fdc9f2",
139
- "@rolldown/binding-win32-ia32-msvc": "1.0.0-beta.6-commit.0fdc9f2",
140
- "@rolldown/binding-win32-x64-msvc": "1.0.0-beta.6-commit.0fdc9f2"
109
+ "@rolldown/binding-darwin-x64": "1.0.0-beta.60",
110
+ "@rolldown/binding-win32-x64-msvc": "1.0.0-beta.60",
111
+ "@rolldown/binding-linux-x64-gnu": "1.0.0-beta.60",
112
+ "@rolldown/binding-linux-x64-musl": "1.0.0-beta.60",
113
+ "@rolldown/binding-freebsd-x64": "1.0.0-beta.60",
114
+ "@rolldown/binding-linux-arm-gnueabihf": "1.0.0-beta.60",
115
+ "@rolldown/binding-linux-arm64-gnu": "1.0.0-beta.60",
116
+ "@rolldown/binding-darwin-arm64": "1.0.0-beta.60",
117
+ "@rolldown/binding-linux-arm64-musl": "1.0.0-beta.60",
118
+ "@rolldown/binding-openharmony-arm64": "1.0.0-beta.60",
119
+ "@rolldown/binding-win32-arm64-msvc": "1.0.0-beta.60",
120
+ "@rolldown/binding-android-arm64": "1.0.0-beta.60",
121
+ "@rolldown/binding-wasm32-wasi": "1.0.0-beta.60"
141
122
  },
142
123
  "scripts": {
143
124
  "# Scrips for binding #": "_",
144
125
  "artifacts": "napi artifacts --cwd ./src --package-json-path ../package.json -o=../artifacts --npm-dir ../npm",
145
- "build-binding": "node ./build-binding.js",
126
+ "build-binding": "oxnode ./build-binding.ts",
146
127
  "build-binding:release": "pnpm build-binding --release",
128
+ "build-binding:profile": "pnpm build-binding --profile profile",
147
129
  "build-binding:wasi": "pnpm build-binding --target wasm32-wasip1-threads",
148
130
  "build-binding:wasi:release": "pnpm build-binding --profile release-wasi --target wasm32-wasip1-threads",
149
131
  "# Scrips for node #": "_",
150
- "bak_build-node": "unbuild",
151
- "build-node": "tsx ./build.ts",
152
- "build-types": "tsc -p ./tsconfig.json",
153
- "build-js-glue": "run-s build-types build-node build-types-check",
154
- "build-native:debug": "run-s build-binding build-js-glue",
155
- "build-native:release": "run-s build-binding:release build-js-glue",
156
- "build-wasi:debug": "run-s build-binding build-binding:wasi build-node",
157
- "build-wasi:release": "run-s build-binding build-binding:wasi:release build-node",
132
+ "build-node": "oxnode -C dev ./build.ts",
158
133
  "build-types-check": "tsc -p ./tsconfig.check.json",
159
- "# Scrips for docs #": "_",
160
- "extract-options-doc": "typedoc"
134
+ "build-js-glue": "pnpm run --sequential '/^build-(node|types-check)$/'",
135
+ "build-native:debug": "pnpm run --sequential '/^build-(binding|js-glue)$/'",
136
+ "build-native:release": "pnpm run --sequential '/^build-(binding:release|js-glue)$/'",
137
+ "build-native:profile": "pnpm run build-binding:profile && pnpm run build-js-glue",
138
+ "build-native:memory-profile": "pnpm run build-binding:profile --features default_global_allocator && pnpm run build-js-glue",
139
+ "build-wasi:debug": "TARGET='rolldown-wasi' pnpm run --sequential '/^build-(binding|binding:wasi|node)$/'",
140
+ "build-wasi:release": "TARGET='rolldown-wasi' pnpm run --sequential '/^build-(binding|binding:wasi:release|node)$/'",
141
+ "build-browser-pkg:debug": "TARGET='browser' pnpm run --sequential '/^build-(binding|binding:wasi|node)$/'",
142
+ "build-browser-pkg:release": "TARGET='browser' pnpm run --sequential '/^build-(binding|binding:wasi:release|node)$/'",
143
+ "# Scrips for docs #": "_"
161
144
  }
162
145
  }
package/bin/cli.js DELETED
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import('../dist/esm/cli.mjs')