@rolldown/browser 1.0.0-rc.9 → 1.0.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 (48) hide show
  1. package/dist/cli.mjs +208 -73
  2. package/dist/config.d.mts +1 -1
  3. package/dist/config.mjs +2 -7
  4. package/dist/{constructors-BgL_dmUe.js → constructors-BTLtc_G_.js} +11 -2
  5. package/dist/{error-DkAP_6fk.js → error-CIj5jXSo.js} +1 -1
  6. package/dist/experimental-index.browser.mjs +10 -10
  7. package/dist/experimental-index.d.mts +17 -19
  8. package/dist/experimental-index.mjs +11 -11
  9. package/dist/experimental-runtime-types.d.ts +14 -5
  10. package/dist/filter-index.d.mts +3 -3
  11. package/dist/filter-index.mjs +3 -3
  12. package/dist/index.browser.mjs +4 -4
  13. package/dist/index.d.mts +4 -3
  14. package/dist/index.mjs +4 -8
  15. package/dist/{normalize-string-or-regex-TtAGUp42.js → normalize-string-or-regex-CBPw_c5O.js} +21 -11
  16. package/dist/parallel-plugin-worker.mjs +1 -4
  17. package/dist/parallel-plugin.d.mts +2 -2
  18. package/dist/parse-ast-index.d.mts +1 -2
  19. package/dist/parse-ast-index.mjs +1 -1
  20. package/dist/plugins-index.browser.mjs +2 -2
  21. package/dist/plugins-index.d.mts +3 -3
  22. package/dist/plugins-index.mjs +2 -2
  23. package/dist/{transform-UkHb5h4g.js → resolve-tsconfig-uVC8K7GR.js} +28 -5
  24. package/dist/rolldown-binding.wasi-browser.js +6 -0
  25. package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
  26. package/dist/{rolldown-build-sRmdtwRU.js → rolldown-build-DCjXbOeh.js} +242 -210
  27. package/dist/shared/binding-CaVxb0SV.d.mts +3198 -0
  28. package/dist/shared/{bindingify-input-options-Cfptl9gw.mjs → bindingify-input-options-C7dl2XLe.mjs} +126 -58
  29. package/dist/shared/{composable-filters-B2ByPP8y.mjs → composable-filters-DpWB82jk.mjs} +2 -2
  30. package/dist/shared/{constructors-C1tQjDsj.d.mts → constructors-B1JYJxhf.d.mts} +7 -3
  31. package/dist/shared/{constructors-C7Kkidxk.mjs → constructors-CI_8FAaP.mjs} +11 -2
  32. package/dist/shared/{define-config-B1J71V4c.d.mts → define-config-CYgMQYTy.d.mts} +131 -39
  33. package/dist/shared/{load-config-B6MMusXN.mjs → load-config-BFkorvIR.mjs} +1 -1
  34. package/dist/shared/{normalize-string-or-regex-CF3Uz6aU.mjs → normalize-string-or-regex-Dq6w-2tU.mjs} +21 -11
  35. package/dist/shared/{parse-DDUnGYGU.mjs → parse-Bmk53Le1.mjs} +1 -1
  36. package/dist/shared/{prompt-BYQIwEjg.mjs → prompt-U5ajztzG.mjs} +4 -2
  37. package/dist/shared/{transform-B_n5An0U.mjs → resolve-tsconfig-Cwoo4h_o.mjs} +27 -4
  38. package/dist/shared/{rolldown-BDqeiCX1.mjs → rolldown-Dyy9Y2li.mjs} +1 -1
  39. package/dist/shared/{rolldown-build-DZ7tJkeQ.mjs → rolldown-build-DYE2Qi6z.mjs} +120 -156
  40. package/dist/shared/{transform-BSAGL1b_.d.mts → transform-kP3ISMFT.d.mts} +30 -13
  41. package/dist/shared/{utils-6wxe_LMG.d.mts → utils-KRVeJqya.d.mts} +1 -1
  42. package/dist/shared/{watch-Cj4uDLQX.mjs → watch-DXAEaxPd.mjs} +3 -3
  43. package/dist/utils-index.browser.mjs +5 -5
  44. package/dist/utils-index.d.mts +4 -4
  45. package/dist/utils-index.mjs +5 -6
  46. package/dist/wasi-worker-browser.mjs +8 -0
  47. package/package.json +4 -2
  48. package/dist/shared/types-Cx3HYorz.d.mts +0 -1302
package/dist/cli.mjs CHANGED
@@ -1,17 +1,13 @@
1
- import { n as onExit, t as watch } from "./shared/watch-Cj4uDLQX.mjs";
2
- import "./shared/normalize-string-or-regex-CF3Uz6aU.mjs";
3
- import { C as version, S as description } from "./shared/bindingify-input-options-Cfptl9gw.mjs";
4
- import { h as arraify } from "./shared/composable-filters-B2ByPP8y.mjs";
5
- import { a as getInputCliKeys, i as getCliSchemaInfo, l as styleText, o as getOutputCliKeys, r as logger, s as validateCliOptions } from "./shared/rolldown-build-DZ7tJkeQ.mjs";
6
- import "./shared/error-CQ6njWsV.mjs";
7
- import "./shared/parse-DDUnGYGU.mjs";
8
- import { t as rolldown } from "./shared/rolldown-BDqeiCX1.mjs";
9
- import { t as loadConfig } from "./shared/load-config-B6MMusXN.mjs";
1
+ import { n as onExit, t as watch } from "./shared/watch-DXAEaxPd.mjs";
2
+ import { C as version, S as description } from "./shared/bindingify-input-options-C7dl2XLe.mjs";
3
+ import { h as arraify } from "./shared/composable-filters-DpWB82jk.mjs";
4
+ import { a as getInputCliKeys, i as getCliSchemaInfo, l as styleText, o as getOutputCliKeys, r as logger, s as validateCliOptions } from "./shared/rolldown-build-DYE2Qi6z.mjs";
5
+ import { t as rolldown } from "./shared/rolldown-Dyy9Y2li.mjs";
6
+ import { t as loadConfig } from "./shared/load-config-BFkorvIR.mjs";
10
7
  import path from "node:path";
11
8
  import process$1 from "node:process";
12
- import { EventEmitter } from "events";
13
9
  import { performance } from "node:perf_hooks";
14
- //#region ../../node_modules/.pnpm/cac@6.7.14/node_modules/cac/dist/index.mjs
10
+ //#region ../../node_modules/.pnpm/cac@7.0.0/node_modules/cac/dist/index.js
15
11
  function toArr(any) {
16
12
  return any == null ? [] : Array.isArray(any) ? any : [any];
17
13
  }
@@ -19,7 +15,7 @@ function toVal(out, key, val, opts) {
19
15
  var x, old = out[key], nxt = !!~opts.string.indexOf(key) ? val == null || val === true ? "" : String(val) : typeof val === "boolean" ? val : !!~opts.boolean.indexOf(key) ? val === "false" ? false : val === "true" || (out._.push((x = +val, x * 0 === 0) ? x : val), !!val) : (x = +val, x * 0 === 0) ? x : val;
20
16
  out[key] = old == null ? nxt : Array.isArray(old) ? old.concat(nxt) : [old, nxt];
21
17
  }
22
- function mri2(args, opts) {
18
+ function lib_default(args, opts) {
23
19
  args = args || [];
24
20
  opts = opts || {};
25
21
  var k, arr, arg, name, val, out = { _: [] };
@@ -84,8 +80,10 @@ function mri2(args, opts) {
84
80
  }
85
81
  return out;
86
82
  }
87
- const removeBrackets = (v) => v.replace(/[<[].+/, "").trim();
88
- const findAllBrackets = (v) => {
83
+ function removeBrackets(v) {
84
+ return v.replace(/[<[].+/, "").trim();
85
+ }
86
+ function findAllBrackets(v) {
89
87
  const ANGLED_BRACKET_RE_GLOBAL = /<([^>]+)>/g;
90
88
  const SQUARE_BRACKET_RE_GLOBAL = /\[([^\]]+)\]/g;
91
89
  const res = [];
@@ -107,8 +105,8 @@ const findAllBrackets = (v) => {
107
105
  let squareMatch;
108
106
  while (squareMatch = SQUARE_BRACKET_RE_GLOBAL.exec(v)) res.push(parse(squareMatch));
109
107
  return res;
110
- };
111
- const getMriOptions = (options) => {
108
+ }
109
+ function getMriOptions(options) {
112
110
  const result = {
113
111
  alias: {},
114
112
  boolean: []
@@ -122,62 +120,76 @@ const getMriOptions = (options) => {
122
120
  } else result.boolean.push(option.names[0]);
123
121
  }
124
122
  return result;
125
- };
126
- const findLongest = (arr) => {
123
+ }
124
+ function findLongest(arr) {
127
125
  return arr.sort((a, b) => {
128
126
  return a.length > b.length ? -1 : 1;
129
127
  })[0];
130
- };
131
- const padRight = (str, length) => {
128
+ }
129
+ function padRight(str, length) {
132
130
  return str.length >= length ? str : `${str}${" ".repeat(length - str.length)}`;
133
- };
134
- const camelcase = (input) => {
135
- return input.replace(/([a-z])-([a-z])/g, (_, p1, p2) => {
131
+ }
132
+ function camelcase(input) {
133
+ return input.replaceAll(/([a-z])-([a-z])/g, (_, p1, p2) => {
136
134
  return p1 + p2.toUpperCase();
137
135
  });
138
- };
139
- const setDotProp = (obj, keys, val) => {
140
- let i = 0;
141
- let length = keys.length;
142
- let t = obj;
143
- let x;
144
- for (; i < length; ++i) {
145
- x = t[keys[i]];
146
- t = t[keys[i]] = i === length - 1 ? val : x != null ? x : !!~keys[i + 1].indexOf(".") || !(+keys[i + 1] > -1) ? {} : [];
136
+ }
137
+ function setDotProp(obj, keys, val) {
138
+ let current = obj;
139
+ for (let i = 0; i < keys.length; i++) {
140
+ const key = keys[i];
141
+ if (i === keys.length - 1) {
142
+ current[key] = val;
143
+ return;
144
+ }
145
+ if (current[key] == null) {
146
+ const nextKeyIsArrayIndex = +keys[i + 1] > -1;
147
+ current[key] = nextKeyIsArrayIndex ? [] : {};
148
+ }
149
+ current = current[key];
147
150
  }
148
- };
149
- const setByType = (obj, transforms) => {
151
+ }
152
+ function setByType(obj, transforms) {
150
153
  for (const key of Object.keys(transforms)) {
151
154
  const transform = transforms[key];
152
155
  if (transform.shouldTransform) {
153
- obj[key] = Array.prototype.concat.call([], obj[key]);
156
+ obj[key] = [obj[key]].flat();
154
157
  if (typeof transform.transformFunction === "function") obj[key] = obj[key].map(transform.transformFunction);
155
158
  }
156
159
  }
157
- };
158
- const getFileName = (input) => {
159
- const m = /([^\\\/]+)$/.exec(input);
160
+ }
161
+ function getFileName(input) {
162
+ const m = /([^\\/]+)$/.exec(input);
160
163
  return m ? m[1] : "";
161
- };
162
- const camelcaseOptionName = (name) => {
164
+ }
165
+ function camelcaseOptionName(name) {
163
166
  return name.split(".").map((v, i) => {
164
167
  return i === 0 ? camelcase(v) : v;
165
168
  }).join(".");
166
- };
169
+ }
167
170
  var CACError = class extends Error {
168
171
  constructor(message) {
169
172
  super(message);
170
- this.name = this.constructor.name;
171
- if (typeof Error.captureStackTrace === "function") Error.captureStackTrace(this, this.constructor);
172
- else this.stack = new Error(message).stack;
173
+ this.name = "CACError";
174
+ if (typeof Error.captureStackTrace !== "function") this.stack = new Error(message).stack;
173
175
  }
174
176
  };
175
177
  var Option = class {
178
+ rawName;
179
+ description;
180
+ /** Option name */
181
+ name;
182
+ /** Option name and aliases */
183
+ names;
184
+ isBoolean;
185
+ required;
186
+ config;
187
+ negated;
176
188
  constructor(rawName, description, config) {
177
189
  this.rawName = rawName;
178
190
  this.description = description;
179
191
  this.config = Object.assign({}, config);
180
- rawName = rawName.replace(/\.\*/g, "");
192
+ rawName = rawName.replaceAll(".*", "");
181
193
  this.negated = false;
182
194
  this.names = removeBrackets(rawName).split(",").map((v) => {
183
195
  let name = v.trim().replace(/^-{1,2}/, "");
@@ -187,16 +199,39 @@ var Option = class {
187
199
  }
188
200
  return camelcaseOptionName(name);
189
201
  }).sort((a, b) => a.length > b.length ? 1 : -1);
190
- this.name = this.names[this.names.length - 1];
202
+ this.name = this.names.at(-1);
191
203
  if (this.negated && this.config.default == null) this.config.default = true;
192
204
  if (rawName.includes("<")) this.required = true;
193
205
  else if (rawName.includes("[")) this.required = false;
194
206
  else this.isBoolean = true;
195
207
  }
196
208
  };
197
- const processArgs = process.argv;
198
- const platformInfo = `${process.platform}-${process.arch} node-${process.version}`;
209
+ let runtimeProcessArgs;
210
+ let runtimeInfo;
211
+ if (typeof process !== "undefined") {
212
+ let runtimeName;
213
+ if (typeof Deno !== "undefined" && typeof Deno.version?.deno === "string") runtimeName = "deno";
214
+ else if (typeof Bun !== "undefined" && typeof Bun.version === "string") runtimeName = "bun";
215
+ else runtimeName = "node";
216
+ runtimeInfo = `${process.platform}-${process.arch} ${runtimeName}-${process.version}`;
217
+ runtimeProcessArgs = process.argv;
218
+ } else if (typeof navigator === "undefined") runtimeInfo = `unknown`;
219
+ else runtimeInfo = `${navigator.platform} ${navigator.userAgent}`;
199
220
  var Command = class {
221
+ rawName;
222
+ description;
223
+ config;
224
+ cli;
225
+ options;
226
+ aliasNames;
227
+ name;
228
+ args;
229
+ commandAction;
230
+ usageText;
231
+ versionNumber;
232
+ examples;
233
+ helpCallback;
234
+ globalCommand;
200
235
  constructor(rawName, description, config = {}, cli) {
201
236
  this.rawName = rawName;
202
237
  this.description = description;
@@ -229,6 +264,12 @@ var Command = class {
229
264
  this.examples.push(example);
230
265
  return this;
231
266
  }
267
+ /**
268
+ * Add a option for this command
269
+ * @param rawName Raw option name(s)
270
+ * @param description Option description
271
+ * @param config Option config
272
+ */
232
273
  option(rawName, description, config) {
233
274
  const option = new Option(rawName, description, config);
234
275
  this.options.push(option);
@@ -242,6 +283,10 @@ var Command = class {
242
283
  this.commandAction = callback;
243
284
  return this;
244
285
  }
286
+ /**
287
+ * Check if a command name is matched by this command
288
+ * @param name Command name
289
+ */
245
290
  isMatched(name) {
246
291
  return this.name === name || this.aliasNames.includes(name);
247
292
  }
@@ -251,6 +296,10 @@ var Command = class {
251
296
  get isGlobalCommand() {
252
297
  return this instanceof GlobalCommand;
253
298
  }
299
+ /**
300
+ * Check if an option is registered in this command
301
+ * @param name Option name
302
+ */
254
303
  hasOption(name) {
255
304
  name = name.split(".")[0];
256
305
  return this.options.find((option) => {
@@ -272,8 +321,7 @@ var Command = class {
272
321
  body: commands.map((command) => {
273
322
  return ` ${padRight(command.rawName, longestCommandName.length)} ${command.description}`;
274
323
  }).join("\n")
275
- });
276
- sections.push({
324
+ }, {
277
325
  title: `For more info, run any command with the \`--help\` flag`,
278
326
  body: commands.map((command) => ` $ ${name}${command.name === "" ? "" : ` ${command.name}`} --help`).join("\n")
279
327
  });
@@ -297,26 +345,33 @@ var Command = class {
297
345
  }).join("\n")
298
346
  });
299
347
  if (helpCallback) sections = helpCallback(sections) || sections;
300
- console.log(sections.map((section) => {
301
- return section.title ? `${section.title}:
302
- ${section.body}` : section.body;
348
+ console.info(sections.map((section) => {
349
+ return section.title ? `${section.title}:\n${section.body}` : section.body;
303
350
  }).join("\n\n"));
304
351
  }
305
352
  outputVersion() {
306
353
  const { name } = this.cli;
307
354
  const { versionNumber } = this.cli.globalCommand;
308
- if (versionNumber) console.log(`${name}/${versionNumber} ${platformInfo}`);
355
+ if (versionNumber) console.info(`${name}/${versionNumber} ${runtimeInfo}`);
309
356
  }
310
357
  checkRequiredArgs() {
311
358
  const minimalArgsCount = this.args.filter((arg) => arg.required).length;
312
359
  if (this.cli.args.length < minimalArgsCount) throw new CACError(`missing required args for command \`${this.rawName}\``);
313
360
  }
361
+ /**
362
+ * Check if the parsed options contain any unknown options
363
+ *
364
+ * Exit and output error when true
365
+ */
314
366
  checkUnknownOptions() {
315
367
  const { options, globalCommand } = this.cli;
316
368
  if (!this.config.allowUnknownOptions) {
317
369
  for (const name of Object.keys(options)) if (name !== "--" && !this.hasOption(name) && !globalCommand.hasOption(name)) throw new CACError(`Unknown option \`${name.length > 1 ? `--${name}` : `-${name}`}\``);
318
370
  }
319
371
  }
372
+ /**
373
+ * Check if the required string-type options exist
374
+ */
320
375
  checkOptionValue() {
321
376
  const { options: parsedOptions, globalCommand } = this.cli;
322
377
  const options = [...globalCommand.options, ...this.options];
@@ -328,14 +383,43 @@ ${section.body}` : section.body;
328
383
  }
329
384
  }
330
385
  }
386
+ /**
387
+ * Check if the number of args is more than expected
388
+ */
389
+ checkUnusedArgs() {
390
+ const maximumArgsCount = this.args.some((arg) => arg.variadic) ? Infinity : this.args.length;
391
+ if (maximumArgsCount < this.cli.args.length) throw new CACError(`Unused args: ${this.cli.args.slice(maximumArgsCount).map((arg) => `\`${arg}\``).join(", ")}`);
392
+ }
331
393
  };
332
394
  var GlobalCommand = class extends Command {
333
395
  constructor(cli) {
334
396
  super("@@global@@", "", {}, cli);
335
397
  }
336
398
  };
337
- var __assign = Object.assign;
338
- var CAC = class extends EventEmitter {
399
+ var CAC = class extends EventTarget {
400
+ /** The program name to display in help and version message */
401
+ name;
402
+ commands;
403
+ globalCommand;
404
+ matchedCommand;
405
+ matchedCommandName;
406
+ /**
407
+ * Raw CLI arguments
408
+ */
409
+ rawArgs;
410
+ /**
411
+ * Parsed CLI arguments
412
+ */
413
+ args;
414
+ /**
415
+ * Parsed CLI options, camelCased
416
+ */
417
+ options;
418
+ showHelpOnExit;
419
+ showVersionOnExit;
420
+ /**
421
+ * @param name The program name to display in help and version message
422
+ */
339
423
  constructor(name = "") {
340
424
  super();
341
425
  this.name = name;
@@ -346,39 +430,75 @@ var CAC = class extends EventEmitter {
346
430
  this.globalCommand = new GlobalCommand(this);
347
431
  this.globalCommand.usage("<command> [options]");
348
432
  }
433
+ /**
434
+ * Add a global usage text.
435
+ *
436
+ * This is not used by sub-commands.
437
+ */
349
438
  usage(text) {
350
439
  this.globalCommand.usage(text);
351
440
  return this;
352
441
  }
442
+ /**
443
+ * Add a sub-command
444
+ */
353
445
  command(rawName, description, config) {
354
446
  const command = new Command(rawName, description || "", config, this);
355
447
  command.globalCommand = this.globalCommand;
356
448
  this.commands.push(command);
357
449
  return command;
358
450
  }
451
+ /**
452
+ * Add a global CLI option.
453
+ *
454
+ * Which is also applied to sub-commands.
455
+ */
359
456
  option(rawName, description, config) {
360
457
  this.globalCommand.option(rawName, description, config);
361
458
  return this;
362
459
  }
460
+ /**
461
+ * Show help message when `-h, --help` flags appear.
462
+ *
463
+ */
363
464
  help(callback) {
364
465
  this.globalCommand.option("-h, --help", "Display this message");
365
466
  this.globalCommand.helpCallback = callback;
366
467
  this.showHelpOnExit = true;
367
468
  return this;
368
469
  }
470
+ /**
471
+ * Show version number when `-v, --version` flags appear.
472
+ *
473
+ */
369
474
  version(version, customFlags = "-v, --version") {
370
475
  this.globalCommand.version(version, customFlags);
371
476
  this.showVersionOnExit = true;
372
477
  return this;
373
478
  }
479
+ /**
480
+ * Add a global example.
481
+ *
482
+ * This example added here will not be used by sub-commands.
483
+ */
374
484
  example(example) {
375
485
  this.globalCommand.example(example);
376
486
  return this;
377
487
  }
488
+ /**
489
+ * Output the corresponding help message
490
+ * When a sub-command is matched, output the help message for the command
491
+ * Otherwise output the global one.
492
+ *
493
+ */
378
494
  outputHelp() {
379
495
  if (this.matchedCommand) this.matchedCommand.outputHelp();
380
496
  else this.globalCommand.outputHelp();
381
497
  }
498
+ /**
499
+ * Output the version number.
500
+ *
501
+ */
382
502
  outputVersion() {
383
503
  this.globalCommand.outputVersion();
384
504
  }
@@ -393,7 +513,14 @@ var CAC = class extends EventEmitter {
393
513
  this.matchedCommand = void 0;
394
514
  this.matchedCommandName = void 0;
395
515
  }
396
- parse(argv = processArgs, { run = true } = {}) {
516
+ /**
517
+ * Parse argv
518
+ */
519
+ parse(argv, { run = true } = {}) {
520
+ if (!argv) {
521
+ if (!runtimeProcessArgs) throw new Error("No argv provided and runtime process argv is not available.");
522
+ argv = runtimeProcessArgs;
523
+ }
397
524
  this.rawArgs = argv;
398
525
  if (!this.name) this.name = argv[1] ? getFileName(argv[1]) : "cli";
399
526
  let shouldParse = true;
@@ -402,17 +529,20 @@ var CAC = class extends EventEmitter {
402
529
  const commandName = parsed.args[0];
403
530
  if (command.isMatched(commandName)) {
404
531
  shouldParse = false;
405
- const parsedInfo = __assign(__assign({}, parsed), { args: parsed.args.slice(1) });
532
+ const parsedInfo = {
533
+ ...parsed,
534
+ args: parsed.args.slice(1)
535
+ };
406
536
  this.setParsedInfo(parsedInfo, command, commandName);
407
- this.emit(`command:${commandName}`, command);
537
+ this.dispatchEvent(new CustomEvent(`command:${commandName}`, { detail: command }));
408
538
  }
409
539
  }
410
540
  if (shouldParse) {
411
- for (const command of this.commands) if (command.name === "") {
541
+ for (const command of this.commands) if (command.isDefaultCommand) {
412
542
  shouldParse = false;
413
543
  const parsed = this.mri(argv.slice(2), command);
414
544
  this.setParsedInfo(parsed, command);
415
- this.emit(`command:!`, command);
545
+ this.dispatchEvent(new CustomEvent("command:!", { detail: command }));
416
546
  }
417
547
  }
418
548
  if (shouldParse) {
@@ -434,7 +564,7 @@ var CAC = class extends EventEmitter {
434
564
  options: this.options
435
565
  };
436
566
  if (run) this.runMatchedCommand();
437
- if (!this.matchedCommand && this.args[0]) this.emit("command:*");
567
+ if (!this.matchedCommand && this.args[0]) this.dispatchEvent(new CustomEvent("command:*", { detail: this.args[0] }));
438
568
  return parsedArgv;
439
569
  }
440
570
  mri(argv, command) {
@@ -442,26 +572,27 @@ var CAC = class extends EventEmitter {
442
572
  const mriOptions = getMriOptions(cliOptions);
443
573
  let argsAfterDoubleDashes = [];
444
574
  const doubleDashesIndex = argv.indexOf("--");
445
- if (doubleDashesIndex > -1) {
575
+ if (doubleDashesIndex !== -1) {
446
576
  argsAfterDoubleDashes = argv.slice(doubleDashesIndex + 1);
447
577
  argv = argv.slice(0, doubleDashesIndex);
448
578
  }
449
- let parsed = mri2(argv, mriOptions);
579
+ let parsed = lib_default(argv, mriOptions);
450
580
  parsed = Object.keys(parsed).reduce((res, name) => {
451
- return __assign(__assign({}, res), { [camelcaseOptionName(name)]: parsed[name] });
581
+ return {
582
+ ...res,
583
+ [camelcaseOptionName(name)]: parsed[name]
584
+ };
452
585
  }, { _: [] });
453
586
  const args = parsed._;
454
587
  const options = { "--": argsAfterDoubleDashes };
455
588
  const ignoreDefault = command && command.config.ignoreOptionDefaultValue ? command.config.ignoreOptionDefaultValue : this.globalCommand.config.ignoreOptionDefaultValue;
456
- let transforms = Object.create(null);
589
+ const transforms = Object.create(null);
457
590
  for (const cliOption of cliOptions) {
458
591
  if (!ignoreDefault && cliOption.config.default !== void 0) for (const name of cliOption.names) options[name] = cliOption.config.default;
459
- if (Array.isArray(cliOption.config.type)) {
460
- if (transforms[cliOption.name] === void 0) {
461
- transforms[cliOption.name] = Object.create(null);
462
- transforms[cliOption.name]["shouldTransform"] = true;
463
- transforms[cliOption.name]["transformFunction"] = cliOption.config.type[0];
464
- }
592
+ if (Array.isArray(cliOption.config.type) && transforms[cliOption.name] === void 0) {
593
+ transforms[cliOption.name] = Object.create(null);
594
+ transforms[cliOption.name].shouldTransform = true;
595
+ transforms[cliOption.name].transformFunction = cliOption.config.type[0];
465
596
  }
466
597
  }
467
598
  for (const key of Object.keys(parsed)) if (key !== "_") {
@@ -479,6 +610,7 @@ var CAC = class extends EventEmitter {
479
610
  command.checkUnknownOptions();
480
611
  command.checkOptionValue();
481
612
  command.checkRequiredArgs();
613
+ command.checkUnusedArgs();
482
614
  const actionArgs = [];
483
615
  command.args.forEach((arg, index) => {
484
616
  if (arg.variadic) actionArgs.push(args.slice(index));
@@ -488,6 +620,9 @@ var CAC = class extends EventEmitter {
488
620
  return command.commandAction.apply(this, actionArgs);
489
621
  }
490
622
  };
623
+ /**
624
+ * @param name The program name to display in help and version message
625
+ */
491
626
  const cac = (name = "") => new CAC(name);
492
627
  //#endregion
493
628
  //#region src/cli/arguments/alias.ts
@@ -712,7 +847,7 @@ function getClearScreenFunction(options) {
712
847
  };
713
848
  }
714
849
  //#endregion
715
- //#region \0@oxc-project+runtime@0.115.0/helpers/usingCtx.js
850
+ //#region \0@oxc-project+runtime@0.130.0/helpers/usingCtx.js
716
851
  function _usingCtx() {
717
852
  var r = "function" == typeof SuppressedError ? SuppressedError : function(r, e) {
718
853
  var n = Error();
package/dist/config.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as VERSION, r as defineConfig, t as ConfigExport } from "./shared/define-config-B1J71V4c.mjs";
1
+ import { $ as VERSION, r as defineConfig, t as ConfigExport } from "./shared/define-config-CYgMQYTy.mjs";
2
2
 
3
3
  //#region src/utils/load-config.d.ts
4
4
  /**
package/dist/config.mjs CHANGED
@@ -1,9 +1,4 @@
1
- import "./shared/normalize-string-or-regex-CF3Uz6aU.mjs";
2
- import { x as VERSION } from "./shared/bindingify-input-options-Cfptl9gw.mjs";
3
- import "./shared/rolldown-build-DZ7tJkeQ.mjs";
4
- import "./shared/error-CQ6njWsV.mjs";
5
- import "./shared/parse-DDUnGYGU.mjs";
6
- import "./shared/rolldown-BDqeiCX1.mjs";
1
+ import { x as VERSION } from "./shared/bindingify-input-options-C7dl2XLe.mjs";
7
2
  import { t as defineConfig } from "./shared/define-config-DJOr6Iwt.mjs";
8
- import { t as loadConfig } from "./shared/load-config-B6MMusXN.mjs";
3
+ import { t as loadConfig } from "./shared/load-config-BFkorvIR.mjs";
9
4
  export { VERSION, defineConfig, loadConfig };
@@ -1,4 +1,4 @@
1
- import { a as makeBuiltinPluginCallable, n as BuiltinPlugin, t as normalizedStringOrRegex } from "./normalize-string-or-regex-TtAGUp42.js";
1
+ import { a as makeBuiltinPluginCallable, n as BuiltinPlugin, t as normalizedStringOrRegex } from "./normalize-string-or-regex-CBPw_c5O.js";
2
2
  //#region src/builtin-plugin/constructors.ts
3
3
  function viteModulePreloadPolyfillPlugin(config) {
4
4
  return new BuiltinPlugin("builtin:vite-module-preload-polyfill", config);
@@ -31,6 +31,9 @@ function viteBuildImportAnalysisPlugin(config) {
31
31
  function viteResolvePlugin(config) {
32
32
  return makeBuiltinPluginCallable(new BuiltinPlugin("builtin:vite-resolve", {
33
33
  ...config,
34
+ async resolveSubpathImports(id, importer, isRequire, scan) {
35
+ return config.resolveSubpathImports(id, importer, isRequire, scan);
36
+ },
34
37
  yarnPnp: typeof process === "object" && !!process.versions?.pnp
35
38
  }));
36
39
  }
@@ -51,6 +54,12 @@ function esmExternalRequirePlugin(config) {
51
54
  plugin.enforce = "pre";
52
55
  return plugin;
53
56
  }
57
+ /**
58
+ * This plugin should not be used for Rolldown.
59
+ */
60
+ function oxcRuntimePlugin() {
61
+ return makeBuiltinPluginCallable(new BuiltinPlugin("builtin:oxc-runtime"));
62
+ }
54
63
  function viteReactRefreshWrapperPlugin(config) {
55
64
  if (config) {
56
65
  config.include = normalizedStringOrRegex(config.include);
@@ -59,4 +68,4 @@ function viteReactRefreshWrapperPlugin(config) {
59
68
  return makeBuiltinPluginCallable(new BuiltinPlugin("builtin:vite-react-refresh-wrapper", config));
60
69
  }
61
70
  //#endregion
62
- export { viteImportGlobPlugin as a, viteModulePreloadPolyfillPlugin as c, viteResolvePlugin as d, viteWasmFallbackPlugin as f, viteDynamicImportVarsPlugin as i, viteReactRefreshWrapperPlugin as l, isolatedDeclarationPlugin as n, viteJsonPlugin as o, viteWebWorkerPostPlugin as p, viteBuildImportAnalysisPlugin as r, viteLoadFallbackPlugin as s, esmExternalRequirePlugin as t, viteReporterPlugin as u };
71
+ export { viteDynamicImportVarsPlugin as a, viteLoadFallbackPlugin as c, viteReporterPlugin as d, viteResolvePlugin as f, viteBuildImportAnalysisPlugin as i, viteModulePreloadPolyfillPlugin as l, viteWebWorkerPostPlugin as m, isolatedDeclarationPlugin as n, viteImportGlobPlugin as o, viteWasmFallbackPlugin as p, oxcRuntimePlugin as r, viteJsonPlugin as s, esmExternalRequirePlugin as t, viteReactRefreshWrapperPlugin as u };
@@ -14,7 +14,7 @@ function bindingifySourcemap(map) {
14
14
  } };
15
15
  }
16
16
  //#endregion
17
- //#region ../../node_modules/.pnpm/oxc-parser@0.115.0/node_modules/oxc-parser/src-js/wrap.js
17
+ //#region ../../node_modules/.pnpm/oxc-parser@0.130.0/node_modules/oxc-parser/src-js/wrap.js
18
18
  function wrap(result) {
19
19
  let program, module, comments, errors;
20
20
  return {
@@ -1,10 +1,10 @@
1
- import { n as BuiltinPlugin, t as normalizedStringOrRegex } from "./normalize-string-or-regex-TtAGUp42.js";
2
- import { a as validateOption, i as transformToRollupOutput, n as createBundlerOptions, o as PluginDriver, t as RolldownBuild } from "./rolldown-build-sRmdtwRU.js";
3
- import { a as parse$2, i as unwrapBindingResult, o as parseSync$2, r as normalizeBindingResult } from "./error-DkAP_6fk.js";
4
- import { a as viteImportGlobPlugin, c as viteModulePreloadPolyfillPlugin, d as viteResolvePlugin, f as viteWasmFallbackPlugin, i as viteDynamicImportVarsPlugin, l as viteReactRefreshWrapperPlugin, n as isolatedDeclarationPlugin, o as viteJsonPlugin, p as viteWebWorkerPostPlugin, r as viteBuildImportAnalysisPlugin, s as viteLoadFallbackPlugin, u as viteReporterPlugin } from "./constructors-BgL_dmUe.js";
5
- import { a as minifySync$2, i as minify$2, n as transform$1, r as transformSync$1, t as TsconfigCache$1 } from "./transform-UkHb5h4g.js";
1
+ import { n as BuiltinPlugin, t as normalizedStringOrRegex } from "./normalize-string-or-regex-CBPw_c5O.js";
2
+ import { a as validateOption, i as transformToRollupOutput, n as createBundlerOptions, o as PluginDriver, t as RolldownBuild } from "./rolldown-build-DCjXbOeh.js";
3
+ import { a as parse$2, i as unwrapBindingResult, o as parseSync$2, r as normalizeBindingResult } from "./error-CIj5jXSo.js";
4
+ import { a as viteDynamicImportVarsPlugin, c as viteLoadFallbackPlugin, d as viteReporterPlugin, f as viteResolvePlugin, i as viteBuildImportAnalysisPlugin, l as viteModulePreloadPolyfillPlugin, m as viteWebWorkerPostPlugin, n as isolatedDeclarationPlugin, o as viteImportGlobPlugin, p as viteWasmFallbackPlugin, r as oxcRuntimePlugin, s as viteJsonPlugin, u as viteReactRefreshWrapperPlugin } from "./constructors-BTLtc_G_.js";
5
+ import { a as minify$2, i as transformSync$1, n as resolveTsconfig, o as minifySync$2, r as transform$1, t as TsconfigCache$2 } from "./resolve-tsconfig-uVC8K7GR.js";
6
6
  import * as binding from "./rolldown-binding.wasi-browser.js";
7
- import { BindingBundler, BindingDevEngine, BindingRebuildStrategy, BindingRebuildStrategy as BindingRebuildStrategy$1, ResolverFactory, isolatedDeclaration, isolatedDeclarationSync, moduleRunnerTransform, resolveTsconfig, shutdownAsyncRuntime, startAsyncRuntime } from "./rolldown-binding.wasi-browser.js";
7
+ import { BindingBundler, BindingDevEngine, BindingRebuildStrategy, BindingRebuildStrategy as BindingRebuildStrategy$1, ResolverFactory, isolatedDeclaration, isolatedDeclarationSync, moduleRunnerTransform, shutdownAsyncRuntime, startAsyncRuntime } from "./rolldown-binding.wasi-browser.js";
8
8
  //#region src/api/dev/dev-engine.ts
9
9
  var DevEngine = class DevEngine {
10
10
  #inner;
@@ -228,11 +228,11 @@ function viteAliasPlugin(config) {
228
228
  * @example
229
229
  * **LLM-friendly markdown output**
230
230
  * ```js
231
- * import { chunkVisualizePlugin } from 'rolldown/experimental';
231
+ * import { bundleAnalyzerPlugin } from 'rolldown/experimental';
232
232
  *
233
233
  * export default {
234
234
  * plugins: [
235
- * chunkVisualizePlugin({
235
+ * bundleAnalyzerPlugin({
236
236
  * format: 'md'
237
237
  * })
238
238
  * ]
@@ -305,6 +305,6 @@ const transform = transform$1;
305
305
  /** @deprecated Use from `rolldown/utils` instead. */
306
306
  const transformSync = transformSync$1;
307
307
  /** @deprecated Use from `rolldown/utils` instead. */
308
- const TsconfigCache = TsconfigCache$1;
308
+ const TsconfigCache = TsconfigCache$2;
309
309
  //#endregion
310
- export { BindingRebuildStrategy, DevEngine, ResolverFactory, TsconfigCache, bundleAnalyzerPlugin, defineParallelPlugin, dev, viteDynamicImportVarsPlugin as dynamicImportVarsPlugin, viteDynamicImportVarsPlugin, freeExternalMemory, viteImportGlobPlugin as importGlobPlugin, viteImportGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, isolatedDeclarationSync, memfs, minify, minifySync, moduleRunnerTransform, parse, parseSync, resolveTsconfig, scan, transform, transformSync, viteAliasPlugin, viteBuildImportAnalysisPlugin, viteJsonPlugin, viteLoadFallbackPlugin, viteManifestPlugin, viteModulePreloadPolyfillPlugin, viteReactRefreshWrapperPlugin, viteReporterPlugin, viteResolvePlugin, viteTransformPlugin, viteWasmFallbackPlugin, viteWebWorkerPostPlugin };
310
+ export { BindingRebuildStrategy, DevEngine, ResolverFactory, TsconfigCache, bundleAnalyzerPlugin, defineParallelPlugin, dev, viteDynamicImportVarsPlugin as dynamicImportVarsPlugin, viteDynamicImportVarsPlugin, freeExternalMemory, viteImportGlobPlugin as importGlobPlugin, viteImportGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, isolatedDeclarationSync, memfs, minify, minifySync, moduleRunnerTransform, oxcRuntimePlugin, parse, parseSync, resolveTsconfig, scan, transform, transformSync, viteAliasPlugin, viteBuildImportAnalysisPlugin, viteJsonPlugin, viteLoadFallbackPlugin, viteManifestPlugin, viteModulePreloadPolyfillPlugin, viteReactRefreshWrapperPlugin, viteReporterPlugin, viteResolvePlugin, viteTransformPlugin, viteWasmFallbackPlugin, viteWebWorkerPostPlugin };