rolldown 1.0.0-beta.9-commit.0ec9e7d → 1.0.0-rc.1

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 (68) hide show
  1. package/README.md +11 -0
  2. package/bin/cli.mjs +1 -0
  3. package/dist/cli-setup.mjs +17 -0
  4. package/dist/cli.mjs +1085 -1281
  5. package/dist/config.d.mts +2 -4
  6. package/dist/config.mjs +8 -5
  7. package/dist/experimental-index.d.mts +161 -76
  8. package/dist/experimental-index.mjs +227 -61
  9. package/dist/experimental-runtime-types.d.ts +98 -0
  10. package/dist/filter-index.d.mts +196 -4
  11. package/dist/filter-index.mjs +328 -4
  12. package/dist/get-log-filter.d.mts +7 -0
  13. package/dist/get-log-filter.mjs +48 -0
  14. package/dist/index.d.mts +4 -4
  15. package/dist/index.mjs +56 -5
  16. package/dist/parallel-plugin-worker.mjs +27 -33
  17. package/dist/parallel-plugin.d.mts +7 -8
  18. package/dist/parse-ast-index.d.mts +4 -5
  19. package/dist/parse-ast-index.mjs +2 -2
  20. package/dist/plugins-index.d.mts +30 -0
  21. package/dist/plugins-index.mjs +40 -0
  22. package/dist/shared/binding-B92Lq__Q.d.mts +1687 -0
  23. package/dist/shared/binding-C-UNREnT.mjs +585 -0
  24. package/dist/shared/bindingify-input-options-Cb-01HR1.mjs +2233 -0
  25. package/dist/shared/constructors-D_KFsTQ-.d.mts +28 -0
  26. package/dist/shared/constructors-aZ82R2dj.mjs +61 -0
  27. package/dist/shared/define-config-BVG4QvnP.mjs +7 -0
  28. package/dist/shared/define-config-DO4TBkJV.d.mts +3457 -0
  29. package/dist/shared/{load-config-Dll-92l5.mjs → load-config-D6cey0o1.mjs} +23 -33
  30. package/dist/shared/logging-wIy4zY9I.d.mts +50 -0
  31. package/dist/shared/logs-NH298mHo.mjs +183 -0
  32. package/dist/shared/{misc-DGAe2XOW.mjs → misc-CCZIsXVO.mjs} +1 -7
  33. package/dist/shared/normalize-string-or-regex-Dq50a7l9.mjs +61 -0
  34. package/dist/shared/parse-ast-index-B6LAhWD8.mjs +99 -0
  35. package/dist/shared/{prompt-CxjDC0Gn.cjs → prompt-tlfjalEt.mjs} +301 -308
  36. package/dist/shared/rolldown-CIC_OHw3.mjs +42 -0
  37. package/dist/shared/rolldown-build-KB1YaNe-.mjs +2369 -0
  38. package/dist/shared/watch-B2WRkpw2.mjs +379 -0
  39. package/package.json +86 -98
  40. package/dist/cli.cjs +0 -1748
  41. package/dist/config.cjs +0 -12
  42. package/dist/config.d.cts +0 -12
  43. package/dist/experimental-index.cjs +0 -132
  44. package/dist/experimental-index.d.cts +0 -96
  45. package/dist/filter-index.cjs +0 -105
  46. package/dist/filter-index.d.cts +0 -5
  47. package/dist/index.cjs +0 -9
  48. package/dist/index.d.cts +0 -4
  49. package/dist/parallel-plugin-worker.cjs +0 -33
  50. package/dist/parallel-plugin-worker.d.cts +0 -1
  51. package/dist/parallel-plugin.cjs +0 -8
  52. package/dist/parallel-plugin.d.cts +0 -15
  53. package/dist/parse-ast-index.cjs +0 -4
  54. package/dist/parse-ast-index.d.cts +0 -9
  55. package/dist/shared/binding.d-Dz3qQrbl.d.mts +0 -1682
  56. package/dist/shared/binding.d-QXzDcVmm.d.cts +0 -1682
  57. package/dist/shared/chunk--iN_1bjD.mjs +0 -33
  58. package/dist/shared/chunk-DDkG_k5U.cjs +0 -39
  59. package/dist/shared/define-config.d-CUcDq_vm.d.cts +0 -1080
  60. package/dist/shared/define-config.d-qV1PzX_C.d.mts +0 -1080
  61. package/dist/shared/load-config-Bx9W9x2a.cjs +0 -125
  62. package/dist/shared/misc-BKp5iIef.cjs +0 -67
  63. package/dist/shared/parse-ast-index-0m6JgGc9.mjs +0 -655
  64. package/dist/shared/parse-ast-index-Cn_efzjO.cjs +0 -697
  65. package/dist/shared/prompt-uGrwvyp0.mjs +0 -854
  66. package/dist/shared/src-B4EklR3U.mjs +0 -4704
  67. package/dist/shared/src-BzFe16tX.cjs +0 -4654
  68. /package/dist/{cli.d.cts → cli-setup.d.mts} +0 -0
@@ -0,0 +1,379 @@
1
+ import { n as __toESM, t as require_binding } from "./binding-C-UNREnT.mjs";
2
+ import { o as logMultiplyNotifyOption } from "./logs-NH298mHo.mjs";
3
+ import { a as aggregateBindingErrorsIntoJsError, b as LOG_LEVEL_WARN } from "./bindingify-input-options-Cb-01HR1.mjs";
4
+ import { t as arraify } from "./misc-CCZIsXVO.mjs";
5
+ import { l as PluginDriver, n as createBundlerOptions } from "./rolldown-build-KB1YaNe-.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
+ /**
344
+ * The API compatible with Rollup's `watch` function.
345
+ *
346
+ * This function will rebuild the bundle when it detects that the individual modules have changed on disk.
347
+ *
348
+ * Note that when using this function, it is your responsibility to call `event.result.close()` in response to the `BUNDLE_END` event to avoid resource leaks.
349
+ *
350
+ * @param input The watch options object or the list of them.
351
+ * @returns A watcher object.
352
+ *
353
+ * @example
354
+ * ```js
355
+ * import { watch } from 'rolldown';
356
+ *
357
+ * const watcher = watch({ /* ... *\/ });
358
+ * watcher.on('event', (event) => {
359
+ * if (event.code === 'BUNDLE_END') {
360
+ * console.log(event.duration);
361
+ * event.result.close();
362
+ * }
363
+ * });
364
+ *
365
+ * // Stop watching
366
+ * watcher.close();
367
+ * ```
368
+ *
369
+ * @experimental
370
+ * @category Programmatic APIs
371
+ */
372
+ const watch = (input) => {
373
+ const emitter = new WatcherEmitter();
374
+ createWatcher(emitter, input);
375
+ return emitter;
376
+ };
377
+
378
+ //#endregion
379
+ export { onExit as n, watch as t };
package/package.json CHANGED
@@ -1,70 +1,83 @@
1
1
  {
2
2
  "name": "rolldown",
3
- "version": "1.0.0-beta.9-commit.0ec9e7d",
3
+ "version": "1.0.0-rc.1",
4
4
  "description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
5
- "type": "commonjs",
5
+ "keywords": [
6
+ "bundler",
7
+ "esbuild",
8
+ "parcel",
9
+ "rolldown",
10
+ "rollup",
11
+ "webpack"
12
+ ],
6
13
  "homepage": "https://rolldown.rs/",
14
+ "license": "MIT",
7
15
  "repository": {
8
16
  "type": "git",
9
17
  "url": "git+https://github.com/rolldown/rolldown.git",
10
18
  "directory": "packages/rolldown"
11
19
  },
12
- "license": "MIT",
13
- "keywords": [
14
- "webpack",
15
- "parcel",
16
- "esbuild",
17
- "rollup",
18
- "bundler",
19
- "rolldown"
20
- ],
20
+ "bin": {
21
+ "rolldown": "./bin/cli.mjs"
22
+ },
21
23
  "files": [
22
24
  "bin",
23
25
  "cli",
24
26
  "dist",
25
27
  "!dist/*.node"
26
28
  ],
27
- "bin": {
28
- "rolldown": "./bin/cli.mjs"
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"
29
35
  },
30
- "main": "./dist/index.cjs",
31
- "types": "./dist/index.d.cts",
32
36
  "exports": {
33
- ".": {
34
- "require": "./dist/index.cjs",
35
- "import": "./dist/index.mjs"
36
- },
37
- "./config": {
38
- "require": "./dist/config.cjs",
39
- "import": "./dist/config.mjs"
40
- },
41
- "./experimental": {
42
- "require": "./dist/experimental-index.cjs",
43
- "import": "./dist/experimental-index.mjs"
44
- },
45
- "./filter": {
46
- "require": "./dist/filter-index.cjs",
47
- "import": "./dist/filter-index.mjs"
48
- },
49
- "./parallelPlugin": {
50
- "require": "./dist/parallel-plugin.cjs",
51
- "import": "./dist/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"
52
42
  },
53
- "./parseAst": {
54
- "require": "./dist/parse-ast-index.cjs",
55
- "import": "./dist/parse-ast-index.mjs"
56
- },
57
- "./package.json": "./package.json"
58
- },
59
- "imports": {
60
- "#parallel-plugin-worker": "./dist/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"
61
49
  },
62
50
  "publishConfig": {
63
- "registry": "https://registry.npmjs.org/",
64
- "access": "public"
51
+ "access": "public",
52
+ "registry": "https://registry.npmjs.org/"
53
+ },
54
+ "dependencies": {
55
+ "@oxc-project/types": "=0.110.0",
56
+ "@rolldown/pluginutils": "1.0.0-rc.1"
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.110.0",
68
+ "pathe": "^2.0.3",
69
+ "remeda": "^2.10.0",
70
+ "rolldown-plugin-dts": "^0.21.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-rc.1"
65
77
  },
66
78
  "napi": {
67
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",
68
81
  "packageName": "@rolldown/binding",
69
82
  "targets": [
70
83
  "x86_64-apple-darwin",
@@ -72,12 +85,13 @@
72
85
  "x86_64-unknown-linux-gnu",
73
86
  "x86_64-unknown-linux-musl",
74
87
  "x86_64-unknown-freebsd",
75
- "i686-pc-windows-msvc",
76
88
  "armv7-unknown-linux-gnueabihf",
77
89
  "aarch64-unknown-linux-gnu",
78
90
  "aarch64-apple-darwin",
79
91
  "aarch64-unknown-linux-musl",
92
+ "aarch64-unknown-linux-ohos",
80
93
  "aarch64-pc-windows-msvc",
94
+ "aarch64-linux-android",
81
95
  "wasm32-wasip1-threads"
82
96
  ],
83
97
  "wasm": {
@@ -86,73 +100,47 @@
86
100
  "fs": true,
87
101
  "asyncInit": true
88
102
  }
89
- },
90
- "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"
103
+ }
91
104
  },
92
- "dependencies": {
93
- "@oxc-project/runtime": "0.72.0",
94
- "@oxc-project/types": "0.72.0",
95
- "ansis": "^4.0.0",
96
- "@rolldown/pluginutils": "1.0.0-beta.9-commit.0ec9e7d"
97
- },
98
- "devDependencies": {
99
- "@napi-rs/cli": "3.0.0-alpha.80",
100
- "@napi-rs/wasm-runtime": "^0.2.10",
101
- "@oxc-node/cli": "^0.0.27",
102
- "@types/fs-extra": "^11.0.4",
103
- "@types/lodash-es": "^4.17.12",
104
- "@valibot/to-json-schema": "1.2.0",
105
- "consola": "^3.4.2",
106
- "emnapi": "^1.2.0",
107
- "execa": "^9.2.0",
108
- "fs-extra": "^11.2.0",
109
- "glob": "^11.0.0",
110
- "locate-character": "^3.0.0",
111
- "oxc-parser": "0.72.0",
112
- "pathe": "^2.0.3",
113
- "remeda": "^2.10.0",
114
- "rolldown-plugin-dts": "^0.7.12",
115
- "rollup": "^4.18.0",
116
- "signal-exit": "4.1.0",
117
- "source-map": "^0.7.4",
118
- "type-fest": "^4.20.0",
119
- "typedoc": "^0.28.0",
120
- "typescript": "^5.7.3",
121
- "unbuild": "^3.0.0",
122
- "valibot": "1.1.0",
123
- "@rolldown/testing": "0.0.1",
124
- "rolldown": "1.0.0-beta.9-commit.0ec9e7d"
105
+ "engines": {
106
+ "node": "^20.19.0 || >=22.12.0"
125
107
  },
126
108
  "optionalDependencies": {
127
- "@rolldown/binding-darwin-arm64": "1.0.0-beta.9-commit.0ec9e7d",
128
- "@rolldown/binding-darwin-x64": "1.0.0-beta.9-commit.0ec9e7d",
129
- "@rolldown/binding-freebsd-x64": "1.0.0-beta.9-commit.0ec9e7d",
130
- "@rolldown/binding-linux-arm-gnueabihf": "1.0.0-beta.9-commit.0ec9e7d",
131
- "@rolldown/binding-linux-arm64-gnu": "1.0.0-beta.9-commit.0ec9e7d",
132
- "@rolldown/binding-linux-arm64-musl": "1.0.0-beta.9-commit.0ec9e7d",
133
- "@rolldown/binding-linux-x64-gnu": "1.0.0-beta.9-commit.0ec9e7d",
134
- "@rolldown/binding-linux-x64-musl": "1.0.0-beta.9-commit.0ec9e7d",
135
- "@rolldown/binding-wasm32-wasi": "1.0.0-beta.9-commit.0ec9e7d",
136
- "@rolldown/binding-win32-ia32-msvc": "1.0.0-beta.9-commit.0ec9e7d",
137
- "@rolldown/binding-win32-x64-msvc": "1.0.0-beta.9-commit.0ec9e7d",
138
- "@rolldown/binding-win32-arm64-msvc": "1.0.0-beta.9-commit.0ec9e7d"
109
+ "@rolldown/binding-darwin-x64": "1.0.0-rc.1",
110
+ "@rolldown/binding-win32-x64-msvc": "1.0.0-rc.1",
111
+ "@rolldown/binding-linux-x64-gnu": "1.0.0-rc.1",
112
+ "@rolldown/binding-linux-x64-musl": "1.0.0-rc.1",
113
+ "@rolldown/binding-freebsd-x64": "1.0.0-rc.1",
114
+ "@rolldown/binding-linux-arm-gnueabihf": "1.0.0-rc.1",
115
+ "@rolldown/binding-linux-arm64-gnu": "1.0.0-rc.1",
116
+ "@rolldown/binding-darwin-arm64": "1.0.0-rc.1",
117
+ "@rolldown/binding-linux-arm64-musl": "1.0.0-rc.1",
118
+ "@rolldown/binding-openharmony-arm64": "1.0.0-rc.1",
119
+ "@rolldown/binding-win32-arm64-msvc": "1.0.0-rc.1",
120
+ "@rolldown/binding-android-arm64": "1.0.0-rc.1",
121
+ "@rolldown/binding-wasm32-wasi": "1.0.0-rc.1"
139
122
  },
140
123
  "scripts": {
141
124
  "# Scrips for binding #": "_",
142
125
  "artifacts": "napi artifacts --cwd ./src --package-json-path ../package.json -o=../artifacts --npm-dir ../npm",
143
- "build-binding": "oxnode ./build-binding.mts",
126
+ "build-binding": "oxnode ./build-binding.ts",
144
127
  "build-binding:release": "pnpm build-binding --release",
128
+ "build-binding:profile": "pnpm build-binding --profile profile",
145
129
  "build-binding:wasi": "pnpm build-binding --target wasm32-wasip1-threads",
146
130
  "build-binding:wasi:release": "pnpm build-binding --profile release-wasi --target wasm32-wasip1-threads",
147
131
  "# Scrips for node #": "_",
148
- "build-node": "oxnode ./build.ts",
132
+ "build-node": "oxnode -C dev ./build.ts",
149
133
  "build-types-check": "tsc -p ./tsconfig.check.json",
150
- "build-js-glue": "pnpm run --sequential '/^build-(types|node|types-check)$/'",
134
+ "build-js-glue": "pnpm run --sequential '/^build-(node|types-check)$/'",
151
135
  "build-native:debug": "pnpm run --sequential '/^build-(binding|js-glue)$/'",
152
136
  "build-native:release": "pnpm run --sequential '/^build-(binding:release|js-glue)$/'",
153
- "build-browser:debug": "BROWSER_PKG=1 pnpm run --sequential '/^build-(binding|binding:wasi|node)$/'",
154
- "build-browser:release": "BROWSER_PKG=1 pnpm run --sequential '/^build-(binding|binding:wasi:release|node)$/'",
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)$/'",
155
143
  "# Scrips for docs #": "_",
156
- "extract-options-doc": "typedoc"
144
+ "publint": "publint ."
157
145
  }
158
146
  }