@kubb/core 2.6.7 → 2.7.1
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-6453B5D6.js → chunk-77TYOFGF.js} +13 -5
- package/dist/chunk-77TYOFGF.js.map +1 -0
- package/dist/{chunk-VCS7BATE.js → chunk-AHK6WOW6.js} +10 -5
- package/dist/chunk-AHK6WOW6.js.map +1 -0
- package/dist/{chunk-AMVMOCJ4.cjs → chunk-AWUFUNOJ.cjs} +23 -22
- package/dist/{chunk-Q5OJPP57.js → chunk-BHNAGXM3.js} +59 -23
- package/dist/chunk-BHNAGXM3.js.map +1 -0
- package/dist/{chunk-M5H5RXTY.cjs → chunk-CUO3T7RA.cjs} +12 -9
- package/dist/{chunk-2JNTDAI2.cjs → chunk-DJLNT4KC.cjs} +17 -17
- package/dist/{chunk-2JNTDAI2.cjs.map → chunk-DJLNT4KC.cjs.map} +1 -1
- package/dist/chunk-EXBYWEC2.cjs +19 -0
- package/dist/{chunk-LVTR4JV4.cjs → chunk-FNHECX2X.cjs} +303 -298
- package/dist/chunk-FNHECX2X.cjs.map +1 -0
- package/dist/{chunk-WCUXF325.cjs → chunk-GNWOOGXA.cjs} +8 -7
- package/dist/{chunk-WDKUUZXN.cjs → chunk-IXCRUQPC.cjs} +21 -17
- package/dist/{chunk-HTCJOTLL.js → chunk-J2ES4PYI.js} +11 -7
- package/dist/chunk-J2ES4PYI.js.map +1 -0
- package/dist/{chunk-QDUQWRFO.js → chunk-JPSCPXBD.js} +8 -4
- package/dist/chunk-JPSCPXBD.js.map +1 -0
- package/dist/{chunk-YNFGR7GL.js → chunk-L3XMZMJ5.js} +10 -4
- package/dist/chunk-L3XMZMJ5.js.map +1 -0
- package/dist/chunk-SEATGNQM.js +15 -0
- package/dist/chunk-SEATGNQM.js.map +1 -0
- package/dist/{chunk-DUZFWQUE.js → chunk-SV7GUBBD.js} +13 -8
- package/dist/chunk-SV7GUBBD.js.map +1 -0
- package/dist/{chunk-E4QOZYOP.js → chunk-WRGVBPK2.js} +24 -10
- package/dist/chunk-WRGVBPK2.js.map +1 -0
- package/dist/{chunk-PHI4BK5K.cjs → chunk-X2JM3GAC.cjs} +162 -124
- package/dist/{chunk-7LKI2367.js → chunk-XDO5ZSKZ.js} +12 -7
- package/dist/chunk-XDO5ZSKZ.js.map +1 -0
- package/dist/{chunk-JWYPCGK5.cjs → chunk-XXN4BH6X.cjs} +14 -13
- package/dist/{chunk-KRX65PCH.cjs → chunk-ZJ6GI35A.cjs} +32 -29
- package/dist/fs.cjs +21 -28
- package/dist/fs.js +21 -5
- package/dist/fs.js.map +1 -1
- package/dist/index.cjs +189 -189
- package/dist/index.d.cts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +61 -19
- package/dist/index.js.map +1 -1
- package/dist/logger.cjs +14 -25
- package/dist/logger.js +14 -4
- package/dist/logger.js.map +1 -1
- package/dist/mocks.cjs +14 -12
- package/dist/mocks.js +15 -11
- package/dist/mocks.js.map +1 -1
- package/dist/transformers.cjs +40 -54
- package/dist/transformers.js +30 -8
- package/dist/transformers.js.map +1 -1
- package/dist/utils.cjs +34 -36
- package/dist/utils.js +25 -8
- package/dist/utils.js.map +1 -1
- package/package.json +5 -5
- package/src/FileManager.ts +14 -4
- package/dist/chunk-6453B5D6.js.map +0 -1
- package/dist/chunk-7LKI2367.js.map +0 -1
- package/dist/chunk-DUZFWQUE.js.map +0 -1
- package/dist/chunk-EFAVSUDO.cjs +0 -15
- package/dist/chunk-HTCJOTLL.js.map +0 -1
- package/dist/chunk-KRX65PCH.cjs.map +0 -1
- package/dist/chunk-LVTR4JV4.cjs.map +0 -1
- package/dist/chunk-Q5OJPP57.js.map +0 -1
- package/dist/chunk-VCS7BATE.js.map +0 -1
- package/dist/chunk-WCUXF325.cjs.map +0 -1
- package/dist/chunk-YFNYSIDY.js +0 -12
- package/dist/chunk-YFNYSIDY.js.map +0 -1
- package/dist/chunk-YNFGR7GL.js.map +0 -1
- /package/dist/{chunk-AMVMOCJ4.cjs.map → chunk-AWUFUNOJ.cjs.map} +0 -0
- /package/dist/{chunk-M5H5RXTY.cjs.map → chunk-CUO3T7RA.cjs.map} +0 -0
- /package/dist/{chunk-EFAVSUDO.cjs.map → chunk-EXBYWEC2.cjs.map} +0 -0
- /package/dist/{chunk-QDUQWRFO.js.map → chunk-GNWOOGXA.cjs.map} +0 -0
- /package/dist/{chunk-WDKUUZXN.cjs.map → chunk-IXCRUQPC.cjs.map} +0 -0
- /package/dist/{chunk-PHI4BK5K.cjs.map → chunk-X2JM3GAC.cjs.map} +0 -0
- /package/dist/{chunk-JWYPCGK5.cjs.map → chunk-XXN4BH6X.cjs.map} +0 -0
- /package/dist/{chunk-E4QOZYOP.js.map → chunk-ZJ6GI35A.cjs.map} +0 -0
|
@@ -1,47 +1,39 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
var _chunkXXN4BH6Xcjs = require('./chunk-XXN4BH6X.cjs');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
var _chunkGNWOOGXAcjs = require('./chunk-GNWOOGXA.cjs');
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
var _chunkZJ6GI35Acjs = require('./chunk-ZJ6GI35A.cjs');
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
var _chunkIXCRUQPCcjs = require('./chunk-IXCRUQPC.cjs');
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
var _chunkX2JM3GACcjs = require('./chunk-X2JM3GAC.cjs');
|
|
2
20
|
|
|
3
|
-
var chunkJWYPCGK5_cjs = require('./chunk-JWYPCGK5.cjs');
|
|
4
|
-
var chunkWCUXF325_cjs = require('./chunk-WCUXF325.cjs');
|
|
5
|
-
var chunkKRX65PCH_cjs = require('./chunk-KRX65PCH.cjs');
|
|
6
|
-
var chunkWDKUUZXN_cjs = require('./chunk-WDKUUZXN.cjs');
|
|
7
|
-
var chunkPHI4BK5K_cjs = require('./chunk-PHI4BK5K.cjs');
|
|
8
|
-
var chunk2JNTDAI2_cjs = require('./chunk-2JNTDAI2.cjs');
|
|
9
|
-
var crypto = require('crypto');
|
|
10
|
-
var path = require('path');
|
|
11
|
-
var parser = require('@kubb/parser');
|
|
12
|
-
var factory = require('@kubb/parser/factory');
|
|
13
|
-
var naturalOrderby = require('natural-orderby');
|
|
14
|
-
var dirTree = require('directory-tree');
|
|
15
21
|
|
|
16
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
22
|
|
|
18
|
-
function _interopNamespace(e) {
|
|
19
|
-
if (e && e.__esModule) return e;
|
|
20
|
-
var n = Object.create(null);
|
|
21
|
-
if (e) {
|
|
22
|
-
Object.keys(e).forEach(function (k) {
|
|
23
|
-
if (k !== 'default') {
|
|
24
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
25
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
26
|
-
enumerable: true,
|
|
27
|
-
get: function () { return e[k]; }
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
n.default = e;
|
|
33
|
-
return Object.freeze(n);
|
|
34
|
-
}
|
|
35
23
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
var _chunkDJLNT4KCcjs = require('./chunk-DJLNT4KC.cjs');
|
|
40
31
|
|
|
41
32
|
// ../../node_modules/.pnpm/lodash.isequal@4.5.0/node_modules/lodash.isequal/index.js
|
|
42
|
-
var require_lodash =
|
|
33
|
+
var require_lodash = _chunkDJLNT4KCcjs.__commonJS.call(void 0, {
|
|
43
34
|
"../../node_modules/.pnpm/lodash.isequal@4.5.0/node_modules/lodash.isequal/index.js"(exports, module) {
|
|
44
|
-
|
|
35
|
+
"use strict";
|
|
36
|
+
_chunkDJLNT4KCcjs.init_cjs_shims.call(void 0, );
|
|
45
37
|
var LARGE_ARRAY_SIZE = 200;
|
|
46
38
|
var HASH_UNDEFINED = "__lodash_hash_undefined__";
|
|
47
39
|
var COMPARE_PARTIAL_FLAG = 1;
|
|
@@ -741,9 +733,10 @@ var require_lodash = chunk2JNTDAI2_cjs.__commonJS({
|
|
|
741
733
|
});
|
|
742
734
|
|
|
743
735
|
// ../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.js
|
|
744
|
-
var require_eventemitter3 =
|
|
736
|
+
var require_eventemitter3 = _chunkDJLNT4KCcjs.__commonJS.call(void 0, {
|
|
745
737
|
"../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.js"(exports, module) {
|
|
746
|
-
|
|
738
|
+
"use strict";
|
|
739
|
+
_chunkDJLNT4KCcjs.init_cjs_shims.call(void 0, );
|
|
747
740
|
var has = Object.prototype.hasOwnProperty;
|
|
748
741
|
var prefix = "~";
|
|
749
742
|
function Events() {
|
|
@@ -923,18 +916,23 @@ var require_eventemitter3 = chunk2JNTDAI2_cjs.__commonJS({
|
|
|
923
916
|
});
|
|
924
917
|
|
|
925
918
|
// src/FileManager.ts
|
|
926
|
-
|
|
927
|
-
var import_lodash =
|
|
919
|
+
_chunkDJLNT4KCcjs.init_cjs_shims.call(void 0, );
|
|
920
|
+
var import_lodash = _chunkDJLNT4KCcjs.__toESM.call(void 0, require_lodash(), 1);
|
|
921
|
+
var _crypto = require('crypto'); var _crypto2 = _interopRequireDefault(_crypto);
|
|
922
|
+
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
923
|
+
var _parser = require('@kubb/parser');
|
|
924
|
+
var _factory = require('@kubb/parser/factory'); var factory = _interopRequireWildcard(_factory);
|
|
925
|
+
var _naturalorderby = require('natural-orderby');
|
|
928
926
|
|
|
929
927
|
// ../../node_modules/.pnpm/p-queue@8.0.1/node_modules/p-queue/dist/index.js
|
|
930
|
-
|
|
928
|
+
_chunkDJLNT4KCcjs.init_cjs_shims.call(void 0, );
|
|
931
929
|
|
|
932
930
|
// ../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.mjs
|
|
933
|
-
|
|
934
|
-
var import_index =
|
|
931
|
+
_chunkDJLNT4KCcjs.init_cjs_shims.call(void 0, );
|
|
932
|
+
var import_index = _chunkDJLNT4KCcjs.__toESM.call(void 0, require_eventemitter3(), 1);
|
|
935
933
|
|
|
936
934
|
// ../../node_modules/.pnpm/p-timeout@6.1.2/node_modules/p-timeout/index.js
|
|
937
|
-
|
|
935
|
+
_chunkDJLNT4KCcjs.init_cjs_shims.call(void 0, );
|
|
938
936
|
var TimeoutError = class extends Error {
|
|
939
937
|
constructor(message) {
|
|
940
938
|
super(message);
|
|
@@ -996,7 +994,7 @@ function pTimeout(promise, options) {
|
|
|
996
994
|
} else if (message instanceof Error) {
|
|
997
995
|
reject(message);
|
|
998
996
|
} else {
|
|
999
|
-
timeoutError.message = message
|
|
997
|
+
timeoutError.message = _nullishCoalesce(message, () => ( `Promise timed out after ${milliseconds} milliseconds`));
|
|
1000
998
|
reject(timeoutError);
|
|
1001
999
|
}
|
|
1002
1000
|
}, milliseconds);
|
|
@@ -1019,10 +1017,10 @@ function pTimeout(promise, options) {
|
|
|
1019
1017
|
}
|
|
1020
1018
|
|
|
1021
1019
|
// ../../node_modules/.pnpm/p-queue@8.0.1/node_modules/p-queue/dist/priority-queue.js
|
|
1022
|
-
|
|
1020
|
+
_chunkDJLNT4KCcjs.init_cjs_shims.call(void 0, );
|
|
1023
1021
|
|
|
1024
1022
|
// ../../node_modules/.pnpm/p-queue@8.0.1/node_modules/p-queue/dist/lower-bound.js
|
|
1025
|
-
|
|
1023
|
+
_chunkDJLNT4KCcjs.init_cjs_shims.call(void 0, );
|
|
1026
1024
|
function lowerBound(array, value, comparator) {
|
|
1027
1025
|
let first = 0;
|
|
1028
1026
|
let count = array.length;
|
|
@@ -1043,7 +1041,7 @@ function lowerBound(array, value, comparator) {
|
|
|
1043
1041
|
var _queue;
|
|
1044
1042
|
var PriorityQueue = class {
|
|
1045
1043
|
constructor() {
|
|
1046
|
-
|
|
1044
|
+
_chunkDJLNT4KCcjs.__privateAdd.call(void 0, this, _queue, []);
|
|
1047
1045
|
}
|
|
1048
1046
|
enqueue(run, options) {
|
|
1049
1047
|
options = {
|
|
@@ -1054,22 +1052,22 @@ var PriorityQueue = class {
|
|
|
1054
1052
|
priority: options.priority,
|
|
1055
1053
|
run
|
|
1056
1054
|
};
|
|
1057
|
-
if (this.size &&
|
|
1058
|
-
|
|
1055
|
+
if (this.size && _chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _queue)[this.size - 1].priority >= options.priority) {
|
|
1056
|
+
_chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _queue).push(element);
|
|
1059
1057
|
return;
|
|
1060
1058
|
}
|
|
1061
|
-
const index = lowerBound(
|
|
1062
|
-
|
|
1059
|
+
const index = lowerBound(_chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _queue), element, (a, b) => b.priority - a.priority);
|
|
1060
|
+
_chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _queue).splice(index, 0, element);
|
|
1063
1061
|
}
|
|
1064
1062
|
dequeue() {
|
|
1065
|
-
const item =
|
|
1066
|
-
return item
|
|
1063
|
+
const item = _chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _queue).shift();
|
|
1064
|
+
return _optionalChain([item, 'optionalAccess', _2 => _2.run]);
|
|
1067
1065
|
}
|
|
1068
1066
|
filter(options) {
|
|
1069
|
-
return
|
|
1067
|
+
return _chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _queue).filter((element) => element.priority === options.priority).map((element) => element.run);
|
|
1070
1068
|
}
|
|
1071
1069
|
get size() {
|
|
1072
|
-
return
|
|
1070
|
+
return _chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _queue).length;
|
|
1073
1071
|
}
|
|
1074
1072
|
};
|
|
1075
1073
|
_queue = new WeakMap();
|
|
@@ -1080,41 +1078,41 @@ var PQueue = class extends import_index.default {
|
|
|
1080
1078
|
// TODO: The `throwOnTimeout` option should affect the return types of `add()` and `addAll()`
|
|
1081
1079
|
constructor(options) {
|
|
1082
1080
|
super();
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1081
|
+
_chunkDJLNT4KCcjs.__privateAdd.call(void 0, this, _doesIntervalAllowAnother);
|
|
1082
|
+
_chunkDJLNT4KCcjs.__privateAdd.call(void 0, this, _doesConcurrentAllowAnother);
|
|
1083
|
+
_chunkDJLNT4KCcjs.__privateAdd.call(void 0, this, _next);
|
|
1084
|
+
_chunkDJLNT4KCcjs.__privateAdd.call(void 0, this, _onResumeInterval);
|
|
1085
|
+
_chunkDJLNT4KCcjs.__privateAdd.call(void 0, this, _isIntervalPaused);
|
|
1086
|
+
_chunkDJLNT4KCcjs.__privateAdd.call(void 0, this, _tryToStartAnother);
|
|
1087
|
+
_chunkDJLNT4KCcjs.__privateAdd.call(void 0, this, _initializeIntervalIfNeeded);
|
|
1088
|
+
_chunkDJLNT4KCcjs.__privateAdd.call(void 0, this, _onInterval);
|
|
1091
1089
|
/**
|
|
1092
1090
|
Executes all queued functions until it reaches the limit.
|
|
1093
1091
|
*/
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1092
|
+
_chunkDJLNT4KCcjs.__privateAdd.call(void 0, this, _processQueue);
|
|
1093
|
+
_chunkDJLNT4KCcjs.__privateAdd.call(void 0, this, _throwOnAbort);
|
|
1094
|
+
_chunkDJLNT4KCcjs.__privateAdd.call(void 0, this, _onEvent);
|
|
1095
|
+
_chunkDJLNT4KCcjs.__privateAdd.call(void 0, this, _carryoverConcurrencyCount, void 0);
|
|
1096
|
+
_chunkDJLNT4KCcjs.__privateAdd.call(void 0, this, _isIntervalIgnored, void 0);
|
|
1097
|
+
_chunkDJLNT4KCcjs.__privateAdd.call(void 0, this, _intervalCount, 0);
|
|
1098
|
+
_chunkDJLNT4KCcjs.__privateAdd.call(void 0, this, _intervalCap, void 0);
|
|
1099
|
+
_chunkDJLNT4KCcjs.__privateAdd.call(void 0, this, _interval, void 0);
|
|
1100
|
+
_chunkDJLNT4KCcjs.__privateAdd.call(void 0, this, _intervalEnd, 0);
|
|
1101
|
+
_chunkDJLNT4KCcjs.__privateAdd.call(void 0, this, _intervalId, void 0);
|
|
1102
|
+
_chunkDJLNT4KCcjs.__privateAdd.call(void 0, this, _timeoutId, void 0);
|
|
1103
|
+
_chunkDJLNT4KCcjs.__privateAdd.call(void 0, this, _queue2, void 0);
|
|
1104
|
+
_chunkDJLNT4KCcjs.__privateAdd.call(void 0, this, _queueClass, void 0);
|
|
1105
|
+
_chunkDJLNT4KCcjs.__privateAdd.call(void 0, this, _pending, 0);
|
|
1108
1106
|
// The `!` is needed because of https://github.com/microsoft/TypeScript/issues/32194
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1107
|
+
_chunkDJLNT4KCcjs.__privateAdd.call(void 0, this, _concurrency, void 0);
|
|
1108
|
+
_chunkDJLNT4KCcjs.__privateAdd.call(void 0, this, _isPaused, void 0);
|
|
1109
|
+
_chunkDJLNT4KCcjs.__privateAdd.call(void 0, this, _throwOnTimeout, void 0);
|
|
1112
1110
|
/**
|
|
1113
1111
|
Per-operation timeout in milliseconds. Operations fulfill once `timeout` elapses if they haven't already.
|
|
1114
1112
|
|
|
1115
1113
|
Applies to each future operation.
|
|
1116
1114
|
*/
|
|
1117
|
-
|
|
1115
|
+
_chunkDJLNT4KCcjs.__publicField.call(void 0, this, "timeout");
|
|
1118
1116
|
options = {
|
|
1119
1117
|
carryoverConcurrencyCount: false,
|
|
1120
1118
|
intervalCap: Number.POSITIVE_INFINITY,
|
|
@@ -1125,50 +1123,50 @@ var PQueue = class extends import_index.default {
|
|
|
1125
1123
|
...options
|
|
1126
1124
|
};
|
|
1127
1125
|
if (!(typeof options.intervalCap === "number" && options.intervalCap >= 1)) {
|
|
1128
|
-
throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${options.intervalCap
|
|
1126
|
+
throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${_nullishCoalesce(_optionalChain([options, 'access', _3 => _3.intervalCap, 'optionalAccess', _4 => _4.toString, 'call', _5 => _5()]), () => ( ""))}\` (${typeof options.intervalCap})`);
|
|
1129
1127
|
}
|
|
1130
1128
|
if (options.interval === void 0 || !(Number.isFinite(options.interval) && options.interval >= 0)) {
|
|
1131
|
-
throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${options.interval
|
|
1132
|
-
}
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1129
|
+
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})`);
|
|
1130
|
+
}
|
|
1131
|
+
_chunkDJLNT4KCcjs.__privateSet.call(void 0, this, _carryoverConcurrencyCount, options.carryoverConcurrencyCount);
|
|
1132
|
+
_chunkDJLNT4KCcjs.__privateSet.call(void 0, this, _isIntervalIgnored, options.intervalCap === Number.POSITIVE_INFINITY || options.interval === 0);
|
|
1133
|
+
_chunkDJLNT4KCcjs.__privateSet.call(void 0, this, _intervalCap, options.intervalCap);
|
|
1134
|
+
_chunkDJLNT4KCcjs.__privateSet.call(void 0, this, _interval, options.interval);
|
|
1135
|
+
_chunkDJLNT4KCcjs.__privateSet.call(void 0, this, _queue2, new options.queueClass());
|
|
1136
|
+
_chunkDJLNT4KCcjs.__privateSet.call(void 0, this, _queueClass, options.queueClass);
|
|
1139
1137
|
this.concurrency = options.concurrency;
|
|
1140
1138
|
this.timeout = options.timeout;
|
|
1141
|
-
|
|
1142
|
-
|
|
1139
|
+
_chunkDJLNT4KCcjs.__privateSet.call(void 0, this, _throwOnTimeout, options.throwOnTimeout === true);
|
|
1140
|
+
_chunkDJLNT4KCcjs.__privateSet.call(void 0, this, _isPaused, options.autoStart === false);
|
|
1143
1141
|
}
|
|
1144
1142
|
get concurrency() {
|
|
1145
|
-
return
|
|
1143
|
+
return _chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _concurrency);
|
|
1146
1144
|
}
|
|
1147
1145
|
set concurrency(newConcurrency) {
|
|
1148
1146
|
if (!(typeof newConcurrency === "number" && newConcurrency >= 1)) {
|
|
1149
1147
|
throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${newConcurrency}\` (${typeof newConcurrency})`);
|
|
1150
1148
|
}
|
|
1151
|
-
|
|
1152
|
-
|
|
1149
|
+
_chunkDJLNT4KCcjs.__privateSet.call(void 0, this, _concurrency, newConcurrency);
|
|
1150
|
+
_chunkDJLNT4KCcjs.__privateMethod.call(void 0, this, _processQueue, processQueue_fn).call(this);
|
|
1153
1151
|
}
|
|
1154
1152
|
async add(function_, options = {}) {
|
|
1155
1153
|
options = {
|
|
1156
1154
|
timeout: this.timeout,
|
|
1157
|
-
throwOnTimeout:
|
|
1155
|
+
throwOnTimeout: _chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _throwOnTimeout),
|
|
1158
1156
|
...options
|
|
1159
1157
|
};
|
|
1160
1158
|
return new Promise((resolve2, reject) => {
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1159
|
+
_chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _queue2).enqueue(async () => {
|
|
1160
|
+
_chunkDJLNT4KCcjs.__privateWrapper.call(void 0, this, _pending)._++;
|
|
1161
|
+
_chunkDJLNT4KCcjs.__privateWrapper.call(void 0, this, _intervalCount)._++;
|
|
1164
1162
|
try {
|
|
1165
|
-
options.signal
|
|
1163
|
+
_optionalChain([options, 'access', _9 => _9.signal, 'optionalAccess', _10 => _10.throwIfAborted, 'call', _11 => _11()]);
|
|
1166
1164
|
let operation = function_({ signal: options.signal });
|
|
1167
1165
|
if (options.timeout) {
|
|
1168
1166
|
operation = pTimeout(Promise.resolve(operation), { milliseconds: options.timeout });
|
|
1169
1167
|
}
|
|
1170
1168
|
if (options.signal) {
|
|
1171
|
-
operation = Promise.race([operation,
|
|
1169
|
+
operation = Promise.race([operation, _chunkDJLNT4KCcjs.__privateMethod.call(void 0, this, _throwOnAbort, throwOnAbort_fn).call(this, options.signal)]);
|
|
1172
1170
|
}
|
|
1173
1171
|
const result = await operation;
|
|
1174
1172
|
resolve2(result);
|
|
@@ -1181,11 +1179,11 @@ var PQueue = class extends import_index.default {
|
|
|
1181
1179
|
reject(error);
|
|
1182
1180
|
this.emit("error", error);
|
|
1183
1181
|
} finally {
|
|
1184
|
-
|
|
1182
|
+
_chunkDJLNT4KCcjs.__privateMethod.call(void 0, this, _next, next_fn).call(this);
|
|
1185
1183
|
}
|
|
1186
1184
|
}, options);
|
|
1187
1185
|
this.emit("add");
|
|
1188
|
-
|
|
1186
|
+
_chunkDJLNT4KCcjs.__privateMethod.call(void 0, this, _tryToStartAnother, tryToStartAnother_fn).call(this);
|
|
1189
1187
|
});
|
|
1190
1188
|
}
|
|
1191
1189
|
async addAll(functions, options) {
|
|
@@ -1195,24 +1193,24 @@ var PQueue = class extends import_index.default {
|
|
|
1195
1193
|
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.)
|
|
1196
1194
|
*/
|
|
1197
1195
|
start() {
|
|
1198
|
-
if (!
|
|
1196
|
+
if (!_chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _isPaused)) {
|
|
1199
1197
|
return this;
|
|
1200
1198
|
}
|
|
1201
|
-
|
|
1202
|
-
|
|
1199
|
+
_chunkDJLNT4KCcjs.__privateSet.call(void 0, this, _isPaused, false);
|
|
1200
|
+
_chunkDJLNT4KCcjs.__privateMethod.call(void 0, this, _processQueue, processQueue_fn).call(this);
|
|
1203
1201
|
return this;
|
|
1204
1202
|
}
|
|
1205
1203
|
/**
|
|
1206
1204
|
Put queue execution on hold.
|
|
1207
1205
|
*/
|
|
1208
1206
|
pause() {
|
|
1209
|
-
|
|
1207
|
+
_chunkDJLNT4KCcjs.__privateSet.call(void 0, this, _isPaused, true);
|
|
1210
1208
|
}
|
|
1211
1209
|
/**
|
|
1212
1210
|
Clear the queue.
|
|
1213
1211
|
*/
|
|
1214
1212
|
clear() {
|
|
1215
|
-
|
|
1213
|
+
_chunkDJLNT4KCcjs.__privateSet.call(void 0, this, _queue2, new (_chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _queueClass))());
|
|
1216
1214
|
}
|
|
1217
1215
|
/**
|
|
1218
1216
|
Can be called multiple times. Useful if you for example add additional items at a later time.
|
|
@@ -1220,10 +1218,10 @@ var PQueue = class extends import_index.default {
|
|
|
1220
1218
|
@returns A promise that settles when the queue becomes empty.
|
|
1221
1219
|
*/
|
|
1222
1220
|
async onEmpty() {
|
|
1223
|
-
if (
|
|
1221
|
+
if (_chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _queue2).size === 0) {
|
|
1224
1222
|
return;
|
|
1225
1223
|
}
|
|
1226
|
-
await
|
|
1224
|
+
await _chunkDJLNT4KCcjs.__privateMethod.call(void 0, this, _onEvent, onEvent_fn).call(this, "empty");
|
|
1227
1225
|
}
|
|
1228
1226
|
/**
|
|
1229
1227
|
@returns A promise that settles when the queue size is less than the given limit: `queue.size < limit`.
|
|
@@ -1233,10 +1231,10 @@ var PQueue = class extends import_index.default {
|
|
|
1233
1231
|
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.
|
|
1234
1232
|
*/
|
|
1235
1233
|
async onSizeLessThan(limit) {
|
|
1236
|
-
if (
|
|
1234
|
+
if (_chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _queue2).size < limit) {
|
|
1237
1235
|
return;
|
|
1238
1236
|
}
|
|
1239
|
-
await
|
|
1237
|
+
await _chunkDJLNT4KCcjs.__privateMethod.call(void 0, this, _onEvent, onEvent_fn).call(this, "next", () => _chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _queue2).size < limit);
|
|
1240
1238
|
}
|
|
1241
1239
|
/**
|
|
1242
1240
|
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.
|
|
@@ -1244,16 +1242,16 @@ var PQueue = class extends import_index.default {
|
|
|
1244
1242
|
@returns A promise that settles when the queue becomes empty, and all promises have completed; `queue.size === 0 && queue.pending === 0`.
|
|
1245
1243
|
*/
|
|
1246
1244
|
async onIdle() {
|
|
1247
|
-
if (
|
|
1245
|
+
if (_chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _pending) === 0 && _chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _queue2).size === 0) {
|
|
1248
1246
|
return;
|
|
1249
1247
|
}
|
|
1250
|
-
await
|
|
1248
|
+
await _chunkDJLNT4KCcjs.__privateMethod.call(void 0, this, _onEvent, onEvent_fn).call(this, "idle");
|
|
1251
1249
|
}
|
|
1252
1250
|
/**
|
|
1253
1251
|
Size of the queue, the number of queued items waiting to run.
|
|
1254
1252
|
*/
|
|
1255
1253
|
get size() {
|
|
1256
|
-
return
|
|
1254
|
+
return _chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _queue2).size;
|
|
1257
1255
|
}
|
|
1258
1256
|
/**
|
|
1259
1257
|
Size of the queue, filtered by the given options.
|
|
@@ -1261,19 +1259,19 @@ var PQueue = class extends import_index.default {
|
|
|
1261
1259
|
For example, this can be used to find the number of items remaining in the queue with a specific priority level.
|
|
1262
1260
|
*/
|
|
1263
1261
|
sizeBy(options) {
|
|
1264
|
-
return
|
|
1262
|
+
return _chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _queue2).filter(options).length;
|
|
1265
1263
|
}
|
|
1266
1264
|
/**
|
|
1267
1265
|
Number of running items (no longer in the queue).
|
|
1268
1266
|
*/
|
|
1269
1267
|
get pending() {
|
|
1270
|
-
return
|
|
1268
|
+
return _chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _pending);
|
|
1271
1269
|
}
|
|
1272
1270
|
/**
|
|
1273
1271
|
Whether the queue is currently paused.
|
|
1274
1272
|
*/
|
|
1275
1273
|
get isPaused() {
|
|
1276
|
-
return
|
|
1274
|
+
return _chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _isPaused);
|
|
1277
1275
|
}
|
|
1278
1276
|
};
|
|
1279
1277
|
_carryoverConcurrencyCount = new WeakMap();
|
|
@@ -1292,35 +1290,35 @@ _isPaused = new WeakMap();
|
|
|
1292
1290
|
_throwOnTimeout = new WeakMap();
|
|
1293
1291
|
_doesIntervalAllowAnother = new WeakSet();
|
|
1294
1292
|
doesIntervalAllowAnother_get = function() {
|
|
1295
|
-
return
|
|
1293
|
+
return _chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _isIntervalIgnored) || _chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _intervalCount) < _chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _intervalCap);
|
|
1296
1294
|
};
|
|
1297
1295
|
_doesConcurrentAllowAnother = new WeakSet();
|
|
1298
1296
|
doesConcurrentAllowAnother_get = function() {
|
|
1299
|
-
return
|
|
1297
|
+
return _chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _pending) < _chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _concurrency);
|
|
1300
1298
|
};
|
|
1301
1299
|
_next = new WeakSet();
|
|
1302
1300
|
next_fn = function() {
|
|
1303
|
-
|
|
1304
|
-
|
|
1301
|
+
_chunkDJLNT4KCcjs.__privateWrapper.call(void 0, this, _pending)._--;
|
|
1302
|
+
_chunkDJLNT4KCcjs.__privateMethod.call(void 0, this, _tryToStartAnother, tryToStartAnother_fn).call(this);
|
|
1305
1303
|
this.emit("next");
|
|
1306
1304
|
};
|
|
1307
1305
|
_onResumeInterval = new WeakSet();
|
|
1308
1306
|
onResumeInterval_fn = function() {
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1307
|
+
_chunkDJLNT4KCcjs.__privateMethod.call(void 0, this, _onInterval, onInterval_fn).call(this);
|
|
1308
|
+
_chunkDJLNT4KCcjs.__privateMethod.call(void 0, this, _initializeIntervalIfNeeded, initializeIntervalIfNeeded_fn).call(this);
|
|
1309
|
+
_chunkDJLNT4KCcjs.__privateSet.call(void 0, this, _timeoutId, void 0);
|
|
1312
1310
|
};
|
|
1313
1311
|
_isIntervalPaused = new WeakSet();
|
|
1314
1312
|
isIntervalPaused_get = function() {
|
|
1315
1313
|
const now = Date.now();
|
|
1316
|
-
if (
|
|
1317
|
-
const delay =
|
|
1314
|
+
if (_chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _intervalId) === void 0) {
|
|
1315
|
+
const delay = _chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _intervalEnd) - now;
|
|
1318
1316
|
if (delay < 0) {
|
|
1319
|
-
|
|
1317
|
+
_chunkDJLNT4KCcjs.__privateSet.call(void 0, this, _intervalCount, _chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _carryoverConcurrencyCount) ? _chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _pending) : 0);
|
|
1320
1318
|
} else {
|
|
1321
|
-
if (
|
|
1322
|
-
|
|
1323
|
-
|
|
1319
|
+
if (_chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _timeoutId) === void 0) {
|
|
1320
|
+
_chunkDJLNT4KCcjs.__privateSet.call(void 0, this, _timeoutId, setTimeout(() => {
|
|
1321
|
+
_chunkDJLNT4KCcjs.__privateMethod.call(void 0, this, _onResumeInterval, onResumeInterval_fn).call(this);
|
|
1324
1322
|
}, delay));
|
|
1325
1323
|
}
|
|
1326
1324
|
return true;
|
|
@@ -1330,28 +1328,28 @@ isIntervalPaused_get = function() {
|
|
|
1330
1328
|
};
|
|
1331
1329
|
_tryToStartAnother = new WeakSet();
|
|
1332
1330
|
tryToStartAnother_fn = function() {
|
|
1333
|
-
if (
|
|
1334
|
-
if (
|
|
1335
|
-
clearInterval(
|
|
1331
|
+
if (_chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _queue2).size === 0) {
|
|
1332
|
+
if (_chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _intervalId)) {
|
|
1333
|
+
clearInterval(_chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _intervalId));
|
|
1336
1334
|
}
|
|
1337
|
-
|
|
1335
|
+
_chunkDJLNT4KCcjs.__privateSet.call(void 0, this, _intervalId, void 0);
|
|
1338
1336
|
this.emit("empty");
|
|
1339
|
-
if (
|
|
1337
|
+
if (_chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _pending) === 0) {
|
|
1340
1338
|
this.emit("idle");
|
|
1341
1339
|
}
|
|
1342
1340
|
return false;
|
|
1343
1341
|
}
|
|
1344
|
-
if (!
|
|
1345
|
-
const canInitializeInterval = !
|
|
1346
|
-
if (
|
|
1347
|
-
const job =
|
|
1342
|
+
if (!_chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _isPaused)) {
|
|
1343
|
+
const canInitializeInterval = !_chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _isIntervalPaused, isIntervalPaused_get);
|
|
1344
|
+
if (_chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _doesIntervalAllowAnother, doesIntervalAllowAnother_get) && _chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _doesConcurrentAllowAnother, doesConcurrentAllowAnother_get)) {
|
|
1345
|
+
const job = _chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _queue2).dequeue();
|
|
1348
1346
|
if (!job) {
|
|
1349
1347
|
return false;
|
|
1350
1348
|
}
|
|
1351
1349
|
this.emit("active");
|
|
1352
1350
|
job();
|
|
1353
1351
|
if (canInitializeInterval) {
|
|
1354
|
-
|
|
1352
|
+
_chunkDJLNT4KCcjs.__privateMethod.call(void 0, this, _initializeIntervalIfNeeded, initializeIntervalIfNeeded_fn).call(this);
|
|
1355
1353
|
}
|
|
1356
1354
|
return true;
|
|
1357
1355
|
}
|
|
@@ -1360,26 +1358,26 @@ tryToStartAnother_fn = function() {
|
|
|
1360
1358
|
};
|
|
1361
1359
|
_initializeIntervalIfNeeded = new WeakSet();
|
|
1362
1360
|
initializeIntervalIfNeeded_fn = function() {
|
|
1363
|
-
if (
|
|
1361
|
+
if (_chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _isIntervalIgnored) || _chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _intervalId) !== void 0) {
|
|
1364
1362
|
return;
|
|
1365
1363
|
}
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
},
|
|
1369
|
-
|
|
1364
|
+
_chunkDJLNT4KCcjs.__privateSet.call(void 0, this, _intervalId, setInterval(() => {
|
|
1365
|
+
_chunkDJLNT4KCcjs.__privateMethod.call(void 0, this, _onInterval, onInterval_fn).call(this);
|
|
1366
|
+
}, _chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _interval)));
|
|
1367
|
+
_chunkDJLNT4KCcjs.__privateSet.call(void 0, this, _intervalEnd, Date.now() + _chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _interval));
|
|
1370
1368
|
};
|
|
1371
1369
|
_onInterval = new WeakSet();
|
|
1372
1370
|
onInterval_fn = function() {
|
|
1373
|
-
if (
|
|
1374
|
-
clearInterval(
|
|
1375
|
-
|
|
1371
|
+
if (_chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _intervalCount) === 0 && _chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _pending) === 0 && _chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _intervalId)) {
|
|
1372
|
+
clearInterval(_chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _intervalId));
|
|
1373
|
+
_chunkDJLNT4KCcjs.__privateSet.call(void 0, this, _intervalId, void 0);
|
|
1376
1374
|
}
|
|
1377
|
-
|
|
1378
|
-
|
|
1375
|
+
_chunkDJLNT4KCcjs.__privateSet.call(void 0, this, _intervalCount, _chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _carryoverConcurrencyCount) ? _chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _pending) : 0);
|
|
1376
|
+
_chunkDJLNT4KCcjs.__privateMethod.call(void 0, this, _processQueue, processQueue_fn).call(this);
|
|
1379
1377
|
};
|
|
1380
1378
|
_processQueue = new WeakSet();
|
|
1381
1379
|
processQueue_fn = function() {
|
|
1382
|
-
while (
|
|
1380
|
+
while (_chunkDJLNT4KCcjs.__privateMethod.call(void 0, this, _tryToStartAnother, tryToStartAnother_fn).call(this)) {
|
|
1383
1381
|
}
|
|
1384
1382
|
};
|
|
1385
1383
|
_throwOnAbort = new WeakSet();
|
|
@@ -1405,10 +1403,13 @@ onEvent_fn = async function(event, filter) {
|
|
|
1405
1403
|
};
|
|
1406
1404
|
|
|
1407
1405
|
// src/BarrelManager.ts
|
|
1408
|
-
|
|
1406
|
+
_chunkDJLNT4KCcjs.init_cjs_shims.call(void 0, );
|
|
1407
|
+
|
|
1408
|
+
|
|
1409
1409
|
|
|
1410
1410
|
// src/utils/TreeNode.ts
|
|
1411
|
-
|
|
1411
|
+
_chunkDJLNT4KCcjs.init_cjs_shims.call(void 0, );
|
|
1412
|
+
var _directorytree = require('directory-tree'); var _directorytree2 = _interopRequireDefault(_directorytree);
|
|
1412
1413
|
var TreeNode = class _TreeNode {
|
|
1413
1414
|
constructor(data, parent) {
|
|
1414
1415
|
this.children = [];
|
|
@@ -1431,7 +1432,7 @@ var TreeNode = class _TreeNode {
|
|
|
1431
1432
|
if (data === this.data) {
|
|
1432
1433
|
return this;
|
|
1433
1434
|
}
|
|
1434
|
-
if (this.children
|
|
1435
|
+
if (_optionalChain([this, 'access', _12 => _12.children, 'optionalAccess', _13 => _13.length])) {
|
|
1435
1436
|
for (let i = 0, { length } = this.children, target = null; i < length; i++) {
|
|
1436
1437
|
target = this.children[i].find(data);
|
|
1437
1438
|
if (target) {
|
|
@@ -1474,20 +1475,20 @@ var TreeNode = class _TreeNode {
|
|
|
1474
1475
|
static build(path3, options = {}) {
|
|
1475
1476
|
try {
|
|
1476
1477
|
const exclude = Array.isArray(options.exclude) ? options.exclude : [options.exclude].filter(Boolean);
|
|
1477
|
-
const filteredTree =
|
|
1478
|
+
const filteredTree = _directorytree2.default.call(void 0, path3, { extensions: options.extensions, exclude: [/node_modules/, ...exclude] });
|
|
1478
1479
|
if (!filteredTree) {
|
|
1479
1480
|
return null;
|
|
1480
1481
|
}
|
|
1481
1482
|
const treeNode = new _TreeNode({ name: filteredTree.name, path: filteredTree.path, type: filteredTree.type || FileManager.getMode(filteredTree.path) });
|
|
1482
1483
|
const recurse = (node, item) => {
|
|
1483
1484
|
const subNode = node.addChild({ name: item.name, path: item.path, type: item.type || FileManager.getMode(item.path) });
|
|
1484
|
-
if (item.children
|
|
1485
|
-
item.children
|
|
1485
|
+
if (_optionalChain([item, 'access', _14 => _14.children, 'optionalAccess', _15 => _15.length])) {
|
|
1486
|
+
_optionalChain([item, 'access', _16 => _16.children, 'optionalAccess', _17 => _17.forEach, 'call', _18 => _18((child) => {
|
|
1486
1487
|
recurse(subNode, child);
|
|
1487
|
-
});
|
|
1488
|
+
})]);
|
|
1488
1489
|
}
|
|
1489
1490
|
};
|
|
1490
|
-
filteredTree.children
|
|
1491
|
+
_optionalChain([filteredTree, 'access', _19 => _19.children, 'optionalAccess', _20 => _20.forEach, 'call', _21 => _21((child) => recurse(treeNode, child))]);
|
|
1491
1492
|
return treeNode;
|
|
1492
1493
|
} catch (e) {
|
|
1493
1494
|
throw new Error("Something went wrong with creating index files with the TreehNode class", { cause: e });
|
|
@@ -1499,17 +1500,17 @@ var TreeNode = class _TreeNode {
|
|
|
1499
1500
|
var _options;
|
|
1500
1501
|
var BarrelManager = class {
|
|
1501
1502
|
constructor(options = {}) {
|
|
1502
|
-
|
|
1503
|
-
|
|
1503
|
+
_chunkDJLNT4KCcjs.__privateAdd.call(void 0, this, _options, void 0);
|
|
1504
|
+
_chunkDJLNT4KCcjs.__privateSet.call(void 0, this, _options, options);
|
|
1504
1505
|
return this;
|
|
1505
1506
|
}
|
|
1506
1507
|
getNamedExport(root, item) {
|
|
1507
|
-
const exportedNames =
|
|
1508
|
+
const exportedNames = _parser.getExports.call(void 0, _path2.default.resolve(root, item.path));
|
|
1508
1509
|
if (!exportedNames) {
|
|
1509
1510
|
return [item];
|
|
1510
1511
|
}
|
|
1511
1512
|
return exportedNames.reduce((prev, curr) => {
|
|
1512
|
-
if (!prev[0]
|
|
1513
|
+
if (!_optionalChain([prev, 'access', _22 => _22[0], 'optionalAccess', _23 => _23.name]) || !_optionalChain([prev, 'access', _24 => _24[1], 'optionalAccess', _25 => _25.name])) {
|
|
1513
1514
|
return prev;
|
|
1514
1515
|
}
|
|
1515
1516
|
if (curr.isTypeOnly) {
|
|
@@ -1529,12 +1530,12 @@ var BarrelManager = class {
|
|
|
1529
1530
|
}]);
|
|
1530
1531
|
}
|
|
1531
1532
|
getNamedExports(root, exports) {
|
|
1532
|
-
return exports
|
|
1533
|
+
return _optionalChain([exports, 'optionalAccess', _26 => _26.map, 'call', _27 => _27((item) => {
|
|
1533
1534
|
return this.getNamedExport(root, item);
|
|
1534
|
-
}).flat();
|
|
1535
|
+
}), 'access', _28 => _28.flat, 'call', _29 => _29()]);
|
|
1535
1536
|
}
|
|
1536
1537
|
getIndexes(root) {
|
|
1537
|
-
const { treeNode = {}, isTypeOnly, extName } =
|
|
1538
|
+
const { treeNode = {}, isTypeOnly, extName } = _chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _options);
|
|
1538
1539
|
const tree = TreeNode.build(root, treeNode);
|
|
1539
1540
|
if (!tree) {
|
|
1540
1541
|
return null;
|
|
@@ -1544,9 +1545,9 @@ var BarrelManager = class {
|
|
|
1544
1545
|
return [];
|
|
1545
1546
|
}
|
|
1546
1547
|
if (treeNode2.children.length > 1) {
|
|
1547
|
-
const indexPath =
|
|
1548
|
+
const indexPath = _path2.default.resolve(treeNode2.data.path, "index.ts");
|
|
1548
1549
|
const exports = treeNode2.children.filter(Boolean).map((file) => {
|
|
1549
|
-
const importPath = file.data.type === "directory" ? `./${file.data.name}/index` : `./${
|
|
1550
|
+
const importPath = file.data.type === "directory" ? `./${file.data.name}/index` : `./${_chunkXXN4BH6Xcjs.trimExtName.call(void 0, file.data.name)}`;
|
|
1550
1551
|
if (importPath.endsWith("index") && file.data.type === "file") {
|
|
1551
1552
|
return void 0;
|
|
1552
1553
|
}
|
|
@@ -1563,8 +1564,8 @@ var BarrelManager = class {
|
|
|
1563
1564
|
});
|
|
1564
1565
|
} else if (treeNode2.children.length === 1) {
|
|
1565
1566
|
const [treeNodeChild] = treeNode2.children;
|
|
1566
|
-
const indexPath =
|
|
1567
|
-
const importPath = treeNodeChild.data.type === "directory" ? `./${treeNodeChild.data.name}/index` : `./${
|
|
1567
|
+
const indexPath = _path2.default.resolve(treeNode2.data.path, "index.ts");
|
|
1568
|
+
const importPath = treeNodeChild.data.type === "directory" ? `./${treeNodeChild.data.name}/index` : `./${_chunkXXN4BH6Xcjs.trimExtName.call(void 0, treeNodeChild.data.name)}`;
|
|
1568
1569
|
const exports = [
|
|
1569
1570
|
{
|
|
1570
1571
|
path: extName ? `${importPath}${extName}` : importPath,
|
|
@@ -1589,37 +1590,37 @@ var BarrelManager = class {
|
|
|
1589
1590
|
_options = new WeakMap();
|
|
1590
1591
|
|
|
1591
1592
|
// src/FileManager.ts
|
|
1592
|
-
|
|
1593
|
+
var KubbFile;
|
|
1593
1594
|
((KubbFile2) => {
|
|
1594
|
-
})(
|
|
1595
|
+
})(KubbFile || (KubbFile = exports.KubbFile = {}));
|
|
1595
1596
|
var _cache, _task, _queue3, _add, add_fn, _addOrAppend, addOrAppend_fn;
|
|
1596
1597
|
var _FileManager = class _FileManager {
|
|
1597
1598
|
constructor({ task = async (file) => file, queue = new PQueue() } = {}) {
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1599
|
+
_chunkDJLNT4KCcjs.__privateAdd.call(void 0, this, _add);
|
|
1600
|
+
_chunkDJLNT4KCcjs.__privateAdd.call(void 0, this, _addOrAppend);
|
|
1601
|
+
_chunkDJLNT4KCcjs.__privateAdd.call(void 0, this, _cache, /* @__PURE__ */ new Map());
|
|
1602
|
+
_chunkDJLNT4KCcjs.__privateAdd.call(void 0, this, _task, void 0);
|
|
1603
|
+
_chunkDJLNT4KCcjs.__privateAdd.call(void 0, this, _queue3, void 0);
|
|
1604
|
+
_chunkDJLNT4KCcjs.__privateSet.call(void 0, this, _task, task);
|
|
1605
|
+
_chunkDJLNT4KCcjs.__privateSet.call(void 0, this, _queue3, queue);
|
|
1605
1606
|
return this;
|
|
1606
1607
|
}
|
|
1607
1608
|
get files() {
|
|
1608
1609
|
const files = [];
|
|
1609
|
-
|
|
1610
|
+
_chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _cache).forEach((item) => {
|
|
1610
1611
|
files.push(...item.flat(1));
|
|
1611
1612
|
});
|
|
1612
1613
|
return files;
|
|
1613
1614
|
}
|
|
1614
1615
|
get isExecuting() {
|
|
1615
|
-
return
|
|
1616
|
+
return _chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _queue3).size !== 0 && _chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _queue3).pending !== 0;
|
|
1616
1617
|
}
|
|
1617
1618
|
async add(...files) {
|
|
1618
1619
|
const promises = combineFiles(files).map((file) => {
|
|
1619
1620
|
if (file.override) {
|
|
1620
|
-
return
|
|
1621
|
+
return _chunkDJLNT4KCcjs.__privateMethod.call(void 0, this, _add, add_fn).call(this, file);
|
|
1621
1622
|
}
|
|
1622
|
-
return
|
|
1623
|
+
return _chunkDJLNT4KCcjs.__privateMethod.call(void 0, this, _addOrAppend, addOrAppend_fn).call(this, file);
|
|
1623
1624
|
});
|
|
1624
1625
|
const resolvedFiles = await Promise.all(promises);
|
|
1625
1626
|
if (files.length > 1) {
|
|
@@ -1632,8 +1633,8 @@ var _FileManager = class _FileManager {
|
|
|
1632
1633
|
if (exportType === false) {
|
|
1633
1634
|
return void 0;
|
|
1634
1635
|
}
|
|
1635
|
-
const pathToBuildFrom =
|
|
1636
|
-
const exportPath = output.path.startsWith("./") ?
|
|
1636
|
+
const pathToBuildFrom = _path.resolve.call(void 0, root, output.path);
|
|
1637
|
+
const exportPath = output.path.startsWith("./") ? _chunkXXN4BH6Xcjs.trimExtName.call(void 0, output.path) : `./${_chunkXXN4BH6Xcjs.trimExtName.call(void 0, output.path)}`;
|
|
1637
1638
|
const mode = _FileManager.getMode(output.path);
|
|
1638
1639
|
const barrelManager = new BarrelManager({ extName: output.extName, ...options });
|
|
1639
1640
|
let files = barrelManager.getIndexes(pathToBuildFrom);
|
|
@@ -1653,7 +1654,7 @@ var _FileManager = class _FileManager {
|
|
|
1653
1654
|
}
|
|
1654
1655
|
await Promise.all(
|
|
1655
1656
|
files.map((file) => {
|
|
1656
|
-
return
|
|
1657
|
+
return _chunkDJLNT4KCcjs.__privateMethod.call(void 0, this, _addOrAppend, addOrAppend_fn).call(this, {
|
|
1657
1658
|
...file,
|
|
1658
1659
|
meta: meta ? meta : file.meta
|
|
1659
1660
|
});
|
|
@@ -1661,7 +1662,7 @@ var _FileManager = class _FileManager {
|
|
|
1661
1662
|
);
|
|
1662
1663
|
const rootPath = mode === "directory" ? `${exportPath}/index${output.extName || ""}` : `${exportPath}${output.extName || ""}`;
|
|
1663
1664
|
const rootFile = {
|
|
1664
|
-
path:
|
|
1665
|
+
path: _path.resolve.call(void 0, root, "index.ts"),
|
|
1665
1666
|
baseName: "index.ts",
|
|
1666
1667
|
source: "",
|
|
1667
1668
|
exports: [
|
|
@@ -1676,36 +1677,36 @@ var _FileManager = class _FileManager {
|
|
|
1676
1677
|
}
|
|
1677
1678
|
]
|
|
1678
1679
|
};
|
|
1679
|
-
if (exportType === "barrelNamed" && !output.exportAs && rootFile.exports
|
|
1680
|
+
if (exportType === "barrelNamed" && !output.exportAs && _optionalChain([rootFile, 'access', _30 => _30.exports, 'optionalAccess', _31 => _31[0]])) {
|
|
1680
1681
|
rootFile.exports = barrelManager.getNamedExport(root, rootFile.exports[0]);
|
|
1681
1682
|
}
|
|
1682
|
-
await
|
|
1683
|
+
await _chunkDJLNT4KCcjs.__privateMethod.call(void 0, this, _addOrAppend, addOrAppend_fn).call(this, {
|
|
1683
1684
|
...rootFile,
|
|
1684
1685
|
meta: meta ? meta : rootFile.meta
|
|
1685
1686
|
});
|
|
1686
1687
|
}
|
|
1687
1688
|
getCacheByUUID(UUID) {
|
|
1688
1689
|
let cache;
|
|
1689
|
-
|
|
1690
|
+
_chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _cache).forEach((files) => {
|
|
1690
1691
|
cache = files.find((item) => item.id === UUID);
|
|
1691
1692
|
});
|
|
1692
1693
|
return cache;
|
|
1693
1694
|
}
|
|
1694
1695
|
get(path3) {
|
|
1695
|
-
return
|
|
1696
|
+
return _chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _cache).get(path3);
|
|
1696
1697
|
}
|
|
1697
1698
|
remove(path3) {
|
|
1698
1699
|
const cacheItem = this.get(path3);
|
|
1699
1700
|
if (!cacheItem) {
|
|
1700
1701
|
return;
|
|
1701
1702
|
}
|
|
1702
|
-
|
|
1703
|
+
_chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _cache).delete(path3);
|
|
1703
1704
|
}
|
|
1704
1705
|
async write(...params) {
|
|
1705
|
-
return
|
|
1706
|
+
return _chunkX2JM3GACcjs.write.call(void 0, ...params);
|
|
1706
1707
|
}
|
|
1707
1708
|
async read(...params) {
|
|
1708
|
-
return
|
|
1709
|
+
return _chunkIXCRUQPCcjs.read.call(void 0, ...params);
|
|
1709
1710
|
}
|
|
1710
1711
|
// statics
|
|
1711
1712
|
static getSource(file) {
|
|
@@ -1718,12 +1719,12 @@ var _FileManager = class _FileManager {
|
|
|
1718
1719
|
if (!path3) {
|
|
1719
1720
|
return "directory";
|
|
1720
1721
|
}
|
|
1721
|
-
return
|
|
1722
|
+
return _path.extname.call(void 0, path3) ? "file" : "directory";
|
|
1722
1723
|
}
|
|
1723
1724
|
static get extensions() {
|
|
1724
1725
|
return [".js", ".ts", ".tsx"];
|
|
1725
1726
|
}
|
|
1726
|
-
static
|
|
1727
|
+
static isJavascript(baseName) {
|
|
1727
1728
|
return _FileManager.extensions.some((extension) => baseName.endsWith(extension));
|
|
1728
1729
|
}
|
|
1729
1730
|
};
|
|
@@ -1733,23 +1734,23 @@ _queue3 = new WeakMap();
|
|
|
1733
1734
|
_add = new WeakSet();
|
|
1734
1735
|
add_fn = async function(file) {
|
|
1735
1736
|
const controller = new AbortController();
|
|
1736
|
-
const resolvedFile = { id:
|
|
1737
|
-
|
|
1738
|
-
return
|
|
1737
|
+
const resolvedFile = { id: _crypto2.default.randomUUID(), name: _chunkXXN4BH6Xcjs.trimExtName.call(void 0, file.baseName), ...file };
|
|
1738
|
+
_chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _cache).set(resolvedFile.path, [{ cancel: () => controller.abort(), ...resolvedFile }]);
|
|
1739
|
+
return _chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _queue3).add(
|
|
1739
1740
|
async () => {
|
|
1740
1741
|
var _a;
|
|
1741
|
-
return (_a =
|
|
1742
|
+
return (_a = _chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _task)) == null ? void 0 : _a.call(this, resolvedFile);
|
|
1742
1743
|
},
|
|
1743
1744
|
{ signal: controller.signal }
|
|
1744
1745
|
);
|
|
1745
1746
|
};
|
|
1746
1747
|
_addOrAppend = new WeakSet();
|
|
1747
1748
|
addOrAppend_fn = async function(file) {
|
|
1748
|
-
const previousCaches =
|
|
1749
|
+
const previousCaches = _chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _cache).get(file.path);
|
|
1749
1750
|
const previousCache = previousCaches ? previousCaches.at(previousCaches.length - 1) : void 0;
|
|
1750
1751
|
if (previousCache) {
|
|
1751
|
-
|
|
1752
|
-
return
|
|
1752
|
+
_chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _cache).delete(previousCache.path);
|
|
1753
|
+
return _chunkDJLNT4KCcjs.__privateMethod.call(void 0, this, _add, add_fn).call(this, {
|
|
1753
1754
|
...file,
|
|
1754
1755
|
source: previousCache.source && file.source ? `${previousCache.source}
|
|
1755
1756
|
${file.source}` : "",
|
|
@@ -1758,7 +1759,7 @@ ${file.source}` : "",
|
|
|
1758
1759
|
env: { ...previousCache.env || {}, ...file.env || {} }
|
|
1759
1760
|
});
|
|
1760
1761
|
}
|
|
1761
|
-
return
|
|
1762
|
+
return _chunkDJLNT4KCcjs.__privateMethod.call(void 0, this, _add, add_fn).call(this, file);
|
|
1762
1763
|
};
|
|
1763
1764
|
var FileManager = _FileManager;
|
|
1764
1765
|
function combineFiles(files) {
|
|
@@ -1790,32 +1791,33 @@ ${file.source}` : "",
|
|
|
1790
1791
|
}, []);
|
|
1791
1792
|
}
|
|
1792
1793
|
function getSource(file) {
|
|
1793
|
-
if (!FileManager.
|
|
1794
|
+
if (file.language ? !["typescript", "javascript"].includes(file.language) : !FileManager.isJavascript(file.baseName)) {
|
|
1794
1795
|
return file.source;
|
|
1795
1796
|
}
|
|
1796
1797
|
const exports = file.exports ? combineExports(file.exports) : [];
|
|
1797
|
-
const imports = file.imports ? combineImports(file.imports, exports, file.source) : [];
|
|
1798
|
+
const imports = file.imports && file.source ? combineImports(file.imports, exports, file.source) : [];
|
|
1798
1799
|
const importNodes = imports.filter((item) => {
|
|
1799
|
-
return item.path !==
|
|
1800
|
+
return item.path !== _chunkXXN4BH6Xcjs.trimExtName.call(void 0, file.path);
|
|
1800
1801
|
}).map((item) => {
|
|
1801
|
-
return
|
|
1802
|
+
return factory.createImportDeclaration({
|
|
1802
1803
|
name: item.name,
|
|
1803
|
-
path: item.root ?
|
|
1804
|
+
path: item.root ? _chunkIXCRUQPCcjs.getRelativePath.call(void 0, item.root, item.path) : item.path,
|
|
1804
1805
|
isTypeOnly: item.isTypeOnly
|
|
1805
1806
|
});
|
|
1806
1807
|
});
|
|
1807
1808
|
const exportNodes = exports.map(
|
|
1808
|
-
(item) =>
|
|
1809
|
+
(item) => factory.createExportDeclaration({
|
|
1809
1810
|
name: item.name,
|
|
1810
1811
|
path: item.path,
|
|
1811
1812
|
isTypeOnly: item.isTypeOnly,
|
|
1812
1813
|
asAlias: item.asAlias
|
|
1813
1814
|
})
|
|
1814
1815
|
);
|
|
1815
|
-
|
|
1816
|
+
const source = [_parser.print.call(void 0, [...importNodes, ...exportNodes]), getEnvSource(file.source, file.env)].join("\n");
|
|
1817
|
+
return _parser.print.call(void 0, [], { source, noEmitHelpers: false });
|
|
1816
1818
|
}
|
|
1817
1819
|
function combineExports(exports) {
|
|
1818
|
-
const combinedExports =
|
|
1820
|
+
const combinedExports = _naturalorderby.orderBy.call(void 0, exports, [(v) => !v.isTypeOnly], ["asc"]).reduce((prev, curr) => {
|
|
1819
1821
|
const name = curr.name;
|
|
1820
1822
|
const prevByPath = prev.findLast((imp) => imp.path === curr.path);
|
|
1821
1823
|
const prevByPathAndIsTypeOnly = prev.findLast((imp) => imp.path === curr.path && (0, import_lodash.default)(imp.name, name) && imp.isTypeOnly);
|
|
@@ -1825,7 +1827,7 @@ function combineExports(exports) {
|
|
|
1825
1827
|
const uniquePrev = prev.findLast(
|
|
1826
1828
|
(imp) => imp.path === curr.path && (0, import_lodash.default)(imp.name, name) && imp.isTypeOnly === curr.isTypeOnly && imp.asAlias === curr.asAlias
|
|
1827
1829
|
);
|
|
1828
|
-
if (uniquePrev || Array.isArray(name) && !name.length || prevByPath
|
|
1830
|
+
if (uniquePrev || Array.isArray(name) && !name.length || _optionalChain([prevByPath, 'optionalAccess', _32 => _32.asAlias]) && !curr.asAlias) {
|
|
1829
1831
|
return prev;
|
|
1830
1832
|
}
|
|
1831
1833
|
if (!prevByPath) {
|
|
@@ -1843,10 +1845,10 @@ function combineExports(exports) {
|
|
|
1843
1845
|
}
|
|
1844
1846
|
return [...prev, curr];
|
|
1845
1847
|
}, []);
|
|
1846
|
-
return
|
|
1848
|
+
return _naturalorderby.orderBy.call(void 0, combinedExports, [(v) => !v.isTypeOnly, (v) => v.asAlias], ["desc", "desc"]);
|
|
1847
1849
|
}
|
|
1848
1850
|
function combineImports(imports, exports, source) {
|
|
1849
|
-
const combinedImports =
|
|
1851
|
+
const combinedImports = _naturalorderby.orderBy.call(void 0, imports, [(v) => !v.isTypeOnly], ["asc"]).reduce((prev, curr) => {
|
|
1850
1852
|
let name = Array.isArray(curr.name) ? [...new Set(curr.name)] : curr.name;
|
|
1851
1853
|
const hasImportInSource = (importName) => {
|
|
1852
1854
|
if (!source) {
|
|
@@ -1885,7 +1887,7 @@ function combineImports(imports, exports, source) {
|
|
|
1885
1887
|
}
|
|
1886
1888
|
return [...prev, curr];
|
|
1887
1889
|
}, []);
|
|
1888
|
-
return
|
|
1890
|
+
return _naturalorderby.orderBy.call(void 0, combinedImports, [(v) => !v.isTypeOnly], ["desc"]);
|
|
1889
1891
|
}
|
|
1890
1892
|
function getEnvSource(source, env) {
|
|
1891
1893
|
if (!env) {
|
|
@@ -1897,13 +1899,13 @@ function getEnvSource(source, env) {
|
|
|
1897
1899
|
}
|
|
1898
1900
|
return keys.reduce((prev, key) => {
|
|
1899
1901
|
const environmentValue = env[key];
|
|
1900
|
-
const replaceBy = environmentValue ? `'${environmentValue.replaceAll('"', "")
|
|
1902
|
+
const replaceBy = environmentValue ? `'${_optionalChain([environmentValue, 'access', _33 => _33.replaceAll, 'call', _34 => _34('"', ""), 'optionalAccess', _35 => _35.replaceAll, 'call', _36 => _36("'", "")])}'` : "undefined";
|
|
1901
1903
|
if (key.toUpperCase() !== key) {
|
|
1902
1904
|
throw new TypeError(`Environment should be in upperCase for ${key}`);
|
|
1903
1905
|
}
|
|
1904
1906
|
if (typeof replaceBy === "string") {
|
|
1905
|
-
prev =
|
|
1906
|
-
prev =
|
|
1907
|
+
prev = _chunkXXN4BH6Xcjs.searchAndReplace.call(void 0, { text: prev.replaceAll(`process.env.${key}`, replaceBy), replaceBy, prefix: "process.env", key });
|
|
1908
|
+
prev = _chunkXXN4BH6Xcjs.searchAndReplace.call(void 0, { text: prev.replaceAll(new RegExp(`(declare const).*
|
|
1907
1909
|
`, "ig"), ""), replaceBy, key });
|
|
1908
1910
|
}
|
|
1909
1911
|
return prev;
|
|
@@ -1911,10 +1913,10 @@ function getEnvSource(source, env) {
|
|
|
1911
1913
|
}
|
|
1912
1914
|
|
|
1913
1915
|
// src/errors.ts
|
|
1914
|
-
|
|
1916
|
+
_chunkDJLNT4KCcjs.init_cjs_shims.call(void 0, );
|
|
1915
1917
|
var Warning = class extends Error {
|
|
1916
1918
|
constructor(message, options) {
|
|
1917
|
-
super(message, { cause: options
|
|
1919
|
+
super(message, { cause: _optionalChain([options, 'optionalAccess', _37 => _37.cause]) });
|
|
1918
1920
|
this.name = "Warning";
|
|
1919
1921
|
}
|
|
1920
1922
|
};
|
|
@@ -1922,10 +1924,11 @@ var ValidationPluginError = class extends Error {
|
|
|
1922
1924
|
};
|
|
1923
1925
|
|
|
1924
1926
|
// src/plugin.ts
|
|
1925
|
-
|
|
1927
|
+
_chunkDJLNT4KCcjs.init_cjs_shims.call(void 0, );
|
|
1928
|
+
|
|
1926
1929
|
|
|
1927
1930
|
// src/utils/cache.ts
|
|
1928
|
-
|
|
1931
|
+
_chunkDJLNT4KCcjs.init_cjs_shims.call(void 0, );
|
|
1929
1932
|
function createPluginCache(Store = /* @__PURE__ */ Object.create(null)) {
|
|
1930
1933
|
return {
|
|
1931
1934
|
set(id, value) {
|
|
@@ -1993,8 +1996,8 @@ var definePlugin = createPlugin((options) => {
|
|
|
1993
1996
|
};
|
|
1994
1997
|
},
|
|
1995
1998
|
resolvePath(baseName) {
|
|
1996
|
-
const root =
|
|
1997
|
-
return
|
|
1999
|
+
const root = _path2.default.resolve(this.config.root, this.config.output.path);
|
|
2000
|
+
return _path2.default.resolve(root, baseName);
|
|
1998
2001
|
},
|
|
1999
2002
|
resolveName(name) {
|
|
2000
2003
|
return name;
|
|
@@ -2003,10 +2006,10 @@ var definePlugin = createPlugin((options) => {
|
|
|
2003
2006
|
});
|
|
2004
2007
|
|
|
2005
2008
|
// src/PromiseManager.ts
|
|
2006
|
-
|
|
2009
|
+
_chunkDJLNT4KCcjs.init_cjs_shims.call(void 0, );
|
|
2007
2010
|
|
|
2008
2011
|
// src/utils/executeStrategies.ts
|
|
2009
|
-
|
|
2012
|
+
_chunkDJLNT4KCcjs.init_cjs_shims.call(void 0, );
|
|
2010
2013
|
function hookSeq(promises) {
|
|
2011
2014
|
return promises.filter(Boolean).reduce(
|
|
2012
2015
|
(promise, func) => {
|
|
@@ -2044,8 +2047,8 @@ function hookParallel(promises) {
|
|
|
2044
2047
|
var _options2;
|
|
2045
2048
|
var PromiseManager = class {
|
|
2046
2049
|
constructor(options = {}) {
|
|
2047
|
-
|
|
2048
|
-
|
|
2050
|
+
_chunkDJLNT4KCcjs.__privateAdd.call(void 0, this, _options2, {});
|
|
2051
|
+
_chunkDJLNT4KCcjs.__privateSet.call(void 0, this, _options2, options);
|
|
2049
2052
|
return this;
|
|
2050
2053
|
}
|
|
2051
2054
|
run(strategy, promises) {
|
|
@@ -2053,7 +2056,7 @@ var PromiseManager = class {
|
|
|
2053
2056
|
return hookSeq(promises);
|
|
2054
2057
|
}
|
|
2055
2058
|
if (strategy === "first") {
|
|
2056
|
-
return hookFirst(promises,
|
|
2059
|
+
return hookFirst(promises, _chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _options2).nullCheck);
|
|
2057
2060
|
}
|
|
2058
2061
|
if (strategy === "parallel") {
|
|
2059
2062
|
return hookParallel(promises);
|
|
@@ -2063,19 +2066,19 @@ var PromiseManager = class {
|
|
|
2063
2066
|
};
|
|
2064
2067
|
_options2 = new WeakMap();
|
|
2065
2068
|
function isPromise(result) {
|
|
2066
|
-
return !!result && typeof result
|
|
2069
|
+
return !!result && typeof _optionalChain([result, 'optionalAccess', _38 => _38.then]) === "function";
|
|
2067
2070
|
}
|
|
2068
2071
|
function isPromiseRejectedResult(result) {
|
|
2069
2072
|
return result.status === "rejected";
|
|
2070
2073
|
}
|
|
2071
2074
|
|
|
2072
2075
|
// src/PluginManager.ts
|
|
2073
|
-
|
|
2076
|
+
_chunkDJLNT4KCcjs.init_cjs_shims.call(void 0, );
|
|
2074
2077
|
var _core, _usedPluginNames, _promiseManager, _getSortedPlugins, getSortedPlugins_fn, _addExecutedToCallStack, addExecutedToCallStack_fn, _execute, execute_fn, _executeSync, executeSync_fn, _catcher, catcher_fn, _parse, parse_fn;
|
|
2075
2078
|
var PluginManager = class {
|
|
2076
2079
|
constructor(config, options) {
|
|
2077
|
-
|
|
2078
|
-
|
|
2080
|
+
_chunkDJLNT4KCcjs.__privateAdd.call(void 0, this, _getSortedPlugins);
|
|
2081
|
+
_chunkDJLNT4KCcjs.__privateAdd.call(void 0, this, _addExecutedToCallStack);
|
|
2079
2082
|
/**
|
|
2080
2083
|
* Run an async plugin hook and return the result.
|
|
2081
2084
|
* @param hookName Name of the plugin hook. Must be either in `PluginHooks` or `OutputPluginValueHooks`.
|
|
@@ -2083,7 +2086,7 @@ var PluginManager = class {
|
|
|
2083
2086
|
* @param plugin The actual pluginObject to run.
|
|
2084
2087
|
*/
|
|
2085
2088
|
// Implementation signature
|
|
2086
|
-
|
|
2089
|
+
_chunkDJLNT4KCcjs.__privateAdd.call(void 0, this, _execute);
|
|
2087
2090
|
/**
|
|
2088
2091
|
* Run a sync plugin hook and return the result.
|
|
2089
2092
|
* @param hookName Name of the plugin hook. Must be in `PluginHooks`.
|
|
@@ -2091,14 +2094,14 @@ var PluginManager = class {
|
|
|
2091
2094
|
* @param plugin The acutal plugin
|
|
2092
2095
|
* @param replaceContext When passed, the plugin context can be overridden.
|
|
2093
2096
|
*/
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
this.events = new
|
|
2097
|
+
_chunkDJLNT4KCcjs.__privateAdd.call(void 0, this, _executeSync);
|
|
2098
|
+
_chunkDJLNT4KCcjs.__privateAdd.call(void 0, this, _catcher);
|
|
2099
|
+
_chunkDJLNT4KCcjs.__privateAdd.call(void 0, this, _parse);
|
|
2100
|
+
this.events = new (0, _chunkZJ6GI35Acjs.EventEmitter)();
|
|
2098
2101
|
this.executed = [];
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
+
_chunkDJLNT4KCcjs.__privateAdd.call(void 0, this, _core, void 0);
|
|
2103
|
+
_chunkDJLNT4KCcjs.__privateAdd.call(void 0, this, _usedPluginNames, {});
|
|
2104
|
+
_chunkDJLNT4KCcjs.__privateAdd.call(void 0, this, _promiseManager, void 0);
|
|
2102
2105
|
this.resolvePath = (params) => {
|
|
2103
2106
|
if (params.pluginKey) {
|
|
2104
2107
|
const paths = this.hookForPluginSync({
|
|
@@ -2106,7 +2109,7 @@ var PluginManager = class {
|
|
|
2106
2109
|
hookName: "resolvePath",
|
|
2107
2110
|
parameters: [params.baseName, params.directory, params.options]
|
|
2108
2111
|
});
|
|
2109
|
-
if (paths && paths
|
|
2112
|
+
if (paths && _optionalChain([paths, 'optionalAccess', _39 => _39.length]) > 1 && this.logger.logLevel === _chunkZJ6GI35Acjs.LogLevel.debug) {
|
|
2110
2113
|
this.logger.emit("debug", [
|
|
2111
2114
|
`Cannot return a path where the 'pluginKey' ${params.pluginKey ? JSON.stringify(params.pluginKey) : '"'} is not unique enough
|
|
2112
2115
|
|
|
@@ -2116,7 +2119,7 @@ Falling back on the first item.
|
|
|
2116
2119
|
`
|
|
2117
2120
|
]);
|
|
2118
2121
|
}
|
|
2119
|
-
return paths
|
|
2122
|
+
return _optionalChain([paths, 'optionalAccess', _40 => _40.at, 'call', _41 => _41(0)]);
|
|
2120
2123
|
}
|
|
2121
2124
|
return this.hookFirstSync({
|
|
2122
2125
|
hookName: "resolvePath",
|
|
@@ -2130,7 +2133,7 @@ Falling back on the first item.
|
|
|
2130
2133
|
hookName: "resolveName",
|
|
2131
2134
|
parameters: [params.name, params.type]
|
|
2132
2135
|
});
|
|
2133
|
-
if (names && names
|
|
2136
|
+
if (names && _optionalChain([names, 'optionalAccess', _42 => _42.length]) > 1 && this.logger.logLevel === _chunkZJ6GI35Acjs.LogLevel.debug) {
|
|
2134
2137
|
this.logger.emit("debug", [
|
|
2135
2138
|
`Cannot return a name where the 'pluginKey' ${params.pluginKey ? JSON.stringify(params.pluginKey) : '"'} is not unique enough
|
|
2136
2139
|
|
|
@@ -2140,19 +2143,19 @@ Falling back on the first item.
|
|
|
2140
2143
|
`
|
|
2141
2144
|
]);
|
|
2142
2145
|
}
|
|
2143
|
-
return
|
|
2146
|
+
return _chunkXXN4BH6Xcjs.transformReservedWord.call(void 0, _optionalChain([names, 'optionalAccess', _43 => _43.at, 'call', _44 => _44(0)]) || params.name);
|
|
2144
2147
|
}
|
|
2145
2148
|
const name = this.hookFirstSync({
|
|
2146
2149
|
hookName: "resolveName",
|
|
2147
2150
|
parameters: [params.name, params.type]
|
|
2148
2151
|
}).result;
|
|
2149
|
-
return
|
|
2152
|
+
return _chunkXXN4BH6Xcjs.transformReservedWord.call(void 0, name);
|
|
2150
2153
|
};
|
|
2151
2154
|
this.config = config;
|
|
2152
2155
|
this.logger = options.logger;
|
|
2153
2156
|
this.queue = new PQueue({ concurrency: 1 });
|
|
2154
2157
|
this.fileManager = new FileManager({ task: options.task, queue: this.queue });
|
|
2155
|
-
|
|
2158
|
+
_chunkDJLNT4KCcjs.__privateSet.call(void 0, this, _promiseManager, new PromiseManager({ nullCheck: (state) => !!_optionalChain([state, 'optionalAccess', _45 => _45.result]) }));
|
|
2156
2159
|
const plugins = config.plugins || [];
|
|
2157
2160
|
const core = definePlugin({
|
|
2158
2161
|
config,
|
|
@@ -2161,11 +2164,11 @@ Falling back on the first item.
|
|
|
2161
2164
|
fileManager: this.fileManager,
|
|
2162
2165
|
resolvePath: this.resolvePath.bind(this),
|
|
2163
2166
|
resolveName: this.resolveName.bind(this),
|
|
2164
|
-
getPlugins:
|
|
2167
|
+
getPlugins: _chunkDJLNT4KCcjs.__privateMethod.call(void 0, this, _getSortedPlugins, getSortedPlugins_fn).bind(this)
|
|
2165
2168
|
});
|
|
2166
|
-
|
|
2167
|
-
this.plugins = [
|
|
2168
|
-
return
|
|
2169
|
+
_chunkDJLNT4KCcjs.__privateSet.call(void 0, this, _core, _chunkDJLNT4KCcjs.__privateMethod.call(void 0, this, _parse, parse_fn).call(this, core, this, core.api.call(null)));
|
|
2170
|
+
this.plugins = [_chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _core), ...plugins].map((plugin) => {
|
|
2171
|
+
return _chunkDJLNT4KCcjs.__privateMethod.call(void 0, this, _parse, parse_fn).call(this, plugin, this, _chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _core).api);
|
|
2169
2172
|
});
|
|
2170
2173
|
return this;
|
|
2171
2174
|
}
|
|
@@ -2185,7 +2188,7 @@ Falling back on the first item.
|
|
|
2185
2188
|
}) {
|
|
2186
2189
|
const plugins = this.getPluginsByKey(hookName, pluginKey);
|
|
2187
2190
|
const promises = plugins.map((plugin) => {
|
|
2188
|
-
return
|
|
2191
|
+
return _chunkDJLNT4KCcjs.__privateMethod.call(void 0, this, _execute, execute_fn).call(this, {
|
|
2189
2192
|
strategy: "hookFirst",
|
|
2190
2193
|
hookName,
|
|
2191
2194
|
parameters,
|
|
@@ -2204,7 +2207,7 @@ Falling back on the first item.
|
|
|
2204
2207
|
}) {
|
|
2205
2208
|
const plugins = this.getPluginsByKey(hookName, pluginKey);
|
|
2206
2209
|
return plugins.map((plugin) => {
|
|
2207
|
-
return
|
|
2210
|
+
return _chunkDJLNT4KCcjs.__privateMethod.call(void 0, this, _executeSync, executeSync_fn).call(this, {
|
|
2208
2211
|
strategy: "hookFirst",
|
|
2209
2212
|
hookName,
|
|
2210
2213
|
parameters,
|
|
@@ -2220,11 +2223,11 @@ Falling back on the first item.
|
|
|
2220
2223
|
parameters,
|
|
2221
2224
|
skipped
|
|
2222
2225
|
}) {
|
|
2223
|
-
const promises =
|
|
2226
|
+
const promises = _chunkDJLNT4KCcjs.__privateMethod.call(void 0, this, _getSortedPlugins, getSortedPlugins_fn).call(this).filter((plugin) => {
|
|
2224
2227
|
return skipped ? skipped.has(plugin) : true;
|
|
2225
2228
|
}).map((plugin) => {
|
|
2226
2229
|
return async () => {
|
|
2227
|
-
const value = await
|
|
2230
|
+
const value = await _chunkDJLNT4KCcjs.__privateMethod.call(void 0, this, _execute, execute_fn).call(this, {
|
|
2228
2231
|
strategy: "hookFirst",
|
|
2229
2232
|
hookName,
|
|
2230
2233
|
parameters,
|
|
@@ -2238,7 +2241,7 @@ Falling back on the first item.
|
|
|
2238
2241
|
);
|
|
2239
2242
|
};
|
|
2240
2243
|
});
|
|
2241
|
-
return
|
|
2244
|
+
return _chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _promiseManager).run("first", promises);
|
|
2242
2245
|
}
|
|
2243
2246
|
/**
|
|
2244
2247
|
* First non-null result stops and will return it's value.
|
|
@@ -2249,12 +2252,12 @@ Falling back on the first item.
|
|
|
2249
2252
|
skipped
|
|
2250
2253
|
}) {
|
|
2251
2254
|
let parseResult = null;
|
|
2252
|
-
for (const plugin of
|
|
2255
|
+
for (const plugin of _chunkDJLNT4KCcjs.__privateMethod.call(void 0, this, _getSortedPlugins, getSortedPlugins_fn).call(this)) {
|
|
2253
2256
|
if (skipped && skipped.has(plugin)) {
|
|
2254
2257
|
continue;
|
|
2255
2258
|
}
|
|
2256
2259
|
parseResult = {
|
|
2257
|
-
result:
|
|
2260
|
+
result: _chunkDJLNT4KCcjs.__privateMethod.call(void 0, this, _executeSync, executeSync_fn).call(this, {
|
|
2258
2261
|
strategy: "hookFirst",
|
|
2259
2262
|
hookName,
|
|
2260
2263
|
parameters,
|
|
@@ -2262,7 +2265,7 @@ Falling back on the first item.
|
|
|
2262
2265
|
}),
|
|
2263
2266
|
plugin
|
|
2264
2267
|
};
|
|
2265
|
-
if (parseResult
|
|
2268
|
+
if (_optionalChain([parseResult, 'optionalAccess', _46 => _46.result]) != null) {
|
|
2266
2269
|
break;
|
|
2267
2270
|
}
|
|
2268
2271
|
}
|
|
@@ -2275,14 +2278,14 @@ Falling back on the first item.
|
|
|
2275
2278
|
hookName,
|
|
2276
2279
|
parameters
|
|
2277
2280
|
}) {
|
|
2278
|
-
const promises =
|
|
2279
|
-
return () =>
|
|
2281
|
+
const promises = _chunkDJLNT4KCcjs.__privateMethod.call(void 0, this, _getSortedPlugins, getSortedPlugins_fn).call(this).map((plugin) => {
|
|
2282
|
+
return () => _chunkDJLNT4KCcjs.__privateMethod.call(void 0, this, _execute, execute_fn).call(this, { strategy: "hookParallel", hookName, parameters, plugin });
|
|
2280
2283
|
});
|
|
2281
|
-
const results = await
|
|
2284
|
+
const results = await _chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _promiseManager).run("parallel", promises);
|
|
2282
2285
|
results.forEach((result, index) => {
|
|
2283
2286
|
if (isPromiseRejectedResult(result)) {
|
|
2284
|
-
const plugin =
|
|
2285
|
-
|
|
2287
|
+
const plugin = _chunkDJLNT4KCcjs.__privateMethod.call(void 0, this, _getSortedPlugins, getSortedPlugins_fn).call(this)[index];
|
|
2288
|
+
_chunkDJLNT4KCcjs.__privateMethod.call(void 0, this, _catcher, catcher_fn).call(this, result.reason, plugin, hookName);
|
|
2286
2289
|
}
|
|
2287
2290
|
});
|
|
2288
2291
|
return results.filter((result) => result.status === "fulfilled").map((result) => result.value);
|
|
@@ -2297,16 +2300,16 @@ Falling back on the first item.
|
|
|
2297
2300
|
}) {
|
|
2298
2301
|
const [argument0, ...rest] = parameters;
|
|
2299
2302
|
let promise = Promise.resolve(argument0);
|
|
2300
|
-
for (const plugin of
|
|
2303
|
+
for (const plugin of _chunkDJLNT4KCcjs.__privateMethod.call(void 0, this, _getSortedPlugins, getSortedPlugins_fn).call(this)) {
|
|
2301
2304
|
promise = promise.then((arg0) => {
|
|
2302
|
-
const value =
|
|
2305
|
+
const value = _chunkDJLNT4KCcjs.__privateMethod.call(void 0, this, _execute, execute_fn).call(this, {
|
|
2303
2306
|
strategy: "hookReduceArg0",
|
|
2304
2307
|
hookName,
|
|
2305
2308
|
parameters: [arg0, ...rest],
|
|
2306
2309
|
plugin
|
|
2307
2310
|
});
|
|
2308
2311
|
return value;
|
|
2309
|
-
}).then((result) => reduce.call(
|
|
2312
|
+
}).then((result) => reduce.call(_chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _core).api, argument0, result, plugin));
|
|
2310
2313
|
}
|
|
2311
2314
|
return promise;
|
|
2312
2315
|
}
|
|
@@ -2314,31 +2317,31 @@ Falling back on the first item.
|
|
|
2314
2317
|
* Chains plugins
|
|
2315
2318
|
*/
|
|
2316
2319
|
async hookSeq({ hookName, parameters }) {
|
|
2317
|
-
const promises =
|
|
2318
|
-
return () =>
|
|
2320
|
+
const promises = _chunkDJLNT4KCcjs.__privateMethod.call(void 0, this, _getSortedPlugins, getSortedPlugins_fn).call(this).map((plugin) => {
|
|
2321
|
+
return () => _chunkDJLNT4KCcjs.__privateMethod.call(void 0, this, _execute, execute_fn).call(this, {
|
|
2319
2322
|
strategy: "hookSeq",
|
|
2320
2323
|
hookName,
|
|
2321
2324
|
parameters,
|
|
2322
2325
|
plugin
|
|
2323
2326
|
});
|
|
2324
2327
|
});
|
|
2325
|
-
return
|
|
2328
|
+
return _chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _promiseManager).run("seq", promises);
|
|
2326
2329
|
}
|
|
2327
2330
|
getPluginsByKey(hookName, pluginKey) {
|
|
2328
2331
|
const plugins = [...this.plugins];
|
|
2329
2332
|
const [searchPluginName, searchIdentifier] = pluginKey;
|
|
2330
2333
|
const pluginByPluginName = plugins.filter((plugin) => plugin[hookName]).filter((item) => {
|
|
2331
2334
|
const [name, identifier] = item.key;
|
|
2332
|
-
const identifierCheck = identifier
|
|
2335
|
+
const identifierCheck = _optionalChain([identifier, 'optionalAccess', _47 => _47.toString, 'call', _48 => _48()]) === _optionalChain([searchIdentifier, 'optionalAccess', _49 => _49.toString, 'call', _50 => _50()]);
|
|
2333
2336
|
const nameCheck = name === searchPluginName;
|
|
2334
2337
|
if (searchIdentifier) {
|
|
2335
2338
|
return identifierCheck && nameCheck;
|
|
2336
2339
|
}
|
|
2337
2340
|
return nameCheck;
|
|
2338
2341
|
});
|
|
2339
|
-
if (!pluginByPluginName
|
|
2342
|
+
if (!_optionalChain([pluginByPluginName, 'optionalAccess', _51 => _51.length])) {
|
|
2340
2343
|
const corePlugin = plugins.find((plugin) => plugin.name === "core" && plugin[hookName]);
|
|
2341
|
-
if (this.logger.logLevel ===
|
|
2344
|
+
if (this.logger.logLevel === _chunkZJ6GI35Acjs.LogLevel.debug) {
|
|
2342
2345
|
if (corePlugin) {
|
|
2343
2346
|
this.logger.emit("debug", [`No hook '${hookName}' for pluginKey '${JSON.stringify(pluginKey)}' found, falling back on the '@kubb/core' plugin`]);
|
|
2344
2347
|
} else {
|
|
@@ -2376,7 +2379,7 @@ _getSortedPlugins = new WeakSet();
|
|
|
2376
2379
|
getSortedPlugins_fn = function(hookName) {
|
|
2377
2380
|
const plugins = [...this.plugins].filter((plugin) => plugin.name !== "core");
|
|
2378
2381
|
if (hookName) {
|
|
2379
|
-
if (this.logger.logLevel ===
|
|
2382
|
+
if (this.logger.logLevel === _chunkZJ6GI35Acjs.LogLevel.info) {
|
|
2380
2383
|
const containsHookName = plugins.some((item) => item[hookName]);
|
|
2381
2384
|
if (!containsHookName) {
|
|
2382
2385
|
this.logger.emit("warning", `No hook ${hookName} found`);
|
|
@@ -2393,10 +2396,10 @@ getSortedPlugins_fn = function(hookName) {
|
|
|
2393
2396
|
}
|
|
2394
2397
|
return plugin;
|
|
2395
2398
|
}).sort((a, b) => {
|
|
2396
|
-
if (b.pre
|
|
2399
|
+
if (_optionalChain([b, 'access', _52 => _52.pre, 'optionalAccess', _53 => _53.includes, 'call', _54 => _54(a.name)])) {
|
|
2397
2400
|
return 1;
|
|
2398
2401
|
}
|
|
2399
|
-
if (b.post
|
|
2402
|
+
if (_optionalChain([b, 'access', _55 => _55.post, 'optionalAccess', _56 => _56.includes, 'call', _57 => _57(a.name)])) {
|
|
2400
2403
|
return -1;
|
|
2401
2404
|
}
|
|
2402
2405
|
return 0;
|
|
@@ -2424,7 +2427,7 @@ execute_fn = function({
|
|
|
2424
2427
|
this.events.emit("execute", { strategy, hookName, parameters, plugin });
|
|
2425
2428
|
const task = Promise.resolve().then(() => {
|
|
2426
2429
|
if (typeof hook === "function") {
|
|
2427
|
-
const possiblePromiseResult = hook.apply({ ...
|
|
2430
|
+
const possiblePromiseResult = hook.apply({ ..._chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _core).api, plugin }, parameters);
|
|
2428
2431
|
if (isPromise(possiblePromiseResult)) {
|
|
2429
2432
|
return Promise.resolve(possiblePromiseResult);
|
|
2430
2433
|
}
|
|
@@ -2433,7 +2436,7 @@ execute_fn = function({
|
|
|
2433
2436
|
return hook;
|
|
2434
2437
|
}).then((result) => {
|
|
2435
2438
|
output = result;
|
|
2436
|
-
|
|
2439
|
+
_chunkDJLNT4KCcjs.__privateMethod.call(void 0, this, _addExecutedToCallStack, addExecutedToCallStack_fn).call(this, {
|
|
2437
2440
|
parameters,
|
|
2438
2441
|
output,
|
|
2439
2442
|
strategy,
|
|
@@ -2442,7 +2445,7 @@ execute_fn = function({
|
|
|
2442
2445
|
});
|
|
2443
2446
|
return result;
|
|
2444
2447
|
}).catch((e) => {
|
|
2445
|
-
|
|
2448
|
+
_chunkDJLNT4KCcjs.__privateMethod.call(void 0, this, _catcher, catcher_fn).call(this, e, plugin, hookName);
|
|
2446
2449
|
return null;
|
|
2447
2450
|
});
|
|
2448
2451
|
return task;
|
|
@@ -2462,12 +2465,12 @@ executeSync_fn = function({
|
|
|
2462
2465
|
this.events.emit("execute", { strategy, hookName, parameters, plugin });
|
|
2463
2466
|
try {
|
|
2464
2467
|
if (typeof hook === "function") {
|
|
2465
|
-
const fn = hook.apply({ ...
|
|
2468
|
+
const fn = hook.apply({ ..._chunkDJLNT4KCcjs.__privateGet.call(void 0, this, _core).api, plugin }, parameters);
|
|
2466
2469
|
output = fn;
|
|
2467
2470
|
return fn;
|
|
2468
2471
|
}
|
|
2469
2472
|
output = hook;
|
|
2470
|
-
|
|
2473
|
+
_chunkDJLNT4KCcjs.__privateMethod.call(void 0, this, _addExecutedToCallStack, addExecutedToCallStack_fn).call(this, {
|
|
2471
2474
|
parameters,
|
|
2472
2475
|
output,
|
|
2473
2476
|
strategy,
|
|
@@ -2476,21 +2479,21 @@ executeSync_fn = function({
|
|
|
2476
2479
|
});
|
|
2477
2480
|
return hook;
|
|
2478
2481
|
} catch (e) {
|
|
2479
|
-
|
|
2482
|
+
_chunkDJLNT4KCcjs.__privateMethod.call(void 0, this, _catcher, catcher_fn).call(this, e, plugin, hookName);
|
|
2480
2483
|
return null;
|
|
2481
2484
|
}
|
|
2482
2485
|
};
|
|
2483
2486
|
_catcher = new WeakSet();
|
|
2484
2487
|
catcher_fn = function(e, plugin, hookName) {
|
|
2485
|
-
const text = `${e.message} (plugin: ${plugin
|
|
2488
|
+
const text = `${e.message} (plugin: ${_optionalChain([plugin, 'optionalAccess', _58 => _58.name]) || "unknown"}, hook: ${hookName || "unknown"})
|
|
2486
2489
|
`;
|
|
2487
2490
|
this.logger.emit("error", text);
|
|
2488
2491
|
this.events.emit("error", e);
|
|
2489
2492
|
};
|
|
2490
2493
|
_parse = new WeakSet();
|
|
2491
2494
|
parse_fn = function(plugin, pluginManager, context) {
|
|
2492
|
-
const usedPluginNames =
|
|
2493
|
-
|
|
2495
|
+
const usedPluginNames = _chunkDJLNT4KCcjs.__privateGet.call(void 0, pluginManager, _usedPluginNames);
|
|
2496
|
+
_chunkGNWOOGXAcjs.setUniqueName.call(void 0, plugin.name, usedPluginNames);
|
|
2494
2497
|
const key = [plugin.name, usedPluginNames[plugin.name]].filter(Boolean);
|
|
2495
2498
|
if (!plugin.transform) {
|
|
2496
2499
|
plugin.transform = function transform(code) {
|
|
@@ -2511,12 +2514,14 @@ parse_fn = function(plugin, pluginManager, context) {
|
|
|
2511
2514
|
};
|
|
2512
2515
|
};
|
|
2513
2516
|
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2517
|
+
|
|
2518
|
+
|
|
2519
|
+
|
|
2520
|
+
|
|
2521
|
+
|
|
2522
|
+
|
|
2523
|
+
|
|
2524
|
+
|
|
2525
|
+
|
|
2526
|
+
exports.KubbFile = KubbFile; exports.FileManager = FileManager; exports.Warning = Warning; exports.createPlugin = createPlugin; exports.pluginName = pluginName; exports.PromiseManager = PromiseManager; exports.isPromise = isPromise; exports.PluginManager = PluginManager;
|
|
2527
|
+
//# sourceMappingURL=chunk-FNHECX2X.cjs.map
|