@kubb/core 3.14.0 → 3.14.3

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 chunkAHJUF7XY_cjs = require('./chunk-AHJUF7XY.cjs');
6
- var chunkSWGRVXDA_cjs = require('./chunk-SWGRVXDA.cjs');
7
- var chunkBGQLAB22_cjs = require('./chunk-BGQLAB22.cjs');
8
- var chunk5FMXBQIM_cjs = require('./chunk-5FMXBQIM.cjs');
9
- var chunkXYYJ47OY_cjs = require('./chunk-XYYJ47OY.cjs');
5
+ var chunk3GAXFWD7_cjs = require('./chunk-3GAXFWD7.cjs');
6
+ var chunkNK3PFGI7_cjs = require('./chunk-NK3PFGI7.cjs');
7
+ var chunkTEEWO6UV_cjs = require('./chunk-TEEWO6UV.cjs');
8
+ var chunkTC37PFUL_cjs = require('./chunk-TC37PFUL.cjs');
9
+ var chunkKZOJCFA7_cjs = require('./chunk-KZOJCFA7.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
- chunkXYYJ47OY_cjs.init_cjs_shims();
27
+ chunkKZOJCFA7_cjs.init_cjs_shims();
28
28
 
29
29
  // src/build.ts
30
- chunkXYYJ47OY_cjs.init_cjs_shims();
30
+ chunkKZOJCFA7_cjs.init_cjs_shims();
31
31
 
32
32
  // src/PluginManager.ts
33
- chunkXYYJ47OY_cjs.init_cjs_shims();
33
+ chunkKZOJCFA7_cjs.init_cjs_shims();
34
34
 
35
35
  // src/PromiseManager.ts
36
- chunkXYYJ47OY_cjs.init_cjs_shims();
36
+ chunkKZOJCFA7_cjs.init_cjs_shims();
37
37
 
38
38
  // src/utils/executeStrategies.ts
39
- chunkXYYJ47OY_cjs.init_cjs_shims();
39
+ chunkKZOJCFA7_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
- chunkXYYJ47OY_cjs.init_cjs_shims();
100
+ chunkKZOJCFA7_cjs.init_cjs_shims();
101
101
  var ValidationPluginError = class extends Error {
102
102
  };
103
103
 
104
104
  // src/plugin.ts
105
- chunkXYYJ47OY_cjs.init_cjs_shims();
105
+ chunkKZOJCFA7_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 chunkAHJUF7XY_cjs.EventEmitter();
156
+ events = new chunk3GAXFWD7_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 chunkSWGRVXDA_cjs.FileManager();
168
+ this.fileManager = new chunkNK3PFGI7_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: [chunkBGQLAB22_cjs.trim(params.name), params.type],
238
+ parameters: [chunkTEEWO6UV_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 chunkBGQLAB22_cjs.transformReservedWord(names?.at(0) || params.name);
254
+ return chunkTEEWO6UV_cjs.transformReservedWord(names?.at(0) || params.name);
255
255
  }
256
256
  const name = this.hookFirstSync({
257
257
  hookName: "resolveName",
258
- parameters: [chunkBGQLAB22_cjs.trim(params.name), params.type],
258
+ parameters: [chunkTEEWO6UV_cjs.trim(params.name), params.type],
259
259
  message: `Resolving name '${params.name}' and type '${params.type}'`
260
260
  }).result;
261
- return chunkBGQLAB22_cjs.transformReservedWord(name);
261
+ return chunkTEEWO6UV_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
- chunkSWGRVXDA_cjs.setUniqueName(plugin.name, usedPluginNames);
599
+ chunkNK3PFGI7_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
- chunkXYYJ47OY_cjs.init_cjs_shims();
634
+ chunkKZOJCFA7_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 = chunkAHJUF7XY_cjs.createLogger() } = options;
645
+ const { config: userConfig, logger = chunk3GAXFWD7_cjs.createLogger() } = options;
646
646
  try {
647
- if (isInputPath(userConfig) && !new chunkSWGRVXDA_cjs.URLPath(userConfig.input.path).isURL) {
648
- await chunk5FMXBQIM_cjs.read(userConfig.input.path);
647
+ if (isInputPath(userConfig) && !new chunkNK3PFGI7_cjs.URLPath(userConfig.input.path).isURL) {
648
+ await chunkTC37PFUL_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 chunk5FMXBQIM_cjs.clean(definedConfig.output.path);
676
- await chunk5FMXBQIM_cjs.clean(path3.join(definedConfig.root, ".kubb"));
675
+ await chunkTC37PFUL_cjs.clean(definedConfig.output.path);
676
+ await chunkTC37PFUL_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: chunk5FMXBQIM_cjs.getRelativePath(rootPath, file.path),
732
+ path: chunkTC37PFUL_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 chunkSWGRVXDA_cjs.processFiles({
743
+ files = await chunkNK3PFGI7_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
- chunkXYYJ47OY_cjs.init_cjs_shims();
766
+ chunkKZOJCFA7_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
- chunkXYYJ47OY_cjs.init_cjs_shims();
791
+ chunkKZOJCFA7_cjs.init_cjs_shims();
792
792
 
793
793
  // ../../node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js
794
- chunkXYYJ47OY_cjs.init_cjs_shims();
794
+ chunkKZOJCFA7_cjs.init_cjs_shims();
795
795
 
796
796
  // ../../node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js
797
- chunkXYYJ47OY_cjs.init_cjs_shims();
797
+ chunkKZOJCFA7_cjs.init_cjs_shims();
798
798
 
799
799
  // ../../node_modules/.pnpm/p-locate@6.0.0/node_modules/p-locate/index.js
800
- chunkXYYJ47OY_cjs.init_cjs_shims();
800
+ chunkKZOJCFA7_cjs.init_cjs_shims();
801
801
 
802
802
  // ../../node_modules/.pnpm/p-limit@4.0.0/node_modules/p-limit/index.js
803
- chunkXYYJ47OY_cjs.init_cjs_shims();
803
+ chunkKZOJCFA7_cjs.init_cjs_shims();
804
804
 
805
805
  // ../../node_modules/.pnpm/yocto-queue@1.1.1/node_modules/yocto-queue/index.js
806
- chunkXYYJ47OY_cjs.init_cjs_shims();
806
+ chunkKZOJCFA7_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
- chunkXYYJ47OY_cjs.init_cjs_shims();
1004
+ chunkKZOJCFA7_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
- chunkXYYJ47OY_cjs.init_cjs_shims();
1010
+ chunkKZOJCFA7_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 chunk5FMXBQIM_cjs.read(pkgPath);
1136
+ const json = await chunkTC37PFUL_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 = chunk5FMXBQIM_cjs.readSync(pkgPath);
1146
+ const json = chunkTC37PFUL_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 chunkSWGRVXDA_cjs.FileManager; }
1215
+ get: function () { return chunkNK3PFGI7_cjs.FileManager; }
1216
1216
  });
1217
1217
  Object.defineProperty(exports, "getDefaultBanner", {
1218
1218
  enumerable: true,
1219
- get: function () { return chunkSWGRVXDA_cjs.getDefaultBanner; }
1219
+ get: function () { return chunkNK3PFGI7_cjs.getDefaultBanner; }
1220
1220
  });
1221
1221
  Object.defineProperty(exports, "getSource", {
1222
1222
  enumerable: true,
1223
- get: function () { return chunkSWGRVXDA_cjs.getSource; }
1223
+ get: function () { return chunkNK3PFGI7_cjs.getSource; }
1224
1224
  });
1225
1225
  Object.defineProperty(exports, "processFiles", {
1226
1226
  enumerable: true,
1227
- get: function () { return chunkSWGRVXDA_cjs.processFiles; }
1227
+ get: function () { return chunkNK3PFGI7_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 chunkAHJUF7XY_cjs = require('./chunk-AHJUF7XY.cjs');
4
- require('./chunk-5FMXBQIM.cjs');
5
- require('./chunk-XYYJ47OY.cjs');
3
+ var chunk3GAXFWD7_cjs = require('./chunk-3GAXFWD7.cjs');
4
+ require('./chunk-TC37PFUL.cjs');
5
+ require('./chunk-KZOJCFA7.cjs');
6
6
 
7
7
 
8
8
 
9
9
  Object.defineProperty(exports, "LogMapper", {
10
10
  enumerable: true,
11
- get: function () { return chunkAHJUF7XY_cjs.LogMapper; }
11
+ get: function () { return chunk3GAXFWD7_cjs.LogMapper; }
12
12
  });
13
13
  Object.defineProperty(exports, "createLogger", {
14
14
  enumerable: true,
15
- get: function () { return chunkAHJUF7XY_cjs.createLogger; }
15
+ get: function () { return chunk3GAXFWD7_cjs.createLogger; }
16
16
  });
17
17
  Object.defineProperty(exports, "randomCliColour", {
18
18
  enumerable: true,
19
- get: function () { return chunkAHJUF7XY_cjs.randomCliColour; }
19
+ get: function () { return chunk3GAXFWD7_cjs.randomCliColour; }
20
20
  });
21
21
  Object.defineProperty(exports, "randomColour", {
22
22
  enumerable: true,
23
- get: function () { return chunkAHJUF7XY_cjs.randomColour; }
23
+ get: function () { return chunk3GAXFWD7_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 chunkSWGRVXDA_cjs = require('./chunk-SWGRVXDA.cjs');
4
- var chunkBGQLAB22_cjs = require('./chunk-BGQLAB22.cjs');
5
- require('./chunk-5FMXBQIM.cjs');
6
- var chunkXYYJ47OY_cjs = require('./chunk-XYYJ47OY.cjs');
3
+ var chunkNK3PFGI7_cjs = require('./chunk-NK3PFGI7.cjs');
4
+ var chunkTEEWO6UV_cjs = require('./chunk-TEEWO6UV.cjs');
5
+ require('./chunk-TC37PFUL.cjs');
6
+ var chunkKZOJCFA7_cjs = require('./chunk-KZOJCFA7.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
  // src/mocks/index.ts
14
- chunkXYYJ47OY_cjs.init_cjs_shims();
14
+ chunkKZOJCFA7_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 chunkBGQLAB22_cjs.camelCase(name || result.name);
25
+ return chunkTEEWO6UV_cjs.camelCase(name || result.name);
26
26
  }
27
27
  if (result.type === "type") {
28
- return chunkBGQLAB22_cjs.pascalCase(result.name);
28
+ return chunkTEEWO6UV_cjs.pascalCase(result.name);
29
29
  }
30
30
  if (result.type === "function") {
31
- return chunkBGQLAB22_cjs.camelCase(result.name);
31
+ return chunkTEEWO6UV_cjs.camelCase(result.name);
32
32
  }
33
- return chunkBGQLAB22_cjs.camelCase(result.name);
33
+ return chunkTEEWO6UV_cjs.camelCase(result.name);
34
34
  },
35
35
  config: {
36
36
  output: {
@@ -66,7 +66,7 @@ async function matchFiles(files, pre) {
66
66
  return void 0;
67
67
  }
68
68
  for await (const file of files) {
69
- const source = await chunkSWGRVXDA_cjs.getSource(chunkSWGRVXDA_cjs.createFile(file), { logger: mockedLogger });
69
+ const source = await chunkNK3PFGI7_cjs.getSource(chunkNK3PFGI7_cjs.createFile(file), { logger: mockedLogger });
70
70
  await expect(source).toMatchFileSnapshot(path__default.default.join(...["__snapshots__", pre, file.path].filter(Boolean)));
71
71
  }
72
72
  }
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkXYYJ47OY_cjs = require('./chunk-XYYJ47OY.cjs');
3
+ var chunkKZOJCFA7_cjs = require('./chunk-KZOJCFA7.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
- chunkXYYJ47OY_cjs.init_cjs_shims();
15
+ chunkKZOJCFA7_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-D3TJH7LL.cjs.map
763
- //# sourceMappingURL=prompt-D3TJH7LL.cjs.map
762
+ //# sourceMappingURL=prompt-55FJQYBV.cjs.map
763
+ //# sourceMappingURL=prompt-55FJQYBV.cjs.map