@kubb/core 2.19.5 → 2.19.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-FRT5NM5I.js → chunk-5JZNFPUP.js} +13 -15
- package/dist/{chunk-FRT5NM5I.js.map → chunk-5JZNFPUP.js.map} +1 -1
- package/dist/{chunk-7UMWFPXG.js → chunk-6D7EFD2R.js} +2 -2
- package/dist/{chunk-4QO27EB2.cjs → chunk-ESX7D52D.cjs} +174 -216
- package/dist/chunk-ESX7D52D.cjs.map +1 -0
- package/dist/{chunk-PNAWM6V2.cjs → chunk-FVW4VDVD.cjs} +5 -5
- package/dist/chunk-HMLY7DHA.js +16 -0
- package/dist/{chunk-JA6UN4AZ.cjs → chunk-OCFABH5L.cjs} +30 -32
- package/dist/chunk-OCFABH5L.cjs.map +1 -0
- package/dist/{chunk-WQ7GB7MO.cjs → chunk-Q7VRQ7E7.cjs} +12 -12
- package/dist/{chunk-EPAC7V2R.js → chunk-SV4UDYSR.js} +16 -18
- package/dist/{chunk-EPAC7V2R.js.map → chunk-SV4UDYSR.js.map} +1 -1
- package/dist/{chunk-CCA5OKGM.cjs → chunk-WSIG7TWQ.cjs} +19 -19
- package/dist/chunk-WSIG7TWQ.cjs.map +1 -0
- package/dist/{chunk-UCKFXEKM.js → chunk-XC6QIAQL.js} +2 -2
- package/dist/{chunk-UCKFXEKM.js.map → chunk-XC6QIAQL.js.map} +1 -1
- package/dist/{chunk-4DTSZ2MS.cjs → chunk-ZG4WVJOZ.cjs} +13 -30
- package/dist/chunk-ZG4WVJOZ.cjs.map +1 -0
- package/dist/index.cjs +150 -160
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +51 -61
- package/dist/index.js.map +1 -1
- package/dist/logger.cjs +3 -3
- package/dist/logger.js +2 -2
- package/dist/mocks.cjs +8 -8
- package/dist/mocks.js +4 -4
- package/dist/transformers.cjs +4 -4
- package/dist/transformers.js +2 -2
- package/dist/utils.cjs +4 -4
- package/dist/utils.js +2 -2
- package/package.json +10 -10
- package/src/transformers/stringify.ts +1 -1
- package/dist/chunk-4DTSZ2MS.cjs.map +0 -1
- package/dist/chunk-4QO27EB2.cjs.map +0 -1
- package/dist/chunk-CCA5OKGM.cjs.map +0 -1
- package/dist/chunk-JA6UN4AZ.cjs.map +0 -1
- package/dist/chunk-Z4BLTVTB.js +0 -30
- /package/dist/{chunk-7UMWFPXG.js.map → chunk-6D7EFD2R.js.map} +0 -0
- /package/dist/{chunk-PNAWM6V2.cjs.map → chunk-FVW4VDVD.cjs.map} +0 -0
- /package/dist/{chunk-Z4BLTVTB.js.map → chunk-HMLY7DHA.js.map} +0 -0
- /package/dist/{chunk-WQ7GB7MO.cjs.map → chunk-Q7VRQ7E7.cjs.map} +0 -0
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkWSIG7TWQcjs = require('./chunk-WSIG7TWQ.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkOCFABH5Lcjs = require('./chunk-OCFABH5L.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkFVW4VDVDcjs = require('./chunk-FVW4VDVD.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
@@ -19,21 +19,20 @@ var _chunkPNAWM6V2cjs = require('./chunk-PNAWM6V2.cjs');
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
var
|
|
22
|
+
var _chunkZG4WVJOZcjs = require('./chunk-ZG4WVJOZ.cjs');
|
|
23
23
|
|
|
24
24
|
// ../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.js
|
|
25
|
-
var require_eventemitter3 =
|
|
25
|
+
var require_eventemitter3 = _chunkZG4WVJOZcjs.__commonJS.call(void 0, {
|
|
26
26
|
"../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.js"(exports, module) {
|
|
27
27
|
"use strict";
|
|
28
|
-
|
|
28
|
+
_chunkZG4WVJOZcjs.init_cjs_shims.call(void 0, );
|
|
29
29
|
var has = Object.prototype.hasOwnProperty;
|
|
30
30
|
var prefix = "~";
|
|
31
31
|
function Events() {
|
|
32
32
|
}
|
|
33
33
|
if (Object.create) {
|
|
34
34
|
Events.prototype = /* @__PURE__ */ Object.create(null);
|
|
35
|
-
if (!new Events().__proto__)
|
|
36
|
-
prefix = false;
|
|
35
|
+
if (!new Events().__proto__) prefix = false;
|
|
37
36
|
}
|
|
38
37
|
function EE(fn, context, once) {
|
|
39
38
|
this.fn = fn;
|
|
@@ -45,19 +44,14 @@ var require_eventemitter3 = _chunk4DTSZ2MScjs.__commonJS.call(void 0, {
|
|
|
45
44
|
throw new TypeError("The listener must be a function");
|
|
46
45
|
}
|
|
47
46
|
var listener = new EE(fn, context || emitter, once), evt = prefix ? prefix + event : event;
|
|
48
|
-
if (!emitter._events[evt])
|
|
49
|
-
|
|
50
|
-
else
|
|
51
|
-
emitter._events[evt].push(listener);
|
|
52
|
-
else
|
|
53
|
-
emitter._events[evt] = [emitter._events[evt], listener];
|
|
47
|
+
if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;
|
|
48
|
+
else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);
|
|
49
|
+
else emitter._events[evt] = [emitter._events[evt], listener];
|
|
54
50
|
return emitter;
|
|
55
51
|
}
|
|
56
52
|
function clearEvent(emitter, evt) {
|
|
57
|
-
if (--emitter._eventsCount === 0)
|
|
58
|
-
|
|
59
|
-
else
|
|
60
|
-
delete emitter._events[evt];
|
|
53
|
+
if (--emitter._eventsCount === 0) emitter._events = new Events();
|
|
54
|
+
else delete emitter._events[evt];
|
|
61
55
|
}
|
|
62
56
|
function EventEmitter2() {
|
|
63
57
|
this._events = new Events();
|
|
@@ -65,11 +59,9 @@ var require_eventemitter3 = _chunk4DTSZ2MScjs.__commonJS.call(void 0, {
|
|
|
65
59
|
}
|
|
66
60
|
EventEmitter2.prototype.eventNames = function eventNames() {
|
|
67
61
|
var names = [], events, name;
|
|
68
|
-
if (this._eventsCount === 0)
|
|
69
|
-
return names;
|
|
62
|
+
if (this._eventsCount === 0) return names;
|
|
70
63
|
for (name in events = this._events) {
|
|
71
|
-
if (has.call(events, name))
|
|
72
|
-
names.push(prefix ? name.slice(1) : name);
|
|
64
|
+
if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);
|
|
73
65
|
}
|
|
74
66
|
if (Object.getOwnPropertySymbols) {
|
|
75
67
|
return names.concat(Object.getOwnPropertySymbols(events));
|
|
@@ -78,10 +70,8 @@ var require_eventemitter3 = _chunk4DTSZ2MScjs.__commonJS.call(void 0, {
|
|
|
78
70
|
};
|
|
79
71
|
EventEmitter2.prototype.listeners = function listeners(event) {
|
|
80
72
|
var evt = prefix ? prefix + event : event, handlers = this._events[evt];
|
|
81
|
-
if (!handlers)
|
|
82
|
-
|
|
83
|
-
if (handlers.fn)
|
|
84
|
-
return [handlers.fn];
|
|
73
|
+
if (!handlers) return [];
|
|
74
|
+
if (handlers.fn) return [handlers.fn];
|
|
85
75
|
for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {
|
|
86
76
|
ee[i] = handlers[i].fn;
|
|
87
77
|
}
|
|
@@ -89,20 +79,16 @@ var require_eventemitter3 = _chunk4DTSZ2MScjs.__commonJS.call(void 0, {
|
|
|
89
79
|
};
|
|
90
80
|
EventEmitter2.prototype.listenerCount = function listenerCount(event) {
|
|
91
81
|
var evt = prefix ? prefix + event : event, listeners = this._events[evt];
|
|
92
|
-
if (!listeners)
|
|
93
|
-
|
|
94
|
-
if (listeners.fn)
|
|
95
|
-
return 1;
|
|
82
|
+
if (!listeners) return 0;
|
|
83
|
+
if (listeners.fn) return 1;
|
|
96
84
|
return listeners.length;
|
|
97
85
|
};
|
|
98
86
|
EventEmitter2.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
|
|
99
87
|
var evt = prefix ? prefix + event : event;
|
|
100
|
-
if (!this._events[evt])
|
|
101
|
-
return false;
|
|
88
|
+
if (!this._events[evt]) return false;
|
|
102
89
|
var listeners = this._events[evt], len = arguments.length, args, i;
|
|
103
90
|
if (listeners.fn) {
|
|
104
|
-
if (listeners.once)
|
|
105
|
-
this.removeListener(event, listeners.fn, void 0, true);
|
|
91
|
+
if (listeners.once) this.removeListener(event, listeners.fn, void 0, true);
|
|
106
92
|
switch (len) {
|
|
107
93
|
case 1:
|
|
108
94
|
return listeners.fn.call(listeners.context), true;
|
|
@@ -124,8 +110,7 @@ var require_eventemitter3 = _chunk4DTSZ2MScjs.__commonJS.call(void 0, {
|
|
|
124
110
|
} else {
|
|
125
111
|
var length = listeners.length, j;
|
|
126
112
|
for (i = 0; i < length; i++) {
|
|
127
|
-
if (listeners[i].once)
|
|
128
|
-
this.removeListener(event, listeners[i].fn, void 0, true);
|
|
113
|
+
if (listeners[i].once) this.removeListener(event, listeners[i].fn, void 0, true);
|
|
129
114
|
switch (len) {
|
|
130
115
|
case 1:
|
|
131
116
|
listeners[i].fn.call(listeners[i].context);
|
|
@@ -140,10 +125,9 @@ var require_eventemitter3 = _chunk4DTSZ2MScjs.__commonJS.call(void 0, {
|
|
|
140
125
|
listeners[i].fn.call(listeners[i].context, a1, a2, a3);
|
|
141
126
|
break;
|
|
142
127
|
default:
|
|
143
|
-
if (!args)
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
}
|
|
128
|
+
if (!args) for (j = 1, args = new Array(len - 1); j < len; j++) {
|
|
129
|
+
args[j - 1] = arguments[j];
|
|
130
|
+
}
|
|
147
131
|
listeners[i].fn.apply(listeners[i].context, args);
|
|
148
132
|
}
|
|
149
133
|
}
|
|
@@ -158,8 +142,7 @@ var require_eventemitter3 = _chunk4DTSZ2MScjs.__commonJS.call(void 0, {
|
|
|
158
142
|
};
|
|
159
143
|
EventEmitter2.prototype.removeListener = function removeListener(event, fn, context, once) {
|
|
160
144
|
var evt = prefix ? prefix + event : event;
|
|
161
|
-
if (!this._events[evt])
|
|
162
|
-
return this;
|
|
145
|
+
if (!this._events[evt]) return this;
|
|
163
146
|
if (!fn) {
|
|
164
147
|
clearEvent(this, evt);
|
|
165
148
|
return this;
|
|
@@ -175,10 +158,8 @@ var require_eventemitter3 = _chunk4DTSZ2MScjs.__commonJS.call(void 0, {
|
|
|
175
158
|
events.push(listeners[i]);
|
|
176
159
|
}
|
|
177
160
|
}
|
|
178
|
-
if (events.length)
|
|
179
|
-
|
|
180
|
-
else
|
|
181
|
-
clearEvent(this, evt);
|
|
161
|
+
if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;
|
|
162
|
+
else clearEvent(this, evt);
|
|
182
163
|
}
|
|
183
164
|
return this;
|
|
184
165
|
};
|
|
@@ -186,8 +167,7 @@ var require_eventemitter3 = _chunk4DTSZ2MScjs.__commonJS.call(void 0, {
|
|
|
186
167
|
var evt;
|
|
187
168
|
if (event) {
|
|
188
169
|
evt = prefix ? prefix + event : event;
|
|
189
|
-
if (this._events[evt])
|
|
190
|
-
clearEvent(this, evt);
|
|
170
|
+
if (this._events[evt]) clearEvent(this, evt);
|
|
191
171
|
} else {
|
|
192
172
|
this._events = new Events();
|
|
193
173
|
this._eventsCount = 0;
|
|
@@ -205,19 +185,19 @@ var require_eventemitter3 = _chunk4DTSZ2MScjs.__commonJS.call(void 0, {
|
|
|
205
185
|
});
|
|
206
186
|
|
|
207
187
|
// src/FileManager.ts
|
|
208
|
-
|
|
188
|
+
_chunkZG4WVJOZcjs.init_cjs_shims.call(void 0, );
|
|
209
189
|
var _crypto = require('crypto'); var _crypto2 = _interopRequireDefault(_crypto);
|
|
210
190
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
211
191
|
|
|
212
192
|
// ../../node_modules/.pnpm/p-queue@8.0.1/node_modules/p-queue/dist/index.js
|
|
213
|
-
|
|
193
|
+
_chunkZG4WVJOZcjs.init_cjs_shims.call(void 0, );
|
|
214
194
|
|
|
215
195
|
// ../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.mjs
|
|
216
|
-
|
|
217
|
-
var import_index =
|
|
196
|
+
_chunkZG4WVJOZcjs.init_cjs_shims.call(void 0, );
|
|
197
|
+
var import_index = _chunkZG4WVJOZcjs.__toESM.call(void 0, require_eventemitter3(), 1);
|
|
218
198
|
|
|
219
199
|
// ../../node_modules/.pnpm/p-timeout@6.1.2/node_modules/p-timeout/index.js
|
|
220
|
-
|
|
200
|
+
_chunkZG4WVJOZcjs.init_cjs_shims.call(void 0, );
|
|
221
201
|
var TimeoutError = class extends Error {
|
|
222
202
|
constructor(message) {
|
|
223
203
|
super(message);
|
|
@@ -302,10 +282,10 @@ function pTimeout(promise, options) {
|
|
|
302
282
|
}
|
|
303
283
|
|
|
304
284
|
// ../../node_modules/.pnpm/p-queue@8.0.1/node_modules/p-queue/dist/priority-queue.js
|
|
305
|
-
|
|
285
|
+
_chunkZG4WVJOZcjs.init_cjs_shims.call(void 0, );
|
|
306
286
|
|
|
307
287
|
// ../../node_modules/.pnpm/p-queue@8.0.1/node_modules/p-queue/dist/lower-bound.js
|
|
308
|
-
|
|
288
|
+
_chunkZG4WVJOZcjs.init_cjs_shims.call(void 0, );
|
|
309
289
|
function lowerBound(array, value, comparator) {
|
|
310
290
|
let first = 0;
|
|
311
291
|
let count = array.length;
|
|
@@ -326,7 +306,7 @@ function lowerBound(array, value, comparator) {
|
|
|
326
306
|
var _queue;
|
|
327
307
|
var PriorityQueue = class {
|
|
328
308
|
constructor() {
|
|
329
|
-
|
|
309
|
+
_chunkZG4WVJOZcjs.__privateAdd.call(void 0, this, _queue, []);
|
|
330
310
|
}
|
|
331
311
|
enqueue(run, options) {
|
|
332
312
|
options = {
|
|
@@ -337,67 +317,54 @@ var PriorityQueue = class {
|
|
|
337
317
|
priority: options.priority,
|
|
338
318
|
run
|
|
339
319
|
};
|
|
340
|
-
if (this.size &&
|
|
341
|
-
|
|
320
|
+
if (this.size && _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _queue)[this.size - 1].priority >= options.priority) {
|
|
321
|
+
_chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _queue).push(element);
|
|
342
322
|
return;
|
|
343
323
|
}
|
|
344
|
-
const index = lowerBound(
|
|
345
|
-
|
|
324
|
+
const index = lowerBound(_chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _queue), element, (a, b) => b.priority - a.priority);
|
|
325
|
+
_chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _queue).splice(index, 0, element);
|
|
346
326
|
}
|
|
347
327
|
dequeue() {
|
|
348
|
-
const item =
|
|
328
|
+
const item = _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _queue).shift();
|
|
349
329
|
return _optionalChain([item, 'optionalAccess', _2 => _2.run]);
|
|
350
330
|
}
|
|
351
331
|
filter(options) {
|
|
352
|
-
return
|
|
332
|
+
return _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _queue).filter((element) => element.priority === options.priority).map((element) => element.run);
|
|
353
333
|
}
|
|
354
334
|
get size() {
|
|
355
|
-
return
|
|
335
|
+
return _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _queue).length;
|
|
356
336
|
}
|
|
357
337
|
};
|
|
358
338
|
_queue = new WeakMap();
|
|
359
339
|
|
|
360
340
|
// ../../node_modules/.pnpm/p-queue@8.0.1/node_modules/p-queue/dist/index.js
|
|
361
|
-
var _carryoverConcurrencyCount, _isIntervalIgnored, _intervalCount, _intervalCap, _interval, _intervalEnd, _intervalId, _timeoutId, _queue2, _queueClass, _pending, _concurrency, _isPaused, _throwOnTimeout,
|
|
341
|
+
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;
|
|
362
342
|
var PQueue = class extends import_index.default {
|
|
363
343
|
// TODO: The `throwOnTimeout` option should affect the return types of `add()` and `addAll()`
|
|
364
344
|
constructor(options) {
|
|
365
345
|
super();
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
_chunk4DTSZ2MScjs.__privateAdd.call(void 0, this, _throwOnAbort);
|
|
379
|
-
_chunk4DTSZ2MScjs.__privateAdd.call(void 0, this, _onEvent);
|
|
380
|
-
_chunk4DTSZ2MScjs.__privateAdd.call(void 0, this, _carryoverConcurrencyCount, void 0);
|
|
381
|
-
_chunk4DTSZ2MScjs.__privateAdd.call(void 0, this, _isIntervalIgnored, void 0);
|
|
382
|
-
_chunk4DTSZ2MScjs.__privateAdd.call(void 0, this, _intervalCount, 0);
|
|
383
|
-
_chunk4DTSZ2MScjs.__privateAdd.call(void 0, this, _intervalCap, void 0);
|
|
384
|
-
_chunk4DTSZ2MScjs.__privateAdd.call(void 0, this, _interval, void 0);
|
|
385
|
-
_chunk4DTSZ2MScjs.__privateAdd.call(void 0, this, _intervalEnd, 0);
|
|
386
|
-
_chunk4DTSZ2MScjs.__privateAdd.call(void 0, this, _intervalId, void 0);
|
|
387
|
-
_chunk4DTSZ2MScjs.__privateAdd.call(void 0, this, _timeoutId, void 0);
|
|
388
|
-
_chunk4DTSZ2MScjs.__privateAdd.call(void 0, this, _queue2, void 0);
|
|
389
|
-
_chunk4DTSZ2MScjs.__privateAdd.call(void 0, this, _queueClass, void 0);
|
|
390
|
-
_chunk4DTSZ2MScjs.__privateAdd.call(void 0, this, _pending, 0);
|
|
346
|
+
_chunkZG4WVJOZcjs.__privateAdd.call(void 0, this, _PQueue_instances);
|
|
347
|
+
_chunkZG4WVJOZcjs.__privateAdd.call(void 0, this, _carryoverConcurrencyCount);
|
|
348
|
+
_chunkZG4WVJOZcjs.__privateAdd.call(void 0, this, _isIntervalIgnored);
|
|
349
|
+
_chunkZG4WVJOZcjs.__privateAdd.call(void 0, this, _intervalCount, 0);
|
|
350
|
+
_chunkZG4WVJOZcjs.__privateAdd.call(void 0, this, _intervalCap);
|
|
351
|
+
_chunkZG4WVJOZcjs.__privateAdd.call(void 0, this, _interval);
|
|
352
|
+
_chunkZG4WVJOZcjs.__privateAdd.call(void 0, this, _intervalEnd, 0);
|
|
353
|
+
_chunkZG4WVJOZcjs.__privateAdd.call(void 0, this, _intervalId);
|
|
354
|
+
_chunkZG4WVJOZcjs.__privateAdd.call(void 0, this, _timeoutId);
|
|
355
|
+
_chunkZG4WVJOZcjs.__privateAdd.call(void 0, this, _queue2);
|
|
356
|
+
_chunkZG4WVJOZcjs.__privateAdd.call(void 0, this, _queueClass);
|
|
357
|
+
_chunkZG4WVJOZcjs.__privateAdd.call(void 0, this, _pending, 0);
|
|
391
358
|
// The `!` is needed because of https://github.com/microsoft/TypeScript/issues/32194
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
359
|
+
_chunkZG4WVJOZcjs.__privateAdd.call(void 0, this, _concurrency);
|
|
360
|
+
_chunkZG4WVJOZcjs.__privateAdd.call(void 0, this, _isPaused);
|
|
361
|
+
_chunkZG4WVJOZcjs.__privateAdd.call(void 0, this, _throwOnTimeout);
|
|
395
362
|
/**
|
|
396
363
|
Per-operation timeout in milliseconds. Operations fulfill once `timeout` elapses if they haven't already.
|
|
397
364
|
|
|
398
365
|
Applies to each future operation.
|
|
399
366
|
*/
|
|
400
|
-
|
|
367
|
+
_chunkZG4WVJOZcjs.__publicField.call(void 0, this, "timeout");
|
|
401
368
|
options = {
|
|
402
369
|
carryoverConcurrencyCount: false,
|
|
403
370
|
intervalCap: Number.POSITIVE_INFINITY,
|
|
@@ -413,37 +380,37 @@ var PQueue = class extends import_index.default {
|
|
|
413
380
|
if (options.interval === void 0 || !(Number.isFinite(options.interval) && options.interval >= 0)) {
|
|
414
381
|
throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${_nullishCoalesce(_optionalChain([options, 'access', _6 => _6.interval, 'optionalAccess', _7 => _7.toString, 'call', _8 => _8()]), () => ( ""))}\` (${typeof options.interval})`);
|
|
415
382
|
}
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
383
|
+
_chunkZG4WVJOZcjs.__privateSet.call(void 0, this, _carryoverConcurrencyCount, options.carryoverConcurrencyCount);
|
|
384
|
+
_chunkZG4WVJOZcjs.__privateSet.call(void 0, this, _isIntervalIgnored, options.intervalCap === Number.POSITIVE_INFINITY || options.interval === 0);
|
|
385
|
+
_chunkZG4WVJOZcjs.__privateSet.call(void 0, this, _intervalCap, options.intervalCap);
|
|
386
|
+
_chunkZG4WVJOZcjs.__privateSet.call(void 0, this, _interval, options.interval);
|
|
387
|
+
_chunkZG4WVJOZcjs.__privateSet.call(void 0, this, _queue2, new options.queueClass());
|
|
388
|
+
_chunkZG4WVJOZcjs.__privateSet.call(void 0, this, _queueClass, options.queueClass);
|
|
422
389
|
this.concurrency = options.concurrency;
|
|
423
390
|
this.timeout = options.timeout;
|
|
424
|
-
|
|
425
|
-
|
|
391
|
+
_chunkZG4WVJOZcjs.__privateSet.call(void 0, this, _throwOnTimeout, options.throwOnTimeout === true);
|
|
392
|
+
_chunkZG4WVJOZcjs.__privateSet.call(void 0, this, _isPaused, options.autoStart === false);
|
|
426
393
|
}
|
|
427
394
|
get concurrency() {
|
|
428
|
-
return
|
|
395
|
+
return _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _concurrency);
|
|
429
396
|
}
|
|
430
397
|
set concurrency(newConcurrency) {
|
|
431
398
|
if (!(typeof newConcurrency === "number" && newConcurrency >= 1)) {
|
|
432
399
|
throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${newConcurrency}\` (${typeof newConcurrency})`);
|
|
433
400
|
}
|
|
434
|
-
|
|
435
|
-
|
|
401
|
+
_chunkZG4WVJOZcjs.__privateSet.call(void 0, this, _concurrency, newConcurrency);
|
|
402
|
+
_chunkZG4WVJOZcjs.__privateMethod.call(void 0, this, _PQueue_instances, processQueue_fn).call(this);
|
|
436
403
|
}
|
|
437
404
|
async add(function_, options = {}) {
|
|
438
405
|
options = {
|
|
439
406
|
timeout: this.timeout,
|
|
440
|
-
throwOnTimeout:
|
|
407
|
+
throwOnTimeout: _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _throwOnTimeout),
|
|
441
408
|
...options
|
|
442
409
|
};
|
|
443
410
|
return new Promise((resolve2, reject) => {
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
411
|
+
_chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _queue2).enqueue(async () => {
|
|
412
|
+
_chunkZG4WVJOZcjs.__privateWrapper.call(void 0, this, _pending)._++;
|
|
413
|
+
_chunkZG4WVJOZcjs.__privateWrapper.call(void 0, this, _intervalCount)._++;
|
|
447
414
|
try {
|
|
448
415
|
_optionalChain([options, 'access', _9 => _9.signal, 'optionalAccess', _10 => _10.throwIfAborted, 'call', _11 => _11()]);
|
|
449
416
|
let operation = function_({ signal: options.signal });
|
|
@@ -451,7 +418,7 @@ var PQueue = class extends import_index.default {
|
|
|
451
418
|
operation = pTimeout(Promise.resolve(operation), { milliseconds: options.timeout });
|
|
452
419
|
}
|
|
453
420
|
if (options.signal) {
|
|
454
|
-
operation = Promise.race([operation,
|
|
421
|
+
operation = Promise.race([operation, _chunkZG4WVJOZcjs.__privateMethod.call(void 0, this, _PQueue_instances, throwOnAbort_fn).call(this, options.signal)]);
|
|
455
422
|
}
|
|
456
423
|
const result = await operation;
|
|
457
424
|
resolve2(result);
|
|
@@ -464,11 +431,11 @@ var PQueue = class extends import_index.default {
|
|
|
464
431
|
reject(error);
|
|
465
432
|
this.emit("error", error);
|
|
466
433
|
} finally {
|
|
467
|
-
|
|
434
|
+
_chunkZG4WVJOZcjs.__privateMethod.call(void 0, this, _PQueue_instances, next_fn).call(this);
|
|
468
435
|
}
|
|
469
436
|
}, options);
|
|
470
437
|
this.emit("add");
|
|
471
|
-
|
|
438
|
+
_chunkZG4WVJOZcjs.__privateMethod.call(void 0, this, _PQueue_instances, tryToStartAnother_fn).call(this);
|
|
472
439
|
});
|
|
473
440
|
}
|
|
474
441
|
async addAll(functions, options) {
|
|
@@ -478,24 +445,24 @@ var PQueue = class extends import_index.default {
|
|
|
478
445
|
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.)
|
|
479
446
|
*/
|
|
480
447
|
start() {
|
|
481
|
-
if (!
|
|
448
|
+
if (!_chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _isPaused)) {
|
|
482
449
|
return this;
|
|
483
450
|
}
|
|
484
|
-
|
|
485
|
-
|
|
451
|
+
_chunkZG4WVJOZcjs.__privateSet.call(void 0, this, _isPaused, false);
|
|
452
|
+
_chunkZG4WVJOZcjs.__privateMethod.call(void 0, this, _PQueue_instances, processQueue_fn).call(this);
|
|
486
453
|
return this;
|
|
487
454
|
}
|
|
488
455
|
/**
|
|
489
456
|
Put queue execution on hold.
|
|
490
457
|
*/
|
|
491
458
|
pause() {
|
|
492
|
-
|
|
459
|
+
_chunkZG4WVJOZcjs.__privateSet.call(void 0, this, _isPaused, true);
|
|
493
460
|
}
|
|
494
461
|
/**
|
|
495
462
|
Clear the queue.
|
|
496
463
|
*/
|
|
497
464
|
clear() {
|
|
498
|
-
|
|
465
|
+
_chunkZG4WVJOZcjs.__privateSet.call(void 0, this, _queue2, new (_chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _queueClass))());
|
|
499
466
|
}
|
|
500
467
|
/**
|
|
501
468
|
Can be called multiple times. Useful if you for example add additional items at a later time.
|
|
@@ -503,10 +470,10 @@ var PQueue = class extends import_index.default {
|
|
|
503
470
|
@returns A promise that settles when the queue becomes empty.
|
|
504
471
|
*/
|
|
505
472
|
async onEmpty() {
|
|
506
|
-
if (
|
|
473
|
+
if (_chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _queue2).size === 0) {
|
|
507
474
|
return;
|
|
508
475
|
}
|
|
509
|
-
await
|
|
476
|
+
await _chunkZG4WVJOZcjs.__privateMethod.call(void 0, this, _PQueue_instances, onEvent_fn).call(this, "empty");
|
|
510
477
|
}
|
|
511
478
|
/**
|
|
512
479
|
@returns A promise that settles when the queue size is less than the given limit: `queue.size < limit`.
|
|
@@ -516,10 +483,10 @@ var PQueue = class extends import_index.default {
|
|
|
516
483
|
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.
|
|
517
484
|
*/
|
|
518
485
|
async onSizeLessThan(limit) {
|
|
519
|
-
if (
|
|
486
|
+
if (_chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _queue2).size < limit) {
|
|
520
487
|
return;
|
|
521
488
|
}
|
|
522
|
-
await
|
|
489
|
+
await _chunkZG4WVJOZcjs.__privateMethod.call(void 0, this, _PQueue_instances, onEvent_fn).call(this, "next", () => _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _queue2).size < limit);
|
|
523
490
|
}
|
|
524
491
|
/**
|
|
525
492
|
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.
|
|
@@ -527,16 +494,16 @@ var PQueue = class extends import_index.default {
|
|
|
527
494
|
@returns A promise that settles when the queue becomes empty, and all promises have completed; `queue.size === 0 && queue.pending === 0`.
|
|
528
495
|
*/
|
|
529
496
|
async onIdle() {
|
|
530
|
-
if (
|
|
497
|
+
if (_chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _pending) === 0 && _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _queue2).size === 0) {
|
|
531
498
|
return;
|
|
532
499
|
}
|
|
533
|
-
await
|
|
500
|
+
await _chunkZG4WVJOZcjs.__privateMethod.call(void 0, this, _PQueue_instances, onEvent_fn).call(this, "idle");
|
|
534
501
|
}
|
|
535
502
|
/**
|
|
536
503
|
Size of the queue, the number of queued items waiting to run.
|
|
537
504
|
*/
|
|
538
505
|
get size() {
|
|
539
|
-
return
|
|
506
|
+
return _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _queue2).size;
|
|
540
507
|
}
|
|
541
508
|
/**
|
|
542
509
|
Size of the queue, filtered by the given options.
|
|
@@ -544,19 +511,19 @@ var PQueue = class extends import_index.default {
|
|
|
544
511
|
For example, this can be used to find the number of items remaining in the queue with a specific priority level.
|
|
545
512
|
*/
|
|
546
513
|
sizeBy(options) {
|
|
547
|
-
return
|
|
514
|
+
return _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _queue2).filter(options).length;
|
|
548
515
|
}
|
|
549
516
|
/**
|
|
550
517
|
Number of running items (no longer in the queue).
|
|
551
518
|
*/
|
|
552
519
|
get pending() {
|
|
553
|
-
return
|
|
520
|
+
return _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _pending);
|
|
554
521
|
}
|
|
555
522
|
/**
|
|
556
523
|
Whether the queue is currently paused.
|
|
557
524
|
*/
|
|
558
525
|
get isPaused() {
|
|
559
|
-
return
|
|
526
|
+
return _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _isPaused);
|
|
560
527
|
}
|
|
561
528
|
};
|
|
562
529
|
_carryoverConcurrencyCount = new WeakMap();
|
|
@@ -573,37 +540,33 @@ _pending = new WeakMap();
|
|
|
573
540
|
_concurrency = new WeakMap();
|
|
574
541
|
_isPaused = new WeakMap();
|
|
575
542
|
_throwOnTimeout = new WeakMap();
|
|
576
|
-
|
|
543
|
+
_PQueue_instances = new WeakSet();
|
|
577
544
|
doesIntervalAllowAnother_get = function() {
|
|
578
|
-
return
|
|
545
|
+
return _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _isIntervalIgnored) || _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _intervalCount) < _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _intervalCap);
|
|
579
546
|
};
|
|
580
|
-
_doesConcurrentAllowAnother = new WeakSet();
|
|
581
547
|
doesConcurrentAllowAnother_get = function() {
|
|
582
|
-
return
|
|
548
|
+
return _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _pending) < _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _concurrency);
|
|
583
549
|
};
|
|
584
|
-
_next = new WeakSet();
|
|
585
550
|
next_fn = function() {
|
|
586
|
-
|
|
587
|
-
|
|
551
|
+
_chunkZG4WVJOZcjs.__privateWrapper.call(void 0, this, _pending)._--;
|
|
552
|
+
_chunkZG4WVJOZcjs.__privateMethod.call(void 0, this, _PQueue_instances, tryToStartAnother_fn).call(this);
|
|
588
553
|
this.emit("next");
|
|
589
554
|
};
|
|
590
|
-
_onResumeInterval = new WeakSet();
|
|
591
555
|
onResumeInterval_fn = function() {
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
556
|
+
_chunkZG4WVJOZcjs.__privateMethod.call(void 0, this, _PQueue_instances, onInterval_fn).call(this);
|
|
557
|
+
_chunkZG4WVJOZcjs.__privateMethod.call(void 0, this, _PQueue_instances, initializeIntervalIfNeeded_fn).call(this);
|
|
558
|
+
_chunkZG4WVJOZcjs.__privateSet.call(void 0, this, _timeoutId, void 0);
|
|
595
559
|
};
|
|
596
|
-
_isIntervalPaused = new WeakSet();
|
|
597
560
|
isIntervalPaused_get = function() {
|
|
598
561
|
const now = Date.now();
|
|
599
|
-
if (
|
|
600
|
-
const delay =
|
|
562
|
+
if (_chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _intervalId) === void 0) {
|
|
563
|
+
const delay = _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _intervalEnd) - now;
|
|
601
564
|
if (delay < 0) {
|
|
602
|
-
|
|
565
|
+
_chunkZG4WVJOZcjs.__privateSet.call(void 0, this, _intervalCount, _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _carryoverConcurrencyCount) ? _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _pending) : 0);
|
|
603
566
|
} else {
|
|
604
|
-
if (
|
|
605
|
-
|
|
606
|
-
|
|
567
|
+
if (_chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _timeoutId) === void 0) {
|
|
568
|
+
_chunkZG4WVJOZcjs.__privateSet.call(void 0, this, _timeoutId, setTimeout(() => {
|
|
569
|
+
_chunkZG4WVJOZcjs.__privateMethod.call(void 0, this, _PQueue_instances, onResumeInterval_fn).call(this);
|
|
607
570
|
}, delay));
|
|
608
571
|
}
|
|
609
572
|
return true;
|
|
@@ -611,61 +574,59 @@ isIntervalPaused_get = function() {
|
|
|
611
574
|
}
|
|
612
575
|
return false;
|
|
613
576
|
};
|
|
614
|
-
_tryToStartAnother = new WeakSet();
|
|
615
577
|
tryToStartAnother_fn = function() {
|
|
616
|
-
if (
|
|
617
|
-
if (
|
|
618
|
-
clearInterval(
|
|
578
|
+
if (_chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _queue2).size === 0) {
|
|
579
|
+
if (_chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _intervalId)) {
|
|
580
|
+
clearInterval(_chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _intervalId));
|
|
619
581
|
}
|
|
620
|
-
|
|
582
|
+
_chunkZG4WVJOZcjs.__privateSet.call(void 0, this, _intervalId, void 0);
|
|
621
583
|
this.emit("empty");
|
|
622
|
-
if (
|
|
584
|
+
if (_chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _pending) === 0) {
|
|
623
585
|
this.emit("idle");
|
|
624
586
|
}
|
|
625
587
|
return false;
|
|
626
588
|
}
|
|
627
|
-
if (!
|
|
628
|
-
const canInitializeInterval = !
|
|
629
|
-
if (
|
|
630
|
-
const job =
|
|
589
|
+
if (!_chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _isPaused)) {
|
|
590
|
+
const canInitializeInterval = !_chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _PQueue_instances, isIntervalPaused_get);
|
|
591
|
+
if (_chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _PQueue_instances, doesIntervalAllowAnother_get) && _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _PQueue_instances, doesConcurrentAllowAnother_get)) {
|
|
592
|
+
const job = _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _queue2).dequeue();
|
|
631
593
|
if (!job) {
|
|
632
594
|
return false;
|
|
633
595
|
}
|
|
634
596
|
this.emit("active");
|
|
635
597
|
job();
|
|
636
598
|
if (canInitializeInterval) {
|
|
637
|
-
|
|
599
|
+
_chunkZG4WVJOZcjs.__privateMethod.call(void 0, this, _PQueue_instances, initializeIntervalIfNeeded_fn).call(this);
|
|
638
600
|
}
|
|
639
601
|
return true;
|
|
640
602
|
}
|
|
641
603
|
}
|
|
642
604
|
return false;
|
|
643
605
|
};
|
|
644
|
-
_initializeIntervalIfNeeded = new WeakSet();
|
|
645
606
|
initializeIntervalIfNeeded_fn = function() {
|
|
646
|
-
if (
|
|
607
|
+
if (_chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _isIntervalIgnored) || _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _intervalId) !== void 0) {
|
|
647
608
|
return;
|
|
648
609
|
}
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
},
|
|
652
|
-
|
|
610
|
+
_chunkZG4WVJOZcjs.__privateSet.call(void 0, this, _intervalId, setInterval(() => {
|
|
611
|
+
_chunkZG4WVJOZcjs.__privateMethod.call(void 0, this, _PQueue_instances, onInterval_fn).call(this);
|
|
612
|
+
}, _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _interval)));
|
|
613
|
+
_chunkZG4WVJOZcjs.__privateSet.call(void 0, this, _intervalEnd, Date.now() + _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _interval));
|
|
653
614
|
};
|
|
654
|
-
_onInterval = new WeakSet();
|
|
655
615
|
onInterval_fn = function() {
|
|
656
|
-
if (
|
|
657
|
-
clearInterval(
|
|
658
|
-
|
|
616
|
+
if (_chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _intervalCount) === 0 && _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _pending) === 0 && _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _intervalId)) {
|
|
617
|
+
clearInterval(_chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _intervalId));
|
|
618
|
+
_chunkZG4WVJOZcjs.__privateSet.call(void 0, this, _intervalId, void 0);
|
|
659
619
|
}
|
|
660
|
-
|
|
661
|
-
|
|
620
|
+
_chunkZG4WVJOZcjs.__privateSet.call(void 0, this, _intervalCount, _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _carryoverConcurrencyCount) ? _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _pending) : 0);
|
|
621
|
+
_chunkZG4WVJOZcjs.__privateMethod.call(void 0, this, _PQueue_instances, processQueue_fn).call(this);
|
|
662
622
|
};
|
|
663
|
-
|
|
623
|
+
/**
|
|
624
|
+
Executes all queued functions until it reaches the limit.
|
|
625
|
+
*/
|
|
664
626
|
processQueue_fn = function() {
|
|
665
|
-
while (
|
|
627
|
+
while (_chunkZG4WVJOZcjs.__privateMethod.call(void 0, this, _PQueue_instances, tryToStartAnother_fn).call(this)) {
|
|
666
628
|
}
|
|
667
629
|
};
|
|
668
|
-
_throwOnAbort = new WeakSet();
|
|
669
630
|
throwOnAbort_fn = async function(signal) {
|
|
670
631
|
return new Promise((_resolve, reject) => {
|
|
671
632
|
signal.addEventListener("abort", () => {
|
|
@@ -673,7 +634,6 @@ throwOnAbort_fn = async function(signal) {
|
|
|
673
634
|
}, { once: true });
|
|
674
635
|
});
|
|
675
636
|
};
|
|
676
|
-
_onEvent = new WeakSet();
|
|
677
637
|
onEvent_fn = async function(event, filter) {
|
|
678
638
|
return new Promise((resolve2) => {
|
|
679
639
|
const listener = () => {
|
|
@@ -692,12 +652,12 @@ var _remeda = require('remeda');
|
|
|
692
652
|
var _fs = require('@kubb/fs');
|
|
693
653
|
|
|
694
654
|
// src/BarrelManager.ts
|
|
695
|
-
|
|
655
|
+
_chunkZG4WVJOZcjs.init_cjs_shims.call(void 0, );
|
|
696
656
|
var _parserts = require('@kubb/parser-ts');
|
|
697
657
|
|
|
698
658
|
|
|
699
659
|
// src/utils/TreeNode.ts
|
|
700
|
-
|
|
660
|
+
_chunkZG4WVJOZcjs.init_cjs_shims.call(void 0, );
|
|
701
661
|
var _directorytree = require('directory-tree'); var _directorytree2 = _interopRequireDefault(_directorytree);
|
|
702
662
|
var TreeNode = class _TreeNode {
|
|
703
663
|
constructor(data, parent) {
|
|
@@ -800,8 +760,8 @@ var TreeNode = class _TreeNode {
|
|
|
800
760
|
var _options;
|
|
801
761
|
var BarrelManager = class {
|
|
802
762
|
constructor(options = {}) {
|
|
803
|
-
|
|
804
|
-
|
|
763
|
+
_chunkZG4WVJOZcjs.__privateAdd.call(void 0, this, _options);
|
|
764
|
+
_chunkZG4WVJOZcjs.__privateSet.call(void 0, this, _options, options);
|
|
805
765
|
return this;
|
|
806
766
|
}
|
|
807
767
|
getNamedExport(root, item) {
|
|
@@ -841,7 +801,7 @@ var BarrelManager = class {
|
|
|
841
801
|
})]);
|
|
842
802
|
}
|
|
843
803
|
getIndexes(root) {
|
|
844
|
-
const { treeNode = {}, isTypeOnly, extName } =
|
|
804
|
+
const { treeNode = {}, isTypeOnly, extName } = _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _options);
|
|
845
805
|
const tree = TreeNode.build(root, treeNode);
|
|
846
806
|
if (!tree) {
|
|
847
807
|
return null;
|
|
@@ -853,7 +813,7 @@ var BarrelManager = class {
|
|
|
853
813
|
if (treeNode2.children.length > 1) {
|
|
854
814
|
const indexPath = _path2.default.resolve(treeNode2.data.path, "index.ts");
|
|
855
815
|
const exports = treeNode2.children.filter(Boolean).map((file) => {
|
|
856
|
-
const importPath = file.data.type === "split" ? `./${file.data.name}/index` : `./${
|
|
816
|
+
const importPath = file.data.type === "split" ? `./${file.data.name}/index` : `./${_chunkWSIG7TWQcjs.trimExtName.call(void 0, file.data.name)}`;
|
|
857
817
|
if (importPath.endsWith("index") && file.data.type === "single") {
|
|
858
818
|
return void 0;
|
|
859
819
|
}
|
|
@@ -872,7 +832,7 @@ var BarrelManager = class {
|
|
|
872
832
|
} else if (treeNode2.children.length === 1) {
|
|
873
833
|
const [treeNodeChild] = treeNode2.children;
|
|
874
834
|
const indexPath = _path2.default.resolve(treeNode2.data.path, "index.ts");
|
|
875
|
-
const importPath = treeNodeChild.data.type === "split" ? `./${treeNodeChild.data.name}/index` : `./${
|
|
835
|
+
const importPath = treeNodeChild.data.type === "split" ? `./${treeNodeChild.data.name}/index` : `./${_chunkWSIG7TWQcjs.trimExtName.call(void 0, treeNodeChild.data.name)}`;
|
|
876
836
|
const exports = [
|
|
877
837
|
{
|
|
878
838
|
path: extName ? `${importPath}${extName}` : importPath,
|
|
@@ -898,34 +858,33 @@ var BarrelManager = class {
|
|
|
898
858
|
_options = new WeakMap();
|
|
899
859
|
|
|
900
860
|
// src/FileManager.ts
|
|
901
|
-
var _cache, _task, _queue3,
|
|
861
|
+
var _cache, _task, _queue3, _FileManager_instances, add_fn, addOrAppend_fn;
|
|
902
862
|
var _FileManager = class _FileManager {
|
|
903
863
|
constructor({ task = async (file) => file, queue = new PQueue() } = {}) {
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
_chunk4DTSZ2MScjs.__privateSet.call(void 0, this, _queue3, queue);
|
|
864
|
+
_chunkZG4WVJOZcjs.__privateAdd.call(void 0, this, _FileManager_instances);
|
|
865
|
+
_chunkZG4WVJOZcjs.__privateAdd.call(void 0, this, _cache, /* @__PURE__ */ new Map());
|
|
866
|
+
_chunkZG4WVJOZcjs.__privateAdd.call(void 0, this, _task);
|
|
867
|
+
_chunkZG4WVJOZcjs.__privateAdd.call(void 0, this, _queue3);
|
|
868
|
+
_chunkZG4WVJOZcjs.__privateSet.call(void 0, this, _task, task);
|
|
869
|
+
_chunkZG4WVJOZcjs.__privateSet.call(void 0, this, _queue3, queue);
|
|
911
870
|
return this;
|
|
912
871
|
}
|
|
913
872
|
get files() {
|
|
914
873
|
const files = [];
|
|
915
|
-
|
|
874
|
+
_chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _cache).forEach((item) => {
|
|
916
875
|
files.push(...item.flat(1));
|
|
917
876
|
});
|
|
918
877
|
return files;
|
|
919
878
|
}
|
|
920
879
|
get isExecuting() {
|
|
921
|
-
return
|
|
880
|
+
return _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _queue3).size !== 0 && _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _queue3).pending !== 0;
|
|
922
881
|
}
|
|
923
882
|
async add(...files) {
|
|
924
883
|
const promises = combineFiles(files).map((file) => {
|
|
925
884
|
if (file.override) {
|
|
926
|
-
return
|
|
885
|
+
return _chunkZG4WVJOZcjs.__privateMethod.call(void 0, this, _FileManager_instances, add_fn).call(this, file);
|
|
927
886
|
}
|
|
928
|
-
return
|
|
887
|
+
return _chunkZG4WVJOZcjs.__privateMethod.call(void 0, this, _FileManager_instances, addOrAppend_fn).call(this, file);
|
|
929
888
|
});
|
|
930
889
|
const resolvedFiles = await Promise.all(promises);
|
|
931
890
|
if (files.length > 1) {
|
|
@@ -939,11 +898,11 @@ var _FileManager = class _FileManager {
|
|
|
939
898
|
return void 0;
|
|
940
899
|
}
|
|
941
900
|
const pathToBuildFrom = _path.resolve.call(void 0, root, output.path);
|
|
942
|
-
if (
|
|
901
|
+
if (_chunkWSIG7TWQcjs.transformers_default.trimExtName(pathToBuildFrom).endsWith("index")) {
|
|
943
902
|
logger.emit("warning", "Output has the same fileName as the barrelFiles, please disable barrel generation");
|
|
944
903
|
return;
|
|
945
904
|
}
|
|
946
|
-
const exportPath = output.path.startsWith("./") ?
|
|
905
|
+
const exportPath = output.path.startsWith("./") ? _chunkWSIG7TWQcjs.trimExtName.call(void 0, output.path) : `./${_chunkWSIG7TWQcjs.trimExtName.call(void 0, output.path)}`;
|
|
947
906
|
const mode = _FileManager.getMode(output.path);
|
|
948
907
|
const barrelManager = new BarrelManager({
|
|
949
908
|
extName: output.extName,
|
|
@@ -966,7 +925,7 @@ var _FileManager = class _FileManager {
|
|
|
966
925
|
}
|
|
967
926
|
await Promise.all(
|
|
968
927
|
files.map((file) => {
|
|
969
|
-
return
|
|
928
|
+
return _chunkZG4WVJOZcjs.__privateMethod.call(void 0, this, _FileManager_instances, addOrAppend_fn).call(this, {
|
|
970
929
|
...file,
|
|
971
930
|
meta: meta ? meta : file.meta
|
|
972
931
|
});
|
|
@@ -993,27 +952,27 @@ var _FileManager = class _FileManager {
|
|
|
993
952
|
if (exportType === "barrelNamed" && !output.exportAs && _optionalChain([rootFile, 'access', _32 => _32.exports, 'optionalAccess', _33 => _33[0]])) {
|
|
994
953
|
rootFile.exports = barrelManager.getNamedExport(root, rootFile.exports[0]);
|
|
995
954
|
}
|
|
996
|
-
await
|
|
955
|
+
await _chunkZG4WVJOZcjs.__privateMethod.call(void 0, this, _FileManager_instances, addOrAppend_fn).call(this, {
|
|
997
956
|
...rootFile,
|
|
998
957
|
meta: meta ? meta : rootFile.meta
|
|
999
958
|
});
|
|
1000
959
|
}
|
|
1001
960
|
getCacheByUUID(UUID) {
|
|
1002
961
|
let cache;
|
|
1003
|
-
|
|
962
|
+
_chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _cache).forEach((files) => {
|
|
1004
963
|
cache = files.find((item) => item.id === UUID);
|
|
1005
964
|
});
|
|
1006
965
|
return cache;
|
|
1007
966
|
}
|
|
1008
967
|
get(path2) {
|
|
1009
|
-
return
|
|
968
|
+
return _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _cache).get(path2);
|
|
1010
969
|
}
|
|
1011
970
|
remove(path2) {
|
|
1012
971
|
const cacheItem = this.get(path2);
|
|
1013
972
|
if (!cacheItem) {
|
|
1014
973
|
return;
|
|
1015
974
|
}
|
|
1016
|
-
|
|
975
|
+
_chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _cache).delete(path2);
|
|
1017
976
|
}
|
|
1018
977
|
async write(...params) {
|
|
1019
978
|
return _fs.write.call(void 0, ...params);
|
|
@@ -1044,12 +1003,12 @@ var _FileManager = class _FileManager {
|
|
|
1044
1003
|
_cache = new WeakMap();
|
|
1045
1004
|
_task = new WeakMap();
|
|
1046
1005
|
_queue3 = new WeakMap();
|
|
1047
|
-
|
|
1006
|
+
_FileManager_instances = new WeakSet();
|
|
1048
1007
|
add_fn = async function(file) {
|
|
1049
1008
|
const controller = new AbortController();
|
|
1050
1009
|
const resolvedFile = {
|
|
1051
1010
|
id: _crypto2.default.randomUUID(),
|
|
1052
|
-
name:
|
|
1011
|
+
name: _chunkWSIG7TWQcjs.trimExtName.call(void 0, file.baseName),
|
|
1053
1012
|
...file
|
|
1054
1013
|
};
|
|
1055
1014
|
if (_optionalChain([resolvedFile, 'access', _34 => _34.exports, 'optionalAccess', _35 => _35.length])) {
|
|
@@ -1062,22 +1021,21 @@ add_fn = async function(file) {
|
|
|
1062
1021
|
return true;
|
|
1063
1022
|
});
|
|
1064
1023
|
}
|
|
1065
|
-
|
|
1066
|
-
return
|
|
1024
|
+
_chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _cache).set(resolvedFile.path, [{ cancel: () => controller.abort(), ...resolvedFile }]);
|
|
1025
|
+
return _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _queue3).add(
|
|
1067
1026
|
async () => {
|
|
1068
1027
|
var _a;
|
|
1069
|
-
return (_a =
|
|
1028
|
+
return (_a = _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _task)) == null ? void 0 : _a.call(this, resolvedFile);
|
|
1070
1029
|
},
|
|
1071
1030
|
{ signal: controller.signal }
|
|
1072
1031
|
);
|
|
1073
1032
|
};
|
|
1074
|
-
_addOrAppend = new WeakSet();
|
|
1075
1033
|
addOrAppend_fn = async function(file) {
|
|
1076
|
-
const previousCaches =
|
|
1034
|
+
const previousCaches = _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _cache).get(file.path);
|
|
1077
1035
|
const previousCache = previousCaches ? previousCaches.at(previousCaches.length - 1) : void 0;
|
|
1078
1036
|
if (previousCache) {
|
|
1079
|
-
|
|
1080
|
-
return
|
|
1037
|
+
_chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _cache).delete(previousCache.path);
|
|
1038
|
+
return _chunkZG4WVJOZcjs.__privateMethod.call(void 0, this, _FileManager_instances, add_fn).call(this, {
|
|
1081
1039
|
...file,
|
|
1082
1040
|
source: previousCache.source && file.source ? `${previousCache.source}
|
|
1083
1041
|
${file.source}` : "",
|
|
@@ -1086,7 +1044,7 @@ ${file.source}` : "",
|
|
|
1086
1044
|
env: { ...previousCache.env || {}, ...file.env || {} }
|
|
1087
1045
|
});
|
|
1088
1046
|
}
|
|
1089
|
-
return
|
|
1047
|
+
return _chunkZG4WVJOZcjs.__privateMethod.call(void 0, this, _FileManager_instances, add_fn).call(this, file);
|
|
1090
1048
|
};
|
|
1091
1049
|
var FileManager = _FileManager;
|
|
1092
1050
|
function combineFiles(files) {
|
|
@@ -1124,12 +1082,12 @@ async function getSource(file) {
|
|
|
1124
1082
|
if (file.language ? !["typescript", "javascript"].includes(file.language) : !FileManager.isJavascript(file.baseName)) {
|
|
1125
1083
|
return file.source;
|
|
1126
1084
|
}
|
|
1127
|
-
const parser = await
|
|
1085
|
+
const parser = await _chunkOCFABH5Lcjs.getParser.call(void 0, file.language);
|
|
1128
1086
|
const exports = file.exports ? combineExports(file.exports) : [];
|
|
1129
1087
|
const imports = file.imports && file.source ? combineImports(file.imports, exports, file.source) : [];
|
|
1130
1088
|
const importNodes = imports.filter((item) => {
|
|
1131
1089
|
const path2 = item.root ? _fs.getRelativePath.call(void 0, item.root, item.path) : item.path;
|
|
1132
|
-
return path2 !==
|
|
1090
|
+
return path2 !== _chunkWSIG7TWQcjs.trimExtName.call(void 0, file.path);
|
|
1133
1091
|
}).map((item) => {
|
|
1134
1092
|
return parser.factory.createImportDeclaration({
|
|
1135
1093
|
name: item.name,
|
|
@@ -1149,7 +1107,7 @@ async function getSource(file) {
|
|
|
1149
1107
|
return parser.print([], { source, noEmitHelpers: false });
|
|
1150
1108
|
}
|
|
1151
1109
|
function combineExports(exports) {
|
|
1152
|
-
const combinedExports =
|
|
1110
|
+
const combinedExports = _chunkFVW4VDVDcjs.orderBy.call(void 0, exports, [(v) => !v.isTypeOnly], ["asc"]).reduce(
|
|
1153
1111
|
(prev, curr) => {
|
|
1154
1112
|
const name = curr.name;
|
|
1155
1113
|
const prevByPath = prev.findLast((imp) => imp.path === curr.path);
|
|
@@ -1180,10 +1138,10 @@ function combineExports(exports) {
|
|
|
1180
1138
|
},
|
|
1181
1139
|
[]
|
|
1182
1140
|
);
|
|
1183
|
-
return
|
|
1141
|
+
return _chunkFVW4VDVDcjs.orderBy.call(void 0, combinedExports, [(v) => !v.isTypeOnly, (v) => v.asAlias], ["desc", "desc"]);
|
|
1184
1142
|
}
|
|
1185
1143
|
function combineImports(imports, exports, source) {
|
|
1186
|
-
const combinedImports =
|
|
1144
|
+
const combinedImports = _chunkFVW4VDVDcjs.orderBy.call(void 0, imports, [(v) => !v.isTypeOnly], ["asc"]).reduce(
|
|
1187
1145
|
(prev, curr) => {
|
|
1188
1146
|
let name = Array.isArray(curr.name) ? [...new Set(curr.name)] : curr.name;
|
|
1189
1147
|
const hasImportInSource = (importName) => {
|
|
@@ -1228,7 +1186,7 @@ function combineImports(imports, exports, source) {
|
|
|
1228
1186
|
},
|
|
1229
1187
|
[]
|
|
1230
1188
|
);
|
|
1231
|
-
return
|
|
1189
|
+
return _chunkFVW4VDVDcjs.orderBy.call(void 0, combinedImports, [(v) => !v.isTypeOnly], ["desc"]);
|
|
1232
1190
|
}
|
|
1233
1191
|
function getEnvSource(source, env) {
|
|
1234
1192
|
if (!env) {
|
|
@@ -1245,13 +1203,13 @@ function getEnvSource(source, env) {
|
|
|
1245
1203
|
throw new TypeError(`Environment should be in upperCase for ${key}`);
|
|
1246
1204
|
}
|
|
1247
1205
|
if (typeof replaceBy === "string") {
|
|
1248
|
-
prev =
|
|
1206
|
+
prev = _chunkWSIG7TWQcjs.searchAndReplace.call(void 0, {
|
|
1249
1207
|
text: prev.replaceAll(`process.env.${key}`, replaceBy),
|
|
1250
1208
|
replaceBy,
|
|
1251
1209
|
prefix: "process.env",
|
|
1252
1210
|
key
|
|
1253
1211
|
});
|
|
1254
|
-
prev =
|
|
1212
|
+
prev = _chunkWSIG7TWQcjs.searchAndReplace.call(void 0, {
|
|
1255
1213
|
text: prev.replaceAll(/(declare const).*\n/gi, ""),
|
|
1256
1214
|
replaceBy,
|
|
1257
1215
|
key
|
|
@@ -1265,4 +1223,4 @@ function getEnvSource(source, env) {
|
|
|
1265
1223
|
|
|
1266
1224
|
|
|
1267
1225
|
exports.PQueue = PQueue; exports.FileManager = FileManager;
|
|
1268
|
-
//# sourceMappingURL=chunk-
|
|
1226
|
+
//# sourceMappingURL=chunk-ESX7D52D.cjs.map
|