@kubb/cli 3.0.0-alpha.6 → 3.0.0-alpha.8

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.
@@ -1,13 +1,9 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var __create = Object.create;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2;var __create = Object.create;
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __getProtoOf = Object.getPrototypeOf;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __typeError = (msg) => {
8
- throw TypeError(msg);
9
- };
10
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
11
7
  var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
12
8
  get: (a3, b) => (typeof require !== "undefined" ? require : a3)[b]
13
9
  }) : x)(function(x) {
@@ -36,24 +32,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
36
32
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
37
33
  mod
38
34
  ));
39
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
40
- var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
41
- var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
42
- var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
43
- var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
44
- var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
45
- var __privateWrapper = (obj, member, setter, getter) => ({
46
- set _(value) {
47
- __privateSet(obj, member, value, setter);
48
- },
49
- get _() {
50
- return __privateGet(obj, member, getter);
51
- }
52
- });
53
35
 
54
- // ../../node_modules/.pnpm/tsup@8.2.4_@microsoft+api-extractor@7.47.7_@types+node@20.16.1__jiti@1.21.6_postcss@8.4.41_typescript@5.5.4_yaml@2.4.5/node_modules/tsup/assets/cjs_shims.js
36
+ // ../../node_modules/.pnpm/tsup@8.2.4_@microsoft+api-extractor@7.47.7_@types+node@20.16.2__jiti@1.21.6_postcss@8.4.41_typescript@5.5.4_yaml@2.4.5/node_modules/tsup/assets/cjs_shims.js
55
37
  var init_cjs_shims = __esm({
56
- "../../node_modules/.pnpm/tsup@8.2.4_@microsoft+api-extractor@7.47.7_@types+node@20.16.1__jiti@1.21.6_postcss@8.4.41_typescript@5.5.4_yaml@2.4.5/node_modules/tsup/assets/cjs_shims.js"() {
38
+ "../../node_modules/.pnpm/tsup@8.2.4_@microsoft+api-extractor@7.47.7_@types+node@20.16.2__jiti@1.21.6_postcss@8.4.41_typescript@5.5.4_yaml@2.4.5/node_modules/tsup/assets/cjs_shims.js"() {
57
39
  "use strict";
58
40
  }
59
41
  });
@@ -1042,7 +1024,7 @@ var _util = require('util');
1042
1024
 
1043
1025
  // ../../node_modules/.pnpm/execa@9.3.1/node_modules/execa/lib/utils/standard-stream.js
1044
1026
  init_cjs_shims();
1045
- var _process2 = require('process'); var process10 = _interopRequireWildcard(_process2);
1027
+ var _process = require('process'); var process10 = _interopRequireWildcard(_process);
1046
1028
  var isStandardStream = (stream) => STANDARD_STREAMS.includes(stream);
1047
1029
  var STANDARD_STREAMS = [process10.default.stdin, process10.default.stdout, process10.default.stderr];
1048
1030
  var STANDARD_STREAMS_ALIASES = ["stdin", "stdout", "stderr"];
@@ -1177,7 +1159,7 @@ var quoteString = (escapedArgument) => {
1177
1159
  if (NO_ESCAPE_REGEXP.test(escapedArgument)) {
1178
1160
  return escapedArgument;
1179
1161
  }
1180
- return _process2.platform === "win32" ? `"${escapedArgument.replaceAll('"', '""')}"` : `'${escapedArgument.replaceAll("'", "'\\''")}'`;
1162
+ return _process.platform === "win32" ? `"${escapedArgument.replaceAll('"', '""')}"` : `'${escapedArgument.replaceAll("'", "'\\''")}'`;
1181
1163
  };
1182
1164
  var NO_ESCAPE_REGEXP = /^[\w./-]+$/;
1183
1165
 
@@ -1676,8 +1658,8 @@ var validateVerbose = (verbose) => {
1676
1658
  // ../../node_modules/.pnpm/execa@9.3.1/node_modules/execa/lib/return/duration.js
1677
1659
  init_cjs_shims();
1678
1660
 
1679
- var getStartTime = () => _process2.hrtime.bigint();
1680
- var getDurationMs = (startTime) => Number(_process2.hrtime.bigint() - startTime) / 1e6;
1661
+ var getStartTime = () => _process.hrtime.bigint();
1662
+ var getDurationMs = (startTime) => Number(_process.hrtime.bigint() - startTime) / 1e6;
1681
1663
 
1682
1664
  // ../../node_modules/.pnpm/execa@9.3.1/node_modules/execa/lib/arguments/command.js
1683
1665
  var handleCommand = (filePath, rawArguments, rawOptions) => {
@@ -2275,7 +2257,7 @@ var killOnTimeout = async ({ kill, forceKillAfterDelay, context, controllerSigna
2275
2257
  try {
2276
2258
  await _promises.setTimeout.call(void 0, forceKillAfterDelay, void 0, { signal: controllerSignal });
2277
2259
  if (kill("SIGKILL")) {
2278
- _nullishCoalesce(context.isForcefullyTerminated, () => ( (context.isForcefullyTerminated = true)));
2260
+ context.isForcefullyTerminated ??= true;
2279
2261
  }
2280
2262
  } catch (e3) {
2281
2263
  }
@@ -2302,7 +2284,7 @@ var validateCancelSignal = ({ cancelSignal }) => {
2302
2284
  var throwOnCancel = ({ subprocess, cancelSignal, gracefulCancel, context, controller }) => cancelSignal === void 0 || gracefulCancel ? [] : [terminateOnCancel(subprocess, cancelSignal, context, controller)];
2303
2285
  var terminateOnCancel = async (subprocess, cancelSignal, context, { signal }) => {
2304
2286
  await onAbortedSignal(cancelSignal, signal);
2305
- _nullishCoalesce(context.terminationReason, () => ( (context.terminationReason = "cancel")));
2287
+ context.terminationReason ??= "cancel";
2306
2288
  subprocess.kill();
2307
2289
  throw cancelSignal.reason;
2308
2290
  };
@@ -2893,7 +2875,7 @@ var sendOnAbort = async ({ subprocess, cancelSignal, forceKillAfterDelay, contex
2893
2875
  context,
2894
2876
  controllerSignal: signal
2895
2877
  });
2896
- _nullishCoalesce(context.terminationReason, () => ( (context.terminationReason = "gracefulCancel")));
2878
+ context.terminationReason ??= "gracefulCancel";
2897
2879
  throw cancelSignal.reason;
2898
2880
  };
2899
2881
  var getReason = ({ reason }) => {
@@ -2921,7 +2903,7 @@ var validateTimeout = ({ timeout }) => {
2921
2903
  var throwOnTimeout = (subprocess, timeout, context, controller) => timeout === 0 || timeout === void 0 ? [] : [killAfterTimeout(subprocess, timeout, context, controller)];
2922
2904
  var killAfterTimeout = async (subprocess, timeout, context, { signal }) => {
2923
2905
  await _promises.setTimeout.call(void 0, timeout, void 0, { signal });
2924
- _nullishCoalesce(context.terminationReason, () => ( (context.terminationReason = "timeout")));
2906
+ context.terminationReason ??= "timeout";
2925
2907
  subprocess.kill();
2926
2908
  throw new DiscardedError();
2927
2909
  };
@@ -2938,8 +2920,8 @@ var mapNode = ({ options }) => {
2938
2920
  };
2939
2921
  var handleNodeOption = (file, commandArguments, {
2940
2922
  node: shouldHandleNode = false,
2941
- nodePath = _process2.execPath,
2942
- nodeOptions = _process2.execArgv.filter((nodeOption) => !nodeOption.startsWith("--inspect")),
2923
+ nodePath = _process.execPath,
2924
+ nodeOptions = _process.execArgv.filter((nodeOption) => !nodeOption.startsWith("--inspect")),
2943
2925
  cwd,
2944
2926
  execPath: formerNodePath,
2945
2927
  ...options
@@ -3219,61 +3201,54 @@ var a2 = Object.getPrototypeOf(
3219
3201
  }
3220
3202
  ).prototype
3221
3203
  );
3222
- var _t, _n, _r, _e, _c_instances, s_fn, i_fn;
3223
3204
  var c = class {
3205
+ #t;
3206
+ #n;
3207
+ #r = false;
3208
+ #e = void 0;
3224
3209
  constructor(e, t) {
3225
- __privateAdd(this, _c_instances);
3226
- __privateAdd(this, _t);
3227
- __privateAdd(this, _n);
3228
- __privateAdd(this, _r, false);
3229
- __privateAdd(this, _e);
3230
- __privateSet(this, _t, e), __privateSet(this, _n, t);
3210
+ this.#t = e, this.#n = t;
3231
3211
  }
3232
3212
  next() {
3233
- const e = () => __privateMethod(this, _c_instances, s_fn).call(this);
3234
- return __privateSet(this, _e, __privateGet(this, _e) ? __privateGet(this, _e).then(e, e) : e()), __privateGet(this, _e);
3213
+ const e = () => this.#s();
3214
+ return this.#e = this.#e ? this.#e.then(e, e) : e(), this.#e;
3235
3215
  }
3236
3216
  return(e) {
3237
- const t = () => __privateMethod(this, _c_instances, i_fn).call(this, e);
3238
- return __privateGet(this, _e) ? __privateGet(this, _e).then(t, t) : t();
3217
+ const t = () => this.#i(e);
3218
+ return this.#e ? this.#e.then(t, t) : t();
3239
3219
  }
3240
- };
3241
- _t = new WeakMap();
3242
- _n = new WeakMap();
3243
- _r = new WeakMap();
3244
- _e = new WeakMap();
3245
- _c_instances = new WeakSet();
3246
- s_fn = async function() {
3247
- if (__privateGet(this, _r))
3248
- return {
3249
- done: true,
3250
- value: void 0
3251
- };
3252
- let e;
3253
- try {
3254
- e = await __privateGet(this, _t).read();
3255
- } catch (t) {
3256
- throw __privateSet(this, _e, void 0), __privateSet(this, _r, true), __privateGet(this, _t).releaseLock(), t;
3220
+ async #s() {
3221
+ if (this.#r)
3222
+ return {
3223
+ done: true,
3224
+ value: void 0
3225
+ };
3226
+ let e;
3227
+ try {
3228
+ e = await this.#t.read();
3229
+ } catch (t) {
3230
+ throw this.#e = void 0, this.#r = true, this.#t.releaseLock(), t;
3231
+ }
3232
+ return e.done && (this.#e = void 0, this.#r = true, this.#t.releaseLock()), e;
3257
3233
  }
3258
- return e.done && (__privateSet(this, _e, void 0), __privateSet(this, _r, true), __privateGet(this, _t).releaseLock()), e;
3259
- };
3260
- i_fn = async function(e) {
3261
- if (__privateGet(this, _r))
3262
- return {
3263
- done: true,
3264
- value: e
3265
- };
3266
- if (__privateSet(this, _r, true), !__privateGet(this, _n)) {
3267
- const t = __privateGet(this, _t).cancel(e);
3268
- return __privateGet(this, _t).releaseLock(), await t, {
3234
+ async #i(e) {
3235
+ if (this.#r)
3236
+ return {
3237
+ done: true,
3238
+ value: e
3239
+ };
3240
+ if (this.#r = true, !this.#n) {
3241
+ const t = this.#t.cancel(e);
3242
+ return this.#t.releaseLock(), await t, {
3243
+ done: true,
3244
+ value: e
3245
+ };
3246
+ }
3247
+ return this.#t.releaseLock(), {
3269
3248
  done: true,
3270
3249
  value: e
3271
3250
  };
3272
3251
  }
3273
- return __privateGet(this, _t).releaseLock(), {
3274
- done: true,
3275
- value: e
3276
- };
3277
3252
  };
3278
3253
  var n = Symbol();
3279
3254
  function i() {
@@ -3452,12 +3427,12 @@ var getChunkType = (chunk) => {
3452
3427
  return "others";
3453
3428
  };
3454
3429
  var { toString: objectToString2 } = Object.prototype;
3455
- var MaxBufferError = class extends Error {
3430
+ var MaxBufferError = (_class = class extends Error {
3431
+ __init2() {this.name = "MaxBufferError"}
3456
3432
  constructor() {
3457
- super("maxBuffer exceeded");
3458
- __publicField(this, "name", "MaxBufferError");
3433
+ super("maxBuffer exceeded");_class.prototype.__init2.call(this);;
3459
3434
  }
3460
- };
3435
+ }, _class);
3461
3436
 
3462
3437
  // ../../node_modules/.pnpm/get-stream@9.0.1/node_modules/get-stream/source/utils.js
3463
3438
  init_cjs_shims();
@@ -5299,7 +5274,7 @@ var logOutputSync = ({ serializedResult, fdNumber, state, verboseInfo, encoding,
5299
5274
  try {
5300
5275
  logLinesSync(linesArray, fdNumber, verboseInfo);
5301
5276
  } catch (error) {
5302
- _nullishCoalesce(state.error, () => ( (state.error = error)));
5277
+ state.error ??= error;
5303
5278
  }
5304
5279
  };
5305
5280
  var writeToFiles = (serializedResult, stdioItems, outputFiles) => {
@@ -5346,7 +5321,7 @@ init_cjs_shims();
5346
5321
 
5347
5322
  var waitForExit = async (subprocess, context) => {
5348
5323
  const [exitCode, signal] = await waitForExitOrError(subprocess);
5349
- _nullishCoalesce(context.isForcefullyTerminated, () => ( (context.isForcefullyTerminated = false)));
5324
+ context.isForcefullyTerminated ??= false;
5350
5325
  return [exitCode, signal];
5351
5326
  };
5352
5327
  var waitForExitOrError = async (subprocess) => {
@@ -5847,57 +5822,47 @@ var getHighWaterMark = (streams, objectMode) => {
5847
5822
  const highWaterMarks = streams.filter(({ readableObjectMode }) => readableObjectMode === objectMode).map(({ readableHighWaterMark }) => readableHighWaterMark);
5848
5823
  return Math.max(...highWaterMarks);
5849
5824
  };
5850
- var _streams, _ended, _aborted, _onFinished, _unpipeEvent, _streamPromises;
5851
5825
  var MergedStream = class extends _stream.PassThrough {
5852
- constructor() {
5853
- super(...arguments);
5854
- __privateAdd(this, _streams, /* @__PURE__ */ new Set([]));
5855
- __privateAdd(this, _ended, /* @__PURE__ */ new Set([]));
5856
- __privateAdd(this, _aborted, /* @__PURE__ */ new Set([]));
5857
- __privateAdd(this, _onFinished);
5858
- __privateAdd(this, _unpipeEvent, Symbol("unpipe"));
5859
- __privateAdd(this, _streamPromises, /* @__PURE__ */ new WeakMap());
5860
- }
5826
+ #streams = /* @__PURE__ */ new Set([]);
5827
+ #ended = /* @__PURE__ */ new Set([]);
5828
+ #aborted = /* @__PURE__ */ new Set([]);
5829
+ #onFinished;
5830
+ #unpipeEvent = Symbol("unpipe");
5831
+ #streamPromises = /* @__PURE__ */ new WeakMap();
5861
5832
  add(stream) {
5862
5833
  validateStream(stream);
5863
- if (__privateGet(this, _streams).has(stream)) {
5834
+ if (this.#streams.has(stream)) {
5864
5835
  return;
5865
5836
  }
5866
- __privateGet(this, _streams).add(stream);
5867
- _nullishCoalesce(__privateGet(this, _onFinished), () => ( __privateSet(this, _onFinished, onMergedStreamFinished(this, __privateGet(this, _streams), __privateGet(this, _unpipeEvent)))));
5837
+ this.#streams.add(stream);
5838
+ this.#onFinished ??= onMergedStreamFinished(this, this.#streams, this.#unpipeEvent);
5868
5839
  const streamPromise = endWhenStreamsDone({
5869
5840
  passThroughStream: this,
5870
5841
  stream,
5871
- streams: __privateGet(this, _streams),
5872
- ended: __privateGet(this, _ended),
5873
- aborted: __privateGet(this, _aborted),
5874
- onFinished: __privateGet(this, _onFinished),
5875
- unpipeEvent: __privateGet(this, _unpipeEvent)
5842
+ streams: this.#streams,
5843
+ ended: this.#ended,
5844
+ aborted: this.#aborted,
5845
+ onFinished: this.#onFinished,
5846
+ unpipeEvent: this.#unpipeEvent
5876
5847
  });
5877
- __privateGet(this, _streamPromises).set(stream, streamPromise);
5848
+ this.#streamPromises.set(stream, streamPromise);
5878
5849
  stream.pipe(this, { end: false });
5879
5850
  }
5880
5851
  async remove(stream) {
5881
5852
  validateStream(stream);
5882
- if (!__privateGet(this, _streams).has(stream)) {
5853
+ if (!this.#streams.has(stream)) {
5883
5854
  return false;
5884
5855
  }
5885
- const streamPromise = __privateGet(this, _streamPromises).get(stream);
5856
+ const streamPromise = this.#streamPromises.get(stream);
5886
5857
  if (streamPromise === void 0) {
5887
5858
  return false;
5888
5859
  }
5889
- __privateGet(this, _streamPromises).delete(stream);
5860
+ this.#streamPromises.delete(stream);
5890
5861
  stream.unpipe(this);
5891
5862
  await streamPromise;
5892
5863
  return true;
5893
5864
  }
5894
5865
  };
5895
- _streams = new WeakMap();
5896
- _ended = new WeakMap();
5897
- _aborted = new WeakMap();
5898
- _onFinished = new WeakMap();
5899
- _unpipeEvent = new WeakMap();
5900
- _streamPromises = new WeakMap();
5901
5866
  var onMergedStreamFinished = async (passThroughStream, streams, unpipeEvent) => {
5902
5867
  updateMaxListeners(passThroughStream, PASSTHROUGH_LISTENERS_COUNT);
5903
5868
  const controller = new AbortController();
@@ -6172,18 +6137,18 @@ var processOk = (process11) => !!process11 && typeof process11 === "object" && t
6172
6137
  var kExitEmitter = Symbol.for("signal-exit emitter");
6173
6138
  var global2 = globalThis;
6174
6139
  var ObjectDefineProperty = Object.defineProperty.bind(Object);
6175
- var Emitter = class {
6176
- constructor() {
6177
- __publicField(this, "emitted", {
6178
- afterExit: false,
6179
- exit: false
6180
- });
6181
- __publicField(this, "listeners", {
6182
- afterExit: [],
6183
- exit: []
6184
- });
6185
- __publicField(this, "count", 0);
6186
- __publicField(this, "id", Math.random());
6140
+ var Emitter = (_class2 = class {
6141
+ __init3() {this.emitted = {
6142
+ afterExit: false,
6143
+ exit: false
6144
+ }}
6145
+ __init4() {this.listeners = {
6146
+ afterExit: [],
6147
+ exit: []
6148
+ }}
6149
+ __init5() {this.count = 0}
6150
+ __init6() {this.id = Math.random()}
6151
+ constructor() {;_class2.prototype.__init3.call(this);_class2.prototype.__init4.call(this);_class2.prototype.__init5.call(this);_class2.prototype.__init6.call(this);
6187
6152
  if (global2[kExitEmitter]) {
6188
6153
  return global2[kExitEmitter];
6189
6154
  }
@@ -6223,7 +6188,7 @@ var Emitter = class {
6223
6188
  }
6224
6189
  return ret;
6225
6190
  }
6226
- };
6191
+ }, _class2);
6227
6192
  var SignalExitBase = class {
6228
6193
  };
6229
6194
  var signalExitWrap = (handler) => {
@@ -6249,129 +6214,119 @@ var SignalExitFallback = class extends SignalExitBase {
6249
6214
  unload() {
6250
6215
  }
6251
6216
  };
6252
- var _hupSig, _emitter, _process, _originalProcessEmit, _originalProcessReallyExit, _sigListeners, _loaded, _SignalExit_instances, processReallyExit_fn, processEmit_fn;
6253
6217
  var SignalExit = class extends SignalExitBase {
6218
+ // "SIGHUP" throws an `ENOSYS` error on Windows,
6219
+ // so use a supported signal instead
6220
+ /* c8 ignore start */
6221
+ #hupSig = process9.platform === "win32" ? "SIGINT" : "SIGHUP";
6222
+ /* c8 ignore stop */
6223
+ #emitter = new Emitter();
6224
+ #process;
6225
+ #originalProcessEmit;
6226
+ #originalProcessReallyExit;
6227
+ #sigListeners = {};
6228
+ #loaded = false;
6254
6229
  constructor(process11) {
6255
6230
  super();
6256
- __privateAdd(this, _SignalExit_instances);
6257
- // "SIGHUP" throws an `ENOSYS` error on Windows,
6258
- // so use a supported signal instead
6259
- /* c8 ignore start */
6260
- __privateAdd(this, _hupSig, process9.platform === "win32" ? "SIGINT" : "SIGHUP");
6261
- /* c8 ignore stop */
6262
- __privateAdd(this, _emitter, new Emitter());
6263
- __privateAdd(this, _process);
6264
- __privateAdd(this, _originalProcessEmit);
6265
- __privateAdd(this, _originalProcessReallyExit);
6266
- __privateAdd(this, _sigListeners, {});
6267
- __privateAdd(this, _loaded, false);
6268
- __privateSet(this, _process, process11);
6269
- __privateSet(this, _sigListeners, {});
6231
+ this.#process = process11;
6232
+ this.#sigListeners = {};
6270
6233
  for (const sig of signals) {
6271
- __privateGet(this, _sigListeners)[sig] = () => {
6272
- const listeners = __privateGet(this, _process).listeners(sig);
6273
- let { count: count2 } = __privateGet(this, _emitter);
6234
+ this.#sigListeners[sig] = () => {
6235
+ const listeners = this.#process.listeners(sig);
6236
+ let { count: count2 } = this.#emitter;
6274
6237
  const p3 = process11;
6275
6238
  if (typeof p3.__signal_exit_emitter__ === "object" && typeof p3.__signal_exit_emitter__.count === "number") {
6276
6239
  count2 += p3.__signal_exit_emitter__.count;
6277
6240
  }
6278
6241
  if (listeners.length === count2) {
6279
6242
  this.unload();
6280
- const ret = __privateGet(this, _emitter).emit("exit", null, sig);
6281
- const s = sig === "SIGHUP" ? __privateGet(this, _hupSig) : sig;
6243
+ const ret = this.#emitter.emit("exit", null, sig);
6244
+ const s = sig === "SIGHUP" ? this.#hupSig : sig;
6282
6245
  if (!ret)
6283
6246
  process11.kill(process11.pid, s);
6284
6247
  }
6285
6248
  };
6286
6249
  }
6287
- __privateSet(this, _originalProcessReallyExit, process11.reallyExit);
6288
- __privateSet(this, _originalProcessEmit, process11.emit);
6250
+ this.#originalProcessReallyExit = process11.reallyExit;
6251
+ this.#originalProcessEmit = process11.emit;
6289
6252
  }
6290
6253
  onExit(cb, opts) {
6291
- if (!processOk(__privateGet(this, _process))) {
6254
+ if (!processOk(this.#process)) {
6292
6255
  return () => {
6293
6256
  };
6294
6257
  }
6295
- if (__privateGet(this, _loaded) === false) {
6258
+ if (this.#loaded === false) {
6296
6259
  this.load();
6297
6260
  }
6298
6261
  const ev = _optionalChain([opts, 'optionalAccess', _33 => _33.alwaysLast]) ? "afterExit" : "exit";
6299
- __privateGet(this, _emitter).on(ev, cb);
6262
+ this.#emitter.on(ev, cb);
6300
6263
  return () => {
6301
- __privateGet(this, _emitter).removeListener(ev, cb);
6302
- if (__privateGet(this, _emitter).listeners["exit"].length === 0 && __privateGet(this, _emitter).listeners["afterExit"].length === 0) {
6264
+ this.#emitter.removeListener(ev, cb);
6265
+ if (this.#emitter.listeners["exit"].length === 0 && this.#emitter.listeners["afterExit"].length === 0) {
6303
6266
  this.unload();
6304
6267
  }
6305
6268
  };
6306
6269
  }
6307
6270
  load() {
6308
- if (__privateGet(this, _loaded)) {
6271
+ if (this.#loaded) {
6309
6272
  return;
6310
6273
  }
6311
- __privateSet(this, _loaded, true);
6312
- __privateGet(this, _emitter).count += 1;
6274
+ this.#loaded = true;
6275
+ this.#emitter.count += 1;
6313
6276
  for (const sig of signals) {
6314
6277
  try {
6315
- const fn = __privateGet(this, _sigListeners)[sig];
6278
+ const fn = this.#sigListeners[sig];
6316
6279
  if (fn)
6317
- __privateGet(this, _process).on(sig, fn);
6280
+ this.#process.on(sig, fn);
6318
6281
  } catch (_) {
6319
6282
  }
6320
6283
  }
6321
- __privateGet(this, _process).emit = (ev, ...a3) => {
6322
- return __privateMethod(this, _SignalExit_instances, processEmit_fn).call(this, ev, ...a3);
6284
+ this.#process.emit = (ev, ...a3) => {
6285
+ return this.#processEmit(ev, ...a3);
6323
6286
  };
6324
- __privateGet(this, _process).reallyExit = (code) => {
6325
- return __privateMethod(this, _SignalExit_instances, processReallyExit_fn).call(this, code);
6287
+ this.#process.reallyExit = (code) => {
6288
+ return this.#processReallyExit(code);
6326
6289
  };
6327
6290
  }
6328
6291
  unload() {
6329
- if (!__privateGet(this, _loaded)) {
6292
+ if (!this.#loaded) {
6330
6293
  return;
6331
6294
  }
6332
- __privateSet(this, _loaded, false);
6295
+ this.#loaded = false;
6333
6296
  signals.forEach((sig) => {
6334
- const listener = __privateGet(this, _sigListeners)[sig];
6297
+ const listener = this.#sigListeners[sig];
6335
6298
  if (!listener) {
6336
6299
  throw new Error("Listener not defined for signal: " + sig);
6337
6300
  }
6338
6301
  try {
6339
- __privateGet(this, _process).removeListener(sig, listener);
6302
+ this.#process.removeListener(sig, listener);
6340
6303
  } catch (_) {
6341
6304
  }
6342
6305
  });
6343
- __privateGet(this, _process).emit = __privateGet(this, _originalProcessEmit);
6344
- __privateGet(this, _process).reallyExit = __privateGet(this, _originalProcessReallyExit);
6345
- __privateGet(this, _emitter).count -= 1;
6346
- }
6347
- };
6348
- _hupSig = new WeakMap();
6349
- _emitter = new WeakMap();
6350
- _process = new WeakMap();
6351
- _originalProcessEmit = new WeakMap();
6352
- _originalProcessReallyExit = new WeakMap();
6353
- _sigListeners = new WeakMap();
6354
- _loaded = new WeakMap();
6355
- _SignalExit_instances = new WeakSet();
6356
- processReallyExit_fn = function(code) {
6357
- if (!processOk(__privateGet(this, _process))) {
6358
- return 0;
6306
+ this.#process.emit = this.#originalProcessEmit;
6307
+ this.#process.reallyExit = this.#originalProcessReallyExit;
6308
+ this.#emitter.count -= 1;
6359
6309
  }
6360
- __privateGet(this, _process).exitCode = code || 0;
6361
- __privateGet(this, _emitter).emit("exit", __privateGet(this, _process).exitCode, null);
6362
- return __privateGet(this, _originalProcessReallyExit).call(__privateGet(this, _process), __privateGet(this, _process).exitCode);
6363
- };
6364
- processEmit_fn = function(ev, ...args) {
6365
- const og = __privateGet(this, _originalProcessEmit);
6366
- if (ev === "exit" && processOk(__privateGet(this, _process))) {
6367
- if (typeof args[0] === "number") {
6368
- __privateGet(this, _process).exitCode = args[0];
6310
+ #processReallyExit(code) {
6311
+ if (!processOk(this.#process)) {
6312
+ return 0;
6313
+ }
6314
+ this.#process.exitCode = code || 0;
6315
+ this.#emitter.emit("exit", this.#process.exitCode, null);
6316
+ return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);
6317
+ }
6318
+ #processEmit(ev, ...args) {
6319
+ const og = this.#originalProcessEmit;
6320
+ if (ev === "exit" && processOk(this.#process)) {
6321
+ if (typeof args[0] === "number") {
6322
+ this.#process.exitCode = args[0];
6323
+ }
6324
+ const ret = og.call(this.#process, ev, ...args);
6325
+ this.#emitter.emit("exit", this.#process.exitCode, null);
6326
+ return ret;
6327
+ } else {
6328
+ return og.call(this.#process, ev, ...args);
6369
6329
  }
6370
- const ret = og.call(__privateGet(this, _process), ev, ...args);
6371
- __privateGet(this, _emitter).emit("exit", __privateGet(this, _process).exitCode, null);
6372
- return ret;
6373
- } else {
6374
- return og.call(__privateGet(this, _process), ev, ...args);
6375
6330
  }
6376
6331
  };
6377
6332
  var process9 = globalThis.process;
@@ -7140,7 +7095,7 @@ var waitForSubprocessResult = async ({
7140
7095
  })
7141
7096
  ]);
7142
7097
  } catch (error) {
7143
- _nullishCoalesce(context.terminationReason, () => ( (context.terminationReason = "other")));
7098
+ context.terminationReason ??= "other";
7144
7099
  return Promise.all([
7145
7100
  { error },
7146
7101
  exitPromise,
@@ -7792,6 +7747,8 @@ init_cjs_shims();
7792
7747
 
7793
7748
 
7794
7749
  var ConsolaWritable = class extends _stream.Writable {
7750
+
7751
+
7795
7752
  constructor(consola, command, opts) {
7796
7753
  super(opts);
7797
7754
  this.command = command;
@@ -7920,11 +7877,8 @@ function lowerBound(array, value, comparator) {
7920
7877
  }
7921
7878
 
7922
7879
  // ../../node_modules/.pnpm/p-queue@8.0.1/node_modules/p-queue/dist/priority-queue.js
7923
- var _queue;
7924
7880
  var PriorityQueue = class {
7925
- constructor() {
7926
- __privateAdd(this, _queue, []);
7927
- }
7881
+ #queue = [];
7928
7882
  enqueue(run, options) {
7929
7883
  options = {
7930
7884
  priority: 0,
@@ -7934,54 +7888,51 @@ var PriorityQueue = class {
7934
7888
  priority: options.priority,
7935
7889
  run
7936
7890
  };
7937
- if (this.size && __privateGet(this, _queue)[this.size - 1].priority >= options.priority) {
7938
- __privateGet(this, _queue).push(element);
7891
+ if (this.size && this.#queue[this.size - 1].priority >= options.priority) {
7892
+ this.#queue.push(element);
7939
7893
  return;
7940
7894
  }
7941
- const index = lowerBound(__privateGet(this, _queue), element, (a3, b) => b.priority - a3.priority);
7942
- __privateGet(this, _queue).splice(index, 0, element);
7895
+ const index = lowerBound(this.#queue, element, (a3, b) => b.priority - a3.priority);
7896
+ this.#queue.splice(index, 0, element);
7943
7897
  }
7944
7898
  dequeue() {
7945
- const item = __privateGet(this, _queue).shift();
7899
+ const item = this.#queue.shift();
7946
7900
  return _optionalChain([item, 'optionalAccess', _40 => _40.run]);
7947
7901
  }
7948
7902
  filter(options) {
7949
- return __privateGet(this, _queue).filter((element) => element.priority === options.priority).map((element) => element.run);
7903
+ return this.#queue.filter((element) => element.priority === options.priority).map((element) => element.run);
7950
7904
  }
7951
7905
  get size() {
7952
- return __privateGet(this, _queue).length;
7906
+ return this.#queue.length;
7953
7907
  }
7954
7908
  };
7955
- _queue = new WeakMap();
7956
7909
 
7957
7910
  // ../../node_modules/.pnpm/p-queue@8.0.1/node_modules/p-queue/dist/index.js
7958
- var _carryoverConcurrencyCount, _isIntervalIgnored, _intervalCount, _intervalCap, _interval, _intervalEnd, _intervalId, _timeoutId, _queue2, _queueClass, _pending, _concurrency, _isPaused, _throwOnTimeout, _PQueue_instances, doesIntervalAllowAnother_get, doesConcurrentAllowAnother_get, next_fn, onResumeInterval_fn, isIntervalPaused_get, tryToStartAnother_fn, initializeIntervalIfNeeded_fn, onInterval_fn, processQueue_fn, throwOnAbort_fn, onEvent_fn;
7959
7911
  var PQueue = class extends import_index.default {
7912
+ #carryoverConcurrencyCount;
7913
+ #isIntervalIgnored;
7914
+ #intervalCount = 0;
7915
+ #intervalCap;
7916
+ #interval;
7917
+ #intervalEnd = 0;
7918
+ #intervalId;
7919
+ #timeoutId;
7920
+ #queue;
7921
+ #queueClass;
7922
+ #pending = 0;
7923
+ // The `!` is needed because of https://github.com/microsoft/TypeScript/issues/32194
7924
+ #concurrency;
7925
+ #isPaused;
7926
+ #throwOnTimeout;
7927
+ /**
7928
+ Per-operation timeout in milliseconds. Operations fulfill once `timeout` elapses if they haven't already.
7929
+
7930
+ Applies to each future operation.
7931
+ */
7932
+
7960
7933
  // TODO: The `throwOnTimeout` option should affect the return types of `add()` and `addAll()`
7961
7934
  constructor(options) {
7962
7935
  super();
7963
- __privateAdd(this, _PQueue_instances);
7964
- __privateAdd(this, _carryoverConcurrencyCount);
7965
- __privateAdd(this, _isIntervalIgnored);
7966
- __privateAdd(this, _intervalCount, 0);
7967
- __privateAdd(this, _intervalCap);
7968
- __privateAdd(this, _interval);
7969
- __privateAdd(this, _intervalEnd, 0);
7970
- __privateAdd(this, _intervalId);
7971
- __privateAdd(this, _timeoutId);
7972
- __privateAdd(this, _queue2);
7973
- __privateAdd(this, _queueClass);
7974
- __privateAdd(this, _pending, 0);
7975
- // The `!` is needed because of https://github.com/microsoft/TypeScript/issues/32194
7976
- __privateAdd(this, _concurrency);
7977
- __privateAdd(this, _isPaused);
7978
- __privateAdd(this, _throwOnTimeout);
7979
- /**
7980
- Per-operation timeout in milliseconds. Operations fulfill once `timeout` elapses if they haven't already.
7981
-
7982
- Applies to each future operation.
7983
- */
7984
- __publicField(this, "timeout");
7985
7936
  options = {
7986
7937
  carryoverConcurrencyCount: false,
7987
7938
  intervalCap: Number.POSITIVE_INFINITY,
@@ -7997,37 +7948,130 @@ var PQueue = class extends import_index.default {
7997
7948
  if (options.interval === void 0 || !(Number.isFinite(options.interval) && options.interval >= 0)) {
7998
7949
  throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${_nullishCoalesce(_optionalChain([options, 'access', _44 => _44.interval, 'optionalAccess', _45 => _45.toString, 'call', _46 => _46()]), () => ( ""))}\` (${typeof options.interval})`);
7999
7950
  }
8000
- __privateSet(this, _carryoverConcurrencyCount, options.carryoverConcurrencyCount);
8001
- __privateSet(this, _isIntervalIgnored, options.intervalCap === Number.POSITIVE_INFINITY || options.interval === 0);
8002
- __privateSet(this, _intervalCap, options.intervalCap);
8003
- __privateSet(this, _interval, options.interval);
8004
- __privateSet(this, _queue2, new options.queueClass());
8005
- __privateSet(this, _queueClass, options.queueClass);
7951
+ this.#carryoverConcurrencyCount = options.carryoverConcurrencyCount;
7952
+ this.#isIntervalIgnored = options.intervalCap === Number.POSITIVE_INFINITY || options.interval === 0;
7953
+ this.#intervalCap = options.intervalCap;
7954
+ this.#interval = options.interval;
7955
+ this.#queue = new options.queueClass();
7956
+ this.#queueClass = options.queueClass;
8006
7957
  this.concurrency = options.concurrency;
8007
7958
  this.timeout = options.timeout;
8008
- __privateSet(this, _throwOnTimeout, options.throwOnTimeout === true);
8009
- __privateSet(this, _isPaused, options.autoStart === false);
7959
+ this.#throwOnTimeout = options.throwOnTimeout === true;
7960
+ this.#isPaused = options.autoStart === false;
7961
+ }
7962
+ get #doesIntervalAllowAnother() {
7963
+ return this.#isIntervalIgnored || this.#intervalCount < this.#intervalCap;
7964
+ }
7965
+ get #doesConcurrentAllowAnother() {
7966
+ return this.#pending < this.#concurrency;
7967
+ }
7968
+ #next() {
7969
+ this.#pending--;
7970
+ this.#tryToStartAnother();
7971
+ this.emit("next");
7972
+ }
7973
+ #onResumeInterval() {
7974
+ this.#onInterval();
7975
+ this.#initializeIntervalIfNeeded();
7976
+ this.#timeoutId = void 0;
7977
+ }
7978
+ get #isIntervalPaused() {
7979
+ const now = Date.now();
7980
+ if (this.#intervalId === void 0) {
7981
+ const delay = this.#intervalEnd - now;
7982
+ if (delay < 0) {
7983
+ this.#intervalCount = this.#carryoverConcurrencyCount ? this.#pending : 0;
7984
+ } else {
7985
+ if (this.#timeoutId === void 0) {
7986
+ this.#timeoutId = setTimeout(() => {
7987
+ this.#onResumeInterval();
7988
+ }, delay);
7989
+ }
7990
+ return true;
7991
+ }
7992
+ }
7993
+ return false;
7994
+ }
7995
+ #tryToStartAnother() {
7996
+ if (this.#queue.size === 0) {
7997
+ if (this.#intervalId) {
7998
+ clearInterval(this.#intervalId);
7999
+ }
8000
+ this.#intervalId = void 0;
8001
+ this.emit("empty");
8002
+ if (this.#pending === 0) {
8003
+ this.emit("idle");
8004
+ }
8005
+ return false;
8006
+ }
8007
+ if (!this.#isPaused) {
8008
+ const canInitializeInterval = !this.#isIntervalPaused;
8009
+ if (this.#doesIntervalAllowAnother && this.#doesConcurrentAllowAnother) {
8010
+ const job = this.#queue.dequeue();
8011
+ if (!job) {
8012
+ return false;
8013
+ }
8014
+ this.emit("active");
8015
+ job();
8016
+ if (canInitializeInterval) {
8017
+ this.#initializeIntervalIfNeeded();
8018
+ }
8019
+ return true;
8020
+ }
8021
+ }
8022
+ return false;
8023
+ }
8024
+ #initializeIntervalIfNeeded() {
8025
+ if (this.#isIntervalIgnored || this.#intervalId !== void 0) {
8026
+ return;
8027
+ }
8028
+ this.#intervalId = setInterval(() => {
8029
+ this.#onInterval();
8030
+ }, this.#interval);
8031
+ this.#intervalEnd = Date.now() + this.#interval;
8032
+ }
8033
+ #onInterval() {
8034
+ if (this.#intervalCount === 0 && this.#pending === 0 && this.#intervalId) {
8035
+ clearInterval(this.#intervalId);
8036
+ this.#intervalId = void 0;
8037
+ }
8038
+ this.#intervalCount = this.#carryoverConcurrencyCount ? this.#pending : 0;
8039
+ this.#processQueue();
8040
+ }
8041
+ /**
8042
+ Executes all queued functions until it reaches the limit.
8043
+ */
8044
+ #processQueue() {
8045
+ while (this.#tryToStartAnother()) {
8046
+ }
8010
8047
  }
8011
8048
  get concurrency() {
8012
- return __privateGet(this, _concurrency);
8049
+ return this.#concurrency;
8013
8050
  }
8014
8051
  set concurrency(newConcurrency) {
8015
8052
  if (!(typeof newConcurrency === "number" && newConcurrency >= 1)) {
8016
8053
  throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${newConcurrency}\` (${typeof newConcurrency})`);
8017
8054
  }
8018
- __privateSet(this, _concurrency, newConcurrency);
8019
- __privateMethod(this, _PQueue_instances, processQueue_fn).call(this);
8055
+ this.#concurrency = newConcurrency;
8056
+ this.#processQueue();
8057
+ }
8058
+ async #throwOnAbort(signal) {
8059
+ return new Promise((_resolve, reject) => {
8060
+ signal.addEventListener("abort", () => {
8061
+ reject(signal.reason);
8062
+ }, { once: true });
8063
+ });
8020
8064
  }
8021
8065
  async add(function_, options = {}) {
8022
8066
  options = {
8023
8067
  timeout: this.timeout,
8024
- throwOnTimeout: __privateGet(this, _throwOnTimeout),
8068
+ throwOnTimeout: this.#throwOnTimeout,
8025
8069
  ...options
8026
8070
  };
8027
8071
  return new Promise((resolve2, reject) => {
8028
- __privateGet(this, _queue2).enqueue(async () => {
8029
- __privateWrapper(this, _pending)._++;
8030
- __privateWrapper(this, _intervalCount)._++;
8072
+ this.#queue.enqueue(async () => {
8073
+ this.#pending++;
8074
+ this.#intervalCount++;
8031
8075
  try {
8032
8076
  _optionalChain([options, 'access', _47 => _47.signal, 'optionalAccess', _48 => _48.throwIfAborted, 'call', _49 => _49()]);
8033
8077
  let operation = function_({ signal: options.signal });
@@ -8035,7 +8079,7 @@ var PQueue = class extends import_index.default {
8035
8079
  operation = pTimeout(Promise.resolve(operation), { milliseconds: options.timeout });
8036
8080
  }
8037
8081
  if (options.signal) {
8038
- operation = Promise.race([operation, __privateMethod(this, _PQueue_instances, throwOnAbort_fn).call(this, options.signal)]);
8082
+ operation = Promise.race([operation, this.#throwOnAbort(options.signal)]);
8039
8083
  }
8040
8084
  const result = await operation;
8041
8085
  resolve2(result);
@@ -8048,11 +8092,11 @@ var PQueue = class extends import_index.default {
8048
8092
  reject(error);
8049
8093
  this.emit("error", error);
8050
8094
  } finally {
8051
- __privateMethod(this, _PQueue_instances, next_fn).call(this);
8095
+ this.#next();
8052
8096
  }
8053
8097
  }, options);
8054
8098
  this.emit("add");
8055
- __privateMethod(this, _PQueue_instances, tryToStartAnother_fn).call(this);
8099
+ this.#tryToStartAnother();
8056
8100
  });
8057
8101
  }
8058
8102
  async addAll(functions, options) {
@@ -8062,24 +8106,24 @@ var PQueue = class extends import_index.default {
8062
8106
  Start (or resume) executing enqueued tasks within concurrency limit. No need to call this if queue is not paused (via `options.autoStart = false` or by `.pause()` method.)
8063
8107
  */
8064
8108
  start() {
8065
- if (!__privateGet(this, _isPaused)) {
8109
+ if (!this.#isPaused) {
8066
8110
  return this;
8067
8111
  }
8068
- __privateSet(this, _isPaused, false);
8069
- __privateMethod(this, _PQueue_instances, processQueue_fn).call(this);
8112
+ this.#isPaused = false;
8113
+ this.#processQueue();
8070
8114
  return this;
8071
8115
  }
8072
8116
  /**
8073
8117
  Put queue execution on hold.
8074
8118
  */
8075
8119
  pause() {
8076
- __privateSet(this, _isPaused, true);
8120
+ this.#isPaused = true;
8077
8121
  }
8078
8122
  /**
8079
8123
  Clear the queue.
8080
8124
  */
8081
8125
  clear() {
8082
- __privateSet(this, _queue2, new (__privateGet(this, _queueClass))());
8126
+ this.#queue = new this.#queueClass();
8083
8127
  }
8084
8128
  /**
8085
8129
  Can be called multiple times. Useful if you for example add additional items at a later time.
@@ -8087,10 +8131,10 @@ var PQueue = class extends import_index.default {
8087
8131
  @returns A promise that settles when the queue becomes empty.
8088
8132
  */
8089
8133
  async onEmpty() {
8090
- if (__privateGet(this, _queue2).size === 0) {
8134
+ if (this.#queue.size === 0) {
8091
8135
  return;
8092
8136
  }
8093
- await __privateMethod(this, _PQueue_instances, onEvent_fn).call(this, "empty");
8137
+ await this.#onEvent("empty");
8094
8138
  }
8095
8139
  /**
8096
8140
  @returns A promise that settles when the queue size is less than the given limit: `queue.size < limit`.
@@ -8100,10 +8144,10 @@ var PQueue = class extends import_index.default {
8100
8144
  Note that this only limits the number of items waiting to start. There could still be up to `concurrency` jobs already running that this call does not include in its calculation.
8101
8145
  */
8102
8146
  async onSizeLessThan(limit) {
8103
- if (__privateGet(this, _queue2).size < limit) {
8147
+ if (this.#queue.size < limit) {
8104
8148
  return;
8105
8149
  }
8106
- await __privateMethod(this, _PQueue_instances, onEvent_fn).call(this, "next", () => __privateGet(this, _queue2).size < limit);
8150
+ await this.#onEvent("next", () => this.#queue.size < limit);
8107
8151
  }
8108
8152
  /**
8109
8153
  The difference with `.onEmpty` is that `.onIdle` guarantees that all work from the queue has finished. `.onEmpty` merely signals that the queue is empty, but it could mean that some promises haven't completed yet.
@@ -8111,16 +8155,28 @@ var PQueue = class extends import_index.default {
8111
8155
  @returns A promise that settles when the queue becomes empty, and all promises have completed; `queue.size === 0 && queue.pending === 0`.
8112
8156
  */
8113
8157
  async onIdle() {
8114
- if (__privateGet(this, _pending) === 0 && __privateGet(this, _queue2).size === 0) {
8158
+ if (this.#pending === 0 && this.#queue.size === 0) {
8115
8159
  return;
8116
8160
  }
8117
- await __privateMethod(this, _PQueue_instances, onEvent_fn).call(this, "idle");
8161
+ await this.#onEvent("idle");
8162
+ }
8163
+ async #onEvent(event, filter) {
8164
+ return new Promise((resolve2) => {
8165
+ const listener = () => {
8166
+ if (filter && !filter()) {
8167
+ return;
8168
+ }
8169
+ this.off(event, listener);
8170
+ resolve2();
8171
+ };
8172
+ this.on(event, listener);
8173
+ });
8118
8174
  }
8119
8175
  /**
8120
8176
  Size of the queue, the number of queued items waiting to run.
8121
8177
  */
8122
8178
  get size() {
8123
- return __privateGet(this, _queue2).size;
8179
+ return this.#queue.size;
8124
8180
  }
8125
8181
  /**
8126
8182
  Size of the queue, filtered by the given options.
@@ -8128,140 +8184,20 @@ var PQueue = class extends import_index.default {
8128
8184
  For example, this can be used to find the number of items remaining in the queue with a specific priority level.
8129
8185
  */
8130
8186
  sizeBy(options) {
8131
- return __privateGet(this, _queue2).filter(options).length;
8187
+ return this.#queue.filter(options).length;
8132
8188
  }
8133
8189
  /**
8134
8190
  Number of running items (no longer in the queue).
8135
8191
  */
8136
8192
  get pending() {
8137
- return __privateGet(this, _pending);
8193
+ return this.#pending;
8138
8194
  }
8139
8195
  /**
8140
8196
  Whether the queue is currently paused.
8141
8197
  */
8142
8198
  get isPaused() {
8143
- return __privateGet(this, _isPaused);
8144
- }
8145
- };
8146
- _carryoverConcurrencyCount = new WeakMap();
8147
- _isIntervalIgnored = new WeakMap();
8148
- _intervalCount = new WeakMap();
8149
- _intervalCap = new WeakMap();
8150
- _interval = new WeakMap();
8151
- _intervalEnd = new WeakMap();
8152
- _intervalId = new WeakMap();
8153
- _timeoutId = new WeakMap();
8154
- _queue2 = new WeakMap();
8155
- _queueClass = new WeakMap();
8156
- _pending = new WeakMap();
8157
- _concurrency = new WeakMap();
8158
- _isPaused = new WeakMap();
8159
- _throwOnTimeout = new WeakMap();
8160
- _PQueue_instances = new WeakSet();
8161
- doesIntervalAllowAnother_get = function() {
8162
- return __privateGet(this, _isIntervalIgnored) || __privateGet(this, _intervalCount) < __privateGet(this, _intervalCap);
8163
- };
8164
- doesConcurrentAllowAnother_get = function() {
8165
- return __privateGet(this, _pending) < __privateGet(this, _concurrency);
8166
- };
8167
- next_fn = function() {
8168
- __privateWrapper(this, _pending)._--;
8169
- __privateMethod(this, _PQueue_instances, tryToStartAnother_fn).call(this);
8170
- this.emit("next");
8171
- };
8172
- onResumeInterval_fn = function() {
8173
- __privateMethod(this, _PQueue_instances, onInterval_fn).call(this);
8174
- __privateMethod(this, _PQueue_instances, initializeIntervalIfNeeded_fn).call(this);
8175
- __privateSet(this, _timeoutId, void 0);
8176
- };
8177
- isIntervalPaused_get = function() {
8178
- const now = Date.now();
8179
- if (__privateGet(this, _intervalId) === void 0) {
8180
- const delay = __privateGet(this, _intervalEnd) - now;
8181
- if (delay < 0) {
8182
- __privateSet(this, _intervalCount, __privateGet(this, _carryoverConcurrencyCount) ? __privateGet(this, _pending) : 0);
8183
- } else {
8184
- if (__privateGet(this, _timeoutId) === void 0) {
8185
- __privateSet(this, _timeoutId, setTimeout(() => {
8186
- __privateMethod(this, _PQueue_instances, onResumeInterval_fn).call(this);
8187
- }, delay));
8188
- }
8189
- return true;
8190
- }
8191
- }
8192
- return false;
8193
- };
8194
- tryToStartAnother_fn = function() {
8195
- if (__privateGet(this, _queue2).size === 0) {
8196
- if (__privateGet(this, _intervalId)) {
8197
- clearInterval(__privateGet(this, _intervalId));
8198
- }
8199
- __privateSet(this, _intervalId, void 0);
8200
- this.emit("empty");
8201
- if (__privateGet(this, _pending) === 0) {
8202
- this.emit("idle");
8203
- }
8204
- return false;
8205
- }
8206
- if (!__privateGet(this, _isPaused)) {
8207
- const canInitializeInterval = !__privateGet(this, _PQueue_instances, isIntervalPaused_get);
8208
- if (__privateGet(this, _PQueue_instances, doesIntervalAllowAnother_get) && __privateGet(this, _PQueue_instances, doesConcurrentAllowAnother_get)) {
8209
- const job = __privateGet(this, _queue2).dequeue();
8210
- if (!job) {
8211
- return false;
8212
- }
8213
- this.emit("active");
8214
- job();
8215
- if (canInitializeInterval) {
8216
- __privateMethod(this, _PQueue_instances, initializeIntervalIfNeeded_fn).call(this);
8217
- }
8218
- return true;
8219
- }
8199
+ return this.#isPaused;
8220
8200
  }
8221
- return false;
8222
- };
8223
- initializeIntervalIfNeeded_fn = function() {
8224
- if (__privateGet(this, _isIntervalIgnored) || __privateGet(this, _intervalId) !== void 0) {
8225
- return;
8226
- }
8227
- __privateSet(this, _intervalId, setInterval(() => {
8228
- __privateMethod(this, _PQueue_instances, onInterval_fn).call(this);
8229
- }, __privateGet(this, _interval)));
8230
- __privateSet(this, _intervalEnd, Date.now() + __privateGet(this, _interval));
8231
- };
8232
- onInterval_fn = function() {
8233
- if (__privateGet(this, _intervalCount) === 0 && __privateGet(this, _pending) === 0 && __privateGet(this, _intervalId)) {
8234
- clearInterval(__privateGet(this, _intervalId));
8235
- __privateSet(this, _intervalId, void 0);
8236
- }
8237
- __privateSet(this, _intervalCount, __privateGet(this, _carryoverConcurrencyCount) ? __privateGet(this, _pending) : 0);
8238
- __privateMethod(this, _PQueue_instances, processQueue_fn).call(this);
8239
- };
8240
- /**
8241
- Executes all queued functions until it reaches the limit.
8242
- */
8243
- processQueue_fn = function() {
8244
- while (__privateMethod(this, _PQueue_instances, tryToStartAnother_fn).call(this)) {
8245
- }
8246
- };
8247
- throwOnAbort_fn = async function(signal) {
8248
- return new Promise((_resolve, reject) => {
8249
- signal.addEventListener("abort", () => {
8250
- reject(signal.reason);
8251
- }, { once: true });
8252
- });
8253
- };
8254
- onEvent_fn = async function(event, filter) {
8255
- return new Promise((resolve2) => {
8256
- const listener = () => {
8257
- if (filter && !filter()) {
8258
- return;
8259
- }
8260
- this.off(event, listener);
8261
- resolve2();
8262
- };
8263
- this.on(event, listener);
8264
- });
8265
8201
  };
8266
8202
 
8267
8203
  // src/utils/executeHooks.ts
@@ -8315,29 +8251,17 @@ function parseHrtimeToSeconds(hrtime2) {
8315
8251
  }
8316
8252
 
8317
8253
  // src/utils/getSummary.ts
8318
- function getSummary({ pluginManager, status, hrStart, config }) {
8254
+ function getSummary({ pluginManager, filesCreated, status, hrStart, config }) {
8319
8255
  const logs = [];
8320
8256
  const elapsedSeconds = parseHrtimeToSeconds(process.hrtime(hrStart));
8321
8257
  const buildStartPlugins = pluginManager.executed.filter((item) => item.hookName === "buildStart" && item.plugin.name !== "core").map((item) => item.plugin.name);
8322
8258
  const buildEndPlugins = pluginManager.executed.filter((item) => item.hookName === "buildEnd" && item.plugin.name !== "core").map((item) => item.plugin.name);
8323
8259
  const failedPlugins = _optionalChain([config, 'access', _51 => _51.plugins, 'optionalAccess', _52 => _52.filter, 'call', _53 => _53((plugin) => !buildEndPlugins.includes(plugin.name)), 'optionalAccess', _54 => _54.map, 'call', _55 => _55((plugin) => plugin.name)]);
8324
8260
  const pluginsCount = _optionalChain([config, 'access', _56 => _56.plugins, 'optionalAccess', _57 => _57.length]) || 0;
8325
- const files = pluginManager.fileManager.files.sort((a3, b) => {
8326
- if (!_optionalChain([a3, 'access', _58 => _58.meta, 'optionalAccess', _59 => _59.pluginKey, 'optionalAccess', _60 => _60[0]]) || !_optionalChain([b, 'access', _61 => _61.meta, 'optionalAccess', _62 => _62.pluginKey, 'optionalAccess', _63 => _63[0]])) {
8327
- return 0;
8328
- }
8329
- if (_optionalChain([a3, 'access', _64 => _64.meta, 'optionalAccess', _65 => _65.pluginKey, 'optionalAccess', _66 => _66[0], 'optionalAccess', _67 => _67.length]) < _optionalChain([b, 'access', _68 => _68.meta, 'optionalAccess', _69 => _69.pluginKey, 'optionalAccess', _70 => _70[0], 'optionalAccess', _71 => _71.length])) {
8330
- return 1;
8331
- }
8332
- if (_optionalChain([a3, 'access', _72 => _72.meta, 'optionalAccess', _73 => _73.pluginKey, 'optionalAccess', _74 => _74[0], 'optionalAccess', _75 => _75.length]) > _optionalChain([b, 'access', _76 => _76.meta, 'optionalAccess', _77 => _77.pluginKey, 'optionalAccess', _78 => _78[0], 'optionalAccess', _79 => _79.length])) {
8333
- return -1;
8334
- }
8335
- return 0;
8336
- });
8337
8261
  const meta = {
8338
- plugins: status === "success" ? `${p2.green(`${buildStartPlugins.length} successful`)}, ${pluginsCount} total` : `${p2.red(`${_nullishCoalesce(_optionalChain([failedPlugins, 'optionalAccess', _80 => _80.length]), () => ( 1))} failed`)}, ${pluginsCount} total`,
8339
- pluginsFailed: status === "failed" ? _optionalChain([failedPlugins, 'optionalAccess', _81 => _81.map, 'call', _82 => _82((name) => _logger.randomCliColour.call(void 0, name)), 'optionalAccess', _83 => _83.join, 'call', _84 => _84(", ")]) : void 0,
8340
- filesCreated: files.length,
8262
+ plugins: status === "success" ? `${p2.green(`${buildStartPlugins.length} successful`)}, ${pluginsCount} total` : `${p2.red(`${_nullishCoalesce(_optionalChain([failedPlugins, 'optionalAccess', _58 => _58.length]), () => ( 1))} failed`)}, ${pluginsCount} total`,
8263
+ pluginsFailed: status === "failed" ? _optionalChain([failedPlugins, 'optionalAccess', _59 => _59.map, 'call', _60 => _60((name) => _logger.randomCliColour.call(void 0, name)), 'optionalAccess', _61 => _61.join, 'call', _62 => _62(", ")]) : void 0,
8264
+ filesCreated,
8341
8265
  time: `${p2.yellow(`${elapsedSeconds}s`)}`,
8342
8266
  output: _path2.default.isAbsolute(config.root) ? _path2.default.resolve(config.root, config.output.path) : config.root
8343
8267
  };
@@ -8378,7 +8302,6 @@ async function writeLog({ data, override, fileName = "kubb.log" }) {
8378
8302
  }
8379
8303
 
8380
8304
  // src/generate.ts
8381
-
8382
8305
  var _cliprogress = require('cli-progress');
8383
8306
  async function generate({ input, config, args }) {
8384
8307
  const logLevel = _logger.LogMapper[args.logLevel] || 3;
@@ -8388,13 +8311,14 @@ async function generate({ input, config, args }) {
8388
8311
  });
8389
8312
  const progressBars = {};
8390
8313
  logger.on("progress_start", ({ id, size }) => {
8391
- _optionalChain([logger, 'access', _85 => _85.consola, 'optionalAccess', _86 => _86.pauseLogs, 'call', _87 => _87()]);
8314
+ _optionalChain([logger, 'access', _63 => _63.consola, 'optionalAccess', _64 => _64.pauseLogs, 'call', _65 => _65()]);
8392
8315
  if (!progressBars[id]) {
8393
8316
  progressBars[id] = new (0, _cliprogress.SingleBar)(
8394
8317
  {
8395
- format: logLevel === _logger.LogMapper.info ? "{percentage}% {bar} {value}/{total} {id} | {data}" : "{percentage}% {bar} ETA: {eta}s",
8318
+ format: logLevel === _logger.LogMapper.info ? "{percentage}% {bar} {value}/{total} {id} | {data} | ETA: {eta_formatted} | Duration: {duration_formatted} " : "{percentage}% {bar} ETA: {eta_formatted}",
8396
8319
  barsize: 25,
8397
- clearOnComplete: true
8320
+ clearOnComplete: true,
8321
+ emptyOnZero: true
8398
8322
  },
8399
8323
  _cliprogress.Presets.shades_grey
8400
8324
  );
@@ -8403,16 +8327,16 @@ async function generate({ input, config, args }) {
8403
8327
  });
8404
8328
  logger.on("progress_stop", ({ id }) => {
8405
8329
  const progressBar = progressBars[id];
8406
- _optionalChain([progressBar, 'optionalAccess', _88 => _88.stop, 'call', _89 => _89()]);
8407
- _optionalChain([logger, 'access', _90 => _90.consola, 'optionalAccess', _91 => _91.resumeLogs, 'call', _92 => _92()]);
8330
+ _optionalChain([progressBar, 'optionalAccess', _66 => _66.stop, 'call', _67 => _67()]);
8331
+ _optionalChain([logger, 'access', _68 => _68.consola, 'optionalAccess', _69 => _69.resumeLogs, 'call', _70 => _70()]);
8408
8332
  });
8409
8333
  logger.on("progress", ({ id, count: count2, data = "" }) => {
8410
8334
  const progressBar = progressBars[id];
8411
8335
  const payload = { id, data };
8412
8336
  if (count2) {
8413
- _optionalChain([progressBar, 'optionalAccess', _93 => _93.update, 'call', _94 => _94(count2, payload)]);
8337
+ _optionalChain([progressBar, 'optionalAccess', _71 => _71.update, 'call', _72 => _72(count2, payload)]);
8414
8338
  } else {
8415
- _optionalChain([progressBar, 'optionalAccess', _95 => _95.increment, 'call', _96 => _96(1, payload)]);
8339
+ _optionalChain([progressBar, 'optionalAccess', _73 => _73.increment, 'call', _74 => _74(1, payload)]);
8416
8340
  }
8417
8341
  });
8418
8342
  logger.on("debug", async ({ logs, override, fileName }) => {
@@ -8430,15 +8354,17 @@ async function generate({ input, config, args }) {
8430
8354
  } : userConfig.input,
8431
8355
  output: {
8432
8356
  write: true,
8357
+ exportType: "barrelNamed",
8433
8358
  ...userConfig.output
8434
8359
  }
8435
8360
  };
8436
8361
  const hrStart = process.hrtime();
8437
- const { pluginManager, error } = await _core.safeBuild.call(void 0, {
8362
+ const { pluginManager, files, error } = await _core.safeBuild.call(void 0, {
8438
8363
  config: definedConfig,
8439
8364
  logger
8440
8365
  });
8441
8366
  const summary = getSummary({
8367
+ filesCreated: files.length,
8442
8368
  pluginManager,
8443
8369
  config: definedConfig,
8444
8370
  status: error ? "failed" : "success",
@@ -8446,6 +8372,7 @@ async function generate({ input, config, args }) {
8446
8372
  logger
8447
8373
  });
8448
8374
  if (error && logger.consola) {
8375
+ _optionalChain([logger, 'access', _75 => _75.consola, 'optionalAccess', _76 => _76.resumeLogs, 'call', _77 => _77()]);
8449
8376
  logger.consola.error(`Build failed ${logLevel !== _logger.LogMapper.silent ? p2.dim(inputPath) : ""}`);
8450
8377
  logger.consola.box({
8451
8378
  title: `${config.name || ""}`,
@@ -8459,17 +8386,17 @@ async function generate({ input, config, args }) {
8459
8386
  const errors = getErrorCauses([error]);
8460
8387
  if (logger.consola && errors.length && logLevel === _logger.LogMapper.debug) {
8461
8388
  errors.forEach((err) => {
8462
- _optionalChain([logger, 'access', _97 => _97.consola, 'optionalAccess', _98 => _98.error, 'call', _99 => _99(err)]);
8389
+ _optionalChain([logger, 'access', _78 => _78.consola, 'optionalAccess', _79 => _79.error, 'call', _80 => _80(err)]);
8463
8390
  });
8464
8391
  }
8465
- _optionalChain([logger, 'access', _100 => _100.consola, 'optionalAccess', _101 => _101.error, 'call', _102 => _102(error)]);
8392
+ _optionalChain([logger, 'access', _81 => _81.consola, 'optionalAccess', _82 => _82.error, 'call', _83 => _83(error)]);
8466
8393
  process.exit(0);
8467
8394
  }
8468
8395
  if (config.hooks) {
8469
8396
  await executeHooks({ hooks: config.hooks, logger });
8470
8397
  }
8471
- _optionalChain([logger, 'access', _103 => _103.consola, 'optionalAccess', _104 => _104.log, 'call', _105 => _105(`\u26A1Build completed ${logLevel !== _logger.LogMapper.silent ? p2.dim(inputPath) : ""}`)]);
8472
- _optionalChain([logger, 'access', _106 => _106.consola, 'optionalAccess', _107 => _107.box, 'call', _108 => _108({
8398
+ _optionalChain([logger, 'access', _84 => _84.consola, 'optionalAccess', _85 => _85.log, 'call', _86 => _86(`\u26A1Build completed ${logLevel !== _logger.LogMapper.silent ? p2.dim(inputPath) : ""}`)]);
8399
+ _optionalChain([logger, 'access', _87 => _87.consola, 'optionalAccess', _88 => _88.box, 'call', _89 => _89({
8473
8400
  title: `${config.name || ""}`,
8474
8401
  message: summary.join(""),
8475
8402
  style: {
@@ -8486,4 +8413,4 @@ async function generate({ input, config, args }) {
8486
8413
 
8487
8414
 
8488
8415
  exports.init_cjs_shims = init_cjs_shims; exports.p = p2; exports.execa = execa; exports.generate = generate;
8489
- //# sourceMappingURL=chunk-MXBF3FNZ.cjs.map
8416
+ //# sourceMappingURL=chunk-WV2IQQKV.cjs.map