@kubb/core 2.19.5 → 2.19.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-FRT5NM5I.js → chunk-5JZNFPUP.js} +13 -15
- package/dist/{chunk-FRT5NM5I.js.map → chunk-5JZNFPUP.js.map} +1 -1
- package/dist/{chunk-7UMWFPXG.js → chunk-6D7EFD2R.js} +2 -2
- package/dist/{chunk-4QO27EB2.cjs → chunk-ESX7D52D.cjs} +174 -216
- package/dist/chunk-ESX7D52D.cjs.map +1 -0
- package/dist/{chunk-PNAWM6V2.cjs → chunk-FVW4VDVD.cjs} +5 -5
- package/dist/chunk-HMLY7DHA.js +16 -0
- package/dist/{chunk-JA6UN4AZ.cjs → chunk-OCFABH5L.cjs} +30 -32
- package/dist/chunk-OCFABH5L.cjs.map +1 -0
- package/dist/{chunk-WQ7GB7MO.cjs → chunk-Q7VRQ7E7.cjs} +12 -12
- package/dist/{chunk-EPAC7V2R.js → chunk-SV4UDYSR.js} +16 -18
- package/dist/{chunk-EPAC7V2R.js.map → chunk-SV4UDYSR.js.map} +1 -1
- package/dist/{chunk-CCA5OKGM.cjs → chunk-WSIG7TWQ.cjs} +19 -19
- package/dist/chunk-WSIG7TWQ.cjs.map +1 -0
- package/dist/{chunk-UCKFXEKM.js → chunk-XC6QIAQL.js} +2 -2
- package/dist/{chunk-UCKFXEKM.js.map → chunk-XC6QIAQL.js.map} +1 -1
- package/dist/{chunk-4DTSZ2MS.cjs → chunk-ZG4WVJOZ.cjs} +13 -30
- package/dist/chunk-ZG4WVJOZ.cjs.map +1 -0
- package/dist/index.cjs +150 -160
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +51 -61
- package/dist/index.js.map +1 -1
- package/dist/logger.cjs +3 -3
- package/dist/logger.js +2 -2
- package/dist/mocks.cjs +8 -8
- package/dist/mocks.js +4 -4
- package/dist/transformers.cjs +4 -4
- package/dist/transformers.js +2 -2
- package/dist/utils.cjs +4 -4
- package/dist/utils.js +2 -2
- package/package.json +10 -10
- package/src/transformers/stringify.ts +1 -1
- package/dist/chunk-4DTSZ2MS.cjs.map +0 -1
- package/dist/chunk-4QO27EB2.cjs.map +0 -1
- package/dist/chunk-CCA5OKGM.cjs.map +0 -1
- package/dist/chunk-JA6UN4AZ.cjs.map +0 -1
- package/dist/chunk-Z4BLTVTB.js +0 -30
- /package/dist/{chunk-7UMWFPXG.js.map → chunk-6D7EFD2R.js.map} +0 -0
- /package/dist/{chunk-PNAWM6V2.cjs.map → chunk-FVW4VDVD.cjs.map} +0 -0
- /package/dist/{chunk-Z4BLTVTB.js.map → chunk-HMLY7DHA.js.map} +0 -0
- /package/dist/{chunk-WQ7GB7MO.cjs.map → chunk-Q7VRQ7E7.cjs.map} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -4,19 +4,19 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkQ7VRQ7E7cjs = require('./chunk-Q7VRQ7E7.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkESX7D52Dcjs = require('./chunk-ESX7D52D.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkWSIG7TWQcjs = require('./chunk-WSIG7TWQ.cjs');
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
var
|
|
19
|
-
require('./chunk-
|
|
18
|
+
var _chunkOCFABH5Lcjs = require('./chunk-OCFABH5L.cjs');
|
|
19
|
+
require('./chunk-FVW4VDVD.cjs');
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
@@ -25,24 +25,24 @@ require('./chunk-PNAWM6V2.cjs');
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
var
|
|
28
|
+
var _chunkZG4WVJOZcjs = require('./chunk-ZG4WVJOZ.cjs');
|
|
29
29
|
|
|
30
30
|
// src/index.ts
|
|
31
|
-
|
|
31
|
+
_chunkZG4WVJOZcjs.init_cjs_shims.call(void 0, );
|
|
32
32
|
|
|
33
33
|
// src/build.ts
|
|
34
|
-
|
|
34
|
+
_chunkZG4WVJOZcjs.init_cjs_shims.call(void 0, );
|
|
35
35
|
var _fs = require('@kubb/fs');
|
|
36
36
|
|
|
37
37
|
// src/PluginManager.ts
|
|
38
|
-
|
|
38
|
+
_chunkZG4WVJOZcjs.init_cjs_shims.call(void 0, );
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
// src/PromiseManager.ts
|
|
42
|
-
|
|
42
|
+
_chunkZG4WVJOZcjs.init_cjs_shims.call(void 0, );
|
|
43
43
|
|
|
44
44
|
// src/utils/executeStrategies.ts
|
|
45
|
-
|
|
45
|
+
_chunkZG4WVJOZcjs.init_cjs_shims.call(void 0, );
|
|
46
46
|
function hookSeq(promises) {
|
|
47
47
|
return promises.filter(Boolean).reduce(
|
|
48
48
|
(promise, func) => {
|
|
@@ -80,8 +80,8 @@ function hookParallel(promises) {
|
|
|
80
80
|
var _options;
|
|
81
81
|
var PromiseManager = class {
|
|
82
82
|
constructor(options = {}) {
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
_chunkZG4WVJOZcjs.__privateAdd.call(void 0, this, _options, {});
|
|
84
|
+
_chunkZG4WVJOZcjs.__privateSet.call(void 0, this, _options, options);
|
|
85
85
|
return this;
|
|
86
86
|
}
|
|
87
87
|
run(strategy, promises) {
|
|
@@ -89,7 +89,7 @@ var PromiseManager = class {
|
|
|
89
89
|
return hookSeq(promises);
|
|
90
90
|
}
|
|
91
91
|
if (strategy === "first") {
|
|
92
|
-
return hookFirst(promises,
|
|
92
|
+
return hookFirst(promises, _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _options).nullCheck);
|
|
93
93
|
}
|
|
94
94
|
if (strategy === "parallel") {
|
|
95
95
|
return hookParallel(promises);
|
|
@@ -106,7 +106,7 @@ function isPromiseRejectedResult(result) {
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
// src/errors.ts
|
|
109
|
-
|
|
109
|
+
_chunkZG4WVJOZcjs.init_cjs_shims.call(void 0, );
|
|
110
110
|
var Warning = class extends Error {
|
|
111
111
|
constructor(message, options) {
|
|
112
112
|
super(message, { cause: _optionalChain([options, 'optionalAccess', _3 => _3.cause]) });
|
|
@@ -117,11 +117,11 @@ var ValidationPluginError = class extends Error {
|
|
|
117
117
|
};
|
|
118
118
|
|
|
119
119
|
// src/plugin.ts
|
|
120
|
-
|
|
120
|
+
_chunkZG4WVJOZcjs.init_cjs_shims.call(void 0, );
|
|
121
121
|
var _path2 = require('path'); var _path3 = _interopRequireDefault(_path2);
|
|
122
122
|
|
|
123
123
|
// src/utils/cache.ts
|
|
124
|
-
|
|
124
|
+
_chunkZG4WVJOZcjs.init_cjs_shims.call(void 0, );
|
|
125
125
|
function createPluginCache(Store = /* @__PURE__ */ Object.create(null)) {
|
|
126
126
|
return {
|
|
127
127
|
set(id, value) {
|
|
@@ -198,34 +198,15 @@ var pluginCore = createPlugin((options) => {
|
|
|
198
198
|
});
|
|
199
199
|
|
|
200
200
|
// src/PluginManager.ts
|
|
201
|
-
var _core, _usedPluginNames, _promiseManager,
|
|
201
|
+
var _core, _usedPluginNames, _promiseManager, _PluginManager_instances, getSortedPlugins_fn, addExecutedToCallStack_fn, execute_fn, executeSync_fn, catcher_fn, parse_fn;
|
|
202
202
|
var PluginManager = class {
|
|
203
203
|
constructor(config, options) {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
/**
|
|
207
|
-
* Run an async plugin hook and return the result.
|
|
208
|
-
* @param hookName Name of the plugin hook. Must be either in `PluginHooks` or `OutputPluginValueHooks`.
|
|
209
|
-
* @param args Arguments passed to the plugin hook.
|
|
210
|
-
* @param plugin The actual pluginObject to run.
|
|
211
|
-
*/
|
|
212
|
-
// Implementation signature
|
|
213
|
-
_chunk4DTSZ2MScjs.__privateAdd.call(void 0, this, _execute);
|
|
214
|
-
/**
|
|
215
|
-
* Run a sync plugin hook and return the result.
|
|
216
|
-
* @param hookName Name of the plugin hook. Must be in `PluginHooks`.
|
|
217
|
-
* @param args Arguments passed to the plugin hook.
|
|
218
|
-
* @param plugin The acutal plugin
|
|
219
|
-
* @param replaceContext When passed, the plugin context can be overridden.
|
|
220
|
-
*/
|
|
221
|
-
_chunk4DTSZ2MScjs.__privateAdd.call(void 0, this, _executeSync);
|
|
222
|
-
_chunk4DTSZ2MScjs.__privateAdd.call(void 0, this, _catcher);
|
|
223
|
-
_chunk4DTSZ2MScjs.__privateAdd.call(void 0, this, _parse);
|
|
224
|
-
this.events = new (0, _chunkWQ7GB7MOcjs.EventEmitter)();
|
|
204
|
+
_chunkZG4WVJOZcjs.__privateAdd.call(void 0, this, _PluginManager_instances);
|
|
205
|
+
this.events = new (0, _chunkQ7VRQ7E7cjs.EventEmitter)();
|
|
225
206
|
this.executed = [];
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
207
|
+
_chunkZG4WVJOZcjs.__privateAdd.call(void 0, this, _core);
|
|
208
|
+
_chunkZG4WVJOZcjs.__privateAdd.call(void 0, this, _usedPluginNames, {});
|
|
209
|
+
_chunkZG4WVJOZcjs.__privateAdd.call(void 0, this, _promiseManager);
|
|
229
210
|
this.resolvePath = (params) => {
|
|
230
211
|
if (params.pluginKey) {
|
|
231
212
|
const paths = this.hookForPluginSync({
|
|
@@ -267,22 +248,22 @@ Falling back on the first item.
|
|
|
267
248
|
`
|
|
268
249
|
]);
|
|
269
250
|
}
|
|
270
|
-
return
|
|
251
|
+
return _chunkWSIG7TWQcjs.transformReservedWord.call(void 0, _optionalChain([names, 'optionalAccess', _8 => _8.at, 'call', _9 => _9(0)]) || params.name);
|
|
271
252
|
}
|
|
272
253
|
const name = this.hookFirstSync({
|
|
273
254
|
hookName: "resolveName",
|
|
274
255
|
parameters: [params.name, params.type]
|
|
275
256
|
}).result;
|
|
276
|
-
return
|
|
257
|
+
return _chunkWSIG7TWQcjs.transformReservedWord.call(void 0, name);
|
|
277
258
|
};
|
|
278
259
|
this.config = config;
|
|
279
260
|
this.logger = options.logger;
|
|
280
|
-
this.queue = new (0,
|
|
281
|
-
this.fileManager = new (0,
|
|
261
|
+
this.queue = new (0, _chunkESX7D52Dcjs.PQueue)({ concurrency: 1 });
|
|
262
|
+
this.fileManager = new (0, _chunkESX7D52Dcjs.FileManager)({
|
|
282
263
|
task: options.task,
|
|
283
264
|
queue: this.queue
|
|
284
265
|
});
|
|
285
|
-
|
|
266
|
+
_chunkZG4WVJOZcjs.__privateSet.call(void 0, this, _promiseManager, new PromiseManager({
|
|
286
267
|
nullCheck: (state) => !!_optionalChain([state, 'optionalAccess', _10 => _10.result])
|
|
287
268
|
}));
|
|
288
269
|
const plugins = config.plugins || [];
|
|
@@ -293,11 +274,11 @@ Falling back on the first item.
|
|
|
293
274
|
fileManager: this.fileManager,
|
|
294
275
|
resolvePath: this.resolvePath.bind(this),
|
|
295
276
|
resolveName: this.resolveName.bind(this),
|
|
296
|
-
getPlugins:
|
|
277
|
+
getPlugins: _chunkZG4WVJOZcjs.__privateMethod.call(void 0, this, _PluginManager_instances, getSortedPlugins_fn).bind(this)
|
|
297
278
|
});
|
|
298
|
-
|
|
299
|
-
this.plugins = [
|
|
300
|
-
return
|
|
279
|
+
_chunkZG4WVJOZcjs.__privateSet.call(void 0, this, _core, _chunkZG4WVJOZcjs.__privateMethod.call(void 0, this, _PluginManager_instances, parse_fn).call(this, core, this, core.api.call(null)));
|
|
280
|
+
this.plugins = [_chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _core), ...plugins].map((plugin) => {
|
|
281
|
+
return _chunkZG4WVJOZcjs.__privateMethod.call(void 0, this, _PluginManager_instances, parse_fn).call(this, plugin, this, _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _core).api);
|
|
301
282
|
});
|
|
302
283
|
return this;
|
|
303
284
|
}
|
|
@@ -337,7 +318,7 @@ Falling back on the first item.
|
|
|
337
318
|
}) {
|
|
338
319
|
const plugins = this.getPluginsByKey(hookName, pluginKey);
|
|
339
320
|
const promises = plugins.map((plugin) => {
|
|
340
|
-
return
|
|
321
|
+
return _chunkZG4WVJOZcjs.__privateMethod.call(void 0, this, _PluginManager_instances, execute_fn).call(this, {
|
|
341
322
|
strategy: "hookFirst",
|
|
342
323
|
hookName,
|
|
343
324
|
parameters,
|
|
@@ -356,7 +337,7 @@ Falling back on the first item.
|
|
|
356
337
|
}) {
|
|
357
338
|
const plugins = this.getPluginsByKey(hookName, pluginKey);
|
|
358
339
|
return plugins.map((plugin) => {
|
|
359
|
-
return
|
|
340
|
+
return _chunkZG4WVJOZcjs.__privateMethod.call(void 0, this, _PluginManager_instances, executeSync_fn).call(this, {
|
|
360
341
|
strategy: "hookFirst",
|
|
361
342
|
hookName,
|
|
362
343
|
parameters,
|
|
@@ -372,11 +353,11 @@ Falling back on the first item.
|
|
|
372
353
|
parameters,
|
|
373
354
|
skipped
|
|
374
355
|
}) {
|
|
375
|
-
const promises =
|
|
356
|
+
const promises = _chunkZG4WVJOZcjs.__privateMethod.call(void 0, this, _PluginManager_instances, getSortedPlugins_fn).call(this).filter((plugin) => {
|
|
376
357
|
return skipped ? skipped.has(plugin) : true;
|
|
377
358
|
}).map((plugin) => {
|
|
378
359
|
return async () => {
|
|
379
|
-
const value = await
|
|
360
|
+
const value = await _chunkZG4WVJOZcjs.__privateMethod.call(void 0, this, _PluginManager_instances, execute_fn).call(this, {
|
|
380
361
|
strategy: "hookFirst",
|
|
381
362
|
hookName,
|
|
382
363
|
parameters,
|
|
@@ -388,7 +369,7 @@ Falling back on the first item.
|
|
|
388
369
|
});
|
|
389
370
|
};
|
|
390
371
|
});
|
|
391
|
-
return
|
|
372
|
+
return _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _promiseManager).run("first", promises);
|
|
392
373
|
}
|
|
393
374
|
/**
|
|
394
375
|
* First non-null result stops and will return it's value.
|
|
@@ -399,12 +380,12 @@ Falling back on the first item.
|
|
|
399
380
|
skipped
|
|
400
381
|
}) {
|
|
401
382
|
let parseResult = null;
|
|
402
|
-
for (const plugin of
|
|
383
|
+
for (const plugin of _chunkZG4WVJOZcjs.__privateMethod.call(void 0, this, _PluginManager_instances, getSortedPlugins_fn).call(this)) {
|
|
403
384
|
if (_optionalChain([skipped, 'optionalAccess', _11 => _11.has, 'call', _12 => _12(plugin)])) {
|
|
404
385
|
continue;
|
|
405
386
|
}
|
|
406
387
|
parseResult = {
|
|
407
|
-
result:
|
|
388
|
+
result: _chunkZG4WVJOZcjs.__privateMethod.call(void 0, this, _PluginManager_instances, executeSync_fn).call(this, {
|
|
408
389
|
strategy: "hookFirst",
|
|
409
390
|
hookName,
|
|
410
391
|
parameters,
|
|
@@ -425,19 +406,19 @@ Falling back on the first item.
|
|
|
425
406
|
hookName,
|
|
426
407
|
parameters
|
|
427
408
|
}) {
|
|
428
|
-
const promises =
|
|
429
|
-
return () =>
|
|
409
|
+
const promises = _chunkZG4WVJOZcjs.__privateMethod.call(void 0, this, _PluginManager_instances, getSortedPlugins_fn).call(this).map((plugin) => {
|
|
410
|
+
return () => _chunkZG4WVJOZcjs.__privateMethod.call(void 0, this, _PluginManager_instances, execute_fn).call(this, {
|
|
430
411
|
strategy: "hookParallel",
|
|
431
412
|
hookName,
|
|
432
413
|
parameters,
|
|
433
414
|
plugin
|
|
434
415
|
});
|
|
435
416
|
});
|
|
436
|
-
const results = await
|
|
417
|
+
const results = await _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _promiseManager).run("parallel", promises);
|
|
437
418
|
results.forEach((result, index) => {
|
|
438
419
|
if (isPromiseRejectedResult(result)) {
|
|
439
|
-
const plugin =
|
|
440
|
-
|
|
420
|
+
const plugin = _chunkZG4WVJOZcjs.__privateMethod.call(void 0, this, _PluginManager_instances, getSortedPlugins_fn).call(this)[index];
|
|
421
|
+
_chunkZG4WVJOZcjs.__privateMethod.call(void 0, this, _PluginManager_instances, catcher_fn).call(this, result.reason, plugin, hookName);
|
|
441
422
|
}
|
|
442
423
|
});
|
|
443
424
|
return results.filter((result) => result.status === "fulfilled").map((result) => result.value);
|
|
@@ -452,16 +433,16 @@ Falling back on the first item.
|
|
|
452
433
|
}) {
|
|
453
434
|
const [argument0, ...rest] = parameters;
|
|
454
435
|
let promise = Promise.resolve(argument0);
|
|
455
|
-
for (const plugin of
|
|
436
|
+
for (const plugin of _chunkZG4WVJOZcjs.__privateMethod.call(void 0, this, _PluginManager_instances, getSortedPlugins_fn).call(this)) {
|
|
456
437
|
promise = promise.then((arg0) => {
|
|
457
|
-
const value =
|
|
438
|
+
const value = _chunkZG4WVJOZcjs.__privateMethod.call(void 0, this, _PluginManager_instances, execute_fn).call(this, {
|
|
458
439
|
strategy: "hookReduceArg0",
|
|
459
440
|
hookName,
|
|
460
441
|
parameters: [arg0, ...rest],
|
|
461
442
|
plugin
|
|
462
443
|
});
|
|
463
444
|
return value;
|
|
464
|
-
}).then((result) => reduce.call(
|
|
445
|
+
}).then((result) => reduce.call(_chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _core).api, argument0, result, plugin));
|
|
465
446
|
}
|
|
466
447
|
return promise;
|
|
467
448
|
}
|
|
@@ -469,15 +450,15 @@ Falling back on the first item.
|
|
|
469
450
|
* Chains plugins
|
|
470
451
|
*/
|
|
471
452
|
async hookSeq({ hookName, parameters }) {
|
|
472
|
-
const promises =
|
|
473
|
-
return () =>
|
|
453
|
+
const promises = _chunkZG4WVJOZcjs.__privateMethod.call(void 0, this, _PluginManager_instances, getSortedPlugins_fn).call(this).map((plugin) => {
|
|
454
|
+
return () => _chunkZG4WVJOZcjs.__privateMethod.call(void 0, this, _PluginManager_instances, execute_fn).call(this, {
|
|
474
455
|
strategy: "hookSeq",
|
|
475
456
|
hookName,
|
|
476
457
|
parameters,
|
|
477
458
|
plugin
|
|
478
459
|
});
|
|
479
460
|
});
|
|
480
|
-
return
|
|
461
|
+
return _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _promiseManager).run("seq", promises);
|
|
481
462
|
}
|
|
482
463
|
getPluginsByKey(hookName, pluginKey) {
|
|
483
464
|
const plugins = [...this.plugins];
|
|
@@ -524,11 +505,11 @@ Falling back on the first item.
|
|
|
524
505
|
_core = new WeakMap();
|
|
525
506
|
_usedPluginNames = new WeakMap();
|
|
526
507
|
_promiseManager = new WeakMap();
|
|
527
|
-
|
|
508
|
+
_PluginManager_instances = new WeakSet();
|
|
528
509
|
getSortedPlugins_fn = function(hookName) {
|
|
529
510
|
const plugins = [...this.plugins].filter((plugin) => plugin.name !== "core");
|
|
530
511
|
if (hookName) {
|
|
531
|
-
if (this.logger.logLevel ===
|
|
512
|
+
if (this.logger.logLevel === _chunkQ7VRQ7E7cjs.LogLevel.info) {
|
|
532
513
|
const containsHookName = plugins.some((item) => item[hookName]);
|
|
533
514
|
if (!containsHookName) {
|
|
534
515
|
this.logger.emit("warning", `No hook ${hookName} found`);
|
|
@@ -554,14 +535,19 @@ getSortedPlugins_fn = function(hookName) {
|
|
|
554
535
|
return 0;
|
|
555
536
|
});
|
|
556
537
|
};
|
|
557
|
-
_addExecutedToCallStack = new WeakSet();
|
|
558
538
|
addExecutedToCallStack_fn = function(executer) {
|
|
559
539
|
if (executer) {
|
|
560
540
|
this.events.emit("executed", executer);
|
|
561
541
|
this.executed.push(executer);
|
|
562
542
|
}
|
|
563
543
|
};
|
|
564
|
-
|
|
544
|
+
/**
|
|
545
|
+
* Run an async plugin hook and return the result.
|
|
546
|
+
* @param hookName Name of the plugin hook. Must be either in `PluginHooks` or `OutputPluginValueHooks`.
|
|
547
|
+
* @param args Arguments passed to the plugin hook.
|
|
548
|
+
* @param plugin The actual pluginObject to run.
|
|
549
|
+
*/
|
|
550
|
+
// Implementation signature
|
|
565
551
|
execute_fn = function({
|
|
566
552
|
strategy,
|
|
567
553
|
hookName,
|
|
@@ -576,7 +562,7 @@ execute_fn = function({
|
|
|
576
562
|
this.events.emit("execute", { strategy, hookName, parameters, plugin });
|
|
577
563
|
const task = Promise.resolve().then(() => {
|
|
578
564
|
if (typeof hook === "function") {
|
|
579
|
-
const possiblePromiseResult = hook.apply({ ...
|
|
565
|
+
const possiblePromiseResult = hook.apply({ ..._chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _core).api, plugin }, parameters);
|
|
580
566
|
if (isPromise(possiblePromiseResult)) {
|
|
581
567
|
return Promise.resolve(possiblePromiseResult);
|
|
582
568
|
}
|
|
@@ -585,7 +571,7 @@ execute_fn = function({
|
|
|
585
571
|
return hook;
|
|
586
572
|
}).then((result) => {
|
|
587
573
|
output = result;
|
|
588
|
-
|
|
574
|
+
_chunkZG4WVJOZcjs.__privateMethod.call(void 0, this, _PluginManager_instances, addExecutedToCallStack_fn).call(this, {
|
|
589
575
|
parameters,
|
|
590
576
|
output,
|
|
591
577
|
strategy,
|
|
@@ -594,12 +580,18 @@ execute_fn = function({
|
|
|
594
580
|
});
|
|
595
581
|
return result;
|
|
596
582
|
}).catch((e) => {
|
|
597
|
-
|
|
583
|
+
_chunkZG4WVJOZcjs.__privateMethod.call(void 0, this, _PluginManager_instances, catcher_fn).call(this, e, plugin, hookName);
|
|
598
584
|
return null;
|
|
599
585
|
});
|
|
600
586
|
return task;
|
|
601
587
|
};
|
|
602
|
-
|
|
588
|
+
/**
|
|
589
|
+
* Run a sync plugin hook and return the result.
|
|
590
|
+
* @param hookName Name of the plugin hook. Must be in `PluginHooks`.
|
|
591
|
+
* @param args Arguments passed to the plugin hook.
|
|
592
|
+
* @param plugin The acutal plugin
|
|
593
|
+
* @param replaceContext When passed, the plugin context can be overridden.
|
|
594
|
+
*/
|
|
603
595
|
executeSync_fn = function({
|
|
604
596
|
strategy,
|
|
605
597
|
hookName,
|
|
@@ -614,12 +606,12 @@ executeSync_fn = function({
|
|
|
614
606
|
this.events.emit("execute", { strategy, hookName, parameters, plugin });
|
|
615
607
|
try {
|
|
616
608
|
if (typeof hook === "function") {
|
|
617
|
-
const fn = hook.apply({ ...
|
|
609
|
+
const fn = hook.apply({ ..._chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _core).api, plugin }, parameters);
|
|
618
610
|
output = fn;
|
|
619
611
|
return fn;
|
|
620
612
|
}
|
|
621
613
|
output = hook;
|
|
622
|
-
|
|
614
|
+
_chunkZG4WVJOZcjs.__privateMethod.call(void 0, this, _PluginManager_instances, addExecutedToCallStack_fn).call(this, {
|
|
623
615
|
parameters,
|
|
624
616
|
output,
|
|
625
617
|
strategy,
|
|
@@ -628,20 +620,18 @@ executeSync_fn = function({
|
|
|
628
620
|
});
|
|
629
621
|
return hook;
|
|
630
622
|
} catch (e) {
|
|
631
|
-
|
|
623
|
+
_chunkZG4WVJOZcjs.__privateMethod.call(void 0, this, _PluginManager_instances, catcher_fn).call(this, e, plugin, hookName);
|
|
632
624
|
return null;
|
|
633
625
|
}
|
|
634
626
|
};
|
|
635
|
-
_catcher = new WeakSet();
|
|
636
627
|
catcher_fn = function(cause, plugin, hookName) {
|
|
637
628
|
const text = `${cause.message} (plugin: ${_optionalChain([plugin, 'optionalAccess', _25 => _25.name]) || "unknown"}, hook: ${hookName || "unknown"})`;
|
|
638
629
|
this.logger.emit("error", text, cause);
|
|
639
630
|
this.events.emit("error", cause);
|
|
640
631
|
};
|
|
641
|
-
_parse = new WeakSet();
|
|
642
632
|
parse_fn = function(plugin, pluginManager, context) {
|
|
643
|
-
const usedPluginNames =
|
|
644
|
-
|
|
633
|
+
const usedPluginNames = _chunkZG4WVJOZcjs.__privateGet.call(void 0, pluginManager, _usedPluginNames);
|
|
634
|
+
_chunkOCFABH5Lcjs.setUniqueName.call(void 0, plugin.name, usedPluginNames);
|
|
645
635
|
const key = [plugin.name, usedPluginNames[plugin.name]].filter(Boolean);
|
|
646
636
|
if (!plugin.transform) {
|
|
647
637
|
plugin.transform = function transform(_path, code) {
|
|
@@ -663,7 +653,7 @@ parse_fn = function(plugin, pluginManager, context) {
|
|
|
663
653
|
};
|
|
664
654
|
|
|
665
655
|
// src/config.ts
|
|
666
|
-
|
|
656
|
+
_chunkZG4WVJOZcjs.init_cjs_shims.call(void 0, );
|
|
667
657
|
function defineConfig(options) {
|
|
668
658
|
return options;
|
|
669
659
|
}
|
|
@@ -676,16 +666,16 @@ async function transformReducer(_previousCode, result, _plugin) {
|
|
|
676
666
|
return result;
|
|
677
667
|
}
|
|
678
668
|
async function setup(options) {
|
|
679
|
-
const { config, logger =
|
|
669
|
+
const { config, logger = _chunkQ7VRQ7E7cjs.createLogger.call(void 0, { logLevel: _chunkQ7VRQ7E7cjs.LogLevel.silent }) } = options;
|
|
680
670
|
let count = 0;
|
|
681
671
|
try {
|
|
682
|
-
if (isInputPath(config) && !new (0,
|
|
672
|
+
if (isInputPath(config) && !new (0, _chunkOCFABH5Lcjs.URLPath)(config.input.path).isURL) {
|
|
683
673
|
await _fs.read.call(void 0, config.input.path);
|
|
684
674
|
}
|
|
685
675
|
} catch (e) {
|
|
686
676
|
if (isInputPath(config)) {
|
|
687
677
|
throw new Error(
|
|
688
|
-
`Cannot read file/URL defined in \`input.path\` or set with \`kubb generate PATH\` in the CLI of your Kubb config ${
|
|
678
|
+
`Cannot read file/URL defined in \`input.path\` or set with \`kubb generate PATH\` in the CLI of your Kubb config ${_chunkQ7VRQ7E7cjs.p.dim(config.input.path)}`,
|
|
689
679
|
{
|
|
690
680
|
cause: e
|
|
691
681
|
}
|
|
@@ -697,7 +687,7 @@ async function setup(options) {
|
|
|
697
687
|
}
|
|
698
688
|
const task = async (file) => {
|
|
699
689
|
const { path: path4 } = file;
|
|
700
|
-
let source = await
|
|
690
|
+
let source = await _chunkESX7D52Dcjs.FileManager.getSource(file);
|
|
701
691
|
const { result: loadedResult } = await pluginManager.hookFirst({
|
|
702
692
|
hookName: "load",
|
|
703
693
|
parameters: [path4]
|
|
@@ -738,14 +728,14 @@ async function setup(options) {
|
|
|
738
728
|
const { hookName, parameters, plugin } = executer;
|
|
739
729
|
if (hookName === "writeFile") {
|
|
740
730
|
const [code] = parameters;
|
|
741
|
-
logger.emit("debug", [`PluginKey ${
|
|
731
|
+
logger.emit("debug", [`PluginKey ${_chunkQ7VRQ7E7cjs.p.dim(JSON.stringify(plugin.key))}
|
|
742
732
|
with source
|
|
743
733
|
|
|
744
734
|
${code}`]);
|
|
745
735
|
}
|
|
746
736
|
});
|
|
747
737
|
pluginManager.queue.on("add", () => {
|
|
748
|
-
if (logger.logLevel !==
|
|
738
|
+
if (logger.logLevel !== _chunkQ7VRQ7E7cjs.LogLevel.info) {
|
|
749
739
|
return;
|
|
750
740
|
}
|
|
751
741
|
if (count === 0) {
|
|
@@ -753,31 +743,31 @@ ${code}`]);
|
|
|
753
743
|
}
|
|
754
744
|
});
|
|
755
745
|
pluginManager.queue.on("active", () => {
|
|
756
|
-
if (logger.logLevel !==
|
|
746
|
+
if (logger.logLevel !== _chunkQ7VRQ7E7cjs.LogLevel.info) {
|
|
757
747
|
return;
|
|
758
748
|
}
|
|
759
749
|
if (logger.spinner && pluginManager.queue.size > 0) {
|
|
760
750
|
const text = `Item: ${count} Size: ${pluginManager.queue.size} Pending: ${pluginManager.queue.pending}`;
|
|
761
|
-
logger.spinner.suffixText =
|
|
751
|
+
logger.spinner.suffixText = _chunkQ7VRQ7E7cjs.p.dim(text);
|
|
762
752
|
}
|
|
763
753
|
++count;
|
|
764
754
|
});
|
|
765
755
|
pluginManager.queue.on("completed", () => {
|
|
766
|
-
if (logger.logLevel !==
|
|
756
|
+
if (logger.logLevel !== _chunkQ7VRQ7E7cjs.LogLevel.info) {
|
|
767
757
|
return;
|
|
768
758
|
}
|
|
769
759
|
if (logger.spinner) {
|
|
770
760
|
const text = `Item: ${count} Size: ${pluginManager.queue.size} Pending: ${pluginManager.queue.pending}`;
|
|
771
|
-
logger.spinner.suffixText =
|
|
761
|
+
logger.spinner.suffixText = _chunkQ7VRQ7E7cjs.p.dim(text);
|
|
772
762
|
}
|
|
773
763
|
});
|
|
774
764
|
pluginManager.on("executed", (executer) => {
|
|
775
765
|
const { hookName, plugin, output, parameters } = executer;
|
|
776
766
|
const logs = [
|
|
777
|
-
`${
|
|
778
|
-
parameters && `${
|
|
767
|
+
`${_chunkQ7VRQ7E7cjs.randomCliColour.call(void 0, plugin.name)} Executing ${hookName}`,
|
|
768
|
+
parameters && `${_chunkQ7VRQ7E7cjs.p.bgWhite("Parameters")} ${_chunkQ7VRQ7E7cjs.randomCliColour.call(void 0, plugin.name)} ${hookName}`,
|
|
779
769
|
JSON.stringify(parameters, void 0, 2),
|
|
780
|
-
output && `${
|
|
770
|
+
output && `${_chunkQ7VRQ7E7cjs.p.bgWhite("Output")} ${_chunkQ7VRQ7E7cjs.randomCliColour.call(void 0, plugin.name)} ${hookName}`,
|
|
781
771
|
output
|
|
782
772
|
].filter(Boolean);
|
|
783
773
|
logger.emit("debug", logs);
|
|
@@ -792,13 +782,13 @@ async function build(options) {
|
|
|
792
782
|
parameters: [options.config]
|
|
793
783
|
});
|
|
794
784
|
await pluginManager.hookParallel({ hookName: "buildEnd" });
|
|
795
|
-
if (logger.logLevel ===
|
|
785
|
+
if (logger.logLevel === _chunkQ7VRQ7E7cjs.LogLevel.info) {
|
|
796
786
|
logger.emit("end", "\u{1F4BE} Writing completed");
|
|
797
787
|
}
|
|
798
788
|
const files = await Promise.all(
|
|
799
789
|
fileManager.files.map(async (file) => ({
|
|
800
790
|
...file,
|
|
801
|
-
source: await
|
|
791
|
+
source: await _chunkESX7D52Dcjs.FileManager.getSource(file)
|
|
802
792
|
}))
|
|
803
793
|
);
|
|
804
794
|
return {
|
|
@@ -815,14 +805,14 @@ async function safeBuild(options) {
|
|
|
815
805
|
parameters: [options.config]
|
|
816
806
|
});
|
|
817
807
|
await pluginManager.hookParallel({ hookName: "buildEnd" });
|
|
818
|
-
if (logger.logLevel ===
|
|
808
|
+
if (logger.logLevel === _chunkQ7VRQ7E7cjs.LogLevel.info) {
|
|
819
809
|
logger.emit("end", "\u{1F4BE} Writing completed");
|
|
820
810
|
}
|
|
821
811
|
} catch (e) {
|
|
822
812
|
const files2 = await Promise.all(
|
|
823
813
|
fileManager.files.map(async (file) => ({
|
|
824
814
|
...file,
|
|
825
|
-
source: await
|
|
815
|
+
source: await _chunkESX7D52Dcjs.FileManager.getSource(file)
|
|
826
816
|
}))
|
|
827
817
|
);
|
|
828
818
|
return {
|
|
@@ -834,7 +824,7 @@ async function safeBuild(options) {
|
|
|
834
824
|
const files = await Promise.all(
|
|
835
825
|
fileManager.files.map(async (file) => ({
|
|
836
826
|
...file,
|
|
837
|
-
source: await
|
|
827
|
+
source: await _chunkESX7D52Dcjs.FileManager.getSource(file)
|
|
838
828
|
}))
|
|
839
829
|
);
|
|
840
830
|
return {
|
|
@@ -844,103 +834,103 @@ async function safeBuild(options) {
|
|
|
844
834
|
}
|
|
845
835
|
|
|
846
836
|
// src/Generator.ts
|
|
847
|
-
|
|
837
|
+
_chunkZG4WVJOZcjs.init_cjs_shims.call(void 0, );
|
|
848
838
|
var _options2, _context;
|
|
849
839
|
var Generator = class {
|
|
850
840
|
constructor(options, context) {
|
|
851
|
-
|
|
852
|
-
|
|
841
|
+
_chunkZG4WVJOZcjs.__privateAdd.call(void 0, this, _options2, {});
|
|
842
|
+
_chunkZG4WVJOZcjs.__privateAdd.call(void 0, this, _context, {});
|
|
853
843
|
if (context) {
|
|
854
|
-
|
|
844
|
+
_chunkZG4WVJOZcjs.__privateSet.call(void 0, this, _context, context);
|
|
855
845
|
}
|
|
856
846
|
if (options) {
|
|
857
|
-
|
|
847
|
+
_chunkZG4WVJOZcjs.__privateSet.call(void 0, this, _options2, options);
|
|
858
848
|
}
|
|
859
849
|
return this;
|
|
860
850
|
}
|
|
861
851
|
get options() {
|
|
862
|
-
return
|
|
852
|
+
return _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _options2);
|
|
863
853
|
}
|
|
864
854
|
get context() {
|
|
865
|
-
return
|
|
855
|
+
return _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _context);
|
|
866
856
|
}
|
|
867
857
|
set options(options) {
|
|
868
|
-
|
|
858
|
+
_chunkZG4WVJOZcjs.__privateSet.call(void 0, this, _options2, { ..._chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _options2), ...options });
|
|
869
859
|
}
|
|
870
860
|
};
|
|
871
861
|
_options2 = new WeakMap();
|
|
872
862
|
_context = new WeakMap();
|
|
873
863
|
|
|
874
864
|
// src/PackageManager.ts
|
|
875
|
-
|
|
865
|
+
_chunkZG4WVJOZcjs.init_cjs_shims.call(void 0, );
|
|
876
866
|
var _module = require('module'); var _module2 = _interopRequireDefault(_module);
|
|
877
867
|
var _os = require('os'); var _os2 = _interopRequireDefault(_os);
|
|
878
868
|
var _url = require('url');
|
|
879
869
|
|
|
880
870
|
// ../../node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js
|
|
881
|
-
|
|
871
|
+
_chunkZG4WVJOZcjs.init_cjs_shims.call(void 0, );
|
|
882
872
|
|
|
883
873
|
|
|
884
874
|
// ../../node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js
|
|
885
|
-
|
|
875
|
+
_chunkZG4WVJOZcjs.init_cjs_shims.call(void 0, );
|
|
886
876
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
887
877
|
|
|
888
878
|
var _fs3 = require('fs'); var _fs4 = _interopRequireDefault(_fs3);
|
|
889
879
|
|
|
890
880
|
|
|
891
881
|
// ../../node_modules/.pnpm/p-locate@6.0.0/node_modules/p-locate/index.js
|
|
892
|
-
|
|
882
|
+
_chunkZG4WVJOZcjs.init_cjs_shims.call(void 0, );
|
|
893
883
|
|
|
894
884
|
// ../../node_modules/.pnpm/p-limit@4.0.0/node_modules/p-limit/index.js
|
|
895
|
-
|
|
885
|
+
_chunkZG4WVJOZcjs.init_cjs_shims.call(void 0, );
|
|
896
886
|
|
|
897
887
|
// ../../node_modules/.pnpm/yocto-queue@1.0.0/node_modules/yocto-queue/index.js
|
|
898
|
-
|
|
888
|
+
_chunkZG4WVJOZcjs.init_cjs_shims.call(void 0, );
|
|
899
889
|
var Node = class {
|
|
900
890
|
constructor(value) {
|
|
901
|
-
|
|
902
|
-
|
|
891
|
+
_chunkZG4WVJOZcjs.__publicField.call(void 0, this, "value");
|
|
892
|
+
_chunkZG4WVJOZcjs.__publicField.call(void 0, this, "next");
|
|
903
893
|
this.value = value;
|
|
904
894
|
}
|
|
905
895
|
};
|
|
906
896
|
var _head, _tail, _size;
|
|
907
897
|
var Queue = class {
|
|
908
898
|
constructor() {
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
899
|
+
_chunkZG4WVJOZcjs.__privateAdd.call(void 0, this, _head);
|
|
900
|
+
_chunkZG4WVJOZcjs.__privateAdd.call(void 0, this, _tail);
|
|
901
|
+
_chunkZG4WVJOZcjs.__privateAdd.call(void 0, this, _size);
|
|
912
902
|
this.clear();
|
|
913
903
|
}
|
|
914
904
|
enqueue(value) {
|
|
915
905
|
const node = new Node(value);
|
|
916
|
-
if (
|
|
917
|
-
|
|
918
|
-
|
|
906
|
+
if (_chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _head)) {
|
|
907
|
+
_chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _tail).next = node;
|
|
908
|
+
_chunkZG4WVJOZcjs.__privateSet.call(void 0, this, _tail, node);
|
|
919
909
|
} else {
|
|
920
|
-
|
|
921
|
-
|
|
910
|
+
_chunkZG4WVJOZcjs.__privateSet.call(void 0, this, _head, node);
|
|
911
|
+
_chunkZG4WVJOZcjs.__privateSet.call(void 0, this, _tail, node);
|
|
922
912
|
}
|
|
923
|
-
|
|
913
|
+
_chunkZG4WVJOZcjs.__privateWrapper.call(void 0, this, _size)._++;
|
|
924
914
|
}
|
|
925
915
|
dequeue() {
|
|
926
|
-
const current =
|
|
916
|
+
const current = _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _head);
|
|
927
917
|
if (!current) {
|
|
928
918
|
return;
|
|
929
919
|
}
|
|
930
|
-
|
|
931
|
-
|
|
920
|
+
_chunkZG4WVJOZcjs.__privateSet.call(void 0, this, _head, _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _head).next);
|
|
921
|
+
_chunkZG4WVJOZcjs.__privateWrapper.call(void 0, this, _size)._--;
|
|
932
922
|
return current.value;
|
|
933
923
|
}
|
|
934
924
|
clear() {
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
925
|
+
_chunkZG4WVJOZcjs.__privateSet.call(void 0, this, _head, void 0);
|
|
926
|
+
_chunkZG4WVJOZcjs.__privateSet.call(void 0, this, _tail, void 0);
|
|
927
|
+
_chunkZG4WVJOZcjs.__privateSet.call(void 0, this, _size, 0);
|
|
938
928
|
}
|
|
939
929
|
get size() {
|
|
940
|
-
return
|
|
930
|
+
return _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _size);
|
|
941
931
|
}
|
|
942
932
|
*[Symbol.iterator]() {
|
|
943
|
-
let current =
|
|
933
|
+
let current = _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _head);
|
|
944
934
|
while (current) {
|
|
945
935
|
yield current.value;
|
|
946
936
|
current = current.next;
|
|
@@ -1091,14 +1081,14 @@ function locatePathSync(paths, {
|
|
|
1091
1081
|
}
|
|
1092
1082
|
|
|
1093
1083
|
// ../../node_modules/.pnpm/unicorn-magic@0.1.0/node_modules/unicorn-magic/node.js
|
|
1094
|
-
|
|
1084
|
+
_chunkZG4WVJOZcjs.init_cjs_shims.call(void 0, );
|
|
1095
1085
|
|
|
1096
1086
|
function toPath2(urlOrPath) {
|
|
1097
1087
|
return urlOrPath instanceof URL ? _url.fileURLToPath.call(void 0, urlOrPath) : urlOrPath;
|
|
1098
1088
|
}
|
|
1099
1089
|
|
|
1100
1090
|
// ../../node_modules/.pnpm/path-exists@5.0.0/node_modules/path-exists/index.js
|
|
1101
|
-
|
|
1091
|
+
_chunkZG4WVJOZcjs.init_cjs_shims.call(void 0, );
|
|
1102
1092
|
|
|
1103
1093
|
|
|
1104
1094
|
// ../../node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js
|
|
@@ -1179,33 +1169,33 @@ function findUpSync(name, options = {}) {
|
|
|
1179
1169
|
// src/PackageManager.ts
|
|
1180
1170
|
var _semver = require('semver');
|
|
1181
1171
|
|
|
1182
|
-
var _cache, _cwd, _SLASHES,
|
|
1172
|
+
var _cache, _cwd, _SLASHES, _PackageManager_instances, match_fn;
|
|
1183
1173
|
var _PackageManager = class _PackageManager {
|
|
1184
1174
|
constructor(workspace) {
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1175
|
+
_chunkZG4WVJOZcjs.__privateAdd.call(void 0, this, _PackageManager_instances);
|
|
1176
|
+
_chunkZG4WVJOZcjs.__privateAdd.call(void 0, this, _cwd);
|
|
1177
|
+
_chunkZG4WVJOZcjs.__privateAdd.call(void 0, this, _SLASHES, /* @__PURE__ */ new Set(["/", "\\"]));
|
|
1188
1178
|
if (workspace) {
|
|
1189
|
-
|
|
1179
|
+
_chunkZG4WVJOZcjs.__privateSet.call(void 0, this, _cwd, workspace);
|
|
1190
1180
|
}
|
|
1191
1181
|
return this;
|
|
1192
1182
|
}
|
|
1193
1183
|
set workspace(workspace) {
|
|
1194
|
-
|
|
1184
|
+
_chunkZG4WVJOZcjs.__privateSet.call(void 0, this, _cwd, workspace);
|
|
1195
1185
|
}
|
|
1196
1186
|
get workspace() {
|
|
1197
|
-
return
|
|
1187
|
+
return _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _cwd);
|
|
1198
1188
|
}
|
|
1199
1189
|
normalizeDirectory(directory) {
|
|
1200
|
-
if (!
|
|
1190
|
+
if (!_chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _SLASHES).has(directory[directory.length - 1])) {
|
|
1201
1191
|
return `${directory}/`;
|
|
1202
1192
|
}
|
|
1203
1193
|
return directory;
|
|
1204
1194
|
}
|
|
1205
1195
|
getLocation(path4) {
|
|
1206
1196
|
let location = path4;
|
|
1207
|
-
if (
|
|
1208
|
-
const require2 = _module2.default.createRequire(this.normalizeDirectory(
|
|
1197
|
+
if (_chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _cwd)) {
|
|
1198
|
+
const require2 = _module2.default.createRequire(this.normalizeDirectory(_chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _cwd)));
|
|
1209
1199
|
location = require2.resolve(path4);
|
|
1210
1200
|
}
|
|
1211
1201
|
return location;
|
|
@@ -1225,7 +1215,7 @@ var _PackageManager = class _PackageManager {
|
|
|
1225
1215
|
}
|
|
1226
1216
|
async getPackageJSON() {
|
|
1227
1217
|
const pkgPath = await findUp(["package.json"], {
|
|
1228
|
-
cwd:
|
|
1218
|
+
cwd: _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _cwd)
|
|
1229
1219
|
});
|
|
1230
1220
|
if (!pkgPath) {
|
|
1231
1221
|
return void 0;
|
|
@@ -1235,7 +1225,7 @@ var _PackageManager = class _PackageManager {
|
|
|
1235
1225
|
}
|
|
1236
1226
|
getPackageJSONSync() {
|
|
1237
1227
|
const pkgPath = findUpSync(["package.json"], {
|
|
1238
|
-
cwd:
|
|
1228
|
+
cwd: _chunkZG4WVJOZcjs.__privateGet.call(void 0, this, _cwd)
|
|
1239
1229
|
});
|
|
1240
1230
|
if (!pkgPath) {
|
|
1241
1231
|
return void 0;
|
|
@@ -1244,27 +1234,27 @@ var _PackageManager = class _PackageManager {
|
|
|
1244
1234
|
return JSON.parse(json);
|
|
1245
1235
|
}
|
|
1246
1236
|
static setVersion(dependency, version) {
|
|
1247
|
-
|
|
1237
|
+
_chunkZG4WVJOZcjs.__privateGet.call(void 0, _PackageManager, _cache)[dependency] = version;
|
|
1248
1238
|
}
|
|
1249
1239
|
async getVersion(dependency) {
|
|
1250
|
-
if (typeof dependency === "string" &&
|
|
1251
|
-
return
|
|
1240
|
+
if (typeof dependency === "string" && _chunkZG4WVJOZcjs.__privateGet.call(void 0, _PackageManager, _cache)[dependency]) {
|
|
1241
|
+
return _chunkZG4WVJOZcjs.__privateGet.call(void 0, _PackageManager, _cache)[dependency];
|
|
1252
1242
|
}
|
|
1253
1243
|
const packageJSON = await this.getPackageJSON();
|
|
1254
1244
|
if (!packageJSON) {
|
|
1255
1245
|
return void 0;
|
|
1256
1246
|
}
|
|
1257
|
-
return
|
|
1247
|
+
return _chunkZG4WVJOZcjs.__privateMethod.call(void 0, this, _PackageManager_instances, match_fn).call(this, packageJSON, dependency);
|
|
1258
1248
|
}
|
|
1259
1249
|
getVersionSync(dependency) {
|
|
1260
|
-
if (typeof dependency === "string" &&
|
|
1261
|
-
return
|
|
1250
|
+
if (typeof dependency === "string" && _chunkZG4WVJOZcjs.__privateGet.call(void 0, _PackageManager, _cache)[dependency]) {
|
|
1251
|
+
return _chunkZG4WVJOZcjs.__privateGet.call(void 0, _PackageManager, _cache)[dependency];
|
|
1262
1252
|
}
|
|
1263
1253
|
const packageJSON = this.getPackageJSONSync();
|
|
1264
1254
|
if (!packageJSON) {
|
|
1265
1255
|
return void 0;
|
|
1266
1256
|
}
|
|
1267
|
-
return
|
|
1257
|
+
return _chunkZG4WVJOZcjs.__privateMethod.call(void 0, this, _PackageManager_instances, match_fn).call(this, packageJSON, dependency);
|
|
1268
1258
|
}
|
|
1269
1259
|
async isValid(dependency, version) {
|
|
1270
1260
|
const packageVersion = await this.getVersion(dependency);
|
|
@@ -1295,7 +1285,7 @@ var _PackageManager = class _PackageManager {
|
|
|
1295
1285
|
_cache = new WeakMap();
|
|
1296
1286
|
_cwd = new WeakMap();
|
|
1297
1287
|
_SLASHES = new WeakMap();
|
|
1298
|
-
|
|
1288
|
+
_PackageManager_instances = new WeakSet();
|
|
1299
1289
|
match_fn = function(packageJSON, dependency) {
|
|
1300
1290
|
const dependencies = {
|
|
1301
1291
|
...packageJSON["dependencies"] || {},
|
|
@@ -1307,7 +1297,7 @@ match_fn = function(packageJSON, dependency) {
|
|
|
1307
1297
|
const matchedDependency = Object.keys(dependencies).find((dep) => dep.match(dependency));
|
|
1308
1298
|
return matchedDependency ? dependencies[matchedDependency] : void 0;
|
|
1309
1299
|
};
|
|
1310
|
-
|
|
1300
|
+
_chunkZG4WVJOZcjs.__privateAdd.call(void 0, _PackageManager, _cache, {});
|
|
1311
1301
|
var PackageManager = _PackageManager;
|
|
1312
1302
|
|
|
1313
1303
|
|
|
@@ -1322,5 +1312,5 @@ var PackageManager = _PackageManager;
|
|
|
1322
1312
|
|
|
1323
1313
|
|
|
1324
1314
|
|
|
1325
|
-
exports.FileManager =
|
|
1315
|
+
exports.FileManager = _chunkESX7D52Dcjs.FileManager; exports.Generator = Generator; exports.PackageManager = PackageManager; exports.PluginManager = PluginManager; exports.PromiseManager = PromiseManager; exports.Warning = Warning; exports.build = build; exports.createPlugin = createPlugin; exports.default = build; exports.defineConfig = defineConfig; exports.isInputPath = isInputPath; exports.safeBuild = safeBuild;
|
|
1326
1316
|
//# sourceMappingURL=index.cjs.map
|