@kubb/cli 3.0.0-alpha.4 → 3.0.0-alpha.6
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.
- package/dist/{chunk-Y35VLSP2.js → chunk-7EOWZACL.js} +62 -43
- package/dist/chunk-7EOWZACL.js.map +1 -0
- package/dist/{chunk-7CMTKETP.cjs → chunk-MXBF3FNZ.cjs} +775 -125
- package/dist/chunk-MXBF3FNZ.cjs.map +1 -0
- package/dist/{generate-FHYQHKKR.js → generate-B6YVAUQK.js} +4 -4
- package/dist/generate-B6YVAUQK.js.map +1 -0
- package/dist/{generate-ZGEX2WSJ.cjs → generate-D5R4IXLS.cjs} +16 -16
- package/dist/{generate-ZGEX2WSJ.cjs.map → generate-D5R4IXLS.cjs.map} +1 -1
- package/dist/index.cjs +6 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/package.json +7 -6
- package/src/commands/generate.ts +2 -2
- package/src/generate.ts +42 -34
- package/src/utils/Writables.ts +2 -22
- package/src/utils/executeHooks.ts +14 -20
- package/src/utils/getSummary.ts +5 -12
- package/src/utils/writeLog.ts +13 -3
- package/dist/chunk-7CMTKETP.cjs.map +0 -1
- package/dist/chunk-Y35VLSP2.js.map +0 -1
- package/dist/generate-FHYQHKKR.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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 __create = Object.create;
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -42,6 +42,14 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
|
|
|
42
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
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
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
|
+
});
|
|
45
53
|
|
|
46
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
|
|
47
55
|
var init_cjs_shims = __esm({
|
|
@@ -564,6 +572,169 @@ var require_cross_spawn = __commonJS({
|
|
|
564
572
|
}
|
|
565
573
|
});
|
|
566
574
|
|
|
575
|
+
// ../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.js
|
|
576
|
+
var require_eventemitter3 = __commonJS({
|
|
577
|
+
"../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.js"(exports, module) {
|
|
578
|
+
"use strict";
|
|
579
|
+
init_cjs_shims();
|
|
580
|
+
var has = Object.prototype.hasOwnProperty;
|
|
581
|
+
var prefix = "~";
|
|
582
|
+
function Events() {
|
|
583
|
+
}
|
|
584
|
+
if (Object.create) {
|
|
585
|
+
Events.prototype = /* @__PURE__ */ Object.create(null);
|
|
586
|
+
if (!new Events().__proto__) prefix = false;
|
|
587
|
+
}
|
|
588
|
+
function EE(fn, context, once9) {
|
|
589
|
+
this.fn = fn;
|
|
590
|
+
this.context = context;
|
|
591
|
+
this.once = once9 || false;
|
|
592
|
+
}
|
|
593
|
+
function addListener(emitter, event, fn, context, once9) {
|
|
594
|
+
if (typeof fn !== "function") {
|
|
595
|
+
throw new TypeError("The listener must be a function");
|
|
596
|
+
}
|
|
597
|
+
var listener = new EE(fn, context || emitter, once9), evt = prefix ? prefix + event : event;
|
|
598
|
+
if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;
|
|
599
|
+
else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);
|
|
600
|
+
else emitter._events[evt] = [emitter._events[evt], listener];
|
|
601
|
+
return emitter;
|
|
602
|
+
}
|
|
603
|
+
function clearEvent(emitter, evt) {
|
|
604
|
+
if (--emitter._eventsCount === 0) emitter._events = new Events();
|
|
605
|
+
else delete emitter._events[evt];
|
|
606
|
+
}
|
|
607
|
+
function EventEmitter3() {
|
|
608
|
+
this._events = new Events();
|
|
609
|
+
this._eventsCount = 0;
|
|
610
|
+
}
|
|
611
|
+
EventEmitter3.prototype.eventNames = function eventNames() {
|
|
612
|
+
var names = [], events, name;
|
|
613
|
+
if (this._eventsCount === 0) return names;
|
|
614
|
+
for (name in events = this._events) {
|
|
615
|
+
if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);
|
|
616
|
+
}
|
|
617
|
+
if (Object.getOwnPropertySymbols) {
|
|
618
|
+
return names.concat(Object.getOwnPropertySymbols(events));
|
|
619
|
+
}
|
|
620
|
+
return names;
|
|
621
|
+
};
|
|
622
|
+
EventEmitter3.prototype.listeners = function listeners(event) {
|
|
623
|
+
var evt = prefix ? prefix + event : event, handlers = this._events[evt];
|
|
624
|
+
if (!handlers) return [];
|
|
625
|
+
if (handlers.fn) return [handlers.fn];
|
|
626
|
+
for (var i2 = 0, l = handlers.length, ee = new Array(l); i2 < l; i2++) {
|
|
627
|
+
ee[i2] = handlers[i2].fn;
|
|
628
|
+
}
|
|
629
|
+
return ee;
|
|
630
|
+
};
|
|
631
|
+
EventEmitter3.prototype.listenerCount = function listenerCount(event) {
|
|
632
|
+
var evt = prefix ? prefix + event : event, listeners = this._events[evt];
|
|
633
|
+
if (!listeners) return 0;
|
|
634
|
+
if (listeners.fn) return 1;
|
|
635
|
+
return listeners.length;
|
|
636
|
+
};
|
|
637
|
+
EventEmitter3.prototype.emit = function emit(event, a1, a22, a3, a4, a5) {
|
|
638
|
+
var evt = prefix ? prefix + event : event;
|
|
639
|
+
if (!this._events[evt]) return false;
|
|
640
|
+
var listeners = this._events[evt], len = arguments.length, args, i2;
|
|
641
|
+
if (listeners.fn) {
|
|
642
|
+
if (listeners.once) this.removeListener(event, listeners.fn, void 0, true);
|
|
643
|
+
switch (len) {
|
|
644
|
+
case 1:
|
|
645
|
+
return listeners.fn.call(listeners.context), true;
|
|
646
|
+
case 2:
|
|
647
|
+
return listeners.fn.call(listeners.context, a1), true;
|
|
648
|
+
case 3:
|
|
649
|
+
return listeners.fn.call(listeners.context, a1, a22), true;
|
|
650
|
+
case 4:
|
|
651
|
+
return listeners.fn.call(listeners.context, a1, a22, a3), true;
|
|
652
|
+
case 5:
|
|
653
|
+
return listeners.fn.call(listeners.context, a1, a22, a3, a4), true;
|
|
654
|
+
case 6:
|
|
655
|
+
return listeners.fn.call(listeners.context, a1, a22, a3, a4, a5), true;
|
|
656
|
+
}
|
|
657
|
+
for (i2 = 1, args = new Array(len - 1); i2 < len; i2++) {
|
|
658
|
+
args[i2 - 1] = arguments[i2];
|
|
659
|
+
}
|
|
660
|
+
listeners.fn.apply(listeners.context, args);
|
|
661
|
+
} else {
|
|
662
|
+
var length = listeners.length, j;
|
|
663
|
+
for (i2 = 0; i2 < length; i2++) {
|
|
664
|
+
if (listeners[i2].once) this.removeListener(event, listeners[i2].fn, void 0, true);
|
|
665
|
+
switch (len) {
|
|
666
|
+
case 1:
|
|
667
|
+
listeners[i2].fn.call(listeners[i2].context);
|
|
668
|
+
break;
|
|
669
|
+
case 2:
|
|
670
|
+
listeners[i2].fn.call(listeners[i2].context, a1);
|
|
671
|
+
break;
|
|
672
|
+
case 3:
|
|
673
|
+
listeners[i2].fn.call(listeners[i2].context, a1, a22);
|
|
674
|
+
break;
|
|
675
|
+
case 4:
|
|
676
|
+
listeners[i2].fn.call(listeners[i2].context, a1, a22, a3);
|
|
677
|
+
break;
|
|
678
|
+
default:
|
|
679
|
+
if (!args) for (j = 1, args = new Array(len - 1); j < len; j++) {
|
|
680
|
+
args[j - 1] = arguments[j];
|
|
681
|
+
}
|
|
682
|
+
listeners[i2].fn.apply(listeners[i2].context, args);
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
return true;
|
|
687
|
+
};
|
|
688
|
+
EventEmitter3.prototype.on = function on6(event, fn, context) {
|
|
689
|
+
return addListener(this, event, fn, context, false);
|
|
690
|
+
};
|
|
691
|
+
EventEmitter3.prototype.once = function once9(event, fn, context) {
|
|
692
|
+
return addListener(this, event, fn, context, true);
|
|
693
|
+
};
|
|
694
|
+
EventEmitter3.prototype.removeListener = function removeListener(event, fn, context, once9) {
|
|
695
|
+
var evt = prefix ? prefix + event : event;
|
|
696
|
+
if (!this._events[evt]) return this;
|
|
697
|
+
if (!fn) {
|
|
698
|
+
clearEvent(this, evt);
|
|
699
|
+
return this;
|
|
700
|
+
}
|
|
701
|
+
var listeners = this._events[evt];
|
|
702
|
+
if (listeners.fn) {
|
|
703
|
+
if (listeners.fn === fn && (!once9 || listeners.once) && (!context || listeners.context === context)) {
|
|
704
|
+
clearEvent(this, evt);
|
|
705
|
+
}
|
|
706
|
+
} else {
|
|
707
|
+
for (var i2 = 0, events = [], length = listeners.length; i2 < length; i2++) {
|
|
708
|
+
if (listeners[i2].fn !== fn || once9 && !listeners[i2].once || context && listeners[i2].context !== context) {
|
|
709
|
+
events.push(listeners[i2]);
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;
|
|
713
|
+
else clearEvent(this, evt);
|
|
714
|
+
}
|
|
715
|
+
return this;
|
|
716
|
+
};
|
|
717
|
+
EventEmitter3.prototype.removeAllListeners = function removeAllListeners(event) {
|
|
718
|
+
var evt;
|
|
719
|
+
if (event) {
|
|
720
|
+
evt = prefix ? prefix + event : event;
|
|
721
|
+
if (this._events[evt]) clearEvent(this, evt);
|
|
722
|
+
} else {
|
|
723
|
+
this._events = new Events();
|
|
724
|
+
this._eventsCount = 0;
|
|
725
|
+
}
|
|
726
|
+
return this;
|
|
727
|
+
};
|
|
728
|
+
EventEmitter3.prototype.off = EventEmitter3.prototype.removeListener;
|
|
729
|
+
EventEmitter3.prototype.addListener = EventEmitter3.prototype.on;
|
|
730
|
+
EventEmitter3.prefixed = prefix;
|
|
731
|
+
EventEmitter3.EventEmitter = EventEmitter3;
|
|
732
|
+
if ("undefined" !== typeof module) {
|
|
733
|
+
module.exports = EventEmitter3;
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
});
|
|
737
|
+
|
|
567
738
|
// ../../node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/node.js
|
|
568
739
|
init_cjs_shims();
|
|
569
740
|
|
|
@@ -839,17 +1010,17 @@ var parseExpression = (expression) => {
|
|
|
839
1010
|
}
|
|
840
1011
|
throw new TypeError(`Unexpected "${typeOfExpression}" in template expression`);
|
|
841
1012
|
};
|
|
842
|
-
var getSubprocessResult = ({ stdout }) => {
|
|
843
|
-
if (typeof
|
|
844
|
-
return
|
|
1013
|
+
var getSubprocessResult = ({ stdout: stdout2 }) => {
|
|
1014
|
+
if (typeof stdout2 === "string") {
|
|
1015
|
+
return stdout2;
|
|
845
1016
|
}
|
|
846
|
-
if (isUint8Array(
|
|
847
|
-
return uint8ArrayToString(
|
|
1017
|
+
if (isUint8Array(stdout2)) {
|
|
1018
|
+
return uint8ArrayToString(stdout2);
|
|
848
1019
|
}
|
|
849
|
-
if (
|
|
1020
|
+
if (stdout2 === void 0) {
|
|
850
1021
|
throw new TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`);
|
|
851
1022
|
}
|
|
852
|
-
throw new TypeError(`Unexpected "${typeof
|
|
1023
|
+
throw new TypeError(`Unexpected "${typeof stdout2}" stdout in template expression`);
|
|
853
1024
|
};
|
|
854
1025
|
|
|
855
1026
|
// ../../node_modules/.pnpm/execa@9.3.1/node_modules/execa/lib/methods/main-sync.js
|
|
@@ -871,9 +1042,9 @@ var _util = require('util');
|
|
|
871
1042
|
|
|
872
1043
|
// ../../node_modules/.pnpm/execa@9.3.1/node_modules/execa/lib/utils/standard-stream.js
|
|
873
1044
|
init_cjs_shims();
|
|
874
|
-
var _process2 = require('process'); var
|
|
1045
|
+
var _process2 = require('process'); var process10 = _interopRequireWildcard(_process2);
|
|
875
1046
|
var isStandardStream = (stream) => STANDARD_STREAMS.includes(stream);
|
|
876
|
-
var STANDARD_STREAMS = [
|
|
1047
|
+
var STANDARD_STREAMS = [process10.default.stdin, process10.default.stdout, process10.default.stderr];
|
|
877
1048
|
var STANDARD_STREAMS_ALIASES = ["stdin", "stdout", "stderr"];
|
|
878
1049
|
var getStreamName = (fdNumber) => _nullishCoalesce(STANDARD_STREAMS_ALIASES[fdNumber], () => ( `stdio[${fdNumber}]`));
|
|
879
1050
|
|
|
@@ -1020,10 +1191,10 @@ init_cjs_shims();
|
|
|
1020
1191
|
init_cjs_shims();
|
|
1021
1192
|
|
|
1022
1193
|
function isUnicodeSupported() {
|
|
1023
|
-
if (
|
|
1024
|
-
return
|
|
1194
|
+
if (process10.default.platform !== "win32") {
|
|
1195
|
+
return process10.default.env.TERM !== "linux";
|
|
1025
1196
|
}
|
|
1026
|
-
return Boolean(
|
|
1197
|
+
return Boolean(process10.default.env.WT_SESSION) || Boolean(process10.default.env.TERMINUS_SUBLIME) || process10.default.env.ConEmuTask === "{cmd::Cmder}" || process10.default.env.TERM_PROGRAM === "Terminus-Sublime" || process10.default.env.TERM_PROGRAM === "vscode" || process10.default.env.TERM === "xterm-256color" || process10.default.env.TERM === "alacritty" || process10.default.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
1027
1198
|
}
|
|
1028
1199
|
|
|
1029
1200
|
// ../../node_modules/.pnpm/figures@6.1.0/node_modules/figures/index.js
|
|
@@ -1550,10 +1721,10 @@ function pathKey(options = {}) {
|
|
|
1550
1721
|
|
|
1551
1722
|
// ../../node_modules/.pnpm/npm-run-path@5.3.0/node_modules/npm-run-path/index.js
|
|
1552
1723
|
var npmRunPath = ({
|
|
1553
|
-
cwd =
|
|
1554
|
-
path: pathOption =
|
|
1724
|
+
cwd = process10.default.cwd(),
|
|
1725
|
+
path: pathOption = process10.default.env[pathKey()],
|
|
1555
1726
|
preferLocal = true,
|
|
1556
|
-
execPath: execPath2 =
|
|
1727
|
+
execPath: execPath2 = process10.default.execPath,
|
|
1557
1728
|
addExecPath = true
|
|
1558
1729
|
} = {}) => {
|
|
1559
1730
|
const cwdString = cwd instanceof URL ? _url.fileURLToPath.call(void 0, cwd) : cwd;
|
|
@@ -1579,7 +1750,7 @@ var applyExecPath = (result, execPath2, cwdPath) => {
|
|
|
1579
1750
|
const execPathString = execPath2 instanceof URL ? _url.fileURLToPath.call(void 0, execPath2) : execPath2;
|
|
1580
1751
|
result.push(_path2.default.resolve(cwdPath, execPathString, ".."));
|
|
1581
1752
|
};
|
|
1582
|
-
var npmRunPathEnv = ({ env =
|
|
1753
|
+
var npmRunPathEnv = ({ env = process10.default.env, ...options } = {}) => {
|
|
1583
1754
|
env = { ...env };
|
|
1584
1755
|
const pathName = pathKey({ env });
|
|
1585
1756
|
options.path = env[pathName];
|
|
@@ -2115,10 +2286,10 @@ init_cjs_shims();
|
|
|
2115
2286
|
|
|
2116
2287
|
// ../../node_modules/.pnpm/execa@9.3.1/node_modules/execa/lib/utils/abort-signal.js
|
|
2117
2288
|
init_cjs_shims();
|
|
2118
|
-
var
|
|
2289
|
+
var _events2 = require('events');
|
|
2119
2290
|
var onAbortedSignal = async (mainSignal, stopSignal) => {
|
|
2120
2291
|
if (!mainSignal.aborted) {
|
|
2121
|
-
await
|
|
2292
|
+
await _events2.once.call(void 0, mainSignal, "abort", { signal: stopSignal });
|
|
2122
2293
|
}
|
|
2123
2294
|
};
|
|
2124
2295
|
|
|
@@ -2292,13 +2463,13 @@ var getInvalidStdioOptionMessage = (fdNumber, fdName, options, isWritable) => {
|
|
|
2292
2463
|
return `The "${optionName}: ${serializeOptionValue(optionValue)}" option is incompatible with using "${getOptionName(isWritable)}: ${serializeOptionValue(fdName)}".
|
|
2293
2464
|
Please set this option with "pipe" instead.`;
|
|
2294
2465
|
};
|
|
2295
|
-
var getInvalidStdioOption = (fdNumber, { stdin, stdout, stderr, stdio }) => {
|
|
2466
|
+
var getInvalidStdioOption = (fdNumber, { stdin, stdout: stdout2, stderr, stdio }) => {
|
|
2296
2467
|
const usedDescriptor = getUsedDescriptor(fdNumber);
|
|
2297
2468
|
if (usedDescriptor === 0 && stdin !== void 0) {
|
|
2298
2469
|
return { optionName: "stdin", optionValue: stdin };
|
|
2299
2470
|
}
|
|
2300
|
-
if (usedDescriptor === 1 &&
|
|
2301
|
-
return { optionName: "stdout", optionValue:
|
|
2471
|
+
if (usedDescriptor === 1 && stdout2 !== void 0) {
|
|
2472
|
+
return { optionName: "stdout", optionValue: stdout2 };
|
|
2302
2473
|
}
|
|
2303
2474
|
if (usedDescriptor === 2 && stderr !== void 0) {
|
|
2304
2475
|
return { optionName: "stderr", optionValue: stderr };
|
|
@@ -2327,7 +2498,7 @@ var incrementMaxListeners = (eventEmitter, maxListenersIncrement, signal) => {
|
|
|
2327
2498
|
return;
|
|
2328
2499
|
}
|
|
2329
2500
|
eventEmitter.setMaxListeners(maxListeners + maxListenersIncrement);
|
|
2330
|
-
|
|
2501
|
+
_events2.addAbortListener.call(void 0, signal, () => {
|
|
2331
2502
|
eventEmitter.setMaxListeners(eventEmitter.getMaxListeners() - maxListenersIncrement);
|
|
2332
2503
|
});
|
|
2333
2504
|
};
|
|
@@ -2404,7 +2575,7 @@ var onDisconnect = async ({ anyProcess, channel, isSubprocess, ipcEmitter, bound
|
|
|
2404
2575
|
abortOnDisconnect();
|
|
2405
2576
|
const incomingMessages = INCOMING_MESSAGES.get(anyProcess);
|
|
2406
2577
|
while (_optionalChain([incomingMessages, 'optionalAccess', _6 => _6.length]) > 0) {
|
|
2407
|
-
await
|
|
2578
|
+
await _events2.once.call(void 0, ipcEmitter, "message:done");
|
|
2408
2579
|
}
|
|
2409
2580
|
anyProcess.removeListener("message", boundOnMessage);
|
|
2410
2581
|
redoAddedReferences(channel, isSubprocess);
|
|
@@ -2418,7 +2589,7 @@ var getIpcEmitter = (anyProcess, channel, isSubprocess) => {
|
|
|
2418
2589
|
if (IPC_EMITTERS.has(anyProcess)) {
|
|
2419
2590
|
return IPC_EMITTERS.get(anyProcess);
|
|
2420
2591
|
}
|
|
2421
|
-
const ipcEmitter = new (0,
|
|
2592
|
+
const ipcEmitter = new (0, _events2.EventEmitter)();
|
|
2422
2593
|
ipcEmitter.connected = true;
|
|
2423
2594
|
IPC_EMITTERS.set(anyProcess, ipcEmitter);
|
|
2424
2595
|
forwardEvents({
|
|
@@ -2529,7 +2700,7 @@ var waitForStrictResponse = async (wrappedMessage, anyProcess, isSubprocess) =>
|
|
|
2529
2700
|
var STRICT_RESPONSES = {};
|
|
2530
2701
|
var throwOnDisconnect = async (anyProcess, isSubprocess, { signal }) => {
|
|
2531
2702
|
incrementMaxListeners(anyProcess, 1, signal);
|
|
2532
|
-
await
|
|
2703
|
+
await _events2.once.call(void 0, anyProcess, "disconnect", { signal });
|
|
2533
2704
|
throwOnStrictDisconnect(isSubprocess);
|
|
2534
2705
|
};
|
|
2535
2706
|
var REQUEST_TYPE = "execa:ipc:request";
|
|
@@ -2888,7 +3059,7 @@ var normalizeCwd = (cwd = getDefaultCwd()) => {
|
|
|
2888
3059
|
};
|
|
2889
3060
|
var getDefaultCwd = () => {
|
|
2890
3061
|
try {
|
|
2891
|
-
return
|
|
3062
|
+
return process10.default.cwd();
|
|
2892
3063
|
} catch (error) {
|
|
2893
3064
|
error.message = `The current directory does not exist.
|
|
2894
3065
|
${error.message}`;
|
|
@@ -2931,7 +3102,7 @@ var normalizeOptions = (filePath, rawArguments, rawOptions) => {
|
|
|
2931
3102
|
options.killSignal = normalizeKillSignal(options.killSignal);
|
|
2932
3103
|
options.forceKillAfterDelay = normalizeForceKillAfterDelay(options.forceKillAfterDelay);
|
|
2933
3104
|
options.lines = options.lines.map((lines, fdNumber) => lines && !BINARY_ENCODINGS.has(options.encoding) && options.buffer[fdNumber]);
|
|
2934
|
-
if (
|
|
3105
|
+
if (process10.default.platform === "win32" && _path2.default.basename(file, ".exe") === "cmd") {
|
|
2935
3106
|
commandArguments.unshift("/q");
|
|
2936
3107
|
}
|
|
2937
3108
|
return { file, commandArguments, options };
|
|
@@ -2972,7 +3143,7 @@ var addDefaultOptions = ({
|
|
|
2972
3143
|
serialization
|
|
2973
3144
|
});
|
|
2974
3145
|
var getEnv = ({ env: envOption, extendEnv, preferLocal, node, localDirectory, nodePath }) => {
|
|
2975
|
-
const env = extendEnv ? { ...
|
|
3146
|
+
const env = extendEnv ? { ...process10.default.env, ...envOption } : envOption;
|
|
2976
3147
|
if (preferLocal || node) {
|
|
2977
3148
|
return npmRunPathEnv({
|
|
2978
3149
|
env,
|
|
@@ -3410,7 +3581,7 @@ var stringMethods = {
|
|
|
3410
3581
|
};
|
|
3411
3582
|
|
|
3412
3583
|
// ../../node_modules/.pnpm/get-stream@9.0.1/node_modules/get-stream/source/index.js
|
|
3413
|
-
Object.assign(nodeImports, { on:
|
|
3584
|
+
Object.assign(nodeImports, { on: _events2.on, finished: _promises3.finished });
|
|
3414
3585
|
|
|
3415
3586
|
// ../../node_modules/.pnpm/execa@9.3.1/node_modules/execa/lib/io/max-buffer.js
|
|
3416
3587
|
var handleMaxBuffer = ({ error, stream, readableObjectMode, lines, encoding, fdNumber }) => {
|
|
@@ -4231,10 +4402,10 @@ var guessStreamDirection = {
|
|
|
4231
4402
|
}
|
|
4232
4403
|
};
|
|
4233
4404
|
var getStandardStreamDirection = (value) => {
|
|
4234
|
-
if ([0,
|
|
4405
|
+
if ([0, process10.default.stdin].includes(value)) {
|
|
4235
4406
|
return "input";
|
|
4236
4407
|
}
|
|
4237
|
-
if ([1, 2,
|
|
4408
|
+
if ([1, 2, process10.default.stdout, process10.default.stderr].includes(value)) {
|
|
4238
4409
|
return "output";
|
|
4239
4410
|
}
|
|
4240
4411
|
};
|
|
@@ -5145,26 +5316,26 @@ var writeToFiles = (serializedResult, stdioItems, outputFiles) => {
|
|
|
5145
5316
|
|
|
5146
5317
|
// ../../node_modules/.pnpm/execa@9.3.1/node_modules/execa/lib/resolve/all-sync.js
|
|
5147
5318
|
init_cjs_shims();
|
|
5148
|
-
var getAllSync = ([,
|
|
5319
|
+
var getAllSync = ([, stdout2, stderr], options) => {
|
|
5149
5320
|
if (!options.all) {
|
|
5150
5321
|
return;
|
|
5151
5322
|
}
|
|
5152
|
-
if (
|
|
5323
|
+
if (stdout2 === void 0) {
|
|
5153
5324
|
return stderr;
|
|
5154
5325
|
}
|
|
5155
5326
|
if (stderr === void 0) {
|
|
5156
|
-
return
|
|
5327
|
+
return stdout2;
|
|
5157
5328
|
}
|
|
5158
|
-
if (Array.isArray(
|
|
5159
|
-
return Array.isArray(stderr) ? [...
|
|
5329
|
+
if (Array.isArray(stdout2)) {
|
|
5330
|
+
return Array.isArray(stderr) ? [...stdout2, ...stderr] : [...stdout2, stripNewline(stderr, options, "all")];
|
|
5160
5331
|
}
|
|
5161
5332
|
if (Array.isArray(stderr)) {
|
|
5162
|
-
return [stripNewline(
|
|
5333
|
+
return [stripNewline(stdout2, options, "all"), ...stderr];
|
|
5163
5334
|
}
|
|
5164
|
-
if (isUint8Array(
|
|
5165
|
-
return concatUint8Arrays([
|
|
5335
|
+
if (isUint8Array(stdout2) && isUint8Array(stderr)) {
|
|
5336
|
+
return concatUint8Arrays([stdout2, stderr]);
|
|
5166
5337
|
}
|
|
5167
|
-
return `${
|
|
5338
|
+
return `${stdout2}${stderr}`;
|
|
5168
5339
|
};
|
|
5169
5340
|
|
|
5170
5341
|
// ../../node_modules/.pnpm/execa@9.3.1/node_modules/execa/lib/resolve/exit-sync.js
|
|
@@ -5180,8 +5351,8 @@ var waitForExit = async (subprocess, context) => {
|
|
|
5180
5351
|
};
|
|
5181
5352
|
var waitForExitOrError = async (subprocess) => {
|
|
5182
5353
|
const [spawnPayload, exitPayload] = await Promise.allSettled([
|
|
5183
|
-
|
|
5184
|
-
|
|
5354
|
+
_events2.once.call(void 0, subprocess, "spawn"),
|
|
5355
|
+
_events2.once.call(void 0, subprocess, "exit")
|
|
5185
5356
|
]);
|
|
5186
5357
|
if (spawnPayload.status === "rejected") {
|
|
5187
5358
|
return [];
|
|
@@ -5190,7 +5361,7 @@ var waitForExitOrError = async (subprocess) => {
|
|
|
5190
5361
|
};
|
|
5191
5362
|
var waitForSubprocessExit = async (subprocess) => {
|
|
5192
5363
|
try {
|
|
5193
|
-
return await
|
|
5364
|
+
return await _events2.once.call(void 0, subprocess, "exit");
|
|
5194
5365
|
} catch (e4) {
|
|
5195
5366
|
return waitForSubprocessExit(subprocess);
|
|
5196
5367
|
}
|
|
@@ -5404,21 +5575,21 @@ var getOneMessageAsync = async ({ anyProcess, channel, isSubprocess, filter, ref
|
|
|
5404
5575
|
};
|
|
5405
5576
|
var getMessage = async (ipcEmitter, filter, { signal }) => {
|
|
5406
5577
|
if (filter === void 0) {
|
|
5407
|
-
const [message] = await
|
|
5578
|
+
const [message] = await _events2.once.call(void 0, ipcEmitter, "message", { signal });
|
|
5408
5579
|
return message;
|
|
5409
5580
|
}
|
|
5410
|
-
for await (const [message] of
|
|
5581
|
+
for await (const [message] of _events2.on.call(void 0, ipcEmitter, "message", { signal })) {
|
|
5411
5582
|
if (filter(message)) {
|
|
5412
5583
|
return message;
|
|
5413
5584
|
}
|
|
5414
5585
|
}
|
|
5415
5586
|
};
|
|
5416
5587
|
var throwOnDisconnect2 = async (ipcEmitter, isSubprocess, { signal }) => {
|
|
5417
|
-
await
|
|
5588
|
+
await _events2.once.call(void 0, ipcEmitter, "disconnect", { signal });
|
|
5418
5589
|
throwOnEarlyDisconnect(isSubprocess);
|
|
5419
5590
|
};
|
|
5420
5591
|
var throwOnStrictError = async (ipcEmitter, isSubprocess, { signal }) => {
|
|
5421
|
-
const [error] = await
|
|
5592
|
+
const [error] = await _events2.once.call(void 0, ipcEmitter, "strict:error", { signal });
|
|
5422
5593
|
throw getStrictResponseError(error, isSubprocess);
|
|
5423
5594
|
};
|
|
5424
5595
|
|
|
@@ -5464,14 +5635,14 @@ var loopOnMessages = ({ anyProcess, channel, isSubprocess, ipc, shouldAwait, ref
|
|
|
5464
5635
|
};
|
|
5465
5636
|
var stopOnDisconnect = async (anyProcess, ipcEmitter, controller) => {
|
|
5466
5637
|
try {
|
|
5467
|
-
await
|
|
5638
|
+
await _events2.once.call(void 0, ipcEmitter, "disconnect", { signal: controller.signal });
|
|
5468
5639
|
controller.abort();
|
|
5469
5640
|
} catch (e5) {
|
|
5470
5641
|
}
|
|
5471
5642
|
};
|
|
5472
5643
|
var abortOnStrictError = async ({ ipcEmitter, isSubprocess, controller, state }) => {
|
|
5473
5644
|
try {
|
|
5474
|
-
const [error] = await
|
|
5645
|
+
const [error] = await _events2.once.call(void 0, ipcEmitter, "strict:error", { signal: controller.signal });
|
|
5475
5646
|
state.error = getStrictResponseError(error, isSubprocess);
|
|
5476
5647
|
controller.abort();
|
|
5477
5648
|
} catch (e6) {
|
|
@@ -5479,7 +5650,7 @@ var abortOnStrictError = async ({ ipcEmitter, isSubprocess, controller, state })
|
|
|
5479
5650
|
};
|
|
5480
5651
|
var iterateOnMessages = async function* ({ anyProcess, channel, ipcEmitter, isSubprocess, shouldAwait, controller, state, reference }) {
|
|
5481
5652
|
try {
|
|
5482
|
-
for await (const [message] of
|
|
5653
|
+
for await (const [message] of _events2.on.call(void 0, ipcEmitter, "message", { signal: controller.signal })) {
|
|
5483
5654
|
throwIfStrictError(state);
|
|
5484
5655
|
yield message;
|
|
5485
5656
|
}
|
|
@@ -5507,9 +5678,9 @@ var addIpcMethods = (subprocess, { ipc }) => {
|
|
|
5507
5678
|
Object.assign(subprocess, getIpcMethods(subprocess, false, ipc));
|
|
5508
5679
|
};
|
|
5509
5680
|
var getIpcExport = () => {
|
|
5510
|
-
const anyProcess =
|
|
5681
|
+
const anyProcess = process10.default;
|
|
5511
5682
|
const isSubprocess = true;
|
|
5512
|
-
const ipc =
|
|
5683
|
+
const ipc = process10.default.channel !== void 0;
|
|
5513
5684
|
return {
|
|
5514
5685
|
...getIpcMethods(anyProcess, isSubprocess, ipc),
|
|
5515
5686
|
getCancelSignal: getCancelSignal.bind(void 0, {
|
|
@@ -5569,14 +5740,14 @@ var handleEarlyError = ({ error, command, escapedCommand, fileDescriptors, optio
|
|
|
5569
5740
|
};
|
|
5570
5741
|
var createDummyStreams = (subprocess, fileDescriptors) => {
|
|
5571
5742
|
const stdin = createDummyStream();
|
|
5572
|
-
const
|
|
5743
|
+
const stdout2 = createDummyStream();
|
|
5573
5744
|
const stderr = createDummyStream();
|
|
5574
5745
|
const extraStdio = Array.from({ length: fileDescriptors.length - 3 }, createDummyStream);
|
|
5575
5746
|
const all = createDummyStream();
|
|
5576
|
-
const stdio = [stdin,
|
|
5747
|
+
const stdio = [stdin, stdout2, stderr, ...extraStdio];
|
|
5577
5748
|
Object.assign(subprocess, {
|
|
5578
5749
|
stdin,
|
|
5579
|
-
stdout,
|
|
5750
|
+
stdout: stdout2,
|
|
5580
5751
|
stderr,
|
|
5581
5752
|
all,
|
|
5582
5753
|
stdio
|
|
@@ -5749,7 +5920,7 @@ var onMergedStreamEnd = async (passThroughStream, { signal }) => {
|
|
|
5749
5920
|
}
|
|
5750
5921
|
};
|
|
5751
5922
|
var onInputStreamsUnpipe = async (passThroughStream, streams, unpipeEvent, { signal }) => {
|
|
5752
|
-
for await (const [unpipedStream] of
|
|
5923
|
+
for await (const [unpipedStream] of _events2.on.call(void 0, passThroughStream, "unpipe", { signal })) {
|
|
5753
5924
|
if (streams.has(unpipedStream)) {
|
|
5754
5925
|
unpipedStream.emit(unpipeEvent);
|
|
5755
5926
|
}
|
|
@@ -5830,9 +6001,9 @@ var onInputStreamEnd = async ({ passThroughStream, stream, streams, ended, abort
|
|
|
5830
6001
|
}
|
|
5831
6002
|
};
|
|
5832
6003
|
var onInputStreamUnpipe = async ({ stream, streams, ended, aborted: aborted2, unpipeEvent, controller: { signal } }) => {
|
|
5833
|
-
await
|
|
6004
|
+
await _events2.once.call(void 0, stream, unpipeEvent, { signal });
|
|
5834
6005
|
if (!stream.readable) {
|
|
5835
|
-
return
|
|
6006
|
+
return _events2.once.call(void 0, signal, "abort", { signal });
|
|
5836
6007
|
}
|
|
5837
6008
|
streams.delete(stream);
|
|
5838
6009
|
ended.delete(stream);
|
|
@@ -5997,7 +6168,7 @@ if (process.platform === "linux") {
|
|
|
5997
6168
|
}
|
|
5998
6169
|
|
|
5999
6170
|
// ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js
|
|
6000
|
-
var processOk = (
|
|
6171
|
+
var processOk = (process11) => !!process11 && typeof process11 === "object" && typeof process11.removeListener === "function" && typeof process11.emit === "function" && typeof process11.reallyExit === "function" && typeof process11.listeners === "function" && typeof process11.kill === "function" && typeof process11.pid === "number" && typeof process11.on === "function";
|
|
6001
6172
|
var kExitEmitter = Symbol.for("signal-exit emitter");
|
|
6002
6173
|
var global2 = globalThis;
|
|
6003
6174
|
var ObjectDefineProperty = Object.defineProperty.bind(Object);
|
|
@@ -6080,7 +6251,7 @@ var SignalExitFallback = class extends SignalExitBase {
|
|
|
6080
6251
|
};
|
|
6081
6252
|
var _hupSig, _emitter, _process, _originalProcessEmit, _originalProcessReallyExit, _sigListeners, _loaded, _SignalExit_instances, processReallyExit_fn, processEmit_fn;
|
|
6082
6253
|
var SignalExit = class extends SignalExitBase {
|
|
6083
|
-
constructor(
|
|
6254
|
+
constructor(process11) {
|
|
6084
6255
|
super();
|
|
6085
6256
|
__privateAdd(this, _SignalExit_instances);
|
|
6086
6257
|
// "SIGHUP" throws an `ENOSYS` error on Windows,
|
|
@@ -6094,13 +6265,13 @@ var SignalExit = class extends SignalExitBase {
|
|
|
6094
6265
|
__privateAdd(this, _originalProcessReallyExit);
|
|
6095
6266
|
__privateAdd(this, _sigListeners, {});
|
|
6096
6267
|
__privateAdd(this, _loaded, false);
|
|
6097
|
-
__privateSet(this, _process,
|
|
6268
|
+
__privateSet(this, _process, process11);
|
|
6098
6269
|
__privateSet(this, _sigListeners, {});
|
|
6099
6270
|
for (const sig of signals) {
|
|
6100
6271
|
__privateGet(this, _sigListeners)[sig] = () => {
|
|
6101
6272
|
const listeners = __privateGet(this, _process).listeners(sig);
|
|
6102
6273
|
let { count: count2 } = __privateGet(this, _emitter);
|
|
6103
|
-
const p3 =
|
|
6274
|
+
const p3 = process11;
|
|
6104
6275
|
if (typeof p3.__signal_exit_emitter__ === "object" && typeof p3.__signal_exit_emitter__.count === "number") {
|
|
6105
6276
|
count2 += p3.__signal_exit_emitter__.count;
|
|
6106
6277
|
}
|
|
@@ -6109,12 +6280,12 @@ var SignalExit = class extends SignalExitBase {
|
|
|
6109
6280
|
const ret = __privateGet(this, _emitter).emit("exit", null, sig);
|
|
6110
6281
|
const s = sig === "SIGHUP" ? __privateGet(this, _hupSig) : sig;
|
|
6111
6282
|
if (!ret)
|
|
6112
|
-
|
|
6283
|
+
process11.kill(process11.pid, s);
|
|
6113
6284
|
}
|
|
6114
6285
|
};
|
|
6115
6286
|
}
|
|
6116
|
-
__privateSet(this, _originalProcessReallyExit,
|
|
6117
|
-
__privateSet(this, _originalProcessEmit,
|
|
6287
|
+
__privateSet(this, _originalProcessReallyExit, process11.reallyExit);
|
|
6288
|
+
__privateSet(this, _originalProcessEmit, process11.emit);
|
|
6118
6289
|
}
|
|
6119
6290
|
onExit(cb, opts) {
|
|
6120
6291
|
if (!processOk(__privateGet(this, _process))) {
|
|
@@ -6241,7 +6412,7 @@ var cleanupOnExit = (subprocess, { cleanup, detached }, { signal }) => {
|
|
|
6241
6412
|
const removeExitHandler = onExit(() => {
|
|
6242
6413
|
subprocess.kill();
|
|
6243
6414
|
});
|
|
6244
|
-
|
|
6415
|
+
_events2.addAbortListener.call(void 0, signal, () => {
|
|
6245
6416
|
removeExitHandler();
|
|
6246
6417
|
});
|
|
6247
6418
|
};
|
|
@@ -6558,7 +6729,7 @@ var stopReadingOnStreamEnd = async (onStreamEnd, controller, stream) => {
|
|
|
6558
6729
|
}
|
|
6559
6730
|
};
|
|
6560
6731
|
var iterateOnStream = ({ stream, controller, binary, shouldEncode, encoding, shouldSplit, preserveNewlines }) => {
|
|
6561
|
-
const onStdoutChunk =
|
|
6732
|
+
const onStdoutChunk = _events2.on.call(void 0, stream, "data", {
|
|
6562
6733
|
signal: controller.signal,
|
|
6563
6734
|
highWaterMark: HIGH_WATER_MARK,
|
|
6564
6735
|
// Backward compatibility with older name for this option
|
|
@@ -6790,7 +6961,7 @@ var waitForSubprocessStream = async ({ stream, fdNumber, encoding, buffer, maxBu
|
|
|
6790
6961
|
};
|
|
6791
6962
|
|
|
6792
6963
|
// ../../node_modules/.pnpm/execa@9.3.1/node_modules/execa/lib/resolve/all-async.js
|
|
6793
|
-
var makeAllStream = ({ stdout, stderr }, { all }) => all && (
|
|
6964
|
+
var makeAllStream = ({ stdout: stdout2, stderr }, { all }) => all && (stdout2 || stderr) ? mergeStreams([stdout2, stderr].filter(Boolean)) : void 0;
|
|
6794
6965
|
var waitForAllStream = ({ subprocess, encoding, buffer, maxBuffer, lines, stripFinalNewline: stripFinalNewline2, verboseInfo, streamInfo }) => waitForSubprocessStream({
|
|
6795
6966
|
...getAllStream(subprocess, buffer),
|
|
6796
6967
|
fdNumber: "all",
|
|
@@ -6802,7 +6973,7 @@ var waitForAllStream = ({ subprocess, encoding, buffer, maxBuffer, lines, stripF
|
|
|
6802
6973
|
verboseInfo,
|
|
6803
6974
|
streamInfo
|
|
6804
6975
|
});
|
|
6805
|
-
var getAllStream = ({ stdout, stderr, all }, [, bufferStdout, bufferStderr]) => {
|
|
6976
|
+
var getAllStream = ({ stdout: stdout2, stderr, all }, [, bufferStdout, bufferStderr]) => {
|
|
6806
6977
|
const buffer = bufferStdout || bufferStderr;
|
|
6807
6978
|
if (!buffer) {
|
|
6808
6979
|
return { stream: all, buffer };
|
|
@@ -6811,11 +6982,11 @@ var getAllStream = ({ stdout, stderr, all }, [, bufferStdout, bufferStderr]) =>
|
|
|
6811
6982
|
return { stream: stderr, buffer };
|
|
6812
6983
|
}
|
|
6813
6984
|
if (!bufferStderr) {
|
|
6814
|
-
return { stream:
|
|
6985
|
+
return { stream: stdout2, buffer };
|
|
6815
6986
|
}
|
|
6816
6987
|
return { stream: all, buffer };
|
|
6817
6988
|
};
|
|
6818
|
-
var getAllMixed = ({ all, stdout, stderr }) => all &&
|
|
6989
|
+
var getAllMixed = ({ all, stdout: stdout2, stderr }) => all && stdout2 && stderr && stdout2.readableObjectMode !== stderr.readableObjectMode;
|
|
6819
6990
|
|
|
6820
6991
|
// ../../node_modules/.pnpm/execa@9.3.1/node_modules/execa/lib/resolve/wait-subprocess.js
|
|
6821
6992
|
init_cjs_shims();
|
|
@@ -6987,7 +7158,7 @@ var waitForCustomStreamsEnd = (fileDescriptors, streamInfo) => fileDescriptors.f
|
|
|
6987
7158
|
stopOnExit: type === "native"
|
|
6988
7159
|
})));
|
|
6989
7160
|
var throwOnSubprocessError = async (subprocess, { signal }) => {
|
|
6990
|
-
const [error] = await
|
|
7161
|
+
const [error] = await _events2.once.call(void 0, subprocess, "error", { signal });
|
|
6991
7162
|
throw error;
|
|
6992
7163
|
};
|
|
6993
7164
|
|
|
@@ -7390,7 +7561,7 @@ var spawnSubprocessAsync = ({ file, commandArguments, options, startTime, verbos
|
|
|
7390
7561
|
});
|
|
7391
7562
|
}
|
|
7392
7563
|
const controller = new AbortController();
|
|
7393
|
-
|
|
7564
|
+
_events2.setMaxListeners.call(void 0, Number.POSITIVE_INFINITY, controller.signal);
|
|
7394
7565
|
const originalStreams = [...subprocess.stdio];
|
|
7395
7566
|
pipeOutputAsync(subprocess, fileDescriptors, controller);
|
|
7396
7567
|
cleanupOnExit(subprocess, options, controller);
|
|
@@ -7619,6 +7790,7 @@ var _stringargv = require('string-argv');
|
|
|
7619
7790
|
// src/utils/Writables.ts
|
|
7620
7791
|
init_cjs_shims();
|
|
7621
7792
|
|
|
7793
|
+
|
|
7622
7794
|
var ConsolaWritable = class extends _stream.Writable {
|
|
7623
7795
|
constructor(consola, command, opts) {
|
|
7624
7796
|
super(opts);
|
|
@@ -7626,49 +7798,501 @@ var ConsolaWritable = class extends _stream.Writable {
|
|
|
7626
7798
|
this.consola = consola;
|
|
7627
7799
|
}
|
|
7628
7800
|
_write(chunk, _encoding, callback) {
|
|
7629
|
-
|
|
7630
|
-
this.consola.log(`${p2.bold(p2.blue(this.command))}: ${_optionalChain([chunk, 'optionalAccess', _38 => _38.toString, 'call', _39 => _39()])}`);
|
|
7631
|
-
} else {
|
|
7632
|
-
this.consola.log(`${p2.bold(p2.blue(this.command))}: ${_optionalChain([chunk, 'optionalAccess', _40 => _40.toString, 'call', _41 => _41()])}`);
|
|
7633
|
-
}
|
|
7801
|
+
process10.stdout.write(`${p2.dim(_optionalChain([chunk, 'optionalAccess', _38 => _38.toString, 'call', _39 => _39()]))}`);
|
|
7634
7802
|
callback();
|
|
7635
7803
|
}
|
|
7636
7804
|
};
|
|
7637
7805
|
|
|
7638
7806
|
// src/utils/executeHooks.ts
|
|
7639
7807
|
|
|
7808
|
+
|
|
7809
|
+
// ../../node_modules/.pnpm/p-queue@8.0.1/node_modules/p-queue/dist/index.js
|
|
7810
|
+
init_cjs_shims();
|
|
7811
|
+
|
|
7812
|
+
// ../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.mjs
|
|
7813
|
+
init_cjs_shims();
|
|
7814
|
+
var import_index = __toESM(require_eventemitter3(), 1);
|
|
7815
|
+
|
|
7816
|
+
// ../../node_modules/.pnpm/p-timeout@6.1.2/node_modules/p-timeout/index.js
|
|
7817
|
+
init_cjs_shims();
|
|
7818
|
+
var TimeoutError = class extends Error {
|
|
7819
|
+
constructor(message) {
|
|
7820
|
+
super(message);
|
|
7821
|
+
this.name = "TimeoutError";
|
|
7822
|
+
}
|
|
7823
|
+
};
|
|
7824
|
+
var AbortError = class extends Error {
|
|
7825
|
+
constructor(message) {
|
|
7826
|
+
super();
|
|
7827
|
+
this.name = "AbortError";
|
|
7828
|
+
this.message = message;
|
|
7829
|
+
}
|
|
7830
|
+
};
|
|
7831
|
+
var getDOMException = (errorMessage) => globalThis.DOMException === void 0 ? new AbortError(errorMessage) : new DOMException(errorMessage);
|
|
7832
|
+
var getAbortedReason = (signal) => {
|
|
7833
|
+
const reason = signal.reason === void 0 ? getDOMException("This operation was aborted.") : signal.reason;
|
|
7834
|
+
return reason instanceof Error ? reason : getDOMException(reason);
|
|
7835
|
+
};
|
|
7836
|
+
function pTimeout(promise, options) {
|
|
7837
|
+
const {
|
|
7838
|
+
milliseconds,
|
|
7839
|
+
fallback,
|
|
7840
|
+
message,
|
|
7841
|
+
customTimers = { setTimeout, clearTimeout }
|
|
7842
|
+
} = options;
|
|
7843
|
+
let timer;
|
|
7844
|
+
const wrappedPromise = new Promise((resolve2, reject) => {
|
|
7845
|
+
if (typeof milliseconds !== "number" || Math.sign(milliseconds) !== 1) {
|
|
7846
|
+
throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${milliseconds}\``);
|
|
7847
|
+
}
|
|
7848
|
+
if (options.signal) {
|
|
7849
|
+
const { signal } = options;
|
|
7850
|
+
if (signal.aborted) {
|
|
7851
|
+
reject(getAbortedReason(signal));
|
|
7852
|
+
}
|
|
7853
|
+
signal.addEventListener("abort", () => {
|
|
7854
|
+
reject(getAbortedReason(signal));
|
|
7855
|
+
});
|
|
7856
|
+
}
|
|
7857
|
+
if (milliseconds === Number.POSITIVE_INFINITY) {
|
|
7858
|
+
promise.then(resolve2, reject);
|
|
7859
|
+
return;
|
|
7860
|
+
}
|
|
7861
|
+
const timeoutError = new TimeoutError();
|
|
7862
|
+
timer = customTimers.setTimeout.call(void 0, () => {
|
|
7863
|
+
if (fallback) {
|
|
7864
|
+
try {
|
|
7865
|
+
resolve2(fallback());
|
|
7866
|
+
} catch (error) {
|
|
7867
|
+
reject(error);
|
|
7868
|
+
}
|
|
7869
|
+
return;
|
|
7870
|
+
}
|
|
7871
|
+
if (typeof promise.cancel === "function") {
|
|
7872
|
+
promise.cancel();
|
|
7873
|
+
}
|
|
7874
|
+
if (message === false) {
|
|
7875
|
+
resolve2();
|
|
7876
|
+
} else if (message instanceof Error) {
|
|
7877
|
+
reject(message);
|
|
7878
|
+
} else {
|
|
7879
|
+
timeoutError.message = _nullishCoalesce(message, () => ( `Promise timed out after ${milliseconds} milliseconds`));
|
|
7880
|
+
reject(timeoutError);
|
|
7881
|
+
}
|
|
7882
|
+
}, milliseconds);
|
|
7883
|
+
(async () => {
|
|
7884
|
+
try {
|
|
7885
|
+
resolve2(await promise);
|
|
7886
|
+
} catch (error) {
|
|
7887
|
+
reject(error);
|
|
7888
|
+
}
|
|
7889
|
+
})();
|
|
7890
|
+
});
|
|
7891
|
+
const cancelablePromise = wrappedPromise.finally(() => {
|
|
7892
|
+
cancelablePromise.clear();
|
|
7893
|
+
});
|
|
7894
|
+
cancelablePromise.clear = () => {
|
|
7895
|
+
customTimers.clearTimeout.call(void 0, timer);
|
|
7896
|
+
timer = void 0;
|
|
7897
|
+
};
|
|
7898
|
+
return cancelablePromise;
|
|
7899
|
+
}
|
|
7900
|
+
|
|
7901
|
+
// ../../node_modules/.pnpm/p-queue@8.0.1/node_modules/p-queue/dist/priority-queue.js
|
|
7902
|
+
init_cjs_shims();
|
|
7903
|
+
|
|
7904
|
+
// ../../node_modules/.pnpm/p-queue@8.0.1/node_modules/p-queue/dist/lower-bound.js
|
|
7905
|
+
init_cjs_shims();
|
|
7906
|
+
function lowerBound(array, value, comparator) {
|
|
7907
|
+
let first = 0;
|
|
7908
|
+
let count2 = array.length;
|
|
7909
|
+
while (count2 > 0) {
|
|
7910
|
+
const step = Math.trunc(count2 / 2);
|
|
7911
|
+
let it = first + step;
|
|
7912
|
+
if (comparator(array[it], value) <= 0) {
|
|
7913
|
+
first = ++it;
|
|
7914
|
+
count2 -= step + 1;
|
|
7915
|
+
} else {
|
|
7916
|
+
count2 = step;
|
|
7917
|
+
}
|
|
7918
|
+
}
|
|
7919
|
+
return first;
|
|
7920
|
+
}
|
|
7921
|
+
|
|
7922
|
+
// ../../node_modules/.pnpm/p-queue@8.0.1/node_modules/p-queue/dist/priority-queue.js
|
|
7923
|
+
var _queue;
|
|
7924
|
+
var PriorityQueue = class {
|
|
7925
|
+
constructor() {
|
|
7926
|
+
__privateAdd(this, _queue, []);
|
|
7927
|
+
}
|
|
7928
|
+
enqueue(run, options) {
|
|
7929
|
+
options = {
|
|
7930
|
+
priority: 0,
|
|
7931
|
+
...options
|
|
7932
|
+
};
|
|
7933
|
+
const element = {
|
|
7934
|
+
priority: options.priority,
|
|
7935
|
+
run
|
|
7936
|
+
};
|
|
7937
|
+
if (this.size && __privateGet(this, _queue)[this.size - 1].priority >= options.priority) {
|
|
7938
|
+
__privateGet(this, _queue).push(element);
|
|
7939
|
+
return;
|
|
7940
|
+
}
|
|
7941
|
+
const index = lowerBound(__privateGet(this, _queue), element, (a3, b) => b.priority - a3.priority);
|
|
7942
|
+
__privateGet(this, _queue).splice(index, 0, element);
|
|
7943
|
+
}
|
|
7944
|
+
dequeue() {
|
|
7945
|
+
const item = __privateGet(this, _queue).shift();
|
|
7946
|
+
return _optionalChain([item, 'optionalAccess', _40 => _40.run]);
|
|
7947
|
+
}
|
|
7948
|
+
filter(options) {
|
|
7949
|
+
return __privateGet(this, _queue).filter((element) => element.priority === options.priority).map((element) => element.run);
|
|
7950
|
+
}
|
|
7951
|
+
get size() {
|
|
7952
|
+
return __privateGet(this, _queue).length;
|
|
7953
|
+
}
|
|
7954
|
+
};
|
|
7955
|
+
_queue = new WeakMap();
|
|
7956
|
+
|
|
7957
|
+
// ../../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
|
+
var PQueue = class extends import_index.default {
|
|
7960
|
+
// TODO: The `throwOnTimeout` option should affect the return types of `add()` and `addAll()`
|
|
7961
|
+
constructor(options) {
|
|
7962
|
+
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
|
+
options = {
|
|
7986
|
+
carryoverConcurrencyCount: false,
|
|
7987
|
+
intervalCap: Number.POSITIVE_INFINITY,
|
|
7988
|
+
interval: 0,
|
|
7989
|
+
concurrency: Number.POSITIVE_INFINITY,
|
|
7990
|
+
autoStart: true,
|
|
7991
|
+
queueClass: PriorityQueue,
|
|
7992
|
+
...options
|
|
7993
|
+
};
|
|
7994
|
+
if (!(typeof options.intervalCap === "number" && options.intervalCap >= 1)) {
|
|
7995
|
+
throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${_nullishCoalesce(_optionalChain([options, 'access', _41 => _41.intervalCap, 'optionalAccess', _42 => _42.toString, 'call', _43 => _43()]), () => ( ""))}\` (${typeof options.intervalCap})`);
|
|
7996
|
+
}
|
|
7997
|
+
if (options.interval === void 0 || !(Number.isFinite(options.interval) && options.interval >= 0)) {
|
|
7998
|
+
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
|
+
}
|
|
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);
|
|
8006
|
+
this.concurrency = options.concurrency;
|
|
8007
|
+
this.timeout = options.timeout;
|
|
8008
|
+
__privateSet(this, _throwOnTimeout, options.throwOnTimeout === true);
|
|
8009
|
+
__privateSet(this, _isPaused, options.autoStart === false);
|
|
8010
|
+
}
|
|
8011
|
+
get concurrency() {
|
|
8012
|
+
return __privateGet(this, _concurrency);
|
|
8013
|
+
}
|
|
8014
|
+
set concurrency(newConcurrency) {
|
|
8015
|
+
if (!(typeof newConcurrency === "number" && newConcurrency >= 1)) {
|
|
8016
|
+
throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${newConcurrency}\` (${typeof newConcurrency})`);
|
|
8017
|
+
}
|
|
8018
|
+
__privateSet(this, _concurrency, newConcurrency);
|
|
8019
|
+
__privateMethod(this, _PQueue_instances, processQueue_fn).call(this);
|
|
8020
|
+
}
|
|
8021
|
+
async add(function_, options = {}) {
|
|
8022
|
+
options = {
|
|
8023
|
+
timeout: this.timeout,
|
|
8024
|
+
throwOnTimeout: __privateGet(this, _throwOnTimeout),
|
|
8025
|
+
...options
|
|
8026
|
+
};
|
|
8027
|
+
return new Promise((resolve2, reject) => {
|
|
8028
|
+
__privateGet(this, _queue2).enqueue(async () => {
|
|
8029
|
+
__privateWrapper(this, _pending)._++;
|
|
8030
|
+
__privateWrapper(this, _intervalCount)._++;
|
|
8031
|
+
try {
|
|
8032
|
+
_optionalChain([options, 'access', _47 => _47.signal, 'optionalAccess', _48 => _48.throwIfAborted, 'call', _49 => _49()]);
|
|
8033
|
+
let operation = function_({ signal: options.signal });
|
|
8034
|
+
if (options.timeout) {
|
|
8035
|
+
operation = pTimeout(Promise.resolve(operation), { milliseconds: options.timeout });
|
|
8036
|
+
}
|
|
8037
|
+
if (options.signal) {
|
|
8038
|
+
operation = Promise.race([operation, __privateMethod(this, _PQueue_instances, throwOnAbort_fn).call(this, options.signal)]);
|
|
8039
|
+
}
|
|
8040
|
+
const result = await operation;
|
|
8041
|
+
resolve2(result);
|
|
8042
|
+
this.emit("completed", result);
|
|
8043
|
+
} catch (error) {
|
|
8044
|
+
if (error instanceof TimeoutError && !options.throwOnTimeout) {
|
|
8045
|
+
resolve2();
|
|
8046
|
+
return;
|
|
8047
|
+
}
|
|
8048
|
+
reject(error);
|
|
8049
|
+
this.emit("error", error);
|
|
8050
|
+
} finally {
|
|
8051
|
+
__privateMethod(this, _PQueue_instances, next_fn).call(this);
|
|
8052
|
+
}
|
|
8053
|
+
}, options);
|
|
8054
|
+
this.emit("add");
|
|
8055
|
+
__privateMethod(this, _PQueue_instances, tryToStartAnother_fn).call(this);
|
|
8056
|
+
});
|
|
8057
|
+
}
|
|
8058
|
+
async addAll(functions, options) {
|
|
8059
|
+
return Promise.all(functions.map(async (function_) => this.add(function_, options)));
|
|
8060
|
+
}
|
|
8061
|
+
/**
|
|
8062
|
+
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
|
+
*/
|
|
8064
|
+
start() {
|
|
8065
|
+
if (!__privateGet(this, _isPaused)) {
|
|
8066
|
+
return this;
|
|
8067
|
+
}
|
|
8068
|
+
__privateSet(this, _isPaused, false);
|
|
8069
|
+
__privateMethod(this, _PQueue_instances, processQueue_fn).call(this);
|
|
8070
|
+
return this;
|
|
8071
|
+
}
|
|
8072
|
+
/**
|
|
8073
|
+
Put queue execution on hold.
|
|
8074
|
+
*/
|
|
8075
|
+
pause() {
|
|
8076
|
+
__privateSet(this, _isPaused, true);
|
|
8077
|
+
}
|
|
8078
|
+
/**
|
|
8079
|
+
Clear the queue.
|
|
8080
|
+
*/
|
|
8081
|
+
clear() {
|
|
8082
|
+
__privateSet(this, _queue2, new (__privateGet(this, _queueClass))());
|
|
8083
|
+
}
|
|
8084
|
+
/**
|
|
8085
|
+
Can be called multiple times. Useful if you for example add additional items at a later time.
|
|
8086
|
+
|
|
8087
|
+
@returns A promise that settles when the queue becomes empty.
|
|
8088
|
+
*/
|
|
8089
|
+
async onEmpty() {
|
|
8090
|
+
if (__privateGet(this, _queue2).size === 0) {
|
|
8091
|
+
return;
|
|
8092
|
+
}
|
|
8093
|
+
await __privateMethod(this, _PQueue_instances, onEvent_fn).call(this, "empty");
|
|
8094
|
+
}
|
|
8095
|
+
/**
|
|
8096
|
+
@returns A promise that settles when the queue size is less than the given limit: `queue.size < limit`.
|
|
8097
|
+
|
|
8098
|
+
If you want to avoid having the queue grow beyond a certain size you can `await queue.onSizeLessThan()` before adding a new item.
|
|
8099
|
+
|
|
8100
|
+
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
|
+
*/
|
|
8102
|
+
async onSizeLessThan(limit) {
|
|
8103
|
+
if (__privateGet(this, _queue2).size < limit) {
|
|
8104
|
+
return;
|
|
8105
|
+
}
|
|
8106
|
+
await __privateMethod(this, _PQueue_instances, onEvent_fn).call(this, "next", () => __privateGet(this, _queue2).size < limit);
|
|
8107
|
+
}
|
|
8108
|
+
/**
|
|
8109
|
+
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.
|
|
8110
|
+
|
|
8111
|
+
@returns A promise that settles when the queue becomes empty, and all promises have completed; `queue.size === 0 && queue.pending === 0`.
|
|
8112
|
+
*/
|
|
8113
|
+
async onIdle() {
|
|
8114
|
+
if (__privateGet(this, _pending) === 0 && __privateGet(this, _queue2).size === 0) {
|
|
8115
|
+
return;
|
|
8116
|
+
}
|
|
8117
|
+
await __privateMethod(this, _PQueue_instances, onEvent_fn).call(this, "idle");
|
|
8118
|
+
}
|
|
8119
|
+
/**
|
|
8120
|
+
Size of the queue, the number of queued items waiting to run.
|
|
8121
|
+
*/
|
|
8122
|
+
get size() {
|
|
8123
|
+
return __privateGet(this, _queue2).size;
|
|
8124
|
+
}
|
|
8125
|
+
/**
|
|
8126
|
+
Size of the queue, filtered by the given options.
|
|
8127
|
+
|
|
8128
|
+
For example, this can be used to find the number of items remaining in the queue with a specific priority level.
|
|
8129
|
+
*/
|
|
8130
|
+
sizeBy(options) {
|
|
8131
|
+
return __privateGet(this, _queue2).filter(options).length;
|
|
8132
|
+
}
|
|
8133
|
+
/**
|
|
8134
|
+
Number of running items (no longer in the queue).
|
|
8135
|
+
*/
|
|
8136
|
+
get pending() {
|
|
8137
|
+
return __privateGet(this, _pending);
|
|
8138
|
+
}
|
|
8139
|
+
/**
|
|
8140
|
+
Whether the queue is currently paused.
|
|
8141
|
+
*/
|
|
8142
|
+
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
|
+
}
|
|
8220
|
+
}
|
|
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
|
+
};
|
|
8266
|
+
|
|
8267
|
+
// src/utils/executeHooks.ts
|
|
7640
8268
|
async function executeHooks({ hooks, logger }) {
|
|
7641
8269
|
const commands = Array.isArray(hooks.done) ? hooks.done : [hooks.done].filter(Boolean);
|
|
7642
|
-
const
|
|
8270
|
+
const queue = new PQueue({ concurrency: 1 });
|
|
8271
|
+
const promises = commands.map(async (command) => {
|
|
7643
8272
|
const consolaWritable = new ConsolaWritable(logger.consola, command);
|
|
7644
|
-
const abortController = new AbortController();
|
|
7645
8273
|
const [cmd, ..._args] = [..._stringargv.parseArgsStringToArgv.call(void 0, command)];
|
|
7646
8274
|
if (!cmd) {
|
|
7647
8275
|
return null;
|
|
7648
8276
|
}
|
|
7649
|
-
|
|
7650
|
-
|
|
7651
|
-
|
|
7652
|
-
|
|
7653
|
-
|
|
8277
|
+
await queue.add(async () => {
|
|
8278
|
+
logger.emit("start", `Executing hook ${logger.logLevel !== _logger.LogMapper.silent ? p2.dim(command) : ""}`);
|
|
8279
|
+
const subProcess = await execa(cmd, _args, {
|
|
8280
|
+
detached: true,
|
|
8281
|
+
stdout: logger.logLevel === _logger.LogMapper.silent ? void 0 : ["pipe", consolaWritable],
|
|
8282
|
+
stripFinalNewline: true
|
|
8283
|
+
});
|
|
8284
|
+
logger.emit("success", `Executed hook ${logger.logLevel !== _logger.LogMapper.silent ? p2.dim(command) : ""}`);
|
|
7654
8285
|
});
|
|
7655
|
-
|
|
7656
|
-
|
|
7657
|
-
|
|
7658
|
-
${subProcess.stdout}`);
|
|
7659
|
-
}
|
|
7660
|
-
consolaWritable.destroy();
|
|
7661
|
-
return { subProcess, abort: abortController.abort.bind(abortController) };
|
|
7662
|
-
}).filter(Boolean);
|
|
7663
|
-
await Promise.all(executors);
|
|
7664
|
-
logger.emit("success", "Executing hooks");
|
|
8286
|
+
});
|
|
8287
|
+
await Promise.all(promises);
|
|
8288
|
+
logger.emit("success", "Executed hooks");
|
|
7665
8289
|
}
|
|
7666
8290
|
|
|
7667
8291
|
// src/utils/getErrorCauses.ts
|
|
7668
8292
|
init_cjs_shims();
|
|
7669
8293
|
function getErrorCauses(errors) {
|
|
7670
8294
|
return errors.reduce((prev, error) => {
|
|
7671
|
-
const causedError = _optionalChain([error, 'optionalAccess',
|
|
8295
|
+
const causedError = _optionalChain([error, 'optionalAccess', _50 => _50.cause]);
|
|
7672
8296
|
if (causedError) {
|
|
7673
8297
|
prev = [...prev, ...getErrorCauses([causedError])];
|
|
7674
8298
|
return prev;
|
|
@@ -7691,43 +8315,37 @@ function parseHrtimeToSeconds(hrtime2) {
|
|
|
7691
8315
|
}
|
|
7692
8316
|
|
|
7693
8317
|
// src/utils/getSummary.ts
|
|
7694
|
-
function getSummary({ pluginManager, status, hrStart, config
|
|
8318
|
+
function getSummary({ pluginManager, status, hrStart, config }) {
|
|
7695
8319
|
const logs = [];
|
|
7696
8320
|
const elapsedSeconds = parseHrtimeToSeconds(process.hrtime(hrStart));
|
|
7697
8321
|
const buildStartPlugins = pluginManager.executed.filter((item) => item.hookName === "buildStart" && item.plugin.name !== "core").map((item) => item.plugin.name);
|
|
7698
8322
|
const buildEndPlugins = pluginManager.executed.filter((item) => item.hookName === "buildEnd" && item.plugin.name !== "core").map((item) => item.plugin.name);
|
|
7699
|
-
const failedPlugins = _optionalChain([config, 'access',
|
|
7700
|
-
const pluginsCount = _optionalChain([config, 'access',
|
|
8323
|
+
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
|
+
const pluginsCount = _optionalChain([config, 'access', _56 => _56.plugins, 'optionalAccess', _57 => _57.length]) || 0;
|
|
7701
8325
|
const files = pluginManager.fileManager.files.sort((a3, b) => {
|
|
7702
|
-
if (!_optionalChain([a3, 'access',
|
|
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]])) {
|
|
7703
8327
|
return 0;
|
|
7704
8328
|
}
|
|
7705
|
-
if (_optionalChain([a3, 'access',
|
|
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])) {
|
|
7706
8330
|
return 1;
|
|
7707
8331
|
}
|
|
7708
|
-
if (_optionalChain([a3, 'access',
|
|
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])) {
|
|
7709
8333
|
return -1;
|
|
7710
8334
|
}
|
|
7711
8335
|
return 0;
|
|
7712
8336
|
});
|
|
7713
8337
|
const meta = {
|
|
7714
|
-
plugins: status === "success" ? `${p2.green(`${buildStartPlugins.length} successful`)}, ${pluginsCount} total` : `${p2.red(`${_nullishCoalesce(_optionalChain([failedPlugins, 'optionalAccess',
|
|
7715
|
-
pluginsFailed: status === "failed" ? _optionalChain([failedPlugins, 'optionalAccess',
|
|
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,
|
|
7716
8340
|
filesCreated: files.length,
|
|
7717
|
-
time: `${p2.yellow(`${elapsedSeconds}s`)}
|
|
8341
|
+
time: `${p2.yellow(`${elapsedSeconds}s`)}`,
|
|
7718
8342
|
output: _path2.default.isAbsolute(config.root) ? _path2.default.resolve(config.root, config.output.path) : config.root
|
|
7719
8343
|
};
|
|
7720
|
-
logger.emit("debug", ["\nGenerated files:\n"]);
|
|
7721
|
-
logger.emit(
|
|
7722
|
-
"debug",
|
|
7723
|
-
files.map((file) => `${_logger.randomCliColour.call(void 0, JSON.stringify(_optionalChain([file, 'access', _77 => _77.meta, 'optionalAccess', _78 => _78.pluginKey])))} ${file.path}`)
|
|
7724
|
-
);
|
|
7725
8344
|
logs.push(
|
|
7726
8345
|
[
|
|
7727
8346
|
[`${p2.bold("Plugins:")} ${meta.plugins}`, true],
|
|
7728
8347
|
[`${p2.dim("Failed:")} ${meta.pluginsFailed || "none"}`, !!meta.pluginsFailed],
|
|
7729
|
-
[`${p2.bold("Generated:")} ${meta.filesCreated} files`, true],
|
|
7730
|
-
[`${p2.bold("Time:")} ${meta.time}`, true],
|
|
8348
|
+
[`${p2.bold("Generated:")} ${meta.filesCreated} files in ${meta.time}`, true],
|
|
7731
8349
|
[`${p2.bold("Output:")} ${meta.output}`, true]
|
|
7732
8350
|
].map((item) => {
|
|
7733
8351
|
if (item.at(1)) {
|
|
@@ -7743,17 +8361,20 @@ function getSummary({ pluginManager, status, hrStart, config, logger }) {
|
|
|
7743
8361
|
init_cjs_shims();
|
|
7744
8362
|
|
|
7745
8363
|
var _fs3 = require('@kubb/fs');
|
|
7746
|
-
async function writeLog(data) {
|
|
8364
|
+
async function writeLog({ data, override, fileName = "kubb.log" }) {
|
|
7747
8365
|
if (data.trim() === "") {
|
|
7748
8366
|
return void 0;
|
|
7749
8367
|
}
|
|
7750
|
-
const path6 = _path.resolve.call(void 0, process.cwd(),
|
|
8368
|
+
const path6 = _path.resolve.call(void 0, process.cwd(), fileName);
|
|
7751
8369
|
let previousLogs = "";
|
|
7752
8370
|
try {
|
|
7753
8371
|
previousLogs = await _fs3.read.call(void 0, _path.resolve.call(void 0, path6));
|
|
7754
8372
|
} catch (_err) {
|
|
7755
8373
|
}
|
|
7756
|
-
|
|
8374
|
+
if (override) {
|
|
8375
|
+
return _fs3.write.call(void 0, path6, data.trim(), { sanity: false });
|
|
8376
|
+
}
|
|
8377
|
+
return _fs3.write.call(void 0, path6, [previousLogs, data.trim()].filter(Boolean).join("\n"), { sanity: false });
|
|
7757
8378
|
}
|
|
7758
8379
|
|
|
7759
8380
|
// src/generate.ts
|
|
@@ -7765,12 +8386,41 @@ async function generate({ input, config, args }) {
|
|
|
7765
8386
|
logLevel,
|
|
7766
8387
|
name: config.name
|
|
7767
8388
|
});
|
|
7768
|
-
|
|
7769
|
-
|
|
8389
|
+
const progressBars = {};
|
|
8390
|
+
logger.on("progress_start", ({ id, size }) => {
|
|
8391
|
+
_optionalChain([logger, 'access', _85 => _85.consola, 'optionalAccess', _86 => _86.pauseLogs, 'call', _87 => _87()]);
|
|
8392
|
+
if (!progressBars[id]) {
|
|
8393
|
+
progressBars[id] = new (0, _cliprogress.SingleBar)(
|
|
8394
|
+
{
|
|
8395
|
+
format: logLevel === _logger.LogMapper.info ? "{percentage}% {bar} {value}/{total} {id} | {data}" : "{percentage}% {bar} ETA: {eta}s",
|
|
8396
|
+
barsize: 25,
|
|
8397
|
+
clearOnComplete: true
|
|
8398
|
+
},
|
|
8399
|
+
_cliprogress.Presets.shades_grey
|
|
8400
|
+
);
|
|
8401
|
+
progressBars[id].start(size, 1, { id, data: "" });
|
|
8402
|
+
}
|
|
8403
|
+
});
|
|
8404
|
+
logger.on("progress_stop", ({ id }) => {
|
|
8405
|
+
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()]);
|
|
8408
|
+
});
|
|
8409
|
+
logger.on("progress", ({ id, count: count2, data = "" }) => {
|
|
8410
|
+
const progressBar = progressBars[id];
|
|
8411
|
+
const payload = { id, data };
|
|
8412
|
+
if (count2) {
|
|
8413
|
+
_optionalChain([progressBar, 'optionalAccess', _93 => _93.update, 'call', _94 => _94(count2, payload)]);
|
|
8414
|
+
} else {
|
|
8415
|
+
_optionalChain([progressBar, 'optionalAccess', _95 => _95.increment, 'call', _96 => _96(1, payload)]);
|
|
8416
|
+
}
|
|
8417
|
+
});
|
|
8418
|
+
logger.on("debug", async ({ logs, override, fileName }) => {
|
|
8419
|
+
await writeLog({ data: logs.join("\n"), fileName, override });
|
|
7770
8420
|
});
|
|
7771
8421
|
const { root = process.cwd(), ...userConfig } = config;
|
|
7772
8422
|
const inputPath = _nullishCoalesce(input, () => ( ("path" in userConfig.input ? userConfig.input.path : void 0)));
|
|
7773
|
-
logger.emit("start",
|
|
8423
|
+
logger.emit("start", `Building ${logLevel !== _logger.LogMapper.silent ? p2.dim(inputPath) : ""}`);
|
|
7774
8424
|
const definedConfig = {
|
|
7775
8425
|
root,
|
|
7776
8426
|
...userConfig,
|
|
@@ -7796,7 +8446,7 @@ async function generate({ input, config, args }) {
|
|
|
7796
8446
|
logger
|
|
7797
8447
|
});
|
|
7798
8448
|
if (error && logger.consola) {
|
|
7799
|
-
logger.consola.error(
|
|
8449
|
+
logger.consola.error(`Build failed ${logLevel !== _logger.LogMapper.silent ? p2.dim(inputPath) : ""}`);
|
|
7800
8450
|
logger.consola.box({
|
|
7801
8451
|
title: `${config.name || ""}`,
|
|
7802
8452
|
message: summary.join(""),
|
|
@@ -7809,17 +8459,17 @@ async function generate({ input, config, args }) {
|
|
|
7809
8459
|
const errors = getErrorCauses([error]);
|
|
7810
8460
|
if (logger.consola && errors.length && logLevel === _logger.LogMapper.debug) {
|
|
7811
8461
|
errors.forEach((err) => {
|
|
7812
|
-
_optionalChain([logger, 'access',
|
|
8462
|
+
_optionalChain([logger, 'access', _97 => _97.consola, 'optionalAccess', _98 => _98.error, 'call', _99 => _99(err)]);
|
|
7813
8463
|
});
|
|
7814
8464
|
}
|
|
7815
|
-
_optionalChain([logger, 'access',
|
|
8465
|
+
_optionalChain([logger, 'access', _100 => _100.consola, 'optionalAccess', _101 => _101.error, 'call', _102 => _102(error)]);
|
|
7816
8466
|
process.exit(0);
|
|
7817
8467
|
}
|
|
7818
8468
|
if (config.hooks) {
|
|
7819
8469
|
await executeHooks({ hooks: config.hooks, logger });
|
|
7820
8470
|
}
|
|
7821
|
-
_optionalChain([logger, 'access',
|
|
7822
|
-
_optionalChain([logger, 'access',
|
|
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({
|
|
7823
8473
|
title: `${config.name || ""}`,
|
|
7824
8474
|
message: summary.join(""),
|
|
7825
8475
|
style: {
|
|
@@ -7836,4 +8486,4 @@ async function generate({ input, config, args }) {
|
|
|
7836
8486
|
|
|
7837
8487
|
|
|
7838
8488
|
exports.init_cjs_shims = init_cjs_shims; exports.p = p2; exports.execa = execa; exports.generate = generate;
|
|
7839
|
-
//# sourceMappingURL=chunk-
|
|
8489
|
+
//# sourceMappingURL=chunk-MXBF3FNZ.cjs.map
|