@kubb/core 3.5.6 → 3.5.8

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 (40) hide show
  1. package/dist/{chunk-7ZWCCQIK.cjs → chunk-BIWQPQEA.cjs} +4 -4
  2. package/dist/chunk-BIWQPQEA.cjs.map +1 -0
  3. package/dist/{chunk-BWZNO5B2.cjs → chunk-BJTJV7DO.cjs} +20 -20
  4. package/dist/chunk-BJTJV7DO.cjs.map +1 -0
  5. package/dist/chunk-E2WLQU27.js +8 -8
  6. package/dist/chunk-E2WLQU27.js.map +1 -1
  7. package/dist/{chunk-HOFDXARN.cjs → chunk-MYUGSVTP.cjs} +65 -65
  8. package/dist/chunk-MYUGSVTP.cjs.map +1 -0
  9. package/dist/chunk-O5ASNFB7.js +14 -14
  10. package/dist/chunk-O5ASNFB7.js.map +1 -1
  11. package/dist/{chunk-4WJNDG3X.cjs → chunk-SH7MTMBR.cjs} +31 -31
  12. package/dist/chunk-SH7MTMBR.cjs.map +1 -0
  13. package/dist/chunk-YYMV5PIX.js +16 -16
  14. package/dist/chunk-YYMV5PIX.js.map +1 -1
  15. package/dist/index.cjs +49 -50
  16. package/dist/index.cjs.map +1 -1
  17. package/dist/index.js +12 -13
  18. package/dist/index.js.map +1 -1
  19. package/dist/logger.cjs +6 -6
  20. package/dist/mocks.cjs +14 -14
  21. package/dist/mocks.cjs.map +1 -1
  22. package/dist/mocks.js +5 -5
  23. package/dist/mocks.js.map +1 -1
  24. package/dist/prompt-RQXXVSD5.js +8 -8
  25. package/dist/prompt-RQXXVSD5.js.map +1 -1
  26. package/dist/{prompt-PLDPTBBZ.cjs → prompt-UHZFVPND.cjs} +12 -12
  27. package/dist/prompt-UHZFVPND.cjs.map +1 -0
  28. package/dist/transformers.cjs +22 -22
  29. package/dist/utils.cjs +17 -17
  30. package/package.json +9 -9
  31. package/src/PluginManager.ts +1 -4
  32. package/src/PromiseManager.ts +0 -4
  33. package/src/build.ts +1 -1
  34. package/src/config.ts +1 -1
  35. package/src/utils/executeStrategies.ts +1 -10
  36. package/dist/chunk-4WJNDG3X.cjs.map +0 -1
  37. package/dist/chunk-7ZWCCQIK.cjs.map +0 -1
  38. package/dist/chunk-BWZNO5B2.cjs.map +0 -1
  39. package/dist/chunk-HOFDXARN.cjs.map +0 -1
  40. package/dist/prompt-PLDPTBBZ.cjs.map +0 -1
package/dist/index.cjs CHANGED
@@ -2,10 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var chunkBWZNO5B2_cjs = require('./chunk-BWZNO5B2.cjs');
6
- var chunkHOFDXARN_cjs = require('./chunk-HOFDXARN.cjs');
7
- var chunk4WJNDG3X_cjs = require('./chunk-4WJNDG3X.cjs');
8
- var chunk7ZWCCQIK_cjs = require('./chunk-7ZWCCQIK.cjs');
5
+ var chunkBJTJV7DO_cjs = require('./chunk-BJTJV7DO.cjs');
6
+ var chunkMYUGSVTP_cjs = require('./chunk-MYUGSVTP.cjs');
7
+ var chunkSH7MTMBR_cjs = require('./chunk-SH7MTMBR.cjs');
8
+ var chunkBIWQPQEA_cjs = require('./chunk-BIWQPQEA.cjs');
9
9
  var fs = require('@kubb/fs');
10
10
  var path3 = require('path');
11
11
  var mod = require('module');
@@ -24,19 +24,19 @@ var process2__default = /*#__PURE__*/_interopDefault(process2);
24
24
  var fs__default = /*#__PURE__*/_interopDefault(fs$1);
25
25
 
26
26
  // src/index.ts
27
- chunk7ZWCCQIK_cjs.init_cjs_shims();
27
+ chunkBIWQPQEA_cjs.init_cjs_shims();
28
28
 
29
29
  // src/build.ts
30
- chunk7ZWCCQIK_cjs.init_cjs_shims();
30
+ chunkBIWQPQEA_cjs.init_cjs_shims();
31
31
 
32
32
  // src/PluginManager.ts
33
- chunk7ZWCCQIK_cjs.init_cjs_shims();
33
+ chunkBIWQPQEA_cjs.init_cjs_shims();
34
34
 
35
35
  // src/PromiseManager.ts
36
- chunk7ZWCCQIK_cjs.init_cjs_shims();
36
+ chunkBIWQPQEA_cjs.init_cjs_shims();
37
37
 
38
38
  // src/utils/executeStrategies.ts
39
- chunk7ZWCCQIK_cjs.init_cjs_shims();
39
+ chunkBIWQPQEA_cjs.init_cjs_shims();
40
40
  function hookSeq(promises) {
41
41
  return promises.filter(Boolean).reduce(
42
42
  (promise, func) => {
@@ -60,8 +60,7 @@ function hookFirst(promises, nullCheck = (state) => state !== null) {
60
60
  if (nullCheck(state)) {
61
61
  return state;
62
62
  }
63
- const calledFunc = func(state);
64
- return calledFunc;
63
+ return func(state);
65
64
  });
66
65
  }
67
66
  return promise;
@@ -98,12 +97,12 @@ function isPromiseRejectedResult(result) {
98
97
  }
99
98
 
100
99
  // src/errors.ts
101
- chunk7ZWCCQIK_cjs.init_cjs_shims();
100
+ chunkBIWQPQEA_cjs.init_cjs_shims();
102
101
  var ValidationPluginError = class extends Error {
103
102
  };
104
103
 
105
104
  // src/plugin.ts
106
- chunk7ZWCCQIK_cjs.init_cjs_shims();
105
+ chunkBIWQPQEA_cjs.init_cjs_shims();
107
106
  function createPlugin(factory) {
108
107
  return (options = {}) => {
109
108
  return factory(options);
@@ -154,7 +153,7 @@ var pluginCore = createPlugin((options) => {
154
153
  var PluginManager = class {
155
154
  plugins = /* @__PURE__ */ new Set();
156
155
  fileManager;
157
- events = new chunkBWZNO5B2_cjs.EventEmitter();
156
+ events = new chunkBJTJV7DO_cjs.EventEmitter();
158
157
  config;
159
158
  executed = [];
160
159
  logger;
@@ -166,7 +165,7 @@ var PluginManager = class {
166
165
  this.config = config;
167
166
  this.options = options;
168
167
  this.logger = options.logger;
169
- this.fileManager = new chunkHOFDXARN_cjs.FileManager();
168
+ this.fileManager = new chunkMYUGSVTP_cjs.FileManager();
170
169
  this.#promiseManager = new PromiseManager({
171
170
  nullCheck: (state) => !!state?.result
172
171
  });
@@ -215,7 +214,7 @@ var PluginManager = class {
215
214
  logs: [
216
215
  `Cannot return a path where the 'pluginKey' ${params.pluginKey ? JSON.stringify(params.pluginKey) : '"'} is not unique enough
217
216
 
218
- Paths: ${JSON.stringify(paths, void 0, 2)}
217
+ Paths: ${JSON.stringify(paths, undefined, 2)}
219
218
 
220
219
  Falling back on the first item.
221
220
  `
@@ -236,7 +235,7 @@ Falling back on the first item.
236
235
  const names = this.hookForPluginSync({
237
236
  pluginKey: params.pluginKey,
238
237
  hookName: "resolveName",
239
- parameters: [chunk4WJNDG3X_cjs.trim(params.name), params.type],
238
+ parameters: [chunkSH7MTMBR_cjs.trim(params.name), params.type],
240
239
  message: `Resolving name '${params.name}' and type '${params.type}'`
241
240
  });
242
241
  if (names && names?.length > 1) {
@@ -245,21 +244,21 @@ Falling back on the first item.
245
244
  logs: [
246
245
  `Cannot return a name where the 'pluginKey' ${params.pluginKey ? JSON.stringify(params.pluginKey) : '"'} is not unique enough
247
246
 
248
- Names: ${JSON.stringify(names, void 0, 2)}
247
+ Names: ${JSON.stringify(names, undefined, 2)}
249
248
 
250
249
  Falling back on the first item.
251
250
  `
252
251
  ]
253
252
  });
254
253
  }
255
- return chunk4WJNDG3X_cjs.transformReservedWord(names?.at(0) || params.name);
254
+ return chunkSH7MTMBR_cjs.transformReservedWord(names?.at(0) || params.name);
256
255
  }
257
256
  const name = this.hookFirstSync({
258
257
  hookName: "resolveName",
259
- parameters: [chunk4WJNDG3X_cjs.trim(params.name), params.type],
258
+ parameters: [chunkSH7MTMBR_cjs.trim(params.name), params.type],
260
259
  message: `Resolving name '${params.name}' and type '${params.type}'`
261
260
  }).result;
262
- return chunk4WJNDG3X_cjs.transformReservedWord(name);
261
+ return chunkSH7MTMBR_cjs.transformReservedWord(name);
263
262
  };
264
263
  /**
265
264
  * Instead of calling `pluginManager.events.on` you can use `pluginManager.on`. This one also has better types.
@@ -434,7 +433,7 @@ Falling back on the first item.
434
433
  if (plugin.pre) {
435
434
  const isValid = plugin.pre.every((pluginName) => plugins.find((pluginToFind) => pluginToFind.name === pluginName));
436
435
  if (!isValid) {
437
- throw new ValidationPluginError(`This plugin has a pre set that is not valid(${JSON.stringify(plugin.pre, void 0, 2)})`);
436
+ throw new ValidationPluginError(`This plugin has a pre set that is not valid(${JSON.stringify(plugin.pre, undefined, 2)})`);
438
437
  }
439
438
  }
440
439
  return plugin;
@@ -450,7 +449,7 @@ Falling back on the first item.
450
449
  }
451
450
  getPluginByKey(pluginKey) {
452
451
  const plugins = [...this.plugins];
453
- const [searchPluginName, searchIdentifier] = pluginKey;
452
+ const [searchPluginName] = pluginKey;
454
453
  return plugins.find((item) => {
455
454
  const [name] = item.key;
456
455
  return name === searchPluginName;
@@ -513,7 +512,7 @@ Falling back on the first item.
513
512
  }
514
513
  this.events.emit("executing", { strategy, hookName, parameters, plugin, message });
515
514
  const promise = new Promise((resolve2) => {
516
- resolve2(void 0);
515
+ resolve2(undefined);
517
516
  });
518
517
  const task = promise.then(() => {
519
518
  if (typeof hook === "function") {
@@ -597,7 +596,7 @@ Falling back on the first item.
597
596
  }
598
597
  #parse(plugin, pluginManager, context) {
599
598
  const usedPluginNames = pluginManager.#usedPluginNames;
600
- chunkHOFDXARN_cjs.setUniqueName(plugin.name, usedPluginNames);
599
+ chunkMYUGSVTP_cjs.setUniqueName(plugin.name, usedPluginNames);
601
600
  const key = [plugin.name, usedPluginNames[plugin.name]].filter(Boolean);
602
601
  if (plugin.context && typeof plugin.context === "function") {
603
602
  return {
@@ -632,7 +631,7 @@ Falling back on the first item.
632
631
  };
633
632
 
634
633
  // src/config.ts
635
- chunk7ZWCCQIK_cjs.init_cjs_shims();
634
+ chunkBIWQPQEA_cjs.init_cjs_shims();
636
635
  function defineConfig(options) {
637
636
  return options;
638
637
  }
@@ -640,9 +639,9 @@ function isInputPath(result) {
640
639
  return !!result && "path" in result?.input;
641
640
  }
642
641
  async function setup(options) {
643
- const { config: userConfig, logger = chunkBWZNO5B2_cjs.createLogger() } = options;
642
+ const { config: userConfig, logger = chunkBJTJV7DO_cjs.createLogger() } = options;
644
643
  try {
645
- if (isInputPath(userConfig) && !new chunkHOFDXARN_cjs.URLPath(userConfig.input.path).isURL) {
644
+ if (isInputPath(userConfig) && !new chunkMYUGSVTP_cjs.URLPath(userConfig.input.path).isURL) {
646
645
  await fs.read(userConfig.input.path);
647
646
  }
648
647
  } catch (e) {
@@ -737,7 +736,7 @@ async function safeBuild(options) {
737
736
  if (config.output.barrelType) {
738
737
  await pluginManager.fileManager.add(rootFile);
739
738
  }
740
- files = await chunkHOFDXARN_cjs.processFiles({
739
+ files = await chunkMYUGSVTP_cjs.processFiles({
741
740
  root: config.root,
742
741
  extension: config.output.extension,
743
742
  dryRun: !config.output.write,
@@ -760,7 +759,7 @@ async function safeBuild(options) {
760
759
  }
761
760
 
762
761
  // src/BaseGenerator.ts
763
- chunk7ZWCCQIK_cjs.init_cjs_shims();
762
+ chunkBIWQPQEA_cjs.init_cjs_shims();
764
763
  var BaseGenerator = class {
765
764
  #options = {};
766
765
  #context = {};
@@ -785,22 +784,22 @@ var BaseGenerator = class {
785
784
  };
786
785
 
787
786
  // src/PackageManager.ts
788
- chunk7ZWCCQIK_cjs.init_cjs_shims();
787
+ chunkBIWQPQEA_cjs.init_cjs_shims();
789
788
 
790
789
  // ../../node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js
791
- chunk7ZWCCQIK_cjs.init_cjs_shims();
790
+ chunkBIWQPQEA_cjs.init_cjs_shims();
792
791
 
793
792
  // ../../node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js
794
- chunk7ZWCCQIK_cjs.init_cjs_shims();
793
+ chunkBIWQPQEA_cjs.init_cjs_shims();
795
794
 
796
795
  // ../../node_modules/.pnpm/p-locate@6.0.0/node_modules/p-locate/index.js
797
- chunk7ZWCCQIK_cjs.init_cjs_shims();
796
+ chunkBIWQPQEA_cjs.init_cjs_shims();
798
797
 
799
798
  // ../../node_modules/.pnpm/p-limit@4.0.0/node_modules/p-limit/index.js
800
- chunk7ZWCCQIK_cjs.init_cjs_shims();
799
+ chunkBIWQPQEA_cjs.init_cjs_shims();
801
800
 
802
801
  // ../../node_modules/.pnpm/yocto-queue@1.1.1/node_modules/yocto-queue/index.js
803
- chunk7ZWCCQIK_cjs.init_cjs_shims();
802
+ chunkBIWQPQEA_cjs.init_cjs_shims();
804
803
  var Node = class {
805
804
  value;
806
805
  next;
@@ -842,8 +841,8 @@ var Queue = class {
842
841
  return this.#head.value;
843
842
  }
844
843
  clear() {
845
- this.#head = void 0;
846
- this.#tail = void 0;
844
+ this.#head = undefined;
845
+ this.#tail = undefined;
847
846
  this.#size = 0;
848
847
  }
849
848
  get size() {
@@ -882,7 +881,7 @@ function pLimit(concurrency) {
882
881
  next();
883
882
  };
884
883
  const enqueue = (fn, resolve2, args) => {
885
- queue.enqueue(run.bind(void 0, fn, resolve2, args));
884
+ queue.enqueue(run.bind(undefined, fn, resolve2, args));
886
885
  (async () => {
887
886
  await Promise.resolve();
888
887
  if (activeCount < concurrency && queue.size > 0) {
@@ -998,13 +997,13 @@ function locatePathSync(paths, {
998
997
  }
999
998
 
1000
999
  // ../../node_modules/.pnpm/unicorn-magic@0.1.0/node_modules/unicorn-magic/node.js
1001
- chunk7ZWCCQIK_cjs.init_cjs_shims();
1000
+ chunkBIWQPQEA_cjs.init_cjs_shims();
1002
1001
  function toPath2(urlOrPath) {
1003
1002
  return urlOrPath instanceof URL ? url.fileURLToPath(urlOrPath) : urlOrPath;
1004
1003
  }
1005
1004
 
1006
1005
  // ../../node_modules/.pnpm/path-exists@5.0.0/node_modules/path-exists/index.js
1007
- chunk7ZWCCQIK_cjs.init_cjs_shims();
1006
+ chunkBIWQPQEA_cjs.init_cjs_shims();
1008
1007
 
1009
1008
  // ../../node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js
1010
1009
  var findUpStop = Symbol("findUpStop");
@@ -1120,7 +1119,7 @@ var PackageManager = class _PackageManager {
1120
1119
  return module?.default ?? module;
1121
1120
  } catch (e) {
1122
1121
  console.error(e);
1123
- return void 0;
1122
+ return undefined;
1124
1123
  }
1125
1124
  }
1126
1125
  async getPackageJSON() {
@@ -1128,7 +1127,7 @@ var PackageManager = class _PackageManager {
1128
1127
  cwd: this.#cwd
1129
1128
  });
1130
1129
  if (!pkgPath) {
1131
- return void 0;
1130
+ return undefined;
1132
1131
  }
1133
1132
  const json = await fs.read(pkgPath);
1134
1133
  return JSON.parse(json);
@@ -1138,7 +1137,7 @@ var PackageManager = class _PackageManager {
1138
1137
  cwd: this.#cwd
1139
1138
  });
1140
1139
  if (!pkgPath) {
1141
- return void 0;
1140
+ return undefined;
1142
1141
  }
1143
1142
  const json = fs.readSync(pkgPath);
1144
1143
  return JSON.parse(json);
@@ -1155,7 +1154,7 @@ var PackageManager = class _PackageManager {
1155
1154
  return dependencies[dependency];
1156
1155
  }
1157
1156
  const matchedDependency = Object.keys(dependencies).find((dep) => dep.match(dependency));
1158
- return matchedDependency ? dependencies[matchedDependency] : void 0;
1157
+ return matchedDependency ? dependencies[matchedDependency] : undefined;
1159
1158
  }
1160
1159
  async getVersion(dependency) {
1161
1160
  if (typeof dependency === "string" && _PackageManager.#cache[dependency]) {
@@ -1163,7 +1162,7 @@ var PackageManager = class _PackageManager {
1163
1162
  }
1164
1163
  const packageJSON = await this.getPackageJSON();
1165
1164
  if (!packageJSON) {
1166
- return void 0;
1165
+ return undefined;
1167
1166
  }
1168
1167
  return this.#match(packageJSON, dependency);
1169
1168
  }
@@ -1173,7 +1172,7 @@ var PackageManager = class _PackageManager {
1173
1172
  }
1174
1173
  const packageJSON = this.getPackageJSONSync();
1175
1174
  if (!packageJSON) {
1176
- return void 0;
1175
+ return undefined;
1177
1176
  }
1178
1177
  return this.#match(packageJSON, dependency);
1179
1178
  }
@@ -1206,15 +1205,15 @@ var PackageManager = class _PackageManager {
1206
1205
 
1207
1206
  Object.defineProperty(exports, "FileManager", {
1208
1207
  enumerable: true,
1209
- get: function () { return chunkHOFDXARN_cjs.FileManager; }
1208
+ get: function () { return chunkMYUGSVTP_cjs.FileManager; }
1210
1209
  });
1211
1210
  Object.defineProperty(exports, "getSource", {
1212
1211
  enumerable: true,
1213
- get: function () { return chunkHOFDXARN_cjs.getSource; }
1212
+ get: function () { return chunkMYUGSVTP_cjs.getSource; }
1214
1213
  });
1215
1214
  Object.defineProperty(exports, "processFiles", {
1216
1215
  enumerable: true,
1217
- get: function () { return chunkHOFDXARN_cjs.processFiles; }
1216
+ get: function () { return chunkMYUGSVTP_cjs.processFiles; }
1218
1217
  });
1219
1218
  exports.BaseGenerator = BaseGenerator;
1220
1219
  exports.PackageManager = PackageManager;