@betty-blocks/cli 25.109.0-beta.1 → 26.0.0-alpha.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 (46) hide show
  1. package/assets/app-functions/wasm-template/.wasm-functions +0 -0
  2. package/assets/app-functions/wasm-template/functions/say-hello/1.0/Cargo.lock +449 -0
  3. package/assets/app-functions/wasm-template/functions/say-hello/1.0/Cargo.toml +10 -0
  4. package/assets/app-functions/wasm-template/functions/say-hello/1.0/Justfile +6 -0
  5. package/assets/app-functions/wasm-template/functions/say-hello/1.0/function.json +35 -0
  6. package/assets/app-functions/wasm-template/functions/say-hello/1.0/src/lib.rs +19 -0
  7. package/assets/app-functions/wasm-template/functions/say-hello/1.0/wit/world.wit +13 -0
  8. package/build/src/bb-blocks-new.js +5361 -2181
  9. package/build/src/bb-blocks-publish.js +11493 -18303
  10. package/build/src/bb-blocks-release.js +65 -46
  11. package/build/src/bb-blocks.js +32 -32
  12. package/build/src/bb-bundle-init.js +1542 -912
  13. package/build/src/bb-bundle.js +35 -32
  14. package/build/src/bb-components-build.js +34965 -7598
  15. package/build/src/bb-components-create.js +1542 -912
  16. package/build/src/bb-components-generate.js +1542 -912
  17. package/build/src/bb-components-publish-bundle.js +1519 -889
  18. package/build/src/bb-components-publish.js +1522 -892
  19. package/build/src/bb-components-serve.js +1524 -894
  20. package/build/src/bb-components.js +32 -32
  21. package/build/src/bb-functions-bump.js +6047 -2733
  22. package/build/src/bb-functions-init.js +100 -593
  23. package/build/src/bb-functions-login.js +65 -46
  24. package/build/src/bb-functions-logout.js +65 -46
  25. package/build/src/bb-functions-new.js +5464 -2195
  26. package/build/src/bb-functions-publish.js +15134 -76022
  27. package/build/src/bb-functions-validate.js +7262 -3950
  28. package/build/src/bb-functions.js +35 -37
  29. package/build/src/bb.js +76 -74
  30. package/package.json +41 -42
  31. package/assets/app-functions/templates/test/helpers.js +0 -3
  32. package/assets/app-functions/templates/test/say-hello.test.js +0 -4
  33. package/assets/functions/packer/package.json +0 -9
  34. package/assets/functions/packer/webpack.config.js +0 -12
  35. package/assets/functions/templates/functions.json +0 -14
  36. package/assets/functions/templates/package.json +0 -11
  37. package/assets/functions/templates/src/all-users.js +0 -14
  38. package/assets/functions/templates/src/get-json.js +0 -9
  39. package/assets/functions/templates/src/index.js +0 -5
  40. package/assets/functions/templates/src/say-hello.js +0 -13
  41. package/build/src/bb-functions-build.js +0 -4285
  42. package/src/bb.ts +0 -31
  43. /package/assets/app-functions/{templates → js-template}/.app-functions +0 -0
  44. /package/assets/app-functions/{templates → js-template}/functions/say-hello/1.0/function.json +0 -0
  45. /package/assets/app-functions/{templates → js-template}/functions/say-hello/1.0/index.js +0 -0
  46. /package/assets/app-functions/{templates → js-template}/package.json +0 -0
@@ -78,7 +78,7 @@ var require_argument = __commonJS((exports) => {
78
78
  this._name = name;
79
79
  break;
80
80
  }
81
- if (this._name.length > 3 && this._name.slice(-3) === "...") {
81
+ if (this._name.endsWith("...")) {
82
82
  this.variadic = true;
83
83
  this._name = this._name.slice(0, -3);
84
84
  }
@@ -86,11 +86,12 @@ var require_argument = __commonJS((exports) => {
86
86
  name() {
87
87
  return this._name;
88
88
  }
89
- _concatValue(value, previous) {
89
+ _collectValue(value, previous) {
90
90
  if (previous === this.defaultValue || !Array.isArray(previous)) {
91
91
  return [value];
92
92
  }
93
- return previous.concat(value);
93
+ previous.push(value);
94
+ return previous;
94
95
  }
95
96
  default(value, description) {
96
97
  this.defaultValue = value;
@@ -108,7 +109,7 @@ var require_argument = __commonJS((exports) => {
108
109
  throw new InvalidArgumentError(`Allowed choices are ${this.argChoices.join(", ")}.`);
109
110
  }
110
111
  if (this.variadic) {
111
- return this._concatValue(arg, previous);
112
+ return this._collectValue(arg, previous);
112
113
  }
113
114
  return arg;
114
115
  };
@@ -555,11 +556,12 @@ var require_option = __commonJS((exports) => {
555
556
  this.hidden = !!hide;
556
557
  return this;
557
558
  }
558
- _concatValue(value, previous) {
559
+ _collectValue(value, previous) {
559
560
  if (previous === this.defaultValue || !Array.isArray(previous)) {
560
561
  return [value];
561
562
  }
562
- return previous.concat(value);
563
+ previous.push(value);
564
+ return previous;
563
565
  }
564
566
  choices(values) {
565
567
  this.argChoices = values.slice();
@@ -568,7 +570,7 @@ var require_option = __commonJS((exports) => {
568
570
  throw new InvalidArgumentError(`Allowed choices are ${this.argChoices.join(", ")}.`);
569
571
  }
570
572
  if (this.variadic) {
571
- return this._concatValue(arg, previous);
573
+ return this._collectValue(arg, previous);
572
574
  }
573
575
  return arg;
574
576
  };
@@ -874,7 +876,10 @@ var require_command = __commonJS((exports) => {
874
876
  configureOutput(configuration) {
875
877
  if (configuration === undefined)
876
878
  return this._outputConfiguration;
877
- this._outputConfiguration = Object.assign({}, this._outputConfiguration, configuration);
879
+ this._outputConfiguration = {
880
+ ...this._outputConfiguration,
881
+ ...configuration
882
+ };
878
883
  return this;
879
884
  }
880
885
  showHelpAfterError(displayHelp = true) {
@@ -923,7 +928,7 @@ var require_command = __commonJS((exports) => {
923
928
  }
924
929
  addArgument(argument) {
925
930
  const previousArgument = this.registeredArguments.slice(-1)[0];
926
- if (previousArgument && previousArgument.variadic) {
931
+ if (previousArgument?.variadic) {
927
932
  throw new Error(`only the last argument can be variadic '${previousArgument.name()}'`);
928
933
  }
929
934
  if (argument.required && argument.defaultValue !== undefined && argument.parseArg === undefined) {
@@ -1078,7 +1083,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1078
1083
  if (val !== null && option.parseArg) {
1079
1084
  val = this._callParseArg(option, val, oldValue, invalidValueMessage);
1080
1085
  } else if (val !== null && option.variadic) {
1081
- val = option._concatValue(val, oldValue);
1086
+ val = option._collectValue(val, oldValue);
1082
1087
  }
1083
1088
  if (val == null) {
1084
1089
  if (option.negate) {
@@ -1453,7 +1458,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1453
1458
  this.processedArgs = processedArgs;
1454
1459
  }
1455
1460
  _chainOrCall(promise, fn) {
1456
- if (promise && promise.then && typeof promise.then === "function") {
1461
+ if (promise?.then && typeof promise.then === "function") {
1457
1462
  return promise.then(() => fn());
1458
1463
  }
1459
1464
  return fn();
@@ -1530,7 +1535,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1530
1535
  promiseChain = this._chainOrCallHooks(promiseChain, "postAction");
1531
1536
  return promiseChain;
1532
1537
  }
1533
- if (this.parent && this.parent.listenerCount(commandEvent)) {
1538
+ if (this.parent?.listenerCount(commandEvent)) {
1534
1539
  checkForUnknownOptions();
1535
1540
  this._processArguments();
1536
1541
  this.parent.emit(commandEvent, operands, unknown);
@@ -1592,11 +1597,10 @@ Expecting one of '${allowedValues.join("', '")}'`);
1592
1597
  cmd._checkForConflictingLocalOptions();
1593
1598
  });
1594
1599
  }
1595
- parseOptions(argv) {
1600
+ parseOptions(args) {
1596
1601
  const operands = [];
1597
1602
  const unknown = [];
1598
1603
  let dest = operands;
1599
- const args = argv.slice();
1600
1604
  function maybeOption(arg) {
1601
1605
  return arg.length > 1 && arg[0] === "-";
1602
1606
  }
@@ -1606,12 +1610,15 @@ Expecting one of '${allowedValues.join("', '")}'`);
1606
1610
  return !this._getCommandAndAncestors().some((cmd) => cmd.options.map((opt) => opt.short).some((short) => /^-\d$/.test(short)));
1607
1611
  };
1608
1612
  let activeVariadicOption = null;
1609
- while (args.length) {
1610
- const arg = args.shift();
1613
+ let activeGroup = null;
1614
+ let i = 0;
1615
+ while (i < args.length || activeGroup) {
1616
+ const arg = activeGroup ?? args[i++];
1617
+ activeGroup = null;
1611
1618
  if (arg === "--") {
1612
1619
  if (dest === unknown)
1613
1620
  dest.push(arg);
1614
- dest.push(...args);
1621
+ dest.push(...args.slice(i));
1615
1622
  break;
1616
1623
  }
1617
1624
  if (activeVariadicOption && (!maybeOption(arg) || negativeNumberArg(arg))) {
@@ -1623,14 +1630,14 @@ Expecting one of '${allowedValues.join("', '")}'`);
1623
1630
  const option = this._findOption(arg);
1624
1631
  if (option) {
1625
1632
  if (option.required) {
1626
- const value = args.shift();
1633
+ const value = args[i++];
1627
1634
  if (value === undefined)
1628
1635
  this.optionMissingArgument(option);
1629
1636
  this.emit(`option:${option.name()}`, value);
1630
1637
  } else if (option.optional) {
1631
1638
  let value = null;
1632
- if (args.length > 0 && (!maybeOption(args[0]) || negativeNumberArg(args[0]))) {
1633
- value = args.shift();
1639
+ if (i < args.length && (!maybeOption(args[i]) || negativeNumberArg(args[i]))) {
1640
+ value = args[i++];
1634
1641
  }
1635
1642
  this.emit(`option:${option.name()}`, value);
1636
1643
  } else {
@@ -1647,7 +1654,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1647
1654
  this.emit(`option:${option.name()}`, arg.slice(2));
1648
1655
  } else {
1649
1656
  this.emit(`option:${option.name()}`);
1650
- args.unshift(`-${arg.slice(2)}`);
1657
+ activeGroup = `-${arg.slice(2)}`;
1651
1658
  }
1652
1659
  continue;
1653
1660
  }
@@ -1666,25 +1673,18 @@ Expecting one of '${allowedValues.join("', '")}'`);
1666
1673
  if ((this._enablePositionalOptions || this._passThroughOptions) && operands.length === 0 && unknown.length === 0) {
1667
1674
  if (this._findCommand(arg)) {
1668
1675
  operands.push(arg);
1669
- if (args.length > 0)
1670
- unknown.push(...args);
1676
+ unknown.push(...args.slice(i));
1671
1677
  break;
1672
1678
  } else if (this._getHelpCommand() && arg === this._getHelpCommand().name()) {
1673
- operands.push(arg);
1674
- if (args.length > 0)
1675
- operands.push(...args);
1679
+ operands.push(arg, ...args.slice(i));
1676
1680
  break;
1677
1681
  } else if (this._defaultCommandName) {
1678
- unknown.push(arg);
1679
- if (args.length > 0)
1680
- unknown.push(...args);
1682
+ unknown.push(arg, ...args.slice(i));
1681
1683
  break;
1682
1684
  }
1683
1685
  }
1684
1686
  if (this._passThroughOptions) {
1685
- dest.push(arg);
1686
- if (args.length > 0)
1687
- dest.push(...args);
1687
+ dest.push(arg, ...args.slice(i));
1688
1688
  break;
1689
1689
  }
1690
1690
  dest.push(arg);
@@ -3271,6 +3271,23 @@ var require_stat = __commonJS((exports, module) => {
3271
3271
  };
3272
3272
  });
3273
3273
 
3274
+ // node_modules/fs-extra/lib/util/async.js
3275
+ var require_async = __commonJS((exports, module) => {
3276
+ async function asyncIteratorConcurrentProcess(iterator, fn) {
3277
+ const promises = [];
3278
+ for await (const item of iterator) {
3279
+ promises.push(fn(item).then(() => null, (err) => err ?? new Error("unknown error")));
3280
+ }
3281
+ await Promise.all(promises.map((promise) => promise.then((possibleErr) => {
3282
+ if (possibleErr !== null)
3283
+ throw possibleErr;
3284
+ })));
3285
+ }
3286
+ module.exports = {
3287
+ asyncIteratorConcurrentProcess
3288
+ };
3289
+ });
3290
+
3274
3291
  // node_modules/fs-extra/lib/copy/copy.js
3275
3292
  var require_copy = __commonJS((exports, module) => {
3276
3293
  var fs = require_fs();
@@ -3279,6 +3296,7 @@ var require_copy = __commonJS((exports, module) => {
3279
3296
  var { pathExists } = require_path_exists();
3280
3297
  var { utimesMillis } = require_utimes();
3281
3298
  var stat = require_stat();
3299
+ var { asyncIteratorConcurrentProcess } = require_async();
3282
3300
  async function copy(src, dest, opts = {}) {
3283
3301
  if (typeof opts === "function") {
3284
3302
  opts = { filter: opts };
@@ -3354,19 +3372,15 @@ var require_copy = __commonJS((exports, module) => {
3354
3372
  if (!destStat) {
3355
3373
  await fs.mkdir(dest);
3356
3374
  }
3357
- const promises = [];
3358
- for await (const item of await fs.opendir(src)) {
3375
+ await asyncIteratorConcurrentProcess(await fs.opendir(src), async (item) => {
3359
3376
  const srcItem = path.join(src, item.name);
3360
3377
  const destItem = path.join(dest, item.name);
3361
- promises.push(runFilter(srcItem, destItem, opts).then((include) => {
3362
- if (include) {
3363
- return stat.checkPaths(srcItem, destItem, "copy", opts).then(({ destStat: destStat2 }) => {
3364
- return getStatsAndPerformCopy(destStat2, srcItem, destItem, opts);
3365
- });
3366
- }
3367
- }));
3368
- }
3369
- await Promise.all(promises);
3378
+ const include = await runFilter(srcItem, destItem, opts);
3379
+ if (include) {
3380
+ const { destStat: destStat2 } = await stat.checkPaths(srcItem, destItem, "copy", opts);
3381
+ await getStatsAndPerformCopy(destStat2, srcItem, destItem, opts);
3382
+ }
3383
+ });
3370
3384
  if (!destStat) {
3371
3385
  await fs.chmod(dest, srcStat.mode);
3372
3386
  }
@@ -3982,13 +3996,12 @@ var require_jsonfile = __commonJS((exports, module) => {
3982
3996
  const str = stringify(obj, options);
3983
3997
  return fs.writeFileSync(file, str, options);
3984
3998
  }
3985
- var jsonfile = {
3999
+ module.exports = {
3986
4000
  readFile,
3987
4001
  readFileSync,
3988
4002
  writeFile,
3989
4003
  writeFileSync
3990
4004
  };
3991
- module.exports = jsonfile;
3992
4005
  });
3993
4006
 
3994
4007
  // node_modules/fs-extra/lib/json/jsonfile.js
@@ -13528,7 +13541,13 @@ var require_node_domexception = __commonJS((exports, module) => {
13528
13541
 
13529
13542
  // node_modules/fetch-blob/from.js
13530
13543
  import { statSync, createReadStream, promises as fs3 } from "node:fs";
13531
- var import_node_domexception, stat, BlobDataItem;
13544
+ import { basename } from "node:path";
13545
+ var import_node_domexception, stat, fileFromSync = (path3, type) => fromFile(statSync(path3), path3, type), fromFile = (stat2, path3, type = "") => new file_default([new BlobDataItem({
13546
+ path: path3,
13547
+ size: stat2.size,
13548
+ lastModified: stat2.mtimeMs,
13549
+ start: 0
13550
+ })], basename(path3), { type, lastModified: stat2.mtimeMs }), BlobDataItem;
13532
13551
  var init_from = __esm(() => {
13533
13552
  import_node_domexception = __toESM(require_node_domexception(), 1);
13534
13553
  init_file();
@@ -78,7 +78,7 @@ var require_argument = __commonJS((exports) => {
78
78
  this._name = name;
79
79
  break;
80
80
  }
81
- if (this._name.length > 3 && this._name.slice(-3) === "...") {
81
+ if (this._name.endsWith("...")) {
82
82
  this.variadic = true;
83
83
  this._name = this._name.slice(0, -3);
84
84
  }
@@ -86,11 +86,12 @@ var require_argument = __commonJS((exports) => {
86
86
  name() {
87
87
  return this._name;
88
88
  }
89
- _concatValue(value, previous) {
89
+ _collectValue(value, previous) {
90
90
  if (previous === this.defaultValue || !Array.isArray(previous)) {
91
91
  return [value];
92
92
  }
93
- return previous.concat(value);
93
+ previous.push(value);
94
+ return previous;
94
95
  }
95
96
  default(value, description) {
96
97
  this.defaultValue = value;
@@ -108,7 +109,7 @@ var require_argument = __commonJS((exports) => {
108
109
  throw new InvalidArgumentError(`Allowed choices are ${this.argChoices.join(", ")}.`);
109
110
  }
110
111
  if (this.variadic) {
111
- return this._concatValue(arg, previous);
112
+ return this._collectValue(arg, previous);
112
113
  }
113
114
  return arg;
114
115
  };
@@ -555,11 +556,12 @@ var require_option = __commonJS((exports) => {
555
556
  this.hidden = !!hide;
556
557
  return this;
557
558
  }
558
- _concatValue(value, previous) {
559
+ _collectValue(value, previous) {
559
560
  if (previous === this.defaultValue || !Array.isArray(previous)) {
560
561
  return [value];
561
562
  }
562
- return previous.concat(value);
563
+ previous.push(value);
564
+ return previous;
563
565
  }
564
566
  choices(values) {
565
567
  this.argChoices = values.slice();
@@ -568,7 +570,7 @@ var require_option = __commonJS((exports) => {
568
570
  throw new InvalidArgumentError(`Allowed choices are ${this.argChoices.join(", ")}.`);
569
571
  }
570
572
  if (this.variadic) {
571
- return this._concatValue(arg, previous);
573
+ return this._collectValue(arg, previous);
572
574
  }
573
575
  return arg;
574
576
  };
@@ -874,7 +876,10 @@ var require_command = __commonJS((exports) => {
874
876
  configureOutput(configuration) {
875
877
  if (configuration === undefined)
876
878
  return this._outputConfiguration;
877
- this._outputConfiguration = Object.assign({}, this._outputConfiguration, configuration);
879
+ this._outputConfiguration = {
880
+ ...this._outputConfiguration,
881
+ ...configuration
882
+ };
878
883
  return this;
879
884
  }
880
885
  showHelpAfterError(displayHelp = true) {
@@ -923,7 +928,7 @@ var require_command = __commonJS((exports) => {
923
928
  }
924
929
  addArgument(argument) {
925
930
  const previousArgument = this.registeredArguments.slice(-1)[0];
926
- if (previousArgument && previousArgument.variadic) {
931
+ if (previousArgument?.variadic) {
927
932
  throw new Error(`only the last argument can be variadic '${previousArgument.name()}'`);
928
933
  }
929
934
  if (argument.required && argument.defaultValue !== undefined && argument.parseArg === undefined) {
@@ -1078,7 +1083,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1078
1083
  if (val !== null && option.parseArg) {
1079
1084
  val = this._callParseArg(option, val, oldValue, invalidValueMessage);
1080
1085
  } else if (val !== null && option.variadic) {
1081
- val = option._concatValue(val, oldValue);
1086
+ val = option._collectValue(val, oldValue);
1082
1087
  }
1083
1088
  if (val == null) {
1084
1089
  if (option.negate) {
@@ -1453,7 +1458,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1453
1458
  this.processedArgs = processedArgs;
1454
1459
  }
1455
1460
  _chainOrCall(promise, fn) {
1456
- if (promise && promise.then && typeof promise.then === "function") {
1461
+ if (promise?.then && typeof promise.then === "function") {
1457
1462
  return promise.then(() => fn());
1458
1463
  }
1459
1464
  return fn();
@@ -1530,7 +1535,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1530
1535
  promiseChain = this._chainOrCallHooks(promiseChain, "postAction");
1531
1536
  return promiseChain;
1532
1537
  }
1533
- if (this.parent && this.parent.listenerCount(commandEvent)) {
1538
+ if (this.parent?.listenerCount(commandEvent)) {
1534
1539
  checkForUnknownOptions();
1535
1540
  this._processArguments();
1536
1541
  this.parent.emit(commandEvent, operands, unknown);
@@ -1592,11 +1597,10 @@ Expecting one of '${allowedValues.join("', '")}'`);
1592
1597
  cmd._checkForConflictingLocalOptions();
1593
1598
  });
1594
1599
  }
1595
- parseOptions(argv) {
1600
+ parseOptions(args) {
1596
1601
  const operands = [];
1597
1602
  const unknown = [];
1598
1603
  let dest = operands;
1599
- const args = argv.slice();
1600
1604
  function maybeOption(arg) {
1601
1605
  return arg.length > 1 && arg[0] === "-";
1602
1606
  }
@@ -1606,12 +1610,15 @@ Expecting one of '${allowedValues.join("', '")}'`);
1606
1610
  return !this._getCommandAndAncestors().some((cmd) => cmd.options.map((opt) => opt.short).some((short) => /^-\d$/.test(short)));
1607
1611
  };
1608
1612
  let activeVariadicOption = null;
1609
- while (args.length) {
1610
- const arg = args.shift();
1613
+ let activeGroup = null;
1614
+ let i = 0;
1615
+ while (i < args.length || activeGroup) {
1616
+ const arg = activeGroup ?? args[i++];
1617
+ activeGroup = null;
1611
1618
  if (arg === "--") {
1612
1619
  if (dest === unknown)
1613
1620
  dest.push(arg);
1614
- dest.push(...args);
1621
+ dest.push(...args.slice(i));
1615
1622
  break;
1616
1623
  }
1617
1624
  if (activeVariadicOption && (!maybeOption(arg) || negativeNumberArg(arg))) {
@@ -1623,14 +1630,14 @@ Expecting one of '${allowedValues.join("', '")}'`);
1623
1630
  const option = this._findOption(arg);
1624
1631
  if (option) {
1625
1632
  if (option.required) {
1626
- const value = args.shift();
1633
+ const value = args[i++];
1627
1634
  if (value === undefined)
1628
1635
  this.optionMissingArgument(option);
1629
1636
  this.emit(`option:${option.name()}`, value);
1630
1637
  } else if (option.optional) {
1631
1638
  let value = null;
1632
- if (args.length > 0 && (!maybeOption(args[0]) || negativeNumberArg(args[0]))) {
1633
- value = args.shift();
1639
+ if (i < args.length && (!maybeOption(args[i]) || negativeNumberArg(args[i]))) {
1640
+ value = args[i++];
1634
1641
  }
1635
1642
  this.emit(`option:${option.name()}`, value);
1636
1643
  } else {
@@ -1647,7 +1654,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1647
1654
  this.emit(`option:${option.name()}`, arg.slice(2));
1648
1655
  } else {
1649
1656
  this.emit(`option:${option.name()}`);
1650
- args.unshift(`-${arg.slice(2)}`);
1657
+ activeGroup = `-${arg.slice(2)}`;
1651
1658
  }
1652
1659
  continue;
1653
1660
  }
@@ -1666,25 +1673,18 @@ Expecting one of '${allowedValues.join("', '")}'`);
1666
1673
  if ((this._enablePositionalOptions || this._passThroughOptions) && operands.length === 0 && unknown.length === 0) {
1667
1674
  if (this._findCommand(arg)) {
1668
1675
  operands.push(arg);
1669
- if (args.length > 0)
1670
- unknown.push(...args);
1676
+ unknown.push(...args.slice(i));
1671
1677
  break;
1672
1678
  } else if (this._getHelpCommand() && arg === this._getHelpCommand().name()) {
1673
- operands.push(arg);
1674
- if (args.length > 0)
1675
- operands.push(...args);
1679
+ operands.push(arg, ...args.slice(i));
1676
1680
  break;
1677
1681
  } else if (this._defaultCommandName) {
1678
- unknown.push(arg);
1679
- if (args.length > 0)
1680
- unknown.push(...args);
1682
+ unknown.push(arg, ...args.slice(i));
1681
1683
  break;
1682
1684
  }
1683
1685
  }
1684
1686
  if (this._passThroughOptions) {
1685
- dest.push(arg);
1686
- if (args.length > 0)
1687
- dest.push(...args);
1687
+ dest.push(arg, ...args.slice(i));
1688
1688
  break;
1689
1689
  }
1690
1690
  dest.push(arg);
@@ -3271,6 +3271,23 @@ var require_stat = __commonJS((exports, module) => {
3271
3271
  };
3272
3272
  });
3273
3273
 
3274
+ // node_modules/fs-extra/lib/util/async.js
3275
+ var require_async = __commonJS((exports, module) => {
3276
+ async function asyncIteratorConcurrentProcess(iterator, fn) {
3277
+ const promises = [];
3278
+ for await (const item of iterator) {
3279
+ promises.push(fn(item).then(() => null, (err) => err ?? new Error("unknown error")));
3280
+ }
3281
+ await Promise.all(promises.map((promise) => promise.then((possibleErr) => {
3282
+ if (possibleErr !== null)
3283
+ throw possibleErr;
3284
+ })));
3285
+ }
3286
+ module.exports = {
3287
+ asyncIteratorConcurrentProcess
3288
+ };
3289
+ });
3290
+
3274
3291
  // node_modules/fs-extra/lib/copy/copy.js
3275
3292
  var require_copy = __commonJS((exports, module) => {
3276
3293
  var fs = require_fs();
@@ -3279,6 +3296,7 @@ var require_copy = __commonJS((exports, module) => {
3279
3296
  var { pathExists } = require_path_exists();
3280
3297
  var { utimesMillis } = require_utimes();
3281
3298
  var stat = require_stat();
3299
+ var { asyncIteratorConcurrentProcess } = require_async();
3282
3300
  async function copy(src, dest, opts = {}) {
3283
3301
  if (typeof opts === "function") {
3284
3302
  opts = { filter: opts };
@@ -3354,19 +3372,15 @@ var require_copy = __commonJS((exports, module) => {
3354
3372
  if (!destStat) {
3355
3373
  await fs.mkdir(dest);
3356
3374
  }
3357
- const promises = [];
3358
- for await (const item of await fs.opendir(src)) {
3375
+ await asyncIteratorConcurrentProcess(await fs.opendir(src), async (item) => {
3359
3376
  const srcItem = path.join(src, item.name);
3360
3377
  const destItem = path.join(dest, item.name);
3361
- promises.push(runFilter(srcItem, destItem, opts).then((include) => {
3362
- if (include) {
3363
- return stat.checkPaths(srcItem, destItem, "copy", opts).then(({ destStat: destStat2 }) => {
3364
- return getStatsAndPerformCopy(destStat2, srcItem, destItem, opts);
3365
- });
3366
- }
3367
- }));
3368
- }
3369
- await Promise.all(promises);
3378
+ const include = await runFilter(srcItem, destItem, opts);
3379
+ if (include) {
3380
+ const { destStat: destStat2 } = await stat.checkPaths(srcItem, destItem, "copy", opts);
3381
+ await getStatsAndPerformCopy(destStat2, srcItem, destItem, opts);
3382
+ }
3383
+ });
3370
3384
  if (!destStat) {
3371
3385
  await fs.chmod(dest, srcStat.mode);
3372
3386
  }
@@ -3982,13 +3996,12 @@ var require_jsonfile = __commonJS((exports, module) => {
3982
3996
  const str = stringify(obj, options);
3983
3997
  return fs.writeFileSync(file, str, options);
3984
3998
  }
3985
- var jsonfile = {
3999
+ module.exports = {
3986
4000
  readFile,
3987
4001
  readFileSync,
3988
4002
  writeFile,
3989
4003
  writeFileSync
3990
4004
  };
3991
- module.exports = jsonfile;
3992
4005
  });
3993
4006
 
3994
4007
  // node_modules/fs-extra/lib/json/jsonfile.js
@@ -13528,7 +13541,13 @@ var require_node_domexception = __commonJS((exports, module) => {
13528
13541
 
13529
13542
  // node_modules/fetch-blob/from.js
13530
13543
  import { statSync, createReadStream, promises as fs3 } from "node:fs";
13531
- var import_node_domexception, stat, BlobDataItem;
13544
+ import { basename } from "node:path";
13545
+ var import_node_domexception, stat, fileFromSync = (path3, type) => fromFile(statSync(path3), path3, type), fromFile = (stat2, path3, type = "") => new file_default([new BlobDataItem({
13546
+ path: path3,
13547
+ size: stat2.size,
13548
+ lastModified: stat2.mtimeMs,
13549
+ start: 0
13550
+ })], basename(path3), { type, lastModified: stat2.mtimeMs }), BlobDataItem;
13532
13551
  var init_from = __esm(() => {
13533
13552
  import_node_domexception = __toESM(require_node_domexception(), 1);
13534
13553
  init_file();