@kubb/core 2.9.1 → 2.11.0
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-CUO3T7RA.cjs → chunk-4GE2JRAA.cjs} +6 -6
- package/dist/{chunk-DJLNT4KC.cjs → chunk-4TB6NGOC.cjs} +3 -3
- package/dist/{chunk-DJLNT4KC.cjs.map → chunk-4TB6NGOC.cjs.map} +1 -1
- package/dist/{chunk-XDO5ZSKZ.js → chunk-5I2ALFAS.js} +2 -2
- package/dist/{chunk-JPSCPXBD.js → chunk-B7DTFNR4.js} +2 -2
- package/dist/{chunk-WRGVBPK2.js → chunk-CH2676BL.js} +7 -5
- package/dist/chunk-CH2676BL.js.map +1 -0
- package/dist/chunk-DOELQNBO.cjs +455 -0
- package/dist/chunk-DOELQNBO.cjs.map +1 -0
- package/dist/{chunk-77TYOFGF.js → chunk-EAM5RXNI.js} +3 -3
- package/dist/{chunk-77TYOFGF.js.map → chunk-EAM5RXNI.js.map} +1 -1
- package/dist/{chunk-AHK6WOW6.js → chunk-G7EQ47A4.js} +3 -3
- package/dist/{chunk-S3BHD7DW.js → chunk-H7U5WQ3I.js} +2 -2
- package/dist/{chunk-ZJ6GI35A.cjs → chunk-JDIEEDDB.cjs} +18 -16
- package/dist/chunk-JDIEEDDB.cjs.map +1 -0
- package/dist/{chunk-UMLYXEIH.cjs → chunk-KOQSM5X7.cjs} +5 -5
- package/dist/{chunk-SEATGNQM.js → chunk-KXDRK6DY.js} +2 -2
- package/dist/{chunk-X2JM3GAC.cjs → chunk-TJHTFTXA.cjs} +90 -90
- package/dist/{chunk-LCHP3GH5.cjs → chunk-UIWHEBZA.cjs} +226 -225
- package/dist/chunk-UIWHEBZA.cjs.map +1 -0
- package/dist/{chunk-GNWOOGXA.cjs → chunk-UUBXTHJG.cjs} +3 -3
- package/dist/{chunk-J2ES4PYI.js → chunk-UYADU5OY.js} +2 -2
- package/dist/{chunk-IXCRUQPC.cjs → chunk-WAIHMG76.cjs} +5 -5
- package/dist/chunk-WXV3UNEP.js +353 -0
- package/dist/chunk-WXV3UNEP.js.map +1 -0
- package/dist/chunk-XZZ2F3LK.cjs +19 -0
- package/dist/{chunk-WJTCEFTE.js → chunk-ZNYG4U5D.js} +14 -13
- package/dist/{chunk-WJTCEFTE.js.map → chunk-ZNYG4U5D.js.map} +1 -1
- package/dist/fs.cjs +6 -6
- package/dist/fs.js +4 -4
- package/dist/index.cjs +96 -96
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +10 -10
- package/dist/{logger-DjcF5DGc.d.ts → logger-Cskfrvra.d.cts} +1 -1
- package/dist/{logger-DjcF5DGc.d.cts → logger-Cskfrvra.d.ts} +1 -1
- package/dist/logger.cjs +4 -4
- package/dist/logger.d.cts +1 -1
- package/dist/logger.d.ts +1 -1
- package/dist/logger.js +3 -3
- package/dist/mocks.cjs +11 -11
- package/dist/mocks.d.cts +1 -1
- package/dist/mocks.d.ts +1 -1
- package/dist/mocks.js +8 -8
- package/dist/transformers.cjs +41 -32
- package/dist/transformers.cjs.map +1 -1
- package/dist/transformers.d.cts +14 -2
- package/dist/transformers.d.ts +14 -2
- package/dist/transformers.js +18 -9
- package/dist/transformers.js.map +1 -1
- package/dist/utils.cjs +27 -27
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.js +6 -6
- package/dist/utils.js.map +1 -1
- package/package.json +7 -5
- package/src/PluginManager.ts +4 -4
- package/src/logger.ts +6 -3
- package/src/transformers/index.ts +11 -2
- package/src/transformers/stringify.ts +1 -0
- package/src/transformers/toNumber.ts +1 -2
- package/dist/chunk-AWUFUNOJ.cjs +0 -137
- package/dist/chunk-AWUFUNOJ.cjs.map +0 -1
- package/dist/chunk-EXBYWEC2.cjs +0 -19
- package/dist/chunk-LCHP3GH5.cjs.map +0 -1
- package/dist/chunk-SV7GUBBD.js +0 -35
- package/dist/chunk-SV7GUBBD.js.map +0 -1
- package/dist/chunk-WRGVBPK2.js.map +0 -1
- package/dist/chunk-ZJ6GI35A.cjs.map +0 -1
- /package/dist/{chunk-CUO3T7RA.cjs.map → chunk-4GE2JRAA.cjs.map} +0 -0
- /package/dist/{chunk-XDO5ZSKZ.js.map → chunk-5I2ALFAS.js.map} +0 -0
- /package/dist/{chunk-JPSCPXBD.js.map → chunk-B7DTFNR4.js.map} +0 -0
- /package/dist/{chunk-AHK6WOW6.js.map → chunk-G7EQ47A4.js.map} +0 -0
- /package/dist/{chunk-S3BHD7DW.js.map → chunk-H7U5WQ3I.js.map} +0 -0
- /package/dist/{chunk-UMLYXEIH.cjs.map → chunk-KOQSM5X7.cjs.map} +0 -0
- /package/dist/{chunk-SEATGNQM.js.map → chunk-KXDRK6DY.js.map} +0 -0
- /package/dist/{chunk-X2JM3GAC.cjs.map → chunk-TJHTFTXA.cjs.map} +0 -0
- /package/dist/{chunk-GNWOOGXA.cjs.map → chunk-UUBXTHJG.cjs.map} +0 -0
- /package/dist/{chunk-J2ES4PYI.js.map → chunk-UYADU5OY.js.map} +0 -0
- /package/dist/{chunk-IXCRUQPC.cjs.map → chunk-WAIHMG76.cjs.map} +0 -0
- /package/dist/{chunk-EXBYWEC2.cjs.map → chunk-XZZ2F3LK.cjs.map} +0 -0
|
@@ -2,24 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkKOQSM5X7cjs = require('./chunk-KOQSM5X7.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkUUBXTHJGcjs = require('./chunk-UUBXTHJG.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
+
var _chunkDOELQNBOcjs = require('./chunk-DOELQNBO.cjs');
|
|
11
12
|
|
|
12
|
-
var _chunkZJ6GI35Acjs = require('./chunk-ZJ6GI35A.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
|
+
var _chunkJDIEEDDBcjs = require('./chunk-JDIEEDDB.cjs');
|
|
15
16
|
|
|
16
17
|
|
|
17
|
-
var _chunkIXCRUQPCcjs = require('./chunk-IXCRUQPC.cjs');
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _chunkWAIHMG76cjs = require('./chunk-WAIHMG76.cjs');
|
|
21
21
|
|
|
22
22
|
|
|
23
|
+
var _chunkTJHTFTXAcjs = require('./chunk-TJHTFTXA.cjs');
|
|
23
24
|
|
|
24
25
|
|
|
25
26
|
|
|
@@ -28,13 +29,15 @@ var _chunkX2JM3GACcjs = require('./chunk-X2JM3GAC.cjs');
|
|
|
28
29
|
|
|
29
30
|
|
|
30
31
|
|
|
31
|
-
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
var _chunk4TB6NGOCcjs = require('./chunk-4TB6NGOC.cjs');
|
|
32
35
|
|
|
33
36
|
// ../../node_modules/.pnpm/lodash.isequal@4.5.0/node_modules/lodash.isequal/index.js
|
|
34
|
-
var require_lodash =
|
|
37
|
+
var require_lodash = _chunk4TB6NGOCcjs.__commonJS.call(void 0, {
|
|
35
38
|
"../../node_modules/.pnpm/lodash.isequal@4.5.0/node_modules/lodash.isequal/index.js"(exports, module) {
|
|
36
39
|
"use strict";
|
|
37
|
-
|
|
40
|
+
_chunk4TB6NGOCcjs.init_cjs_shims.call(void 0, );
|
|
38
41
|
var LARGE_ARRAY_SIZE = 200;
|
|
39
42
|
var HASH_UNDEFINED = "__lodash_hash_undefined__";
|
|
40
43
|
var COMPARE_PARTIAL_FLAG = 1;
|
|
@@ -734,10 +737,10 @@ var require_lodash = _chunkDJLNT4KCcjs.__commonJS.call(void 0, {
|
|
|
734
737
|
});
|
|
735
738
|
|
|
736
739
|
// ../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.js
|
|
737
|
-
var require_eventemitter3 =
|
|
740
|
+
var require_eventemitter3 = _chunk4TB6NGOCcjs.__commonJS.call(void 0, {
|
|
738
741
|
"../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.js"(exports, module) {
|
|
739
742
|
"use strict";
|
|
740
|
-
|
|
743
|
+
_chunk4TB6NGOCcjs.init_cjs_shims.call(void 0, );
|
|
741
744
|
var has = Object.prototype.hasOwnProperty;
|
|
742
745
|
var prefix = "~";
|
|
743
746
|
function Events() {
|
|
@@ -917,23 +920,22 @@ var require_eventemitter3 = _chunkDJLNT4KCcjs.__commonJS.call(void 0, {
|
|
|
917
920
|
});
|
|
918
921
|
|
|
919
922
|
// src/FileManager.ts
|
|
920
|
-
|
|
921
|
-
var import_lodash =
|
|
923
|
+
_chunk4TB6NGOCcjs.init_cjs_shims.call(void 0, );
|
|
924
|
+
var import_lodash = _chunk4TB6NGOCcjs.__toESM.call(void 0, require_lodash(), 1);
|
|
922
925
|
var _crypto = require('crypto'); var _crypto2 = _interopRequireDefault(_crypto);
|
|
923
926
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
924
927
|
var _parser = require('@kubb/parser');
|
|
925
928
|
var _factory = require('@kubb/parser/factory'); var factory = _interopRequireWildcard(_factory);
|
|
926
|
-
var _naturalorderby = require('natural-orderby');
|
|
927
929
|
|
|
928
930
|
// ../../node_modules/.pnpm/p-queue@8.0.1/node_modules/p-queue/dist/index.js
|
|
929
|
-
|
|
931
|
+
_chunk4TB6NGOCcjs.init_cjs_shims.call(void 0, );
|
|
930
932
|
|
|
931
933
|
// ../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.mjs
|
|
932
|
-
|
|
933
|
-
var import_index =
|
|
934
|
+
_chunk4TB6NGOCcjs.init_cjs_shims.call(void 0, );
|
|
935
|
+
var import_index = _chunk4TB6NGOCcjs.__toESM.call(void 0, require_eventemitter3(), 1);
|
|
934
936
|
|
|
935
937
|
// ../../node_modules/.pnpm/p-timeout@6.1.2/node_modules/p-timeout/index.js
|
|
936
|
-
|
|
938
|
+
_chunk4TB6NGOCcjs.init_cjs_shims.call(void 0, );
|
|
937
939
|
var TimeoutError = class extends Error {
|
|
938
940
|
constructor(message) {
|
|
939
941
|
super(message);
|
|
@@ -1018,10 +1020,10 @@ function pTimeout(promise, options) {
|
|
|
1018
1020
|
}
|
|
1019
1021
|
|
|
1020
1022
|
// ../../node_modules/.pnpm/p-queue@8.0.1/node_modules/p-queue/dist/priority-queue.js
|
|
1021
|
-
|
|
1023
|
+
_chunk4TB6NGOCcjs.init_cjs_shims.call(void 0, );
|
|
1022
1024
|
|
|
1023
1025
|
// ../../node_modules/.pnpm/p-queue@8.0.1/node_modules/p-queue/dist/lower-bound.js
|
|
1024
|
-
|
|
1026
|
+
_chunk4TB6NGOCcjs.init_cjs_shims.call(void 0, );
|
|
1025
1027
|
function lowerBound(array, value, comparator) {
|
|
1026
1028
|
let first = 0;
|
|
1027
1029
|
let count = array.length;
|
|
@@ -1042,7 +1044,7 @@ function lowerBound(array, value, comparator) {
|
|
|
1042
1044
|
var _queue;
|
|
1043
1045
|
var PriorityQueue = class {
|
|
1044
1046
|
constructor() {
|
|
1045
|
-
|
|
1047
|
+
_chunk4TB6NGOCcjs.__privateAdd.call(void 0, this, _queue, []);
|
|
1046
1048
|
}
|
|
1047
1049
|
enqueue(run, options) {
|
|
1048
1050
|
options = {
|
|
@@ -1053,22 +1055,22 @@ var PriorityQueue = class {
|
|
|
1053
1055
|
priority: options.priority,
|
|
1054
1056
|
run
|
|
1055
1057
|
};
|
|
1056
|
-
if (this.size &&
|
|
1057
|
-
|
|
1058
|
+
if (this.size && _chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _queue)[this.size - 1].priority >= options.priority) {
|
|
1059
|
+
_chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _queue).push(element);
|
|
1058
1060
|
return;
|
|
1059
1061
|
}
|
|
1060
|
-
const index = lowerBound(
|
|
1061
|
-
|
|
1062
|
+
const index = lowerBound(_chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _queue), element, (a, b) => b.priority - a.priority);
|
|
1063
|
+
_chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _queue).splice(index, 0, element);
|
|
1062
1064
|
}
|
|
1063
1065
|
dequeue() {
|
|
1064
|
-
const item =
|
|
1066
|
+
const item = _chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _queue).shift();
|
|
1065
1067
|
return _optionalChain([item, 'optionalAccess', _2 => _2.run]);
|
|
1066
1068
|
}
|
|
1067
1069
|
filter(options) {
|
|
1068
|
-
return
|
|
1070
|
+
return _chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _queue).filter((element) => element.priority === options.priority).map((element) => element.run);
|
|
1069
1071
|
}
|
|
1070
1072
|
get size() {
|
|
1071
|
-
return
|
|
1073
|
+
return _chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _queue).length;
|
|
1072
1074
|
}
|
|
1073
1075
|
};
|
|
1074
1076
|
_queue = new WeakMap();
|
|
@@ -1079,41 +1081,41 @@ var PQueue = class extends import_index.default {
|
|
|
1079
1081
|
// TODO: The `throwOnTimeout` option should affect the return types of `add()` and `addAll()`
|
|
1080
1082
|
constructor(options) {
|
|
1081
1083
|
super();
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1084
|
+
_chunk4TB6NGOCcjs.__privateAdd.call(void 0, this, _doesIntervalAllowAnother);
|
|
1085
|
+
_chunk4TB6NGOCcjs.__privateAdd.call(void 0, this, _doesConcurrentAllowAnother);
|
|
1086
|
+
_chunk4TB6NGOCcjs.__privateAdd.call(void 0, this, _next);
|
|
1087
|
+
_chunk4TB6NGOCcjs.__privateAdd.call(void 0, this, _onResumeInterval);
|
|
1088
|
+
_chunk4TB6NGOCcjs.__privateAdd.call(void 0, this, _isIntervalPaused);
|
|
1089
|
+
_chunk4TB6NGOCcjs.__privateAdd.call(void 0, this, _tryToStartAnother);
|
|
1090
|
+
_chunk4TB6NGOCcjs.__privateAdd.call(void 0, this, _initializeIntervalIfNeeded);
|
|
1091
|
+
_chunk4TB6NGOCcjs.__privateAdd.call(void 0, this, _onInterval);
|
|
1090
1092
|
/**
|
|
1091
1093
|
Executes all queued functions until it reaches the limit.
|
|
1092
1094
|
*/
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1095
|
+
_chunk4TB6NGOCcjs.__privateAdd.call(void 0, this, _processQueue);
|
|
1096
|
+
_chunk4TB6NGOCcjs.__privateAdd.call(void 0, this, _throwOnAbort);
|
|
1097
|
+
_chunk4TB6NGOCcjs.__privateAdd.call(void 0, this, _onEvent);
|
|
1098
|
+
_chunk4TB6NGOCcjs.__privateAdd.call(void 0, this, _carryoverConcurrencyCount, void 0);
|
|
1099
|
+
_chunk4TB6NGOCcjs.__privateAdd.call(void 0, this, _isIntervalIgnored, void 0);
|
|
1100
|
+
_chunk4TB6NGOCcjs.__privateAdd.call(void 0, this, _intervalCount, 0);
|
|
1101
|
+
_chunk4TB6NGOCcjs.__privateAdd.call(void 0, this, _intervalCap, void 0);
|
|
1102
|
+
_chunk4TB6NGOCcjs.__privateAdd.call(void 0, this, _interval, void 0);
|
|
1103
|
+
_chunk4TB6NGOCcjs.__privateAdd.call(void 0, this, _intervalEnd, 0);
|
|
1104
|
+
_chunk4TB6NGOCcjs.__privateAdd.call(void 0, this, _intervalId, void 0);
|
|
1105
|
+
_chunk4TB6NGOCcjs.__privateAdd.call(void 0, this, _timeoutId, void 0);
|
|
1106
|
+
_chunk4TB6NGOCcjs.__privateAdd.call(void 0, this, _queue2, void 0);
|
|
1107
|
+
_chunk4TB6NGOCcjs.__privateAdd.call(void 0, this, _queueClass, void 0);
|
|
1108
|
+
_chunk4TB6NGOCcjs.__privateAdd.call(void 0, this, _pending, 0);
|
|
1107
1109
|
// The `!` is needed because of https://github.com/microsoft/TypeScript/issues/32194
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1110
|
+
_chunk4TB6NGOCcjs.__privateAdd.call(void 0, this, _concurrency, void 0);
|
|
1111
|
+
_chunk4TB6NGOCcjs.__privateAdd.call(void 0, this, _isPaused, void 0);
|
|
1112
|
+
_chunk4TB6NGOCcjs.__privateAdd.call(void 0, this, _throwOnTimeout, void 0);
|
|
1111
1113
|
/**
|
|
1112
1114
|
Per-operation timeout in milliseconds. Operations fulfill once `timeout` elapses if they haven't already.
|
|
1113
1115
|
|
|
1114
1116
|
Applies to each future operation.
|
|
1115
1117
|
*/
|
|
1116
|
-
|
|
1118
|
+
_chunk4TB6NGOCcjs.__publicField.call(void 0, this, "timeout");
|
|
1117
1119
|
options = {
|
|
1118
1120
|
carryoverConcurrencyCount: false,
|
|
1119
1121
|
intervalCap: Number.POSITIVE_INFINITY,
|
|
@@ -1129,37 +1131,37 @@ var PQueue = class extends import_index.default {
|
|
|
1129
1131
|
if (options.interval === void 0 || !(Number.isFinite(options.interval) && options.interval >= 0)) {
|
|
1130
1132
|
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})`);
|
|
1131
1133
|
}
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1134
|
+
_chunk4TB6NGOCcjs.__privateSet.call(void 0, this, _carryoverConcurrencyCount, options.carryoverConcurrencyCount);
|
|
1135
|
+
_chunk4TB6NGOCcjs.__privateSet.call(void 0, this, _isIntervalIgnored, options.intervalCap === Number.POSITIVE_INFINITY || options.interval === 0);
|
|
1136
|
+
_chunk4TB6NGOCcjs.__privateSet.call(void 0, this, _intervalCap, options.intervalCap);
|
|
1137
|
+
_chunk4TB6NGOCcjs.__privateSet.call(void 0, this, _interval, options.interval);
|
|
1138
|
+
_chunk4TB6NGOCcjs.__privateSet.call(void 0, this, _queue2, new options.queueClass());
|
|
1139
|
+
_chunk4TB6NGOCcjs.__privateSet.call(void 0, this, _queueClass, options.queueClass);
|
|
1138
1140
|
this.concurrency = options.concurrency;
|
|
1139
1141
|
this.timeout = options.timeout;
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
+
_chunk4TB6NGOCcjs.__privateSet.call(void 0, this, _throwOnTimeout, options.throwOnTimeout === true);
|
|
1143
|
+
_chunk4TB6NGOCcjs.__privateSet.call(void 0, this, _isPaused, options.autoStart === false);
|
|
1142
1144
|
}
|
|
1143
1145
|
get concurrency() {
|
|
1144
|
-
return
|
|
1146
|
+
return _chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _concurrency);
|
|
1145
1147
|
}
|
|
1146
1148
|
set concurrency(newConcurrency) {
|
|
1147
1149
|
if (!(typeof newConcurrency === "number" && newConcurrency >= 1)) {
|
|
1148
1150
|
throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${newConcurrency}\` (${typeof newConcurrency})`);
|
|
1149
1151
|
}
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
+
_chunk4TB6NGOCcjs.__privateSet.call(void 0, this, _concurrency, newConcurrency);
|
|
1153
|
+
_chunk4TB6NGOCcjs.__privateMethod.call(void 0, this, _processQueue, processQueue_fn).call(this);
|
|
1152
1154
|
}
|
|
1153
1155
|
async add(function_, options = {}) {
|
|
1154
1156
|
options = {
|
|
1155
1157
|
timeout: this.timeout,
|
|
1156
|
-
throwOnTimeout:
|
|
1158
|
+
throwOnTimeout: _chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _throwOnTimeout),
|
|
1157
1159
|
...options
|
|
1158
1160
|
};
|
|
1159
1161
|
return new Promise((resolve2, reject) => {
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1162
|
+
_chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _queue2).enqueue(async () => {
|
|
1163
|
+
_chunk4TB6NGOCcjs.__privateWrapper.call(void 0, this, _pending)._++;
|
|
1164
|
+
_chunk4TB6NGOCcjs.__privateWrapper.call(void 0, this, _intervalCount)._++;
|
|
1163
1165
|
try {
|
|
1164
1166
|
_optionalChain([options, 'access', _9 => _9.signal, 'optionalAccess', _10 => _10.throwIfAborted, 'call', _11 => _11()]);
|
|
1165
1167
|
let operation = function_({ signal: options.signal });
|
|
@@ -1167,7 +1169,7 @@ var PQueue = class extends import_index.default {
|
|
|
1167
1169
|
operation = pTimeout(Promise.resolve(operation), { milliseconds: options.timeout });
|
|
1168
1170
|
}
|
|
1169
1171
|
if (options.signal) {
|
|
1170
|
-
operation = Promise.race([operation,
|
|
1172
|
+
operation = Promise.race([operation, _chunk4TB6NGOCcjs.__privateMethod.call(void 0, this, _throwOnAbort, throwOnAbort_fn).call(this, options.signal)]);
|
|
1171
1173
|
}
|
|
1172
1174
|
const result = await operation;
|
|
1173
1175
|
resolve2(result);
|
|
@@ -1180,11 +1182,11 @@ var PQueue = class extends import_index.default {
|
|
|
1180
1182
|
reject(error);
|
|
1181
1183
|
this.emit("error", error);
|
|
1182
1184
|
} finally {
|
|
1183
|
-
|
|
1185
|
+
_chunk4TB6NGOCcjs.__privateMethod.call(void 0, this, _next, next_fn).call(this);
|
|
1184
1186
|
}
|
|
1185
1187
|
}, options);
|
|
1186
1188
|
this.emit("add");
|
|
1187
|
-
|
|
1189
|
+
_chunk4TB6NGOCcjs.__privateMethod.call(void 0, this, _tryToStartAnother, tryToStartAnother_fn).call(this);
|
|
1188
1190
|
});
|
|
1189
1191
|
}
|
|
1190
1192
|
async addAll(functions, options) {
|
|
@@ -1194,24 +1196,24 @@ var PQueue = class extends import_index.default {
|
|
|
1194
1196
|
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.)
|
|
1195
1197
|
*/
|
|
1196
1198
|
start() {
|
|
1197
|
-
if (!
|
|
1199
|
+
if (!_chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _isPaused)) {
|
|
1198
1200
|
return this;
|
|
1199
1201
|
}
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
+
_chunk4TB6NGOCcjs.__privateSet.call(void 0, this, _isPaused, false);
|
|
1203
|
+
_chunk4TB6NGOCcjs.__privateMethod.call(void 0, this, _processQueue, processQueue_fn).call(this);
|
|
1202
1204
|
return this;
|
|
1203
1205
|
}
|
|
1204
1206
|
/**
|
|
1205
1207
|
Put queue execution on hold.
|
|
1206
1208
|
*/
|
|
1207
1209
|
pause() {
|
|
1208
|
-
|
|
1210
|
+
_chunk4TB6NGOCcjs.__privateSet.call(void 0, this, _isPaused, true);
|
|
1209
1211
|
}
|
|
1210
1212
|
/**
|
|
1211
1213
|
Clear the queue.
|
|
1212
1214
|
*/
|
|
1213
1215
|
clear() {
|
|
1214
|
-
|
|
1216
|
+
_chunk4TB6NGOCcjs.__privateSet.call(void 0, this, _queue2, new (_chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _queueClass))());
|
|
1215
1217
|
}
|
|
1216
1218
|
/**
|
|
1217
1219
|
Can be called multiple times. Useful if you for example add additional items at a later time.
|
|
@@ -1219,10 +1221,10 @@ var PQueue = class extends import_index.default {
|
|
|
1219
1221
|
@returns A promise that settles when the queue becomes empty.
|
|
1220
1222
|
*/
|
|
1221
1223
|
async onEmpty() {
|
|
1222
|
-
if (
|
|
1224
|
+
if (_chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _queue2).size === 0) {
|
|
1223
1225
|
return;
|
|
1224
1226
|
}
|
|
1225
|
-
await
|
|
1227
|
+
await _chunk4TB6NGOCcjs.__privateMethod.call(void 0, this, _onEvent, onEvent_fn).call(this, "empty");
|
|
1226
1228
|
}
|
|
1227
1229
|
/**
|
|
1228
1230
|
@returns A promise that settles when the queue size is less than the given limit: `queue.size < limit`.
|
|
@@ -1232,10 +1234,10 @@ var PQueue = class extends import_index.default {
|
|
|
1232
1234
|
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.
|
|
1233
1235
|
*/
|
|
1234
1236
|
async onSizeLessThan(limit) {
|
|
1235
|
-
if (
|
|
1237
|
+
if (_chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _queue2).size < limit) {
|
|
1236
1238
|
return;
|
|
1237
1239
|
}
|
|
1238
|
-
await
|
|
1240
|
+
await _chunk4TB6NGOCcjs.__privateMethod.call(void 0, this, _onEvent, onEvent_fn).call(this, "next", () => _chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _queue2).size < limit);
|
|
1239
1241
|
}
|
|
1240
1242
|
/**
|
|
1241
1243
|
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.
|
|
@@ -1243,16 +1245,16 @@ var PQueue = class extends import_index.default {
|
|
|
1243
1245
|
@returns A promise that settles when the queue becomes empty, and all promises have completed; `queue.size === 0 && queue.pending === 0`.
|
|
1244
1246
|
*/
|
|
1245
1247
|
async onIdle() {
|
|
1246
|
-
if (
|
|
1248
|
+
if (_chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _pending) === 0 && _chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _queue2).size === 0) {
|
|
1247
1249
|
return;
|
|
1248
1250
|
}
|
|
1249
|
-
await
|
|
1251
|
+
await _chunk4TB6NGOCcjs.__privateMethod.call(void 0, this, _onEvent, onEvent_fn).call(this, "idle");
|
|
1250
1252
|
}
|
|
1251
1253
|
/**
|
|
1252
1254
|
Size of the queue, the number of queued items waiting to run.
|
|
1253
1255
|
*/
|
|
1254
1256
|
get size() {
|
|
1255
|
-
return
|
|
1257
|
+
return _chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _queue2).size;
|
|
1256
1258
|
}
|
|
1257
1259
|
/**
|
|
1258
1260
|
Size of the queue, filtered by the given options.
|
|
@@ -1260,19 +1262,19 @@ var PQueue = class extends import_index.default {
|
|
|
1260
1262
|
For example, this can be used to find the number of items remaining in the queue with a specific priority level.
|
|
1261
1263
|
*/
|
|
1262
1264
|
sizeBy(options) {
|
|
1263
|
-
return
|
|
1265
|
+
return _chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _queue2).filter(options).length;
|
|
1264
1266
|
}
|
|
1265
1267
|
/**
|
|
1266
1268
|
Number of running items (no longer in the queue).
|
|
1267
1269
|
*/
|
|
1268
1270
|
get pending() {
|
|
1269
|
-
return
|
|
1271
|
+
return _chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _pending);
|
|
1270
1272
|
}
|
|
1271
1273
|
/**
|
|
1272
1274
|
Whether the queue is currently paused.
|
|
1273
1275
|
*/
|
|
1274
1276
|
get isPaused() {
|
|
1275
|
-
return
|
|
1277
|
+
return _chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _isPaused);
|
|
1276
1278
|
}
|
|
1277
1279
|
};
|
|
1278
1280
|
_carryoverConcurrencyCount = new WeakMap();
|
|
@@ -1291,35 +1293,35 @@ _isPaused = new WeakMap();
|
|
|
1291
1293
|
_throwOnTimeout = new WeakMap();
|
|
1292
1294
|
_doesIntervalAllowAnother = new WeakSet();
|
|
1293
1295
|
doesIntervalAllowAnother_get = function() {
|
|
1294
|
-
return
|
|
1296
|
+
return _chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _isIntervalIgnored) || _chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _intervalCount) < _chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _intervalCap);
|
|
1295
1297
|
};
|
|
1296
1298
|
_doesConcurrentAllowAnother = new WeakSet();
|
|
1297
1299
|
doesConcurrentAllowAnother_get = function() {
|
|
1298
|
-
return
|
|
1300
|
+
return _chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _pending) < _chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _concurrency);
|
|
1299
1301
|
};
|
|
1300
1302
|
_next = new WeakSet();
|
|
1301
1303
|
next_fn = function() {
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
+
_chunk4TB6NGOCcjs.__privateWrapper.call(void 0, this, _pending)._--;
|
|
1305
|
+
_chunk4TB6NGOCcjs.__privateMethod.call(void 0, this, _tryToStartAnother, tryToStartAnother_fn).call(this);
|
|
1304
1306
|
this.emit("next");
|
|
1305
1307
|
};
|
|
1306
1308
|
_onResumeInterval = new WeakSet();
|
|
1307
1309
|
onResumeInterval_fn = function() {
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1310
|
+
_chunk4TB6NGOCcjs.__privateMethod.call(void 0, this, _onInterval, onInterval_fn).call(this);
|
|
1311
|
+
_chunk4TB6NGOCcjs.__privateMethod.call(void 0, this, _initializeIntervalIfNeeded, initializeIntervalIfNeeded_fn).call(this);
|
|
1312
|
+
_chunk4TB6NGOCcjs.__privateSet.call(void 0, this, _timeoutId, void 0);
|
|
1311
1313
|
};
|
|
1312
1314
|
_isIntervalPaused = new WeakSet();
|
|
1313
1315
|
isIntervalPaused_get = function() {
|
|
1314
1316
|
const now = Date.now();
|
|
1315
|
-
if (
|
|
1316
|
-
const delay =
|
|
1317
|
+
if (_chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _intervalId) === void 0) {
|
|
1318
|
+
const delay = _chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _intervalEnd) - now;
|
|
1317
1319
|
if (delay < 0) {
|
|
1318
|
-
|
|
1320
|
+
_chunk4TB6NGOCcjs.__privateSet.call(void 0, this, _intervalCount, _chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _carryoverConcurrencyCount) ? _chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _pending) : 0);
|
|
1319
1321
|
} else {
|
|
1320
|
-
if (
|
|
1321
|
-
|
|
1322
|
-
|
|
1322
|
+
if (_chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _timeoutId) === void 0) {
|
|
1323
|
+
_chunk4TB6NGOCcjs.__privateSet.call(void 0, this, _timeoutId, setTimeout(() => {
|
|
1324
|
+
_chunk4TB6NGOCcjs.__privateMethod.call(void 0, this, _onResumeInterval, onResumeInterval_fn).call(this);
|
|
1323
1325
|
}, delay));
|
|
1324
1326
|
}
|
|
1325
1327
|
return true;
|
|
@@ -1329,28 +1331,28 @@ isIntervalPaused_get = function() {
|
|
|
1329
1331
|
};
|
|
1330
1332
|
_tryToStartAnother = new WeakSet();
|
|
1331
1333
|
tryToStartAnother_fn = function() {
|
|
1332
|
-
if (
|
|
1333
|
-
if (
|
|
1334
|
-
clearInterval(
|
|
1334
|
+
if (_chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _queue2).size === 0) {
|
|
1335
|
+
if (_chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _intervalId)) {
|
|
1336
|
+
clearInterval(_chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _intervalId));
|
|
1335
1337
|
}
|
|
1336
|
-
|
|
1338
|
+
_chunk4TB6NGOCcjs.__privateSet.call(void 0, this, _intervalId, void 0);
|
|
1337
1339
|
this.emit("empty");
|
|
1338
|
-
if (
|
|
1340
|
+
if (_chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _pending) === 0) {
|
|
1339
1341
|
this.emit("idle");
|
|
1340
1342
|
}
|
|
1341
1343
|
return false;
|
|
1342
1344
|
}
|
|
1343
|
-
if (!
|
|
1344
|
-
const canInitializeInterval = !
|
|
1345
|
-
if (
|
|
1346
|
-
const job =
|
|
1345
|
+
if (!_chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _isPaused)) {
|
|
1346
|
+
const canInitializeInterval = !_chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _isIntervalPaused, isIntervalPaused_get);
|
|
1347
|
+
if (_chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _doesIntervalAllowAnother, doesIntervalAllowAnother_get) && _chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _doesConcurrentAllowAnother, doesConcurrentAllowAnother_get)) {
|
|
1348
|
+
const job = _chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _queue2).dequeue();
|
|
1347
1349
|
if (!job) {
|
|
1348
1350
|
return false;
|
|
1349
1351
|
}
|
|
1350
1352
|
this.emit("active");
|
|
1351
1353
|
job();
|
|
1352
1354
|
if (canInitializeInterval) {
|
|
1353
|
-
|
|
1355
|
+
_chunk4TB6NGOCcjs.__privateMethod.call(void 0, this, _initializeIntervalIfNeeded, initializeIntervalIfNeeded_fn).call(this);
|
|
1354
1356
|
}
|
|
1355
1357
|
return true;
|
|
1356
1358
|
}
|
|
@@ -1359,26 +1361,26 @@ tryToStartAnother_fn = function() {
|
|
|
1359
1361
|
};
|
|
1360
1362
|
_initializeIntervalIfNeeded = new WeakSet();
|
|
1361
1363
|
initializeIntervalIfNeeded_fn = function() {
|
|
1362
|
-
if (
|
|
1364
|
+
if (_chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _isIntervalIgnored) || _chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _intervalId) !== void 0) {
|
|
1363
1365
|
return;
|
|
1364
1366
|
}
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
},
|
|
1368
|
-
|
|
1367
|
+
_chunk4TB6NGOCcjs.__privateSet.call(void 0, this, _intervalId, setInterval(() => {
|
|
1368
|
+
_chunk4TB6NGOCcjs.__privateMethod.call(void 0, this, _onInterval, onInterval_fn).call(this);
|
|
1369
|
+
}, _chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _interval)));
|
|
1370
|
+
_chunk4TB6NGOCcjs.__privateSet.call(void 0, this, _intervalEnd, Date.now() + _chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _interval));
|
|
1369
1371
|
};
|
|
1370
1372
|
_onInterval = new WeakSet();
|
|
1371
1373
|
onInterval_fn = function() {
|
|
1372
|
-
if (
|
|
1373
|
-
clearInterval(
|
|
1374
|
-
|
|
1374
|
+
if (_chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _intervalCount) === 0 && _chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _pending) === 0 && _chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _intervalId)) {
|
|
1375
|
+
clearInterval(_chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _intervalId));
|
|
1376
|
+
_chunk4TB6NGOCcjs.__privateSet.call(void 0, this, _intervalId, void 0);
|
|
1375
1377
|
}
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
+
_chunk4TB6NGOCcjs.__privateSet.call(void 0, this, _intervalCount, _chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _carryoverConcurrencyCount) ? _chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _pending) : 0);
|
|
1379
|
+
_chunk4TB6NGOCcjs.__privateMethod.call(void 0, this, _processQueue, processQueue_fn).call(this);
|
|
1378
1380
|
};
|
|
1379
1381
|
_processQueue = new WeakSet();
|
|
1380
1382
|
processQueue_fn = function() {
|
|
1381
|
-
while (
|
|
1383
|
+
while (_chunk4TB6NGOCcjs.__privateMethod.call(void 0, this, _tryToStartAnother, tryToStartAnother_fn).call(this)) {
|
|
1382
1384
|
}
|
|
1383
1385
|
};
|
|
1384
1386
|
_throwOnAbort = new WeakSet();
|
|
@@ -1404,12 +1406,12 @@ onEvent_fn = async function(event, filter) {
|
|
|
1404
1406
|
};
|
|
1405
1407
|
|
|
1406
1408
|
// src/BarrelManager.ts
|
|
1407
|
-
|
|
1409
|
+
_chunk4TB6NGOCcjs.init_cjs_shims.call(void 0, );
|
|
1408
1410
|
|
|
1409
1411
|
|
|
1410
1412
|
|
|
1411
1413
|
// src/utils/TreeNode.ts
|
|
1412
|
-
|
|
1414
|
+
_chunk4TB6NGOCcjs.init_cjs_shims.call(void 0, );
|
|
1413
1415
|
var _directorytree = require('directory-tree'); var _directorytree2 = _interopRequireDefault(_directorytree);
|
|
1414
1416
|
var TreeNode = class _TreeNode {
|
|
1415
1417
|
constructor(data, parent) {
|
|
@@ -1501,8 +1503,8 @@ var TreeNode = class _TreeNode {
|
|
|
1501
1503
|
var _options;
|
|
1502
1504
|
var BarrelManager = class {
|
|
1503
1505
|
constructor(options = {}) {
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
+
_chunk4TB6NGOCcjs.__privateAdd.call(void 0, this, _options, void 0);
|
|
1507
|
+
_chunk4TB6NGOCcjs.__privateSet.call(void 0, this, _options, options);
|
|
1506
1508
|
return this;
|
|
1507
1509
|
}
|
|
1508
1510
|
getNamedExport(root, item) {
|
|
@@ -1536,7 +1538,7 @@ var BarrelManager = class {
|
|
|
1536
1538
|
}), 'access', _28 => _28.flat, 'call', _29 => _29()]);
|
|
1537
1539
|
}
|
|
1538
1540
|
getIndexes(root) {
|
|
1539
|
-
const { treeNode = {}, isTypeOnly, extName } =
|
|
1541
|
+
const { treeNode = {}, isTypeOnly, extName } = _chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _options);
|
|
1540
1542
|
const tree = TreeNode.build(root, treeNode);
|
|
1541
1543
|
if (!tree) {
|
|
1542
1544
|
return null;
|
|
@@ -1548,7 +1550,7 @@ var BarrelManager = class {
|
|
|
1548
1550
|
if (treeNode2.children.length > 1) {
|
|
1549
1551
|
const indexPath = _path2.default.resolve(treeNode2.data.path, "index.ts");
|
|
1550
1552
|
const exports = treeNode2.children.filter(Boolean).map((file) => {
|
|
1551
|
-
const importPath = file.data.type === "directory" ? `./${file.data.name}/index` : `./${
|
|
1553
|
+
const importPath = file.data.type === "directory" ? `./${file.data.name}/index` : `./${_chunkKOQSM5X7cjs.trimExtName.call(void 0, file.data.name)}`;
|
|
1552
1554
|
if (importPath.endsWith("index") && file.data.type === "file") {
|
|
1553
1555
|
return void 0;
|
|
1554
1556
|
}
|
|
@@ -1566,7 +1568,7 @@ var BarrelManager = class {
|
|
|
1566
1568
|
} else if (treeNode2.children.length === 1) {
|
|
1567
1569
|
const [treeNodeChild] = treeNode2.children;
|
|
1568
1570
|
const indexPath = _path2.default.resolve(treeNode2.data.path, "index.ts");
|
|
1569
|
-
const importPath = treeNodeChild.data.type === "directory" ? `./${treeNodeChild.data.name}/index` : `./${
|
|
1571
|
+
const importPath = treeNodeChild.data.type === "directory" ? `./${treeNodeChild.data.name}/index` : `./${_chunkKOQSM5X7cjs.trimExtName.call(void 0, treeNodeChild.data.name)}`;
|
|
1570
1572
|
const exports = [
|
|
1571
1573
|
{
|
|
1572
1574
|
path: extName ? `${importPath}${extName}` : importPath,
|
|
@@ -1597,31 +1599,31 @@ var KubbFile;
|
|
|
1597
1599
|
var _cache, _task, _queue3, _add, add_fn, _addOrAppend, addOrAppend_fn;
|
|
1598
1600
|
var _FileManager = class _FileManager {
|
|
1599
1601
|
constructor({ task = async (file) => file, queue = new PQueue() } = {}) {
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1602
|
+
_chunk4TB6NGOCcjs.__privateAdd.call(void 0, this, _add);
|
|
1603
|
+
_chunk4TB6NGOCcjs.__privateAdd.call(void 0, this, _addOrAppend);
|
|
1604
|
+
_chunk4TB6NGOCcjs.__privateAdd.call(void 0, this, _cache, /* @__PURE__ */ new Map());
|
|
1605
|
+
_chunk4TB6NGOCcjs.__privateAdd.call(void 0, this, _task, void 0);
|
|
1606
|
+
_chunk4TB6NGOCcjs.__privateAdd.call(void 0, this, _queue3, void 0);
|
|
1607
|
+
_chunk4TB6NGOCcjs.__privateSet.call(void 0, this, _task, task);
|
|
1608
|
+
_chunk4TB6NGOCcjs.__privateSet.call(void 0, this, _queue3, queue);
|
|
1607
1609
|
return this;
|
|
1608
1610
|
}
|
|
1609
1611
|
get files() {
|
|
1610
1612
|
const files = [];
|
|
1611
|
-
|
|
1613
|
+
_chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _cache).forEach((item) => {
|
|
1612
1614
|
files.push(...item.flat(1));
|
|
1613
1615
|
});
|
|
1614
1616
|
return files;
|
|
1615
1617
|
}
|
|
1616
1618
|
get isExecuting() {
|
|
1617
|
-
return
|
|
1619
|
+
return _chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _queue3).size !== 0 && _chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _queue3).pending !== 0;
|
|
1618
1620
|
}
|
|
1619
1621
|
async add(...files) {
|
|
1620
1622
|
const promises = combineFiles(files).map((file) => {
|
|
1621
1623
|
if (file.override) {
|
|
1622
|
-
return
|
|
1624
|
+
return _chunk4TB6NGOCcjs.__privateMethod.call(void 0, this, _add, add_fn).call(this, file);
|
|
1623
1625
|
}
|
|
1624
|
-
return
|
|
1626
|
+
return _chunk4TB6NGOCcjs.__privateMethod.call(void 0, this, _addOrAppend, addOrAppend_fn).call(this, file);
|
|
1625
1627
|
});
|
|
1626
1628
|
const resolvedFiles = await Promise.all(promises);
|
|
1627
1629
|
if (files.length > 1) {
|
|
@@ -1635,7 +1637,7 @@ var _FileManager = class _FileManager {
|
|
|
1635
1637
|
return void 0;
|
|
1636
1638
|
}
|
|
1637
1639
|
const pathToBuildFrom = _path.resolve.call(void 0, root, output.path);
|
|
1638
|
-
const exportPath = output.path.startsWith("./") ?
|
|
1640
|
+
const exportPath = output.path.startsWith("./") ? _chunkKOQSM5X7cjs.trimExtName.call(void 0, output.path) : `./${_chunkKOQSM5X7cjs.trimExtName.call(void 0, output.path)}`;
|
|
1639
1641
|
const mode = _FileManager.getMode(output.path);
|
|
1640
1642
|
const barrelManager = new BarrelManager({ extName: output.extName, ...options });
|
|
1641
1643
|
let files = barrelManager.getIndexes(pathToBuildFrom);
|
|
@@ -1655,7 +1657,7 @@ var _FileManager = class _FileManager {
|
|
|
1655
1657
|
}
|
|
1656
1658
|
await Promise.all(
|
|
1657
1659
|
files.map((file) => {
|
|
1658
|
-
return
|
|
1660
|
+
return _chunk4TB6NGOCcjs.__privateMethod.call(void 0, this, _addOrAppend, addOrAppend_fn).call(this, {
|
|
1659
1661
|
...file,
|
|
1660
1662
|
meta: meta ? meta : file.meta
|
|
1661
1663
|
});
|
|
@@ -1681,33 +1683,33 @@ var _FileManager = class _FileManager {
|
|
|
1681
1683
|
if (exportType === "barrelNamed" && !output.exportAs && _optionalChain([rootFile, 'access', _30 => _30.exports, 'optionalAccess', _31 => _31[0]])) {
|
|
1682
1684
|
rootFile.exports = barrelManager.getNamedExport(root, rootFile.exports[0]);
|
|
1683
1685
|
}
|
|
1684
|
-
await
|
|
1686
|
+
await _chunk4TB6NGOCcjs.__privateMethod.call(void 0, this, _addOrAppend, addOrAppend_fn).call(this, {
|
|
1685
1687
|
...rootFile,
|
|
1686
1688
|
meta: meta ? meta : rootFile.meta
|
|
1687
1689
|
});
|
|
1688
1690
|
}
|
|
1689
1691
|
getCacheByUUID(UUID) {
|
|
1690
1692
|
let cache;
|
|
1691
|
-
|
|
1693
|
+
_chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _cache).forEach((files) => {
|
|
1692
1694
|
cache = files.find((item) => item.id === UUID);
|
|
1693
1695
|
});
|
|
1694
1696
|
return cache;
|
|
1695
1697
|
}
|
|
1696
1698
|
get(path3) {
|
|
1697
|
-
return
|
|
1699
|
+
return _chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _cache).get(path3);
|
|
1698
1700
|
}
|
|
1699
1701
|
remove(path3) {
|
|
1700
1702
|
const cacheItem = this.get(path3);
|
|
1701
1703
|
if (!cacheItem) {
|
|
1702
1704
|
return;
|
|
1703
1705
|
}
|
|
1704
|
-
|
|
1706
|
+
_chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _cache).delete(path3);
|
|
1705
1707
|
}
|
|
1706
1708
|
async write(...params) {
|
|
1707
|
-
return
|
|
1709
|
+
return _chunkTJHTFTXAcjs.write.call(void 0, ...params);
|
|
1708
1710
|
}
|
|
1709
1711
|
async read(...params) {
|
|
1710
|
-
return
|
|
1712
|
+
return _chunkWAIHMG76cjs.read.call(void 0, ...params);
|
|
1711
1713
|
}
|
|
1712
1714
|
// statics
|
|
1713
1715
|
static getSource(file) {
|
|
@@ -1735,23 +1737,23 @@ _queue3 = new WeakMap();
|
|
|
1735
1737
|
_add = new WeakSet();
|
|
1736
1738
|
add_fn = async function(file) {
|
|
1737
1739
|
const controller = new AbortController();
|
|
1738
|
-
const resolvedFile = { id: _crypto2.default.randomUUID(), name:
|
|
1739
|
-
|
|
1740
|
-
return
|
|
1740
|
+
const resolvedFile = { id: _crypto2.default.randomUUID(), name: _chunkKOQSM5X7cjs.trimExtName.call(void 0, file.baseName), ...file };
|
|
1741
|
+
_chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _cache).set(resolvedFile.path, [{ cancel: () => controller.abort(), ...resolvedFile }]);
|
|
1742
|
+
return _chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _queue3).add(
|
|
1741
1743
|
async () => {
|
|
1742
1744
|
var _a;
|
|
1743
|
-
return (_a =
|
|
1745
|
+
return (_a = _chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _task)) == null ? void 0 : _a.call(this, resolvedFile);
|
|
1744
1746
|
},
|
|
1745
1747
|
{ signal: controller.signal }
|
|
1746
1748
|
);
|
|
1747
1749
|
};
|
|
1748
1750
|
_addOrAppend = new WeakSet();
|
|
1749
1751
|
addOrAppend_fn = async function(file) {
|
|
1750
|
-
const previousCaches =
|
|
1752
|
+
const previousCaches = _chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _cache).get(file.path);
|
|
1751
1753
|
const previousCache = previousCaches ? previousCaches.at(previousCaches.length - 1) : void 0;
|
|
1752
1754
|
if (previousCache) {
|
|
1753
|
-
|
|
1754
|
-
return
|
|
1755
|
+
_chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _cache).delete(previousCache.path);
|
|
1756
|
+
return _chunk4TB6NGOCcjs.__privateMethod.call(void 0, this, _add, add_fn).call(this, {
|
|
1755
1757
|
...file,
|
|
1756
1758
|
source: previousCache.source && file.source ? `${previousCache.source}
|
|
1757
1759
|
${file.source}` : "",
|
|
@@ -1760,7 +1762,7 @@ ${file.source}` : "",
|
|
|
1760
1762
|
env: { ...previousCache.env || {}, ...file.env || {} }
|
|
1761
1763
|
});
|
|
1762
1764
|
}
|
|
1763
|
-
return
|
|
1765
|
+
return _chunk4TB6NGOCcjs.__privateMethod.call(void 0, this, _add, add_fn).call(this, file);
|
|
1764
1766
|
};
|
|
1765
1767
|
var FileManager = _FileManager;
|
|
1766
1768
|
function combineFiles(files) {
|
|
@@ -1798,11 +1800,11 @@ function getSource(file) {
|
|
|
1798
1800
|
const exports = file.exports ? combineExports(file.exports) : [];
|
|
1799
1801
|
const imports = file.imports && file.source ? combineImports(file.imports, exports, file.source) : [];
|
|
1800
1802
|
const importNodes = imports.filter((item) => {
|
|
1801
|
-
return item.path !==
|
|
1803
|
+
return item.path !== _chunkKOQSM5X7cjs.trimExtName.call(void 0, file.path);
|
|
1802
1804
|
}).map((item) => {
|
|
1803
1805
|
return factory.createImportDeclaration({
|
|
1804
1806
|
name: item.name,
|
|
1805
|
-
path: item.root ?
|
|
1807
|
+
path: item.root ? _chunkWAIHMG76cjs.getRelativePath.call(void 0, item.root, item.path) : item.path,
|
|
1806
1808
|
isTypeOnly: item.isTypeOnly
|
|
1807
1809
|
});
|
|
1808
1810
|
});
|
|
@@ -1818,7 +1820,7 @@ function getSource(file) {
|
|
|
1818
1820
|
return _parser.print.call(void 0, [], { source, noEmitHelpers: false });
|
|
1819
1821
|
}
|
|
1820
1822
|
function combineExports(exports) {
|
|
1821
|
-
const combinedExports =
|
|
1823
|
+
const combinedExports = _chunkDOELQNBOcjs.orderBy.call(void 0, exports, [(v) => !v.isTypeOnly], ["asc"]).reduce((prev, curr) => {
|
|
1822
1824
|
const name = curr.name;
|
|
1823
1825
|
const prevByPath = prev.findLast((imp) => imp.path === curr.path);
|
|
1824
1826
|
const prevByPathAndIsTypeOnly = prev.findLast((imp) => imp.path === curr.path && (0, import_lodash.default)(imp.name, name) && imp.isTypeOnly);
|
|
@@ -1846,10 +1848,10 @@ function combineExports(exports) {
|
|
|
1846
1848
|
}
|
|
1847
1849
|
return [...prev, curr];
|
|
1848
1850
|
}, []);
|
|
1849
|
-
return
|
|
1851
|
+
return _chunkDOELQNBOcjs.orderBy.call(void 0, combinedExports, [(v) => !v.isTypeOnly, (v) => v.asAlias], ["desc", "desc"]);
|
|
1850
1852
|
}
|
|
1851
1853
|
function combineImports(imports, exports, source) {
|
|
1852
|
-
const combinedImports =
|
|
1854
|
+
const combinedImports = _chunkDOELQNBOcjs.orderBy.call(void 0, imports, [(v) => !v.isTypeOnly], ["asc"]).reduce((prev, curr) => {
|
|
1853
1855
|
let name = Array.isArray(curr.name) ? [...new Set(curr.name)] : curr.name;
|
|
1854
1856
|
const hasImportInSource = (importName) => {
|
|
1855
1857
|
if (!source) {
|
|
@@ -1888,7 +1890,7 @@ function combineImports(imports, exports, source) {
|
|
|
1888
1890
|
}
|
|
1889
1891
|
return [...prev, curr];
|
|
1890
1892
|
}, []);
|
|
1891
|
-
return
|
|
1893
|
+
return _chunkDOELQNBOcjs.orderBy.call(void 0, combinedImports, [(v) => !v.isTypeOnly], ["desc"]);
|
|
1892
1894
|
}
|
|
1893
1895
|
function getEnvSource(source, env) {
|
|
1894
1896
|
if (!env) {
|
|
@@ -1905,8 +1907,8 @@ function getEnvSource(source, env) {
|
|
|
1905
1907
|
throw new TypeError(`Environment should be in upperCase for ${key}`);
|
|
1906
1908
|
}
|
|
1907
1909
|
if (typeof replaceBy === "string") {
|
|
1908
|
-
prev =
|
|
1909
|
-
prev =
|
|
1910
|
+
prev = _chunkKOQSM5X7cjs.searchAndReplace.call(void 0, { text: prev.replaceAll(`process.env.${key}`, replaceBy), replaceBy, prefix: "process.env", key });
|
|
1911
|
+
prev = _chunkKOQSM5X7cjs.searchAndReplace.call(void 0, { text: prev.replaceAll(new RegExp(`(declare const).*
|
|
1910
1912
|
`, "ig"), ""), replaceBy, key });
|
|
1911
1913
|
}
|
|
1912
1914
|
return prev;
|
|
@@ -1914,7 +1916,7 @@ function getEnvSource(source, env) {
|
|
|
1914
1916
|
}
|
|
1915
1917
|
|
|
1916
1918
|
// src/errors.ts
|
|
1917
|
-
|
|
1919
|
+
_chunk4TB6NGOCcjs.init_cjs_shims.call(void 0, );
|
|
1918
1920
|
var Warning = class extends Error {
|
|
1919
1921
|
constructor(message, options) {
|
|
1920
1922
|
super(message, { cause: _optionalChain([options, 'optionalAccess', _37 => _37.cause]) });
|
|
@@ -1925,11 +1927,11 @@ var ValidationPluginError = class extends Error {
|
|
|
1925
1927
|
};
|
|
1926
1928
|
|
|
1927
1929
|
// src/plugin.ts
|
|
1928
|
-
|
|
1930
|
+
_chunk4TB6NGOCcjs.init_cjs_shims.call(void 0, );
|
|
1929
1931
|
|
|
1930
1932
|
|
|
1931
1933
|
// src/utils/cache.ts
|
|
1932
|
-
|
|
1934
|
+
_chunk4TB6NGOCcjs.init_cjs_shims.call(void 0, );
|
|
1933
1935
|
function createPluginCache(Store = /* @__PURE__ */ Object.create(null)) {
|
|
1934
1936
|
return {
|
|
1935
1937
|
set(id, value) {
|
|
@@ -2007,10 +2009,10 @@ var definePlugin = createPlugin((options) => {
|
|
|
2007
2009
|
});
|
|
2008
2010
|
|
|
2009
2011
|
// src/PromiseManager.ts
|
|
2010
|
-
|
|
2012
|
+
_chunk4TB6NGOCcjs.init_cjs_shims.call(void 0, );
|
|
2011
2013
|
|
|
2012
2014
|
// src/utils/executeStrategies.ts
|
|
2013
|
-
|
|
2015
|
+
_chunk4TB6NGOCcjs.init_cjs_shims.call(void 0, );
|
|
2014
2016
|
function hookSeq(promises) {
|
|
2015
2017
|
return promises.filter(Boolean).reduce(
|
|
2016
2018
|
(promise, func) => {
|
|
@@ -2048,8 +2050,8 @@ function hookParallel(promises) {
|
|
|
2048
2050
|
var _options2;
|
|
2049
2051
|
var PromiseManager = class {
|
|
2050
2052
|
constructor(options = {}) {
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
+
_chunk4TB6NGOCcjs.__privateAdd.call(void 0, this, _options2, {});
|
|
2054
|
+
_chunk4TB6NGOCcjs.__privateSet.call(void 0, this, _options2, options);
|
|
2053
2055
|
return this;
|
|
2054
2056
|
}
|
|
2055
2057
|
run(strategy, promises) {
|
|
@@ -2057,7 +2059,7 @@ var PromiseManager = class {
|
|
|
2057
2059
|
return hookSeq(promises);
|
|
2058
2060
|
}
|
|
2059
2061
|
if (strategy === "first") {
|
|
2060
|
-
return hookFirst(promises,
|
|
2062
|
+
return hookFirst(promises, _chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _options2).nullCheck);
|
|
2061
2063
|
}
|
|
2062
2064
|
if (strategy === "parallel") {
|
|
2063
2065
|
return hookParallel(promises);
|
|
@@ -2074,12 +2076,12 @@ function isPromiseRejectedResult(result) {
|
|
|
2074
2076
|
}
|
|
2075
2077
|
|
|
2076
2078
|
// src/PluginManager.ts
|
|
2077
|
-
|
|
2079
|
+
_chunk4TB6NGOCcjs.init_cjs_shims.call(void 0, );
|
|
2078
2080
|
var _core, _usedPluginNames, _promiseManager, _getSortedPlugins, getSortedPlugins_fn, _addExecutedToCallStack, addExecutedToCallStack_fn, _execute, execute_fn, _executeSync, executeSync_fn, _catcher, catcher_fn, _parse, parse_fn;
|
|
2079
2081
|
var PluginManager = class {
|
|
2080
2082
|
constructor(config, options) {
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
+
_chunk4TB6NGOCcjs.__privateAdd.call(void 0, this, _getSortedPlugins);
|
|
2084
|
+
_chunk4TB6NGOCcjs.__privateAdd.call(void 0, this, _addExecutedToCallStack);
|
|
2083
2085
|
/**
|
|
2084
2086
|
* Run an async plugin hook and return the result.
|
|
2085
2087
|
* @param hookName Name of the plugin hook. Must be either in `PluginHooks` or `OutputPluginValueHooks`.
|
|
@@ -2087,7 +2089,7 @@ var PluginManager = class {
|
|
|
2087
2089
|
* @param plugin The actual pluginObject to run.
|
|
2088
2090
|
*/
|
|
2089
2091
|
// Implementation signature
|
|
2090
|
-
|
|
2092
|
+
_chunk4TB6NGOCcjs.__privateAdd.call(void 0, this, _execute);
|
|
2091
2093
|
/**
|
|
2092
2094
|
* Run a sync plugin hook and return the result.
|
|
2093
2095
|
* @param hookName Name of the plugin hook. Must be in `PluginHooks`.
|
|
@@ -2095,14 +2097,14 @@ var PluginManager = class {
|
|
|
2095
2097
|
* @param plugin The acutal plugin
|
|
2096
2098
|
* @param replaceContext When passed, the plugin context can be overridden.
|
|
2097
2099
|
*/
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
this.events = new (0,
|
|
2100
|
+
_chunk4TB6NGOCcjs.__privateAdd.call(void 0, this, _executeSync);
|
|
2101
|
+
_chunk4TB6NGOCcjs.__privateAdd.call(void 0, this, _catcher);
|
|
2102
|
+
_chunk4TB6NGOCcjs.__privateAdd.call(void 0, this, _parse);
|
|
2103
|
+
this.events = new (0, _chunkJDIEEDDBcjs.EventEmitter)();
|
|
2102
2104
|
this.executed = [];
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2105
|
+
_chunk4TB6NGOCcjs.__privateAdd.call(void 0, this, _core, void 0);
|
|
2106
|
+
_chunk4TB6NGOCcjs.__privateAdd.call(void 0, this, _usedPluginNames, {});
|
|
2107
|
+
_chunk4TB6NGOCcjs.__privateAdd.call(void 0, this, _promiseManager, void 0);
|
|
2106
2108
|
this.resolvePath = (params) => {
|
|
2107
2109
|
if (params.pluginKey) {
|
|
2108
2110
|
const paths = this.hookForPluginSync({
|
|
@@ -2110,7 +2112,7 @@ var PluginManager = class {
|
|
|
2110
2112
|
hookName: "resolvePath",
|
|
2111
2113
|
parameters: [params.baseName, params.mode, params.options]
|
|
2112
2114
|
});
|
|
2113
|
-
if (paths && _optionalChain([paths, 'optionalAccess', _39 => _39.length]) > 1 && this.logger.logLevel ===
|
|
2115
|
+
if (paths && _optionalChain([paths, 'optionalAccess', _39 => _39.length]) > 1 && this.logger.logLevel === _chunkJDIEEDDBcjs.LogLevel.debug) {
|
|
2114
2116
|
this.logger.emit("debug", [
|
|
2115
2117
|
`Cannot return a path where the 'pluginKey' ${params.pluginKey ? JSON.stringify(params.pluginKey) : '"'} is not unique enough
|
|
2116
2118
|
|
|
@@ -2134,7 +2136,7 @@ Falling back on the first item.
|
|
|
2134
2136
|
hookName: "resolveName",
|
|
2135
2137
|
parameters: [params.name, params.type]
|
|
2136
2138
|
});
|
|
2137
|
-
if (names && _optionalChain([names, 'optionalAccess', _42 => _42.length]) > 1 && this.logger.logLevel ===
|
|
2139
|
+
if (names && _optionalChain([names, 'optionalAccess', _42 => _42.length]) > 1 && this.logger.logLevel === _chunkJDIEEDDBcjs.LogLevel.debug) {
|
|
2138
2140
|
this.logger.emit("debug", [
|
|
2139
2141
|
`Cannot return a name where the 'pluginKey' ${params.pluginKey ? JSON.stringify(params.pluginKey) : '"'} is not unique enough
|
|
2140
2142
|
|
|
@@ -2144,19 +2146,19 @@ Falling back on the first item.
|
|
|
2144
2146
|
`
|
|
2145
2147
|
]);
|
|
2146
2148
|
}
|
|
2147
|
-
return
|
|
2149
|
+
return _chunkKOQSM5X7cjs.transformReservedWord.call(void 0, _optionalChain([names, 'optionalAccess', _43 => _43.at, 'call', _44 => _44(0)]) || params.name);
|
|
2148
2150
|
}
|
|
2149
2151
|
const name = this.hookFirstSync({
|
|
2150
2152
|
hookName: "resolveName",
|
|
2151
2153
|
parameters: [params.name, params.type]
|
|
2152
2154
|
}).result;
|
|
2153
|
-
return
|
|
2155
|
+
return _chunkKOQSM5X7cjs.transformReservedWord.call(void 0, name);
|
|
2154
2156
|
};
|
|
2155
2157
|
this.config = config;
|
|
2156
2158
|
this.logger = options.logger;
|
|
2157
2159
|
this.queue = new PQueue({ concurrency: 1 });
|
|
2158
2160
|
this.fileManager = new FileManager({ task: options.task, queue: this.queue });
|
|
2159
|
-
|
|
2161
|
+
_chunk4TB6NGOCcjs.__privateSet.call(void 0, this, _promiseManager, new PromiseManager({ nullCheck: (state) => !!_optionalChain([state, 'optionalAccess', _45 => _45.result]) }));
|
|
2160
2162
|
const plugins = config.plugins || [];
|
|
2161
2163
|
const core = definePlugin({
|
|
2162
2164
|
config,
|
|
@@ -2165,11 +2167,11 @@ Falling back on the first item.
|
|
|
2165
2167
|
fileManager: this.fileManager,
|
|
2166
2168
|
resolvePath: this.resolvePath.bind(this),
|
|
2167
2169
|
resolveName: this.resolveName.bind(this),
|
|
2168
|
-
getPlugins:
|
|
2170
|
+
getPlugins: _chunk4TB6NGOCcjs.__privateMethod.call(void 0, this, _getSortedPlugins, getSortedPlugins_fn).bind(this)
|
|
2169
2171
|
});
|
|
2170
|
-
|
|
2171
|
-
this.plugins = [
|
|
2172
|
-
return
|
|
2172
|
+
_chunk4TB6NGOCcjs.__privateSet.call(void 0, this, _core, _chunk4TB6NGOCcjs.__privateMethod.call(void 0, this, _parse, parse_fn).call(this, core, this, core.api.call(null)));
|
|
2173
|
+
this.plugins = [_chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _core), ...plugins].map((plugin) => {
|
|
2174
|
+
return _chunk4TB6NGOCcjs.__privateMethod.call(void 0, this, _parse, parse_fn).call(this, plugin, this, _chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _core).api);
|
|
2173
2175
|
});
|
|
2174
2176
|
return this;
|
|
2175
2177
|
}
|
|
@@ -2181,7 +2183,7 @@ Falling back on the first item.
|
|
|
2181
2183
|
throw new Error(`Filepath should be defined for resolvedName "${name}" and pluginKey [${JSON.stringify(pluginKey)}]`);
|
|
2182
2184
|
}
|
|
2183
2185
|
try {
|
|
2184
|
-
source =
|
|
2186
|
+
source = _chunkWAIHMG76cjs.readSync.call(void 0, path3);
|
|
2185
2187
|
} catch (_e) {
|
|
2186
2188
|
}
|
|
2187
2189
|
return {
|
|
@@ -2209,7 +2211,7 @@ Falling back on the first item.
|
|
|
2209
2211
|
}) {
|
|
2210
2212
|
const plugins = this.getPluginsByKey(hookName, pluginKey);
|
|
2211
2213
|
const promises = plugins.map((plugin) => {
|
|
2212
|
-
return
|
|
2214
|
+
return _chunk4TB6NGOCcjs.__privateMethod.call(void 0, this, _execute, execute_fn).call(this, {
|
|
2213
2215
|
strategy: "hookFirst",
|
|
2214
2216
|
hookName,
|
|
2215
2217
|
parameters,
|
|
@@ -2228,7 +2230,7 @@ Falling back on the first item.
|
|
|
2228
2230
|
}) {
|
|
2229
2231
|
const plugins = this.getPluginsByKey(hookName, pluginKey);
|
|
2230
2232
|
return plugins.map((plugin) => {
|
|
2231
|
-
return
|
|
2233
|
+
return _chunk4TB6NGOCcjs.__privateMethod.call(void 0, this, _executeSync, executeSync_fn).call(this, {
|
|
2232
2234
|
strategy: "hookFirst",
|
|
2233
2235
|
hookName,
|
|
2234
2236
|
parameters,
|
|
@@ -2244,11 +2246,11 @@ Falling back on the first item.
|
|
|
2244
2246
|
parameters,
|
|
2245
2247
|
skipped
|
|
2246
2248
|
}) {
|
|
2247
|
-
const promises =
|
|
2249
|
+
const promises = _chunk4TB6NGOCcjs.__privateMethod.call(void 0, this, _getSortedPlugins, getSortedPlugins_fn).call(this).filter((plugin) => {
|
|
2248
2250
|
return skipped ? skipped.has(plugin) : true;
|
|
2249
2251
|
}).map((plugin) => {
|
|
2250
2252
|
return async () => {
|
|
2251
|
-
const value = await
|
|
2253
|
+
const value = await _chunk4TB6NGOCcjs.__privateMethod.call(void 0, this, _execute, execute_fn).call(this, {
|
|
2252
2254
|
strategy: "hookFirst",
|
|
2253
2255
|
hookName,
|
|
2254
2256
|
parameters,
|
|
@@ -2262,7 +2264,7 @@ Falling back on the first item.
|
|
|
2262
2264
|
);
|
|
2263
2265
|
};
|
|
2264
2266
|
});
|
|
2265
|
-
return
|
|
2267
|
+
return _chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _promiseManager).run("first", promises);
|
|
2266
2268
|
}
|
|
2267
2269
|
/**
|
|
2268
2270
|
* First non-null result stops and will return it's value.
|
|
@@ -2273,12 +2275,12 @@ Falling back on the first item.
|
|
|
2273
2275
|
skipped
|
|
2274
2276
|
}) {
|
|
2275
2277
|
let parseResult = null;
|
|
2276
|
-
for (const plugin of
|
|
2278
|
+
for (const plugin of _chunk4TB6NGOCcjs.__privateMethod.call(void 0, this, _getSortedPlugins, getSortedPlugins_fn).call(this)) {
|
|
2277
2279
|
if (skipped && skipped.has(plugin)) {
|
|
2278
2280
|
continue;
|
|
2279
2281
|
}
|
|
2280
2282
|
parseResult = {
|
|
2281
|
-
result:
|
|
2283
|
+
result: _chunk4TB6NGOCcjs.__privateMethod.call(void 0, this, _executeSync, executeSync_fn).call(this, {
|
|
2282
2284
|
strategy: "hookFirst",
|
|
2283
2285
|
hookName,
|
|
2284
2286
|
parameters,
|
|
@@ -2299,14 +2301,14 @@ Falling back on the first item.
|
|
|
2299
2301
|
hookName,
|
|
2300
2302
|
parameters
|
|
2301
2303
|
}) {
|
|
2302
|
-
const promises =
|
|
2303
|
-
return () =>
|
|
2304
|
+
const promises = _chunk4TB6NGOCcjs.__privateMethod.call(void 0, this, _getSortedPlugins, getSortedPlugins_fn).call(this).map((plugin) => {
|
|
2305
|
+
return () => _chunk4TB6NGOCcjs.__privateMethod.call(void 0, this, _execute, execute_fn).call(this, { strategy: "hookParallel", hookName, parameters, plugin });
|
|
2304
2306
|
});
|
|
2305
|
-
const results = await
|
|
2307
|
+
const results = await _chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _promiseManager).run("parallel", promises);
|
|
2306
2308
|
results.forEach((result, index) => {
|
|
2307
2309
|
if (isPromiseRejectedResult(result)) {
|
|
2308
|
-
const plugin =
|
|
2309
|
-
|
|
2310
|
+
const plugin = _chunk4TB6NGOCcjs.__privateMethod.call(void 0, this, _getSortedPlugins, getSortedPlugins_fn).call(this)[index];
|
|
2311
|
+
_chunk4TB6NGOCcjs.__privateMethod.call(void 0, this, _catcher, catcher_fn).call(this, result.reason, plugin, hookName);
|
|
2310
2312
|
}
|
|
2311
2313
|
});
|
|
2312
2314
|
return results.filter((result) => result.status === "fulfilled").map((result) => result.value);
|
|
@@ -2321,16 +2323,16 @@ Falling back on the first item.
|
|
|
2321
2323
|
}) {
|
|
2322
2324
|
const [argument0, ...rest] = parameters;
|
|
2323
2325
|
let promise = Promise.resolve(argument0);
|
|
2324
|
-
for (const plugin of
|
|
2326
|
+
for (const plugin of _chunk4TB6NGOCcjs.__privateMethod.call(void 0, this, _getSortedPlugins, getSortedPlugins_fn).call(this)) {
|
|
2325
2327
|
promise = promise.then((arg0) => {
|
|
2326
|
-
const value =
|
|
2328
|
+
const value = _chunk4TB6NGOCcjs.__privateMethod.call(void 0, this, _execute, execute_fn).call(this, {
|
|
2327
2329
|
strategy: "hookReduceArg0",
|
|
2328
2330
|
hookName,
|
|
2329
2331
|
parameters: [arg0, ...rest],
|
|
2330
2332
|
plugin
|
|
2331
2333
|
});
|
|
2332
2334
|
return value;
|
|
2333
|
-
}).then((result) => reduce.call(
|
|
2335
|
+
}).then((result) => reduce.call(_chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _core).api, argument0, result, plugin));
|
|
2334
2336
|
}
|
|
2335
2337
|
return promise;
|
|
2336
2338
|
}
|
|
@@ -2338,15 +2340,15 @@ Falling back on the first item.
|
|
|
2338
2340
|
* Chains plugins
|
|
2339
2341
|
*/
|
|
2340
2342
|
async hookSeq({ hookName, parameters }) {
|
|
2341
|
-
const promises =
|
|
2342
|
-
return () =>
|
|
2343
|
+
const promises = _chunk4TB6NGOCcjs.__privateMethod.call(void 0, this, _getSortedPlugins, getSortedPlugins_fn).call(this).map((plugin) => {
|
|
2344
|
+
return () => _chunk4TB6NGOCcjs.__privateMethod.call(void 0, this, _execute, execute_fn).call(this, {
|
|
2343
2345
|
strategy: "hookSeq",
|
|
2344
2346
|
hookName,
|
|
2345
2347
|
parameters,
|
|
2346
2348
|
plugin
|
|
2347
2349
|
});
|
|
2348
2350
|
});
|
|
2349
|
-
return
|
|
2351
|
+
return _chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _promiseManager).run("seq", promises);
|
|
2350
2352
|
}
|
|
2351
2353
|
getPluginsByKey(hookName, pluginKey) {
|
|
2352
2354
|
const plugins = [...this.plugins];
|
|
@@ -2362,7 +2364,7 @@ Falling back on the first item.
|
|
|
2362
2364
|
});
|
|
2363
2365
|
if (!_optionalChain([pluginByPluginName, 'optionalAccess', _51 => _51.length])) {
|
|
2364
2366
|
const corePlugin = plugins.find((plugin) => plugin.name === "core" && plugin[hookName]);
|
|
2365
|
-
if (this.logger.logLevel ===
|
|
2367
|
+
if (this.logger.logLevel === _chunkJDIEEDDBcjs.LogLevel.debug) {
|
|
2366
2368
|
if (corePlugin) {
|
|
2367
2369
|
this.logger.emit("debug", [`No hook '${hookName}' for pluginKey '${JSON.stringify(pluginKey)}' found, falling back on the '@kubb/core' plugin`]);
|
|
2368
2370
|
} else {
|
|
@@ -2400,7 +2402,7 @@ _getSortedPlugins = new WeakSet();
|
|
|
2400
2402
|
getSortedPlugins_fn = function(hookName) {
|
|
2401
2403
|
const plugins = [...this.plugins].filter((plugin) => plugin.name !== "core");
|
|
2402
2404
|
if (hookName) {
|
|
2403
|
-
if (this.logger.logLevel ===
|
|
2405
|
+
if (this.logger.logLevel === _chunkJDIEEDDBcjs.LogLevel.info) {
|
|
2404
2406
|
const containsHookName = plugins.some((item) => item[hookName]);
|
|
2405
2407
|
if (!containsHookName) {
|
|
2406
2408
|
this.logger.emit("warning", `No hook ${hookName} found`);
|
|
@@ -2448,7 +2450,7 @@ execute_fn = function({
|
|
|
2448
2450
|
this.events.emit("execute", { strategy, hookName, parameters, plugin });
|
|
2449
2451
|
const task = Promise.resolve().then(() => {
|
|
2450
2452
|
if (typeof hook === "function") {
|
|
2451
|
-
const possiblePromiseResult = hook.apply({ ...
|
|
2453
|
+
const possiblePromiseResult = hook.apply({ ..._chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _core).api, plugin }, parameters);
|
|
2452
2454
|
if (isPromise(possiblePromiseResult)) {
|
|
2453
2455
|
return Promise.resolve(possiblePromiseResult);
|
|
2454
2456
|
}
|
|
@@ -2457,7 +2459,7 @@ execute_fn = function({
|
|
|
2457
2459
|
return hook;
|
|
2458
2460
|
}).then((result) => {
|
|
2459
2461
|
output = result;
|
|
2460
|
-
|
|
2462
|
+
_chunk4TB6NGOCcjs.__privateMethod.call(void 0, this, _addExecutedToCallStack, addExecutedToCallStack_fn).call(this, {
|
|
2461
2463
|
parameters,
|
|
2462
2464
|
output,
|
|
2463
2465
|
strategy,
|
|
@@ -2466,7 +2468,7 @@ execute_fn = function({
|
|
|
2466
2468
|
});
|
|
2467
2469
|
return result;
|
|
2468
2470
|
}).catch((e) => {
|
|
2469
|
-
|
|
2471
|
+
_chunk4TB6NGOCcjs.__privateMethod.call(void 0, this, _catcher, catcher_fn).call(this, e, plugin, hookName);
|
|
2470
2472
|
return null;
|
|
2471
2473
|
});
|
|
2472
2474
|
return task;
|
|
@@ -2486,12 +2488,12 @@ executeSync_fn = function({
|
|
|
2486
2488
|
this.events.emit("execute", { strategy, hookName, parameters, plugin });
|
|
2487
2489
|
try {
|
|
2488
2490
|
if (typeof hook === "function") {
|
|
2489
|
-
const fn = hook.apply({ ...
|
|
2491
|
+
const fn = hook.apply({ ..._chunk4TB6NGOCcjs.__privateGet.call(void 0, this, _core).api, plugin }, parameters);
|
|
2490
2492
|
output = fn;
|
|
2491
2493
|
return fn;
|
|
2492
2494
|
}
|
|
2493
2495
|
output = hook;
|
|
2494
|
-
|
|
2496
|
+
_chunk4TB6NGOCcjs.__privateMethod.call(void 0, this, _addExecutedToCallStack, addExecutedToCallStack_fn).call(this, {
|
|
2495
2497
|
parameters,
|
|
2496
2498
|
output,
|
|
2497
2499
|
strategy,
|
|
@@ -2500,21 +2502,20 @@ executeSync_fn = function({
|
|
|
2500
2502
|
});
|
|
2501
2503
|
return hook;
|
|
2502
2504
|
} catch (e) {
|
|
2503
|
-
|
|
2505
|
+
_chunk4TB6NGOCcjs.__privateMethod.call(void 0, this, _catcher, catcher_fn).call(this, e, plugin, hookName);
|
|
2504
2506
|
return null;
|
|
2505
2507
|
}
|
|
2506
2508
|
};
|
|
2507
2509
|
_catcher = new WeakSet();
|
|
2508
|
-
catcher_fn = function(
|
|
2509
|
-
const text = `${
|
|
2510
|
-
|
|
2511
|
-
this.
|
|
2512
|
-
this.events.emit("error", e);
|
|
2510
|
+
catcher_fn = function(cause, plugin, hookName) {
|
|
2511
|
+
const text = `${cause.message} (plugin: ${_optionalChain([plugin, 'optionalAccess', _58 => _58.name]) || "unknown"}, hook: ${hookName || "unknown"})`;
|
|
2512
|
+
this.logger.emit("error", text, cause);
|
|
2513
|
+
this.events.emit("error", cause);
|
|
2513
2514
|
};
|
|
2514
2515
|
_parse = new WeakSet();
|
|
2515
2516
|
parse_fn = function(plugin, pluginManager, context) {
|
|
2516
|
-
const usedPluginNames =
|
|
2517
|
-
|
|
2517
|
+
const usedPluginNames = _chunk4TB6NGOCcjs.__privateGet.call(void 0, pluginManager, _usedPluginNames);
|
|
2518
|
+
_chunkUUBXTHJGcjs.setUniqueName.call(void 0, plugin.name, usedPluginNames);
|
|
2518
2519
|
const key = [plugin.name, usedPluginNames[plugin.name]].filter(Boolean);
|
|
2519
2520
|
if (!plugin.transform) {
|
|
2520
2521
|
plugin.transform = function transform(code) {
|
|
@@ -2545,4 +2546,4 @@ parse_fn = function(plugin, pluginManager, context) {
|
|
|
2545
2546
|
|
|
2546
2547
|
|
|
2547
2548
|
exports.KubbFile = KubbFile; exports.FileManager = FileManager; exports.Warning = Warning; exports.createPlugin = createPlugin; exports.pluginName = pluginName; exports.PromiseManager = PromiseManager; exports.isPromise = isPromise; exports.PluginManager = PluginManager;
|
|
2548
|
-
//# sourceMappingURL=chunk-
|
|
2549
|
+
//# sourceMappingURL=chunk-UIWHEBZA.cjs.map
|