@rollipop/rolldown 0.0.0-beta.3 → 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 (39) hide show
  1. package/dist/cli-setup.mjs +1 -1
  2. package/dist/cli.mjs +121 -114
  3. package/dist/config.d.mts +2 -2
  4. package/dist/config.mjs +8 -8
  5. package/dist/experimental-index.d.mts +43 -43
  6. package/dist/experimental-index.mjs +6 -6
  7. package/dist/filter-index.d.mts +197 -4
  8. package/dist/filter-index.mjs +1 -1
  9. package/dist/get-log-filter.d.mts +3 -3
  10. package/dist/index.d.mts +4 -4
  11. package/dist/index.mjs +27 -8
  12. package/dist/parallel-plugin-worker.mjs +4 -4
  13. package/dist/parallel-plugin.d.mts +4 -4
  14. package/dist/parse-ast-index.d.mts +1 -1
  15. package/dist/parse-ast-index.mjs +2 -2
  16. package/dist/plugins-index.d.mts +3 -4
  17. package/dist/plugins-index.mjs +3 -3
  18. package/dist/shared/binding-B92Lq__Q.d.mts +1687 -0
  19. package/dist/shared/{binding-uOeDeDzp.mjs → binding-tNJoEqAa.mjs} +28 -26
  20. package/dist/shared/{bindingify-input-options-CuBDHglZ.mjs → bindingify-input-options-CfhrNd_y.mjs} +117 -58
  21. package/dist/shared/{constructors-D9F4Aj4h.d.mts → constructors--k1uxZrh.d.mts} +2 -2
  22. package/dist/shared/{constructors-DmSv3tnW.mjs → constructors-414MPkgB.mjs} +1 -1
  23. package/dist/shared/define-config-D8xP5iyL.d.mts +3463 -0
  24. package/dist/shared/{load-config-Bo3y98vw.mjs → load-config-Qtd9pHJ5.mjs} +1 -1
  25. package/dist/shared/logging-wIy4zY9I.d.mts +50 -0
  26. package/dist/shared/{normalize-string-or-regex-0f6WITto.mjs → normalize-string-or-regex-DeB7vQ75.mjs} +2 -2
  27. package/dist/shared/{parse-ast-index-B0iVLbj6.mjs → parse-ast-index-BcP4Ts_P.mjs} +3 -3
  28. package/dist/shared/{prompt-BZ-QjPVS.mjs → prompt-tlfjalEt.mjs} +1 -1
  29. package/dist/shared/rolldown-BMzJcmQ7.mjs +42 -0
  30. package/dist/shared/{rolldown-build-BqHWBpp7.mjs → rolldown-build-DWeKtJOy.mjs} +123 -47
  31. package/dist/shared/{watch-Ce8bKBAn.mjs → watch-HmN4U4B9.mjs} +34 -6
  32. package/package.json +18 -16
  33. package/dist/shared/binding-C9YdqoUG.d.mts +0 -1657
  34. package/dist/shared/define-config-glNgjHCc.d.mts +0 -2573
  35. package/dist/shared/logging-DsnCZi19.d.mts +0 -42
  36. package/dist/shared/rolldown-mAJGca5O.mjs +0 -11
  37. /package/dist/shared/{define-config-BF4P-Pum.mjs → define-config-BVG4QvnP.mjs} +0 -0
  38. /package/dist/shared/{logs-N5Akftom.mjs → logs-NH298mHo.mjs} +0 -0
  39. /package/dist/shared/{misc-0HsaOsAX.mjs → misc-CCZIsXVO.mjs} +0 -0
@@ -1,4 +1,4 @@
1
- import { n as __toESM, t as require_binding } from "./shared/binding-uOeDeDzp.mjs";
1
+ import { n as __toESM, t as require_binding } from "./shared/binding-tNJoEqAa.mjs";
2
2
 
3
3
  //#region src/cli/setup-index.ts
4
4
  var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
package/dist/cli.mjs CHANGED
@@ -1,12 +1,12 @@
1
- import "./shared/binding-uOeDeDzp.mjs";
2
- import { n as onExit, t as watch } from "./shared/watch-Ce8bKBAn.mjs";
3
- import "./shared/normalize-string-or-regex-0f6WITto.mjs";
4
- import { C as description, w as version } from "./shared/bindingify-input-options-CuBDHglZ.mjs";
5
- import { t as arraify } from "./shared/misc-0HsaOsAX.mjs";
6
- import { a as getOutputCliKeys, c as styleText$1, i as getInputCliKeys, o as validateCliOptions, r as getCliSchemaInfo } from "./shared/rolldown-build-BqHWBpp7.mjs";
7
- import "./shared/parse-ast-index-B0iVLbj6.mjs";
8
- import { t as rolldown } from "./shared/rolldown-mAJGca5O.mjs";
9
- import { t as loadConfig } from "./shared/load-config-Bo3y98vw.mjs";
1
+ import "./shared/binding-tNJoEqAa.mjs";
2
+ import { n as onExit, t as watch } from "./shared/watch-HmN4U4B9.mjs";
3
+ import "./shared/normalize-string-or-regex-DeB7vQ75.mjs";
4
+ import { C as description, w as version } from "./shared/bindingify-input-options-CfhrNd_y.mjs";
5
+ import { t as arraify } from "./shared/misc-CCZIsXVO.mjs";
6
+ import { a as getOutputCliKeys, c as styleText$1, i as getInputCliKeys, o as validateCliOptions, r as getCliSchemaInfo } from "./shared/rolldown-build-DWeKtJOy.mjs";
7
+ import "./shared/parse-ast-index-BcP4Ts_P.mjs";
8
+ import { t as rolldown } from "./shared/rolldown-BMzJcmQ7.mjs";
9
+ import { t as loadConfig } from "./shared/load-config-Qtd9pHJ5.mjs";
10
10
  import path, { sep } from "node:path";
11
11
  import { formatWithOptions, parseArgs } from "node:util";
12
12
  import process$1 from "node:process";
@@ -69,7 +69,7 @@ function _defu(baseObject, defaults, namespace = ".", merger) {
69
69
  return object;
70
70
  }
71
71
  function createDefu(merger) {
72
- return (...arguments_) => arguments_.reduce((p, c$1) => _defu(p, c$1, "", merger), {});
72
+ return (...arguments_) => arguments_.reduce((p, c) => _defu(p, c, "", merger), {});
73
73
  }
74
74
  const defu = createDefu();
75
75
  function isPlainObject(obj) {
@@ -92,13 +92,13 @@ var Consola = class Consola {
92
92
  *
93
93
  * @param {Partial<ConsolaOptions>} [options={}] - Configuration options for the Consola instance.
94
94
  */
95
- constructor(options$1 = {}) {
96
- const types = options$1.types || LogTypes;
95
+ constructor(options = {}) {
96
+ const types = options.types || LogTypes;
97
97
  this.options = defu({
98
- ...options$1,
99
- defaults: { ...options$1.defaults },
100
- level: _normalizeLogLevel(options$1.level, types),
101
- reporters: [...options$1.reporters || []]
98
+ ...options,
99
+ defaults: { ...options.defaults },
100
+ level: _normalizeLogLevel(options.level, types),
101
+ reporters: [...options.reporters || []]
102
102
  }, {
103
103
  types: LogTypes,
104
104
  throttle: 1e3,
@@ -156,10 +156,10 @@ var Consola = class Consola {
156
156
  * @param {Partial<ConsolaOptions>} options - Optional overrides for the new instance. See {@link ConsolaOptions}.
157
157
  * @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
158
158
  */
159
- create(options$1) {
159
+ create(options) {
160
160
  const instance = new Consola({
161
161
  ...this.options,
162
- ...options$1
162
+ ...options
163
163
  });
164
164
  if (this._mockFn) instance.mockTypes(this._mockFn);
165
165
  return instance;
@@ -208,8 +208,8 @@ var Consola = class Consola {
208
208
  */
209
209
  removeReporter(reporter) {
210
210
  if (reporter) {
211
- const i$1 = this.options.reporters.indexOf(reporter);
212
- if (i$1 !== -1) return this.options.reporters.splice(i$1, 1);
211
+ const i = this.options.reporters.indexOf(reporter);
212
+ if (i !== -1) return this.options.reporters.splice(i, 1);
213
213
  } else this.options.reporters.splice(0);
214
214
  return this;
215
215
  }
@@ -394,15 +394,15 @@ Consola.prototype.withScope = Consola.prototype.withTag;
394
394
  Consola.prototype.mock = Consola.prototype.mockTypes;
395
395
  Consola.prototype.pause = Consola.prototype.pauseLogs;
396
396
  Consola.prototype.resume = Consola.prototype.resumeLogs;
397
- function createConsola$1(options$1 = {}) {
398
- return new Consola(options$1);
397
+ function createConsola$1(options = {}) {
398
+ return new Consola(options);
399
399
  }
400
400
 
401
401
  //#endregion
402
402
  //#region ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/shared/consola.DRwqZj3T.mjs
403
403
  function parseStack(stack, message) {
404
- const cwd$1 = process.cwd() + sep;
405
- return stack.split("\n").splice(message.split("\n").length).map((l$1) => l$1.trim().replace("file://", "").replace(cwd$1, ""));
404
+ const cwd = process.cwd() + sep;
405
+ return stack.split("\n").splice(message.split("\n").length).map((l) => l.trim().replace("file://", "").replace(cwd, ""));
406
406
  }
407
407
  function writeStream(data, stream) {
408
408
  return (stream.__write || stream.write).call(stream, data);
@@ -443,7 +443,7 @@ ${indent}`);
443
443
  bracket(logObj.tag),
444
444
  logObj.title && logObj.title,
445
445
  ...message.split("\n")
446
- ].filter(Boolean).map((l$1) => " > " + l$1).join("\n") + "\n";
446
+ ].filter(Boolean).map((l) => " > " + l).join("\n") + "\n";
447
447
  return this.filterAndJoin([
448
448
  bracket(logObj.type),
449
449
  bracket(logObj.tag),
@@ -635,9 +635,9 @@ function box(text, _opts = {}) {
635
635
  boxLines.push(`${leftSpace}${borderStyle.tl}${left}${title}${right}${borderStyle.tr}`);
636
636
  } else boxLines.push(`${leftSpace}${borderStyle.tl}${borderStyle.h.repeat(widthOffset)}${borderStyle.tr}`);
637
637
  const valignOffset = opts.style.valign === "center" ? Math.floor((height - textLines.length) / 2) : opts.style.valign === "top" ? height - textLines.length - paddingOffset : height - textLines.length;
638
- for (let i$1 = 0; i$1 < height; i$1++) if (i$1 < valignOffset || i$1 >= valignOffset + textLines.length) boxLines.push(`${leftSpace}${borderStyle.v}${" ".repeat(widthOffset)}${borderStyle.v}`);
638
+ for (let i = 0; i < height; i++) if (i < valignOffset || i >= valignOffset + textLines.length) boxLines.push(`${leftSpace}${borderStyle.v}${" ".repeat(widthOffset)}${borderStyle.v}`);
639
639
  else {
640
- const line = textLines[i$1 - valignOffset];
640
+ const line = textLines[i - valignOffset];
641
641
  const left = " ".repeat(paddingOffset);
642
642
  const right = " ".repeat(width - stripAnsi$1(line).length);
643
643
  boxLines.push(`${leftSpace}${borderStyle.v}${left}${line}${right}${borderStyle.v}`);
@@ -838,9 +838,9 @@ const emojiRegex = () => {
838
838
  };
839
839
  const segmenter = globalThis.Intl?.Segmenter ? new Intl.Segmenter() : { segment: (str) => str.split("") };
840
840
  const defaultIgnorableCodePointRegex = /^\p{Default_Ignorable_Code_Point}$/u;
841
- function stringWidth$1(string, options$1 = {}) {
841
+ function stringWidth$1(string, options = {}) {
842
842
  if (typeof string !== "string" || string.length === 0) return 0;
843
- const { ambiguousIsNarrow = true, countAnsiEscapeCodes = false } = options$1;
843
+ const { ambiguousIsNarrow = true, countAnsiEscapeCodes = false } = options;
844
844
  if (!countAnsiEscapeCodes) string = stripAnsi(string);
845
845
  if (string.length === 0) return 0;
846
846
  let width = 0;
@@ -862,10 +862,10 @@ function stringWidth$1(string, options$1 = {}) {
862
862
  return width;
863
863
  }
864
864
  function isUnicodeSupported() {
865
- const { env: env$1 } = process$1;
866
- const { TERM, TERM_PROGRAM } = env$1;
865
+ const { env } = process$1;
866
+ const { TERM, TERM_PROGRAM } = env;
867
867
  if (process$1.platform !== "win32") return TERM !== "linux";
868
- return Boolean(env$1.WT_SESSION) || Boolean(env$1.TERMINUS_SUBLIME) || env$1.ConEmuTask === "{cmd::Cmder}" || TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env$1.TERMINAL_EMULATOR === "JetBrains-JediTerm";
868
+ return Boolean(env.WT_SESSION) || Boolean(env.TERMINUS_SUBLIME) || env.ConEmuTask === "{cmd::Cmder}" || TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
869
869
  }
870
870
  const TYPE_COLOR_MAP = {
871
871
  info: "cyan",
@@ -943,7 +943,7 @@ function getColor(color = "white") {
943
943
  function getBgColor(color = "bgWhite") {
944
944
  return colors[`bg${color[0].toUpperCase()}${color.slice(1)}`] || colors.bgWhite;
945
945
  }
946
- function createConsola(options$1 = {}) {
946
+ function createConsola(options = {}) {
947
947
  let level = _getDefaultLogLevel();
948
948
  if (process.env.CONSOLA_LEVEL) level = Number.parseInt(process.env.CONSOLA_LEVEL) ?? level;
949
949
  return createConsola$1({
@@ -951,9 +951,9 @@ function createConsola(options$1 = {}) {
951
951
  defaults: { level },
952
952
  stdout: process.stdout,
953
953
  stderr: process.stderr,
954
- prompt: (...args) => import("./shared/prompt-BZ-QjPVS.mjs").then((m) => m.prompt(...args)),
955
- reporters: options$1.reporters || [options$1.fancy ?? !(T || R) ? new FancyReporter() : new BasicReporter()],
956
- ...options$1
954
+ prompt: (...args) => import("./shared/prompt-tlfjalEt.mjs").then((m) => m.prompt(...args)),
955
+ reporters: options.reporters || [options.fancy ?? !(T || R) ? new FancyReporter() : new BasicReporter()],
956
+ ...options
957
957
  });
958
958
  }
959
959
  function _getDefaultLogLevel() {
@@ -1033,12 +1033,12 @@ const alias = {
1033
1033
 
1034
1034
  //#endregion
1035
1035
  //#region src/cli/arguments/utils.ts
1036
- function setNestedProperty(obj, path$1, value) {
1037
- const keys = path$1.split(".");
1036
+ function setNestedProperty(obj, path, value) {
1037
+ const keys = path.split(".");
1038
1038
  let current = obj;
1039
- for (let i$1 = 0; i$1 < keys.length - 1; i$1++) {
1040
- if (!current[keys[i$1]]) current[keys[i$1]] = {};
1041
- current = current[keys[i$1]];
1039
+ for (let i = 0; i < keys.length - 1; i++) {
1040
+ if (!current[keys[i]]) current[keys[i]] = {};
1041
+ current = current[keys[i]];
1042
1042
  }
1043
1043
  const finalKey = keys[keys.length - 1];
1044
1044
  Object.defineProperty(current, finalKey, {
@@ -1076,16 +1076,16 @@ function normalizeCliOptions(cliOptions, positionals) {
1076
1076
  });
1077
1077
  process.exit(1);
1078
1078
  }
1079
- const options$1 = data ?? {};
1079
+ const options = data ?? {};
1080
1080
  const result = {
1081
1081
  input: {},
1082
1082
  output: {},
1083
- help: options$1.help ?? false,
1084
- version: options$1.version ?? false,
1085
- watch: options$1.watch ?? false
1083
+ help: options.help ?? false,
1084
+ version: options.version ?? false,
1085
+ watch: options.watch ?? false
1086
1086
  };
1087
- if (typeof options$1.config === "string") result.config = options$1.config;
1088
- if (options$1.environment !== void 0) result.environment = options$1.environment;
1087
+ if (typeof options.config === "string") result.config = options.config;
1088
+ if (options.environment !== void 0) result.environment = options.environment;
1089
1089
  const keysOfInput = getInputCliKeys();
1090
1090
  const keysOfOutput = getOutputCliKeys();
1091
1091
  const reservedKeys = [
@@ -1095,7 +1095,7 @@ function normalizeCliOptions(cliOptions, positionals) {
1095
1095
  "watch",
1096
1096
  "environment"
1097
1097
  ];
1098
- for (let [key, value] of Object.entries(options$1)) {
1098
+ for (let [key, value] of Object.entries(options)) {
1099
1099
  const [primary] = key.split(".");
1100
1100
  if (keysOfInput.includes(primary)) setNestedProperty(result.input, key, value);
1101
1101
  else if (keysOfOutput.includes(primary)) setNestedProperty(result.output, key, value);
@@ -1206,8 +1206,8 @@ function parseCliArguments() {
1206
1206
  }).filter((item) => {
1207
1207
  return item !== void 0;
1208
1208
  });
1209
- invalid_options.sort((a$1, b$1) => {
1210
- return a$1.name.localeCompare(b$1.name);
1209
+ invalid_options.sort((a, b) => {
1210
+ return a.name.localeCompare(b.name);
1211
1211
  });
1212
1212
  if (invalid_options.length !== 0) {
1213
1213
  let single = invalid_options.length === 1;
@@ -1229,41 +1229,41 @@ function parseCliArguments() {
1229
1229
  //#endregion
1230
1230
  //#region src/utils/clear-screen.ts
1231
1231
  const CLEAR_SCREEN = "\x1Bc";
1232
- function getClearScreenFunction(options$1) {
1232
+ function getClearScreenFunction(options) {
1233
1233
  const isTTY = process.stdout.isTTY;
1234
- const isAnyOptionNotAllowingClearScreen = arraify(options$1).some(({ watch: watch$1 }) => watch$1 === false || watch$1?.clearScreen === false);
1234
+ const isAnyOptionNotAllowingClearScreen = arraify(options).some(({ watch }) => watch === false || watch?.clearScreen === false);
1235
1235
  if (isTTY && !isAnyOptionNotAllowingClearScreen) return () => {
1236
1236
  process.stdout.write(CLEAR_SCREEN);
1237
1237
  };
1238
1238
  }
1239
1239
 
1240
1240
  //#endregion
1241
- //#region \0@oxc-project+runtime@0.108.0/helpers/usingCtx.js
1241
+ //#region \0@oxc-project+runtime@0.110.0/helpers/usingCtx.js
1242
1242
  function _usingCtx() {
1243
- var r$1 = "function" == typeof SuppressedError ? SuppressedError : function(r$1, e) {
1244
- var n$1 = Error();
1245
- return n$1.name = "SuppressedError", n$1.error = r$1, n$1.suppressed = e, n$1;
1246
- }, e = {}, n$1 = [];
1247
- function using(r$1, e) {
1243
+ var r = "function" == typeof SuppressedError ? SuppressedError : function(r, e) {
1244
+ var n = Error();
1245
+ return n.name = "SuppressedError", n.error = r, n.suppressed = e, n;
1246
+ }, e = {}, n = [];
1247
+ function using(r, e) {
1248
1248
  if (null != e) {
1249
1249
  if (Object(e) !== e) throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");
1250
- if (r$1) var o$1 = e[Symbol.asyncDispose || Symbol["for"]("Symbol.asyncDispose")];
1251
- if (void 0 === o$1 && (o$1 = e[Symbol.dispose || Symbol["for"]("Symbol.dispose")], r$1)) var t$1 = o$1;
1252
- if ("function" != typeof o$1) throw new TypeError("Object is not disposable.");
1253
- t$1 && (o$1 = function o$1() {
1250
+ if (r) var o = e[Symbol.asyncDispose || Symbol["for"]("Symbol.asyncDispose")];
1251
+ if (void 0 === o && (o = e[Symbol.dispose || Symbol["for"]("Symbol.dispose")], r)) var t = o;
1252
+ if ("function" != typeof o) throw new TypeError("Object is not disposable.");
1253
+ t && (o = function o() {
1254
1254
  try {
1255
- t$1.call(e);
1256
- } catch (r$1) {
1257
- return Promise.reject(r$1);
1255
+ t.call(e);
1256
+ } catch (r) {
1257
+ return Promise.reject(r);
1258
1258
  }
1259
- }), n$1.push({
1259
+ }), n.push({
1260
1260
  v: e,
1261
- d: o$1,
1262
- a: r$1
1261
+ d: o,
1262
+ a: r
1263
1263
  });
1264
- } else r$1 && n$1.push({
1264
+ } else r && n.push({
1265
1265
  d: e,
1266
- a: r$1
1266
+ a: r
1267
1267
  });
1268
1268
  return e;
1269
1269
  }
@@ -1272,22 +1272,22 @@ function _usingCtx() {
1272
1272
  u: using.bind(null, !1),
1273
1273
  a: using.bind(null, !0),
1274
1274
  d: function d() {
1275
- var o$1, t$1 = this.e, s$1 = 0;
1275
+ var o, t = this.e, s = 0;
1276
1276
  function next() {
1277
- for (; o$1 = n$1.pop();) try {
1278
- if (!o$1.a && 1 === s$1) return s$1 = 0, n$1.push(o$1), Promise.resolve().then(next);
1279
- if (o$1.d) {
1280
- var r$1 = o$1.d.call(o$1.v);
1281
- if (o$1.a) return s$1 |= 2, Promise.resolve(r$1).then(next, err);
1282
- } else s$1 |= 1;
1283
- } catch (r$1) {
1284
- return err(r$1);
1277
+ for (; o = n.pop();) try {
1278
+ if (!o.a && 1 === s) return s = 0, n.push(o), Promise.resolve().then(next);
1279
+ if (o.d) {
1280
+ var r = o.d.call(o.v);
1281
+ if (o.a) return s |= 2, Promise.resolve(r).then(next, err);
1282
+ } else s |= 1;
1283
+ } catch (r) {
1284
+ return err(r);
1285
1285
  }
1286
- if (1 === s$1) return t$1 !== e ? Promise.reject(t$1) : Promise.resolve();
1287
- if (t$1 !== e) throw t$1;
1286
+ if (1 === s) return t !== e ? Promise.reject(t) : Promise.resolve();
1287
+ if (t !== e) throw t;
1288
1288
  }
1289
- function err(n$1) {
1290
- return t$1 = t$1 !== e ? new r$1(n$1, t$1) : n$1, next();
1289
+ function err(n) {
1290
+ return t = t !== e ? new r(n, t) : n, next();
1291
1291
  }
1292
1292
  return next();
1293
1293
  }
@@ -1330,8 +1330,8 @@ async function bundleWithCliOptions(cliOptions) {
1330
1330
  if (outputs.length > 1) logger.log(`\n${styleText$1(["cyan", "bold"], `|→ ${file.fileName}:`)}\n`);
1331
1331
  console.log(file.type === "asset" ? file.source : file.code);
1332
1332
  }
1333
- } catch (_$1) {
1334
- _usingCtx$1.e = _$1;
1333
+ } catch (_) {
1334
+ _usingCtx$1.e = _;
1335
1335
  } finally {
1336
1336
  await _usingCtx$1.d();
1337
1337
  }
@@ -1450,7 +1450,7 @@ function printOutputEntries(entries, sizeAdjustment, distPath) {
1450
1450
  for (const group of CHUNK_GROUPS) {
1451
1451
  const filtered = entries.filter((e) => e.type === group.type);
1452
1452
  if (!filtered.length) continue;
1453
- for (const entry of filtered.sort((a$1, z) => a$1.size - z.size)) {
1453
+ for (const entry of filtered.sort((a, z) => a.size - z.size)) {
1454
1454
  let log = styleText$1("dim", withTrailingSlash(distPath));
1455
1455
  log += styleText$1(group.color, entry.fileName.padEnd(sizeAdjustment.longest + 2));
1456
1456
  log += styleText$1("dim", entry.type);
@@ -1459,9 +1459,9 @@ function printOutputEntries(entries, sizeAdjustment, distPath) {
1459
1459
  }
1460
1460
  }
1461
1461
  }
1462
- function withTrailingSlash(path$1) {
1463
- if (path$1[path$1.length - 1] !== "/") return `${path$1}/`;
1464
- return path$1;
1462
+ function withTrailingSlash(path) {
1463
+ if (path[path.length - 1] !== "/") return `${path}/`;
1464
+ return path;
1465
1465
  }
1466
1466
  function ms(duration) {
1467
1467
  return duration < 1e3 ? `${duration.toFixed(2)} ms` : `${(duration / 1e3).toFixed(2)} s`;
@@ -1473,9 +1473,6 @@ function relativeId(id) {
1473
1473
 
1474
1474
  //#endregion
1475
1475
  //#region src/cli/commands/help.ts
1476
- const introduction = `${styleText$1("gray", `${description} (rolldown v${version})`)}
1477
-
1478
- ${styleText$1(["bold", "underline"], "USAGE")} ${styleText$1("cyan", "rolldown -c <config>")} or ${styleText$1("cyan", "rolldown <input> <options>")}`;
1479
1476
  const examples = [
1480
1477
  {
1481
1478
  title: "Bundle with a config file `rolldown.config.mjs`",
@@ -1504,37 +1501,47 @@ const notes = [
1504
1501
  "CLI options will override the configuration file.",
1505
1502
  "For more information, please visit https://rolldown.rs/."
1506
1503
  ];
1507
- function showHelp() {
1508
- logger.log(introduction);
1509
- logger.log("");
1510
- logger.log(`${styleText$1(["bold", "underline"], "OPTIONS")}`);
1511
- logger.log("");
1512
- logger.log(Object.entries(options).sort(([a$1], [b$1]) => {
1513
- if (options[a$1].short && !options[b$1].short) return -1;
1514
- if (!options[a$1].short && options[b$1].short) return 1;
1515
- if (options[a$1].short && options[b$1].short) return options[a$1].short.localeCompare(options[b$1].short);
1516
- return a$1.localeCompare(b$1);
1517
- }).map(([option, { type, short, hint, description: description$1 }]) => {
1504
+ /**
1505
+ * Generates the CLI help text as a string.
1506
+ */
1507
+ function generateHelpText() {
1508
+ const lines = [];
1509
+ lines.push(`${styleText$1("gray", `${description} (rolldown v${version})`)}`);
1510
+ lines.push("");
1511
+ lines.push(`${styleText$1(["bold", "underline"], "USAGE")} ${styleText$1("cyan", "rolldown -c <config>")} or ${styleText$1("cyan", "rolldown <input> <options>")}`);
1512
+ lines.push("");
1513
+ lines.push(`${styleText$1(["bold", "underline"], "OPTIONS")}`);
1514
+ lines.push("");
1515
+ lines.push(Object.entries(options).sort(([a], [b]) => {
1516
+ if (options[a].short && !options[b].short) return -1;
1517
+ if (!options[a].short && options[b].short) return 1;
1518
+ if (options[a].short && options[b].short) return options[a].short.localeCompare(options[b].short);
1519
+ return a.localeCompare(b);
1520
+ }).map(([option, { type, short, hint, description }]) => {
1518
1521
  let optionStr = ` --${option} `;
1519
1522
  option = camelCaseToKebabCase(option);
1520
1523
  if (short) optionStr += `-${short}, `;
1521
1524
  if (type === "string") optionStr += `<${hint ?? option}>`;
1522
- if (description$1 && description$1.length > 0) description$1 = description$1[0].toUpperCase() + description$1.slice(1);
1523
- return styleText$1("cyan", optionStr.padEnd(30)) + description$1 + (description$1 && description$1?.endsWith(".") ? "" : ".");
1525
+ if (description && description.length > 0) description = description[0].toUpperCase() + description.slice(1);
1526
+ return styleText$1("cyan", optionStr.padEnd(30)) + description + (description && description?.endsWith(".") ? "" : ".");
1524
1527
  }).join("\n"));
1525
- logger.log("");
1526
- logger.log(`${styleText$1(["bold", "underline"], "EXAMPLES")}`);
1527
- logger.log("");
1528
+ lines.push("");
1529
+ lines.push(`${styleText$1(["bold", "underline"], "EXAMPLES")}`);
1530
+ lines.push("");
1528
1531
  examples.forEach(({ title, command }, ord) => {
1529
- logger.log(` ${ord + 1}. ${title}:`);
1530
- logger.log(` ${styleText$1("cyan", command)}`);
1531
- logger.log("");
1532
+ lines.push(` ${ord + 1}. ${title}:`);
1533
+ lines.push(` ${styleText$1("cyan", command)}`);
1534
+ lines.push("");
1532
1535
  });
1533
- logger.log(`${styleText$1(["bold", "underline"], "NOTES")}`);
1534
- logger.log("");
1536
+ lines.push(`${styleText$1(["bold", "underline"], "NOTES")}`);
1537
+ lines.push("");
1535
1538
  notes.forEach((note) => {
1536
- logger.log(` * ${styleText$1("gray", note)}`);
1539
+ lines.push(` * ${styleText$1("gray", note)}`);
1537
1540
  });
1541
+ return lines.join("\n");
1542
+ }
1543
+ function showHelp() {
1544
+ logger.log(generateHelpText());
1538
1545
  }
1539
1546
 
1540
1547
  //#endregion
package/dist/config.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import "./shared/binding-C9YdqoUG.mjs";
2
- import { r as defineConfig, t as ConfigExport } from "./shared/define-config-glNgjHCc.mjs";
1
+ import "./shared/binding-B92Lq__Q.mjs";
2
+ import { r as defineConfig, t as ConfigExport } from "./shared/define-config-D8xP5iyL.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,11 +1,11 @@
1
- import "./shared/binding-uOeDeDzp.mjs";
2
- import "./shared/normalize-string-or-regex-0f6WITto.mjs";
3
- import { w as version } from "./shared/bindingify-input-options-CuBDHglZ.mjs";
4
- import "./shared/rolldown-build-BqHWBpp7.mjs";
5
- import "./shared/parse-ast-index-B0iVLbj6.mjs";
6
- import "./shared/rolldown-mAJGca5O.mjs";
7
- import { t as defineConfig } from "./shared/define-config-BF4P-Pum.mjs";
8
- import { t as loadConfig } from "./shared/load-config-Bo3y98vw.mjs";
1
+ import "./shared/binding-tNJoEqAa.mjs";
2
+ import "./shared/normalize-string-or-regex-DeB7vQ75.mjs";
3
+ import { w as version } from "./shared/bindingify-input-options-CfhrNd_y.mjs";
4
+ import "./shared/rolldown-build-DWeKtJOy.mjs";
5
+ import "./shared/parse-ast-index-BcP4Ts_P.mjs";
6
+ import "./shared/rolldown-BMzJcmQ7.mjs";
7
+ import { t as defineConfig } from "./shared/define-config-BVG4QvnP.mjs";
8
+ import { t as loadConfig } from "./shared/load-config-Qtd9pHJ5.mjs";
9
9
 
10
10
  //#region src/config.ts
11
11
  const VERSION = version;
@@ -1,6 +1,6 @@
1
- import { A as MinifyResult, B as isolatedDeclaration, D as IsolatedDeclarationsResult, E as IsolatedDeclarationsOptions, F as ResolveResult, G as transform, H as minify, I as ResolverFactory, K as transformSync, L as TransformOptions, M as ParseResult, N as ParserOptions, R as TransformResult, U as minifySync, V as isolatedDeclarationSync, W as moduleRunnerTransform, c as BindingRebuildStrategy, g as BindingViteManifestPluginConfig, j as NapiResolveOptions, k as MinifyOptions, n as BindingBundleState, r as BindingClientHmrUpdate, x as BindingViteTransformPluginConfig, z as createTokioRuntime } from "./shared/binding-C9YdqoUG.mjs";
2
- import { Et as OutputOptions, Ft as RolldownOutput, G as defineParallelPlugin, Lt as freeExternalMemory, M as BuiltinPlugin, c as InputOptions, nt as NormalizedOutputOptions } from "./shared/define-config-glNgjHCc.mjs";
3
- import { a as viteImportGlobPlugin, c as viteModulePreloadPolyfillPlugin, d as viteResolvePlugin, f as viteWasmFallbackPlugin, i as viteDynamicImportVarsPlugin, l as viteReactRefreshWrapperPlugin, m as viteWebWorkerPostPlugin, n as isolatedDeclarationPlugin, o as viteJsonPlugin, p as viteWasmHelperPlugin, r as viteBuildImportAnalysisPlugin, s as viteLoadFallbackPlugin, u as viteReporterPlugin } from "./shared/constructors-D9F4Aj4h.mjs";
1
+ import { A as MinifyResult, B as isolatedDeclaration, D as IsolatedDeclarationsResult, E as IsolatedDeclarationsOptions, F as ResolveResult, G as transform, H as minify, I as ResolverFactory, K as transformSync, L as TransformOptions, M as ParseResult, N as ParserOptions, R as TransformResult, S as BindingViteTransformPluginConfig, U as minifySync, V as isolatedDeclarationSync, W as moduleRunnerTransform, _ as BindingViteManifestPluginConfig, j as NapiResolveOptions, k as MinifyOptions, l as BindingRebuildStrategy, n as BindingBundleState, r as BindingClientHmrUpdate, z as createTokioRuntime } from "./shared/binding-B92Lq__Q.mjs";
2
+ import { M as BuiltinPlugin, Mt as OutputOptions, Ut as freeExternalMemory, Vt as RolldownOutput, c as InputOptions, it as NormalizedOutputOptions, q as defineParallelPlugin } from "./shared/define-config-D8xP5iyL.mjs";
3
+ import { a as viteImportGlobPlugin, c as viteModulePreloadPolyfillPlugin, d as viteResolvePlugin, f as viteWasmFallbackPlugin, i as viteDynamicImportVarsPlugin, l as viteReactRefreshWrapperPlugin, m as viteWebWorkerPostPlugin, n as isolatedDeclarationPlugin, o as viteJsonPlugin, p as viteWasmHelperPlugin, r as viteBuildImportAnalysisPlugin, s as viteLoadFallbackPlugin, u as viteReporterPlugin } from "./shared/constructors--k1uxZrh.mjs";
4
4
 
5
5
  //#region src/api/dev/dev-options.d.ts
6
6
  type DevOnHmrUpdates = (result: Error | {
@@ -10,54 +10,54 @@ type DevOnHmrUpdates = (result: Error | {
10
10
  type DevOnOutput = (result: Error | RolldownOutput) => void | Promise<void>;
11
11
  interface DevWatchOptions {
12
12
  /**
13
- * If `true`, files are not written to disk.
14
- * @default false
15
- */
13
+ * If `true`, files are not written to disk.
14
+ * @default false
15
+ */
16
16
  skipWrite?: boolean;
17
17
  /**
18
- * If `true`, use polling instead of native file system events for watching.
19
- * @default false
20
- */
18
+ * If `true`, use polling instead of native file system events for watching.
19
+ * @default false
20
+ */
21
21
  usePolling?: boolean;
22
22
  /**
23
- * Poll interval in milliseconds (only used when usePolling is true).
24
- * @default 100
25
- */
23
+ * Poll interval in milliseconds (only used when usePolling is true).
24
+ * @default 100
25
+ */
26
26
  pollInterval?: number;
27
27
  /**
28
- * If `true`, use debounced watcher. If `false`, use non-debounced watcher for immediate responses.
29
- * @default true
30
- */
28
+ * If `true`, use debounced watcher. If `false`, use non-debounced watcher for immediate responses.
29
+ * @default true
30
+ */
31
31
  useDebounce?: boolean;
32
32
  /**
33
- * Debounce duration in milliseconds (only used when useDebounce is true).
34
- * @default 10
35
- */
33
+ * Debounce duration in milliseconds (only used when useDebounce is true).
34
+ * @default 10
35
+ */
36
36
  debounceDuration?: number;
37
37
  /**
38
- * Whether to compare file contents for poll-based watchers (only used when usePolling is true).
39
- * When enabled, poll watchers will check file contents to determine if they actually changed.
40
- * @default false
41
- */
38
+ * Whether to compare file contents for poll-based watchers (only used when usePolling is true).
39
+ * When enabled, poll watchers will check file contents to determine if they actually changed.
40
+ * @default false
41
+ */
42
42
  compareContentsForPolling?: boolean;
43
43
  /**
44
- * Tick rate in milliseconds for debounced watchers (only used when useDebounce is true).
45
- * Controls how frequently the debouncer checks for events to process.
46
- * When not specified, the debouncer will auto-select an appropriate tick rate (1/4 of the debounce duration).
47
- * @default undefined (auto-select)
48
- */
44
+ * Tick rate in milliseconds for debounced watchers (only used when useDebounce is true).
45
+ * Controls how frequently the debouncer checks for events to process.
46
+ * When not specified, the debouncer will auto-select an appropriate tick rate (1/4 of the debounce duration).
47
+ * @default undefined (auto-select)
48
+ */
49
49
  debounceTickRate?: number;
50
50
  }
51
51
  interface DevOptions {
52
52
  onHmrUpdates?: DevOnHmrUpdates;
53
53
  onOutput?: DevOnOutput;
54
54
  /**
55
- * Strategy for triggering rebuilds after HMR updates.
56
- * - `'always'`: Always trigger a rebuild after HMR updates
57
- * - `'auto'`: Trigger rebuild only if HMR updates contain full reload updates
58
- * - `'never'`: Never trigger rebuild after HMR updates (default)
59
- * @default 'auto'
60
- */
55
+ * Strategy for triggering rebuilds after HMR updates.
56
+ * - `'always'`: Always trigger a rebuild after HMR updates
57
+ * - `'auto'`: Trigger rebuild only if HMR updates contain full reload updates
58
+ * - `'never'`: Never trigger rebuild after HMR updates (default)
59
+ * @default 'auto'
60
+ */
61
61
  rebuildStrategy?: "always" | "auto" | "never";
62
62
  watch?: DevWatchOptions;
63
63
  }
@@ -76,16 +76,16 @@ declare class DevEngine {
76
76
  removeClient(clientId: string): Promise<void>;
77
77
  close(): Promise<void>;
78
78
  /**
79
- * Compile a lazy entry module and return HMR-style patch code.
80
- *
81
- * This is called when a dynamically imported module is first requested at runtime.
82
- * The module was previously stubbed with a proxy, and now we need to compile the
83
- * actual module and its dependencies.
84
- *
85
- * @param moduleId - The absolute file path of the module to compile
86
- * @param clientId - The client ID requesting this compilation
87
- * @returns The compiled JavaScript code as a string (HMR patch format)
88
- */
79
+ * Compile a lazy entry module and return HMR-style patch code.
80
+ *
81
+ * This is called when a dynamically imported module is first requested at runtime.
82
+ * The module was previously stubbed with a proxy, and now we need to compile the
83
+ * actual module and its dependencies.
84
+ *
85
+ * @param moduleId - The absolute file path of the module to compile
86
+ * @param clientId - The client ID requesting this compilation
87
+ * @returns The compiled JavaScript code as a string (HMR patch format)
88
+ */
89
89
  compileEntry(moduleId: string, clientId: string): Promise<string>;
90
90
  }
91
91
  //#endregion
@@ -1,9 +1,9 @@
1
- import { n as __toESM, t as require_binding } from "./shared/binding-uOeDeDzp.mjs";
2
- import { n as BuiltinPlugin, t as normalizedStringOrRegex } from "./shared/normalize-string-or-regex-0f6WITto.mjs";
3
- import { c as transformToRollupOutput, o as normalizeBindingResult, s as unwrapBindingResult } from "./shared/bindingify-input-options-CuBDHglZ.mjs";
4
- import { l as PluginDriver, n as createBundlerOptions, s as validateOption, t as RolldownBuild } from "./shared/rolldown-build-BqHWBpp7.mjs";
5
- import { i as parseSync, r as parse } from "./shared/parse-ast-index-B0iVLbj6.mjs";
6
- import { a as viteImportGlobPlugin, c as viteModulePreloadPolyfillPlugin, d as viteResolvePlugin, f as viteWasmFallbackPlugin, i as viteDynamicImportVarsPlugin, l as viteReactRefreshWrapperPlugin, m as viteWebWorkerPostPlugin, n as isolatedDeclarationPlugin, o as viteJsonPlugin, p as viteWasmHelperPlugin, r as viteBuildImportAnalysisPlugin, s as viteLoadFallbackPlugin, u as viteReporterPlugin } from "./shared/constructors-DmSv3tnW.mjs";
1
+ import { n as __toESM, t as require_binding } from "./shared/binding-tNJoEqAa.mjs";
2
+ import { n as BuiltinPlugin, t as normalizedStringOrRegex } from "./shared/normalize-string-or-regex-DeB7vQ75.mjs";
3
+ import { c as transformToRollupOutput, o as normalizeBindingResult, s as unwrapBindingResult } from "./shared/bindingify-input-options-CfhrNd_y.mjs";
4
+ import { l as PluginDriver, n as createBundlerOptions, s as validateOption, t as RolldownBuild } from "./shared/rolldown-build-DWeKtJOy.mjs";
5
+ import { i as parseSync, r as parse } from "./shared/parse-ast-index-BcP4Ts_P.mjs";
6
+ import { a as viteImportGlobPlugin, c as viteModulePreloadPolyfillPlugin, d as viteResolvePlugin, f as viteWasmFallbackPlugin, i as viteDynamicImportVarsPlugin, l as viteReactRefreshWrapperPlugin, m as viteWebWorkerPostPlugin, n as isolatedDeclarationPlugin, o as viteJsonPlugin, p as viteWasmHelperPlugin, r as viteBuildImportAnalysisPlugin, s as viteLoadFallbackPlugin, u as viteReporterPlugin } from "./shared/constructors-414MPkgB.mjs";
7
7
  import { pathToFileURL } from "node:url";
8
8
 
9
9
  //#region src/api/dev/dev-engine.ts