@kubb/core 3.10.7 → 3.10.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var chunkPLNVC6RC_cjs = require('./chunk-PLNVC6RC.cjs');
6
- var chunkH7WBARWY_cjs = require('./chunk-H7WBARWY.cjs');
7
- var chunkK7NAX5WN_cjs = require('./chunk-K7NAX5WN.cjs');
8
- var chunkTYHNMIVY_cjs = require('./chunk-TYHNMIVY.cjs');
9
- var chunkC6ZMCVRD_cjs = require('./chunk-C6ZMCVRD.cjs');
5
+ var chunkASNFY2P2_cjs = require('./chunk-ASNFY2P2.cjs');
6
+ var chunk4FC3UQ2A_cjs = require('./chunk-4FC3UQ2A.cjs');
7
+ var chunkXFTBW3ZJ_cjs = require('./chunk-XFTBW3ZJ.cjs');
8
+ var chunk56YJEKS3_cjs = require('./chunk-56YJEKS3.cjs');
9
+ var chunkGGXWIE3Q_cjs = require('./chunk-GGXWIE3Q.cjs');
10
10
  var path3 = require('path');
11
11
  var mod = require('module');
12
12
  var os = require('os');
@@ -24,19 +24,19 @@ var process2__default = /*#__PURE__*/_interopDefault(process2);
24
24
  var fs__default = /*#__PURE__*/_interopDefault(fs);
25
25
 
26
26
  // src/index.ts
27
- chunkC6ZMCVRD_cjs.init_cjs_shims();
27
+ chunkGGXWIE3Q_cjs.init_cjs_shims();
28
28
 
29
29
  // src/build.ts
30
- chunkC6ZMCVRD_cjs.init_cjs_shims();
30
+ chunkGGXWIE3Q_cjs.init_cjs_shims();
31
31
 
32
32
  // src/PluginManager.ts
33
- chunkC6ZMCVRD_cjs.init_cjs_shims();
33
+ chunkGGXWIE3Q_cjs.init_cjs_shims();
34
34
 
35
35
  // src/PromiseManager.ts
36
- chunkC6ZMCVRD_cjs.init_cjs_shims();
36
+ chunkGGXWIE3Q_cjs.init_cjs_shims();
37
37
 
38
38
  // src/utils/executeStrategies.ts
39
- chunkC6ZMCVRD_cjs.init_cjs_shims();
39
+ chunkGGXWIE3Q_cjs.init_cjs_shims();
40
40
  function hookSeq(promises) {
41
41
  return promises.filter(Boolean).reduce(
42
42
  (promise, func) => {
@@ -97,12 +97,12 @@ function isPromiseRejectedResult(result) {
97
97
  }
98
98
 
99
99
  // src/errors.ts
100
- chunkC6ZMCVRD_cjs.init_cjs_shims();
100
+ chunkGGXWIE3Q_cjs.init_cjs_shims();
101
101
  var ValidationPluginError = class extends Error {
102
102
  };
103
103
 
104
104
  // src/plugin.ts
105
- chunkC6ZMCVRD_cjs.init_cjs_shims();
105
+ chunkGGXWIE3Q_cjs.init_cjs_shims();
106
106
  function createPlugin(factory) {
107
107
  return (options = {}) => {
108
108
  return factory(options);
@@ -153,7 +153,7 @@ var pluginCore = createPlugin((options) => {
153
153
  var PluginManager = class {
154
154
  plugins = /* @__PURE__ */ new Set();
155
155
  fileManager;
156
- events = new chunkPLNVC6RC_cjs.EventEmitter();
156
+ events = new chunkASNFY2P2_cjs.EventEmitter();
157
157
  config;
158
158
  executed = [];
159
159
  logger;
@@ -165,7 +165,7 @@ var PluginManager = class {
165
165
  this.config = config;
166
166
  this.options = options;
167
167
  this.logger = options.logger;
168
- this.fileManager = new chunkH7WBARWY_cjs.FileManager();
168
+ this.fileManager = new chunk4FC3UQ2A_cjs.FileManager();
169
169
  this.#promiseManager = new PromiseManager({
170
170
  nullCheck: (state) => !!state?.result
171
171
  });
@@ -235,7 +235,7 @@ Falling back on the first item.
235
235
  const names = this.hookForPluginSync({
236
236
  pluginKey: params.pluginKey,
237
237
  hookName: "resolveName",
238
- parameters: [chunkK7NAX5WN_cjs.trim(params.name), params.type],
238
+ parameters: [chunkXFTBW3ZJ_cjs.trim(params.name), params.type],
239
239
  message: `Resolving name '${params.name}' and type '${params.type}'`
240
240
  });
241
241
  if (names && names?.length > 1) {
@@ -251,14 +251,14 @@ Falling back on the first item.
251
251
  ]
252
252
  });
253
253
  }
254
- return chunkK7NAX5WN_cjs.transformReservedWord(names?.at(0) || params.name);
254
+ return chunkXFTBW3ZJ_cjs.transformReservedWord(names?.at(0) || params.name);
255
255
  }
256
256
  const name = this.hookFirstSync({
257
257
  hookName: "resolveName",
258
- parameters: [chunkK7NAX5WN_cjs.trim(params.name), params.type],
258
+ parameters: [chunkXFTBW3ZJ_cjs.trim(params.name), params.type],
259
259
  message: `Resolving name '${params.name}' and type '${params.type}'`
260
260
  }).result;
261
- return chunkK7NAX5WN_cjs.transformReservedWord(name);
261
+ return chunkXFTBW3ZJ_cjs.transformReservedWord(name);
262
262
  };
263
263
  /**
264
264
  * Instead of calling `pluginManager.events.on` you can use `pluginManager.on`. This one also has better types.
@@ -596,7 +596,7 @@ Falling back on the first item.
596
596
  }
597
597
  #parse(plugin, pluginManager, context) {
598
598
  const usedPluginNames = pluginManager.#usedPluginNames;
599
- chunkH7WBARWY_cjs.setUniqueName(plugin.name, usedPluginNames);
599
+ chunk4FC3UQ2A_cjs.setUniqueName(plugin.name, usedPluginNames);
600
600
  const key = [plugin.name, usedPluginNames[plugin.name]].filter(Boolean);
601
601
  if (plugin.context && typeof plugin.context === "function") {
602
602
  return {
@@ -631,7 +631,7 @@ Falling back on the first item.
631
631
  };
632
632
 
633
633
  // src/config.ts
634
- chunkC6ZMCVRD_cjs.init_cjs_shims();
634
+ chunkGGXWIE3Q_cjs.init_cjs_shims();
635
635
  function defineConfig(options) {
636
636
  return options;
637
637
  }
@@ -642,10 +642,10 @@ async function setup(options) {
642
642
  if (options.pluginManager) {
643
643
  return options.pluginManager;
644
644
  }
645
- const { config: userConfig, logger = chunkPLNVC6RC_cjs.createLogger() } = options;
645
+ const { config: userConfig, logger = chunkASNFY2P2_cjs.createLogger() } = options;
646
646
  try {
647
- if (isInputPath(userConfig) && !new chunkH7WBARWY_cjs.URLPath(userConfig.input.path).isURL) {
648
- await chunkTYHNMIVY_cjs.read(userConfig.input.path);
647
+ if (isInputPath(userConfig) && !new chunk4FC3UQ2A_cjs.URLPath(userConfig.input.path).isURL) {
648
+ await chunk56YJEKS3_cjs.read(userConfig.input.path);
649
649
  }
650
650
  } catch (e) {
651
651
  if (isInputPath(userConfig)) {
@@ -672,8 +672,8 @@ async function setup(options) {
672
672
  plugins: userConfig.plugins
673
673
  };
674
674
  if (definedConfig.output.clean) {
675
- await chunkTYHNMIVY_cjs.clean(definedConfig.output.path);
676
- await chunkTYHNMIVY_cjs.clean(path3.join(definedConfig.root, ".kubb"));
675
+ await chunk56YJEKS3_cjs.clean(definedConfig.output.path);
676
+ await chunk56YJEKS3_cjs.clean(path3.join(definedConfig.root, ".kubb"));
677
677
  }
678
678
  return new PluginManager(definedConfig, { logger });
679
679
  }
@@ -729,7 +729,7 @@ async function safeBuild(options) {
729
729
  }
730
730
  return {
731
731
  name: config.output.barrelType === "all" ? void 0 : [source.name],
732
- path: chunkTYHNMIVY_cjs.getRelativePath(rootPath, file.path),
732
+ path: chunk56YJEKS3_cjs.getRelativePath(rootPath, file.path),
733
733
  isTypeOnly: config.output.barrelType === "all" ? containsOnlyTypes : source.isTypeOnly
734
734
  };
735
735
  }).filter(Boolean);
@@ -740,7 +740,7 @@ async function safeBuild(options) {
740
740
  if (config.output.barrelType) {
741
741
  await pluginManager.fileManager.add(rootFile);
742
742
  }
743
- files = await chunkH7WBARWY_cjs.processFiles({
743
+ files = await chunk4FC3UQ2A_cjs.processFiles({
744
744
  root: config.root,
745
745
  extension: config.output.extension,
746
746
  dryRun: !config.output.write,
@@ -763,7 +763,7 @@ async function safeBuild(options) {
763
763
  }
764
764
 
765
765
  // src/BaseGenerator.ts
766
- chunkC6ZMCVRD_cjs.init_cjs_shims();
766
+ chunkGGXWIE3Q_cjs.init_cjs_shims();
767
767
  var BaseGenerator = class {
768
768
  #options = {};
769
769
  #context = {};
@@ -788,22 +788,22 @@ var BaseGenerator = class {
788
788
  };
789
789
 
790
790
  // src/PackageManager.ts
791
- chunkC6ZMCVRD_cjs.init_cjs_shims();
791
+ chunkGGXWIE3Q_cjs.init_cjs_shims();
792
792
 
793
793
  // ../../node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js
794
- chunkC6ZMCVRD_cjs.init_cjs_shims();
794
+ chunkGGXWIE3Q_cjs.init_cjs_shims();
795
795
 
796
796
  // ../../node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js
797
- chunkC6ZMCVRD_cjs.init_cjs_shims();
797
+ chunkGGXWIE3Q_cjs.init_cjs_shims();
798
798
 
799
799
  // ../../node_modules/.pnpm/p-locate@6.0.0/node_modules/p-locate/index.js
800
- chunkC6ZMCVRD_cjs.init_cjs_shims();
800
+ chunkGGXWIE3Q_cjs.init_cjs_shims();
801
801
 
802
802
  // ../../node_modules/.pnpm/p-limit@4.0.0/node_modules/p-limit/index.js
803
- chunkC6ZMCVRD_cjs.init_cjs_shims();
803
+ chunkGGXWIE3Q_cjs.init_cjs_shims();
804
804
 
805
805
  // ../../node_modules/.pnpm/yocto-queue@1.1.1/node_modules/yocto-queue/index.js
806
- chunkC6ZMCVRD_cjs.init_cjs_shims();
806
+ chunkGGXWIE3Q_cjs.init_cjs_shims();
807
807
  var Node = class {
808
808
  value;
809
809
  next;
@@ -1001,13 +1001,13 @@ function locatePathSync(paths, {
1001
1001
  }
1002
1002
 
1003
1003
  // ../../node_modules/.pnpm/unicorn-magic@0.1.0/node_modules/unicorn-magic/node.js
1004
- chunkC6ZMCVRD_cjs.init_cjs_shims();
1004
+ chunkGGXWIE3Q_cjs.init_cjs_shims();
1005
1005
  function toPath2(urlOrPath) {
1006
1006
  return urlOrPath instanceof URL ? url.fileURLToPath(urlOrPath) : urlOrPath;
1007
1007
  }
1008
1008
 
1009
1009
  // ../../node_modules/.pnpm/path-exists@5.0.0/node_modules/path-exists/index.js
1010
- chunkC6ZMCVRD_cjs.init_cjs_shims();
1010
+ chunkGGXWIE3Q_cjs.init_cjs_shims();
1011
1011
 
1012
1012
  // ../../node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js
1013
1013
  var findUpStop = Symbol("findUpStop");
@@ -1133,7 +1133,7 @@ var PackageManager = class _PackageManager {
1133
1133
  if (!pkgPath) {
1134
1134
  return void 0;
1135
1135
  }
1136
- const json = await chunkTYHNMIVY_cjs.read(pkgPath);
1136
+ const json = await chunk56YJEKS3_cjs.read(pkgPath);
1137
1137
  return JSON.parse(json);
1138
1138
  }
1139
1139
  getPackageJSONSync() {
@@ -1143,7 +1143,7 @@ var PackageManager = class _PackageManager {
1143
1143
  if (!pkgPath) {
1144
1144
  return void 0;
1145
1145
  }
1146
- const json = chunkTYHNMIVY_cjs.readSync(pkgPath);
1146
+ const json = chunk56YJEKS3_cjs.readSync(pkgPath);
1147
1147
  return JSON.parse(json);
1148
1148
  }
1149
1149
  static setVersion(dependency, version) {
@@ -1212,19 +1212,19 @@ var PackageManager = class _PackageManager {
1212
1212
 
1213
1213
  Object.defineProperty(exports, "FileManager", {
1214
1214
  enumerable: true,
1215
- get: function () { return chunkH7WBARWY_cjs.FileManager; }
1215
+ get: function () { return chunk4FC3UQ2A_cjs.FileManager; }
1216
1216
  });
1217
1217
  Object.defineProperty(exports, "getDefaultBanner", {
1218
1218
  enumerable: true,
1219
- get: function () { return chunkH7WBARWY_cjs.getDefaultBanner; }
1219
+ get: function () { return chunk4FC3UQ2A_cjs.getDefaultBanner; }
1220
1220
  });
1221
1221
  Object.defineProperty(exports, "getSource", {
1222
1222
  enumerable: true,
1223
- get: function () { return chunkH7WBARWY_cjs.getSource; }
1223
+ get: function () { return chunk4FC3UQ2A_cjs.getSource; }
1224
1224
  });
1225
1225
  Object.defineProperty(exports, "processFiles", {
1226
1226
  enumerable: true,
1227
- get: function () { return chunkH7WBARWY_cjs.processFiles; }
1227
+ get: function () { return chunk4FC3UQ2A_cjs.processFiles; }
1228
1228
  });
1229
1229
  exports.BaseGenerator = BaseGenerator;
1230
1230
  exports.PackageManager = PackageManager;
package/dist/logger.cjs CHANGED
@@ -1,26 +1,26 @@
1
1
  'use strict';
2
2
 
3
- var chunkPLNVC6RC_cjs = require('./chunk-PLNVC6RC.cjs');
4
- require('./chunk-TYHNMIVY.cjs');
5
- require('./chunk-C6ZMCVRD.cjs');
3
+ var chunkASNFY2P2_cjs = require('./chunk-ASNFY2P2.cjs');
4
+ require('./chunk-56YJEKS3.cjs');
5
+ require('./chunk-GGXWIE3Q.cjs');
6
6
 
7
7
 
8
8
 
9
9
  Object.defineProperty(exports, "LogMapper", {
10
10
  enumerable: true,
11
- get: function () { return chunkPLNVC6RC_cjs.LogMapper; }
11
+ get: function () { return chunkASNFY2P2_cjs.LogMapper; }
12
12
  });
13
13
  Object.defineProperty(exports, "createLogger", {
14
14
  enumerable: true,
15
- get: function () { return chunkPLNVC6RC_cjs.createLogger; }
15
+ get: function () { return chunkASNFY2P2_cjs.createLogger; }
16
16
  });
17
17
  Object.defineProperty(exports, "randomCliColour", {
18
18
  enumerable: true,
19
- get: function () { return chunkPLNVC6RC_cjs.randomCliColour; }
19
+ get: function () { return chunkASNFY2P2_cjs.randomCliColour; }
20
20
  });
21
21
  Object.defineProperty(exports, "randomColour", {
22
22
  enumerable: true,
23
- get: function () { return chunkPLNVC6RC_cjs.randomColour; }
23
+ get: function () { return chunkASNFY2P2_cjs.randomColour; }
24
24
  });
25
25
  //# sourceMappingURL=logger.cjs.map
26
26
  //# sourceMappingURL=logger.cjs.map
package/dist/mocks.cjs CHANGED
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var chunkH7WBARWY_cjs = require('./chunk-H7WBARWY.cjs');
4
- var chunkK7NAX5WN_cjs = require('./chunk-K7NAX5WN.cjs');
5
- require('./chunk-TYHNMIVY.cjs');
6
- var chunkC6ZMCVRD_cjs = require('./chunk-C6ZMCVRD.cjs');
3
+ var chunk4FC3UQ2A_cjs = require('./chunk-4FC3UQ2A.cjs');
4
+ var chunkXFTBW3ZJ_cjs = require('./chunk-XFTBW3ZJ.cjs');
5
+ require('./chunk-56YJEKS3.cjs');
6
+ var chunkGGXWIE3Q_cjs = require('./chunk-GGXWIE3Q.cjs');
7
7
  var path = require('path');
8
8
 
9
9
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
@@ -11,7 +11,7 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
11
11
  var path__default = /*#__PURE__*/_interopDefault(path);
12
12
 
13
13
  // mocks/index.ts
14
- chunkC6ZMCVRD_cjs.init_cjs_shims();
14
+ chunkGGXWIE3Q_cjs.init_cjs_shims();
15
15
  var mockedLogger = {
16
16
  emit(_type, _message) {
17
17
  },
@@ -22,15 +22,15 @@ var mockedLogger = {
22
22
  var createMockedPluginManager = (name) => ({
23
23
  resolveName: (result) => {
24
24
  if (result.type === "file") {
25
- return chunkK7NAX5WN_cjs.camelCase(name || result.name);
25
+ return chunkXFTBW3ZJ_cjs.camelCase(name || result.name);
26
26
  }
27
27
  if (result.type === "type") {
28
- return chunkK7NAX5WN_cjs.pascalCase(result.name);
28
+ return chunkXFTBW3ZJ_cjs.pascalCase(result.name);
29
29
  }
30
30
  if (result.type === "function") {
31
- return chunkK7NAX5WN_cjs.camelCase(result.name);
31
+ return chunkXFTBW3ZJ_cjs.camelCase(result.name);
32
32
  }
33
- return chunkK7NAX5WN_cjs.camelCase(result.name);
33
+ return chunkXFTBW3ZJ_cjs.camelCase(result.name);
34
34
  },
35
35
  config: {
36
36
  output: {
@@ -66,7 +66,7 @@ async function matchFiles(files) {
66
66
  return void 0;
67
67
  }
68
68
  for await (const file of files) {
69
- const source = await chunkH7WBARWY_cjs.getSource(chunkH7WBARWY_cjs.createFile(file), { logger: mockedLogger });
69
+ const source = await chunk4FC3UQ2A_cjs.getSource(chunk4FC3UQ2A_cjs.createFile(file), { logger: mockedLogger });
70
70
  await expect(source).toMatchFileSnapshot(path__default.default.join("__snapshots__", file.path));
71
71
  }
72
72
  }
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkC6ZMCVRD_cjs = require('./chunk-C6ZMCVRD.cjs');
3
+ var chunkGGXWIE3Q_cjs = require('./chunk-GGXWIE3Q.cjs');
4
4
  require('util');
5
5
  var g = require('process');
6
6
  var f = require('readline');
@@ -12,7 +12,7 @@ var g__default = /*#__PURE__*/_interopDefault(g);
12
12
  var f__default = /*#__PURE__*/_interopDefault(f);
13
13
 
14
14
  // ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/chunks/prompt.mjs
15
- chunkC6ZMCVRD_cjs.init_cjs_shims();
15
+ chunkGGXWIE3Q_cjs.init_cjs_shims();
16
16
  function getDefaultExportFromCjs(x2) {
17
17
  return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
18
18
  }
@@ -759,5 +759,5 @@ async function prompt(message, opts = {}) {
759
759
 
760
760
  exports.kCancel = kCancel;
761
761
  exports.prompt = prompt;
762
- //# sourceMappingURL=prompt-7UC6AUNR.cjs.map
763
- //# sourceMappingURL=prompt-7UC6AUNR.cjs.map
762
+ //# sourceMappingURL=prompt-SB4H4DMO.cjs.map
763
+ //# sourceMappingURL=prompt-SB4H4DMO.cjs.map