@kubb/core 2.0.0-beta.13 → 2.0.0-beta.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/dist/chunk-35FDNG5F.cjs +71 -0
  2. package/dist/chunk-35FDNG5F.cjs.map +1 -0
  3. package/dist/chunk-7CNPSL5M.js +85 -0
  4. package/dist/chunk-7CNPSL5M.js.map +1 -0
  5. package/dist/{chunk-SX2AYX5F.js → chunk-DKYWBKNH.js} +2 -2
  6. package/dist/chunk-EZSRGYAY.js +128 -0
  7. package/dist/chunk-EZSRGYAY.js.map +1 -0
  8. package/dist/{chunk-77QZQ377.cjs → chunk-GBX7KRCX.cjs} +12 -5
  9. package/dist/chunk-GBX7KRCX.cjs.map +1 -0
  10. package/dist/{chunk-FOQFLMOC.js → chunk-ICRPOCV4.cjs} +400 -446
  11. package/dist/chunk-ICRPOCV4.cjs.map +1 -0
  12. package/dist/chunk-LAS7UYTK.cjs +129 -0
  13. package/dist/chunk-LAS7UYTK.cjs.map +1 -0
  14. package/dist/chunk-LJHT3DNH.js +67 -0
  15. package/dist/chunk-LJHT3DNH.js.map +1 -0
  16. package/dist/{chunk-I7UUR5MZ.cjs → chunk-MM42A6GN.cjs} +3 -3
  17. package/dist/{chunk-I7UUR5MZ.cjs.map → chunk-MM42A6GN.cjs.map} +1 -1
  18. package/dist/{chunk-L6F5QUH2.js → chunk-SRGTC4FJ.js} +2 -2
  19. package/dist/{chunk-PY7I7OEN.cjs → chunk-ST7GHHSU.cjs} +34 -22
  20. package/dist/chunk-ST7GHHSU.cjs.map +1 -0
  21. package/dist/{chunk-ABFPJZJL.cjs → chunk-U4C2WTCI.cjs} +5 -5
  22. package/dist/{chunk-WFDR7OMY.js → chunk-UIQUKFF4.js} +9 -2
  23. package/dist/chunk-UIQUKFF4.js.map +1 -0
  24. package/dist/{chunk-6N4JBFFS.js → chunk-WTSDXEWD.js} +4 -12
  25. package/dist/chunk-WTSDXEWD.js.map +1 -0
  26. package/dist/fs.cjs +9 -8
  27. package/dist/fs.cjs.map +1 -1
  28. package/dist/fs.d.cts +1 -1
  29. package/dist/fs.d.ts +1 -1
  30. package/dist/fs.js +3 -2
  31. package/dist/fs.js.map +1 -1
  32. package/dist/index.cjs +955 -244
  33. package/dist/index.cjs.map +1 -1
  34. package/dist/index.d.cts +17 -15
  35. package/dist/index.d.ts +17 -15
  36. package/dist/index.js +135 -83
  37. package/dist/index.js.map +1 -1
  38. package/dist/logger.cjs +7 -6
  39. package/dist/logger.d.cts +1 -0
  40. package/dist/logger.d.ts +1 -0
  41. package/dist/logger.js +3 -2
  42. package/dist/transformers.cjs +21 -21
  43. package/dist/transformers.js +5 -5
  44. package/dist/utils.cjs +22 -19
  45. package/dist/utils.cjs.map +1 -1
  46. package/dist/utils.d.cts +0 -1
  47. package/dist/utils.d.ts +0 -1
  48. package/dist/utils.js +14 -4
  49. package/dist/utils.js.map +1 -1
  50. package/dist/{write-46ytbnu9.d.cts → write-A6VgHkYA.d.cts} +4 -1
  51. package/dist/{write-46ytbnu9.d.ts → write-A6VgHkYA.d.ts} +4 -1
  52. package/package.json +9 -8
  53. package/src/FileManager.ts +60 -57
  54. package/src/PluginManager.ts +11 -18
  55. package/src/build.ts +57 -32
  56. package/src/fs/clean.ts +2 -2
  57. package/src/fs/read.ts +1 -0
  58. package/src/fs/write.ts +40 -24
  59. package/src/logger.ts +10 -0
  60. package/src/utils/index.ts +0 -2
  61. package/dist/Queue-2-6pMcCx.d.cts +0 -32
  62. package/dist/Queue-2-6pMcCx.d.ts +0 -32
  63. package/dist/chunk-56YH3VX6.js +0 -239
  64. package/dist/chunk-56YH3VX6.js.map +0 -1
  65. package/dist/chunk-6N4JBFFS.js.map +0 -1
  66. package/dist/chunk-72O327DC.cjs +0 -247
  67. package/dist/chunk-72O327DC.cjs.map +0 -1
  68. package/dist/chunk-77QZQ377.cjs.map +0 -1
  69. package/dist/chunk-FOQFLMOC.js.map +0 -1
  70. package/dist/chunk-PY7I7OEN.cjs.map +0 -1
  71. package/dist/chunk-WFDR7OMY.js.map +0 -1
  72. package/dist/chunk-Z7XZQBAK.cjs +0 -2339
  73. package/dist/chunk-Z7XZQBAK.cjs.map +0 -1
  74. package/src/utils/Queue.ts +0 -110
  75. /package/dist/{chunk-SX2AYX5F.js.map → chunk-DKYWBKNH.js.map} +0 -0
  76. /package/dist/{chunk-L6F5QUH2.js.map → chunk-SRGTC4FJ.js.map} +0 -0
  77. /package/dist/{chunk-ABFPJZJL.cjs.map → chunk-U4C2WTCI.cjs.map} +0 -0
package/dist/index.cjs CHANGED
@@ -2,18 +2,20 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var chunkABFPJZJL_cjs = require('./chunk-ABFPJZJL.cjs');
6
- var chunk72O327DC_cjs = require('./chunk-72O327DC.cjs');
7
- require('./chunk-PY7I7OEN.cjs');
8
- var chunk77QZQ377_cjs = require('./chunk-77QZQ377.cjs');
9
- var chunkZ7XZQBAK_cjs = require('./chunk-Z7XZQBAK.cjs');
10
- var chunkI7UUR5MZ_cjs = require('./chunk-I7UUR5MZ.cjs');
5
+ var chunkU4C2WTCI_cjs = require('./chunk-U4C2WTCI.cjs');
6
+ var chunkLAS7UYTK_cjs = require('./chunk-LAS7UYTK.cjs');
7
+ require('./chunk-ST7GHHSU.cjs');
8
+ var chunkGBX7KRCX_cjs = require('./chunk-GBX7KRCX.cjs');
9
+ var chunk35FDNG5F_cjs = require('./chunk-35FDNG5F.cjs');
10
+ var chunkICRPOCV4_cjs = require('./chunk-ICRPOCV4.cjs');
11
+ var chunkMM42A6GN_cjs = require('./chunk-MM42A6GN.cjs');
11
12
  var crypto = require('crypto');
12
13
  var path4 = require('path');
13
14
  var parser = require('@kubb/parser');
14
15
  var factory = require('@kubb/parser/factory');
15
16
  var naturalOrderby = require('natural-orderby');
16
17
  var dirTree = require('directory-tree');
18
+ var events = require('events');
17
19
  var mod = require('module');
18
20
  var os = require('os');
19
21
  var url = require('url');
@@ -51,9 +53,9 @@ var process__default = /*#__PURE__*/_interopDefault(process);
51
53
  var fs__default = /*#__PURE__*/_interopDefault(fs);
52
54
 
53
55
  // ../../node_modules/.pnpm/lodash.isequal@4.5.0/node_modules/lodash.isequal/index.js
54
- var require_lodash = chunkI7UUR5MZ_cjs.__commonJS({
56
+ var require_lodash = chunkMM42A6GN_cjs.__commonJS({
55
57
  "../../node_modules/.pnpm/lodash.isequal@4.5.0/node_modules/lodash.isequal/index.js"(exports, module) {
56
- chunkI7UUR5MZ_cjs.init_cjs_shims();
58
+ chunkMM42A6GN_cjs.init_cjs_shims();
57
59
  var LARGE_ARRAY_SIZE = 200;
58
60
  var HASH_UNDEFINED = "__lodash_hash_undefined__";
59
61
  var COMPARE_PARTIAL_FLAG = 1;
@@ -752,14 +754,196 @@ var require_lodash = chunkI7UUR5MZ_cjs.__commonJS({
752
754
  }
753
755
  });
754
756
 
757
+ // ../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.js
758
+ var require_eventemitter3 = chunkMM42A6GN_cjs.__commonJS({
759
+ "../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.js"(exports, module) {
760
+ chunkMM42A6GN_cjs.init_cjs_shims();
761
+ var has = Object.prototype.hasOwnProperty;
762
+ var prefix = "~";
763
+ function Events() {
764
+ }
765
+ if (Object.create) {
766
+ Events.prototype = /* @__PURE__ */ Object.create(null);
767
+ if (!new Events().__proto__)
768
+ prefix = false;
769
+ }
770
+ function EE(fn, context, once) {
771
+ this.fn = fn;
772
+ this.context = context;
773
+ this.once = once || false;
774
+ }
775
+ function addListener(emitter, event, fn, context, once) {
776
+ if (typeof fn !== "function") {
777
+ throw new TypeError("The listener must be a function");
778
+ }
779
+ var listener = new EE(fn, context || emitter, once), evt = prefix ? prefix + event : event;
780
+ if (!emitter._events[evt])
781
+ emitter._events[evt] = listener, emitter._eventsCount++;
782
+ else if (!emitter._events[evt].fn)
783
+ emitter._events[evt].push(listener);
784
+ else
785
+ emitter._events[evt] = [emitter._events[evt], listener];
786
+ return emitter;
787
+ }
788
+ function clearEvent(emitter, evt) {
789
+ if (--emitter._eventsCount === 0)
790
+ emitter._events = new Events();
791
+ else
792
+ delete emitter._events[evt];
793
+ }
794
+ function EventEmitter3() {
795
+ this._events = new Events();
796
+ this._eventsCount = 0;
797
+ }
798
+ EventEmitter3.prototype.eventNames = function eventNames() {
799
+ var names = [], events, name;
800
+ if (this._eventsCount === 0)
801
+ return names;
802
+ for (name in events = this._events) {
803
+ if (has.call(events, name))
804
+ names.push(prefix ? name.slice(1) : name);
805
+ }
806
+ if (Object.getOwnPropertySymbols) {
807
+ return names.concat(Object.getOwnPropertySymbols(events));
808
+ }
809
+ return names;
810
+ };
811
+ EventEmitter3.prototype.listeners = function listeners(event) {
812
+ var evt = prefix ? prefix + event : event, handlers = this._events[evt];
813
+ if (!handlers)
814
+ return [];
815
+ if (handlers.fn)
816
+ return [handlers.fn];
817
+ for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {
818
+ ee[i] = handlers[i].fn;
819
+ }
820
+ return ee;
821
+ };
822
+ EventEmitter3.prototype.listenerCount = function listenerCount(event) {
823
+ var evt = prefix ? prefix + event : event, listeners = this._events[evt];
824
+ if (!listeners)
825
+ return 0;
826
+ if (listeners.fn)
827
+ return 1;
828
+ return listeners.length;
829
+ };
830
+ EventEmitter3.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
831
+ var evt = prefix ? prefix + event : event;
832
+ if (!this._events[evt])
833
+ return false;
834
+ var listeners = this._events[evt], len = arguments.length, args, i;
835
+ if (listeners.fn) {
836
+ if (listeners.once)
837
+ this.removeListener(event, listeners.fn, void 0, true);
838
+ switch (len) {
839
+ case 1:
840
+ return listeners.fn.call(listeners.context), true;
841
+ case 2:
842
+ return listeners.fn.call(listeners.context, a1), true;
843
+ case 3:
844
+ return listeners.fn.call(listeners.context, a1, a2), true;
845
+ case 4:
846
+ return listeners.fn.call(listeners.context, a1, a2, a3), true;
847
+ case 5:
848
+ return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
849
+ case 6:
850
+ return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
851
+ }
852
+ for (i = 1, args = new Array(len - 1); i < len; i++) {
853
+ args[i - 1] = arguments[i];
854
+ }
855
+ listeners.fn.apply(listeners.context, args);
856
+ } else {
857
+ var length = listeners.length, j;
858
+ for (i = 0; i < length; i++) {
859
+ if (listeners[i].once)
860
+ this.removeListener(event, listeners[i].fn, void 0, true);
861
+ switch (len) {
862
+ case 1:
863
+ listeners[i].fn.call(listeners[i].context);
864
+ break;
865
+ case 2:
866
+ listeners[i].fn.call(listeners[i].context, a1);
867
+ break;
868
+ case 3:
869
+ listeners[i].fn.call(listeners[i].context, a1, a2);
870
+ break;
871
+ case 4:
872
+ listeners[i].fn.call(listeners[i].context, a1, a2, a3);
873
+ break;
874
+ default:
875
+ if (!args)
876
+ for (j = 1, args = new Array(len - 1); j < len; j++) {
877
+ args[j - 1] = arguments[j];
878
+ }
879
+ listeners[i].fn.apply(listeners[i].context, args);
880
+ }
881
+ }
882
+ }
883
+ return true;
884
+ };
885
+ EventEmitter3.prototype.on = function on(event, fn, context) {
886
+ return addListener(this, event, fn, context, false);
887
+ };
888
+ EventEmitter3.prototype.once = function once(event, fn, context) {
889
+ return addListener(this, event, fn, context, true);
890
+ };
891
+ EventEmitter3.prototype.removeListener = function removeListener(event, fn, context, once) {
892
+ var evt = prefix ? prefix + event : event;
893
+ if (!this._events[evt])
894
+ return this;
895
+ if (!fn) {
896
+ clearEvent(this, evt);
897
+ return this;
898
+ }
899
+ var listeners = this._events[evt];
900
+ if (listeners.fn) {
901
+ if (listeners.fn === fn && (!once || listeners.once) && (!context || listeners.context === context)) {
902
+ clearEvent(this, evt);
903
+ }
904
+ } else {
905
+ for (var i = 0, events = [], length = listeners.length; i < length; i++) {
906
+ if (listeners[i].fn !== fn || once && !listeners[i].once || context && listeners[i].context !== context) {
907
+ events.push(listeners[i]);
908
+ }
909
+ }
910
+ if (events.length)
911
+ this._events[evt] = events.length === 1 ? events[0] : events;
912
+ else
913
+ clearEvent(this, evt);
914
+ }
915
+ return this;
916
+ };
917
+ EventEmitter3.prototype.removeAllListeners = function removeAllListeners(event) {
918
+ var evt;
919
+ if (event) {
920
+ evt = prefix ? prefix + event : event;
921
+ if (this._events[evt])
922
+ clearEvent(this, evt);
923
+ } else {
924
+ this._events = new Events();
925
+ this._eventsCount = 0;
926
+ }
927
+ return this;
928
+ };
929
+ EventEmitter3.prototype.off = EventEmitter3.prototype.removeListener;
930
+ EventEmitter3.prototype.addListener = EventEmitter3.prototype.on;
931
+ EventEmitter3.prefixed = prefix;
932
+ EventEmitter3.EventEmitter = EventEmitter3;
933
+ if ("undefined" !== typeof module) {
934
+ module.exports = EventEmitter3;
935
+ }
936
+ }
937
+ });
938
+
755
939
  // src/index.ts
756
- chunkI7UUR5MZ_cjs.init_cjs_shims();
940
+ chunkMM42A6GN_cjs.init_cjs_shims();
757
941
 
758
942
  // src/build.ts
759
- chunkI7UUR5MZ_cjs.init_cjs_shims();
943
+ chunkMM42A6GN_cjs.init_cjs_shims();
760
944
 
761
945
  // src/config.ts
762
- chunkI7UUR5MZ_cjs.init_cjs_shims();
946
+ chunkMM42A6GN_cjs.init_cjs_shims();
763
947
  function defineConfig(options) {
764
948
  return options;
765
949
  }
@@ -768,14 +952,492 @@ function isInputPath(result) {
768
952
  }
769
953
 
770
954
  // src/FileManager.ts
771
- chunkI7UUR5MZ_cjs.init_cjs_shims();
772
- var import_lodash = chunkI7UUR5MZ_cjs.__toESM(require_lodash(), 1);
955
+ chunkMM42A6GN_cjs.init_cjs_shims();
956
+ var import_lodash = chunkMM42A6GN_cjs.__toESM(require_lodash(), 1);
957
+
958
+ // ../../node_modules/.pnpm/p-queue@7.4.1/node_modules/p-queue/dist/index.js
959
+ chunkMM42A6GN_cjs.init_cjs_shims();
960
+
961
+ // ../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.mjs
962
+ chunkMM42A6GN_cjs.init_cjs_shims();
963
+ var import_index = chunkMM42A6GN_cjs.__toESM(require_eventemitter3(), 1);
964
+
965
+ // ../../node_modules/.pnpm/p-timeout@5.1.0/node_modules/p-timeout/index.js
966
+ chunkMM42A6GN_cjs.init_cjs_shims();
967
+ var TimeoutError = class extends Error {
968
+ constructor(message) {
969
+ super(message);
970
+ this.name = "TimeoutError";
971
+ }
972
+ };
973
+ var AbortError = class extends Error {
974
+ constructor(message) {
975
+ super();
976
+ this.name = "AbortError";
977
+ this.message = message;
978
+ }
979
+ };
980
+ var getDOMException = (errorMessage) => globalThis.DOMException === void 0 ? new AbortError(errorMessage) : new DOMException(errorMessage);
981
+ var getAbortedReason = (signal) => {
982
+ const reason = signal.reason === void 0 ? getDOMException("This operation was aborted.") : signal.reason;
983
+ return reason instanceof Error ? reason : getDOMException(reason);
984
+ };
985
+ function pTimeout(promise, milliseconds, fallback, options) {
986
+ let timer;
987
+ const cancelablePromise = new Promise((resolve2, reject) => {
988
+ if (typeof milliseconds !== "number" || Math.sign(milliseconds) !== 1) {
989
+ throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${milliseconds}\``);
990
+ }
991
+ if (milliseconds === Number.POSITIVE_INFINITY) {
992
+ resolve2(promise);
993
+ return;
994
+ }
995
+ options = {
996
+ customTimers: { setTimeout, clearTimeout },
997
+ ...options
998
+ };
999
+ if (options.signal) {
1000
+ const { signal } = options;
1001
+ if (signal.aborted) {
1002
+ reject(getAbortedReason(signal));
1003
+ }
1004
+ signal.addEventListener("abort", () => {
1005
+ reject(getAbortedReason(signal));
1006
+ });
1007
+ }
1008
+ timer = options.customTimers.setTimeout.call(void 0, () => {
1009
+ if (typeof fallback === "function") {
1010
+ try {
1011
+ resolve2(fallback());
1012
+ } catch (error) {
1013
+ reject(error);
1014
+ }
1015
+ return;
1016
+ }
1017
+ const message = typeof fallback === "string" ? fallback : `Promise timed out after ${milliseconds} milliseconds`;
1018
+ const timeoutError = fallback instanceof Error ? fallback : new TimeoutError(message);
1019
+ if (typeof promise.cancel === "function") {
1020
+ promise.cancel();
1021
+ }
1022
+ reject(timeoutError);
1023
+ }, milliseconds);
1024
+ (async () => {
1025
+ try {
1026
+ resolve2(await promise);
1027
+ } catch (error) {
1028
+ reject(error);
1029
+ } finally {
1030
+ options.customTimers.clearTimeout.call(void 0, timer);
1031
+ }
1032
+ })();
1033
+ });
1034
+ cancelablePromise.clear = () => {
1035
+ clearTimeout(timer);
1036
+ timer = void 0;
1037
+ };
1038
+ return cancelablePromise;
1039
+ }
1040
+
1041
+ // ../../node_modules/.pnpm/p-queue@7.4.1/node_modules/p-queue/dist/priority-queue.js
1042
+ chunkMM42A6GN_cjs.init_cjs_shims();
1043
+
1044
+ // ../../node_modules/.pnpm/p-queue@7.4.1/node_modules/p-queue/dist/lower-bound.js
1045
+ chunkMM42A6GN_cjs.init_cjs_shims();
1046
+ function lowerBound(array, value, comparator) {
1047
+ let first = 0;
1048
+ let count = array.length;
1049
+ while (count > 0) {
1050
+ const step = Math.trunc(count / 2);
1051
+ let it = first + step;
1052
+ if (comparator(array[it], value) <= 0) {
1053
+ first = ++it;
1054
+ count -= step + 1;
1055
+ } else {
1056
+ count = step;
1057
+ }
1058
+ }
1059
+ return first;
1060
+ }
1061
+
1062
+ // ../../node_modules/.pnpm/p-queue@7.4.1/node_modules/p-queue/dist/priority-queue.js
1063
+ var __classPrivateFieldGet = function(receiver, state, kind, f) {
1064
+ if (kind === "a" && !f)
1065
+ throw new TypeError("Private accessor was defined without a getter");
1066
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
1067
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
1068
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
1069
+ };
1070
+ var _PriorityQueue_queue;
1071
+ var PriorityQueue = class {
1072
+ constructor() {
1073
+ _PriorityQueue_queue.set(this, []);
1074
+ }
1075
+ enqueue(run, options) {
1076
+ options = {
1077
+ priority: 0,
1078
+ ...options
1079
+ };
1080
+ const element = {
1081
+ priority: options.priority,
1082
+ run
1083
+ };
1084
+ if (this.size && __classPrivateFieldGet(this, _PriorityQueue_queue, "f")[this.size - 1].priority >= options.priority) {
1085
+ __classPrivateFieldGet(this, _PriorityQueue_queue, "f").push(element);
1086
+ return;
1087
+ }
1088
+ const index = lowerBound(__classPrivateFieldGet(this, _PriorityQueue_queue, "f"), element, (a, b) => b.priority - a.priority);
1089
+ __classPrivateFieldGet(this, _PriorityQueue_queue, "f").splice(index, 0, element);
1090
+ }
1091
+ dequeue() {
1092
+ const item = __classPrivateFieldGet(this, _PriorityQueue_queue, "f").shift();
1093
+ return item === null || item === void 0 ? void 0 : item.run;
1094
+ }
1095
+ filter(options) {
1096
+ return __classPrivateFieldGet(this, _PriorityQueue_queue, "f").filter((element) => element.priority === options.priority).map((element) => element.run);
1097
+ }
1098
+ get size() {
1099
+ return __classPrivateFieldGet(this, _PriorityQueue_queue, "f").length;
1100
+ }
1101
+ };
1102
+ _PriorityQueue_queue = /* @__PURE__ */ new WeakMap();
1103
+ var priority_queue_default = PriorityQueue;
1104
+
1105
+ // ../../node_modules/.pnpm/p-queue@7.4.1/node_modules/p-queue/dist/index.js
1106
+ var __classPrivateFieldSet = function(receiver, state, value, kind, f) {
1107
+ if (kind === "m")
1108
+ throw new TypeError("Private method is not writable");
1109
+ if (kind === "a" && !f)
1110
+ throw new TypeError("Private accessor was defined without a setter");
1111
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
1112
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
1113
+ return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
1114
+ };
1115
+ var __classPrivateFieldGet2 = function(receiver, state, kind, f) {
1116
+ if (kind === "a" && !f)
1117
+ throw new TypeError("Private accessor was defined without a getter");
1118
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
1119
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
1120
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
1121
+ };
1122
+ var _PQueue_instances;
1123
+ var _PQueue_carryoverConcurrencyCount;
1124
+ var _PQueue_isIntervalIgnored;
1125
+ var _PQueue_intervalCount;
1126
+ var _PQueue_intervalCap;
1127
+ var _PQueue_interval;
1128
+ var _PQueue_intervalEnd;
1129
+ var _PQueue_intervalId;
1130
+ var _PQueue_timeoutId;
1131
+ var _PQueue_queue;
1132
+ var _PQueue_queueClass;
1133
+ var _PQueue_pending;
1134
+ var _PQueue_concurrency;
1135
+ var _PQueue_isPaused;
1136
+ var _PQueue_throwOnTimeout;
1137
+ var _PQueue_doesIntervalAllowAnother_get;
1138
+ var _PQueue_doesConcurrentAllowAnother_get;
1139
+ var _PQueue_next;
1140
+ var _PQueue_onResumeInterval;
1141
+ var _PQueue_isIntervalPaused_get;
1142
+ var _PQueue_tryToStartAnother;
1143
+ var _PQueue_initializeIntervalIfNeeded;
1144
+ var _PQueue_onInterval;
1145
+ var _PQueue_processQueue;
1146
+ var _PQueue_throwOnAbort;
1147
+ var _PQueue_onEvent;
1148
+ var AbortError2 = class extends Error {
1149
+ };
1150
+ var PQueue = class extends import_index.default {
1151
+ // TODO: The `throwOnTimeout` option should affect the return types of `add()` and `addAll()`
1152
+ constructor(options) {
1153
+ var _a, _b, _c, _d;
1154
+ super();
1155
+ _PQueue_instances.add(this);
1156
+ _PQueue_carryoverConcurrencyCount.set(this, void 0);
1157
+ _PQueue_isIntervalIgnored.set(this, void 0);
1158
+ _PQueue_intervalCount.set(this, 0);
1159
+ _PQueue_intervalCap.set(this, void 0);
1160
+ _PQueue_interval.set(this, void 0);
1161
+ _PQueue_intervalEnd.set(this, 0);
1162
+ _PQueue_intervalId.set(this, void 0);
1163
+ _PQueue_timeoutId.set(this, void 0);
1164
+ _PQueue_queue.set(this, void 0);
1165
+ _PQueue_queueClass.set(this, void 0);
1166
+ _PQueue_pending.set(this, 0);
1167
+ _PQueue_concurrency.set(this, void 0);
1168
+ _PQueue_isPaused.set(this, void 0);
1169
+ _PQueue_throwOnTimeout.set(this, void 0);
1170
+ Object.defineProperty(this, "timeout", {
1171
+ enumerable: true,
1172
+ configurable: true,
1173
+ writable: true,
1174
+ value: void 0
1175
+ });
1176
+ options = {
1177
+ carryoverConcurrencyCount: false,
1178
+ intervalCap: Number.POSITIVE_INFINITY,
1179
+ interval: 0,
1180
+ concurrency: Number.POSITIVE_INFINITY,
1181
+ autoStart: true,
1182
+ queueClass: priority_queue_default,
1183
+ ...options
1184
+ };
1185
+ if (!(typeof options.intervalCap === "number" && options.intervalCap >= 1)) {
1186
+ throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(_b = (_a = options.intervalCap) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : ""}\` (${typeof options.intervalCap})`);
1187
+ }
1188
+ if (options.interval === void 0 || !(Number.isFinite(options.interval) && options.interval >= 0)) {
1189
+ throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(_d = (_c = options.interval) === null || _c === void 0 ? void 0 : _c.toString()) !== null && _d !== void 0 ? _d : ""}\` (${typeof options.interval})`);
1190
+ }
1191
+ __classPrivateFieldSet(this, _PQueue_carryoverConcurrencyCount, options.carryoverConcurrencyCount, "f");
1192
+ __classPrivateFieldSet(this, _PQueue_isIntervalIgnored, options.intervalCap === Number.POSITIVE_INFINITY || options.interval === 0, "f");
1193
+ __classPrivateFieldSet(this, _PQueue_intervalCap, options.intervalCap, "f");
1194
+ __classPrivateFieldSet(this, _PQueue_interval, options.interval, "f");
1195
+ __classPrivateFieldSet(this, _PQueue_queue, new options.queueClass(), "f");
1196
+ __classPrivateFieldSet(this, _PQueue_queueClass, options.queueClass, "f");
1197
+ this.concurrency = options.concurrency;
1198
+ this.timeout = options.timeout;
1199
+ __classPrivateFieldSet(this, _PQueue_throwOnTimeout, options.throwOnTimeout === true, "f");
1200
+ __classPrivateFieldSet(this, _PQueue_isPaused, options.autoStart === false, "f");
1201
+ }
1202
+ get concurrency() {
1203
+ return __classPrivateFieldGet2(this, _PQueue_concurrency, "f");
1204
+ }
1205
+ set concurrency(newConcurrency) {
1206
+ if (!(typeof newConcurrency === "number" && newConcurrency >= 1)) {
1207
+ throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${newConcurrency}\` (${typeof newConcurrency})`);
1208
+ }
1209
+ __classPrivateFieldSet(this, _PQueue_concurrency, newConcurrency, "f");
1210
+ __classPrivateFieldGet2(this, _PQueue_instances, "m", _PQueue_processQueue).call(this);
1211
+ }
1212
+ async add(function_, options = {}) {
1213
+ options = {
1214
+ timeout: this.timeout,
1215
+ throwOnTimeout: __classPrivateFieldGet2(this, _PQueue_throwOnTimeout, "f"),
1216
+ ...options
1217
+ };
1218
+ return new Promise((resolve2, reject) => {
1219
+ __classPrivateFieldGet2(this, _PQueue_queue, "f").enqueue(async () => {
1220
+ var _a;
1221
+ var _b, _c;
1222
+ __classPrivateFieldSet(this, _PQueue_pending, (_b = __classPrivateFieldGet2(this, _PQueue_pending, "f"), _b++, _b), "f");
1223
+ __classPrivateFieldSet(this, _PQueue_intervalCount, (_c = __classPrivateFieldGet2(this, _PQueue_intervalCount, "f"), _c++, _c), "f");
1224
+ try {
1225
+ if ((_a = options.signal) === null || _a === void 0 ? void 0 : _a.aborted) {
1226
+ throw new AbortError2("The task was aborted.");
1227
+ }
1228
+ let operation = function_({ signal: options.signal });
1229
+ if (options.timeout) {
1230
+ operation = pTimeout(Promise.resolve(operation), options.timeout);
1231
+ }
1232
+ if (options.signal) {
1233
+ operation = Promise.race([operation, __classPrivateFieldGet2(this, _PQueue_instances, "m", _PQueue_throwOnAbort).call(this, options.signal)]);
1234
+ }
1235
+ const result = await operation;
1236
+ resolve2(result);
1237
+ this.emit("completed", result);
1238
+ } catch (error) {
1239
+ if (error instanceof TimeoutError && !options.throwOnTimeout) {
1240
+ resolve2();
1241
+ return;
1242
+ }
1243
+ reject(error);
1244
+ this.emit("error", error);
1245
+ } finally {
1246
+ __classPrivateFieldGet2(this, _PQueue_instances, "m", _PQueue_next).call(this);
1247
+ }
1248
+ }, options);
1249
+ this.emit("add");
1250
+ __classPrivateFieldGet2(this, _PQueue_instances, "m", _PQueue_tryToStartAnother).call(this);
1251
+ });
1252
+ }
1253
+ async addAll(functions, options) {
1254
+ return Promise.all(functions.map(async (function_) => this.add(function_, options)));
1255
+ }
1256
+ /**
1257
+ 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.)
1258
+ */
1259
+ start() {
1260
+ if (!__classPrivateFieldGet2(this, _PQueue_isPaused, "f")) {
1261
+ return this;
1262
+ }
1263
+ __classPrivateFieldSet(this, _PQueue_isPaused, false, "f");
1264
+ __classPrivateFieldGet2(this, _PQueue_instances, "m", _PQueue_processQueue).call(this);
1265
+ return this;
1266
+ }
1267
+ /**
1268
+ Put queue execution on hold.
1269
+ */
1270
+ pause() {
1271
+ __classPrivateFieldSet(this, _PQueue_isPaused, true, "f");
1272
+ }
1273
+ /**
1274
+ Clear the queue.
1275
+ */
1276
+ clear() {
1277
+ __classPrivateFieldSet(this, _PQueue_queue, new (__classPrivateFieldGet2(this, _PQueue_queueClass, "f"))(), "f");
1278
+ }
1279
+ /**
1280
+ Can be called multiple times. Useful if you for example add additional items at a later time.
1281
+
1282
+ @returns A promise that settles when the queue becomes empty.
1283
+ */
1284
+ async onEmpty() {
1285
+ if (__classPrivateFieldGet2(this, _PQueue_queue, "f").size === 0) {
1286
+ return;
1287
+ }
1288
+ await __classPrivateFieldGet2(this, _PQueue_instances, "m", _PQueue_onEvent).call(this, "empty");
1289
+ }
1290
+ /**
1291
+ @returns A promise that settles when the queue size is less than the given limit: `queue.size < limit`.
1292
+
1293
+ If you want to avoid having the queue grow beyond a certain size you can `await queue.onSizeLessThan()` before adding a new item.
1294
+
1295
+ 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.
1296
+ */
1297
+ async onSizeLessThan(limit) {
1298
+ if (__classPrivateFieldGet2(this, _PQueue_queue, "f").size < limit) {
1299
+ return;
1300
+ }
1301
+ await __classPrivateFieldGet2(this, _PQueue_instances, "m", _PQueue_onEvent).call(this, "next", () => __classPrivateFieldGet2(this, _PQueue_queue, "f").size < limit);
1302
+ }
1303
+ /**
1304
+ 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.
1305
+
1306
+ @returns A promise that settles when the queue becomes empty, and all promises have completed; `queue.size === 0 && queue.pending === 0`.
1307
+ */
1308
+ async onIdle() {
1309
+ if (__classPrivateFieldGet2(this, _PQueue_pending, "f") === 0 && __classPrivateFieldGet2(this, _PQueue_queue, "f").size === 0) {
1310
+ return;
1311
+ }
1312
+ await __classPrivateFieldGet2(this, _PQueue_instances, "m", _PQueue_onEvent).call(this, "idle");
1313
+ }
1314
+ /**
1315
+ Size of the queue, the number of queued items waiting to run.
1316
+ */
1317
+ get size() {
1318
+ return __classPrivateFieldGet2(this, _PQueue_queue, "f").size;
1319
+ }
1320
+ /**
1321
+ Size of the queue, filtered by the given options.
1322
+
1323
+ For example, this can be used to find the number of items remaining in the queue with a specific priority level.
1324
+ */
1325
+ sizeBy(options) {
1326
+ return __classPrivateFieldGet2(this, _PQueue_queue, "f").filter(options).length;
1327
+ }
1328
+ /**
1329
+ Number of running items (no longer in the queue).
1330
+ */
1331
+ get pending() {
1332
+ return __classPrivateFieldGet2(this, _PQueue_pending, "f");
1333
+ }
1334
+ /**
1335
+ Whether the queue is currently paused.
1336
+ */
1337
+ get isPaused() {
1338
+ return __classPrivateFieldGet2(this, _PQueue_isPaused, "f");
1339
+ }
1340
+ };
1341
+ _PQueue_carryoverConcurrencyCount = /* @__PURE__ */ new WeakMap(), _PQueue_isIntervalIgnored = /* @__PURE__ */ new WeakMap(), _PQueue_intervalCount = /* @__PURE__ */ new WeakMap(), _PQueue_intervalCap = /* @__PURE__ */ new WeakMap(), _PQueue_interval = /* @__PURE__ */ new WeakMap(), _PQueue_intervalEnd = /* @__PURE__ */ new WeakMap(), _PQueue_intervalId = /* @__PURE__ */ new WeakMap(), _PQueue_timeoutId = /* @__PURE__ */ new WeakMap(), _PQueue_queue = /* @__PURE__ */ new WeakMap(), _PQueue_queueClass = /* @__PURE__ */ new WeakMap(), _PQueue_pending = /* @__PURE__ */ new WeakMap(), _PQueue_concurrency = /* @__PURE__ */ new WeakMap(), _PQueue_isPaused = /* @__PURE__ */ new WeakMap(), _PQueue_throwOnTimeout = /* @__PURE__ */ new WeakMap(), _PQueue_instances = /* @__PURE__ */ new WeakSet(), _PQueue_doesIntervalAllowAnother_get = function _PQueue_doesIntervalAllowAnother_get2() {
1342
+ return __classPrivateFieldGet2(this, _PQueue_isIntervalIgnored, "f") || __classPrivateFieldGet2(this, _PQueue_intervalCount, "f") < __classPrivateFieldGet2(this, _PQueue_intervalCap, "f");
1343
+ }, _PQueue_doesConcurrentAllowAnother_get = function _PQueue_doesConcurrentAllowAnother_get2() {
1344
+ return __classPrivateFieldGet2(this, _PQueue_pending, "f") < __classPrivateFieldGet2(this, _PQueue_concurrency, "f");
1345
+ }, _PQueue_next = function _PQueue_next2() {
1346
+ var _a;
1347
+ __classPrivateFieldSet(this, _PQueue_pending, (_a = __classPrivateFieldGet2(this, _PQueue_pending, "f"), _a--, _a), "f");
1348
+ __classPrivateFieldGet2(this, _PQueue_instances, "m", _PQueue_tryToStartAnother).call(this);
1349
+ this.emit("next");
1350
+ }, _PQueue_onResumeInterval = function _PQueue_onResumeInterval2() {
1351
+ __classPrivateFieldGet2(this, _PQueue_instances, "m", _PQueue_onInterval).call(this);
1352
+ __classPrivateFieldGet2(this, _PQueue_instances, "m", _PQueue_initializeIntervalIfNeeded).call(this);
1353
+ __classPrivateFieldSet(this, _PQueue_timeoutId, void 0, "f");
1354
+ }, _PQueue_isIntervalPaused_get = function _PQueue_isIntervalPaused_get2() {
1355
+ const now = Date.now();
1356
+ if (__classPrivateFieldGet2(this, _PQueue_intervalId, "f") === void 0) {
1357
+ const delay = __classPrivateFieldGet2(this, _PQueue_intervalEnd, "f") - now;
1358
+ if (delay < 0) {
1359
+ __classPrivateFieldSet(this, _PQueue_intervalCount, __classPrivateFieldGet2(this, _PQueue_carryoverConcurrencyCount, "f") ? __classPrivateFieldGet2(this, _PQueue_pending, "f") : 0, "f");
1360
+ } else {
1361
+ if (__classPrivateFieldGet2(this, _PQueue_timeoutId, "f") === void 0) {
1362
+ __classPrivateFieldSet(this, _PQueue_timeoutId, setTimeout(() => {
1363
+ __classPrivateFieldGet2(this, _PQueue_instances, "m", _PQueue_onResumeInterval).call(this);
1364
+ }, delay), "f");
1365
+ }
1366
+ return true;
1367
+ }
1368
+ }
1369
+ return false;
1370
+ }, _PQueue_tryToStartAnother = function _PQueue_tryToStartAnother2() {
1371
+ if (__classPrivateFieldGet2(this, _PQueue_queue, "f").size === 0) {
1372
+ if (__classPrivateFieldGet2(this, _PQueue_intervalId, "f")) {
1373
+ clearInterval(__classPrivateFieldGet2(this, _PQueue_intervalId, "f"));
1374
+ }
1375
+ __classPrivateFieldSet(this, _PQueue_intervalId, void 0, "f");
1376
+ this.emit("empty");
1377
+ if (__classPrivateFieldGet2(this, _PQueue_pending, "f") === 0) {
1378
+ this.emit("idle");
1379
+ }
1380
+ return false;
1381
+ }
1382
+ if (!__classPrivateFieldGet2(this, _PQueue_isPaused, "f")) {
1383
+ const canInitializeInterval = !__classPrivateFieldGet2(this, _PQueue_instances, "a", _PQueue_isIntervalPaused_get);
1384
+ if (__classPrivateFieldGet2(this, _PQueue_instances, "a", _PQueue_doesIntervalAllowAnother_get) && __classPrivateFieldGet2(this, _PQueue_instances, "a", _PQueue_doesConcurrentAllowAnother_get)) {
1385
+ const job = __classPrivateFieldGet2(this, _PQueue_queue, "f").dequeue();
1386
+ if (!job) {
1387
+ return false;
1388
+ }
1389
+ this.emit("active");
1390
+ job();
1391
+ if (canInitializeInterval) {
1392
+ __classPrivateFieldGet2(this, _PQueue_instances, "m", _PQueue_initializeIntervalIfNeeded).call(this);
1393
+ }
1394
+ return true;
1395
+ }
1396
+ }
1397
+ return false;
1398
+ }, _PQueue_initializeIntervalIfNeeded = function _PQueue_initializeIntervalIfNeeded2() {
1399
+ if (__classPrivateFieldGet2(this, _PQueue_isIntervalIgnored, "f") || __classPrivateFieldGet2(this, _PQueue_intervalId, "f") !== void 0) {
1400
+ return;
1401
+ }
1402
+ __classPrivateFieldSet(this, _PQueue_intervalId, setInterval(() => {
1403
+ __classPrivateFieldGet2(this, _PQueue_instances, "m", _PQueue_onInterval).call(this);
1404
+ }, __classPrivateFieldGet2(this, _PQueue_interval, "f")), "f");
1405
+ __classPrivateFieldSet(this, _PQueue_intervalEnd, Date.now() + __classPrivateFieldGet2(this, _PQueue_interval, "f"), "f");
1406
+ }, _PQueue_onInterval = function _PQueue_onInterval2() {
1407
+ if (__classPrivateFieldGet2(this, _PQueue_intervalCount, "f") === 0 && __classPrivateFieldGet2(this, _PQueue_pending, "f") === 0 && __classPrivateFieldGet2(this, _PQueue_intervalId, "f")) {
1408
+ clearInterval(__classPrivateFieldGet2(this, _PQueue_intervalId, "f"));
1409
+ __classPrivateFieldSet(this, _PQueue_intervalId, void 0, "f");
1410
+ }
1411
+ __classPrivateFieldSet(this, _PQueue_intervalCount, __classPrivateFieldGet2(this, _PQueue_carryoverConcurrencyCount, "f") ? __classPrivateFieldGet2(this, _PQueue_pending, "f") : 0, "f");
1412
+ __classPrivateFieldGet2(this, _PQueue_instances, "m", _PQueue_processQueue).call(this);
1413
+ }, _PQueue_processQueue = function _PQueue_processQueue2() {
1414
+ while (__classPrivateFieldGet2(this, _PQueue_instances, "m", _PQueue_tryToStartAnother).call(this)) {
1415
+ }
1416
+ }, _PQueue_throwOnAbort = async function _PQueue_throwOnAbort2(signal) {
1417
+ return new Promise((_resolve, reject) => {
1418
+ signal.addEventListener("abort", () => {
1419
+ reject(new AbortError2("The task was aborted."));
1420
+ }, { once: true });
1421
+ });
1422
+ }, _PQueue_onEvent = async function _PQueue_onEvent2(event, filter) {
1423
+ return new Promise((resolve2) => {
1424
+ const listener = () => {
1425
+ if (filter && !filter()) {
1426
+ return;
1427
+ }
1428
+ this.off(event, listener);
1429
+ resolve2();
1430
+ };
1431
+ this.on(event, listener);
1432
+ });
1433
+ };
1434
+ var dist_default = PQueue;
773
1435
 
774
1436
  // src/BarrelManager.ts
775
- chunkI7UUR5MZ_cjs.init_cjs_shims();
1437
+ chunkMM42A6GN_cjs.init_cjs_shims();
776
1438
 
777
1439
  // src/utils/TreeNode.ts
778
- chunkI7UUR5MZ_cjs.init_cjs_shims();
1440
+ chunkMM42A6GN_cjs.init_cjs_shims();
779
1441
  var TreeNode = class _TreeNode {
780
1442
  constructor(data, parent) {
781
1443
  this.children = [];
@@ -866,12 +1528,12 @@ var TreeNode = class _TreeNode {
866
1528
  var _options;
867
1529
  var BarrelManager = class {
868
1530
  constructor(options = {}) {
869
- chunkI7UUR5MZ_cjs.__privateAdd(this, _options, void 0);
870
- chunkI7UUR5MZ_cjs.__privateSet(this, _options, options);
1531
+ chunkMM42A6GN_cjs.__privateAdd(this, _options, void 0);
1532
+ chunkMM42A6GN_cjs.__privateSet(this, _options, options);
871
1533
  return this;
872
1534
  }
873
1535
  getIndexes(pathToBuild) {
874
- const { treeNode = {}, isTypeOnly, extName } = chunkI7UUR5MZ_cjs.__privateGet(this, _options);
1536
+ const { treeNode = {}, isTypeOnly, extName } = chunkMM42A6GN_cjs.__privateGet(this, _options);
875
1537
  const tree = TreeNode.build(pathToBuild, treeNode);
876
1538
  if (!tree) {
877
1539
  return null;
@@ -883,7 +1545,7 @@ var BarrelManager = class {
883
1545
  if (treeNode2.children.length > 1) {
884
1546
  const indexPath = path4__default.default.resolve(treeNode2.data.path, "index.ts");
885
1547
  const exports = treeNode2.children.filter(Boolean).map((file) => {
886
- const importPath = file.data.type === "directory" ? `./${file.data.name}/index` : `./${chunkABFPJZJL_cjs.trimExtName(file.data.name)}`;
1548
+ const importPath = file.data.type === "directory" ? `./${file.data.name}/index` : `./${chunkU4C2WTCI_cjs.trimExtName(file.data.name)}`;
887
1549
  if (importPath.endsWith("index") && file.data.type === "file") {
888
1550
  return void 0;
889
1551
  }
@@ -904,7 +1566,7 @@ var BarrelManager = class {
904
1566
  } else if (treeNode2.children.length === 1) {
905
1567
  const [treeNodeChild] = treeNode2.children;
906
1568
  const indexPath = path4__default.default.resolve(treeNode2.data.path, "index.ts");
907
- const importPath = treeNodeChild.data.type === "directory" ? `./${treeNodeChild.data.name}/index` : `./${chunkABFPJZJL_cjs.trimExtName(treeNodeChild.data.name)}`;
1569
+ const importPath = treeNodeChild.data.type === "directory" ? `./${treeNodeChild.data.name}/index` : `./${chunkU4C2WTCI_cjs.trimExtName(treeNodeChild.data.name)}`;
908
1570
  const exports = [
909
1571
  {
910
1572
  path: extName ? `${importPath}${extName}` : importPath,
@@ -935,43 +1597,34 @@ _options = new WeakMap();
935
1597
  exports.KubbFile = void 0;
936
1598
  ((KubbFile2) => {
937
1599
  })(exports.KubbFile || (exports.KubbFile = {}));
938
- var _cache, _task, _isWriting, _timeout, _queue, _validate, _add, add_fn, _addOrAppend, addOrAppend_fn;
1600
+ var _cache, _task, _queue, _add, add_fn, _addOrAppend, addOrAppend_fn;
939
1601
  var _FileManager = class _FileManager {
940
- constructor(options) {
941
- chunkI7UUR5MZ_cjs.__privateAdd(this, _validate);
942
- chunkI7UUR5MZ_cjs.__privateAdd(this, _add);
943
- chunkI7UUR5MZ_cjs.__privateAdd(this, _addOrAppend);
944
- chunkI7UUR5MZ_cjs.__privateAdd(this, _cache, /* @__PURE__ */ new Map());
945
- chunkI7UUR5MZ_cjs.__privateAdd(this, _task, void 0);
946
- chunkI7UUR5MZ_cjs.__privateAdd(this, _isWriting, false);
947
- /**
948
- * Timeout between writes
949
- */
950
- chunkI7UUR5MZ_cjs.__privateAdd(this, _timeout, 0);
951
- chunkI7UUR5MZ_cjs.__privateAdd(this, _queue, void 0);
952
- if (options) {
953
- chunkI7UUR5MZ_cjs.__privateSet(this, _task, options.task);
954
- chunkI7UUR5MZ_cjs.__privateSet(this, _queue, options.queue);
955
- chunkI7UUR5MZ_cjs.__privateSet(this, _timeout, options.timeout || 0);
956
- }
1602
+ constructor({ task = async (file) => file, queue = new dist_default() } = {}) {
1603
+ chunkMM42A6GN_cjs.__privateAdd(this, _add);
1604
+ chunkMM42A6GN_cjs.__privateAdd(this, _addOrAppend);
1605
+ chunkMM42A6GN_cjs.__privateAdd(this, _cache, /* @__PURE__ */ new Map());
1606
+ chunkMM42A6GN_cjs.__privateAdd(this, _task, void 0);
1607
+ chunkMM42A6GN_cjs.__privateAdd(this, _queue, void 0);
1608
+ chunkMM42A6GN_cjs.__privateSet(this, _task, task);
1609
+ chunkMM42A6GN_cjs.__privateSet(this, _queue, queue);
957
1610
  return this;
958
1611
  }
959
1612
  get files() {
960
1613
  const files = [];
961
- chunkI7UUR5MZ_cjs.__privateGet(this, _cache).forEach((item) => {
1614
+ chunkMM42A6GN_cjs.__privateGet(this, _cache).forEach((item) => {
962
1615
  files.push(...item.flat(1));
963
1616
  });
964
1617
  return files;
965
1618
  }
966
1619
  get isExecuting() {
967
- return chunkI7UUR5MZ_cjs.__privateGet(this, _queue)?.hasJobs ?? chunkI7UUR5MZ_cjs.__privateGet(this, _isWriting) ?? false;
1620
+ return chunkMM42A6GN_cjs.__privateGet(this, _queue).size !== 0 && chunkMM42A6GN_cjs.__privateGet(this, _queue).pending !== 0;
968
1621
  }
969
1622
  async add(...files) {
970
- const promises = files.map((file) => {
1623
+ const promises = combineFiles(files).map((file) => {
971
1624
  if (file.override) {
972
- return chunkI7UUR5MZ_cjs.__privateMethod(this, _add, add_fn).call(this, file);
1625
+ return chunkMM42A6GN_cjs.__privateMethod(this, _add, add_fn).call(this, file);
973
1626
  }
974
- return chunkI7UUR5MZ_cjs.__privateMethod(this, _addOrAppend, addOrAppend_fn).call(this, file);
1627
+ return chunkMM42A6GN_cjs.__privateMethod(this, _addOrAppend, addOrAppend_fn).call(this, file);
975
1628
  });
976
1629
  const resolvedFiles = await Promise.all(promises);
977
1630
  if (files.length > 1) {
@@ -984,7 +1637,7 @@ var _FileManager = class _FileManager {
984
1637
  if (!exportType) {
985
1638
  return void 0;
986
1639
  }
987
- const exportPath = output.path.startsWith("./") ? output.path : `./${output.path}`;
1640
+ const exportPath = output.path.startsWith("./") ? chunkU4C2WTCI_cjs.trimExtName(output.path) : `./${chunkU4C2WTCI_cjs.trimExtName(output.path)}`;
988
1641
  const barrelManager = new BarrelManager({ extName: output.extName, ...options });
989
1642
  const files = barrelManager.getIndexes(path4.resolve(root, output.path));
990
1643
  if (!files) {
@@ -998,21 +1651,21 @@ var _FileManager = class _FileManager {
998
1651
  output.exportAs ? {
999
1652
  name: output.exportAs,
1000
1653
  asAlias: true,
1001
- path: exportPath,
1654
+ path: output.extName ? `${exportPath}${output.extName}` : exportPath,
1002
1655
  isTypeOnly: options.isTypeOnly
1003
1656
  } : {
1004
- path: exportPath,
1657
+ path: output.extName ? `${exportPath}${output.extName}` : exportPath,
1005
1658
  isTypeOnly: options.isTypeOnly
1006
1659
  }
1007
1660
  ]
1008
1661
  };
1009
- await chunkI7UUR5MZ_cjs.__privateMethod(this, _addOrAppend, addOrAppend_fn).call(this, {
1662
+ await chunkMM42A6GN_cjs.__privateMethod(this, _addOrAppend, addOrAppend_fn).call(this, {
1010
1663
  ...rootFile,
1011
1664
  meta: meta ? meta : rootFile.meta
1012
1665
  });
1013
1666
  return await Promise.all(
1014
1667
  files.map((file) => {
1015
- return chunkI7UUR5MZ_cjs.__privateMethod(this, _addOrAppend, addOrAppend_fn).call(this, {
1668
+ return chunkMM42A6GN_cjs.__privateMethod(this, _addOrAppend, addOrAppend_fn).call(this, {
1016
1669
  ...file,
1017
1670
  meta: meta ? meta : file.meta
1018
1671
  });
@@ -1021,38 +1674,34 @@ var _FileManager = class _FileManager {
1021
1674
  }
1022
1675
  getCacheByUUID(UUID) {
1023
1676
  let cache;
1024
- chunkI7UUR5MZ_cjs.__privateGet(this, _cache).forEach((files) => {
1677
+ chunkMM42A6GN_cjs.__privateGet(this, _cache).forEach((files) => {
1025
1678
  cache = files.find((item) => item.id === UUID);
1026
1679
  });
1027
1680
  return cache;
1028
1681
  }
1029
1682
  get(path5) {
1030
- return chunkI7UUR5MZ_cjs.__privateGet(this, _cache).get(path5);
1683
+ return chunkMM42A6GN_cjs.__privateGet(this, _cache).get(path5);
1031
1684
  }
1032
1685
  remove(path5) {
1033
1686
  const cacheItem = this.get(path5);
1034
1687
  if (!cacheItem) {
1035
1688
  return;
1036
1689
  }
1037
- chunkI7UUR5MZ_cjs.__privateGet(this, _cache).delete(path5);
1690
+ chunkMM42A6GN_cjs.__privateGet(this, _cache).delete(path5);
1038
1691
  }
1039
1692
  async write(...params) {
1040
- if (!chunkI7UUR5MZ_cjs.__privateGet(this, _isWriting)) {
1041
- chunkI7UUR5MZ_cjs.__privateSet(this, _isWriting, true);
1042
- const text = await chunkZ7XZQBAK_cjs.write(...params);
1043
- chunkI7UUR5MZ_cjs.__privateSet(this, _isWriting, false);
1044
- return text;
1045
- }
1046
- await chunk72O327DC_cjs.timeout(chunkI7UUR5MZ_cjs.__privateGet(this, _timeout));
1047
- return this.write(...params);
1693
+ return chunkICRPOCV4_cjs.write(...params);
1048
1694
  }
1049
1695
  async read(...params) {
1050
- return chunkZ7XZQBAK_cjs.read(...params);
1696
+ return chunk35FDNG5F_cjs.read(...params);
1051
1697
  }
1052
1698
  // statics
1053
1699
  static getSource(file) {
1054
1700
  return getSource(file);
1055
1701
  }
1702
+ static combineFiles(files) {
1703
+ return combineFiles(files);
1704
+ }
1056
1705
  static getMode(path5) {
1057
1706
  if (!path5) {
1058
1707
  return "directory";
@@ -1068,33 +1717,27 @@ var _FileManager = class _FileManager {
1068
1717
  };
1069
1718
  _cache = new WeakMap();
1070
1719
  _task = new WeakMap();
1071
- _isWriting = new WeakMap();
1072
- _timeout = new WeakMap();
1073
1720
  _queue = new WeakMap();
1074
- _validate = new WeakSet();
1075
1721
  _add = new WeakSet();
1076
1722
  add_fn = async function(file) {
1077
1723
  const controller = new AbortController();
1078
- const resolvedFile = { id: crypto__default.default.randomUUID(), name: chunkABFPJZJL_cjs.trimExtName(file.baseName), ...file };
1079
- chunkI7UUR5MZ_cjs.__privateGet(this, _cache).set(resolvedFile.path, [{ cancel: () => controller.abort(), ...resolvedFile }]);
1080
- if (chunkI7UUR5MZ_cjs.__privateGet(this, _queue)) {
1081
- await chunkI7UUR5MZ_cjs.__privateGet(this, _queue).run(
1082
- async () => {
1083
- var _a;
1084
- return (_a = chunkI7UUR5MZ_cjs.__privateGet(this, _task)) == null ? void 0 : _a.call(this, resolvedFile);
1085
- },
1086
- { controller }
1087
- );
1088
- }
1089
- return resolvedFile;
1724
+ const resolvedFile = { id: crypto__default.default.randomUUID(), name: chunkU4C2WTCI_cjs.trimExtName(file.baseName), ...file };
1725
+ chunkMM42A6GN_cjs.__privateGet(this, _cache).set(resolvedFile.path, [{ cancel: () => controller.abort(), ...resolvedFile }]);
1726
+ return chunkMM42A6GN_cjs.__privateGet(this, _queue).add(
1727
+ async () => {
1728
+ var _a;
1729
+ return (_a = chunkMM42A6GN_cjs.__privateGet(this, _task)) == null ? void 0 : _a.call(this, resolvedFile);
1730
+ },
1731
+ { signal: controller.signal }
1732
+ );
1090
1733
  };
1091
1734
  _addOrAppend = new WeakSet();
1092
1735
  addOrAppend_fn = async function(file) {
1093
- const previousCaches = chunkI7UUR5MZ_cjs.__privateGet(this, _cache).get(file.path);
1736
+ const previousCaches = chunkMM42A6GN_cjs.__privateGet(this, _cache).get(file.path);
1094
1737
  const previousCache = previousCaches ? previousCaches.at(previousCaches.length - 1) : void 0;
1095
1738
  if (previousCache) {
1096
- chunkI7UUR5MZ_cjs.__privateGet(this, _cache).delete(previousCache.path);
1097
- return chunkI7UUR5MZ_cjs.__privateMethod(this, _add, add_fn).call(this, {
1739
+ chunkMM42A6GN_cjs.__privateGet(this, _cache).delete(previousCache.path);
1740
+ return chunkMM42A6GN_cjs.__privateMethod(this, _add, add_fn).call(this, {
1098
1741
  ...file,
1099
1742
  source: previousCache.source && file.source ? `${previousCache.source}
1100
1743
  ${file.source}` : "",
@@ -1103,9 +1746,37 @@ ${file.source}` : "",
1103
1746
  env: { ...previousCache.env || {}, ...file.env || {} }
1104
1747
  });
1105
1748
  }
1106
- return chunkI7UUR5MZ_cjs.__privateMethod(this, _add, add_fn).call(this, file);
1749
+ return chunkMM42A6GN_cjs.__privateMethod(this, _add, add_fn).call(this, file);
1107
1750
  };
1108
1751
  var FileManager = _FileManager;
1752
+ function combineFiles(files) {
1753
+ return files.filter(Boolean).reduce((acc, file) => {
1754
+ const prevIndex = acc.findIndex((item) => item.path === file.path);
1755
+ if (prevIndex === -1) {
1756
+ return [...acc, file];
1757
+ }
1758
+ const prev = acc[prevIndex];
1759
+ if (prev && file.override) {
1760
+ acc[prevIndex] = {
1761
+ imports: [],
1762
+ exports: [],
1763
+ ...file
1764
+ };
1765
+ return acc;
1766
+ }
1767
+ if (prev) {
1768
+ acc[prevIndex] = {
1769
+ ...file,
1770
+ source: prev.source && file.source ? `${prev.source}
1771
+ ${file.source}` : "",
1772
+ imports: [...prev.imports || [], ...file.imports || []],
1773
+ exports: [...prev.exports || [], ...file.exports || []],
1774
+ env: { ...prev.env || {}, ...file.env || {} }
1775
+ };
1776
+ }
1777
+ return acc;
1778
+ }, []);
1779
+ }
1109
1780
  function getSource(file) {
1110
1781
  if (!FileManager.isExtensionAllowed(file.baseName)) {
1111
1782
  return file.source;
@@ -1113,11 +1784,11 @@ function getSource(file) {
1113
1784
  const exports = file.exports ? combineExports(file.exports) : [];
1114
1785
  const imports = file.imports ? combineImports(file.imports, exports, file.source) : [];
1115
1786
  const importNodes = imports.filter((item) => {
1116
- return item.path !== chunkABFPJZJL_cjs.trimExtName(file.path);
1787
+ return item.path !== chunkU4C2WTCI_cjs.trimExtName(file.path);
1117
1788
  }).map((item) => {
1118
1789
  return factory__namespace.createImportDeclaration({
1119
1790
  name: item.name,
1120
- path: item.root ? chunkZ7XZQBAK_cjs.getRelativePath(item.root, item.path) : item.path,
1791
+ path: item.root ? chunk35FDNG5F_cjs.getRelativePath(item.root, item.path) : item.path,
1121
1792
  isTypeOnly: item.isTypeOnly
1122
1793
  });
1123
1794
  });
@@ -1219,8 +1890,8 @@ function getEnvSource(source, env) {
1219
1890
  throw new TypeError(`Environment should be in upperCase for ${key}`);
1220
1891
  }
1221
1892
  if (typeof replaceBy === "string") {
1222
- prev = chunkABFPJZJL_cjs.searchAndReplace({ text: prev.replaceAll(`process.env.${key}`, replaceBy), replaceBy, prefix: "process.env", key });
1223
- prev = chunkABFPJZJL_cjs.searchAndReplace({ text: prev.replaceAll(new RegExp(`(declare const).*
1893
+ prev = chunkU4C2WTCI_cjs.searchAndReplace({ text: prev.replaceAll(`process.env.${key}`, replaceBy), replaceBy, prefix: "process.env", key });
1894
+ prev = chunkU4C2WTCI_cjs.searchAndReplace({ text: prev.replaceAll(new RegExp(`(declare const).*
1224
1895
  `, "ig"), ""), replaceBy, key });
1225
1896
  }
1226
1897
  return prev;
@@ -1228,10 +1899,33 @@ function getEnvSource(source, env) {
1228
1899
  }
1229
1900
 
1230
1901
  // src/PluginManager.ts
1231
- chunkI7UUR5MZ_cjs.init_cjs_shims();
1902
+ chunkMM42A6GN_cjs.init_cjs_shims();
1903
+
1904
+ // src/utils/EventEmitter.ts
1905
+ chunkMM42A6GN_cjs.init_cjs_shims();
1906
+ var _emitter;
1907
+ var EventEmitter2 = class {
1908
+ constructor() {
1909
+ chunkMM42A6GN_cjs.__privateAdd(this, _emitter, new events.EventEmitter());
1910
+ chunkMM42A6GN_cjs.__privateGet(this, _emitter).setMaxListeners(100);
1911
+ }
1912
+ emit(eventName, ...eventArg) {
1913
+ chunkMM42A6GN_cjs.__privateGet(this, _emitter).emit(eventName, ...eventArg);
1914
+ }
1915
+ on(eventName, handler) {
1916
+ chunkMM42A6GN_cjs.__privateGet(this, _emitter).on(eventName, handler);
1917
+ }
1918
+ off(eventName, handler) {
1919
+ chunkMM42A6GN_cjs.__privateGet(this, _emitter).off(eventName, handler);
1920
+ }
1921
+ removeAll() {
1922
+ chunkMM42A6GN_cjs.__privateGet(this, _emitter).removeAllListeners();
1923
+ }
1924
+ };
1925
+ _emitter = new WeakMap();
1232
1926
 
1233
1927
  // src/errors.ts
1234
- chunkI7UUR5MZ_cjs.init_cjs_shims();
1928
+ chunkMM42A6GN_cjs.init_cjs_shims();
1235
1929
  var Warning = class extends Error {
1236
1930
  constructor(message, options) {
1237
1931
  super(message, { cause: options?.cause });
@@ -1242,10 +1936,10 @@ var ValidationPluginError = class extends Error {
1242
1936
  };
1243
1937
 
1244
1938
  // src/plugin.ts
1245
- chunkI7UUR5MZ_cjs.init_cjs_shims();
1939
+ chunkMM42A6GN_cjs.init_cjs_shims();
1246
1940
 
1247
1941
  // src/utils/cache.ts
1248
- chunkI7UUR5MZ_cjs.init_cjs_shims();
1942
+ chunkMM42A6GN_cjs.init_cjs_shims();
1249
1943
  function createPluginCache(Store = /* @__PURE__ */ Object.create(null)) {
1250
1944
  return {
1251
1945
  set(id, value) {
@@ -1323,10 +2017,10 @@ var definePlugin = createPlugin((options) => {
1323
2017
  });
1324
2018
 
1325
2019
  // src/PromiseManager.ts
1326
- chunkI7UUR5MZ_cjs.init_cjs_shims();
2020
+ chunkMM42A6GN_cjs.init_cjs_shims();
1327
2021
 
1328
2022
  // src/utils/executeStrategies.ts
1329
- chunkI7UUR5MZ_cjs.init_cjs_shims();
2023
+ chunkMM42A6GN_cjs.init_cjs_shims();
1330
2024
  function hookSeq(promises) {
1331
2025
  return promises.filter(Boolean).reduce(
1332
2026
  (promise, func) => {
@@ -1364,8 +2058,8 @@ function hookParallel(promises) {
1364
2058
  var _options2;
1365
2059
  var PromiseManager = class {
1366
2060
  constructor(options = {}) {
1367
- chunkI7UUR5MZ_cjs.__privateAdd(this, _options2, {});
1368
- chunkI7UUR5MZ_cjs.__privateSet(this, _options2, options);
2061
+ chunkMM42A6GN_cjs.__privateAdd(this, _options2, {});
2062
+ chunkMM42A6GN_cjs.__privateSet(this, _options2, options);
1369
2063
  return this;
1370
2064
  }
1371
2065
  run(strategy, promises) {
@@ -1373,7 +2067,7 @@ var PromiseManager = class {
1373
2067
  return hookSeq(promises);
1374
2068
  }
1375
2069
  if (strategy === "first") {
1376
- return hookFirst(promises, chunkI7UUR5MZ_cjs.__privateGet(this, _options2).nullCheck);
2070
+ return hookFirst(promises, chunkMM42A6GN_cjs.__privateGet(this, _options2).nullCheck);
1377
2071
  }
1378
2072
  if (strategy === "parallel") {
1379
2073
  return hookParallel(promises);
@@ -1393,8 +2087,8 @@ function isPromiseRejectedResult(result) {
1393
2087
  var _core, _usedPluginNames, _promiseManager, _getSortedPlugins, getSortedPlugins_fn, _addExecutedToCallStack, addExecutedToCallStack_fn, _execute, execute_fn, _executeSync, executeSync_fn, _catcher, catcher_fn, _parse, parse_fn;
1394
2088
  var PluginManager = class {
1395
2089
  constructor(config, options) {
1396
- chunkI7UUR5MZ_cjs.__privateAdd(this, _getSortedPlugins);
1397
- chunkI7UUR5MZ_cjs.__privateAdd(this, _addExecutedToCallStack);
2090
+ chunkMM42A6GN_cjs.__privateAdd(this, _getSortedPlugins);
2091
+ chunkMM42A6GN_cjs.__privateAdd(this, _addExecutedToCallStack);
1398
2092
  /**
1399
2093
  * Run an async plugin hook and return the result.
1400
2094
  * @param hookName Name of the plugin hook. Must be either in `PluginHooks` or `OutputPluginValueHooks`.
@@ -1402,7 +2096,7 @@ var PluginManager = class {
1402
2096
  * @param plugin The actual pluginObject to run.
1403
2097
  */
1404
2098
  // Implementation signature
1405
- chunkI7UUR5MZ_cjs.__privateAdd(this, _execute);
2099
+ chunkMM42A6GN_cjs.__privateAdd(this, _execute);
1406
2100
  /**
1407
2101
  * Run a sync plugin hook and return the result.
1408
2102
  * @param hookName Name of the plugin hook. Must be in `PluginHooks`.
@@ -1410,14 +2104,14 @@ var PluginManager = class {
1410
2104
  * @param plugin The acutal plugin
1411
2105
  * @param replaceContext When passed, the plugin context can be overridden.
1412
2106
  */
1413
- chunkI7UUR5MZ_cjs.__privateAdd(this, _executeSync);
1414
- chunkI7UUR5MZ_cjs.__privateAdd(this, _catcher);
1415
- chunkI7UUR5MZ_cjs.__privateAdd(this, _parse);
1416
- this.events = new chunk72O327DC_cjs.EventEmitter();
2107
+ chunkMM42A6GN_cjs.__privateAdd(this, _executeSync);
2108
+ chunkMM42A6GN_cjs.__privateAdd(this, _catcher);
2109
+ chunkMM42A6GN_cjs.__privateAdd(this, _parse);
2110
+ this.events = new EventEmitter2();
1417
2111
  this.executed = [];
1418
- chunkI7UUR5MZ_cjs.__privateAdd(this, _core, void 0);
1419
- chunkI7UUR5MZ_cjs.__privateAdd(this, _usedPluginNames, {});
1420
- chunkI7UUR5MZ_cjs.__privateAdd(this, _promiseManager, void 0);
2112
+ chunkMM42A6GN_cjs.__privateAdd(this, _core, void 0);
2113
+ chunkMM42A6GN_cjs.__privateAdd(this, _usedPluginNames, {});
2114
+ chunkMM42A6GN_cjs.__privateAdd(this, _promiseManager, void 0);
1421
2115
  this.resolvePath = (params) => {
1422
2116
  if (params.pluginKey) {
1423
2117
  const paths = this.hookForPluginSync({
@@ -1425,8 +2119,8 @@ var PluginManager = class {
1425
2119
  hookName: "resolvePath",
1426
2120
  parameters: [params.baseName, params.directory, params.options]
1427
2121
  });
1428
- if (paths && paths?.length > 1 && this.logger.logLevel === chunk77QZQ377_cjs.LogLevel.debug) {
1429
- this.logger.warn(
2122
+ if (paths && paths?.length > 1 && this.logger.logLevel === chunkGBX7KRCX_cjs.LogLevel.debug) {
2123
+ this.logger.debug(
1430
2124
  `Cannot return a path where the 'pluginKey' ${params.pluginKey ? JSON.stringify(params.pluginKey) : '"'} is not unique enough
1431
2125
 
1432
2126
  Paths: ${JSON.stringify(paths, void 0, 2)}
@@ -1449,8 +2143,8 @@ Falling back on the first item.
1449
2143
  hookName: "resolveName",
1450
2144
  parameters: [params.name, params.type]
1451
2145
  });
1452
- if (names && names?.length > 1 && this.logger.logLevel === chunk77QZQ377_cjs.LogLevel.debug) {
1453
- this.logger.warn(
2146
+ if (names && names?.length > 1 && this.logger.logLevel === chunkGBX7KRCX_cjs.LogLevel.debug) {
2147
+ this.logger.debug(
1454
2148
  `Cannot return a name where the 'pluginKey' ${params.pluginKey ? JSON.stringify(params.pluginKey) : '"'} is not unique enough
1455
2149
 
1456
2150
  Names: ${JSON.stringify(names, void 0, 2)}
@@ -1459,19 +2153,19 @@ Falling back on the first item.
1459
2153
  `
1460
2154
  );
1461
2155
  }
1462
- return chunkABFPJZJL_cjs.transformReservedWord(names?.at(0) || params.name);
2156
+ return chunkU4C2WTCI_cjs.transformReservedWord(names?.at(0) || params.name);
1463
2157
  }
1464
2158
  const name = this.hookFirstSync({
1465
2159
  hookName: "resolveName",
1466
2160
  parameters: [params.name, params.type]
1467
2161
  }).result;
1468
- return chunkABFPJZJL_cjs.transformReservedWord(name);
2162
+ return chunkU4C2WTCI_cjs.transformReservedWord(name);
1469
2163
  };
1470
2164
  this.config = config;
1471
2165
  this.logger = options.logger;
1472
- this.queue = new chunk72O327DC_cjs.Queue(100, this.logger.logLevel === chunk77QZQ377_cjs.LogLevel.debug);
1473
- this.fileManager = new FileManager({ task: options.task, queue: this.queue, timeout: options.writeTimeout });
1474
- chunkI7UUR5MZ_cjs.__privateSet(this, _promiseManager, new PromiseManager({ nullCheck: (state) => !!state?.result }));
2166
+ this.queue = new dist_default({ concurrency: 1 });
2167
+ this.fileManager = new FileManager({ task: options.task, queue: this.queue });
2168
+ chunkMM42A6GN_cjs.__privateSet(this, _promiseManager, new PromiseManager({ nullCheck: (state) => !!state?.result }));
1475
2169
  const plugins = config.plugins || [];
1476
2170
  const core = definePlugin({
1477
2171
  config,
@@ -1480,11 +2174,11 @@ Falling back on the first item.
1480
2174
  fileManager: this.fileManager,
1481
2175
  resolvePath: this.resolvePath.bind(this),
1482
2176
  resolveName: this.resolveName.bind(this),
1483
- getPlugins: chunkI7UUR5MZ_cjs.__privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).bind(this)
2177
+ getPlugins: chunkMM42A6GN_cjs.__privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).bind(this)
1484
2178
  });
1485
- chunkI7UUR5MZ_cjs.__privateSet(this, _core, chunkI7UUR5MZ_cjs.__privateMethod(this, _parse, parse_fn).call(this, core, this, core.api.call(null)));
1486
- this.plugins = [chunkI7UUR5MZ_cjs.__privateGet(this, _core), ...plugins].map((plugin) => {
1487
- return chunkI7UUR5MZ_cjs.__privateMethod(this, _parse, parse_fn).call(this, plugin, this, chunkI7UUR5MZ_cjs.__privateGet(this, _core).api);
2179
+ chunkMM42A6GN_cjs.__privateSet(this, _core, chunkMM42A6GN_cjs.__privateMethod(this, _parse, parse_fn).call(this, core, this, core.api.call(null)));
2180
+ this.plugins = [chunkMM42A6GN_cjs.__privateGet(this, _core), ...plugins].map((plugin) => {
2181
+ return chunkMM42A6GN_cjs.__privateMethod(this, _parse, parse_fn).call(this, plugin, this, chunkMM42A6GN_cjs.__privateGet(this, _core).api);
1488
2182
  });
1489
2183
  return this;
1490
2184
  }
@@ -1504,7 +2198,7 @@ Falling back on the first item.
1504
2198
  }) {
1505
2199
  const plugins = this.getPluginsByKey(hookName, pluginKey);
1506
2200
  const promises = plugins.map((plugin) => {
1507
- return chunkI7UUR5MZ_cjs.__privateMethod(this, _execute, execute_fn).call(this, {
2201
+ return chunkMM42A6GN_cjs.__privateMethod(this, _execute, execute_fn).call(this, {
1508
2202
  strategy: "hookFirst",
1509
2203
  hookName,
1510
2204
  parameters,
@@ -1523,7 +2217,7 @@ Falling back on the first item.
1523
2217
  }) {
1524
2218
  const plugins = this.getPluginsByKey(hookName, pluginKey);
1525
2219
  return plugins.map((plugin) => {
1526
- return chunkI7UUR5MZ_cjs.__privateMethod(this, _executeSync, executeSync_fn).call(this, {
2220
+ return chunkMM42A6GN_cjs.__privateMethod(this, _executeSync, executeSync_fn).call(this, {
1527
2221
  strategy: "hookFirst",
1528
2222
  hookName,
1529
2223
  parameters,
@@ -1539,11 +2233,11 @@ Falling back on the first item.
1539
2233
  parameters,
1540
2234
  skipped
1541
2235
  }) {
1542
- const promises = chunkI7UUR5MZ_cjs.__privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this).filter((plugin) => {
2236
+ const promises = chunkMM42A6GN_cjs.__privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this).filter((plugin) => {
1543
2237
  return skipped ? skipped.has(plugin) : true;
1544
2238
  }).map((plugin) => {
1545
2239
  return async () => {
1546
- const value = await chunkI7UUR5MZ_cjs.__privateMethod(this, _execute, execute_fn).call(this, {
2240
+ const value = await chunkMM42A6GN_cjs.__privateMethod(this, _execute, execute_fn).call(this, {
1547
2241
  strategy: "hookFirst",
1548
2242
  hookName,
1549
2243
  parameters,
@@ -1557,7 +2251,7 @@ Falling back on the first item.
1557
2251
  );
1558
2252
  };
1559
2253
  });
1560
- return chunkI7UUR5MZ_cjs.__privateGet(this, _promiseManager).run("first", promises);
2254
+ return chunkMM42A6GN_cjs.__privateGet(this, _promiseManager).run("first", promises);
1561
2255
  }
1562
2256
  /**
1563
2257
  * First non-null result stops and will return it's value.
@@ -1568,12 +2262,12 @@ Falling back on the first item.
1568
2262
  skipped
1569
2263
  }) {
1570
2264
  let parseResult = null;
1571
- for (const plugin of chunkI7UUR5MZ_cjs.__privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this)) {
2265
+ for (const plugin of chunkMM42A6GN_cjs.__privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this)) {
1572
2266
  if (skipped && skipped.has(plugin)) {
1573
2267
  continue;
1574
2268
  }
1575
2269
  parseResult = {
1576
- result: chunkI7UUR5MZ_cjs.__privateMethod(this, _executeSync, executeSync_fn).call(this, {
2270
+ result: chunkMM42A6GN_cjs.__privateMethod(this, _executeSync, executeSync_fn).call(this, {
1577
2271
  strategy: "hookFirst",
1578
2272
  hookName,
1579
2273
  parameters,
@@ -1594,14 +2288,14 @@ Falling back on the first item.
1594
2288
  hookName,
1595
2289
  parameters
1596
2290
  }) {
1597
- const promises = chunkI7UUR5MZ_cjs.__privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this).map((plugin) => {
1598
- return () => chunkI7UUR5MZ_cjs.__privateMethod(this, _execute, execute_fn).call(this, { strategy: "hookParallel", hookName, parameters, plugin });
2291
+ const promises = chunkMM42A6GN_cjs.__privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this).map((plugin) => {
2292
+ return () => chunkMM42A6GN_cjs.__privateMethod(this, _execute, execute_fn).call(this, { strategy: "hookParallel", hookName, parameters, plugin });
1599
2293
  });
1600
- const results = await chunkI7UUR5MZ_cjs.__privateGet(this, _promiseManager).run("parallel", promises);
2294
+ const results = await chunkMM42A6GN_cjs.__privateGet(this, _promiseManager).run("parallel", promises);
1601
2295
  results.forEach((result, index) => {
1602
2296
  if (isPromiseRejectedResult(result)) {
1603
- const plugin = chunkI7UUR5MZ_cjs.__privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this)[index];
1604
- chunkI7UUR5MZ_cjs.__privateMethod(this, _catcher, catcher_fn).call(this, result.reason, plugin, hookName);
2297
+ const plugin = chunkMM42A6GN_cjs.__privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this)[index];
2298
+ chunkMM42A6GN_cjs.__privateMethod(this, _catcher, catcher_fn).call(this, result.reason, plugin, hookName);
1605
2299
  }
1606
2300
  });
1607
2301
  return results.filter((result) => result.status === "fulfilled").map((result) => result.value);
@@ -1616,16 +2310,16 @@ Falling back on the first item.
1616
2310
  }) {
1617
2311
  const [argument0, ...rest] = parameters;
1618
2312
  let promise = Promise.resolve(argument0);
1619
- for (const plugin of chunkI7UUR5MZ_cjs.__privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this)) {
2313
+ for (const plugin of chunkMM42A6GN_cjs.__privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this)) {
1620
2314
  promise = promise.then((arg0) => {
1621
- const value = chunkI7UUR5MZ_cjs.__privateMethod(this, _execute, execute_fn).call(this, {
2315
+ const value = chunkMM42A6GN_cjs.__privateMethod(this, _execute, execute_fn).call(this, {
1622
2316
  strategy: "hookReduceArg0",
1623
2317
  hookName,
1624
2318
  parameters: [arg0, ...rest],
1625
2319
  plugin
1626
2320
  });
1627
2321
  return value;
1628
- }).then((result) => reduce.call(chunkI7UUR5MZ_cjs.__privateGet(this, _core).api, argument0, result, plugin));
2322
+ }).then((result) => reduce.call(chunkMM42A6GN_cjs.__privateGet(this, _core).api, argument0, result, plugin));
1629
2323
  }
1630
2324
  return promise;
1631
2325
  }
@@ -1633,15 +2327,15 @@ Falling back on the first item.
1633
2327
  * Chains plugins
1634
2328
  */
1635
2329
  async hookSeq({ hookName, parameters }) {
1636
- const promises = chunkI7UUR5MZ_cjs.__privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this).map((plugin) => {
1637
- return () => chunkI7UUR5MZ_cjs.__privateMethod(this, _execute, execute_fn).call(this, {
2330
+ const promises = chunkMM42A6GN_cjs.__privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this).map((plugin) => {
2331
+ return () => chunkMM42A6GN_cjs.__privateMethod(this, _execute, execute_fn).call(this, {
1638
2332
  strategy: "hookSeq",
1639
2333
  hookName,
1640
2334
  parameters,
1641
2335
  plugin
1642
2336
  });
1643
2337
  });
1644
- return chunkI7UUR5MZ_cjs.__privateGet(this, _promiseManager).run("seq", promises);
2338
+ return chunkMM42A6GN_cjs.__privateGet(this, _promiseManager).run("seq", promises);
1645
2339
  }
1646
2340
  getPluginsByKey(hookName, pluginKey) {
1647
2341
  const plugins = [...this.plugins];
@@ -1657,11 +2351,11 @@ Falling back on the first item.
1657
2351
  });
1658
2352
  if (!pluginByPluginName?.length) {
1659
2353
  const corePlugin = plugins.find((plugin) => plugin.name === "core" && plugin[hookName]);
1660
- if (this.logger.logLevel === chunk77QZQ377_cjs.LogLevel.debug) {
2354
+ if (this.logger.logLevel === chunkGBX7KRCX_cjs.LogLevel.debug) {
1661
2355
  if (corePlugin) {
1662
- this.logger.warn(`No hook '${hookName}' for pluginKey '${JSON.stringify(pluginKey)}' found, falling back on the '@kubb/core' plugin`);
2356
+ this.logger.debug(`No hook '${hookName}' for pluginKey '${JSON.stringify(pluginKey)}' found, falling back on the '@kubb/core' plugin`);
1663
2357
  } else {
1664
- this.logger.warn(`No hook '${hookName}' for pluginKey '${JSON.stringify(pluginKey)}' found, no fallback found in the '@kubb/core' plugin`);
2358
+ this.logger.debug(`No hook '${hookName}' for pluginKey '${JSON.stringify(pluginKey)}' found, no fallback found in the '@kubb/core' plugin`);
1665
2359
  }
1666
2360
  }
1667
2361
  return corePlugin ? [corePlugin] : [];
@@ -1695,7 +2389,7 @@ _getSortedPlugins = new WeakSet();
1695
2389
  getSortedPlugins_fn = function(hookName) {
1696
2390
  const plugins = [...this.plugins].filter((plugin) => plugin.name !== "core");
1697
2391
  if (hookName) {
1698
- if (this.logger.logLevel === chunk77QZQ377_cjs.LogLevel.info) {
2392
+ if (this.logger.logLevel === chunkGBX7KRCX_cjs.LogLevel.info) {
1699
2393
  const containsHookName = plugins.some((item) => item[hookName]);
1700
2394
  if (!containsHookName) {
1701
2395
  this.logger.warn(`No hook ${hookName} found`);
@@ -1743,7 +2437,7 @@ execute_fn = function({
1743
2437
  this.events.emit("execute", { strategy, hookName, parameters, plugin });
1744
2438
  const task = Promise.resolve().then(() => {
1745
2439
  if (typeof hook === "function") {
1746
- const possiblePromiseResult = hook.apply({ ...chunkI7UUR5MZ_cjs.__privateGet(this, _core).api, plugin }, parameters);
2440
+ const possiblePromiseResult = hook.apply({ ...chunkMM42A6GN_cjs.__privateGet(this, _core).api, plugin }, parameters);
1747
2441
  if (isPromise(possiblePromiseResult)) {
1748
2442
  return Promise.resolve(possiblePromiseResult);
1749
2443
  }
@@ -1752,7 +2446,7 @@ execute_fn = function({
1752
2446
  return hook;
1753
2447
  }).then((result) => {
1754
2448
  output = result;
1755
- chunkI7UUR5MZ_cjs.__privateMethod(this, _addExecutedToCallStack, addExecutedToCallStack_fn).call(this, {
2449
+ chunkMM42A6GN_cjs.__privateMethod(this, _addExecutedToCallStack, addExecutedToCallStack_fn).call(this, {
1756
2450
  parameters,
1757
2451
  output,
1758
2452
  strategy,
@@ -1761,7 +2455,7 @@ execute_fn = function({
1761
2455
  });
1762
2456
  return result;
1763
2457
  }).catch((e) => {
1764
- chunkI7UUR5MZ_cjs.__privateMethod(this, _catcher, catcher_fn).call(this, e, plugin, hookName);
2458
+ chunkMM42A6GN_cjs.__privateMethod(this, _catcher, catcher_fn).call(this, e, plugin, hookName);
1765
2459
  return null;
1766
2460
  });
1767
2461
  return task;
@@ -1781,12 +2475,12 @@ executeSync_fn = function({
1781
2475
  this.events.emit("execute", { strategy, hookName, parameters, plugin });
1782
2476
  try {
1783
2477
  if (typeof hook === "function") {
1784
- const fn = hook.apply({ ...chunkI7UUR5MZ_cjs.__privateGet(this, _core).api, plugin }, parameters);
2478
+ const fn = hook.apply({ ...chunkMM42A6GN_cjs.__privateGet(this, _core).api, plugin }, parameters);
1785
2479
  output = fn;
1786
2480
  return fn;
1787
2481
  }
1788
2482
  output = hook;
1789
- chunkI7UUR5MZ_cjs.__privateMethod(this, _addExecutedToCallStack, addExecutedToCallStack_fn).call(this, {
2483
+ chunkMM42A6GN_cjs.__privateMethod(this, _addExecutedToCallStack, addExecutedToCallStack_fn).call(this, {
1790
2484
  parameters,
1791
2485
  output,
1792
2486
  strategy,
@@ -1795,7 +2489,7 @@ executeSync_fn = function({
1795
2489
  });
1796
2490
  return hook;
1797
2491
  } catch (e) {
1798
- chunkI7UUR5MZ_cjs.__privateMethod(this, _catcher, catcher_fn).call(this, e, plugin, hookName);
2492
+ chunkMM42A6GN_cjs.__privateMethod(this, _catcher, catcher_fn).call(this, e, plugin, hookName);
1799
2493
  return null;
1800
2494
  }
1801
2495
  };
@@ -1808,12 +2502,9 @@ catcher_fn = function(e, plugin, hookName) {
1808
2502
  };
1809
2503
  _parse = new WeakSet();
1810
2504
  parse_fn = function(plugin, pluginManager, context) {
1811
- const usedPluginNames = chunkI7UUR5MZ_cjs.__privateGet(pluginManager, _usedPluginNames);
1812
- chunk72O327DC_cjs.setUniqueName(plugin.name, usedPluginNames);
2505
+ const usedPluginNames = chunkMM42A6GN_cjs.__privateGet(pluginManager, _usedPluginNames);
2506
+ chunkLAS7UYTK_cjs.setUniqueName(plugin.name, usedPluginNames);
1813
2507
  const key = [plugin.name, usedPluginNames[plugin.name]].filter(Boolean);
1814
- if (plugin.name !== "core" && usedPluginNames[plugin.name] >= 2) {
1815
- pluginManager.logger.warn("Using multiple of the same plugin is an experimental feature");
1816
- }
1817
2508
  if (!plugin.transform) {
1818
2509
  plugin.transform = function transform(code) {
1819
2510
  return code;
@@ -1838,15 +2529,16 @@ async function transformReducer(_previousCode, result, _plugin) {
1838
2529
  return result;
1839
2530
  }
1840
2531
  async function setup(options) {
1841
- const { config, logger = chunk77QZQ377_cjs.createLogger({ logLevel: chunk77QZQ377_cjs.LogLevel.silent }) } = options;
2532
+ const { config, logger = chunkGBX7KRCX_cjs.createLogger({ logLevel: chunkGBX7KRCX_cjs.LogLevel.silent }) } = options;
2533
+ let count = 0;
1842
2534
  try {
1843
- if (isInputPath(config) && !new chunk72O327DC_cjs.URLPath(config.input.path).isURL) {
1844
- await chunkZ7XZQBAK_cjs.read(config.input.path);
2535
+ if (isInputPath(config) && !new chunkLAS7UYTK_cjs.URLPath(config.input.path).isURL) {
2536
+ await chunk35FDNG5F_cjs.read(config.input.path);
1845
2537
  }
1846
2538
  } catch (e) {
1847
2539
  if (isInputPath(config)) {
1848
2540
  throw new Error(
1849
- "Cannot read file/URL defined in `input.path` or set with `kubb generate PATH` in the CLI of your Kubb config " + chunk77QZQ377_cjs.p.dim(config.input.path),
2541
+ "Cannot read file/URL defined in `input.path` or set with `kubb generate PATH` in the CLI of your Kubb config " + chunkGBX7KRCX_cjs.p.dim(config.input.path),
1850
2542
  {
1851
2543
  cause: e
1852
2544
  }
@@ -1854,78 +2546,97 @@ async function setup(options) {
1854
2546
  }
1855
2547
  }
1856
2548
  if (config.output.clean) {
1857
- await chunkZ7XZQBAK_cjs.clean(config.output.path);
2549
+ await chunk35FDNG5F_cjs.clean(config.output.path);
1858
2550
  }
1859
- const queueTask = async (file) => {
2551
+ const task = async (file) => {
1860
2552
  const { path: path5 } = file;
1861
- let code = FileManager.getSource(file);
2553
+ let source = FileManager.getSource(file);
1862
2554
  const { result: loadedResult } = await pluginManager.hookFirst({
1863
2555
  hookName: "load",
1864
2556
  parameters: [path5]
1865
2557
  });
1866
2558
  if (loadedResult && isPromise(loadedResult)) {
1867
- code = await loadedResult;
2559
+ source = await loadedResult;
1868
2560
  }
1869
2561
  if (loadedResult && !isPromise(loadedResult)) {
1870
- code = loadedResult;
2562
+ source = loadedResult;
1871
2563
  }
1872
- if (code) {
1873
- const transformedCode = await pluginManager.hookReduceArg0({
2564
+ if (source) {
2565
+ source = await pluginManager.hookReduceArg0({
1874
2566
  hookName: "transform",
1875
- parameters: [code, path5],
2567
+ parameters: [source, path5],
1876
2568
  reduce: transformReducer
1877
2569
  });
1878
2570
  if (config.output.write || config.output.write === void 0) {
1879
2571
  if (file.meta?.pluginKey) {
1880
- return pluginManager.hookForPlugin({
2572
+ await pluginManager.hookForPlugin({
1881
2573
  pluginKey: file.meta?.pluginKey,
1882
2574
  hookName: "writeFile",
1883
- parameters: [transformedCode, path5]
2575
+ parameters: [source, path5]
1884
2576
  });
1885
2577
  }
1886
- return pluginManager.hookFirst({
2578
+ await pluginManager.hookFirst({
1887
2579
  hookName: "writeFile",
1888
- parameters: [transformedCode, path5]
2580
+ parameters: [source, path5]
1889
2581
  });
1890
2582
  }
1891
2583
  }
2584
+ return {
2585
+ ...file,
2586
+ source: source || ""
2587
+ };
1892
2588
  };
1893
- const pluginManager = new PluginManager(config, { logger, task: queueTask, writeTimeout: 0 });
2589
+ const pluginManager = new PluginManager(config, { logger, task });
1894
2590
  pluginManager.on("execute", (executer) => {
1895
2591
  const { hookName, parameters, plugin } = executer;
1896
2592
  if (hookName === "writeFile" && logger.spinner) {
1897
2593
  const [code] = parameters;
1898
- if (logger.logLevel === chunk77QZQ377_cjs.LogLevel.info) {
1899
- logger.spinner.start(`\u{1F4BE} Writing`);
1900
- }
1901
- if (logger.logLevel === chunk77QZQ377_cjs.LogLevel.debug) {
1902
- logger.info(`PluginKey ${chunk77QZQ377_cjs.p.dim(JSON.stringify(plugin.key))}
2594
+ if (logger.logLevel === chunkGBX7KRCX_cjs.LogLevel.debug) {
2595
+ logger.debug(`PluginKey ${chunkGBX7KRCX_cjs.p.dim(JSON.stringify(plugin.key))}
1903
2596
  with source
1904
2597
 
1905
2598
  ${code}`);
1906
2599
  }
1907
2600
  }
1908
2601
  });
2602
+ pluginManager.queue.on("add", () => {
2603
+ if (logger.logLevel !== chunkGBX7KRCX_cjs.LogLevel.info) {
2604
+ return;
2605
+ }
2606
+ if (logger.spinner && count === 0) {
2607
+ logger.spinner?.start(`\u{1F4BE} Writing`);
2608
+ }
2609
+ });
2610
+ pluginManager.queue.on("active", () => {
2611
+ if (logger.logLevel !== chunkGBX7KRCX_cjs.LogLevel.info) {
2612
+ return;
2613
+ }
2614
+ if (logger.spinner && pluginManager.queue.size > 0) {
2615
+ const text = `Item: ${count} Size: ${pluginManager.queue.size} Pending: ${pluginManager.queue.pending}`;
2616
+ logger.spinner.suffixText = chunkGBX7KRCX_cjs.p.dim(text);
2617
+ }
2618
+ ++count;
2619
+ });
2620
+ pluginManager.queue.on("completed", () => {
2621
+ if (logger.logLevel !== chunkGBX7KRCX_cjs.LogLevel.info) {
2622
+ return;
2623
+ }
2624
+ if (logger.spinner) {
2625
+ const text = `Item: ${count} Size: ${pluginManager.queue.size} Pending: ${pluginManager.queue.pending}`;
2626
+ logger.spinner.suffixText = chunkGBX7KRCX_cjs.p.dim(text);
2627
+ }
2628
+ });
1909
2629
  pluginManager.on("executed", (executer) => {
1910
2630
  const { hookName, plugin, output, parameters } = executer;
1911
- const messsage = `${chunk77QZQ377_cjs.randomCliColour(plugin.name)} Executing ${hookName}`;
1912
- if (logger.logLevel === chunk77QZQ377_cjs.LogLevel.info && logger.spinner) {
1913
- if (hookName === "writeFile") {
1914
- const [_code, path5] = parameters;
1915
- logger.spinner.suffixText = chunk77QZQ377_cjs.p.dim(path5);
1916
- } else {
1917
- logger.spinner.suffixText = messsage;
1918
- }
1919
- }
1920
- if (logger.logLevel === chunk77QZQ377_cjs.LogLevel.debug) {
1921
- logger.info(messsage);
2631
+ if (logger.logLevel === chunkGBX7KRCX_cjs.LogLevel.debug) {
1922
2632
  const logs = [
1923
- parameters && `${chunk77QZQ377_cjs.p.bgWhite(`Parameters`)} ${chunk77QZQ377_cjs.randomCliColour(plugin.name)} ${hookName}`,
2633
+ `${chunkGBX7KRCX_cjs.randomCliColour(plugin.name)} Executing ${hookName}`,
2634
+ parameters && `${chunkGBX7KRCX_cjs.p.bgWhite(`Parameters`)} ${chunkGBX7KRCX_cjs.randomCliColour(plugin.name)} ${hookName}`,
1924
2635
  JSON.stringify(parameters, void 0, 2),
1925
- output && `${chunk77QZQ377_cjs.p.bgWhite("Output")} ${chunk77QZQ377_cjs.randomCliColour(plugin.name)} ${hookName}`,
2636
+ output && `${chunkGBX7KRCX_cjs.p.bgWhite("Output")} ${chunkGBX7KRCX_cjs.randomCliColour(plugin.name)} ${hookName}`,
1926
2637
  output
1927
2638
  ].filter(Boolean);
1928
- console.log(logs.join("\n"));
2639
+ logger.debug(logs.join("\n"));
1929
2640
  }
1930
2641
  });
1931
2642
  return pluginManager;
@@ -1938,7 +2649,7 @@ async function build(options) {
1938
2649
  parameters: [options.config]
1939
2650
  });
1940
2651
  await pluginManager.hookParallel({ hookName: "buildEnd" });
1941
- if (!fileManager.isExecuting && logger.spinner) {
2652
+ if (logger.logLevel === chunkGBX7KRCX_cjs.LogLevel.info && logger.spinner) {
1942
2653
  logger.spinner.suffixText = "";
1943
2654
  logger.spinner.succeed(`\u{1F4BE} Writing completed`);
1944
2655
  }
@@ -1953,7 +2664,7 @@ async function safeBuild(options) {
1953
2664
  parameters: [options.config]
1954
2665
  });
1955
2666
  await pluginManager.hookParallel({ hookName: "buildEnd" });
1956
- if (!fileManager.isExecuting && logger.spinner) {
2667
+ if (logger.logLevel === chunkGBX7KRCX_cjs.LogLevel.info && logger.spinner) {
1957
2668
  logger.spinner.suffixText = "";
1958
2669
  logger.spinner.succeed(`\u{1F4BE} Writing completed`);
1959
2670
  }
@@ -1964,95 +2675,95 @@ async function safeBuild(options) {
1964
2675
  }
1965
2676
 
1966
2677
  // src/Generator.ts
1967
- chunkI7UUR5MZ_cjs.init_cjs_shims();
2678
+ chunkMM42A6GN_cjs.init_cjs_shims();
1968
2679
  var _options3, _context;
1969
2680
  var Generator = class {
1970
2681
  constructor(options, context) {
1971
- chunkI7UUR5MZ_cjs.__privateAdd(this, _options3, {});
1972
- chunkI7UUR5MZ_cjs.__privateAdd(this, _context, {});
2682
+ chunkMM42A6GN_cjs.__privateAdd(this, _options3, {});
2683
+ chunkMM42A6GN_cjs.__privateAdd(this, _context, {});
1973
2684
  if (context) {
1974
- chunkI7UUR5MZ_cjs.__privateSet(this, _context, context);
2685
+ chunkMM42A6GN_cjs.__privateSet(this, _context, context);
1975
2686
  }
1976
2687
  if (options) {
1977
- chunkI7UUR5MZ_cjs.__privateSet(this, _options3, options);
2688
+ chunkMM42A6GN_cjs.__privateSet(this, _options3, options);
1978
2689
  }
1979
2690
  return this;
1980
2691
  }
1981
2692
  get options() {
1982
- return chunkI7UUR5MZ_cjs.__privateGet(this, _options3);
2693
+ return chunkMM42A6GN_cjs.__privateGet(this, _options3);
1983
2694
  }
1984
2695
  get context() {
1985
- return chunkI7UUR5MZ_cjs.__privateGet(this, _context);
2696
+ return chunkMM42A6GN_cjs.__privateGet(this, _context);
1986
2697
  }
1987
2698
  set options(options) {
1988
- chunkI7UUR5MZ_cjs.__privateSet(this, _options3, { ...chunkI7UUR5MZ_cjs.__privateGet(this, _options3), ...options });
2699
+ chunkMM42A6GN_cjs.__privateSet(this, _options3, { ...chunkMM42A6GN_cjs.__privateGet(this, _options3), ...options });
1989
2700
  }
1990
2701
  };
1991
2702
  _options3 = new WeakMap();
1992
2703
  _context = new WeakMap();
1993
2704
 
1994
2705
  // src/PackageManager.ts
1995
- chunkI7UUR5MZ_cjs.init_cjs_shims();
2706
+ chunkMM42A6GN_cjs.init_cjs_shims();
1996
2707
 
1997
2708
  // ../../node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js
1998
- chunkI7UUR5MZ_cjs.init_cjs_shims();
2709
+ chunkMM42A6GN_cjs.init_cjs_shims();
1999
2710
 
2000
2711
  // ../../node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js
2001
- chunkI7UUR5MZ_cjs.init_cjs_shims();
2712
+ chunkMM42A6GN_cjs.init_cjs_shims();
2002
2713
 
2003
2714
  // ../../node_modules/.pnpm/p-locate@6.0.0/node_modules/p-locate/index.js
2004
- chunkI7UUR5MZ_cjs.init_cjs_shims();
2715
+ chunkMM42A6GN_cjs.init_cjs_shims();
2005
2716
 
2006
2717
  // ../../node_modules/.pnpm/p-limit@4.0.0/node_modules/p-limit/index.js
2007
- chunkI7UUR5MZ_cjs.init_cjs_shims();
2718
+ chunkMM42A6GN_cjs.init_cjs_shims();
2008
2719
 
2009
2720
  // ../../node_modules/.pnpm/yocto-queue@1.0.0/node_modules/yocto-queue/index.js
2010
- chunkI7UUR5MZ_cjs.init_cjs_shims();
2721
+ chunkMM42A6GN_cjs.init_cjs_shims();
2011
2722
  var Node = class {
2012
2723
  constructor(value) {
2013
- chunkI7UUR5MZ_cjs.__publicField(this, "value");
2014
- chunkI7UUR5MZ_cjs.__publicField(this, "next");
2724
+ chunkMM42A6GN_cjs.__publicField(this, "value");
2725
+ chunkMM42A6GN_cjs.__publicField(this, "next");
2015
2726
  this.value = value;
2016
2727
  }
2017
2728
  };
2018
2729
  var _head, _tail, _size;
2019
- var Queue2 = class {
2730
+ var Queue = class {
2020
2731
  constructor() {
2021
- chunkI7UUR5MZ_cjs.__privateAdd(this, _head, void 0);
2022
- chunkI7UUR5MZ_cjs.__privateAdd(this, _tail, void 0);
2023
- chunkI7UUR5MZ_cjs.__privateAdd(this, _size, void 0);
2732
+ chunkMM42A6GN_cjs.__privateAdd(this, _head, void 0);
2733
+ chunkMM42A6GN_cjs.__privateAdd(this, _tail, void 0);
2734
+ chunkMM42A6GN_cjs.__privateAdd(this, _size, void 0);
2024
2735
  this.clear();
2025
2736
  }
2026
2737
  enqueue(value) {
2027
2738
  const node = new Node(value);
2028
- if (chunkI7UUR5MZ_cjs.__privateGet(this, _head)) {
2029
- chunkI7UUR5MZ_cjs.__privateGet(this, _tail).next = node;
2030
- chunkI7UUR5MZ_cjs.__privateSet(this, _tail, node);
2739
+ if (chunkMM42A6GN_cjs.__privateGet(this, _head)) {
2740
+ chunkMM42A6GN_cjs.__privateGet(this, _tail).next = node;
2741
+ chunkMM42A6GN_cjs.__privateSet(this, _tail, node);
2031
2742
  } else {
2032
- chunkI7UUR5MZ_cjs.__privateSet(this, _head, node);
2033
- chunkI7UUR5MZ_cjs.__privateSet(this, _tail, node);
2743
+ chunkMM42A6GN_cjs.__privateSet(this, _head, node);
2744
+ chunkMM42A6GN_cjs.__privateSet(this, _tail, node);
2034
2745
  }
2035
- chunkI7UUR5MZ_cjs.__privateWrapper(this, _size)._++;
2746
+ chunkMM42A6GN_cjs.__privateWrapper(this, _size)._++;
2036
2747
  }
2037
2748
  dequeue() {
2038
- const current = chunkI7UUR5MZ_cjs.__privateGet(this, _head);
2749
+ const current = chunkMM42A6GN_cjs.__privateGet(this, _head);
2039
2750
  if (!current) {
2040
2751
  return;
2041
2752
  }
2042
- chunkI7UUR5MZ_cjs.__privateSet(this, _head, chunkI7UUR5MZ_cjs.__privateGet(this, _head).next);
2043
- chunkI7UUR5MZ_cjs.__privateWrapper(this, _size)._--;
2753
+ chunkMM42A6GN_cjs.__privateSet(this, _head, chunkMM42A6GN_cjs.__privateGet(this, _head).next);
2754
+ chunkMM42A6GN_cjs.__privateWrapper(this, _size)._--;
2044
2755
  return current.value;
2045
2756
  }
2046
2757
  clear() {
2047
- chunkI7UUR5MZ_cjs.__privateSet(this, _head, void 0);
2048
- chunkI7UUR5MZ_cjs.__privateSet(this, _tail, void 0);
2049
- chunkI7UUR5MZ_cjs.__privateSet(this, _size, 0);
2758
+ chunkMM42A6GN_cjs.__privateSet(this, _head, void 0);
2759
+ chunkMM42A6GN_cjs.__privateSet(this, _tail, void 0);
2760
+ chunkMM42A6GN_cjs.__privateSet(this, _size, 0);
2050
2761
  }
2051
2762
  get size() {
2052
- return chunkI7UUR5MZ_cjs.__privateGet(this, _size);
2763
+ return chunkMM42A6GN_cjs.__privateGet(this, _size);
2053
2764
  }
2054
2765
  *[Symbol.iterator]() {
2055
- let current = chunkI7UUR5MZ_cjs.__privateGet(this, _head);
2766
+ let current = chunkMM42A6GN_cjs.__privateGet(this, _head);
2056
2767
  while (current) {
2057
2768
  yield current.value;
2058
2769
  current = current.next;
@@ -2068,7 +2779,7 @@ function pLimit(concurrency) {
2068
2779
  if (!((Number.isInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency > 0)) {
2069
2780
  throw new TypeError("Expected `concurrency` to be a number from 1 and up");
2070
2781
  }
2071
- const queue = new Queue2();
2782
+ const queue = new Queue();
2072
2783
  let activeCount = 0;
2073
2784
  const next = () => {
2074
2785
  activeCount--;
@@ -2203,13 +2914,13 @@ function locatePathSync(paths, {
2203
2914
  }
2204
2915
 
2205
2916
  // ../../node_modules/.pnpm/unicorn-magic@0.1.0/node_modules/unicorn-magic/node.js
2206
- chunkI7UUR5MZ_cjs.init_cjs_shims();
2917
+ chunkMM42A6GN_cjs.init_cjs_shims();
2207
2918
  function toPath2(urlOrPath) {
2208
2919
  return urlOrPath instanceof URL ? url.fileURLToPath(urlOrPath) : urlOrPath;
2209
2920
  }
2210
2921
 
2211
2922
  // ../../node_modules/.pnpm/path-exists@5.0.0/node_modules/path-exists/index.js
2212
- chunkI7UUR5MZ_cjs.init_cjs_shims();
2923
+ chunkMM42A6GN_cjs.init_cjs_shims();
2213
2924
 
2214
2925
  // ../../node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js
2215
2926
  var findUpStop = Symbol("findUpStop");
@@ -2288,30 +2999,30 @@ function findUpSync(name, options = {}) {
2288
2999
  var _cache2, _cwd, _SLASHES, _match, match_fn;
2289
3000
  var _PackageManager = class _PackageManager {
2290
3001
  constructor(workspace) {
2291
- chunkI7UUR5MZ_cjs.__privateAdd(this, _match);
2292
- chunkI7UUR5MZ_cjs.__privateAdd(this, _cwd, void 0);
2293
- chunkI7UUR5MZ_cjs.__privateAdd(this, _SLASHES, /* @__PURE__ */ new Set(["/", "\\"]));
3002
+ chunkMM42A6GN_cjs.__privateAdd(this, _match);
3003
+ chunkMM42A6GN_cjs.__privateAdd(this, _cwd, void 0);
3004
+ chunkMM42A6GN_cjs.__privateAdd(this, _SLASHES, /* @__PURE__ */ new Set(["/", "\\"]));
2294
3005
  if (workspace) {
2295
- chunkI7UUR5MZ_cjs.__privateSet(this, _cwd, workspace);
3006
+ chunkMM42A6GN_cjs.__privateSet(this, _cwd, workspace);
2296
3007
  }
2297
3008
  return this;
2298
3009
  }
2299
3010
  set workspace(workspace) {
2300
- chunkI7UUR5MZ_cjs.__privateSet(this, _cwd, workspace);
3011
+ chunkMM42A6GN_cjs.__privateSet(this, _cwd, workspace);
2301
3012
  }
2302
3013
  get workspace() {
2303
- return chunkI7UUR5MZ_cjs.__privateGet(this, _cwd);
3014
+ return chunkMM42A6GN_cjs.__privateGet(this, _cwd);
2304
3015
  }
2305
3016
  normalizeDirectory(directory) {
2306
- if (!chunkI7UUR5MZ_cjs.__privateGet(this, _SLASHES).has(directory[directory.length - 1])) {
3017
+ if (!chunkMM42A6GN_cjs.__privateGet(this, _SLASHES).has(directory[directory.length - 1])) {
2307
3018
  return `${directory}/`;
2308
3019
  }
2309
3020
  return directory;
2310
3021
  }
2311
3022
  getLocation(path5) {
2312
3023
  let location = path5;
2313
- if (chunkI7UUR5MZ_cjs.__privateGet(this, _cwd)) {
2314
- const require2 = mod__default.default.createRequire(this.normalizeDirectory(chunkI7UUR5MZ_cjs.__privateGet(this, _cwd)));
3024
+ if (chunkMM42A6GN_cjs.__privateGet(this, _cwd)) {
3025
+ const require2 = mod__default.default.createRequire(this.normalizeDirectory(chunkMM42A6GN_cjs.__privateGet(this, _cwd)));
2315
3026
  location = require2.resolve(path5);
2316
3027
  }
2317
3028
  return location;
@@ -2331,44 +3042,44 @@ var _PackageManager = class _PackageManager {
2331
3042
  }
2332
3043
  async getPackageJSON() {
2333
3044
  const pkgPath = await findUp(["package.json"], {
2334
- cwd: chunkI7UUR5MZ_cjs.__privateGet(this, _cwd)
3045
+ cwd: chunkMM42A6GN_cjs.__privateGet(this, _cwd)
2335
3046
  });
2336
3047
  if (!pkgPath) {
2337
3048
  return void 0;
2338
3049
  }
2339
- return chunkI7UUR5MZ_cjs.__require(pkgPath);
3050
+ return chunkMM42A6GN_cjs.__require(pkgPath);
2340
3051
  }
2341
3052
  getPackageJSONSync() {
2342
3053
  const pkgPath = findUpSync(["package.json"], {
2343
- cwd: chunkI7UUR5MZ_cjs.__privateGet(this, _cwd)
3054
+ cwd: chunkMM42A6GN_cjs.__privateGet(this, _cwd)
2344
3055
  });
2345
3056
  if (!pkgPath) {
2346
3057
  return void 0;
2347
3058
  }
2348
- return chunkI7UUR5MZ_cjs.__require(pkgPath);
3059
+ return chunkMM42A6GN_cjs.__require(pkgPath);
2349
3060
  }
2350
3061
  static setVersion(dependency, version) {
2351
- chunkI7UUR5MZ_cjs.__privateGet(_PackageManager, _cache2)[dependency] = version;
3062
+ chunkMM42A6GN_cjs.__privateGet(_PackageManager, _cache2)[dependency] = version;
2352
3063
  }
2353
3064
  async getVersion(dependency) {
2354
- if (typeof dependency === "string" && chunkI7UUR5MZ_cjs.__privateGet(_PackageManager, _cache2)[dependency]) {
2355
- return chunkI7UUR5MZ_cjs.__privateGet(_PackageManager, _cache2)[dependency];
3065
+ if (typeof dependency === "string" && chunkMM42A6GN_cjs.__privateGet(_PackageManager, _cache2)[dependency]) {
3066
+ return chunkMM42A6GN_cjs.__privateGet(_PackageManager, _cache2)[dependency];
2356
3067
  }
2357
3068
  const packageJSON = await this.getPackageJSON();
2358
3069
  if (!packageJSON) {
2359
3070
  return void 0;
2360
3071
  }
2361
- return chunkI7UUR5MZ_cjs.__privateMethod(this, _match, match_fn).call(this, packageJSON, dependency);
3072
+ return chunkMM42A6GN_cjs.__privateMethod(this, _match, match_fn).call(this, packageJSON, dependency);
2362
3073
  }
2363
3074
  getVersionSync(dependency) {
2364
- if (typeof dependency === "string" && chunkI7UUR5MZ_cjs.__privateGet(_PackageManager, _cache2)[dependency]) {
2365
- return chunkI7UUR5MZ_cjs.__privateGet(_PackageManager, _cache2)[dependency];
3075
+ if (typeof dependency === "string" && chunkMM42A6GN_cjs.__privateGet(_PackageManager, _cache2)[dependency]) {
3076
+ return chunkMM42A6GN_cjs.__privateGet(_PackageManager, _cache2)[dependency];
2366
3077
  }
2367
3078
  const packageJSON = this.getPackageJSONSync();
2368
3079
  if (!packageJSON) {
2369
3080
  return void 0;
2370
3081
  }
2371
- return chunkI7UUR5MZ_cjs.__privateMethod(this, _match, match_fn).call(this, packageJSON, dependency);
3082
+ return chunkMM42A6GN_cjs.__privateMethod(this, _match, match_fn).call(this, packageJSON, dependency);
2372
3083
  }
2373
3084
  async isValid(dependency, version) {
2374
3085
  const packageVersion = await this.getVersion(dependency);
@@ -2411,7 +3122,7 @@ match_fn = function(packageJSON, dependency) {
2411
3122
  const matchedDependency = Object.keys(dependencies).find((dep) => dep.match(dependency));
2412
3123
  return matchedDependency ? dependencies[matchedDependency] : void 0;
2413
3124
  };
2414
- chunkI7UUR5MZ_cjs.__privateAdd(_PackageManager, _cache2, {});
3125
+ chunkMM42A6GN_cjs.__privateAdd(_PackageManager, _cache2, {});
2415
3126
  var PackageManager = _PackageManager;
2416
3127
 
2417
3128
  // src/index.ts