@kubb/core 3.0.0-alpha.10 → 3.0.0-alpha.11

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.
Files changed (56) hide show
  1. package/dist/chunk-2EU7DMPM.js +2 -3
  2. package/dist/chunk-2EU7DMPM.js.map +1 -1
  3. package/dist/chunk-4X5FFJPJ.js +8 -13
  4. package/dist/chunk-4X5FFJPJ.js.map +1 -1
  5. package/dist/{chunk-NB4JMN75.cjs → chunk-52WA2JF5.cjs} +130 -142
  6. package/dist/chunk-52WA2JF5.cjs.map +1 -0
  7. package/dist/{chunk-SEH6NUCX.cjs → chunk-ADFKVVPE.cjs} +10 -10
  8. package/dist/chunk-ADFKVVPE.cjs.map +1 -0
  9. package/dist/{chunk-MU3CBCQT.js → chunk-E6CN2CZC.js} +12 -27
  10. package/dist/chunk-E6CN2CZC.js.map +1 -0
  11. package/dist/chunk-HBQM723K.js +12 -26
  12. package/dist/chunk-HBQM723K.js.map +1 -1
  13. package/dist/{chunk-A6PCLWEY.cjs → chunk-HMCSWG5L.cjs} +25 -26
  14. package/dist/chunk-HMCSWG5L.cjs.map +1 -0
  15. package/dist/chunk-L6YLVCKM.js +14 -49
  16. package/dist/chunk-L6YLVCKM.js.map +1 -1
  17. package/dist/{chunk-5E2I6KH4.cjs → chunk-PJLUPV3P.cjs} +54 -37
  18. package/dist/chunk-PJLUPV3P.cjs.map +1 -0
  19. package/dist/{chunk-DID47EQD.cjs → chunk-TTDCUWK7.cjs} +6 -7
  20. package/dist/chunk-TTDCUWK7.cjs.map +1 -0
  21. package/dist/{chunk-M7NLNCSM.cjs → chunk-YEVCYV36.cjs} +33 -36
  22. package/dist/chunk-YEVCYV36.cjs.map +1 -0
  23. package/dist/index.cjs +138 -147
  24. package/dist/index.cjs.map +1 -1
  25. package/dist/index.js +17 -47
  26. package/dist/index.js.map +1 -1
  27. package/dist/logger.cjs +25 -14
  28. package/dist/logger.cjs.map +1 -1
  29. package/dist/logger.js +3 -13
  30. package/dist/logger.js.map +1 -1
  31. package/dist/mocks.cjs +13 -18
  32. package/dist/mocks.cjs.map +1 -1
  33. package/dist/mocks.js +5 -12
  34. package/dist/mocks.js.map +1 -1
  35. package/dist/{prompt-DVQN7JTN.cjs → prompt-L5KFKY73.cjs} +89 -89
  36. package/dist/prompt-L5KFKY73.cjs.map +1 -0
  37. package/dist/prompt-WQQUN22Z.js +8 -13
  38. package/dist/prompt-WQQUN22Z.js.map +1 -1
  39. package/dist/transformers.cjs +62 -52
  40. package/dist/transformers.cjs.map +1 -1
  41. package/dist/transformers.js +9 -37
  42. package/dist/transformers.js.map +1 -1
  43. package/dist/utils.cjs +65 -34
  44. package/dist/utils.cjs.map +1 -1
  45. package/dist/utils.js +3 -33
  46. package/dist/utils.js.map +1 -1
  47. package/package.json +7 -7
  48. package/src/logger.ts +3 -3
  49. package/dist/chunk-5E2I6KH4.cjs.map +0 -1
  50. package/dist/chunk-A6PCLWEY.cjs.map +0 -1
  51. package/dist/chunk-DID47EQD.cjs.map +0 -1
  52. package/dist/chunk-M7NLNCSM.cjs.map +0 -1
  53. package/dist/chunk-MU3CBCQT.js.map +0 -1
  54. package/dist/chunk-NB4JMN75.cjs.map +0 -1
  55. package/dist/chunk-SEH6NUCX.cjs.map +0 -1
  56. package/dist/prompt-DVQN7JTN.cjs.map +0 -1
@@ -1,18 +1,20 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class;
1
+ 'use strict';
2
2
 
3
+ var chunkHMCSWG5L_cjs = require('./chunk-HMCSWG5L.cjs');
4
+ var chunkADFKVVPE_cjs = require('./chunk-ADFKVVPE.cjs');
5
+ var path = require('path');
6
+ var fs = require('@kubb/fs');
7
+ var hash = require('object-hash');
8
+ var remeda = require('remeda');
3
9
 
4
- var _chunkA6PCLWEYcjs = require('./chunk-A6PCLWEY.cjs');
10
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
5
11
 
6
-
7
-
8
-
9
- var _chunkSEH6NUCXcjs = require('./chunk-SEH6NUCX.cjs');
12
+ var hash__default = /*#__PURE__*/_interopDefault(hash);
10
13
 
11
14
  // ../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.js
12
- var require_eventemitter3 = _chunkSEH6NUCXcjs.__commonJS.call(void 0, {
15
+ var require_eventemitter3 = chunkADFKVVPE_cjs.__commonJS({
13
16
  "../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.js"(exports, module) {
14
- "use strict";
15
- _chunkSEH6NUCXcjs.init_cjs_shims.call(void 0, );
17
+ chunkADFKVVPE_cjs.init_cjs_shims();
16
18
  var has = Object.prototype.hasOwnProperty;
17
19
  var prefix = "~";
18
20
  function Events() {
@@ -172,10 +174,10 @@ var require_eventemitter3 = _chunkSEH6NUCXcjs.__commonJS.call(void 0, {
172
174
  });
173
175
 
174
176
  // src/utils/index.ts
175
- _chunkSEH6NUCXcjs.init_cjs_shims.call(void 0, );
177
+ chunkADFKVVPE_cjs.init_cjs_shims();
176
178
 
177
179
  // src/utils/FunctionParams.ts
178
- _chunkSEH6NUCXcjs.init_cjs_shims.call(void 0, );
180
+ chunkADFKVVPE_cjs.init_cjs_shims();
179
181
  var FunctionParams = class _FunctionParams {
180
182
  #items = [];
181
183
  constructor() {
@@ -196,7 +198,7 @@ var FunctionParams = class _FunctionParams {
196
198
  return this;
197
199
  }
198
200
  static #orderItems(items) {
199
- return _chunkA6PCLWEYcjs.orderBy.call(void 0,
201
+ return chunkHMCSWG5L_cjs.orderBy(
200
202
  items.filter(Boolean),
201
203
  [
202
204
  (v) => {
@@ -209,7 +211,7 @@ var FunctionParams = class _FunctionParams {
209
211
  if (Array.isArray(v)) {
210
212
  return void 0;
211
213
  }
212
- return _nullishCoalesce(v.required, () => ( true));
214
+ return v.required ?? true;
213
215
  }
214
216
  ],
215
217
  ["desc", "desc"]
@@ -224,7 +226,7 @@ var FunctionParams = class _FunctionParams {
224
226
  acc.push(`${type}${rest.default ? ` = ${rest.default}` : ""}`);
225
227
  return acc;
226
228
  }
227
- const parameterName = name.startsWith("{") ? name : _chunkA6PCLWEYcjs.camelCase.call(void 0, name);
229
+ const parameterName = name.startsWith("{") ? name : chunkHMCSWG5L_cjs.camelCase(name);
228
230
  if (type) {
229
231
  if (required) {
230
232
  acc.push(`${parameterName}: ${type}${rest.default ? ` = ${rest.default}` : ""}`);
@@ -239,8 +241,8 @@ var FunctionParams = class _FunctionParams {
239
241
  static toObject(items) {
240
242
  let type = [];
241
243
  let name = [];
242
- const enabled = items.every((item) => item.enabled) ? _optionalChain([items, 'access', _ => _.at, 'call', _2 => _2(0), 'optionalAccess', _3 => _3.enabled]) : true;
243
- const required = _nullishCoalesce(items.every((item) => item.required), () => ( true));
244
+ const enabled = items.every((item) => item.enabled) ? items.at(0)?.enabled : true;
245
+ const required = items.every((item) => item.required) ?? true;
244
246
  items.forEach((item) => {
245
247
  name = _FunctionParams.#addParams(name, { ...item, type: void 0 });
246
248
  if (items.some((item2) => item2.type)) {
@@ -279,9 +281,9 @@ var FunctionParams = class _FunctionParams {
279
281
  };
280
282
 
281
283
  // src/utils/promise.ts
282
- _chunkSEH6NUCXcjs.init_cjs_shims.call(void 0, );
284
+ chunkADFKVVPE_cjs.init_cjs_shims();
283
285
  function isPromise(result) {
284
- return !!result && typeof _optionalChain([result, 'optionalAccess', _4 => _4.then]) === "function";
286
+ return !!result && typeof result?.then === "function";
285
287
  }
286
288
  function isPromiseFulfilledResult(result) {
287
289
  return result.status === "fulfilled";
@@ -291,14 +293,14 @@ function isPromiseRejectedResult(result) {
291
293
  }
292
294
 
293
295
  // src/utils/renderTemplate.ts
294
- _chunkSEH6NUCXcjs.init_cjs_shims.call(void 0, );
296
+ chunkADFKVVPE_cjs.init_cjs_shims();
295
297
  function renderTemplate(template, data = void 0) {
296
298
  if (!data || !Object.keys(data).length) {
297
299
  return template.replace(/{{(.*?)}}/g, "");
298
300
  }
299
301
  const matches = template.match(/{{(.*?)}}/g);
300
- return _optionalChain([matches, 'optionalAccess', _5 => _5.reduce, 'call', _6 => _6((prev, curr) => {
301
- const index = _optionalChain([curr, 'access', _7 => _7.split, 'call', _8 => _8(/{{|}}/), 'access', _9 => _9.filter, 'call', _10 => _10(Boolean), 'access', _11 => _11[0], 'optionalAccess', _12 => _12.trim, 'call', _13 => _13()]);
302
+ return matches?.reduce((prev, curr) => {
303
+ const index = curr.split(/{{|}}/).filter(Boolean)[0]?.trim();
302
304
  if (index === void 0) {
303
305
  return prev;
304
306
  }
@@ -312,11 +314,11 @@ function renderTemplate(template, data = void 0) {
312
314
  }
313
315
  return value || "";
314
316
  }).trim();
315
- }, template)]) || "";
317
+ }, template) || "";
316
318
  }
317
319
 
318
320
  // src/utils/timeout.ts
319
- _chunkSEH6NUCXcjs.init_cjs_shims.call(void 0, );
321
+ chunkADFKVVPE_cjs.init_cjs_shims();
320
322
  async function timeout(ms) {
321
323
  return new Promise((resolve) => {
322
324
  setTimeout(() => {
@@ -326,7 +328,7 @@ async function timeout(ms) {
326
328
  }
327
329
 
328
330
  // src/utils/uniqueName.ts
329
- _chunkSEH6NUCXcjs.init_cjs_shims.call(void 0, );
331
+ chunkADFKVVPE_cjs.init_cjs_shims();
330
332
  function getUniqueName(originalName, data) {
331
333
  let used = data[originalName] || 0;
332
334
  if (used) {
@@ -347,9 +349,9 @@ function setUniqueName(originalName, data) {
347
349
  }
348
350
 
349
351
  // src/utils/URLPath.ts
350
- _chunkSEH6NUCXcjs.init_cjs_shims.call(void 0, );
352
+ chunkADFKVVPE_cjs.init_cjs_shims();
351
353
  var URLPath = class {
352
-
354
+ path;
353
355
  constructor(path) {
354
356
  this.path = path;
355
357
  return this;
@@ -364,7 +366,7 @@ var URLPath = class {
364
366
  get isURL() {
365
367
  try {
366
368
  const url = new URL(this.path);
367
- if (_optionalChain([url, 'optionalAccess', _14 => _14.href])) {
369
+ if (url?.href) {
368
370
  return true;
369
371
  }
370
372
  } catch (error) {
@@ -415,7 +417,7 @@ var URLPath = class {
415
417
  let newPath = this.path.replaceAll("{", "${");
416
418
  if (found) {
417
419
  newPath = found.reduce((prev, curr) => {
418
- const pathParam = replacer ? replacer(_chunkA6PCLWEYcjs.camelCase.call(void 0, curr)) : _chunkA6PCLWEYcjs.camelCase.call(void 0, curr);
420
+ const pathParam = replacer ? replacer(chunkHMCSWG5L_cjs.camelCase(curr)) : chunkHMCSWG5L_cjs.camelCase(curr);
419
421
  const replacement = `\${${pathParam}}`;
420
422
  return prev.replace(curr, replacement);
421
423
  }, this.path);
@@ -431,7 +433,7 @@ var URLPath = class {
431
433
  const params = {};
432
434
  found.forEach((item) => {
433
435
  item = item.replaceAll("{", "").replaceAll("}", "");
434
- const pathParam = replacer ? replacer(_chunkA6PCLWEYcjs.camelCase.call(void 0, item)) : _chunkA6PCLWEYcjs.camelCase.call(void 0, item);
436
+ const pathParam = replacer ? replacer(chunkHMCSWG5L_cjs.camelCase(item)) : chunkHMCSWG5L_cjs.camelCase(item);
435
437
  params[pathParam] = pathParam;
436
438
  }, this.path);
437
439
  return params;
@@ -446,29 +448,22 @@ var URLPath = class {
446
448
  };
447
449
 
448
450
  // src/utils/parser.ts
449
- _chunkSEH6NUCXcjs.init_cjs_shims.call(void 0, );
450
- var _path = require('path');
451
- var _fs = require('@kubb/fs');
452
- var _objecthash = require('object-hash'); var _objecthash2 = _interopRequireDefault(_objecthash);
451
+ chunkADFKVVPE_cjs.init_cjs_shims();
453
452
 
454
453
  // src/FileManager.ts
455
- _chunkSEH6NUCXcjs.init_cjs_shims.call(void 0, );
456
-
457
- var _remeda = require('remeda');
458
-
454
+ chunkADFKVVPE_cjs.init_cjs_shims();
459
455
 
460
456
  // src/BarrelManager.ts
461
- _chunkSEH6NUCXcjs.init_cjs_shims.call(void 0, );
462
-
457
+ chunkADFKVVPE_cjs.init_cjs_shims();
463
458
 
464
459
  // src/utils/TreeNode.ts
465
- _chunkSEH6NUCXcjs.init_cjs_shims.call(void 0, );
466
- var TreeNode = (_class = class _TreeNode {
467
-
468
-
469
- __init() {this.children = []}
460
+ chunkADFKVVPE_cjs.init_cjs_shims();
461
+ var TreeNode = class _TreeNode {
462
+ data;
463
+ parent;
464
+ children = [];
470
465
  #cachedLeaves = void 0;
471
- constructor(data, parent) {;_class.prototype.__init.call(this);
466
+ constructor(data, parent) {
472
467
  this.data = data;
473
468
  this.parent = parent;
474
469
  return this;
@@ -510,7 +505,7 @@ var TreeNode = (_class = class _TreeNode {
510
505
  callback(this);
511
506
  if (this.children) {
512
507
  for (let i = 0, { length } = this.children; i < length; i++) {
513
- _optionalChain([this, 'access', _15 => _15.children, 'access', _16 => _16[i], 'optionalAccess', _17 => _17.forEach, 'call', _18 => _18(callback)]);
508
+ this.children[i]?.forEach(callback);
514
509
  }
515
510
  }
516
511
  return this;
@@ -558,19 +553,19 @@ var TreeNode = (_class = class _TreeNode {
558
553
  file: item.file,
559
554
  type: FileManager.getMode(item.path)
560
555
  });
561
- if (_optionalChain([item, 'access', _19 => _19.children, 'optionalAccess', _20 => _20.length])) {
562
- _optionalChain([item, 'access', _21 => _21.children, 'optionalAccess', _22 => _22.forEach, 'call', _23 => _23((child) => {
556
+ if (item.children?.length) {
557
+ item.children?.forEach((child) => {
563
558
  recurse(subNode, child);
564
- })]);
559
+ });
565
560
  }
566
561
  };
567
- _optionalChain([filteredTree, 'access', _24 => _24.children, 'optionalAccess', _25 => _25.forEach, 'call', _26 => _26((child) => recurse(treeNode, child))]);
562
+ filteredTree.children?.forEach((child) => recurse(treeNode, child));
568
563
  return treeNode;
569
564
  } catch (e) {
570
565
  throw new Error("Something went wrong with creating barrel files with the TreeNode class", { cause: e });
571
566
  }
572
567
  }
573
- }, _class);
568
+ };
574
569
  function buildDirectoryTree(files, rootFolder = "") {
575
570
  const rootPrefix = rootFolder.endsWith("/") ? rootFolder : `${rootFolder}/`;
576
571
  const filteredFiles = files.filter((file) => rootFolder ? file.path.startsWith(rootPrefix) && !file.path.endsWith(".json") : !file.path.endsWith(".json"));
@@ -617,9 +612,6 @@ function buildDirectoryTree(files, rootFolder = "") {
617
612
  });
618
613
  return root;
619
614
  }
620
-
621
- // src/BarrelManager.ts
622
-
623
615
  var BarrelManager = class {
624
616
  #options;
625
617
  constructor(options = {}) {
@@ -629,13 +621,13 @@ var BarrelManager = class {
629
621
  getFiles({ files: generatedFiles, root, meta }) {
630
622
  const { logger } = this.#options;
631
623
  const cachedFiles = /* @__PURE__ */ new Map();
632
- _optionalChain([logger, 'optionalAccess', _27 => _27.emit, 'call', _28 => _28("debug", { date: /* @__PURE__ */ new Date(), logs: [`Start barrel generation for pluginKey ${_optionalChain([meta, 'optionalAccess', _29 => _29.pluginKey, 'optionalAccess', _30 => _30.join, 'call', _31 => _31(".")])} and root '${root}'`] })]);
633
- _optionalChain([TreeNode, 'access', _32 => _32.build, 'call', _33 => _33(generatedFiles, root), 'optionalAccess', _34 => _34.forEach, 'call', _35 => _35((treeNode) => {
634
- if (!treeNode || !treeNode.children || !_optionalChain([treeNode, 'access', _36 => _36.parent, 'optionalAccess', _37 => _37.data, 'access', _38 => _38.path])) {
624
+ logger?.emit("debug", { date: /* @__PURE__ */ new Date(), logs: [`Start barrel generation for pluginKey ${meta?.pluginKey?.join(".")} and root '${root}'`] });
625
+ TreeNode.build(generatedFiles, root)?.forEach((treeNode) => {
626
+ if (!treeNode || !treeNode.children || !treeNode.parent?.data.path) {
635
627
  return void 0;
636
628
  }
637
629
  const barrelFile = {
638
- path: _path.join.call(void 0, _optionalChain([treeNode, 'access', _39 => _39.parent, 'optionalAccess', _40 => _40.data, 'access', _41 => _41.path]), "index.ts"),
630
+ path: path.join(treeNode.parent?.data.path, "index.ts"),
639
631
  baseName: "index.ts",
640
632
  exports: [],
641
633
  sources: []
@@ -646,30 +638,30 @@ var BarrelManager = class {
646
638
  if (!item.data.name) {
647
639
  return void 0;
648
640
  }
649
- const sources = _optionalChain([item, 'access', _42 => _42.data, 'access', _43 => _43.file, 'optionalAccess', _44 => _44.sources]) || [];
641
+ const sources = item.data.file?.sources || [];
650
642
  if (!sources.some((source) => source.isIndexable)) {
651
- _optionalChain([logger, 'optionalAccess', _45 => _45.emit, 'call', _46 => _46(
643
+ logger?.emit(
652
644
  "warning",
653
645
  `No isIndexable source found(source should have a name and isIndexable):
654
646
  File: ${JSON.stringify(item.data.file, void 0, 2)}`
655
- )]);
647
+ );
656
648
  }
657
649
  sources.forEach((source) => {
658
- if (!_optionalChain([item, 'access', _47 => _47.data, 'access', _48 => _48.file, 'optionalAccess', _49 => _49.path]) || !source.isIndexable || !source.name) {
650
+ if (!item.data.file?.path || !source.isIndexable || !source.name) {
659
651
  return void 0;
660
652
  }
661
- const alreadyContainInPreviousBarrelFile = _optionalChain([previousBarrelFile, 'optionalAccess', _50 => _50.sources, 'access', _51 => _51.some, 'call', _52 => _52((item2) => item2.name === source.name)]);
653
+ const alreadyContainInPreviousBarrelFile = previousBarrelFile?.sources.some((item2) => item2.name === source.name);
662
654
  if (alreadyContainInPreviousBarrelFile) {
663
655
  return void 0;
664
656
  }
665
657
  if (!barrelFile.exports) {
666
658
  barrelFile.exports = [];
667
659
  }
668
- const isSubExport = !!_optionalChain([treeNode, 'access', _53 => _53.parent, 'optionalAccess', _54 => _54.data, 'access', _55 => _55.path, 'optionalAccess', _56 => _56.split, 'optionalCall', _57 => _57("/"), 'optionalAccess', _58 => _58.length]);
660
+ const isSubExport = !!treeNode.parent?.data.path?.split?.("/")?.length;
669
661
  if (isSubExport) {
670
662
  barrelFile.exports.push({
671
663
  name: [source.name],
672
- path: _fs.getRelativePath.call(void 0, _optionalChain([treeNode, 'access', _59 => _59.parent, 'optionalAccess', _60 => _60.data, 'access', _61 => _61.path]), item.data.path),
664
+ path: fs.getRelativePath(treeNode.parent?.data.path, item.data.path),
673
665
  isTypeOnly: source.isTypeOnly
674
666
  });
675
667
  } else {
@@ -689,41 +681,38 @@ File: ${JSON.stringify(item.data.file, void 0, 2)}`
689
681
  });
690
682
  });
691
683
  });
692
- _optionalChain([logger, 'optionalAccess', _62 => _62.emit, 'call', _63 => _63("debug", {
684
+ logger?.emit("debug", {
693
685
  date: /* @__PURE__ */ new Date(),
694
686
  logs: [
695
- `Generating barrelFile '${_fs.getRelativePath.call(void 0, root, barrelFile.path)}' for '${_fs.getRelativePath.call(void 0, root, _optionalChain([treeNode, 'access', _64 => _64.data, 'optionalAccess', _65 => _65.path]))}' with ${barrelFile.sources.length} indexable exports: '${_optionalChain([barrelFile, 'access', _66 => _66.sources, 'optionalAccess', _67 => _67.map, 'call', _68 => _68((source) => source.name), 'access', _69 => _69.join, 'call', _70 => _70(", ")])}'`
687
+ `Generating barrelFile '${fs.getRelativePath(root, barrelFile.path)}' for '${fs.getRelativePath(root, treeNode.data?.path)}' with ${barrelFile.sources.length} indexable exports: '${barrelFile.sources?.map((source) => source.name).join(", ")}'`
696
688
  ]
697
- })]);
698
- _optionalChain([logger, 'optionalAccess', _71 => _71.emit, 'call', _72 => _72("debug", {
689
+ });
690
+ logger?.emit("debug", {
699
691
  date: /* @__PURE__ */ new Date(),
700
692
  logs: [
701
- `Generated barrelFile '${_fs.getRelativePath.call(void 0, root, barrelFile.path)}' for '${_fs.getRelativePath.call(void 0, root, _optionalChain([treeNode, 'access', _73 => _73.data, 'optionalAccess', _74 => _74.path]))}' with exports: '${_optionalChain([cachedFiles, 'access', _75 => _75.get, 'call', _76 => _76(barrelFile.path), 'optionalAccess', _77 => _77.sources, 'optionalAccess', _78 => _78.map, 'call', _79 => _79((source) => source.name), 'access', _80 => _80.join, 'call', _81 => _81(", ")])}'`
693
+ `Generated barrelFile '${fs.getRelativePath(root, barrelFile.path)}' for '${fs.getRelativePath(root, treeNode.data?.path)}' with exports: '${cachedFiles.get(barrelFile.path)?.sources?.map((source) => source.name).join(", ")}'`
702
694
  ]
703
- })]);
695
+ });
704
696
  if (previousBarrelFile) {
705
697
  previousBarrelFile.sources.push(...barrelFile.sources);
706
- _optionalChain([previousBarrelFile, 'access', _82 => _82.exports, 'optionalAccess', _83 => _83.push, 'call', _84 => _84(...barrelFile.exports || [])]);
698
+ previousBarrelFile.exports?.push(...barrelFile.exports || []);
707
699
  } else {
708
700
  cachedFiles.set(barrelFile.path, barrelFile);
709
701
  }
710
- })]);
702
+ });
711
703
  return [...cachedFiles.values()];
712
704
  }
713
705
  };
714
706
 
715
- // src/FileManager.ts
716
-
717
-
718
707
  // ../../node_modules/.pnpm/p-queue@8.0.1/node_modules/p-queue/dist/index.js
719
- _chunkSEH6NUCXcjs.init_cjs_shims.call(void 0, );
708
+ chunkADFKVVPE_cjs.init_cjs_shims();
720
709
 
721
710
  // ../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.mjs
722
- _chunkSEH6NUCXcjs.init_cjs_shims.call(void 0, );
723
- var import_index = _chunkSEH6NUCXcjs.__toESM.call(void 0, require_eventemitter3(), 1);
711
+ chunkADFKVVPE_cjs.init_cjs_shims();
712
+ var import_index = chunkADFKVVPE_cjs.__toESM(require_eventemitter3(), 1);
724
713
 
725
714
  // ../../node_modules/.pnpm/p-timeout@6.1.2/node_modules/p-timeout/index.js
726
- _chunkSEH6NUCXcjs.init_cjs_shims.call(void 0, );
715
+ chunkADFKVVPE_cjs.init_cjs_shims();
727
716
  var TimeoutError = class extends Error {
728
717
  constructor(message) {
729
718
  super(message);
@@ -785,7 +774,7 @@ function pTimeout(promise, options) {
785
774
  } else if (message instanceof Error) {
786
775
  reject(message);
787
776
  } else {
788
- timeoutError.message = _nullishCoalesce(message, () => ( `Promise timed out after ${milliseconds} milliseconds`));
777
+ timeoutError.message = message ?? `Promise timed out after ${milliseconds} milliseconds`;
789
778
  reject(timeoutError);
790
779
  }
791
780
  }, milliseconds);
@@ -808,10 +797,10 @@ function pTimeout(promise, options) {
808
797
  }
809
798
 
810
799
  // ../../node_modules/.pnpm/p-queue@8.0.1/node_modules/p-queue/dist/priority-queue.js
811
- _chunkSEH6NUCXcjs.init_cjs_shims.call(void 0, );
800
+ chunkADFKVVPE_cjs.init_cjs_shims();
812
801
 
813
802
  // ../../node_modules/.pnpm/p-queue@8.0.1/node_modules/p-queue/dist/lower-bound.js
814
- _chunkSEH6NUCXcjs.init_cjs_shims.call(void 0, );
803
+ chunkADFKVVPE_cjs.init_cjs_shims();
815
804
  function lowerBound(array, value, comparator) {
816
805
  let first = 0;
817
806
  let count = array.length;
@@ -849,7 +838,7 @@ var PriorityQueue = class {
849
838
  }
850
839
  dequeue() {
851
840
  const item = this.#queue.shift();
852
- return _optionalChain([item, 'optionalAccess', _85 => _85.run]);
841
+ return item?.run;
853
842
  }
854
843
  filter(options) {
855
844
  return this.#queue.filter((element) => element.priority === options.priority).map((element) => element.run);
@@ -881,7 +870,7 @@ var PQueue = class extends import_index.default {
881
870
 
882
871
  Applies to each future operation.
883
872
  */
884
-
873
+ timeout;
885
874
  // TODO: The `throwOnTimeout` option should affect the return types of `add()` and `addAll()`
886
875
  constructor(options) {
887
876
  super();
@@ -895,10 +884,10 @@ var PQueue = class extends import_index.default {
895
884
  ...options
896
885
  };
897
886
  if (!(typeof options.intervalCap === "number" && options.intervalCap >= 1)) {
898
- throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${_nullishCoalesce(_optionalChain([options, 'access', _86 => _86.intervalCap, 'optionalAccess', _87 => _87.toString, 'call', _88 => _88()]), () => ( ""))}\` (${typeof options.intervalCap})`);
887
+ throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${options.intervalCap?.toString() ?? ""}\` (${typeof options.intervalCap})`);
899
888
  }
900
889
  if (options.interval === void 0 || !(Number.isFinite(options.interval) && options.interval >= 0)) {
901
- throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${_nullishCoalesce(_optionalChain([options, 'access', _89 => _89.interval, 'optionalAccess', _90 => _90.toString, 'call', _91 => _91()]), () => ( ""))}\` (${typeof options.interval})`);
890
+ throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${options.interval?.toString() ?? ""}\` (${typeof options.interval})`);
902
891
  }
903
892
  this.#carryoverConcurrencyCount = options.carryoverConcurrencyCount;
904
893
  this.#isIntervalIgnored = options.intervalCap === Number.POSITIVE_INFINITY || options.interval === 0;
@@ -1025,7 +1014,7 @@ var PQueue = class extends import_index.default {
1025
1014
  this.#pending++;
1026
1015
  this.#intervalCount++;
1027
1016
  try {
1028
- _optionalChain([options, 'access', _92 => _92.signal, 'optionalAccess', _93 => _93.throwIfAborted, 'call', _94 => _94()]);
1017
+ options.signal?.throwIfAborted();
1029
1018
  let operation = function_({ signal: options.signal });
1030
1019
  if (options.timeout) {
1031
1020
  operation = pTimeout(Promise.resolve(operation), { milliseconds: options.timeout });
@@ -1163,11 +1152,11 @@ var FileManager = class {
1163
1152
  return Array.from(this.#files);
1164
1153
  }
1165
1154
  get orderedFiles() {
1166
- return _chunkA6PCLWEYcjs.orderBy.call(void 0, Array.from(this.#files), [
1167
- (v) => _optionalChain([v, 'optionalAccess', _95 => _95.meta]) && "pluginKey" in v.meta && !v.meta.pluginKey,
1155
+ return chunkHMCSWG5L_cjs.orderBy(Array.from(this.#files), [
1156
+ (v) => v?.meta && "pluginKey" in v.meta && !v.meta.pluginKey,
1168
1157
  (v) => v.path.length,
1169
- (v) => _fs.trimExtName.call(void 0, v.path).endsWith("index"),
1170
- (v) => _fs.trimExtName.call(void 0, v.baseName),
1158
+ (v) => fs.trimExtName(v.path).endsWith("index"),
1159
+ (v) => fs.trimExtName(v.baseName),
1171
1160
  (v) => v.path.split(".").pop()
1172
1161
  ]);
1173
1162
  }
@@ -1235,9 +1224,9 @@ var FileManager = class {
1235
1224
  if (exportType === false) {
1236
1225
  return [];
1237
1226
  }
1238
- const pathToBuildFrom = _path.join.call(void 0, root, output.path);
1239
- if (_fs.trimExtName.call(void 0, pathToBuildFrom).endsWith("index")) {
1240
- _optionalChain([logger, 'optionalAccess', _96 => _96.emit, 'call', _97 => _97("warning", "Output has the same fileName as the barrelFiles, please disable barrel generation")]);
1227
+ const pathToBuildFrom = path.join(root, output.path);
1228
+ if (fs.trimExtName(pathToBuildFrom).endsWith("index")) {
1229
+ logger?.emit("warning", "Output has the same fileName as the barrelFiles, please disable barrel generation");
1241
1230
  return [];
1242
1231
  }
1243
1232
  const barrelFiles = barrelManager.getFiles({ files, root: pathToBuildFrom, meta });
@@ -1245,12 +1234,12 @@ var FileManager = class {
1245
1234
  return barrelFiles.map((file) => {
1246
1235
  return {
1247
1236
  ...file,
1248
- exports: _optionalChain([file, 'access', _98 => _98.exports, 'optionalAccess', _99 => _99.map, 'call', _100 => _100((exportItem) => {
1237
+ exports: file.exports?.map((exportItem) => {
1249
1238
  return {
1250
1239
  ...exportItem,
1251
1240
  name: void 0
1252
1241
  };
1253
- })])
1242
+ })
1254
1243
  };
1255
1244
  });
1256
1245
  }
@@ -1262,17 +1251,17 @@ var FileManager = class {
1262
1251
  });
1263
1252
  }
1264
1253
  async write(...params) {
1265
- return _fs.write.call(void 0, ...params);
1254
+ return fs.write(...params);
1266
1255
  }
1267
1256
  async read(...params) {
1268
- return _fs.read.call(void 0, ...params);
1257
+ return fs.read(...params);
1269
1258
  }
1270
1259
  // statics
1271
- static getMode(path) {
1272
- if (!path) {
1260
+ static getMode(path$1) {
1261
+ if (!path$1) {
1273
1262
  return "split";
1274
1263
  }
1275
- return _path.extname.call(void 0, path) ? "single" : "split";
1264
+ return path.extname(path$1) ? "single" : "split";
1276
1265
  }
1277
1266
  };
1278
1267
  async function getSource(file, { logger } = {}) {
@@ -1312,14 +1301,14 @@ function combineExports(exports) {
1312
1301
  (prev, curr) => {
1313
1302
  const name = curr.name;
1314
1303
  const prevByPath = prev.findLast((imp) => imp.path === curr.path);
1315
- const prevByPathAndIsTypeOnly = prev.findLast((imp) => imp.path === curr.path && _remeda.isDeepEqual.call(void 0, imp.name, name) && imp.isTypeOnly);
1304
+ const prevByPathAndIsTypeOnly = prev.findLast((imp) => imp.path === curr.path && remeda.isDeepEqual(imp.name, name) && imp.isTypeOnly);
1316
1305
  if (prevByPathAndIsTypeOnly) {
1317
1306
  return prev;
1318
1307
  }
1319
1308
  const uniquePrev = prev.findLast(
1320
- (imp) => imp.path === curr.path && _remeda.isDeepEqual.call(void 0, imp.name, name) && imp.isTypeOnly === curr.isTypeOnly && imp.asAlias === curr.asAlias
1309
+ (imp) => imp.path === curr.path && remeda.isDeepEqual(imp.name, name) && imp.isTypeOnly === curr.isTypeOnly && imp.asAlias === curr.asAlias
1321
1310
  );
1322
- if (uniquePrev || Array.isArray(name) && !name.length || _optionalChain([prevByPath, 'optionalAccess', _101 => _101.asAlias]) && !curr.asAlias) {
1311
+ if (uniquePrev || Array.isArray(name) && !name.length || prevByPath?.asAlias && !curr.asAlias) {
1323
1312
  return prev;
1324
1313
  }
1325
1314
  if (!prevByPath) {
@@ -1339,12 +1328,12 @@ function combineExports(exports) {
1339
1328
  },
1340
1329
  []
1341
1330
  );
1342
- return _chunkA6PCLWEYcjs.orderBy.call(void 0, combinedExports, [
1331
+ return chunkHMCSWG5L_cjs.orderBy(combinedExports, [
1343
1332
  (v) => !!Array.isArray(v.name),
1344
1333
  (v) => !v.isTypeOnly,
1345
1334
  (v) => v.path,
1346
1335
  (v) => !!v.name,
1347
- (v) => Array.isArray(v.name) ? _chunkA6PCLWEYcjs.orderBy.call(void 0, v.name) : v.name
1336
+ (v) => Array.isArray(v.name) ? chunkHMCSWG5L_cjs.orderBy(v.name) : v.name
1348
1337
  ]);
1349
1338
  }
1350
1339
  function combineImports(imports, exports, source) {
@@ -1365,8 +1354,8 @@ function combineImports(imports, exports, source) {
1365
1354
  name = name.filter((item) => typeof item === "string" ? hasImportInSource(item) : hasImportInSource(item.propertyName));
1366
1355
  }
1367
1356
  const prevByPath = prev.findLast((imp) => imp.path === curr.path && imp.isTypeOnly === curr.isTypeOnly);
1368
- const uniquePrev = prev.findLast((imp) => imp.path === curr.path && _remeda.isDeepEqual.call(void 0, imp.name, name) && imp.isTypeOnly === curr.isTypeOnly);
1369
- const prevByPathNameAndIsTypeOnly = prev.findLast((imp) => imp.path === curr.path && _remeda.isDeepEqual.call(void 0, imp.name, name) && imp.isTypeOnly);
1357
+ const uniquePrev = prev.findLast((imp) => imp.path === curr.path && remeda.isDeepEqual(imp.name, name) && imp.isTypeOnly === curr.isTypeOnly);
1358
+ const prevByPathNameAndIsTypeOnly = prev.findLast((imp) => imp.path === curr.path && remeda.isDeepEqual(imp.name, name) && imp.isTypeOnly);
1370
1359
  if (prevByPathNameAndIsTypeOnly) {
1371
1360
  return prev;
1372
1361
  }
@@ -1393,20 +1382,20 @@ function combineImports(imports, exports, source) {
1393
1382
  },
1394
1383
  []
1395
1384
  );
1396
- return _chunkA6PCLWEYcjs.orderBy.call(void 0, combinedImports, [
1385
+ return chunkHMCSWG5L_cjs.orderBy(combinedImports, [
1397
1386
  (v) => !!Array.isArray(v.name),
1398
1387
  (v) => !v.isTypeOnly,
1399
1388
  (v) => v.path,
1400
1389
  (v) => !!v.name,
1401
- (v) => Array.isArray(v.name) ? _chunkA6PCLWEYcjs.orderBy.call(void 0, v.name) : v.name
1390
+ (v) => Array.isArray(v.name) ? chunkHMCSWG5L_cjs.orderBy(v.name) : v.name
1402
1391
  ]);
1403
1392
  }
1404
1393
  var queue = new PQueue({ concurrency: 100 });
1405
1394
  async function processFiles({ dryRun, config, logger, files }) {
1406
- const orderedFiles = _chunkA6PCLWEYcjs.orderBy.call(void 0, files, [
1407
- (v) => _optionalChain([v, 'optionalAccess', _102 => _102.meta]) && "pluginKey" in v.meta && !v.meta.pluginKey,
1395
+ const orderedFiles = chunkHMCSWG5L_cjs.orderBy(files, [
1396
+ (v) => v?.meta && "pluginKey" in v.meta && !v.meta.pluginKey,
1408
1397
  (v) => v.path.length,
1409
- (v) => _fs.trimExtName.call(void 0, v.path).endsWith("index")
1398
+ (v) => fs.trimExtName(v.path).endsWith("index")
1410
1399
  ]);
1411
1400
  logger.emit("debug", {
1412
1401
  date: /* @__PURE__ */ new Date(),
@@ -1418,9 +1407,9 @@ async function processFiles({ dryRun, config, logger, files }) {
1418
1407
  logger.emit("progress_start", { id: "files", size, message: "Writing files ..." });
1419
1408
  const promises = orderedFiles.map(async (file) => {
1420
1409
  await queue.add(async () => {
1421
- const message = file ? `Writing ${_path.relative.call(void 0, config.root, file.path)}` : "";
1410
+ const message = file ? `Writing ${path.relative(config.root, file.path)}` : "";
1422
1411
  const source = await getSource(file, { logger });
1423
- await _fs.write.call(void 0, file.path, source, { sanity: false });
1412
+ await fs.write(file.path, source, { sanity: false });
1424
1413
  logger.emit("progressed", { id: "files", message });
1425
1414
  });
1426
1415
  });
@@ -1432,7 +1421,7 @@ async function processFiles({ dryRun, config, logger, files }) {
1432
1421
 
1433
1422
  // src/utils/parser.ts
1434
1423
  function createFile(file) {
1435
- const extName = _path.extname.call(void 0, file.baseName);
1424
+ const extName = path.extname(file.baseName);
1436
1425
  if (!extName) {
1437
1426
  throw new Error(`No extName found for ${file.baseName}`);
1438
1427
  }
@@ -1442,7 +1431,7 @@ function createFile(file) {
1442
1431
  const sources = file.sources ? combineSources(file.sources) : [];
1443
1432
  return {
1444
1433
  ...file,
1445
- id: _objecthash2.default.call(void 0, { path: file.path }),
1434
+ id: hash__default.default({ path: file.path }),
1446
1435
  name: trimExtName2(file.baseName),
1447
1436
  extName,
1448
1437
  imports: imports.map((item) => createFileImport(item)),
@@ -1454,14 +1443,14 @@ function createFileSource(source) {
1454
1443
  return source;
1455
1444
  }
1456
1445
  function createFileImport(imp) {
1457
- const extName = _path.extname.call(void 0, imp.path);
1446
+ const extName = path.extname(imp.path);
1458
1447
  return {
1459
1448
  ...imp,
1460
1449
  extName: imp.extName ? imp.extName : extName
1461
1450
  };
1462
1451
  }
1463
1452
  function createFileExport(exp) {
1464
- const extName = _path.extname.call(void 0, exp.path);
1453
+ const extName = path.extname(exp.path);
1465
1454
  return {
1466
1455
  ...exp,
1467
1456
  extName: exp.extName ? exp.extName : extName
@@ -1475,9 +1464,9 @@ var typeScriptParser = createFileParser({
1475
1464
  return void 0;
1476
1465
  },
1477
1466
  async print(file) {
1478
- const module = await Promise.resolve().then(() => _interopRequireWildcard(require("@kubb/parser-ts")));
1467
+ const module = await import('@kubb/parser-ts');
1479
1468
  const importNodes = file.imports.map((item) => {
1480
- const path = item.root ? _fs.getRelativePath.call(void 0, item.root, item.path) : item.path;
1469
+ const path = item.root ? fs.getRelativePath(item.root, item.path) : item.path;
1481
1470
  return module.factory.createImportDeclaration({
1482
1471
  name: item.name,
1483
1472
  path,
@@ -1526,23 +1515,22 @@ function trimExtName2(text) {
1526
1515
  return text.replace(`.${extName}`, "");
1527
1516
  }
1528
1517
 
1529
-
1530
-
1531
-
1532
-
1533
-
1534
-
1535
-
1536
-
1537
-
1538
-
1539
-
1540
-
1541
-
1542
-
1543
-
1544
-
1545
-
1546
-
1547
- exports.FunctionParams = FunctionParams; exports.isPromise = isPromise; exports.isPromiseFulfilledResult = isPromiseFulfilledResult; exports.isPromiseRejectedResult = isPromiseRejectedResult; exports.renderTemplate = renderTemplate; exports.timeout = timeout; exports.getUniqueName = getUniqueName; exports.setUniqueName = setUniqueName; exports.URLPath = URLPath; exports.createFile = createFile; exports.createFileImport = createFileImport; exports.createFileExport = createFileExport; exports.createFileParser = createFileParser; exports.getFileParser = getFileParser; exports.FileManager = FileManager; exports.getSource = getSource; exports.processFiles = processFiles;
1548
- //# sourceMappingURL=chunk-NB4JMN75.cjs.map
1518
+ exports.FileManager = FileManager;
1519
+ exports.FunctionParams = FunctionParams;
1520
+ exports.URLPath = URLPath;
1521
+ exports.createFile = createFile;
1522
+ exports.createFileExport = createFileExport;
1523
+ exports.createFileImport = createFileImport;
1524
+ exports.createFileParser = createFileParser;
1525
+ exports.getFileParser = getFileParser;
1526
+ exports.getSource = getSource;
1527
+ exports.getUniqueName = getUniqueName;
1528
+ exports.isPromise = isPromise;
1529
+ exports.isPromiseFulfilledResult = isPromiseFulfilledResult;
1530
+ exports.isPromiseRejectedResult = isPromiseRejectedResult;
1531
+ exports.processFiles = processFiles;
1532
+ exports.renderTemplate = renderTemplate;
1533
+ exports.setUniqueName = setUniqueName;
1534
+ exports.timeout = timeout;
1535
+ //# sourceMappingURL=chunk-52WA2JF5.cjs.map
1536
+ //# sourceMappingURL=chunk-52WA2JF5.cjs.map