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

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 (72) hide show
  1. package/dist/{FileManager-CpuFz6eH.d.ts → FileManager-B-fP5y5O.d.ts} +5 -10
  2. package/dist/{FileManager-BbUCeEyv.d.cts → FileManager-CL52wQgR.d.cts} +5 -10
  3. package/dist/chunk-2EU7DMPM.js +2 -3
  4. package/dist/chunk-2EU7DMPM.js.map +1 -1
  5. package/dist/chunk-4X5FFJPJ.js +8 -13
  6. package/dist/chunk-4X5FFJPJ.js.map +1 -1
  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-JRU2D5E6.cjs} +28 -29
  14. package/dist/chunk-JRU2D5E6.cjs.map +1 -0
  15. package/dist/{chunk-NB4JMN75.cjs → chunk-OJRKV365.cjs} +156 -173
  16. package/dist/chunk-OJRKV365.cjs.map +1 -0
  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-L6YLVCKM.js → chunk-WDYNXEYV.js} +45 -88
  22. package/dist/chunk-WDYNXEYV.js.map +1 -0
  23. package/dist/{chunk-M7NLNCSM.cjs → chunk-YEVCYV36.cjs} +33 -36
  24. package/dist/chunk-YEVCYV36.cjs.map +1 -0
  25. package/dist/index.cjs +157 -186
  26. package/dist/index.cjs.map +1 -1
  27. package/dist/index.d.cts +2 -2
  28. package/dist/index.d.ts +2 -2
  29. package/dist/index.js +26 -87
  30. package/dist/index.js.map +1 -1
  31. package/dist/logger.cjs +25 -14
  32. package/dist/logger.cjs.map +1 -1
  33. package/dist/logger.js +3 -13
  34. package/dist/logger.js.map +1 -1
  35. package/dist/mocks.cjs +13 -18
  36. package/dist/mocks.cjs.map +1 -1
  37. package/dist/mocks.d.cts +1 -1
  38. package/dist/mocks.d.ts +1 -1
  39. package/dist/mocks.js +5 -12
  40. package/dist/mocks.js.map +1 -1
  41. package/dist/{prompt-DVQN7JTN.cjs → prompt-L5KFKY73.cjs} +89 -89
  42. package/dist/prompt-L5KFKY73.cjs.map +1 -0
  43. package/dist/prompt-WQQUN22Z.js +8 -13
  44. package/dist/prompt-WQQUN22Z.js.map +1 -1
  45. package/dist/transformers.cjs +62 -52
  46. package/dist/transformers.cjs.map +1 -1
  47. package/dist/transformers.js +9 -37
  48. package/dist/transformers.js.map +1 -1
  49. package/dist/utils.cjs +65 -34
  50. package/dist/utils.cjs.map +1 -1
  51. package/dist/utils.js +3 -33
  52. package/dist/utils.js.map +1 -1
  53. package/package.json +7 -7
  54. package/src/BarrelManager.ts +1 -1
  55. package/src/FileManager.ts +29 -39
  56. package/src/PluginManager.ts +7 -8
  57. package/src/build.ts +1 -1
  58. package/src/index.ts +1 -1
  59. package/src/logger.ts +3 -3
  60. package/src/plugin.ts +0 -3
  61. package/src/types.ts +0 -2
  62. package/src/utils/parser.ts +3 -3
  63. package/dist/chunk-5E2I6KH4.cjs.map +0 -1
  64. package/dist/chunk-A6PCLWEY.cjs.map +0 -1
  65. package/dist/chunk-DID47EQD.cjs.map +0 -1
  66. package/dist/chunk-L6YLVCKM.js.map +0 -1
  67. package/dist/chunk-M7NLNCSM.cjs.map +0 -1
  68. package/dist/chunk-MU3CBCQT.js.map +0 -1
  69. package/dist/chunk-NB4JMN75.cjs.map +0 -1
  70. package/dist/chunk-SEH6NUCX.cjs.map +0 -1
  71. package/dist/prompt-DVQN7JTN.cjs.map +0 -1
  72. package/src/utils/cache.ts +0 -35
package/dist/index.cjs CHANGED
@@ -1,37 +1,44 @@
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 _chunkDID47EQDcjs = require('./chunk-DID47EQD.cjs');
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var chunkTTDCUWK7_cjs = require('./chunk-TTDCUWK7.cjs');
6
+ var chunkYEVCYV36_cjs = require('./chunk-YEVCYV36.cjs');
7
+ var chunkOJRKV365_cjs = require('./chunk-OJRKV365.cjs');
8
+ require('./chunk-JRU2D5E6.cjs');
9
+ require('./chunk-PJLUPV3P.cjs');
10
+ var chunkADFKVVPE_cjs = require('./chunk-ADFKVVPE.cjs');
11
+ var fs = require('@kubb/fs');
12
+ var path3 = require('path');
13
+ var mod = require('module');
14
+ var os = require('os');
15
+ var url = require('url');
16
+ var process = require('process');
17
+ var fs$1 = require('fs');
18
+ var semver = require('semver');
5
19
 
20
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
6
21
 
7
- var _chunkM7NLNCSMcjs = require('./chunk-M7NLNCSM.cjs');
8
-
9
-
10
-
11
-
12
-
13
- var _chunkNB4JMN75cjs = require('./chunk-NB4JMN75.cjs');
14
- require('./chunk-A6PCLWEY.cjs');
15
- require('./chunk-5E2I6KH4.cjs');
16
-
17
-
18
- var _chunkSEH6NUCXcjs = require('./chunk-SEH6NUCX.cjs');
22
+ var path3__default = /*#__PURE__*/_interopDefault(path3);
23
+ var mod__default = /*#__PURE__*/_interopDefault(mod);
24
+ var os__default = /*#__PURE__*/_interopDefault(os);
25
+ var process__default = /*#__PURE__*/_interopDefault(process);
26
+ var fs__default = /*#__PURE__*/_interopDefault(fs$1);
19
27
 
20
28
  // src/index.ts
21
- _chunkSEH6NUCXcjs.init_cjs_shims.call(void 0, );
29
+ chunkADFKVVPE_cjs.init_cjs_shims();
22
30
 
23
31
  // src/build.ts
24
- _chunkSEH6NUCXcjs.init_cjs_shims.call(void 0, );
25
- var _fs = require('@kubb/fs');
32
+ chunkADFKVVPE_cjs.init_cjs_shims();
26
33
 
27
34
  // src/PluginManager.ts
28
- _chunkSEH6NUCXcjs.init_cjs_shims.call(void 0, );
35
+ chunkADFKVVPE_cjs.init_cjs_shims();
29
36
 
30
37
  // src/PromiseManager.ts
31
- _chunkSEH6NUCXcjs.init_cjs_shims.call(void 0, );
38
+ chunkADFKVVPE_cjs.init_cjs_shims();
32
39
 
33
40
  // src/utils/executeStrategies.ts
34
- _chunkSEH6NUCXcjs.init_cjs_shims.call(void 0, );
41
+ chunkADFKVVPE_cjs.init_cjs_shims();
35
42
  function hookSeq(promises) {
36
43
  return promises.filter(Boolean).reduce(
37
44
  (promise, func) => {
@@ -86,51 +93,19 @@ var PromiseManager = class {
86
93
  }
87
94
  };
88
95
  function isPromise(result) {
89
- return !!result && typeof _optionalChain([result, 'optionalAccess', _ => _.then]) === "function";
96
+ return !!result && typeof result?.then === "function";
90
97
  }
91
98
  function isPromiseRejectedResult(result) {
92
99
  return result.status === "rejected";
93
100
  }
94
101
 
95
102
  // src/errors.ts
96
- _chunkSEH6NUCXcjs.init_cjs_shims.call(void 0, );
103
+ chunkADFKVVPE_cjs.init_cjs_shims();
97
104
  var ValidationPluginError = class extends Error {
98
105
  };
99
106
 
100
107
  // src/plugin.ts
101
- _chunkSEH6NUCXcjs.init_cjs_shims.call(void 0, );
102
- var _path = require('path'); var _path2 = _interopRequireDefault(_path);
103
-
104
- // src/utils/cache.ts
105
- _chunkSEH6NUCXcjs.init_cjs_shims.call(void 0, );
106
- function createPluginCache(Store = /* @__PURE__ */ Object.create(null)) {
107
- return {
108
- set(id, value) {
109
- Store[id] = [0, value];
110
- },
111
- get(id) {
112
- const item = Store[id];
113
- if (!item) {
114
- return null;
115
- }
116
- item[0] = 0;
117
- return item[1];
118
- },
119
- has(id) {
120
- const item = Store[id];
121
- if (!item) {
122
- return false;
123
- }
124
- item[0] = 0;
125
- return true;
126
- },
127
- delete(id) {
128
- return delete Store[id];
129
- }
130
- };
131
- }
132
-
133
- // src/plugin.ts
108
+ chunkADFKVVPE_cjs.init_cjs_shims();
134
109
  function createPlugin(factory) {
135
110
  return (options = {}) => {
136
111
  return factory(options);
@@ -164,13 +139,12 @@ var pluginCore = createPlugin((options) => {
164
139
  return resolvedFiles;
165
140
  },
166
141
  resolvePath,
167
- resolveName,
168
- cache: createPluginCache()
142
+ resolveName
169
143
  };
170
144
  },
171
145
  resolvePath(baseName) {
172
- const root = _path2.default.resolve(options.config.root, options.config.output.path);
173
- return _path2.default.resolve(root, baseName);
146
+ const root = path3__default.default.resolve(options.config.root, options.config.output.path);
147
+ return path3__default.default.resolve(root, baseName);
174
148
  },
175
149
  resolveName(name) {
176
150
  return name;
@@ -179,26 +153,25 @@ var pluginCore = createPlugin((options) => {
179
153
  });
180
154
 
181
155
  // src/PluginManager.ts
182
- var PluginManager = (_class = class {
183
-
184
-
185
- __init() {this.events = new (0, _chunkM7NLNCSMcjs.EventEmitter)()}
186
-
187
- __init2() {this.executed = []}
188
-
189
-
156
+ var PluginManager = class {
157
+ plugins = /* @__PURE__ */ new Set();
158
+ fileManager;
159
+ events = new chunkYEVCYV36_cjs.EventEmitter();
160
+ config;
161
+ executed = [];
162
+ logger;
163
+ options;
190
164
  #core;
191
165
  #usedPluginNames = {};
192
166
  #promiseManager;
193
- constructor(config, options) {;_class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);_class.prototype.__init4.call(this);
167
+ constructor(config, options) {
194
168
  this.config = config;
195
169
  this.options = options;
196
170
  this.logger = options.logger;
197
- this.fileManager = new (0, _chunkNB4JMN75cjs.FileManager)();
171
+ this.fileManager = new chunkOJRKV365_cjs.FileManager();
198
172
  this.#promiseManager = new PromiseManager({
199
- nullCheck: (state) => !!_optionalChain([state, 'optionalAccess', _8 => _8.result])
173
+ nullCheck: (state) => !!state?.result
200
174
  });
201
- const plugins = config.plugins || [];
202
175
  const core = pluginCore({
203
176
  config,
204
177
  logger: this.logger,
@@ -209,8 +182,9 @@ var PluginManager = (_class = class {
209
182
  getPlugins: this.#getSortedPlugins.bind(this)
210
183
  });
211
184
  this.#core = this.#parse(core, this, core.context.call(null));
212
- this.plugins = [this.#core, ...plugins].map((plugin) => {
213
- return this.#parse(plugin, this, this.#core.context);
185
+ [this.#core, ...config.plugins || []].forEach((plugin) => {
186
+ const parsedPlugin = this.#parse(plugin, this, this.#core.context);
187
+ this.plugins.add(parsedPlugin);
214
188
  });
215
189
  return this;
216
190
  }
@@ -229,7 +203,7 @@ var PluginManager = (_class = class {
229
203
  sources: []
230
204
  };
231
205
  }
232
- __init3() {this.resolvePath = (params) => {
206
+ resolvePath = (params) => {
233
207
  if (params.pluginKey) {
234
208
  const paths = this.hookForPluginSync({
235
209
  pluginKey: params.pluginKey,
@@ -237,7 +211,7 @@ var PluginManager = (_class = class {
237
211
  parameters: [params.baseName, params.mode, params.options],
238
212
  message: `Resolving path '${params.baseName}'`
239
213
  });
240
- if (paths && _optionalChain([paths, 'optionalAccess', _9 => _9.length]) > 1) {
214
+ if (paths && paths?.length > 1) {
241
215
  this.logger.emit("debug", {
242
216
  date: /* @__PURE__ */ new Date(),
243
217
  logs: [
@@ -250,16 +224,16 @@ Falling back on the first item.
250
224
  ]
251
225
  });
252
226
  }
253
- return _optionalChain([paths, 'optionalAccess', _10 => _10.at, 'call', _11 => _11(0)]);
227
+ return paths?.at(0);
254
228
  }
255
229
  return this.hookFirstSync({
256
230
  hookName: "resolvePath",
257
231
  parameters: [params.baseName, params.mode, params.options],
258
232
  message: `Resolving path '${params.baseName}'`
259
233
  }).result;
260
- }}
234
+ };
261
235
  //TODO refactor by using the order of plugins and the cache of the fileManager instead of guessing and recreating the name/path
262
- __init4() {this.resolveName = (params) => {
236
+ resolveName = (params) => {
263
237
  if (params.pluginKey) {
264
238
  const names = this.hookForPluginSync({
265
239
  pluginKey: params.pluginKey,
@@ -267,7 +241,7 @@ Falling back on the first item.
267
241
  parameters: [params.name, params.type],
268
242
  message: `Resolving name '${params.name}' and type '${params.type}'`
269
243
  });
270
- if (names && _optionalChain([names, 'optionalAccess', _12 => _12.length]) > 1) {
244
+ if (names && names?.length > 1) {
271
245
  this.logger.emit("debug", {
272
246
  date: /* @__PURE__ */ new Date(),
273
247
  logs: [
@@ -280,15 +254,15 @@ Falling back on the first item.
280
254
  ]
281
255
  });
282
256
  }
283
- return _chunkDID47EQDcjs.transformReservedWord.call(void 0, _optionalChain([names, 'optionalAccess', _13 => _13.at, 'call', _14 => _14(0)]) || params.name);
257
+ return chunkTTDCUWK7_cjs.transformReservedWord(names?.at(0) || params.name);
284
258
  }
285
259
  const name = this.hookFirstSync({
286
260
  hookName: "resolveName",
287
261
  parameters: [params.name, params.type],
288
262
  message: `Resolving name '${params.name}' and type '${params.type}'`
289
263
  }).result;
290
- return _chunkDID47EQDcjs.transformReservedWord.call(void 0, name);
291
- }}
264
+ return chunkTTDCUWK7_cjs.transformReservedWord(name);
265
+ };
292
266
  /**
293
267
  * Instead of calling `pluginManager.events.on` you can use `pluginManager.on`. This one also has better types.
294
268
  */
@@ -396,7 +370,7 @@ Falling back on the first item.
396
370
  }),
397
371
  plugin
398
372
  };
399
- if (_optionalChain([parseResult, 'optionalAccess', _15 => _15.result]) != null) {
373
+ if (parseResult?.result != null) {
400
374
  break;
401
375
  }
402
376
  }
@@ -482,7 +456,7 @@ Falling back on the first item.
482
456
  #getSortedPlugins(hookName) {
483
457
  const plugins = [...this.plugins].filter((plugin) => plugin.name !== "core");
484
458
  if (hookName) {
485
- return plugins.filter((item) => item[hookName]);
459
+ return plugins.filter((plugin) => hookName in plugin);
486
460
  }
487
461
  return plugins.map((plugin) => {
488
462
  if (plugin.pre) {
@@ -493,10 +467,10 @@ Falling back on the first item.
493
467
  }
494
468
  return plugin;
495
469
  }).sort((a, b) => {
496
- if (_optionalChain([b, 'access', _16 => _16.pre, 'optionalAccess', _17 => _17.includes, 'call', _18 => _18(a.name)])) {
470
+ if (b.pre?.includes(a.name)) {
497
471
  return 1;
498
472
  }
499
- if (_optionalChain([b, 'access', _19 => _19.post, 'optionalAccess', _20 => _20.includes, 'call', _21 => _21(a.name)])) {
473
+ if (b.post?.includes(a.name)) {
500
474
  return -1;
501
475
  }
502
476
  return 0;
@@ -505,17 +479,17 @@ Falling back on the first item.
505
479
  getPluginsByKey(hookName, pluginKey) {
506
480
  const plugins = [...this.plugins];
507
481
  const [searchPluginName, searchIdentifier] = pluginKey;
508
- const pluginByPluginName = plugins.filter((plugin) => plugin[hookName]).filter((item) => {
482
+ const pluginByPluginName = plugins.filter((plugin) => hookName in plugin).filter((item) => {
509
483
  const [name, identifier] = item.key;
510
- const identifierCheck = _optionalChain([identifier, 'optionalAccess', _22 => _22.toString, 'call', _23 => _23()]) === _optionalChain([searchIdentifier, 'optionalAccess', _24 => _24.toString, 'call', _25 => _25()]);
484
+ const identifierCheck = identifier?.toString() === searchIdentifier?.toString();
511
485
  const nameCheck = name === searchPluginName;
512
486
  if (searchIdentifier) {
513
487
  return identifierCheck && nameCheck;
514
488
  }
515
489
  return nameCheck;
516
490
  });
517
- if (!_optionalChain([pluginByPluginName, 'optionalAccess', _26 => _26.length])) {
518
- const corePlugin = plugins.find((plugin) => plugin.name === "core" && plugin[hookName]);
491
+ if (!pluginByPluginName?.length) {
492
+ const corePlugin = plugins.find((plugin) => plugin.name === "core" && hookName in plugin);
519
493
  if (corePlugin) {
520
494
  this.logger.emit("debug", {
521
495
  date: /* @__PURE__ */ new Date(),
@@ -637,13 +611,13 @@ Falling back on the first item.
637
611
  }
638
612
  }
639
613
  #catcher(cause, plugin, hookName) {
640
- const text = `${cause.message} (plugin: ${_optionalChain([plugin, 'optionalAccess', _27 => _27.name]) || "unknown"}, hook: ${hookName || "unknown"})`;
614
+ const text = `${cause.message} (plugin: ${plugin?.name || "unknown"}, hook: ${hookName || "unknown"})`;
641
615
  this.logger.emit("error", text, cause);
642
616
  this.events.emit("error", cause);
643
617
  }
644
618
  #parse(plugin, pluginManager, context) {
645
619
  const usedPluginNames = pluginManager.#usedPluginNames;
646
- _chunkNB4JMN75cjs.setUniqueName.call(void 0, plugin.name, usedPluginNames);
620
+ chunkOJRKV365_cjs.setUniqueName(plugin.name, usedPluginNames);
647
621
  const key = [plugin.name, usedPluginNames[plugin.name]].filter(Boolean);
648
622
  if (plugin.context && typeof plugin.context === "function") {
649
623
  return {
@@ -675,25 +649,21 @@ Falling back on the first item.
675
649
  static get hooks() {
676
650
  return ["buildStart", "resolvePath", "resolveName", "buildEnd"];
677
651
  }
678
- }, _class);
652
+ };
679
653
 
680
654
  // src/config.ts
681
- _chunkSEH6NUCXcjs.init_cjs_shims.call(void 0, );
655
+ chunkADFKVVPE_cjs.init_cjs_shims();
682
656
  function defineConfig(options) {
683
657
  return options;
684
658
  }
685
659
  function isInputPath(result) {
686
660
  return !!result && "path" in result;
687
661
  }
688
-
689
- // src/build.ts
690
-
691
-
692
662
  async function setup(options) {
693
- const { config, logger = _chunkM7NLNCSMcjs.createLogger.call(void 0, ) } = options;
663
+ const { config, logger = chunkYEVCYV36_cjs.createLogger() } = options;
694
664
  try {
695
- if (isInputPath(config) && !new (0, _chunkNB4JMN75cjs.URLPath)(config.input.path).isURL) {
696
- await _fs.read.call(void 0, config.input.path);
665
+ if (isInputPath(config) && !new chunkOJRKV365_cjs.URLPath(config.input.path).isURL) {
666
+ await fs.read(config.input.path);
697
667
  }
698
668
  } catch (e) {
699
669
  if (isInputPath(config)) {
@@ -703,8 +673,8 @@ async function setup(options) {
703
673
  }
704
674
  }
705
675
  if (config.output.clean) {
706
- await _fs.clean.call(void 0, config.output.path);
707
- await _fs.clean.call(void 0, _path.join.call(void 0, config.root, ".kubb"));
676
+ await fs.clean(config.output.path);
677
+ await fs.clean(path3.join(config.root, ".kubb"));
708
678
  }
709
679
  return new PluginManager(config, { logger });
710
680
  }
@@ -722,12 +692,12 @@ async function safeBuild(options) {
722
692
  const pluginManager = await setup(options);
723
693
  try {
724
694
  pluginManager.events.on("executing", ({ plugin, message }) => {
725
- pluginManager.logger.emit("debug", { date: /* @__PURE__ */ new Date(), logs: [`Executing pluginKey ${_optionalChain([plugin, 'access', _28 => _28.key, 'optionalAccess', _29 => _29.join, 'call', _30 => _30(".")])} | ${message}`] });
695
+ pluginManager.logger.emit("debug", { date: /* @__PURE__ */ new Date(), logs: [`Executing pluginKey ${plugin.key?.join(".")} | ${message}`] });
726
696
  });
727
697
  pluginManager.events.on("executed", ({ plugin, message, output }) => {
728
698
  pluginManager.logger.emit("debug", {
729
699
  date: /* @__PURE__ */ new Date(),
730
- logs: [`Executed pluginKey ${_optionalChain([plugin, 'access', _31 => _31.key, 'optionalAccess', _32 => _32.join, 'call', _33 => _33(".")])} | ${message} | ${JSON.stringify(output, void 0, 2)}`]
700
+ logs: [`Executed pluginKey ${plugin.key?.join(".")} | ${message} | ${JSON.stringify(output, void 0, 2)}`]
731
701
  });
732
702
  });
733
703
  await pluginManager.hookParallel({
@@ -735,8 +705,8 @@ async function safeBuild(options) {
735
705
  parameters: [options.config],
736
706
  message: "buildStart"
737
707
  });
738
- const root = _path.resolve.call(void 0, options.config.root);
739
- const rootPath = _path.resolve.call(void 0, root, options.config.output.path, "index.ts");
708
+ const root = path3.resolve(options.config.root);
709
+ const rootPath = path3.resolve(root, options.config.output.path, "index.ts");
740
710
  const barrelFiles = pluginManager.fileManager.files.filter((file) => {
741
711
  return file.sources.some((source) => source.isIndexable);
742
712
  });
@@ -744,26 +714,26 @@ async function safeBuild(options) {
744
714
  path: rootPath,
745
715
  baseName: "index.ts",
746
716
  exports: barrelFiles.flatMap((file) => {
747
- return _optionalChain([file, 'access', _34 => _34.sources, 'optionalAccess', _35 => _35.map, 'call', _36 => _36((source) => {
717
+ return file.sources?.map((source) => {
748
718
  if (!file.path || !source.isIndexable) {
749
719
  return void 0;
750
720
  }
751
- const plugin = pluginManager.plugins.find((item) => {
721
+ const plugin = [...pluginManager.plugins].find((item) => {
752
722
  const meta = file.meta;
753
- return item.name === _optionalChain([meta, 'optionalAccess', _37 => _37.pluginKey, 'optionalAccess', _38 => _38[0]]);
723
+ return item.name === meta?.pluginKey?.[0];
754
724
  });
755
- if (_optionalChain([plugin, 'optionalAccess', _39 => _39.output, 'optionalAccess', _40 => _40.exportType]) === false) {
725
+ if (plugin?.output?.exportType === false) {
756
726
  return void 0;
757
727
  }
758
- if (_chunkNB4JMN75cjs.FileManager.getMode(_optionalChain([plugin, 'optionalAccess', _41 => _41.output, 'optionalAccess', _42 => _42.path])) === "single") {
728
+ if (chunkOJRKV365_cjs.FileManager.getMode(plugin?.output?.path) === "single") {
759
729
  return void 0;
760
730
  }
761
731
  return {
762
732
  name: options.config.output.exportType === "barrel" ? void 0 : [source.name],
763
- path: _fs.getRelativePath.call(void 0, rootPath, file.path),
733
+ path: fs.getRelativePath(rootPath, file.path),
764
734
  isTypeOnly: source.isTypeOnly
765
735
  };
766
- }), 'access', _43 => _43.filter, 'call', _44 => _44(Boolean)]);
736
+ }).filter(Boolean);
767
737
  }).filter(Boolean),
768
738
  sources: [],
769
739
  meta: {}
@@ -771,7 +741,7 @@ async function safeBuild(options) {
771
741
  if (options.config.output.exportType) {
772
742
  await pluginManager.fileManager.add(rootFile);
773
743
  }
774
- files = await _chunkNB4JMN75cjs.processFiles.call(void 0, {
744
+ files = await chunkOJRKV365_cjs.processFiles({
775
745
  config: options.config,
776
746
  dryRun: !options.config.output.write,
777
747
  files: pluginManager.fileManager.files,
@@ -793,7 +763,7 @@ async function safeBuild(options) {
793
763
  }
794
764
 
795
765
  // src/BaseGenerator.ts
796
- _chunkSEH6NUCXcjs.init_cjs_shims.call(void 0, );
766
+ chunkADFKVVPE_cjs.init_cjs_shims();
797
767
  var BaseGenerator = class {
798
768
  #options = {};
799
769
  #context = {};
@@ -818,33 +788,25 @@ var BaseGenerator = class {
818
788
  };
819
789
 
820
790
  // src/PackageManager.ts
821
- _chunkSEH6NUCXcjs.init_cjs_shims.call(void 0, );
822
- var _module = require('module'); var _module2 = _interopRequireDefault(_module);
823
- var _os = require('os'); var _os2 = _interopRequireDefault(_os);
824
- var _url = require('url');
791
+ chunkADFKVVPE_cjs.init_cjs_shims();
825
792
 
826
793
  // ../../node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js
827
- _chunkSEH6NUCXcjs.init_cjs_shims.call(void 0, );
828
-
794
+ chunkADFKVVPE_cjs.init_cjs_shims();
829
795
 
830
796
  // ../../node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js
831
- _chunkSEH6NUCXcjs.init_cjs_shims.call(void 0, );
832
- var _process = require('process'); var _process2 = _interopRequireDefault(_process);
833
-
834
- var _fs3 = require('fs'); var _fs4 = _interopRequireDefault(_fs3);
835
-
797
+ chunkADFKVVPE_cjs.init_cjs_shims();
836
798
 
837
799
  // ../../node_modules/.pnpm/p-locate@6.0.0/node_modules/p-locate/index.js
838
- _chunkSEH6NUCXcjs.init_cjs_shims.call(void 0, );
800
+ chunkADFKVVPE_cjs.init_cjs_shims();
839
801
 
840
802
  // ../../node_modules/.pnpm/p-limit@4.0.0/node_modules/p-limit/index.js
841
- _chunkSEH6NUCXcjs.init_cjs_shims.call(void 0, );
803
+ chunkADFKVVPE_cjs.init_cjs_shims();
842
804
 
843
805
  // ../../node_modules/.pnpm/yocto-queue@1.0.0/node_modules/yocto-queue/index.js
844
- _chunkSEH6NUCXcjs.init_cjs_shims.call(void 0, );
806
+ chunkADFKVVPE_cjs.init_cjs_shims();
845
807
  var Node = class {
846
-
847
-
808
+ value;
809
+ next;
848
810
  constructor(value) {
849
811
  this.value = value;
850
812
  }
@@ -912,7 +874,7 @@ function pLimit(concurrency) {
912
874
  resolve2(result);
913
875
  try {
914
876
  await result;
915
- } catch (e2) {
877
+ } catch {
916
878
  }
917
879
  next();
918
880
  };
@@ -988,9 +950,9 @@ function checkType(type) {
988
950
  throw new Error(`Invalid type specified: ${type}`);
989
951
  }
990
952
  var matchType = (type, stat) => stat[typeMappings[type]]();
991
- var toPath = (urlOrPath) => urlOrPath instanceof URL ? _url.fileURLToPath.call(void 0, urlOrPath) : urlOrPath;
953
+ var toPath = (urlOrPath) => urlOrPath instanceof URL ? url.fileURLToPath(urlOrPath) : urlOrPath;
992
954
  async function locatePath(paths, {
993
- cwd = _process2.default.cwd(),
955
+ cwd = process__default.default.cwd(),
994
956
  type = "file",
995
957
  allowSymlinks = true,
996
958
  concurrency,
@@ -998,27 +960,27 @@ async function locatePath(paths, {
998
960
  } = {}) {
999
961
  checkType(type);
1000
962
  cwd = toPath(cwd);
1001
- const statFunction = allowSymlinks ? _fs3.promises.stat : _fs3.promises.lstat;
963
+ const statFunction = allowSymlinks ? fs$1.promises.stat : fs$1.promises.lstat;
1002
964
  return pLocate(paths, async (path_) => {
1003
965
  try {
1004
- const stat = await statFunction(_path2.default.resolve(cwd, path_));
966
+ const stat = await statFunction(path3__default.default.resolve(cwd, path_));
1005
967
  return matchType(type, stat);
1006
- } catch (e3) {
968
+ } catch {
1007
969
  return false;
1008
970
  }
1009
971
  }, { concurrency, preserveOrder });
1010
972
  }
1011
973
  function locatePathSync(paths, {
1012
- cwd = _process2.default.cwd(),
974
+ cwd = process__default.default.cwd(),
1013
975
  type = "file",
1014
976
  allowSymlinks = true
1015
977
  } = {}) {
1016
978
  checkType(type);
1017
979
  cwd = toPath(cwd);
1018
- const statFunction = allowSymlinks ? _fs4.default.statSync : _fs4.default.lstatSync;
980
+ const statFunction = allowSymlinks ? fs__default.default.statSync : fs__default.default.lstatSync;
1019
981
  for (const path_ of paths) {
1020
982
  try {
1021
- const stat = statFunction(_path2.default.resolve(cwd, path_), {
983
+ const stat = statFunction(path3__default.default.resolve(cwd, path_), {
1022
984
  throwIfNoEntry: false
1023
985
  });
1024
986
  if (!stat) {
@@ -1027,29 +989,27 @@ function locatePathSync(paths, {
1027
989
  if (matchType(type, stat)) {
1028
990
  return path_;
1029
991
  }
1030
- } catch (e4) {
992
+ } catch {
1031
993
  }
1032
994
  }
1033
995
  }
1034
996
 
1035
997
  // ../../node_modules/.pnpm/unicorn-magic@0.1.0/node_modules/unicorn-magic/node.js
1036
- _chunkSEH6NUCXcjs.init_cjs_shims.call(void 0, );
1037
-
998
+ chunkADFKVVPE_cjs.init_cjs_shims();
1038
999
  function toPath2(urlOrPath) {
1039
- return urlOrPath instanceof URL ? _url.fileURLToPath.call(void 0, urlOrPath) : urlOrPath;
1000
+ return urlOrPath instanceof URL ? url.fileURLToPath(urlOrPath) : urlOrPath;
1040
1001
  }
1041
1002
 
1042
1003
  // ../../node_modules/.pnpm/path-exists@5.0.0/node_modules/path-exists/index.js
1043
- _chunkSEH6NUCXcjs.init_cjs_shims.call(void 0, );
1044
-
1004
+ chunkADFKVVPE_cjs.init_cjs_shims();
1045
1005
 
1046
1006
  // ../../node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js
1047
1007
  var findUpStop = Symbol("findUpStop");
1048
1008
  async function findUpMultiple(name, options = {}) {
1049
- let directory = _path2.default.resolve(_nullishCoalesce(toPath2(options.cwd), () => ( "")));
1050
- const { root } = _path2.default.parse(directory);
1051
- const stopAt = _path2.default.resolve(directory, toPath2(_nullishCoalesce(options.stopAt, () => ( root))));
1052
- const limit = _nullishCoalesce(options.limit, () => ( Number.POSITIVE_INFINITY));
1009
+ let directory = path3__default.default.resolve(toPath2(options.cwd) ?? "");
1010
+ const { root } = path3__default.default.parse(directory);
1011
+ const stopAt = path3__default.default.resolve(directory, toPath2(options.stopAt ?? root));
1012
+ const limit = options.limit ?? Number.POSITIVE_INFINITY;
1053
1013
  const paths = [name].flat();
1054
1014
  const runMatcher = async (locateOptions) => {
1055
1015
  if (typeof name !== "function") {
@@ -1068,20 +1028,20 @@ async function findUpMultiple(name, options = {}) {
1068
1028
  break;
1069
1029
  }
1070
1030
  if (foundPath) {
1071
- matches.push(_path2.default.resolve(directory, foundPath));
1031
+ matches.push(path3__default.default.resolve(directory, foundPath));
1072
1032
  }
1073
1033
  if (directory === stopAt || matches.length >= limit) {
1074
1034
  break;
1075
1035
  }
1076
- directory = _path2.default.dirname(directory);
1036
+ directory = path3__default.default.dirname(directory);
1077
1037
  }
1078
1038
  return matches;
1079
1039
  }
1080
1040
  function findUpMultipleSync(name, options = {}) {
1081
- let directory = _path2.default.resolve(_nullishCoalesce(toPath2(options.cwd), () => ( "")));
1082
- const { root } = _path2.default.parse(directory);
1083
- const stopAt = _path2.default.resolve(directory, _nullishCoalesce(toPath2(options.stopAt), () => ( root)));
1084
- const limit = _nullishCoalesce(options.limit, () => ( Number.POSITIVE_INFINITY));
1041
+ let directory = path3__default.default.resolve(toPath2(options.cwd) ?? "");
1042
+ const { root } = path3__default.default.parse(directory);
1043
+ const stopAt = path3__default.default.resolve(directory, toPath2(options.stopAt) ?? root);
1044
+ const limit = options.limit ?? Number.POSITIVE_INFINITY;
1085
1045
  const paths = [name].flat();
1086
1046
  const runMatcher = (locateOptions) => {
1087
1047
  if (typeof name !== "function") {
@@ -1100,12 +1060,12 @@ function findUpMultipleSync(name, options = {}) {
1100
1060
  break;
1101
1061
  }
1102
1062
  if (foundPath) {
1103
- matches.push(_path2.default.resolve(directory, foundPath));
1063
+ matches.push(path3__default.default.resolve(directory, foundPath));
1104
1064
  }
1105
1065
  if (directory === stopAt || matches.length >= limit) {
1106
1066
  break;
1107
1067
  }
1108
- directory = _path2.default.dirname(directory);
1068
+ directory = path3__default.default.dirname(directory);
1109
1069
  }
1110
1070
  return matches;
1111
1071
  }
@@ -1117,10 +1077,6 @@ function findUpSync(name, options = {}) {
1117
1077
  const matches = findUpMultipleSync(name, { ...options, limit: 1 });
1118
1078
  return matches[0];
1119
1079
  }
1120
-
1121
- // src/PackageManager.ts
1122
- var _semver = require('semver');
1123
-
1124
1080
  var PackageManager = class _PackageManager {
1125
1081
  static #cache = {};
1126
1082
  #cwd;
@@ -1146,7 +1102,7 @@ var PackageManager = class _PackageManager {
1146
1102
  getLocation(path4) {
1147
1103
  let location = path4;
1148
1104
  if (this.#cwd) {
1149
- const require2 = _module2.default.createRequire(this.normalizeDirectory(this.#cwd));
1105
+ const require2 = mod__default.default.createRequire(this.normalizeDirectory(this.#cwd));
1150
1106
  location = require2.resolve(path4);
1151
1107
  }
1152
1108
  return location;
@@ -1154,11 +1110,11 @@ var PackageManager = class _PackageManager {
1154
1110
  async import(path4) {
1155
1111
  try {
1156
1112
  let location = this.getLocation(path4);
1157
- if (_os2.default.platform() === "win32") {
1158
- location = _url.pathToFileURL.call(void 0, location).href;
1113
+ if (os__default.default.platform() === "win32") {
1114
+ location = url.pathToFileURL(location).href;
1159
1115
  }
1160
- const module = await Promise.resolve().then(() => _interopRequireWildcard(require(location)));
1161
- return _nullishCoalesce(_optionalChain([module, 'optionalAccess', _45 => _45.default]), () => ( module));
1116
+ const module = await import(location);
1117
+ return module?.default ?? module;
1162
1118
  } catch (e) {
1163
1119
  console.error(e);
1164
1120
  return void 0;
@@ -1171,7 +1127,7 @@ var PackageManager = class _PackageManager {
1171
1127
  if (!pkgPath) {
1172
1128
  return void 0;
1173
1129
  }
1174
- const json = await _fs.read.call(void 0, pkgPath);
1130
+ const json = await fs.read(pkgPath);
1175
1131
  return JSON.parse(json);
1176
1132
  }
1177
1133
  getPackageJSONSync() {
@@ -1181,7 +1137,7 @@ var PackageManager = class _PackageManager {
1181
1137
  if (!pkgPath) {
1182
1138
  return void 0;
1183
1139
  }
1184
- const json = _fs.readSync.call(void 0, pkgPath);
1140
+ const json = fs.readSync(pkgPath);
1185
1141
  return JSON.parse(json);
1186
1142
  }
1187
1143
  static setVersion(dependency, version) {
@@ -1226,35 +1182,50 @@ var PackageManager = class _PackageManager {
1226
1182
  if (packageVersion === version) {
1227
1183
  return true;
1228
1184
  }
1229
- const semVer = _semver.coerce.call(void 0, packageVersion);
1185
+ const semVer = semver.coerce(packageVersion);
1230
1186
  if (!semVer) {
1231
1187
  throw new Error(`${packageVersion} is not valid`);
1232
1188
  }
1233
- return _semver.satisfies.call(void 0, semVer, version);
1189
+ return semver.satisfies(semVer, version);
1234
1190
  }
1235
1191
  isValidSync(dependency, version) {
1236
1192
  const packageVersion = this.getVersionSync(dependency);
1237
1193
  if (!packageVersion) {
1238
1194
  return false;
1239
1195
  }
1240
- const semVer = _semver.coerce.call(void 0, packageVersion);
1196
+ const semVer = semver.coerce(packageVersion);
1241
1197
  if (!semVer) {
1242
1198
  throw new Error(`${packageVersion} is not valid`);
1243
1199
  }
1244
- return _semver.satisfies.call(void 0, semVer, version);
1200
+ return semver.satisfies(semVer, version);
1245
1201
  }
1246
1202
  };
1247
1203
 
1248
-
1249
-
1250
-
1251
-
1252
-
1253
-
1254
-
1255
-
1256
-
1257
-
1258
-
1259
- exports.BaseGenerator = BaseGenerator; exports.FileManager = _chunkNB4JMN75cjs.FileManager; exports.PackageManager = PackageManager; exports.PluginManager = PluginManager; exports.PromiseManager = PromiseManager; exports.build = build; exports.createPlugin = createPlugin; exports.default = build; exports.defineConfig = defineConfig; exports.isInputPath = isInputPath; exports.safeBuild = safeBuild;
1204
+ Object.defineProperty(exports, "FileManager", {
1205
+ enumerable: true,
1206
+ get: function () { return chunkOJRKV365_cjs.FileManager; }
1207
+ });
1208
+ Object.defineProperty(exports, "combineExports", {
1209
+ enumerable: true,
1210
+ get: function () { return chunkOJRKV365_cjs.combineExports; }
1211
+ });
1212
+ Object.defineProperty(exports, "combineImports", {
1213
+ enumerable: true,
1214
+ get: function () { return chunkOJRKV365_cjs.combineImports; }
1215
+ });
1216
+ Object.defineProperty(exports, "combineSources", {
1217
+ enumerable: true,
1218
+ get: function () { return chunkOJRKV365_cjs.combineSources; }
1219
+ });
1220
+ exports.BaseGenerator = BaseGenerator;
1221
+ exports.PackageManager = PackageManager;
1222
+ exports.PluginManager = PluginManager;
1223
+ exports.PromiseManager = PromiseManager;
1224
+ exports.build = build;
1225
+ exports.createPlugin = createPlugin;
1226
+ exports.default = build;
1227
+ exports.defineConfig = defineConfig;
1228
+ exports.isInputPath = isInputPath;
1229
+ exports.safeBuild = safeBuild;
1230
+ //# sourceMappingURL=index.cjs.map
1260
1231
  //# sourceMappingURL=index.cjs.map