@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.
@@ -29,14 +29,14 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
29
29
  mod
30
30
  ));
31
31
 
32
- // ../../node_modules/.pnpm/tsup@8.5.0_@microsoft+api-extractor@7.52.8_@types+node@20.19.4__jiti@2.4.2_postcss@8.5.6_typescript@5.8.3_yaml@2.7.1/node_modules/tsup/assets/cjs_shims.js
32
+ // ../../node_modules/.pnpm/tsup@8.5.0_@microsoft+api-extractor@7.52.8_@types+node@20.19.6__jiti@2.4.2_postcss@8.5.6_typescript@5.8.3_yaml@2.7.1/node_modules/tsup/assets/cjs_shims.js
33
33
  var init_cjs_shims = __esm({
34
- "../../node_modules/.pnpm/tsup@8.5.0_@microsoft+api-extractor@7.52.8_@types+node@20.19.4__jiti@2.4.2_postcss@8.5.6_typescript@5.8.3_yaml@2.7.1/node_modules/tsup/assets/cjs_shims.js"() {
34
+ "../../node_modules/.pnpm/tsup@8.5.0_@microsoft+api-extractor@7.52.8_@types+node@20.19.6__jiti@2.4.2_postcss@8.5.6_typescript@5.8.3_yaml@2.7.1/node_modules/tsup/assets/cjs_shims.js"() {
35
35
  }
36
36
  });
37
37
 
38
38
  exports.__commonJS = __commonJS;
39
39
  exports.__toESM = __toESM;
40
40
  exports.init_cjs_shims = init_cjs_shims;
41
- //# sourceMappingURL=chunk-XYYJ47OY.cjs.map
42
- //# sourceMappingURL=chunk-XYYJ47OY.cjs.map
41
+ //# sourceMappingURL=chunk-KZOJCFA7.cjs.map
42
+ //# sourceMappingURL=chunk-KZOJCFA7.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../node_modules/.pnpm/tsup@8.5.0_@microsoft+api-extractor@7.52.8_@types+node@20.19.4__jiti@2.4.2_postcss@8.5.6_typescript@5.8.3_yaml@2.7.1/node_modules/tsup/assets/cjs_shims.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA,cAAA,GAAA,KAAA,CAAA;AAAA,EAAA,qLAAA,GAAA;AAAA;AAAA,CAAA","file":"chunk-XYYJ47OY.cjs","sourcesContent":["// Shim globals in cjs bundle\n// There's a weird bug that esbuild will always inject importMetaUrl\n// if we export it as `const importMetaUrl = ... __filename ...`\n// But using a function will not cause this issue\n\nconst getImportMetaUrl = () =>\n typeof document === 'undefined'\n ? new URL(`file:${__filename}`).href\n : (document.currentScript && document.currentScript.src) ||\n new URL('main.js', document.baseURI).href\n\nexport const importMetaUrl = /* @__PURE__ */ getImportMetaUrl()\n"]}
1
+ {"version":3,"sources":["../../../node_modules/.pnpm/tsup@8.5.0_@microsoft+api-extractor@7.52.8_@types+node@20.19.6__jiti@2.4.2_postcss@8.5.6_typescript@5.8.3_yaml@2.7.1/node_modules/tsup/assets/cjs_shims.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA,cAAA,GAAA,KAAA,CAAA;AAAA,EAAA,qLAAA,GAAA;AAAA;AAAA,CAAA","file":"chunk-KZOJCFA7.cjs","sourcesContent":["// Shim globals in cjs bundle\n// There's a weird bug that esbuild will always inject importMetaUrl\n// if we export it as `const importMetaUrl = ... __filename ...`\n// But using a function will not cause this issue\n\nconst getImportMetaUrl = () =>\n typeof document === 'undefined'\n ? new URL(`file:${__filename}`).href\n : (document.currentScript && document.currentScript.src) ||\n new URL('main.js', document.baseURI).href\n\nexport const importMetaUrl = /* @__PURE__ */ getImportMetaUrl()\n"]}
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var chunkBGQLAB22_cjs = require('./chunk-BGQLAB22.cjs');
4
- var chunk5FMXBQIM_cjs = require('./chunk-5FMXBQIM.cjs');
5
- var chunkXYYJ47OY_cjs = require('./chunk-XYYJ47OY.cjs');
3
+ var chunkTEEWO6UV_cjs = require('./chunk-TEEWO6UV.cjs');
4
+ var chunkTC37PFUL_cjs = require('./chunk-TC37PFUL.cjs');
5
+ var chunkKZOJCFA7_cjs = require('./chunk-KZOJCFA7.cjs');
6
6
  var path = require('path');
7
7
  var hash = require('object-hash');
8
8
  var remeda = require('remeda');
@@ -13,9 +13,9 @@ var path__default = /*#__PURE__*/_interopDefault(path);
13
13
  var hash__default = /*#__PURE__*/_interopDefault(hash);
14
14
 
15
15
  // ../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.js
16
- var require_eventemitter3 = chunkXYYJ47OY_cjs.__commonJS({
16
+ var require_eventemitter3 = chunkKZOJCFA7_cjs.__commonJS({
17
17
  "../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.js"(exports, module) {
18
- chunkXYYJ47OY_cjs.init_cjs_shims();
18
+ chunkKZOJCFA7_cjs.init_cjs_shims();
19
19
  var has = Object.prototype.hasOwnProperty;
20
20
  var prefix = "~";
21
21
  function Events() {
@@ -175,10 +175,10 @@ var require_eventemitter3 = chunkXYYJ47OY_cjs.__commonJS({
175
175
  });
176
176
 
177
177
  // src/utils/index.ts
178
- chunkXYYJ47OY_cjs.init_cjs_shims();
178
+ chunkKZOJCFA7_cjs.init_cjs_shims();
179
179
 
180
180
  // src/utils/FunctionParams.ts
181
- chunkXYYJ47OY_cjs.init_cjs_shims();
181
+ chunkKZOJCFA7_cjs.init_cjs_shims();
182
182
  var FunctionParams = class _FunctionParams {
183
183
  #items = [];
184
184
  constructor() {
@@ -199,7 +199,7 @@ var FunctionParams = class _FunctionParams {
199
199
  return this;
200
200
  }
201
201
  static #orderItems(items) {
202
- return chunkBGQLAB22_cjs.orderBy(
202
+ return chunkTEEWO6UV_cjs.orderBy(
203
203
  items.filter(Boolean),
204
204
  [
205
205
  (v) => {
@@ -227,7 +227,7 @@ var FunctionParams = class _FunctionParams {
227
227
  acc.push(`${type}${rest.default ? ` = ${rest.default}` : ""}`);
228
228
  return acc;
229
229
  }
230
- const parameterName = name.startsWith("{") ? name : chunkBGQLAB22_cjs.camelCase(name);
230
+ const parameterName = name.startsWith("{") ? name : chunkTEEWO6UV_cjs.camelCase(name);
231
231
  if (type) {
232
232
  if (required) {
233
233
  acc.push(`${parameterName}: ${type}${rest.default ? ` = ${rest.default}` : ""}`);
@@ -282,7 +282,7 @@ var FunctionParams = class _FunctionParams {
282
282
  };
283
283
 
284
284
  // src/utils/promise.ts
285
- chunkXYYJ47OY_cjs.init_cjs_shims();
285
+ chunkKZOJCFA7_cjs.init_cjs_shims();
286
286
  function isPromise(result) {
287
287
  return !!result && typeof result?.then === "function";
288
288
  }
@@ -294,7 +294,7 @@ function isPromiseRejectedResult(result) {
294
294
  }
295
295
 
296
296
  // src/utils/renderTemplate.ts
297
- chunkXYYJ47OY_cjs.init_cjs_shims();
297
+ chunkKZOJCFA7_cjs.init_cjs_shims();
298
298
  function renderTemplate(template, data = void 0) {
299
299
  if (!data || !Object.keys(data).length) {
300
300
  return template.replace(/{{(.*?)}}/g, "");
@@ -319,7 +319,7 @@ function renderTemplate(template, data = void 0) {
319
319
  }
320
320
 
321
321
  // src/utils/timeout.ts
322
- chunkXYYJ47OY_cjs.init_cjs_shims();
322
+ chunkKZOJCFA7_cjs.init_cjs_shims();
323
323
  async function timeout(ms) {
324
324
  return new Promise((resolve) => {
325
325
  setTimeout(() => {
@@ -329,7 +329,7 @@ async function timeout(ms) {
329
329
  }
330
330
 
331
331
  // src/utils/uniqueName.ts
332
- chunkXYYJ47OY_cjs.init_cjs_shims();
332
+ chunkKZOJCFA7_cjs.init_cjs_shims();
333
333
  function getUniqueName(originalName, data) {
334
334
  let used = data[originalName] || 0;
335
335
  if (used) {
@@ -350,7 +350,7 @@ function setUniqueName(originalName, data) {
350
350
  }
351
351
 
352
352
  // src/utils/URLPath.ts
353
- chunkXYYJ47OY_cjs.init_cjs_shims();
353
+ chunkKZOJCFA7_cjs.init_cjs_shims();
354
354
  var URLPath = class {
355
355
  path;
356
356
  #options;
@@ -421,9 +421,9 @@ var URLPath = class {
421
421
  if (found) {
422
422
  newPath = found.reduce((prev, path2) => {
423
423
  const pathWithoutBrackets = path2.replaceAll("{", "").replaceAll("}", "");
424
- let param = chunkBGQLAB22_cjs.isValidVarName(pathWithoutBrackets) ? pathWithoutBrackets : chunkBGQLAB22_cjs.camelCase(pathWithoutBrackets);
424
+ let param = chunkTEEWO6UV_cjs.isValidVarName(pathWithoutBrackets) ? pathWithoutBrackets : chunkTEEWO6UV_cjs.camelCase(pathWithoutBrackets);
425
425
  if (this.#options.casing === "camelcase") {
426
- param = chunkBGQLAB22_cjs.camelCase(param);
426
+ param = chunkTEEWO6UV_cjs.camelCase(param);
427
427
  }
428
428
  return prev.replace(path2, `\${${replacer ? replacer(param) : param}}`);
429
429
  }, this.path);
@@ -439,9 +439,9 @@ var URLPath = class {
439
439
  const params = {};
440
440
  found.forEach((item) => {
441
441
  item = item.replaceAll("{", "").replaceAll("}", "");
442
- let param = chunkBGQLAB22_cjs.isValidVarName(item) ? item : chunkBGQLAB22_cjs.camelCase(item);
442
+ let param = chunkTEEWO6UV_cjs.isValidVarName(item) ? item : chunkTEEWO6UV_cjs.camelCase(item);
443
443
  if (this.#options.casing === "camelcase") {
444
- param = chunkBGQLAB22_cjs.camelCase(param);
444
+ param = chunkTEEWO6UV_cjs.camelCase(param);
445
445
  }
446
446
  const key = replacer ? replacer(param) : param;
447
447
  params[key] = key;
@@ -458,20 +458,20 @@ var URLPath = class {
458
458
  };
459
459
 
460
460
  // src/utils/parser.ts
461
- chunkXYYJ47OY_cjs.init_cjs_shims();
461
+ chunkKZOJCFA7_cjs.init_cjs_shims();
462
462
 
463
463
  // src/FileManager.ts
464
- chunkXYYJ47OY_cjs.init_cjs_shims();
464
+ chunkKZOJCFA7_cjs.init_cjs_shims();
465
465
 
466
466
  // ../../node_modules/.pnpm/p-queue@8.1.0/node_modules/p-queue/dist/index.js
467
- chunkXYYJ47OY_cjs.init_cjs_shims();
467
+ chunkKZOJCFA7_cjs.init_cjs_shims();
468
468
 
469
469
  // ../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.mjs
470
- chunkXYYJ47OY_cjs.init_cjs_shims();
471
- var import_index = chunkXYYJ47OY_cjs.__toESM(require_eventemitter3(), 1);
470
+ chunkKZOJCFA7_cjs.init_cjs_shims();
471
+ var import_index = chunkKZOJCFA7_cjs.__toESM(require_eventemitter3(), 1);
472
472
 
473
473
  // ../../node_modules/.pnpm/p-timeout@6.1.3/node_modules/p-timeout/index.js
474
- chunkXYYJ47OY_cjs.init_cjs_shims();
474
+ chunkKZOJCFA7_cjs.init_cjs_shims();
475
475
  var TimeoutError = class extends Error {
476
476
  constructor(message) {
477
477
  super(message);
@@ -560,10 +560,10 @@ function pTimeout(promise, options) {
560
560
  }
561
561
 
562
562
  // ../../node_modules/.pnpm/p-queue@8.1.0/node_modules/p-queue/dist/priority-queue.js
563
- chunkXYYJ47OY_cjs.init_cjs_shims();
563
+ chunkKZOJCFA7_cjs.init_cjs_shims();
564
564
 
565
565
  // ../../node_modules/.pnpm/p-queue@8.1.0/node_modules/p-queue/dist/lower-bound.js
566
- chunkXYYJ47OY_cjs.init_cjs_shims();
566
+ chunkKZOJCFA7_cjs.init_cjs_shims();
567
567
  function lowerBound(array, value, comparator) {
568
568
  let first = 0;
569
569
  let count = array.length;
@@ -956,10 +956,10 @@ var PQueue = class extends import_index.default {
956
956
  };
957
957
 
958
958
  // src/BarrelManager.ts
959
- chunkXYYJ47OY_cjs.init_cjs_shims();
959
+ chunkKZOJCFA7_cjs.init_cjs_shims();
960
960
 
961
961
  // src/utils/TreeNode.ts
962
- chunkXYYJ47OY_cjs.init_cjs_shims();
962
+ chunkKZOJCFA7_cjs.init_cjs_shims();
963
963
  var TreeNode = class _TreeNode {
964
964
  data;
965
965
  parent;
@@ -1172,7 +1172,7 @@ File: ${JSON.stringify(item.data.file, void 0, 2)}`
1172
1172
  if (isSubExport) {
1173
1173
  barrelFile.exports.push({
1174
1174
  name: [source.name],
1175
- path: chunk5FMXBQIM_cjs.getRelativePath(treeNode.parent?.data.path, item.data.path),
1175
+ path: chunkTC37PFUL_cjs.getRelativePath(treeNode.parent?.data.path, item.data.path),
1176
1176
  isTypeOnly: source.isTypeOnly
1177
1177
  });
1178
1178
  } else {
@@ -1195,13 +1195,13 @@ File: ${JSON.stringify(item.data.file, void 0, 2)}`
1195
1195
  logger?.emit("debug", {
1196
1196
  date: /* @__PURE__ */ new Date(),
1197
1197
  logs: [
1198
- `Generating barrelFile '${chunk5FMXBQIM_cjs.getRelativePath(root, barrelFile.path)}' for '${chunk5FMXBQIM_cjs.getRelativePath(root, treeNode.data?.path)}' with ${barrelFile.sources.length} indexable exports: '${barrelFile.sources?.map((source) => source.name).join(", ")}'`
1198
+ `Generating barrelFile '${chunkTC37PFUL_cjs.getRelativePath(root, barrelFile.path)}' for '${chunkTC37PFUL_cjs.getRelativePath(root, treeNode.data?.path)}' with ${barrelFile.sources.length} indexable exports: '${barrelFile.sources?.map((source) => source.name).join(", ")}'`
1199
1199
  ]
1200
1200
  });
1201
1201
  logger?.emit("debug", {
1202
1202
  date: /* @__PURE__ */ new Date(),
1203
1203
  logs: [
1204
- `Generated barrelFile '${chunk5FMXBQIM_cjs.getRelativePath(root, barrelFile.path)}' for '${chunk5FMXBQIM_cjs.getRelativePath(root, treeNode.data?.path)}' with exports: '${cachedFiles.get(barrelFile.path)?.sources?.map((source) => source.name).join(", ")}'`
1204
+ `Generated barrelFile '${chunkTC37PFUL_cjs.getRelativePath(root, barrelFile.path)}' for '${chunkTC37PFUL_cjs.getRelativePath(root, treeNode.data?.path)}' with exports: '${cachedFiles.get(barrelFile.path)?.sources?.map((source) => source.name).join(", ")}'`
1205
1205
  ]
1206
1206
  });
1207
1207
  if (previousBarrelFile) {
@@ -1225,13 +1225,13 @@ var FileManager = class {
1225
1225
  return [...this.#filesByPath.values()];
1226
1226
  }
1227
1227
  get orderedFiles() {
1228
- return chunkBGQLAB22_cjs.orderBy(
1228
+ return chunkTEEWO6UV_cjs.orderBy(
1229
1229
  [...this.#filesByPath.values()],
1230
1230
  [
1231
1231
  (v) => v?.meta && "pluginKey" in v.meta && !v.meta.pluginKey,
1232
1232
  (v) => v.path.length,
1233
- (v) => chunk5FMXBQIM_cjs.trimExtName(v.path).endsWith("index"),
1234
- (v) => chunk5FMXBQIM_cjs.trimExtName(v.baseName),
1233
+ (v) => chunkTC37PFUL_cjs.trimExtName(v.path).endsWith("index"),
1234
+ (v) => chunkTC37PFUL_cjs.trimExtName(v.baseName),
1235
1235
  (v) => v.path.split(".").pop()
1236
1236
  ]
1237
1237
  );
@@ -1290,7 +1290,7 @@ var FileManager = class {
1290
1290
  }
1291
1291
  const barrelManager = new BarrelManager({ logger });
1292
1292
  const pathToBuildFrom = path.join(root, output.path);
1293
- if (chunk5FMXBQIM_cjs.trimExtName(pathToBuildFrom).endsWith("index")) {
1293
+ if (chunkTC37PFUL_cjs.trimExtName(pathToBuildFrom).endsWith("index")) {
1294
1294
  logger?.emit("warning", "Output has the same fileName as the barrelFiles, please disable barrel generation");
1295
1295
  return [];
1296
1296
  }
@@ -1316,10 +1316,10 @@ var FileManager = class {
1316
1316
  });
1317
1317
  }
1318
1318
  async write(...params) {
1319
- return chunk5FMXBQIM_cjs.write(...params);
1319
+ return chunkTC37PFUL_cjs.write(...params);
1320
1320
  }
1321
1321
  async read(...params) {
1322
- return chunk5FMXBQIM_cjs.read(...params);
1322
+ return chunkTC37PFUL_cjs.read(...params);
1323
1323
  }
1324
1324
  // statics
1325
1325
  static getMode(path2) {
@@ -1349,12 +1349,12 @@ function combineSources(sources) {
1349
1349
  return remeda.uniqueBy(sources, (obj) => [obj.name, obj.isExportable, obj.isTypeOnly]);
1350
1350
  }
1351
1351
  function combineExports(exports) {
1352
- return chunkBGQLAB22_cjs.orderBy(exports, [
1352
+ return chunkTEEWO6UV_cjs.orderBy(exports, [
1353
1353
  (v) => !!Array.isArray(v.name),
1354
1354
  (v) => !v.isTypeOnly,
1355
1355
  (v) => v.path,
1356
1356
  (v) => !!v.name,
1357
- (v) => Array.isArray(v.name) ? chunkBGQLAB22_cjs.orderBy(v.name) : v.name
1357
+ (v) => Array.isArray(v.name) ? chunkTEEWO6UV_cjs.orderBy(v.name) : v.name
1358
1358
  ]).reduce(
1359
1359
  (prev, curr) => {
1360
1360
  const name = curr.name;
@@ -1388,12 +1388,12 @@ function combineExports(exports) {
1388
1388
  );
1389
1389
  }
1390
1390
  function combineImports(imports, exports, source) {
1391
- return chunkBGQLAB22_cjs.orderBy(imports, [
1391
+ return chunkTEEWO6UV_cjs.orderBy(imports, [
1392
1392
  (v) => !!Array.isArray(v.name),
1393
1393
  (v) => !v.isTypeOnly,
1394
1394
  (v) => v.path,
1395
1395
  (v) => !!v.name,
1396
- (v) => Array.isArray(v.name) ? chunkBGQLAB22_cjs.orderBy(v.name) : v.name
1396
+ (v) => Array.isArray(v.name) ? chunkTEEWO6UV_cjs.orderBy(v.name) : v.name
1397
1397
  ]).reduce(
1398
1398
  (prev, curr) => {
1399
1399
  let name = Array.isArray(curr.name) ? [...new Set(curr.name)] : curr.name;
@@ -1444,10 +1444,10 @@ function combineImports(imports, exports, source) {
1444
1444
  }
1445
1445
  var queue = new PQueue({ concurrency: 100 });
1446
1446
  async function processFiles({ dryRun, root, extension, logger, files }) {
1447
- const orderedFiles = chunkBGQLAB22_cjs.orderBy(files, [
1447
+ const orderedFiles = chunkTEEWO6UV_cjs.orderBy(files, [
1448
1448
  (v) => v?.meta && "pluginKey" in v.meta && !v.meta.pluginKey,
1449
1449
  (v) => v.path.length,
1450
- (v) => chunk5FMXBQIM_cjs.trimExtName(v.path).endsWith("index")
1450
+ (v) => chunkTC37PFUL_cjs.trimExtName(v.path).endsWith("index")
1451
1451
  ]);
1452
1452
  logger?.emit("debug", {
1453
1453
  date: /* @__PURE__ */ new Date(),
@@ -1462,7 +1462,7 @@ async function processFiles({ dryRun, root, extension, logger, files }) {
1462
1462
  const message = file ? `Writing ${path.relative(root, file.path)}` : "";
1463
1463
  const extname2 = extension?.[file.extname] || void 0;
1464
1464
  const source = await getSource(file, { logger, extname: extname2 });
1465
- await chunk5FMXBQIM_cjs.write(file.path, source, { sanity: false });
1465
+ await chunkTC37PFUL_cjs.write(file.path, source, { sanity: false });
1466
1466
  logger?.emit("progressed", { id: "files", message });
1467
1467
  });
1468
1468
  });
@@ -1554,7 +1554,7 @@ var typeScriptParser = createFileParser({
1554
1554
  const module = await import('@kubb/parser-ts');
1555
1555
  const source = file.sources.map((item) => item.value).join("\n\n");
1556
1556
  const importNodes = file.imports.map((item) => {
1557
- const importPath = item.root ? chunk5FMXBQIM_cjs.getRelativePath(item.root, item.path) : item.path;
1557
+ const importPath = item.root ? chunkTC37PFUL_cjs.getRelativePath(item.root, item.path) : item.path;
1558
1558
  const hasExtname = !!path__default.default.extname(importPath);
1559
1559
  return module.factory.createImportDeclaration({
1560
1560
  name: item.name,
@@ -1632,5 +1632,5 @@ exports.processFiles = processFiles;
1632
1632
  exports.renderTemplate = renderTemplate;
1633
1633
  exports.setUniqueName = setUniqueName;
1634
1634
  exports.timeout = timeout;
1635
- //# sourceMappingURL=chunk-SWGRVXDA.cjs.map
1636
- //# sourceMappingURL=chunk-SWGRVXDA.cjs.map
1635
+ //# sourceMappingURL=chunk-NK3PFGI7.cjs.map
1636
+ //# sourceMappingURL=chunk-NK3PFGI7.cjs.map