@kubb/core 2.6.3 → 2.6.5
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-LX3C2KYZ.cjs → chunk-2YPJ2PU6.cjs} +3 -3
- package/dist/{chunk-LX3C2KYZ.cjs.map → chunk-2YPJ2PU6.cjs.map} +1 -1
- package/dist/{chunk-IZEN6QJW.cjs → chunk-5P3EI3J3.cjs} +4 -4
- package/dist/{chunk-ORSUFOUY.js → chunk-7ENLO2XM.js} +3 -3
- package/dist/{chunk-ORSUFOUY.js.map → chunk-7ENLO2XM.js.map} +1 -1
- package/dist/{chunk-QMJHN2SZ.js → chunk-7VQYBAHZ.js} +2 -2
- package/dist/{chunk-SQ7PJS37.js → chunk-AABVZDWJ.js} +2 -2
- package/dist/{chunk-4ETFEMWH.cjs → chunk-AUXXNU4E.cjs} +3 -3
- package/dist/{chunk-QUDB2AZM.cjs → chunk-BCJRR2TA.cjs} +5 -5
- package/dist/{chunk-KMYQYSXM.js → chunk-DC7TSBAX.js} +2 -2
- package/dist/{chunk-K5BPDI36.js → chunk-DOKFLMTZ.js} +2 -2
- package/dist/{chunk-UP3ABHHJ.js → chunk-EI5BXOWQ.js} +2 -2
- package/dist/{chunk-BMYALID3.js → chunk-GQZLE54N.js} +7 -7
- package/dist/{chunk-BG5SP7MX.js → chunk-GTQX3YE3.js} +3 -3
- package/dist/{chunk-42QBHWTS.cjs → chunk-MYP62TTS.cjs} +214 -214
- package/dist/chunk-NYSHCGJK.cjs +15 -0
- package/dist/{chunk-VARKFQXA.js → chunk-PD4VAMC4.js} +2 -2
- package/dist/{chunk-46M72VA2.js → chunk-RKJEICYC.js} +3 -3
- package/dist/{chunk-AKVDLTIG.cjs → chunk-RVR4GIMH.cjs} +6 -6
- package/dist/{chunk-QNVB4X4Z.cjs → chunk-SFOOQU7X.cjs} +14 -14
- package/dist/{chunk-CLOD7FDI.cjs → chunk-TXURS7MB.cjs} +5 -5
- package/dist/{chunk-LZMHGPYG.cjs → chunk-X7LK5QPJ.cjs} +90 -90
- package/dist/fs.cjs +10 -10
- package/dist/fs.js +4 -4
- package/dist/index.cjs +103 -103
- package/dist/index.js +11 -11
- package/dist/logger.cjs +7 -7
- package/dist/logger.js +3 -3
- package/dist/mocks.cjs +10 -10
- package/dist/mocks.cjs.map +1 -1
- package/dist/mocks.js +8 -8
- package/dist/mocks.js.map +1 -1
- package/dist/transformers.cjs +23 -23
- package/dist/transformers.js +5 -5
- package/dist/utils.cjs +13 -13
- package/dist/utils.js +4 -4
- package/package.json +25 -6
- package/dist/chunk-ZGGS2LJL.cjs +0 -15
- /package/dist/{chunk-IZEN6QJW.cjs.map → chunk-5P3EI3J3.cjs.map} +0 -0
- /package/dist/{chunk-QMJHN2SZ.js.map → chunk-7VQYBAHZ.js.map} +0 -0
- /package/dist/{chunk-SQ7PJS37.js.map → chunk-AABVZDWJ.js.map} +0 -0
- /package/dist/{chunk-4ETFEMWH.cjs.map → chunk-AUXXNU4E.cjs.map} +0 -0
- /package/dist/{chunk-QUDB2AZM.cjs.map → chunk-BCJRR2TA.cjs.map} +0 -0
- /package/dist/{chunk-KMYQYSXM.js.map → chunk-DC7TSBAX.js.map} +0 -0
- /package/dist/{chunk-CLOD7FDI.cjs.map → chunk-DOKFLMTZ.js.map} +0 -0
- /package/dist/{chunk-UP3ABHHJ.js.map → chunk-EI5BXOWQ.js.map} +0 -0
- /package/dist/{chunk-BMYALID3.js.map → chunk-GQZLE54N.js.map} +0 -0
- /package/dist/{chunk-BG5SP7MX.js.map → chunk-GTQX3YE3.js.map} +0 -0
- /package/dist/{chunk-42QBHWTS.cjs.map → chunk-MYP62TTS.cjs.map} +0 -0
- /package/dist/{chunk-ZGGS2LJL.cjs.map → chunk-NYSHCGJK.cjs.map} +0 -0
- /package/dist/{chunk-VARKFQXA.js.map → chunk-PD4VAMC4.js.map} +0 -0
- /package/dist/{chunk-46M72VA2.js.map → chunk-RKJEICYC.js.map} +0 -0
- /package/dist/{chunk-AKVDLTIG.cjs.map → chunk-RVR4GIMH.cjs.map} +0 -0
- /package/dist/{chunk-QNVB4X4Z.cjs.map → chunk-SFOOQU7X.cjs.map} +0 -0
- /package/dist/{chunk-K5BPDI36.js.map → chunk-TXURS7MB.cjs.map} +0 -0
- /package/dist/{chunk-LZMHGPYG.cjs.map → chunk-X7LK5QPJ.cjs.map} +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
3
|
+
var chunkTXURS7MB_cjs = require('./chunk-TXURS7MB.cjs');
|
|
4
|
+
var chunkAUXXNU4E_cjs = require('./chunk-AUXXNU4E.cjs');
|
|
5
|
+
var chunkSFOOQU7X_cjs = require('./chunk-SFOOQU7X.cjs');
|
|
6
|
+
var chunkBCJRR2TA_cjs = require('./chunk-BCJRR2TA.cjs');
|
|
7
|
+
var chunkX7LK5QPJ_cjs = require('./chunk-X7LK5QPJ.cjs');
|
|
8
|
+
var chunk2YPJ2PU6_cjs = require('./chunk-2YPJ2PU6.cjs');
|
|
9
9
|
var crypto = require('crypto');
|
|
10
10
|
var path = require('path');
|
|
11
11
|
var parser = require('@kubb/parser');
|
|
@@ -39,9 +39,9 @@ var factory__namespace = /*#__PURE__*/_interopNamespace(factory);
|
|
|
39
39
|
var dirTree__default = /*#__PURE__*/_interopDefault(dirTree);
|
|
40
40
|
|
|
41
41
|
// ../../node_modules/.pnpm/lodash.isequal@4.5.0/node_modules/lodash.isequal/index.js
|
|
42
|
-
var require_lodash =
|
|
42
|
+
var require_lodash = chunk2YPJ2PU6_cjs.__commonJS({
|
|
43
43
|
"../../node_modules/.pnpm/lodash.isequal@4.5.0/node_modules/lodash.isequal/index.js"(exports, module) {
|
|
44
|
-
|
|
44
|
+
chunk2YPJ2PU6_cjs.init_cjs_shims();
|
|
45
45
|
var LARGE_ARRAY_SIZE = 200;
|
|
46
46
|
var HASH_UNDEFINED = "__lodash_hash_undefined__";
|
|
47
47
|
var COMPARE_PARTIAL_FLAG = 1;
|
|
@@ -741,9 +741,9 @@ var require_lodash = chunkLX3C2KYZ_cjs.__commonJS({
|
|
|
741
741
|
});
|
|
742
742
|
|
|
743
743
|
// ../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.js
|
|
744
|
-
var require_eventemitter3 =
|
|
744
|
+
var require_eventemitter3 = chunk2YPJ2PU6_cjs.__commonJS({
|
|
745
745
|
"../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.js"(exports, module) {
|
|
746
|
-
|
|
746
|
+
chunk2YPJ2PU6_cjs.init_cjs_shims();
|
|
747
747
|
var has = Object.prototype.hasOwnProperty;
|
|
748
748
|
var prefix = "~";
|
|
749
749
|
function Events() {
|
|
@@ -923,18 +923,18 @@ var require_eventemitter3 = chunkLX3C2KYZ_cjs.__commonJS({
|
|
|
923
923
|
});
|
|
924
924
|
|
|
925
925
|
// src/FileManager.ts
|
|
926
|
-
|
|
927
|
-
var import_lodash =
|
|
926
|
+
chunk2YPJ2PU6_cjs.init_cjs_shims();
|
|
927
|
+
var import_lodash = chunk2YPJ2PU6_cjs.__toESM(require_lodash(), 1);
|
|
928
928
|
|
|
929
929
|
// ../../node_modules/.pnpm/p-queue@8.0.1/node_modules/p-queue/dist/index.js
|
|
930
|
-
|
|
930
|
+
chunk2YPJ2PU6_cjs.init_cjs_shims();
|
|
931
931
|
|
|
932
932
|
// ../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.mjs
|
|
933
|
-
|
|
934
|
-
var import_index =
|
|
933
|
+
chunk2YPJ2PU6_cjs.init_cjs_shims();
|
|
934
|
+
var import_index = chunk2YPJ2PU6_cjs.__toESM(require_eventemitter3(), 1);
|
|
935
935
|
|
|
936
936
|
// ../../node_modules/.pnpm/p-timeout@6.1.2/node_modules/p-timeout/index.js
|
|
937
|
-
|
|
937
|
+
chunk2YPJ2PU6_cjs.init_cjs_shims();
|
|
938
938
|
var TimeoutError = class extends Error {
|
|
939
939
|
constructor(message) {
|
|
940
940
|
super(message);
|
|
@@ -1019,10 +1019,10 @@ function pTimeout(promise, options) {
|
|
|
1019
1019
|
}
|
|
1020
1020
|
|
|
1021
1021
|
// ../../node_modules/.pnpm/p-queue@8.0.1/node_modules/p-queue/dist/priority-queue.js
|
|
1022
|
-
|
|
1022
|
+
chunk2YPJ2PU6_cjs.init_cjs_shims();
|
|
1023
1023
|
|
|
1024
1024
|
// ../../node_modules/.pnpm/p-queue@8.0.1/node_modules/p-queue/dist/lower-bound.js
|
|
1025
|
-
|
|
1025
|
+
chunk2YPJ2PU6_cjs.init_cjs_shims();
|
|
1026
1026
|
function lowerBound(array, value, comparator) {
|
|
1027
1027
|
let first = 0;
|
|
1028
1028
|
let count = array.length;
|
|
@@ -1043,7 +1043,7 @@ function lowerBound(array, value, comparator) {
|
|
|
1043
1043
|
var _queue;
|
|
1044
1044
|
var PriorityQueue = class {
|
|
1045
1045
|
constructor() {
|
|
1046
|
-
|
|
1046
|
+
chunk2YPJ2PU6_cjs.__privateAdd(this, _queue, []);
|
|
1047
1047
|
}
|
|
1048
1048
|
enqueue(run, options) {
|
|
1049
1049
|
options = {
|
|
@@ -1054,22 +1054,22 @@ var PriorityQueue = class {
|
|
|
1054
1054
|
priority: options.priority,
|
|
1055
1055
|
run
|
|
1056
1056
|
};
|
|
1057
|
-
if (this.size &&
|
|
1058
|
-
|
|
1057
|
+
if (this.size && chunk2YPJ2PU6_cjs.__privateGet(this, _queue)[this.size - 1].priority >= options.priority) {
|
|
1058
|
+
chunk2YPJ2PU6_cjs.__privateGet(this, _queue).push(element);
|
|
1059
1059
|
return;
|
|
1060
1060
|
}
|
|
1061
|
-
const index = lowerBound(
|
|
1062
|
-
|
|
1061
|
+
const index = lowerBound(chunk2YPJ2PU6_cjs.__privateGet(this, _queue), element, (a, b) => b.priority - a.priority);
|
|
1062
|
+
chunk2YPJ2PU6_cjs.__privateGet(this, _queue).splice(index, 0, element);
|
|
1063
1063
|
}
|
|
1064
1064
|
dequeue() {
|
|
1065
|
-
const item =
|
|
1065
|
+
const item = chunk2YPJ2PU6_cjs.__privateGet(this, _queue).shift();
|
|
1066
1066
|
return item?.run;
|
|
1067
1067
|
}
|
|
1068
1068
|
filter(options) {
|
|
1069
|
-
return
|
|
1069
|
+
return chunk2YPJ2PU6_cjs.__privateGet(this, _queue).filter((element) => element.priority === options.priority).map((element) => element.run);
|
|
1070
1070
|
}
|
|
1071
1071
|
get size() {
|
|
1072
|
-
return
|
|
1072
|
+
return chunk2YPJ2PU6_cjs.__privateGet(this, _queue).length;
|
|
1073
1073
|
}
|
|
1074
1074
|
};
|
|
1075
1075
|
_queue = new WeakMap();
|
|
@@ -1080,41 +1080,41 @@ var PQueue = class extends import_index.default {
|
|
|
1080
1080
|
// TODO: The `throwOnTimeout` option should affect the return types of `add()` and `addAll()`
|
|
1081
1081
|
constructor(options) {
|
|
1082
1082
|
super();
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1083
|
+
chunk2YPJ2PU6_cjs.__privateAdd(this, _doesIntervalAllowAnother);
|
|
1084
|
+
chunk2YPJ2PU6_cjs.__privateAdd(this, _doesConcurrentAllowAnother);
|
|
1085
|
+
chunk2YPJ2PU6_cjs.__privateAdd(this, _next);
|
|
1086
|
+
chunk2YPJ2PU6_cjs.__privateAdd(this, _onResumeInterval);
|
|
1087
|
+
chunk2YPJ2PU6_cjs.__privateAdd(this, _isIntervalPaused);
|
|
1088
|
+
chunk2YPJ2PU6_cjs.__privateAdd(this, _tryToStartAnother);
|
|
1089
|
+
chunk2YPJ2PU6_cjs.__privateAdd(this, _initializeIntervalIfNeeded);
|
|
1090
|
+
chunk2YPJ2PU6_cjs.__privateAdd(this, _onInterval);
|
|
1091
1091
|
/**
|
|
1092
1092
|
Executes all queued functions until it reaches the limit.
|
|
1093
1093
|
*/
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1094
|
+
chunk2YPJ2PU6_cjs.__privateAdd(this, _processQueue);
|
|
1095
|
+
chunk2YPJ2PU6_cjs.__privateAdd(this, _throwOnAbort);
|
|
1096
|
+
chunk2YPJ2PU6_cjs.__privateAdd(this, _onEvent);
|
|
1097
|
+
chunk2YPJ2PU6_cjs.__privateAdd(this, _carryoverConcurrencyCount, void 0);
|
|
1098
|
+
chunk2YPJ2PU6_cjs.__privateAdd(this, _isIntervalIgnored, void 0);
|
|
1099
|
+
chunk2YPJ2PU6_cjs.__privateAdd(this, _intervalCount, 0);
|
|
1100
|
+
chunk2YPJ2PU6_cjs.__privateAdd(this, _intervalCap, void 0);
|
|
1101
|
+
chunk2YPJ2PU6_cjs.__privateAdd(this, _interval, void 0);
|
|
1102
|
+
chunk2YPJ2PU6_cjs.__privateAdd(this, _intervalEnd, 0);
|
|
1103
|
+
chunk2YPJ2PU6_cjs.__privateAdd(this, _intervalId, void 0);
|
|
1104
|
+
chunk2YPJ2PU6_cjs.__privateAdd(this, _timeoutId, void 0);
|
|
1105
|
+
chunk2YPJ2PU6_cjs.__privateAdd(this, _queue2, void 0);
|
|
1106
|
+
chunk2YPJ2PU6_cjs.__privateAdd(this, _queueClass, void 0);
|
|
1107
|
+
chunk2YPJ2PU6_cjs.__privateAdd(this, _pending, 0);
|
|
1108
1108
|
// The `!` is needed because of https://github.com/microsoft/TypeScript/issues/32194
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1109
|
+
chunk2YPJ2PU6_cjs.__privateAdd(this, _concurrency, void 0);
|
|
1110
|
+
chunk2YPJ2PU6_cjs.__privateAdd(this, _isPaused, void 0);
|
|
1111
|
+
chunk2YPJ2PU6_cjs.__privateAdd(this, _throwOnTimeout, void 0);
|
|
1112
1112
|
/**
|
|
1113
1113
|
Per-operation timeout in milliseconds. Operations fulfill once `timeout` elapses if they haven't already.
|
|
1114
1114
|
|
|
1115
1115
|
Applies to each future operation.
|
|
1116
1116
|
*/
|
|
1117
|
-
|
|
1117
|
+
chunk2YPJ2PU6_cjs.__publicField(this, "timeout");
|
|
1118
1118
|
options = {
|
|
1119
1119
|
carryoverConcurrencyCount: false,
|
|
1120
1120
|
intervalCap: Number.POSITIVE_INFINITY,
|
|
@@ -1130,37 +1130,37 @@ var PQueue = class extends import_index.default {
|
|
|
1130
1130
|
if (options.interval === void 0 || !(Number.isFinite(options.interval) && options.interval >= 0)) {
|
|
1131
1131
|
throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${options.interval?.toString() ?? ""}\` (${typeof options.interval})`);
|
|
1132
1132
|
}
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1133
|
+
chunk2YPJ2PU6_cjs.__privateSet(this, _carryoverConcurrencyCount, options.carryoverConcurrencyCount);
|
|
1134
|
+
chunk2YPJ2PU6_cjs.__privateSet(this, _isIntervalIgnored, options.intervalCap === Number.POSITIVE_INFINITY || options.interval === 0);
|
|
1135
|
+
chunk2YPJ2PU6_cjs.__privateSet(this, _intervalCap, options.intervalCap);
|
|
1136
|
+
chunk2YPJ2PU6_cjs.__privateSet(this, _interval, options.interval);
|
|
1137
|
+
chunk2YPJ2PU6_cjs.__privateSet(this, _queue2, new options.queueClass());
|
|
1138
|
+
chunk2YPJ2PU6_cjs.__privateSet(this, _queueClass, options.queueClass);
|
|
1139
1139
|
this.concurrency = options.concurrency;
|
|
1140
1140
|
this.timeout = options.timeout;
|
|
1141
|
-
|
|
1142
|
-
|
|
1141
|
+
chunk2YPJ2PU6_cjs.__privateSet(this, _throwOnTimeout, options.throwOnTimeout === true);
|
|
1142
|
+
chunk2YPJ2PU6_cjs.__privateSet(this, _isPaused, options.autoStart === false);
|
|
1143
1143
|
}
|
|
1144
1144
|
get concurrency() {
|
|
1145
|
-
return
|
|
1145
|
+
return chunk2YPJ2PU6_cjs.__privateGet(this, _concurrency);
|
|
1146
1146
|
}
|
|
1147
1147
|
set concurrency(newConcurrency) {
|
|
1148
1148
|
if (!(typeof newConcurrency === "number" && newConcurrency >= 1)) {
|
|
1149
1149
|
throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${newConcurrency}\` (${typeof newConcurrency})`);
|
|
1150
1150
|
}
|
|
1151
|
-
|
|
1152
|
-
|
|
1151
|
+
chunk2YPJ2PU6_cjs.__privateSet(this, _concurrency, newConcurrency);
|
|
1152
|
+
chunk2YPJ2PU6_cjs.__privateMethod(this, _processQueue, processQueue_fn).call(this);
|
|
1153
1153
|
}
|
|
1154
1154
|
async add(function_, options = {}) {
|
|
1155
1155
|
options = {
|
|
1156
1156
|
timeout: this.timeout,
|
|
1157
|
-
throwOnTimeout:
|
|
1157
|
+
throwOnTimeout: chunk2YPJ2PU6_cjs.__privateGet(this, _throwOnTimeout),
|
|
1158
1158
|
...options
|
|
1159
1159
|
};
|
|
1160
1160
|
return new Promise((resolve2, reject) => {
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1161
|
+
chunk2YPJ2PU6_cjs.__privateGet(this, _queue2).enqueue(async () => {
|
|
1162
|
+
chunk2YPJ2PU6_cjs.__privateWrapper(this, _pending)._++;
|
|
1163
|
+
chunk2YPJ2PU6_cjs.__privateWrapper(this, _intervalCount)._++;
|
|
1164
1164
|
try {
|
|
1165
1165
|
options.signal?.throwIfAborted();
|
|
1166
1166
|
let operation = function_({ signal: options.signal });
|
|
@@ -1168,7 +1168,7 @@ var PQueue = class extends import_index.default {
|
|
|
1168
1168
|
operation = pTimeout(Promise.resolve(operation), { milliseconds: options.timeout });
|
|
1169
1169
|
}
|
|
1170
1170
|
if (options.signal) {
|
|
1171
|
-
operation = Promise.race([operation,
|
|
1171
|
+
operation = Promise.race([operation, chunk2YPJ2PU6_cjs.__privateMethod(this, _throwOnAbort, throwOnAbort_fn).call(this, options.signal)]);
|
|
1172
1172
|
}
|
|
1173
1173
|
const result = await operation;
|
|
1174
1174
|
resolve2(result);
|
|
@@ -1181,11 +1181,11 @@ var PQueue = class extends import_index.default {
|
|
|
1181
1181
|
reject(error);
|
|
1182
1182
|
this.emit("error", error);
|
|
1183
1183
|
} finally {
|
|
1184
|
-
|
|
1184
|
+
chunk2YPJ2PU6_cjs.__privateMethod(this, _next, next_fn).call(this);
|
|
1185
1185
|
}
|
|
1186
1186
|
}, options);
|
|
1187
1187
|
this.emit("add");
|
|
1188
|
-
|
|
1188
|
+
chunk2YPJ2PU6_cjs.__privateMethod(this, _tryToStartAnother, tryToStartAnother_fn).call(this);
|
|
1189
1189
|
});
|
|
1190
1190
|
}
|
|
1191
1191
|
async addAll(functions, options) {
|
|
@@ -1195,24 +1195,24 @@ var PQueue = class extends import_index.default {
|
|
|
1195
1195
|
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
1196
|
*/
|
|
1197
1197
|
start() {
|
|
1198
|
-
if (!
|
|
1198
|
+
if (!chunk2YPJ2PU6_cjs.__privateGet(this, _isPaused)) {
|
|
1199
1199
|
return this;
|
|
1200
1200
|
}
|
|
1201
|
-
|
|
1202
|
-
|
|
1201
|
+
chunk2YPJ2PU6_cjs.__privateSet(this, _isPaused, false);
|
|
1202
|
+
chunk2YPJ2PU6_cjs.__privateMethod(this, _processQueue, processQueue_fn).call(this);
|
|
1203
1203
|
return this;
|
|
1204
1204
|
}
|
|
1205
1205
|
/**
|
|
1206
1206
|
Put queue execution on hold.
|
|
1207
1207
|
*/
|
|
1208
1208
|
pause() {
|
|
1209
|
-
|
|
1209
|
+
chunk2YPJ2PU6_cjs.__privateSet(this, _isPaused, true);
|
|
1210
1210
|
}
|
|
1211
1211
|
/**
|
|
1212
1212
|
Clear the queue.
|
|
1213
1213
|
*/
|
|
1214
1214
|
clear() {
|
|
1215
|
-
|
|
1215
|
+
chunk2YPJ2PU6_cjs.__privateSet(this, _queue2, new (chunk2YPJ2PU6_cjs.__privateGet(this, _queueClass))());
|
|
1216
1216
|
}
|
|
1217
1217
|
/**
|
|
1218
1218
|
Can be called multiple times. Useful if you for example add additional items at a later time.
|
|
@@ -1220,10 +1220,10 @@ var PQueue = class extends import_index.default {
|
|
|
1220
1220
|
@returns A promise that settles when the queue becomes empty.
|
|
1221
1221
|
*/
|
|
1222
1222
|
async onEmpty() {
|
|
1223
|
-
if (
|
|
1223
|
+
if (chunk2YPJ2PU6_cjs.__privateGet(this, _queue2).size === 0) {
|
|
1224
1224
|
return;
|
|
1225
1225
|
}
|
|
1226
|
-
await
|
|
1226
|
+
await chunk2YPJ2PU6_cjs.__privateMethod(this, _onEvent, onEvent_fn).call(this, "empty");
|
|
1227
1227
|
}
|
|
1228
1228
|
/**
|
|
1229
1229
|
@returns A promise that settles when the queue size is less than the given limit: `queue.size < limit`.
|
|
@@ -1233,10 +1233,10 @@ var PQueue = class extends import_index.default {
|
|
|
1233
1233
|
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
1234
|
*/
|
|
1235
1235
|
async onSizeLessThan(limit) {
|
|
1236
|
-
if (
|
|
1236
|
+
if (chunk2YPJ2PU6_cjs.__privateGet(this, _queue2).size < limit) {
|
|
1237
1237
|
return;
|
|
1238
1238
|
}
|
|
1239
|
-
await
|
|
1239
|
+
await chunk2YPJ2PU6_cjs.__privateMethod(this, _onEvent, onEvent_fn).call(this, "next", () => chunk2YPJ2PU6_cjs.__privateGet(this, _queue2).size < limit);
|
|
1240
1240
|
}
|
|
1241
1241
|
/**
|
|
1242
1242
|
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 +1244,16 @@ var PQueue = class extends import_index.default {
|
|
|
1244
1244
|
@returns A promise that settles when the queue becomes empty, and all promises have completed; `queue.size === 0 && queue.pending === 0`.
|
|
1245
1245
|
*/
|
|
1246
1246
|
async onIdle() {
|
|
1247
|
-
if (
|
|
1247
|
+
if (chunk2YPJ2PU6_cjs.__privateGet(this, _pending) === 0 && chunk2YPJ2PU6_cjs.__privateGet(this, _queue2).size === 0) {
|
|
1248
1248
|
return;
|
|
1249
1249
|
}
|
|
1250
|
-
await
|
|
1250
|
+
await chunk2YPJ2PU6_cjs.__privateMethod(this, _onEvent, onEvent_fn).call(this, "idle");
|
|
1251
1251
|
}
|
|
1252
1252
|
/**
|
|
1253
1253
|
Size of the queue, the number of queued items waiting to run.
|
|
1254
1254
|
*/
|
|
1255
1255
|
get size() {
|
|
1256
|
-
return
|
|
1256
|
+
return chunk2YPJ2PU6_cjs.__privateGet(this, _queue2).size;
|
|
1257
1257
|
}
|
|
1258
1258
|
/**
|
|
1259
1259
|
Size of the queue, filtered by the given options.
|
|
@@ -1261,19 +1261,19 @@ var PQueue = class extends import_index.default {
|
|
|
1261
1261
|
For example, this can be used to find the number of items remaining in the queue with a specific priority level.
|
|
1262
1262
|
*/
|
|
1263
1263
|
sizeBy(options) {
|
|
1264
|
-
return
|
|
1264
|
+
return chunk2YPJ2PU6_cjs.__privateGet(this, _queue2).filter(options).length;
|
|
1265
1265
|
}
|
|
1266
1266
|
/**
|
|
1267
1267
|
Number of running items (no longer in the queue).
|
|
1268
1268
|
*/
|
|
1269
1269
|
get pending() {
|
|
1270
|
-
return
|
|
1270
|
+
return chunk2YPJ2PU6_cjs.__privateGet(this, _pending);
|
|
1271
1271
|
}
|
|
1272
1272
|
/**
|
|
1273
1273
|
Whether the queue is currently paused.
|
|
1274
1274
|
*/
|
|
1275
1275
|
get isPaused() {
|
|
1276
|
-
return
|
|
1276
|
+
return chunk2YPJ2PU6_cjs.__privateGet(this, _isPaused);
|
|
1277
1277
|
}
|
|
1278
1278
|
};
|
|
1279
1279
|
_carryoverConcurrencyCount = new WeakMap();
|
|
@@ -1292,35 +1292,35 @@ _isPaused = new WeakMap();
|
|
|
1292
1292
|
_throwOnTimeout = new WeakMap();
|
|
1293
1293
|
_doesIntervalAllowAnother = new WeakSet();
|
|
1294
1294
|
doesIntervalAllowAnother_get = function() {
|
|
1295
|
-
return
|
|
1295
|
+
return chunk2YPJ2PU6_cjs.__privateGet(this, _isIntervalIgnored) || chunk2YPJ2PU6_cjs.__privateGet(this, _intervalCount) < chunk2YPJ2PU6_cjs.__privateGet(this, _intervalCap);
|
|
1296
1296
|
};
|
|
1297
1297
|
_doesConcurrentAllowAnother = new WeakSet();
|
|
1298
1298
|
doesConcurrentAllowAnother_get = function() {
|
|
1299
|
-
return
|
|
1299
|
+
return chunk2YPJ2PU6_cjs.__privateGet(this, _pending) < chunk2YPJ2PU6_cjs.__privateGet(this, _concurrency);
|
|
1300
1300
|
};
|
|
1301
1301
|
_next = new WeakSet();
|
|
1302
1302
|
next_fn = function() {
|
|
1303
|
-
|
|
1304
|
-
|
|
1303
|
+
chunk2YPJ2PU6_cjs.__privateWrapper(this, _pending)._--;
|
|
1304
|
+
chunk2YPJ2PU6_cjs.__privateMethod(this, _tryToStartAnother, tryToStartAnother_fn).call(this);
|
|
1305
1305
|
this.emit("next");
|
|
1306
1306
|
};
|
|
1307
1307
|
_onResumeInterval = new WeakSet();
|
|
1308
1308
|
onResumeInterval_fn = function() {
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1309
|
+
chunk2YPJ2PU6_cjs.__privateMethod(this, _onInterval, onInterval_fn).call(this);
|
|
1310
|
+
chunk2YPJ2PU6_cjs.__privateMethod(this, _initializeIntervalIfNeeded, initializeIntervalIfNeeded_fn).call(this);
|
|
1311
|
+
chunk2YPJ2PU6_cjs.__privateSet(this, _timeoutId, void 0);
|
|
1312
1312
|
};
|
|
1313
1313
|
_isIntervalPaused = new WeakSet();
|
|
1314
1314
|
isIntervalPaused_get = function() {
|
|
1315
1315
|
const now = Date.now();
|
|
1316
|
-
if (
|
|
1317
|
-
const delay =
|
|
1316
|
+
if (chunk2YPJ2PU6_cjs.__privateGet(this, _intervalId) === void 0) {
|
|
1317
|
+
const delay = chunk2YPJ2PU6_cjs.__privateGet(this, _intervalEnd) - now;
|
|
1318
1318
|
if (delay < 0) {
|
|
1319
|
-
|
|
1319
|
+
chunk2YPJ2PU6_cjs.__privateSet(this, _intervalCount, chunk2YPJ2PU6_cjs.__privateGet(this, _carryoverConcurrencyCount) ? chunk2YPJ2PU6_cjs.__privateGet(this, _pending) : 0);
|
|
1320
1320
|
} else {
|
|
1321
|
-
if (
|
|
1322
|
-
|
|
1323
|
-
|
|
1321
|
+
if (chunk2YPJ2PU6_cjs.__privateGet(this, _timeoutId) === void 0) {
|
|
1322
|
+
chunk2YPJ2PU6_cjs.__privateSet(this, _timeoutId, setTimeout(() => {
|
|
1323
|
+
chunk2YPJ2PU6_cjs.__privateMethod(this, _onResumeInterval, onResumeInterval_fn).call(this);
|
|
1324
1324
|
}, delay));
|
|
1325
1325
|
}
|
|
1326
1326
|
return true;
|
|
@@ -1330,28 +1330,28 @@ isIntervalPaused_get = function() {
|
|
|
1330
1330
|
};
|
|
1331
1331
|
_tryToStartAnother = new WeakSet();
|
|
1332
1332
|
tryToStartAnother_fn = function() {
|
|
1333
|
-
if (
|
|
1334
|
-
if (
|
|
1335
|
-
clearInterval(
|
|
1333
|
+
if (chunk2YPJ2PU6_cjs.__privateGet(this, _queue2).size === 0) {
|
|
1334
|
+
if (chunk2YPJ2PU6_cjs.__privateGet(this, _intervalId)) {
|
|
1335
|
+
clearInterval(chunk2YPJ2PU6_cjs.__privateGet(this, _intervalId));
|
|
1336
1336
|
}
|
|
1337
|
-
|
|
1337
|
+
chunk2YPJ2PU6_cjs.__privateSet(this, _intervalId, void 0);
|
|
1338
1338
|
this.emit("empty");
|
|
1339
|
-
if (
|
|
1339
|
+
if (chunk2YPJ2PU6_cjs.__privateGet(this, _pending) === 0) {
|
|
1340
1340
|
this.emit("idle");
|
|
1341
1341
|
}
|
|
1342
1342
|
return false;
|
|
1343
1343
|
}
|
|
1344
|
-
if (!
|
|
1345
|
-
const canInitializeInterval = !
|
|
1346
|
-
if (
|
|
1347
|
-
const job =
|
|
1344
|
+
if (!chunk2YPJ2PU6_cjs.__privateGet(this, _isPaused)) {
|
|
1345
|
+
const canInitializeInterval = !chunk2YPJ2PU6_cjs.__privateGet(this, _isIntervalPaused, isIntervalPaused_get);
|
|
1346
|
+
if (chunk2YPJ2PU6_cjs.__privateGet(this, _doesIntervalAllowAnother, doesIntervalAllowAnother_get) && chunk2YPJ2PU6_cjs.__privateGet(this, _doesConcurrentAllowAnother, doesConcurrentAllowAnother_get)) {
|
|
1347
|
+
const job = chunk2YPJ2PU6_cjs.__privateGet(this, _queue2).dequeue();
|
|
1348
1348
|
if (!job) {
|
|
1349
1349
|
return false;
|
|
1350
1350
|
}
|
|
1351
1351
|
this.emit("active");
|
|
1352
1352
|
job();
|
|
1353
1353
|
if (canInitializeInterval) {
|
|
1354
|
-
|
|
1354
|
+
chunk2YPJ2PU6_cjs.__privateMethod(this, _initializeIntervalIfNeeded, initializeIntervalIfNeeded_fn).call(this);
|
|
1355
1355
|
}
|
|
1356
1356
|
return true;
|
|
1357
1357
|
}
|
|
@@ -1360,26 +1360,26 @@ tryToStartAnother_fn = function() {
|
|
|
1360
1360
|
};
|
|
1361
1361
|
_initializeIntervalIfNeeded = new WeakSet();
|
|
1362
1362
|
initializeIntervalIfNeeded_fn = function() {
|
|
1363
|
-
if (
|
|
1363
|
+
if (chunk2YPJ2PU6_cjs.__privateGet(this, _isIntervalIgnored) || chunk2YPJ2PU6_cjs.__privateGet(this, _intervalId) !== void 0) {
|
|
1364
1364
|
return;
|
|
1365
1365
|
}
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
},
|
|
1369
|
-
|
|
1366
|
+
chunk2YPJ2PU6_cjs.__privateSet(this, _intervalId, setInterval(() => {
|
|
1367
|
+
chunk2YPJ2PU6_cjs.__privateMethod(this, _onInterval, onInterval_fn).call(this);
|
|
1368
|
+
}, chunk2YPJ2PU6_cjs.__privateGet(this, _interval)));
|
|
1369
|
+
chunk2YPJ2PU6_cjs.__privateSet(this, _intervalEnd, Date.now() + chunk2YPJ2PU6_cjs.__privateGet(this, _interval));
|
|
1370
1370
|
};
|
|
1371
1371
|
_onInterval = new WeakSet();
|
|
1372
1372
|
onInterval_fn = function() {
|
|
1373
|
-
if (
|
|
1374
|
-
clearInterval(
|
|
1375
|
-
|
|
1373
|
+
if (chunk2YPJ2PU6_cjs.__privateGet(this, _intervalCount) === 0 && chunk2YPJ2PU6_cjs.__privateGet(this, _pending) === 0 && chunk2YPJ2PU6_cjs.__privateGet(this, _intervalId)) {
|
|
1374
|
+
clearInterval(chunk2YPJ2PU6_cjs.__privateGet(this, _intervalId));
|
|
1375
|
+
chunk2YPJ2PU6_cjs.__privateSet(this, _intervalId, void 0);
|
|
1376
1376
|
}
|
|
1377
|
-
|
|
1378
|
-
|
|
1377
|
+
chunk2YPJ2PU6_cjs.__privateSet(this, _intervalCount, chunk2YPJ2PU6_cjs.__privateGet(this, _carryoverConcurrencyCount) ? chunk2YPJ2PU6_cjs.__privateGet(this, _pending) : 0);
|
|
1378
|
+
chunk2YPJ2PU6_cjs.__privateMethod(this, _processQueue, processQueue_fn).call(this);
|
|
1379
1379
|
};
|
|
1380
1380
|
_processQueue = new WeakSet();
|
|
1381
1381
|
processQueue_fn = function() {
|
|
1382
|
-
while (
|
|
1382
|
+
while (chunk2YPJ2PU6_cjs.__privateMethod(this, _tryToStartAnother, tryToStartAnother_fn).call(this)) {
|
|
1383
1383
|
}
|
|
1384
1384
|
};
|
|
1385
1385
|
_throwOnAbort = new WeakSet();
|
|
@@ -1405,10 +1405,10 @@ onEvent_fn = async function(event, filter) {
|
|
|
1405
1405
|
};
|
|
1406
1406
|
|
|
1407
1407
|
// src/BarrelManager.ts
|
|
1408
|
-
|
|
1408
|
+
chunk2YPJ2PU6_cjs.init_cjs_shims();
|
|
1409
1409
|
|
|
1410
1410
|
// src/utils/TreeNode.ts
|
|
1411
|
-
|
|
1411
|
+
chunk2YPJ2PU6_cjs.init_cjs_shims();
|
|
1412
1412
|
var TreeNode = class _TreeNode {
|
|
1413
1413
|
constructor(data, parent) {
|
|
1414
1414
|
this.children = [];
|
|
@@ -1499,8 +1499,8 @@ var TreeNode = class _TreeNode {
|
|
|
1499
1499
|
var _options;
|
|
1500
1500
|
var BarrelManager = class {
|
|
1501
1501
|
constructor(options = {}) {
|
|
1502
|
-
|
|
1503
|
-
|
|
1502
|
+
chunk2YPJ2PU6_cjs.__privateAdd(this, _options, void 0);
|
|
1503
|
+
chunk2YPJ2PU6_cjs.__privateSet(this, _options, options);
|
|
1504
1504
|
return this;
|
|
1505
1505
|
}
|
|
1506
1506
|
getNamedExport(root, item) {
|
|
@@ -1534,7 +1534,7 @@ var BarrelManager = class {
|
|
|
1534
1534
|
}).flat();
|
|
1535
1535
|
}
|
|
1536
1536
|
getIndexes(root) {
|
|
1537
|
-
const { treeNode = {}, isTypeOnly, extName } =
|
|
1537
|
+
const { treeNode = {}, isTypeOnly, extName } = chunk2YPJ2PU6_cjs.__privateGet(this, _options);
|
|
1538
1538
|
const tree = TreeNode.build(root, treeNode);
|
|
1539
1539
|
if (!tree) {
|
|
1540
1540
|
return null;
|
|
@@ -1546,7 +1546,7 @@ var BarrelManager = class {
|
|
|
1546
1546
|
if (treeNode2.children.length > 1) {
|
|
1547
1547
|
const indexPath = path__default.default.resolve(treeNode2.data.path, "index.ts");
|
|
1548
1548
|
const exports = treeNode2.children.filter(Boolean).map((file) => {
|
|
1549
|
-
const importPath = file.data.type === "directory" ? `./${file.data.name}/index` : `./${
|
|
1549
|
+
const importPath = file.data.type === "directory" ? `./${file.data.name}/index` : `./${chunkTXURS7MB_cjs.trimExtName(file.data.name)}`;
|
|
1550
1550
|
if (importPath.endsWith("index") && file.data.type === "file") {
|
|
1551
1551
|
return void 0;
|
|
1552
1552
|
}
|
|
@@ -1564,7 +1564,7 @@ var BarrelManager = class {
|
|
|
1564
1564
|
} else if (treeNode2.children.length === 1) {
|
|
1565
1565
|
const [treeNodeChild] = treeNode2.children;
|
|
1566
1566
|
const indexPath = path__default.default.resolve(treeNode2.data.path, "index.ts");
|
|
1567
|
-
const importPath = treeNodeChild.data.type === "directory" ? `./${treeNodeChild.data.name}/index` : `./${
|
|
1567
|
+
const importPath = treeNodeChild.data.type === "directory" ? `./${treeNodeChild.data.name}/index` : `./${chunkTXURS7MB_cjs.trimExtName(treeNodeChild.data.name)}`;
|
|
1568
1568
|
const exports = [
|
|
1569
1569
|
{
|
|
1570
1570
|
path: extName ? `${importPath}${extName}` : importPath,
|
|
@@ -1595,31 +1595,31 @@ exports.KubbFile = void 0;
|
|
|
1595
1595
|
var _cache, _task, _queue3, _add, add_fn, _addOrAppend, addOrAppend_fn;
|
|
1596
1596
|
var _FileManager = class _FileManager {
|
|
1597
1597
|
constructor({ task = async (file) => file, queue = new PQueue() } = {}) {
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1598
|
+
chunk2YPJ2PU6_cjs.__privateAdd(this, _add);
|
|
1599
|
+
chunk2YPJ2PU6_cjs.__privateAdd(this, _addOrAppend);
|
|
1600
|
+
chunk2YPJ2PU6_cjs.__privateAdd(this, _cache, /* @__PURE__ */ new Map());
|
|
1601
|
+
chunk2YPJ2PU6_cjs.__privateAdd(this, _task, void 0);
|
|
1602
|
+
chunk2YPJ2PU6_cjs.__privateAdd(this, _queue3, void 0);
|
|
1603
|
+
chunk2YPJ2PU6_cjs.__privateSet(this, _task, task);
|
|
1604
|
+
chunk2YPJ2PU6_cjs.__privateSet(this, _queue3, queue);
|
|
1605
1605
|
return this;
|
|
1606
1606
|
}
|
|
1607
1607
|
get files() {
|
|
1608
1608
|
const files = [];
|
|
1609
|
-
|
|
1609
|
+
chunk2YPJ2PU6_cjs.__privateGet(this, _cache).forEach((item) => {
|
|
1610
1610
|
files.push(...item.flat(1));
|
|
1611
1611
|
});
|
|
1612
1612
|
return files;
|
|
1613
1613
|
}
|
|
1614
1614
|
get isExecuting() {
|
|
1615
|
-
return
|
|
1615
|
+
return chunk2YPJ2PU6_cjs.__privateGet(this, _queue3).size !== 0 && chunk2YPJ2PU6_cjs.__privateGet(this, _queue3).pending !== 0;
|
|
1616
1616
|
}
|
|
1617
1617
|
async add(...files) {
|
|
1618
1618
|
const promises = combineFiles(files).map((file) => {
|
|
1619
1619
|
if (file.override) {
|
|
1620
|
-
return
|
|
1620
|
+
return chunk2YPJ2PU6_cjs.__privateMethod(this, _add, add_fn).call(this, file);
|
|
1621
1621
|
}
|
|
1622
|
-
return
|
|
1622
|
+
return chunk2YPJ2PU6_cjs.__privateMethod(this, _addOrAppend, addOrAppend_fn).call(this, file);
|
|
1623
1623
|
});
|
|
1624
1624
|
const resolvedFiles = await Promise.all(promises);
|
|
1625
1625
|
if (files.length > 1) {
|
|
@@ -1633,7 +1633,7 @@ var _FileManager = class _FileManager {
|
|
|
1633
1633
|
return void 0;
|
|
1634
1634
|
}
|
|
1635
1635
|
const pathToBuildFrom = path.resolve(root, output.path);
|
|
1636
|
-
const exportPath = output.path.startsWith("./") ?
|
|
1636
|
+
const exportPath = output.path.startsWith("./") ? chunkTXURS7MB_cjs.trimExtName(output.path) : `./${chunkTXURS7MB_cjs.trimExtName(output.path)}`;
|
|
1637
1637
|
const mode = _FileManager.getMode(output.path);
|
|
1638
1638
|
const barrelManager = new BarrelManager({ extName: output.extName, ...options });
|
|
1639
1639
|
let files = barrelManager.getIndexes(pathToBuildFrom);
|
|
@@ -1653,7 +1653,7 @@ var _FileManager = class _FileManager {
|
|
|
1653
1653
|
}
|
|
1654
1654
|
await Promise.all(
|
|
1655
1655
|
files.map((file) => {
|
|
1656
|
-
return
|
|
1656
|
+
return chunk2YPJ2PU6_cjs.__privateMethod(this, _addOrAppend, addOrAppend_fn).call(this, {
|
|
1657
1657
|
...file,
|
|
1658
1658
|
meta: meta ? meta : file.meta
|
|
1659
1659
|
});
|
|
@@ -1679,33 +1679,33 @@ var _FileManager = class _FileManager {
|
|
|
1679
1679
|
if (exportType === "barrelNamed" && !output.exportAs && rootFile.exports?.[0]) {
|
|
1680
1680
|
rootFile.exports = barrelManager.getNamedExport(root, rootFile.exports[0]);
|
|
1681
1681
|
}
|
|
1682
|
-
await
|
|
1682
|
+
await chunk2YPJ2PU6_cjs.__privateMethod(this, _addOrAppend, addOrAppend_fn).call(this, {
|
|
1683
1683
|
...rootFile,
|
|
1684
1684
|
meta: meta ? meta : rootFile.meta
|
|
1685
1685
|
});
|
|
1686
1686
|
}
|
|
1687
1687
|
getCacheByUUID(UUID) {
|
|
1688
1688
|
let cache;
|
|
1689
|
-
|
|
1689
|
+
chunk2YPJ2PU6_cjs.__privateGet(this, _cache).forEach((files) => {
|
|
1690
1690
|
cache = files.find((item) => item.id === UUID);
|
|
1691
1691
|
});
|
|
1692
1692
|
return cache;
|
|
1693
1693
|
}
|
|
1694
1694
|
get(path3) {
|
|
1695
|
-
return
|
|
1695
|
+
return chunk2YPJ2PU6_cjs.__privateGet(this, _cache).get(path3);
|
|
1696
1696
|
}
|
|
1697
1697
|
remove(path3) {
|
|
1698
1698
|
const cacheItem = this.get(path3);
|
|
1699
1699
|
if (!cacheItem) {
|
|
1700
1700
|
return;
|
|
1701
1701
|
}
|
|
1702
|
-
|
|
1702
|
+
chunk2YPJ2PU6_cjs.__privateGet(this, _cache).delete(path3);
|
|
1703
1703
|
}
|
|
1704
1704
|
async write(...params) {
|
|
1705
|
-
return
|
|
1705
|
+
return chunkX7LK5QPJ_cjs.write(...params);
|
|
1706
1706
|
}
|
|
1707
1707
|
async read(...params) {
|
|
1708
|
-
return
|
|
1708
|
+
return chunkBCJRR2TA_cjs.read(...params);
|
|
1709
1709
|
}
|
|
1710
1710
|
// statics
|
|
1711
1711
|
static getSource(file) {
|
|
@@ -1733,23 +1733,23 @@ _queue3 = new WeakMap();
|
|
|
1733
1733
|
_add = new WeakSet();
|
|
1734
1734
|
add_fn = async function(file) {
|
|
1735
1735
|
const controller = new AbortController();
|
|
1736
|
-
const resolvedFile = { id: crypto__default.default.randomUUID(), name:
|
|
1737
|
-
|
|
1738
|
-
return
|
|
1736
|
+
const resolvedFile = { id: crypto__default.default.randomUUID(), name: chunkTXURS7MB_cjs.trimExtName(file.baseName), ...file };
|
|
1737
|
+
chunk2YPJ2PU6_cjs.__privateGet(this, _cache).set(resolvedFile.path, [{ cancel: () => controller.abort(), ...resolvedFile }]);
|
|
1738
|
+
return chunk2YPJ2PU6_cjs.__privateGet(this, _queue3).add(
|
|
1739
1739
|
async () => {
|
|
1740
1740
|
var _a;
|
|
1741
|
-
return (_a =
|
|
1741
|
+
return (_a = chunk2YPJ2PU6_cjs.__privateGet(this, _task)) == null ? void 0 : _a.call(this, resolvedFile);
|
|
1742
1742
|
},
|
|
1743
1743
|
{ signal: controller.signal }
|
|
1744
1744
|
);
|
|
1745
1745
|
};
|
|
1746
1746
|
_addOrAppend = new WeakSet();
|
|
1747
1747
|
addOrAppend_fn = async function(file) {
|
|
1748
|
-
const previousCaches =
|
|
1748
|
+
const previousCaches = chunk2YPJ2PU6_cjs.__privateGet(this, _cache).get(file.path);
|
|
1749
1749
|
const previousCache = previousCaches ? previousCaches.at(previousCaches.length - 1) : void 0;
|
|
1750
1750
|
if (previousCache) {
|
|
1751
|
-
|
|
1752
|
-
return
|
|
1751
|
+
chunk2YPJ2PU6_cjs.__privateGet(this, _cache).delete(previousCache.path);
|
|
1752
|
+
return chunk2YPJ2PU6_cjs.__privateMethod(this, _add, add_fn).call(this, {
|
|
1753
1753
|
...file,
|
|
1754
1754
|
source: previousCache.source && file.source ? `${previousCache.source}
|
|
1755
1755
|
${file.source}` : "",
|
|
@@ -1758,7 +1758,7 @@ ${file.source}` : "",
|
|
|
1758
1758
|
env: { ...previousCache.env || {}, ...file.env || {} }
|
|
1759
1759
|
});
|
|
1760
1760
|
}
|
|
1761
|
-
return
|
|
1761
|
+
return chunk2YPJ2PU6_cjs.__privateMethod(this, _add, add_fn).call(this, file);
|
|
1762
1762
|
};
|
|
1763
1763
|
var FileManager = _FileManager;
|
|
1764
1764
|
function combineFiles(files) {
|
|
@@ -1796,11 +1796,11 @@ function getSource(file) {
|
|
|
1796
1796
|
const exports = file.exports ? combineExports(file.exports) : [];
|
|
1797
1797
|
const imports = file.imports ? combineImports(file.imports, exports, file.source) : [];
|
|
1798
1798
|
const importNodes = imports.filter((item) => {
|
|
1799
|
-
return item.path !==
|
|
1799
|
+
return item.path !== chunkTXURS7MB_cjs.trimExtName(file.path);
|
|
1800
1800
|
}).map((item) => {
|
|
1801
1801
|
return factory__namespace.createImportDeclaration({
|
|
1802
1802
|
name: item.name,
|
|
1803
|
-
path: item.root ?
|
|
1803
|
+
path: item.root ? chunkBCJRR2TA_cjs.getRelativePath(item.root, item.path) : item.path,
|
|
1804
1804
|
isTypeOnly: item.isTypeOnly
|
|
1805
1805
|
});
|
|
1806
1806
|
});
|
|
@@ -1902,8 +1902,8 @@ function getEnvSource(source, env) {
|
|
|
1902
1902
|
throw new TypeError(`Environment should be in upperCase for ${key}`);
|
|
1903
1903
|
}
|
|
1904
1904
|
if (typeof replaceBy === "string") {
|
|
1905
|
-
prev =
|
|
1906
|
-
prev =
|
|
1905
|
+
prev = chunkTXURS7MB_cjs.searchAndReplace({ text: prev.replaceAll(`process.env.${key}`, replaceBy), replaceBy, prefix: "process.env", key });
|
|
1906
|
+
prev = chunkTXURS7MB_cjs.searchAndReplace({ text: prev.replaceAll(new RegExp(`(declare const).*
|
|
1907
1907
|
`, "ig"), ""), replaceBy, key });
|
|
1908
1908
|
}
|
|
1909
1909
|
return prev;
|
|
@@ -1911,7 +1911,7 @@ function getEnvSource(source, env) {
|
|
|
1911
1911
|
}
|
|
1912
1912
|
|
|
1913
1913
|
// src/errors.ts
|
|
1914
|
-
|
|
1914
|
+
chunk2YPJ2PU6_cjs.init_cjs_shims();
|
|
1915
1915
|
var Warning = class extends Error {
|
|
1916
1916
|
constructor(message, options) {
|
|
1917
1917
|
super(message, { cause: options?.cause });
|
|
@@ -1922,10 +1922,10 @@ var ValidationPluginError = class extends Error {
|
|
|
1922
1922
|
};
|
|
1923
1923
|
|
|
1924
1924
|
// src/plugin.ts
|
|
1925
|
-
|
|
1925
|
+
chunk2YPJ2PU6_cjs.init_cjs_shims();
|
|
1926
1926
|
|
|
1927
1927
|
// src/utils/cache.ts
|
|
1928
|
-
|
|
1928
|
+
chunk2YPJ2PU6_cjs.init_cjs_shims();
|
|
1929
1929
|
function createPluginCache(Store = /* @__PURE__ */ Object.create(null)) {
|
|
1930
1930
|
return {
|
|
1931
1931
|
set(id, value) {
|
|
@@ -2003,10 +2003,10 @@ var definePlugin = createPlugin((options) => {
|
|
|
2003
2003
|
});
|
|
2004
2004
|
|
|
2005
2005
|
// src/PromiseManager.ts
|
|
2006
|
-
|
|
2006
|
+
chunk2YPJ2PU6_cjs.init_cjs_shims();
|
|
2007
2007
|
|
|
2008
2008
|
// src/utils/executeStrategies.ts
|
|
2009
|
-
|
|
2009
|
+
chunk2YPJ2PU6_cjs.init_cjs_shims();
|
|
2010
2010
|
function hookSeq(promises) {
|
|
2011
2011
|
return promises.filter(Boolean).reduce(
|
|
2012
2012
|
(promise, func) => {
|
|
@@ -2044,8 +2044,8 @@ function hookParallel(promises) {
|
|
|
2044
2044
|
var _options2;
|
|
2045
2045
|
var PromiseManager = class {
|
|
2046
2046
|
constructor(options = {}) {
|
|
2047
|
-
|
|
2048
|
-
|
|
2047
|
+
chunk2YPJ2PU6_cjs.__privateAdd(this, _options2, {});
|
|
2048
|
+
chunk2YPJ2PU6_cjs.__privateSet(this, _options2, options);
|
|
2049
2049
|
return this;
|
|
2050
2050
|
}
|
|
2051
2051
|
run(strategy, promises) {
|
|
@@ -2053,7 +2053,7 @@ var PromiseManager = class {
|
|
|
2053
2053
|
return hookSeq(promises);
|
|
2054
2054
|
}
|
|
2055
2055
|
if (strategy === "first") {
|
|
2056
|
-
return hookFirst(promises,
|
|
2056
|
+
return hookFirst(promises, chunk2YPJ2PU6_cjs.__privateGet(this, _options2).nullCheck);
|
|
2057
2057
|
}
|
|
2058
2058
|
if (strategy === "parallel") {
|
|
2059
2059
|
return hookParallel(promises);
|
|
@@ -2070,12 +2070,12 @@ function isPromiseRejectedResult(result) {
|
|
|
2070
2070
|
}
|
|
2071
2071
|
|
|
2072
2072
|
// src/PluginManager.ts
|
|
2073
|
-
|
|
2073
|
+
chunk2YPJ2PU6_cjs.init_cjs_shims();
|
|
2074
2074
|
var _core, _usedPluginNames, _promiseManager, _getSortedPlugins, getSortedPlugins_fn, _addExecutedToCallStack, addExecutedToCallStack_fn, _execute, execute_fn, _executeSync, executeSync_fn, _catcher, catcher_fn, _parse, parse_fn;
|
|
2075
2075
|
var PluginManager = class {
|
|
2076
2076
|
constructor(config, options) {
|
|
2077
|
-
|
|
2078
|
-
|
|
2077
|
+
chunk2YPJ2PU6_cjs.__privateAdd(this, _getSortedPlugins);
|
|
2078
|
+
chunk2YPJ2PU6_cjs.__privateAdd(this, _addExecutedToCallStack);
|
|
2079
2079
|
/**
|
|
2080
2080
|
* Run an async plugin hook and return the result.
|
|
2081
2081
|
* @param hookName Name of the plugin hook. Must be either in `PluginHooks` or `OutputPluginValueHooks`.
|
|
@@ -2083,7 +2083,7 @@ var PluginManager = class {
|
|
|
2083
2083
|
* @param plugin The actual pluginObject to run.
|
|
2084
2084
|
*/
|
|
2085
2085
|
// Implementation signature
|
|
2086
|
-
|
|
2086
|
+
chunk2YPJ2PU6_cjs.__privateAdd(this, _execute);
|
|
2087
2087
|
/**
|
|
2088
2088
|
* Run a sync plugin hook and return the result.
|
|
2089
2089
|
* @param hookName Name of the plugin hook. Must be in `PluginHooks`.
|
|
@@ -2091,14 +2091,14 @@ var PluginManager = class {
|
|
|
2091
2091
|
* @param plugin The acutal plugin
|
|
2092
2092
|
* @param replaceContext When passed, the plugin context can be overridden.
|
|
2093
2093
|
*/
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
this.events = new
|
|
2094
|
+
chunk2YPJ2PU6_cjs.__privateAdd(this, _executeSync);
|
|
2095
|
+
chunk2YPJ2PU6_cjs.__privateAdd(this, _catcher);
|
|
2096
|
+
chunk2YPJ2PU6_cjs.__privateAdd(this, _parse);
|
|
2097
|
+
this.events = new chunkSFOOQU7X_cjs.EventEmitter();
|
|
2098
2098
|
this.executed = [];
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2099
|
+
chunk2YPJ2PU6_cjs.__privateAdd(this, _core, void 0);
|
|
2100
|
+
chunk2YPJ2PU6_cjs.__privateAdd(this, _usedPluginNames, {});
|
|
2101
|
+
chunk2YPJ2PU6_cjs.__privateAdd(this, _promiseManager, void 0);
|
|
2102
2102
|
this.resolvePath = (params) => {
|
|
2103
2103
|
if (params.pluginKey) {
|
|
2104
2104
|
const paths = this.hookForPluginSync({
|
|
@@ -2106,7 +2106,7 @@ var PluginManager = class {
|
|
|
2106
2106
|
hookName: "resolvePath",
|
|
2107
2107
|
parameters: [params.baseName, params.directory, params.options]
|
|
2108
2108
|
});
|
|
2109
|
-
if (paths && paths?.length > 1 && this.logger.logLevel ===
|
|
2109
|
+
if (paths && paths?.length > 1 && this.logger.logLevel === chunkSFOOQU7X_cjs.LogLevel.debug) {
|
|
2110
2110
|
this.logger.emit("debug", [
|
|
2111
2111
|
`Cannot return a path where the 'pluginKey' ${params.pluginKey ? JSON.stringify(params.pluginKey) : '"'} is not unique enough
|
|
2112
2112
|
|
|
@@ -2130,7 +2130,7 @@ Falling back on the first item.
|
|
|
2130
2130
|
hookName: "resolveName",
|
|
2131
2131
|
parameters: [params.name, params.type]
|
|
2132
2132
|
});
|
|
2133
|
-
if (names && names?.length > 1 && this.logger.logLevel ===
|
|
2133
|
+
if (names && names?.length > 1 && this.logger.logLevel === chunkSFOOQU7X_cjs.LogLevel.debug) {
|
|
2134
2134
|
this.logger.emit("debug", [
|
|
2135
2135
|
`Cannot return a name where the 'pluginKey' ${params.pluginKey ? JSON.stringify(params.pluginKey) : '"'} is not unique enough
|
|
2136
2136
|
|
|
@@ -2140,19 +2140,19 @@ Falling back on the first item.
|
|
|
2140
2140
|
`
|
|
2141
2141
|
]);
|
|
2142
2142
|
}
|
|
2143
|
-
return
|
|
2143
|
+
return chunkTXURS7MB_cjs.transformReservedWord(names?.at(0) || params.name);
|
|
2144
2144
|
}
|
|
2145
2145
|
const name = this.hookFirstSync({
|
|
2146
2146
|
hookName: "resolveName",
|
|
2147
2147
|
parameters: [params.name, params.type]
|
|
2148
2148
|
}).result;
|
|
2149
|
-
return
|
|
2149
|
+
return chunkTXURS7MB_cjs.transformReservedWord(name);
|
|
2150
2150
|
};
|
|
2151
2151
|
this.config = config;
|
|
2152
2152
|
this.logger = options.logger;
|
|
2153
2153
|
this.queue = new PQueue({ concurrency: 1 });
|
|
2154
2154
|
this.fileManager = new FileManager({ task: options.task, queue: this.queue });
|
|
2155
|
-
|
|
2155
|
+
chunk2YPJ2PU6_cjs.__privateSet(this, _promiseManager, new PromiseManager({ nullCheck: (state) => !!state?.result }));
|
|
2156
2156
|
const plugins = config.plugins || [];
|
|
2157
2157
|
const core = definePlugin({
|
|
2158
2158
|
config,
|
|
@@ -2161,11 +2161,11 @@ Falling back on the first item.
|
|
|
2161
2161
|
fileManager: this.fileManager,
|
|
2162
2162
|
resolvePath: this.resolvePath.bind(this),
|
|
2163
2163
|
resolveName: this.resolveName.bind(this),
|
|
2164
|
-
getPlugins:
|
|
2164
|
+
getPlugins: chunk2YPJ2PU6_cjs.__privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).bind(this)
|
|
2165
2165
|
});
|
|
2166
|
-
|
|
2167
|
-
this.plugins = [
|
|
2168
|
-
return
|
|
2166
|
+
chunk2YPJ2PU6_cjs.__privateSet(this, _core, chunk2YPJ2PU6_cjs.__privateMethod(this, _parse, parse_fn).call(this, core, this, core.api.call(null)));
|
|
2167
|
+
this.plugins = [chunk2YPJ2PU6_cjs.__privateGet(this, _core), ...plugins].map((plugin) => {
|
|
2168
|
+
return chunk2YPJ2PU6_cjs.__privateMethod(this, _parse, parse_fn).call(this, plugin, this, chunk2YPJ2PU6_cjs.__privateGet(this, _core).api);
|
|
2169
2169
|
});
|
|
2170
2170
|
return this;
|
|
2171
2171
|
}
|
|
@@ -2185,7 +2185,7 @@ Falling back on the first item.
|
|
|
2185
2185
|
}) {
|
|
2186
2186
|
const plugins = this.getPluginsByKey(hookName, pluginKey);
|
|
2187
2187
|
const promises = plugins.map((plugin) => {
|
|
2188
|
-
return
|
|
2188
|
+
return chunk2YPJ2PU6_cjs.__privateMethod(this, _execute, execute_fn).call(this, {
|
|
2189
2189
|
strategy: "hookFirst",
|
|
2190
2190
|
hookName,
|
|
2191
2191
|
parameters,
|
|
@@ -2204,7 +2204,7 @@ Falling back on the first item.
|
|
|
2204
2204
|
}) {
|
|
2205
2205
|
const plugins = this.getPluginsByKey(hookName, pluginKey);
|
|
2206
2206
|
return plugins.map((plugin) => {
|
|
2207
|
-
return
|
|
2207
|
+
return chunk2YPJ2PU6_cjs.__privateMethod(this, _executeSync, executeSync_fn).call(this, {
|
|
2208
2208
|
strategy: "hookFirst",
|
|
2209
2209
|
hookName,
|
|
2210
2210
|
parameters,
|
|
@@ -2220,11 +2220,11 @@ Falling back on the first item.
|
|
|
2220
2220
|
parameters,
|
|
2221
2221
|
skipped
|
|
2222
2222
|
}) {
|
|
2223
|
-
const promises =
|
|
2223
|
+
const promises = chunk2YPJ2PU6_cjs.__privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this).filter((plugin) => {
|
|
2224
2224
|
return skipped ? skipped.has(plugin) : true;
|
|
2225
2225
|
}).map((plugin) => {
|
|
2226
2226
|
return async () => {
|
|
2227
|
-
const value = await
|
|
2227
|
+
const value = await chunk2YPJ2PU6_cjs.__privateMethod(this, _execute, execute_fn).call(this, {
|
|
2228
2228
|
strategy: "hookFirst",
|
|
2229
2229
|
hookName,
|
|
2230
2230
|
parameters,
|
|
@@ -2238,7 +2238,7 @@ Falling back on the first item.
|
|
|
2238
2238
|
);
|
|
2239
2239
|
};
|
|
2240
2240
|
});
|
|
2241
|
-
return
|
|
2241
|
+
return chunk2YPJ2PU6_cjs.__privateGet(this, _promiseManager).run("first", promises);
|
|
2242
2242
|
}
|
|
2243
2243
|
/**
|
|
2244
2244
|
* First non-null result stops and will return it's value.
|
|
@@ -2249,12 +2249,12 @@ Falling back on the first item.
|
|
|
2249
2249
|
skipped
|
|
2250
2250
|
}) {
|
|
2251
2251
|
let parseResult = null;
|
|
2252
|
-
for (const plugin of
|
|
2252
|
+
for (const plugin of chunk2YPJ2PU6_cjs.__privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this)) {
|
|
2253
2253
|
if (skipped && skipped.has(plugin)) {
|
|
2254
2254
|
continue;
|
|
2255
2255
|
}
|
|
2256
2256
|
parseResult = {
|
|
2257
|
-
result:
|
|
2257
|
+
result: chunk2YPJ2PU6_cjs.__privateMethod(this, _executeSync, executeSync_fn).call(this, {
|
|
2258
2258
|
strategy: "hookFirst",
|
|
2259
2259
|
hookName,
|
|
2260
2260
|
parameters,
|
|
@@ -2275,14 +2275,14 @@ Falling back on the first item.
|
|
|
2275
2275
|
hookName,
|
|
2276
2276
|
parameters
|
|
2277
2277
|
}) {
|
|
2278
|
-
const promises =
|
|
2279
|
-
return () =>
|
|
2278
|
+
const promises = chunk2YPJ2PU6_cjs.__privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this).map((plugin) => {
|
|
2279
|
+
return () => chunk2YPJ2PU6_cjs.__privateMethod(this, _execute, execute_fn).call(this, { strategy: "hookParallel", hookName, parameters, plugin });
|
|
2280
2280
|
});
|
|
2281
|
-
const results = await
|
|
2281
|
+
const results = await chunk2YPJ2PU6_cjs.__privateGet(this, _promiseManager).run("parallel", promises);
|
|
2282
2282
|
results.forEach((result, index) => {
|
|
2283
2283
|
if (isPromiseRejectedResult(result)) {
|
|
2284
|
-
const plugin =
|
|
2285
|
-
|
|
2284
|
+
const plugin = chunk2YPJ2PU6_cjs.__privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this)[index];
|
|
2285
|
+
chunk2YPJ2PU6_cjs.__privateMethod(this, _catcher, catcher_fn).call(this, result.reason, plugin, hookName);
|
|
2286
2286
|
}
|
|
2287
2287
|
});
|
|
2288
2288
|
return results.filter((result) => result.status === "fulfilled").map((result) => result.value);
|
|
@@ -2297,16 +2297,16 @@ Falling back on the first item.
|
|
|
2297
2297
|
}) {
|
|
2298
2298
|
const [argument0, ...rest] = parameters;
|
|
2299
2299
|
let promise = Promise.resolve(argument0);
|
|
2300
|
-
for (const plugin of
|
|
2300
|
+
for (const plugin of chunk2YPJ2PU6_cjs.__privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this)) {
|
|
2301
2301
|
promise = promise.then((arg0) => {
|
|
2302
|
-
const value =
|
|
2302
|
+
const value = chunk2YPJ2PU6_cjs.__privateMethod(this, _execute, execute_fn).call(this, {
|
|
2303
2303
|
strategy: "hookReduceArg0",
|
|
2304
2304
|
hookName,
|
|
2305
2305
|
parameters: [arg0, ...rest],
|
|
2306
2306
|
plugin
|
|
2307
2307
|
});
|
|
2308
2308
|
return value;
|
|
2309
|
-
}).then((result) => reduce.call(
|
|
2309
|
+
}).then((result) => reduce.call(chunk2YPJ2PU6_cjs.__privateGet(this, _core).api, argument0, result, plugin));
|
|
2310
2310
|
}
|
|
2311
2311
|
return promise;
|
|
2312
2312
|
}
|
|
@@ -2314,15 +2314,15 @@ Falling back on the first item.
|
|
|
2314
2314
|
* Chains plugins
|
|
2315
2315
|
*/
|
|
2316
2316
|
async hookSeq({ hookName, parameters }) {
|
|
2317
|
-
const promises =
|
|
2318
|
-
return () =>
|
|
2317
|
+
const promises = chunk2YPJ2PU6_cjs.__privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this).map((plugin) => {
|
|
2318
|
+
return () => chunk2YPJ2PU6_cjs.__privateMethod(this, _execute, execute_fn).call(this, {
|
|
2319
2319
|
strategy: "hookSeq",
|
|
2320
2320
|
hookName,
|
|
2321
2321
|
parameters,
|
|
2322
2322
|
plugin
|
|
2323
2323
|
});
|
|
2324
2324
|
});
|
|
2325
|
-
return
|
|
2325
|
+
return chunk2YPJ2PU6_cjs.__privateGet(this, _promiseManager).run("seq", promises);
|
|
2326
2326
|
}
|
|
2327
2327
|
getPluginsByKey(hookName, pluginKey) {
|
|
2328
2328
|
const plugins = [...this.plugins];
|
|
@@ -2338,7 +2338,7 @@ Falling back on the first item.
|
|
|
2338
2338
|
});
|
|
2339
2339
|
if (!pluginByPluginName?.length) {
|
|
2340
2340
|
const corePlugin = plugins.find((plugin) => plugin.name === "core" && plugin[hookName]);
|
|
2341
|
-
if (this.logger.logLevel ===
|
|
2341
|
+
if (this.logger.logLevel === chunkSFOOQU7X_cjs.LogLevel.debug) {
|
|
2342
2342
|
if (corePlugin) {
|
|
2343
2343
|
this.logger.emit("debug", [`No hook '${hookName}' for pluginKey '${JSON.stringify(pluginKey)}' found, falling back on the '@kubb/core' plugin`]);
|
|
2344
2344
|
} else {
|
|
@@ -2376,7 +2376,7 @@ _getSortedPlugins = new WeakSet();
|
|
|
2376
2376
|
getSortedPlugins_fn = function(hookName) {
|
|
2377
2377
|
const plugins = [...this.plugins].filter((plugin) => plugin.name !== "core");
|
|
2378
2378
|
if (hookName) {
|
|
2379
|
-
if (this.logger.logLevel ===
|
|
2379
|
+
if (this.logger.logLevel === chunkSFOOQU7X_cjs.LogLevel.info) {
|
|
2380
2380
|
const containsHookName = plugins.some((item) => item[hookName]);
|
|
2381
2381
|
if (!containsHookName) {
|
|
2382
2382
|
this.logger.emit("warning", `No hook ${hookName} found`);
|
|
@@ -2424,7 +2424,7 @@ execute_fn = function({
|
|
|
2424
2424
|
this.events.emit("execute", { strategy, hookName, parameters, plugin });
|
|
2425
2425
|
const task = Promise.resolve().then(() => {
|
|
2426
2426
|
if (typeof hook === "function") {
|
|
2427
|
-
const possiblePromiseResult = hook.apply({ ...
|
|
2427
|
+
const possiblePromiseResult = hook.apply({ ...chunk2YPJ2PU6_cjs.__privateGet(this, _core).api, plugin }, parameters);
|
|
2428
2428
|
if (isPromise(possiblePromiseResult)) {
|
|
2429
2429
|
return Promise.resolve(possiblePromiseResult);
|
|
2430
2430
|
}
|
|
@@ -2433,7 +2433,7 @@ execute_fn = function({
|
|
|
2433
2433
|
return hook;
|
|
2434
2434
|
}).then((result) => {
|
|
2435
2435
|
output = result;
|
|
2436
|
-
|
|
2436
|
+
chunk2YPJ2PU6_cjs.__privateMethod(this, _addExecutedToCallStack, addExecutedToCallStack_fn).call(this, {
|
|
2437
2437
|
parameters,
|
|
2438
2438
|
output,
|
|
2439
2439
|
strategy,
|
|
@@ -2442,7 +2442,7 @@ execute_fn = function({
|
|
|
2442
2442
|
});
|
|
2443
2443
|
return result;
|
|
2444
2444
|
}).catch((e) => {
|
|
2445
|
-
|
|
2445
|
+
chunk2YPJ2PU6_cjs.__privateMethod(this, _catcher, catcher_fn).call(this, e, plugin, hookName);
|
|
2446
2446
|
return null;
|
|
2447
2447
|
});
|
|
2448
2448
|
return task;
|
|
@@ -2462,12 +2462,12 @@ executeSync_fn = function({
|
|
|
2462
2462
|
this.events.emit("execute", { strategy, hookName, parameters, plugin });
|
|
2463
2463
|
try {
|
|
2464
2464
|
if (typeof hook === "function") {
|
|
2465
|
-
const fn = hook.apply({ ...
|
|
2465
|
+
const fn = hook.apply({ ...chunk2YPJ2PU6_cjs.__privateGet(this, _core).api, plugin }, parameters);
|
|
2466
2466
|
output = fn;
|
|
2467
2467
|
return fn;
|
|
2468
2468
|
}
|
|
2469
2469
|
output = hook;
|
|
2470
|
-
|
|
2470
|
+
chunk2YPJ2PU6_cjs.__privateMethod(this, _addExecutedToCallStack, addExecutedToCallStack_fn).call(this, {
|
|
2471
2471
|
parameters,
|
|
2472
2472
|
output,
|
|
2473
2473
|
strategy,
|
|
@@ -2476,7 +2476,7 @@ executeSync_fn = function({
|
|
|
2476
2476
|
});
|
|
2477
2477
|
return hook;
|
|
2478
2478
|
} catch (e) {
|
|
2479
|
-
|
|
2479
|
+
chunk2YPJ2PU6_cjs.__privateMethod(this, _catcher, catcher_fn).call(this, e, plugin, hookName);
|
|
2480
2480
|
return null;
|
|
2481
2481
|
}
|
|
2482
2482
|
};
|
|
@@ -2489,8 +2489,8 @@ catcher_fn = function(e, plugin, hookName) {
|
|
|
2489
2489
|
};
|
|
2490
2490
|
_parse = new WeakSet();
|
|
2491
2491
|
parse_fn = function(plugin, pluginManager, context) {
|
|
2492
|
-
const usedPluginNames =
|
|
2493
|
-
|
|
2492
|
+
const usedPluginNames = chunk2YPJ2PU6_cjs.__privateGet(pluginManager, _usedPluginNames);
|
|
2493
|
+
chunkAUXXNU4E_cjs.setUniqueName(plugin.name, usedPluginNames);
|
|
2494
2494
|
const key = [plugin.name, usedPluginNames[plugin.name]].filter(Boolean);
|
|
2495
2495
|
if (!plugin.transform) {
|
|
2496
2496
|
plugin.transform = function transform(code) {
|
|
@@ -2519,4 +2519,4 @@ exports.createPlugin = createPlugin;
|
|
|
2519
2519
|
exports.isPromise = isPromise;
|
|
2520
2520
|
exports.pluginName = pluginName;
|
|
2521
2521
|
//# sourceMappingURL=out.js.map
|
|
2522
|
-
//# sourceMappingURL=chunk-
|
|
2522
|
+
//# sourceMappingURL=chunk-MYP62TTS.cjs.map
|