@kubb/core 3.3.4 → 3.4.0

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 (39) hide show
  1. package/dist/chunk-3CLNO5VR.js +1086 -0
  2. package/dist/chunk-3CLNO5VR.js.map +1 -0
  3. package/dist/{chunk-T3JE2UXN.cjs → chunk-4ZMRID7I.cjs} +11 -11
  4. package/dist/{chunk-T3JE2UXN.cjs.map → chunk-4ZMRID7I.cjs.map} +1 -1
  5. package/dist/{chunk-MJJ7HASG.cjs → chunk-6ZGRP6P7.cjs} +17 -17
  6. package/dist/{chunk-MJJ7HASG.cjs.map → chunk-6ZGRP6P7.cjs.map} +1 -1
  7. package/dist/{chunk-N2GBH2C5.cjs → chunk-IZ2EOWIL.cjs} +4 -4
  8. package/dist/{chunk-N2GBH2C5.cjs.map → chunk-IZ2EOWIL.cjs.map} +1 -1
  9. package/dist/{chunk-HTOO3HNK.js → chunk-OL5US75J.js} +3 -3
  10. package/dist/{chunk-HTOO3HNK.js.map → chunk-OL5US75J.js.map} +1 -1
  11. package/dist/chunk-P4ATJPSP.cjs +1124 -0
  12. package/dist/chunk-P4ATJPSP.cjs.map +1 -0
  13. package/dist/{chunk-QQNAR6NN.cjs → chunk-PWNHY2QL.cjs} +36 -36
  14. package/dist/chunk-PWNHY2QL.cjs.map +1 -0
  15. package/dist/{chunk-HHIGUHMQ.js → chunk-U7VFDKAD.js} +3 -3
  16. package/dist/chunk-U7VFDKAD.js.map +1 -0
  17. package/dist/index.cjs +35 -35
  18. package/dist/index.js +4 -4
  19. package/dist/logger.cjs +7 -7
  20. package/dist/logger.js +2 -2
  21. package/dist/mocks.cjs +9 -9
  22. package/dist/mocks.js +1 -1
  23. package/dist/{prompt-WQQUN22Z.js → prompt-Y6ROOH2L.js} +393 -294
  24. package/dist/prompt-Y6ROOH2L.js.map +1 -0
  25. package/dist/{prompt-EJQPAE7T.cjs → prompt-ZJNX5QEM.cjs} +454 -354
  26. package/dist/prompt-ZJNX5QEM.cjs.map +1 -0
  27. package/dist/transformers.cjs +23 -23
  28. package/dist/utils.cjs +17 -17
  29. package/dist/utils.js +1 -1
  30. package/package.json +8 -8
  31. package/src/utils/parser.ts +1 -1
  32. package/dist/chunk-HBQM723K.js +0 -1049
  33. package/dist/chunk-HBQM723K.js.map +0 -1
  34. package/dist/chunk-HHIGUHMQ.js.map +0 -1
  35. package/dist/chunk-QQNAR6NN.cjs.map +0 -1
  36. package/dist/chunk-S4E6TU6G.cjs +0 -1088
  37. package/dist/chunk-S4E6TU6G.cjs.map +0 -1
  38. package/dist/prompt-EJQPAE7T.cjs.map +0 -1
  39. package/dist/prompt-WQQUN22Z.js.map +0 -1
package/dist/index.cjs CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var chunkT3JE2UXN_cjs = require('./chunk-T3JE2UXN.cjs');
6
- var chunkQQNAR6NN_cjs = require('./chunk-QQNAR6NN.cjs');
7
- var chunkMJJ7HASG_cjs = require('./chunk-MJJ7HASG.cjs');
8
- require('./chunk-S4E6TU6G.cjs');
9
- var chunkN2GBH2C5_cjs = require('./chunk-N2GBH2C5.cjs');
5
+ var chunk4ZMRID7I_cjs = require('./chunk-4ZMRID7I.cjs');
6
+ var chunkPWNHY2QL_cjs = require('./chunk-PWNHY2QL.cjs');
7
+ var chunk6ZGRP6P7_cjs = require('./chunk-6ZGRP6P7.cjs');
8
+ require('./chunk-P4ATJPSP.cjs');
9
+ var chunkIZ2EOWIL_cjs = require('./chunk-IZ2EOWIL.cjs');
10
10
  var fs = require('@kubb/fs');
11
11
  var path3 = require('path');
12
12
  var mod = require('module');
@@ -25,19 +25,19 @@ var process__default = /*#__PURE__*/_interopDefault(process);
25
25
  var fs__default = /*#__PURE__*/_interopDefault(fs$1);
26
26
 
27
27
  // src/index.ts
28
- chunkN2GBH2C5_cjs.init_cjs_shims();
28
+ chunkIZ2EOWIL_cjs.init_cjs_shims();
29
29
 
30
30
  // src/build.ts
31
- chunkN2GBH2C5_cjs.init_cjs_shims();
31
+ chunkIZ2EOWIL_cjs.init_cjs_shims();
32
32
 
33
33
  // src/PluginManager.ts
34
- chunkN2GBH2C5_cjs.init_cjs_shims();
34
+ chunkIZ2EOWIL_cjs.init_cjs_shims();
35
35
 
36
36
  // src/PromiseManager.ts
37
- chunkN2GBH2C5_cjs.init_cjs_shims();
37
+ chunkIZ2EOWIL_cjs.init_cjs_shims();
38
38
 
39
39
  // src/utils/executeStrategies.ts
40
- chunkN2GBH2C5_cjs.init_cjs_shims();
40
+ chunkIZ2EOWIL_cjs.init_cjs_shims();
41
41
  function hookSeq(promises) {
42
42
  return promises.filter(Boolean).reduce(
43
43
  (promise, func) => {
@@ -99,12 +99,12 @@ function isPromiseRejectedResult(result) {
99
99
  }
100
100
 
101
101
  // src/errors.ts
102
- chunkN2GBH2C5_cjs.init_cjs_shims();
102
+ chunkIZ2EOWIL_cjs.init_cjs_shims();
103
103
  var ValidationPluginError = class extends Error {
104
104
  };
105
105
 
106
106
  // src/plugin.ts
107
- chunkN2GBH2C5_cjs.init_cjs_shims();
107
+ chunkIZ2EOWIL_cjs.init_cjs_shims();
108
108
  function createPlugin(factory) {
109
109
  return (options = {}) => {
110
110
  return factory(options);
@@ -155,7 +155,7 @@ var pluginCore = createPlugin((options) => {
155
155
  var PluginManager = class {
156
156
  plugins = /* @__PURE__ */ new Set();
157
157
  fileManager;
158
- events = new chunkT3JE2UXN_cjs.EventEmitter();
158
+ events = new chunk4ZMRID7I_cjs.EventEmitter();
159
159
  config;
160
160
  executed = [];
161
161
  logger;
@@ -167,7 +167,7 @@ var PluginManager = class {
167
167
  this.config = config;
168
168
  this.options = options;
169
169
  this.logger = options.logger;
170
- this.fileManager = new chunkQQNAR6NN_cjs.FileManager();
170
+ this.fileManager = new chunkPWNHY2QL_cjs.FileManager();
171
171
  this.#promiseManager = new PromiseManager({
172
172
  nullCheck: (state) => !!state?.result
173
173
  });
@@ -237,7 +237,7 @@ Falling back on the first item.
237
237
  const names = this.hookForPluginSync({
238
238
  pluginKey: params.pluginKey,
239
239
  hookName: "resolveName",
240
- parameters: [chunkMJJ7HASG_cjs.trim(params.name), params.type],
240
+ parameters: [chunk6ZGRP6P7_cjs.trim(params.name), params.type],
241
241
  message: `Resolving name '${params.name}' and type '${params.type}'`
242
242
  });
243
243
  if (names && names?.length > 1) {
@@ -253,14 +253,14 @@ Falling back on the first item.
253
253
  ]
254
254
  });
255
255
  }
256
- return chunkMJJ7HASG_cjs.transformReservedWord(names?.at(0) || params.name);
256
+ return chunk6ZGRP6P7_cjs.transformReservedWord(names?.at(0) || params.name);
257
257
  }
258
258
  const name = this.hookFirstSync({
259
259
  hookName: "resolveName",
260
- parameters: [chunkMJJ7HASG_cjs.trim(params.name), params.type],
260
+ parameters: [chunk6ZGRP6P7_cjs.trim(params.name), params.type],
261
261
  message: `Resolving name '${params.name}' and type '${params.type}'`
262
262
  }).result;
263
- return chunkMJJ7HASG_cjs.transformReservedWord(name);
263
+ return chunk6ZGRP6P7_cjs.transformReservedWord(name);
264
264
  };
265
265
  /**
266
266
  * Instead of calling `pluginManager.events.on` you can use `pluginManager.on`. This one also has better types.
@@ -590,7 +590,7 @@ Falling back on the first item.
590
590
  }
591
591
  #parse(plugin, pluginManager, context) {
592
592
  const usedPluginNames = pluginManager.#usedPluginNames;
593
- chunkQQNAR6NN_cjs.setUniqueName(plugin.name, usedPluginNames);
593
+ chunkPWNHY2QL_cjs.setUniqueName(plugin.name, usedPluginNames);
594
594
  const key = [plugin.name, usedPluginNames[plugin.name]].filter(Boolean);
595
595
  if (plugin.context && typeof plugin.context === "function") {
596
596
  return {
@@ -625,7 +625,7 @@ Falling back on the first item.
625
625
  };
626
626
 
627
627
  // src/config.ts
628
- chunkN2GBH2C5_cjs.init_cjs_shims();
628
+ chunkIZ2EOWIL_cjs.init_cjs_shims();
629
629
  function defineConfig(options) {
630
630
  return options;
631
631
  }
@@ -633,9 +633,9 @@ function isInputPath(result) {
633
633
  return !!result && "path" in result?.input;
634
634
  }
635
635
  async function setup(options) {
636
- const { config, logger = chunkT3JE2UXN_cjs.createLogger() } = options;
636
+ const { config, logger = chunk4ZMRID7I_cjs.createLogger() } = options;
637
637
  try {
638
- if (isInputPath(config) && !new chunkQQNAR6NN_cjs.URLPath(config.input.path).isURL) {
638
+ if (isInputPath(config) && !new chunkPWNHY2QL_cjs.URLPath(config.input.path).isURL) {
639
639
  await fs.read(config.input.path);
640
640
  }
641
641
  } catch (e) {
@@ -713,7 +713,7 @@ async function safeBuild(options) {
713
713
  if (options.config.output.barrelType) {
714
714
  await pluginManager.fileManager.add(rootFile);
715
715
  }
716
- files = await chunkQQNAR6NN_cjs.processFiles({
716
+ files = await chunkPWNHY2QL_cjs.processFiles({
717
717
  root: options.config.root,
718
718
  extension: options.config.output.extension,
719
719
  dryRun: !options.config.output.write,
@@ -736,7 +736,7 @@ async function safeBuild(options) {
736
736
  }
737
737
 
738
738
  // src/BaseGenerator.ts
739
- chunkN2GBH2C5_cjs.init_cjs_shims();
739
+ chunkIZ2EOWIL_cjs.init_cjs_shims();
740
740
  var BaseGenerator = class {
741
741
  #options = {};
742
742
  #context = {};
@@ -761,22 +761,22 @@ var BaseGenerator = class {
761
761
  };
762
762
 
763
763
  // src/PackageManager.ts
764
- chunkN2GBH2C5_cjs.init_cjs_shims();
764
+ chunkIZ2EOWIL_cjs.init_cjs_shims();
765
765
 
766
766
  // ../../node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js
767
- chunkN2GBH2C5_cjs.init_cjs_shims();
767
+ chunkIZ2EOWIL_cjs.init_cjs_shims();
768
768
 
769
769
  // ../../node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js
770
- chunkN2GBH2C5_cjs.init_cjs_shims();
770
+ chunkIZ2EOWIL_cjs.init_cjs_shims();
771
771
 
772
772
  // ../../node_modules/.pnpm/p-locate@6.0.0/node_modules/p-locate/index.js
773
- chunkN2GBH2C5_cjs.init_cjs_shims();
773
+ chunkIZ2EOWIL_cjs.init_cjs_shims();
774
774
 
775
775
  // ../../node_modules/.pnpm/p-limit@4.0.0/node_modules/p-limit/index.js
776
- chunkN2GBH2C5_cjs.init_cjs_shims();
776
+ chunkIZ2EOWIL_cjs.init_cjs_shims();
777
777
 
778
778
  // ../../node_modules/.pnpm/yocto-queue@1.1.1/node_modules/yocto-queue/index.js
779
- chunkN2GBH2C5_cjs.init_cjs_shims();
779
+ chunkIZ2EOWIL_cjs.init_cjs_shims();
780
780
  var Node = class {
781
781
  value;
782
782
  next;
@@ -974,13 +974,13 @@ function locatePathSync(paths, {
974
974
  }
975
975
 
976
976
  // ../../node_modules/.pnpm/unicorn-magic@0.1.0/node_modules/unicorn-magic/node.js
977
- chunkN2GBH2C5_cjs.init_cjs_shims();
977
+ chunkIZ2EOWIL_cjs.init_cjs_shims();
978
978
  function toPath2(urlOrPath) {
979
979
  return urlOrPath instanceof URL ? url.fileURLToPath(urlOrPath) : urlOrPath;
980
980
  }
981
981
 
982
982
  // ../../node_modules/.pnpm/path-exists@5.0.0/node_modules/path-exists/index.js
983
- chunkN2GBH2C5_cjs.init_cjs_shims();
983
+ chunkIZ2EOWIL_cjs.init_cjs_shims();
984
984
 
985
985
  // ../../node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js
986
986
  var findUpStop = Symbol("findUpStop");
@@ -1182,15 +1182,15 @@ var PackageManager = class _PackageManager {
1182
1182
 
1183
1183
  Object.defineProperty(exports, "FileManager", {
1184
1184
  enumerable: true,
1185
- get: function () { return chunkQQNAR6NN_cjs.FileManager; }
1185
+ get: function () { return chunkPWNHY2QL_cjs.FileManager; }
1186
1186
  });
1187
1187
  Object.defineProperty(exports, "getSource", {
1188
1188
  enumerable: true,
1189
- get: function () { return chunkQQNAR6NN_cjs.getSource; }
1189
+ get: function () { return chunkPWNHY2QL_cjs.getSource; }
1190
1190
  });
1191
1191
  Object.defineProperty(exports, "processFiles", {
1192
1192
  enumerable: true,
1193
- get: function () { return chunkQQNAR6NN_cjs.processFiles; }
1193
+ get: function () { return chunkPWNHY2QL_cjs.processFiles; }
1194
1194
  });
1195
1195
  exports.BaseGenerator = BaseGenerator;
1196
1196
  exports.PackageManager = PackageManager;
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
- import { EventEmitter, createLogger } from './chunk-HTOO3HNK.js';
2
- import { FileManager, setUniqueName, processFiles, URLPath } from './chunk-HHIGUHMQ.js';
3
- export { FileManager, getSource, processFiles } from './chunk-HHIGUHMQ.js';
1
+ import { EventEmitter, createLogger } from './chunk-OL5US75J.js';
2
+ import { FileManager, setUniqueName, processFiles, URLPath } from './chunk-U7VFDKAD.js';
3
+ export { FileManager, getSource, processFiles } from './chunk-U7VFDKAD.js';
4
4
  import { trim, transformReservedWord } from './chunk-MDXPT7LL.js';
5
- import './chunk-HBQM723K.js';
5
+ import './chunk-3CLNO5VR.js';
6
6
  import { getRelativePath, read, readSync, clean } from '@kubb/fs';
7
7
  import path, { resolve, join } from 'node:path';
8
8
  import mod from 'node:module';
package/dist/logger.cjs CHANGED
@@ -1,26 +1,26 @@
1
1
  'use strict';
2
2
 
3
- var chunkT3JE2UXN_cjs = require('./chunk-T3JE2UXN.cjs');
4
- require('./chunk-S4E6TU6G.cjs');
5
- require('./chunk-N2GBH2C5.cjs');
3
+ var chunk4ZMRID7I_cjs = require('./chunk-4ZMRID7I.cjs');
4
+ require('./chunk-P4ATJPSP.cjs');
5
+ require('./chunk-IZ2EOWIL.cjs');
6
6
 
7
7
 
8
8
 
9
9
  Object.defineProperty(exports, "LogMapper", {
10
10
  enumerable: true,
11
- get: function () { return chunkT3JE2UXN_cjs.LogMapper; }
11
+ get: function () { return chunk4ZMRID7I_cjs.LogMapper; }
12
12
  });
13
13
  Object.defineProperty(exports, "createLogger", {
14
14
  enumerable: true,
15
- get: function () { return chunkT3JE2UXN_cjs.createLogger; }
15
+ get: function () { return chunk4ZMRID7I_cjs.createLogger; }
16
16
  });
17
17
  Object.defineProperty(exports, "randomCliColour", {
18
18
  enumerable: true,
19
- get: function () { return chunkT3JE2UXN_cjs.randomCliColour; }
19
+ get: function () { return chunk4ZMRID7I_cjs.randomCliColour; }
20
20
  });
21
21
  Object.defineProperty(exports, "randomColour", {
22
22
  enumerable: true,
23
- get: function () { return chunkT3JE2UXN_cjs.randomColour; }
23
+ get: function () { return chunk4ZMRID7I_cjs.randomColour; }
24
24
  });
25
25
  //# sourceMappingURL=logger.cjs.map
26
26
  //# sourceMappingURL=logger.cjs.map
package/dist/logger.js CHANGED
@@ -1,4 +1,4 @@
1
- export { LogMapper, createLogger, randomCliColour, randomColour } from './chunk-HTOO3HNK.js';
2
- import './chunk-HBQM723K.js';
1
+ export { LogMapper, createLogger, randomCliColour, randomColour } from './chunk-OL5US75J.js';
2
+ import './chunk-3CLNO5VR.js';
3
3
  //# sourceMappingURL=logger.js.map
4
4
  //# sourceMappingURL=logger.js.map
package/dist/mocks.cjs CHANGED
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var chunkQQNAR6NN_cjs = require('./chunk-QQNAR6NN.cjs');
4
- var chunkMJJ7HASG_cjs = require('./chunk-MJJ7HASG.cjs');
5
- var chunkN2GBH2C5_cjs = require('./chunk-N2GBH2C5.cjs');
3
+ var chunkPWNHY2QL_cjs = require('./chunk-PWNHY2QL.cjs');
4
+ var chunk6ZGRP6P7_cjs = require('./chunk-6ZGRP6P7.cjs');
5
+ var chunkIZ2EOWIL_cjs = require('./chunk-IZ2EOWIL.cjs');
6
6
  var path = require('path');
7
7
 
8
8
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
@@ -10,7 +10,7 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
10
10
  var path__default = /*#__PURE__*/_interopDefault(path);
11
11
 
12
12
  // mocks/index.ts
13
- chunkN2GBH2C5_cjs.init_cjs_shims();
13
+ chunkIZ2EOWIL_cjs.init_cjs_shims();
14
14
  var mockedLogger = {
15
15
  emit(type, message) {
16
16
  },
@@ -21,15 +21,15 @@ var mockedLogger = {
21
21
  var createMockedPluginManager = (name) => ({
22
22
  resolveName: (result) => {
23
23
  if (result.type === "file") {
24
- return chunkMJJ7HASG_cjs.camelCase(name || result.name);
24
+ return chunk6ZGRP6P7_cjs.camelCase(name || result.name);
25
25
  }
26
26
  if (result.type === "type") {
27
- return chunkMJJ7HASG_cjs.pascalCase(result.name);
27
+ return chunk6ZGRP6P7_cjs.pascalCase(result.name);
28
28
  }
29
29
  if (result.type === "function") {
30
- return chunkMJJ7HASG_cjs.camelCase(result.name);
30
+ return chunk6ZGRP6P7_cjs.camelCase(result.name);
31
31
  }
32
- return chunkMJJ7HASG_cjs.camelCase(result.name);
32
+ return chunk6ZGRP6P7_cjs.camelCase(result.name);
33
33
  },
34
34
  config: {
35
35
  output: {
@@ -62,7 +62,7 @@ async function matchFiles(files) {
62
62
  return void 0;
63
63
  }
64
64
  for (const file of files) {
65
- const source = await chunkQQNAR6NN_cjs.getSource(chunkQQNAR6NN_cjs.createFile(file), { logger: mockedLogger });
65
+ const source = await chunkPWNHY2QL_cjs.getSource(chunkPWNHY2QL_cjs.createFile(file), { logger: mockedLogger });
66
66
  expect(source).toMatchFileSnapshot(path__default.default.join("__snapshots__", file.path));
67
67
  }
68
68
  }
package/dist/mocks.js CHANGED
@@ -1,4 +1,4 @@
1
- import { getSource, createFile } from './chunk-HHIGUHMQ.js';
1
+ import { getSource, createFile } from './chunk-U7VFDKAD.js';
2
2
  import { camelCase, pascalCase } from './chunk-MDXPT7LL.js';
3
3
  import path from 'node:path';
4
4