@kubb/core 5.5.6 → 5.6.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.
- package/dist/index.cjs +649 -301
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +175 -4
- package/dist/index.js +593 -247
- package/dist/index.js.map +1 -1
- package/dist/mocks.cjs +30 -47
- package/dist/mocks.cjs.map +1 -1
- package/dist/mocks.d.ts +1 -1
- package/dist/mocks.js +24 -41
- package/dist/mocks.js.map +1 -1
- package/dist/{usingCtx-C_vhSf7M.cjs → nodeCache-CllHsCcy.cjs} +101 -222
- package/dist/nodeCache-CllHsCcy.cjs.map +1 -0
- package/dist/{usingCtx-DdG2edpx.js → nodeCache-CumrOPh-.js} +101 -216
- package/dist/nodeCache-CumrOPh-.js.map +1 -0
- package/dist/{types-DNE8KVDT.d.ts → types-B-w6zShf.d.ts} +66 -296
- package/package.json +3 -2
- package/dist/usingCtx-C_vhSf7M.cjs.map +0 -1
- package/dist/usingCtx-DdG2edpx.js.map +0 -1
|
@@ -155,6 +155,21 @@ const runtime = new Runtime();
|
|
|
155
155
|
//#endregion
|
|
156
156
|
//#region ../../internals/utils/src/fs.ts
|
|
157
157
|
/**
|
|
158
|
+
* Resolves to `true` when the file or directory at `path` exists.
|
|
159
|
+
* Uses `Bun.file().exists()` when running under Bun, `fs.access` otherwise.
|
|
160
|
+
*
|
|
161
|
+
* @example
|
|
162
|
+
* ```ts
|
|
163
|
+
* if (await exists('./kubb.config.ts')) {
|
|
164
|
+
* const content = await read('./kubb.config.ts')
|
|
165
|
+
* }
|
|
166
|
+
* ```
|
|
167
|
+
*/
|
|
168
|
+
async function exists(path) {
|
|
169
|
+
if (runtime.isBun) return Bun.file(path).exists();
|
|
170
|
+
return (0, node_fs_promises.access)(path).then(() => true, () => false);
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
158
173
|
* Reads the file at `path` as a UTF-8 string.
|
|
159
174
|
* Uses `Bun.file().text()` when running under Bun, `fs.readFile` otherwise.
|
|
160
175
|
*
|
|
@@ -303,138 +318,6 @@ async function inParallel({ items, limit, run }) {
|
|
|
303
318
|
await Promise.all(Array.from({ length: Math.min(limit, items.length) }, () => worker()));
|
|
304
319
|
}
|
|
305
320
|
//#endregion
|
|
306
|
-
//#region src/constants.ts
|
|
307
|
-
/**
|
|
308
|
-
* Plugin `include` filter types that select operations directly. When one of these is set
|
|
309
|
-
* without a `schemaName` include, the generate phase pre-scans operations to compute the set
|
|
310
|
-
* of schemas they reach, so unreachable schemas can be pruned for that plugin.
|
|
311
|
-
*/
|
|
312
|
-
const OPERATION_FILTER_TYPES = /* @__PURE__ */ new Set([
|
|
313
|
-
"tag",
|
|
314
|
-
"operationId",
|
|
315
|
-
"path",
|
|
316
|
-
"method",
|
|
317
|
-
"contentType"
|
|
318
|
-
]);
|
|
319
|
-
/**
|
|
320
|
-
* Stable codes Kubb attaches to a `Diagnostic`. Each maps to a known failure mode
|
|
321
|
-
* and stays stable so it can be referenced in tooling and (later) docs. Reference
|
|
322
|
-
* these instead of inlining the string at a throw site.
|
|
323
|
-
*/
|
|
324
|
-
const diagnosticCode = {
|
|
325
|
-
/**
|
|
326
|
-
* Fallback for an unstructured error with no specific code.
|
|
327
|
-
*/
|
|
328
|
-
unknown: "KUBB_UNKNOWN",
|
|
329
|
-
/**
|
|
330
|
-
* The file or URL set as `input` could not be read.
|
|
331
|
-
*/
|
|
332
|
-
inputNotFound: "KUBB_INPUT_NOT_FOUND",
|
|
333
|
-
/**
|
|
334
|
-
* A URL set as `input` (or referenced by a `$ref`) answered with a 4xx or 5xx status
|
|
335
|
-
* instead of the document.
|
|
336
|
-
*/
|
|
337
|
-
inputRequestFailed: "KUBB_INPUT_REQUEST_FAILED",
|
|
338
|
-
/**
|
|
339
|
-
* A URL set as `input` (or referenced by a `$ref`) never answered, so the request failed
|
|
340
|
-
* before a status was returned.
|
|
341
|
-
*/
|
|
342
|
-
inputUnreachable: "KUBB_INPUT_UNREACHABLE",
|
|
343
|
-
/**
|
|
344
|
-
* An adapter was configured without an `input`.
|
|
345
|
-
*/
|
|
346
|
-
inputRequired: "KUBB_INPUT_REQUIRED",
|
|
347
|
-
/**
|
|
348
|
-
* `input` uses the v4 `{ path }` / `{ data }` wrapper, which v5 reads as a parsed
|
|
349
|
-
* document instead of a pointer to one.
|
|
350
|
-
*/
|
|
351
|
-
legacyInput: "KUBB_LEGACY_INPUT",
|
|
352
|
-
/**
|
|
353
|
-
* The parsed `input` carries no `openapi` or `swagger` version, so it is not a
|
|
354
|
-
* document the adapter can read.
|
|
355
|
-
*/
|
|
356
|
-
invalidDocument: "KUBB_INVALID_DOCUMENT",
|
|
357
|
-
/** The document fails OpenAPI schema validation. Reported as a warning. */
|
|
358
|
-
invalidSpec: "KUBB_INVALID_SPEC",
|
|
359
|
-
/**
|
|
360
|
-
* A `$ref` (or equivalent reference) could not be resolved in the source document.
|
|
361
|
-
*/
|
|
362
|
-
refNotFound: "KUBB_REF_NOT_FOUND",
|
|
363
|
-
/**
|
|
364
|
-
* A server variable value is not allowed by its `enum`.
|
|
365
|
-
*/
|
|
366
|
-
invalidServerVariable: "KUBB_INVALID_SERVER_VARIABLE",
|
|
367
|
-
/**
|
|
368
|
-
* A required plugin is missing from the config.
|
|
369
|
-
*/
|
|
370
|
-
pluginNotFound: "KUBB_PLUGIN_NOT_FOUND",
|
|
371
|
-
/**
|
|
372
|
-
* A plugin threw while generating.
|
|
373
|
-
*/
|
|
374
|
-
pluginFailed: "KUBB_PLUGIN_FAILED",
|
|
375
|
-
/**
|
|
376
|
-
* A plugin reported a non-fatal warning through `ctx.warn`.
|
|
377
|
-
*/
|
|
378
|
-
pluginWarning: "KUBB_PLUGIN_WARNING",
|
|
379
|
-
/**
|
|
380
|
-
* A plugin reported an informational message through `ctx.info`.
|
|
381
|
-
*/
|
|
382
|
-
pluginInfo: "KUBB_PLUGIN_INFO",
|
|
383
|
-
/**
|
|
384
|
-
* A schema uses a `format` Kubb does not map to a specific type. Reserved for
|
|
385
|
-
* adapters to emit as a `warning`.
|
|
386
|
-
*/
|
|
387
|
-
unsupportedFormat: "KUBB_UNSUPPORTED_FORMAT",
|
|
388
|
-
/**
|
|
389
|
-
* A referenced schema or operation is marked `deprecated`. Reserved for adapters
|
|
390
|
-
* to emit as an `info`.
|
|
391
|
-
*/
|
|
392
|
-
deprecated: "KUBB_DEPRECATED",
|
|
393
|
-
/**
|
|
394
|
-
* An adapter is required but the config has none. The build cannot read the input
|
|
395
|
-
* without one.
|
|
396
|
-
*/
|
|
397
|
-
adapterRequired: "KUBB_ADAPTER_REQUIRED",
|
|
398
|
-
/**
|
|
399
|
-
* A resolved output path escapes the output directory, which can stem from a path
|
|
400
|
-
* traversal in the spec or a misconfigured `group.name`.
|
|
401
|
-
*/
|
|
402
|
-
pathTraversal: "KUBB_PATH_TRAVERSAL",
|
|
403
|
-
/**
|
|
404
|
-
* `output.clean` is enabled but `output.path` resolves to the project root or a parent of it,
|
|
405
|
-
* so cleaning would delete kubb.config and every source file.
|
|
406
|
-
*/
|
|
407
|
-
cleanRoot: "KUBB_CLEAN_ROOT",
|
|
408
|
-
/**
|
|
409
|
-
* A plugin's options are invalid, for example `output.mode: 'file'` paired with a `group` option.
|
|
410
|
-
*/
|
|
411
|
-
invalidPluginOptions: "KUBB_INVALID_PLUGIN_OPTIONS",
|
|
412
|
-
/**
|
|
413
|
-
* A post-generate command (`output.postGenerate`) exited with a failure.
|
|
414
|
-
*/
|
|
415
|
-
postGenerateFailed: "KUBB_POST_GENERATE_FAILED",
|
|
416
|
-
/**
|
|
417
|
-
* The formatter pass over the generated files failed.
|
|
418
|
-
*/
|
|
419
|
-
formatFailed: "KUBB_FORMAT_FAILED",
|
|
420
|
-
/**
|
|
421
|
-
* The linter pass over the generated files failed.
|
|
422
|
-
*/
|
|
423
|
-
lintFailed: "KUBB_LINT_FAILED",
|
|
424
|
-
/**
|
|
425
|
-
* A barrel tries to re-export the same name from more than one module.
|
|
426
|
-
*/
|
|
427
|
-
barrelDuplicateExport: "KUBB_BARREL_DUPLICATE_EXPORT",
|
|
428
|
-
/**
|
|
429
|
-
* Not a failure. Carries a plugin's elapsed time, summed into the run total.
|
|
430
|
-
*/
|
|
431
|
-
performance: "KUBB_PERFORMANCE",
|
|
432
|
-
/**
|
|
433
|
-
* Not a failure. A newer Kubb version is available on npm.
|
|
434
|
-
*/
|
|
435
|
-
updateAvailable: "KUBB_UPDATE_AVAILABLE"
|
|
436
|
-
};
|
|
437
|
-
//#endregion
|
|
438
321
|
//#region src/Hookable.ts
|
|
439
322
|
/**
|
|
440
323
|
* Typed hook emitter that awaits all async listeners before resolving.
|
|
@@ -458,7 +341,7 @@ var Hookable = class {
|
|
|
458
341
|
#emitter = new node_events.EventEmitter();
|
|
459
342
|
/**
|
|
460
343
|
* Calls `hookName` and awaits all registered listeners sequentially.
|
|
461
|
-
* Throws if any listener rejects, wrapping the cause
|
|
344
|
+
* Throws if any listener rejects, wrapping the cause in an error that names the hook.
|
|
462
345
|
*
|
|
463
346
|
* @example
|
|
464
347
|
* ```ts
|
|
@@ -474,13 +357,7 @@ var Hookable = class {
|
|
|
474
357
|
for (const listener of listeners) try {
|
|
475
358
|
await listener(...hookArgs);
|
|
476
359
|
} catch (err) {
|
|
477
|
-
|
|
478
|
-
try {
|
|
479
|
-
serializedArgs = JSON.stringify(hookArgs);
|
|
480
|
-
} catch {
|
|
481
|
-
serializedArgs = String(hookArgs);
|
|
482
|
-
}
|
|
483
|
-
throw new Error(`Error in async listener for "${hookName}" with hookArgs ${serializedArgs}`, { cause: toError(err) });
|
|
360
|
+
throw new Error(`Error in async listener for "${hookName}"`, { cause: toError(err) });
|
|
484
361
|
}
|
|
485
362
|
}
|
|
486
363
|
/**
|
|
@@ -560,7 +437,65 @@ var Hookable = class {
|
|
|
560
437
|
}
|
|
561
438
|
};
|
|
562
439
|
//#endregion
|
|
563
|
-
//#region
|
|
440
|
+
//#region \0@oxc-project+runtime@0.148.0/helpers/esm/usingCtx.js
|
|
441
|
+
function _usingCtx() {
|
|
442
|
+
var r = "function" == typeof SuppressedError ? SuppressedError : function(r, e) {
|
|
443
|
+
var n = Error();
|
|
444
|
+
return n.name = "SuppressedError", n.error = r, n.suppressed = e, n;
|
|
445
|
+
};
|
|
446
|
+
var e = {};
|
|
447
|
+
var n = [];
|
|
448
|
+
function using(r, e) {
|
|
449
|
+
if (null != e) {
|
|
450
|
+
if (Object(e) !== e) throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");
|
|
451
|
+
if (r) var o = e[Symbol.asyncDispose || Symbol["for"]("Symbol.asyncDispose")];
|
|
452
|
+
if (void 0 === o && (o = e[Symbol.dispose || Symbol["for"]("Symbol.dispose")], r)) var t = o;
|
|
453
|
+
if ("function" != typeof o) throw new TypeError("Object is not disposable.");
|
|
454
|
+
t && (o = function o() {
|
|
455
|
+
try {
|
|
456
|
+
t.call(e);
|
|
457
|
+
} catch (r) {
|
|
458
|
+
return Promise.reject(r);
|
|
459
|
+
}
|
|
460
|
+
}), n.push({
|
|
461
|
+
v: e,
|
|
462
|
+
d: o,
|
|
463
|
+
a: r
|
|
464
|
+
});
|
|
465
|
+
} else r && n.push({
|
|
466
|
+
d: e,
|
|
467
|
+
a: r
|
|
468
|
+
});
|
|
469
|
+
return e;
|
|
470
|
+
}
|
|
471
|
+
return {
|
|
472
|
+
e,
|
|
473
|
+
u: using.bind(null, !1),
|
|
474
|
+
a: using.bind(null, !0),
|
|
475
|
+
d: function d() {
|
|
476
|
+
var o;
|
|
477
|
+
var t = this.e;
|
|
478
|
+
var s = 0;
|
|
479
|
+
function next() {
|
|
480
|
+
for (; o = n.pop();) try {
|
|
481
|
+
if (!o.a && 1 === s) return s = 0, n.push(o), Promise.resolve().then(next);
|
|
482
|
+
if (o.d) {
|
|
483
|
+
var r = o.d.call(o.v);
|
|
484
|
+
if (o.a) return s |= 2, Promise.resolve(r).then(next, err);
|
|
485
|
+
} else s |= 1;
|
|
486
|
+
} catch (r) {
|
|
487
|
+
return err(r);
|
|
488
|
+
}
|
|
489
|
+
if (1 === s) return t !== e ? Promise.reject(t) : Promise.resolve();
|
|
490
|
+
if (t !== e) throw t;
|
|
491
|
+
}
|
|
492
|
+
function err(n) {
|
|
493
|
+
return t = t !== e ? new r(n, t) : n, next();
|
|
494
|
+
}
|
|
495
|
+
return next();
|
|
496
|
+
}
|
|
497
|
+
};
|
|
498
|
+
}
|
|
564
499
|
function joinSources(file) {
|
|
565
500
|
return file.sources.map((source) => (0, _kubb_ast.extractStringsFromNodes)(source.nodes)).filter(Boolean).join("\n\n");
|
|
566
501
|
}
|
|
@@ -596,13 +531,7 @@ function isIndexPath(path) {
|
|
|
596
531
|
return path.endsWith("/index.ts") || path === "index.ts";
|
|
597
532
|
}
|
|
598
533
|
function compareFiles(a, b) {
|
|
599
|
-
|
|
600
|
-
if (lenDiff !== 0) return lenDiff;
|
|
601
|
-
const aIsIndex = isIndexPath(a.path);
|
|
602
|
-
const bIsIndex = isIndexPath(b.path);
|
|
603
|
-
if (aIsIndex && !bIsIndex) return 1;
|
|
604
|
-
if (!aIsIndex && bIsIndex) return -1;
|
|
605
|
-
return 0;
|
|
534
|
+
return a.path.length - b.path.length || Number(isIndexPath(a.path)) - Number(isIndexPath(b.path));
|
|
606
535
|
}
|
|
607
536
|
function isUnchanged({ stored, source, key, manifest }) {
|
|
608
537
|
if (stored === null) return false;
|
|
@@ -640,6 +569,25 @@ var FileManager = class {
|
|
|
640
569
|
upsert(...files) {
|
|
641
570
|
return this.#store(files, true);
|
|
642
571
|
}
|
|
572
|
+
/** Stores a generator result: a file array is upserted as is, an element renders through `renderer` first, falsy is a no-op. */
|
|
573
|
+
async dispatch({ result, renderer }) {
|
|
574
|
+
try {
|
|
575
|
+
var _usingCtx$1 = _usingCtx();
|
|
576
|
+
if (!result) return;
|
|
577
|
+
if (Array.isArray(result)) {
|
|
578
|
+
this.upsert(...result);
|
|
579
|
+
return;
|
|
580
|
+
}
|
|
581
|
+
if (!renderer) return;
|
|
582
|
+
const instance = _usingCtx$1.u(renderer());
|
|
583
|
+
await instance.render(result);
|
|
584
|
+
this.upsert(...instance.files);
|
|
585
|
+
} catch (_) {
|
|
586
|
+
_usingCtx$1.e = _;
|
|
587
|
+
} finally {
|
|
588
|
+
_usingCtx$1.d();
|
|
589
|
+
}
|
|
590
|
+
}
|
|
643
591
|
#store(files, mergeExisting) {
|
|
644
592
|
const batch = files.length > 1 ? this.#dedupe(files) : files;
|
|
645
593
|
const resolved = [];
|
|
@@ -660,16 +608,13 @@ var FileManager = class {
|
|
|
660
608
|
}
|
|
661
609
|
return [...seen.values()];
|
|
662
610
|
}
|
|
663
|
-
clear() {
|
|
664
|
-
this.#cache.clear();
|
|
665
|
-
this.#sorted = null;
|
|
666
|
-
}
|
|
667
611
|
/**
|
|
668
612
|
* Releases all stored files and clears every `hooks` listener. Called by the core after
|
|
669
613
|
* `kubb:build:end`.
|
|
670
614
|
*/
|
|
671
615
|
dispose() {
|
|
672
|
-
this.clear();
|
|
616
|
+
this.#cache.clear();
|
|
617
|
+
this.#sorted = null;
|
|
673
618
|
this.hooks.removeAllHooks();
|
|
674
619
|
}
|
|
675
620
|
/**
|
|
@@ -760,66 +705,6 @@ function createNodeCache() {
|
|
|
760
705
|
};
|
|
761
706
|
}
|
|
762
707
|
//#endregion
|
|
763
|
-
//#region \0@oxc-project+runtime@0.148.0/helpers/esm/usingCtx.js
|
|
764
|
-
function _usingCtx() {
|
|
765
|
-
var r = "function" == typeof SuppressedError ? SuppressedError : function(r, e) {
|
|
766
|
-
var n = Error();
|
|
767
|
-
return n.name = "SuppressedError", n.error = r, n.suppressed = e, n;
|
|
768
|
-
};
|
|
769
|
-
var e = {};
|
|
770
|
-
var n = [];
|
|
771
|
-
function using(r, e) {
|
|
772
|
-
if (null != e) {
|
|
773
|
-
if (Object(e) !== e) throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");
|
|
774
|
-
if (r) var o = e[Symbol.asyncDispose || Symbol["for"]("Symbol.asyncDispose")];
|
|
775
|
-
if (void 0 === o && (o = e[Symbol.dispose || Symbol["for"]("Symbol.dispose")], r)) var t = o;
|
|
776
|
-
if ("function" != typeof o) throw new TypeError("Object is not disposable.");
|
|
777
|
-
t && (o = function o() {
|
|
778
|
-
try {
|
|
779
|
-
t.call(e);
|
|
780
|
-
} catch (r) {
|
|
781
|
-
return Promise.reject(r);
|
|
782
|
-
}
|
|
783
|
-
}), n.push({
|
|
784
|
-
v: e,
|
|
785
|
-
d: o,
|
|
786
|
-
a: r
|
|
787
|
-
});
|
|
788
|
-
} else r && n.push({
|
|
789
|
-
d: e,
|
|
790
|
-
a: r
|
|
791
|
-
});
|
|
792
|
-
return e;
|
|
793
|
-
}
|
|
794
|
-
return {
|
|
795
|
-
e,
|
|
796
|
-
u: using.bind(null, !1),
|
|
797
|
-
a: using.bind(null, !0),
|
|
798
|
-
d: function d() {
|
|
799
|
-
var o;
|
|
800
|
-
var t = this.e;
|
|
801
|
-
var s = 0;
|
|
802
|
-
function next() {
|
|
803
|
-
for (; o = n.pop();) try {
|
|
804
|
-
if (!o.a && 1 === s) return s = 0, n.push(o), Promise.resolve().then(next);
|
|
805
|
-
if (o.d) {
|
|
806
|
-
var r = o.d.call(o.v);
|
|
807
|
-
if (o.a) return s |= 2, Promise.resolve(r).then(next, err);
|
|
808
|
-
} else s |= 1;
|
|
809
|
-
} catch (r) {
|
|
810
|
-
return err(r);
|
|
811
|
-
}
|
|
812
|
-
if (1 === s) return t !== e ? Promise.reject(t) : Promise.resolve();
|
|
813
|
-
if (t !== e) throw t;
|
|
814
|
-
}
|
|
815
|
-
function err(n) {
|
|
816
|
-
return t = t !== e ? new r(n, t) : n, next();
|
|
817
|
-
}
|
|
818
|
-
return next();
|
|
819
|
-
}
|
|
820
|
-
};
|
|
821
|
-
}
|
|
822
|
-
//#endregion
|
|
823
708
|
Object.defineProperty(exports, "FileManager", {
|
|
824
709
|
enumerable: true,
|
|
825
710
|
get: function() {
|
|
@@ -832,12 +717,6 @@ Object.defineProperty(exports, "Hookable", {
|
|
|
832
717
|
return Hookable;
|
|
833
718
|
}
|
|
834
719
|
});
|
|
835
|
-
Object.defineProperty(exports, "OPERATION_FILTER_TYPES", {
|
|
836
|
-
enumerable: true,
|
|
837
|
-
get: function() {
|
|
838
|
-
return OPERATION_FILTER_TYPES;
|
|
839
|
-
}
|
|
840
|
-
});
|
|
841
720
|
Object.defineProperty(exports, "__name", {
|
|
842
721
|
enumerable: true,
|
|
843
722
|
get: function() {
|
|
@@ -874,10 +753,10 @@ Object.defineProperty(exports, "createNodeCache", {
|
|
|
874
753
|
return createNodeCache;
|
|
875
754
|
}
|
|
876
755
|
});
|
|
877
|
-
Object.defineProperty(exports, "
|
|
756
|
+
Object.defineProperty(exports, "exists", {
|
|
878
757
|
enumerable: true,
|
|
879
758
|
get: function() {
|
|
880
|
-
return
|
|
759
|
+
return exists;
|
|
881
760
|
}
|
|
882
761
|
});
|
|
883
762
|
Object.defineProperty(exports, "getErrorMessage", {
|
|
@@ -923,4 +802,4 @@ Object.defineProperty(exports, "write", {
|
|
|
923
802
|
}
|
|
924
803
|
});
|
|
925
804
|
|
|
926
|
-
//# sourceMappingURL=
|
|
805
|
+
//# sourceMappingURL=nodeCache-CllHsCcy.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodeCache-CllHsCcy.cjs","names":["access","readFile","resolve","writeFile","mkdir","dirname","rm","relative","isAbsolute","NodeEventEmitter","extractStringsFromNodes","ast"],"sources":["../../../internals/utils/src/casing.ts","../../../internals/utils/src/errors.ts","../../../internals/utils/src/runtime.ts","../../../internals/utils/src/fs.ts","../../../internals/utils/src/promise.ts","../src/Hookable.ts","../src/FileManager.ts","../src/nodeCache.ts"],"sourcesContent":["type Options = {\n /**\n * Text prepended before casing is applied.\n */\n prefix?: string\n /**\n * Text appended before casing is applied.\n */\n suffix?: string\n}\n\n/**\n * Shared implementation for camelCase and PascalCase conversion.\n * Splits on common word boundaries (spaces, hyphens, underscores, dots, slashes, colons)\n * and capitalizes each word according to `pascal`.\n *\n * When `pascal` is `true` the first word is also capitalized (PascalCase), otherwise only subsequent words are.\n */\nfunction toCamelOrPascal(text: string, pascal: boolean): string {\n return text\n .trim()\n .replace(/([a-z\\d])([A-Z])/g, '$1 $2')\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2')\n .replace(/(\\d)([a-z])/g, '$1 $2')\n .split(/[\\s\\-_./\\\\:]+/)\n .filter(Boolean)\n .map((word, i) => {\n if (word.length > 1 && word === word.toUpperCase()) return word\n const head = i === 0 && !pascal ? word.charAt(0).toLowerCase() : word.charAt(0).toUpperCase()\n return head + word.slice(1)\n })\n .join('')\n .replace(/[^a-zA-Z0-9]/g, '')\n}\n\n/**\n * Converts `text` to camelCase.\n *\n * @example Word boundaries\n * `camelCase('hello-world') // 'helloWorld'`\n *\n * @example With a prefix\n * `camelCase('tag', { prefix: 'create' }) // 'createTag'`\n */\nexport function camelCase(text: string, { prefix = '', suffix = '' }: Options = {}): string {\n return toCamelOrPascal(`${prefix} ${text} ${suffix}`, false)\n}\n\n/**\n * Converts `text` to PascalCase.\n *\n * @example Word boundaries\n * `pascalCase('hello-world') // 'HelloWorld'`\n *\n * @example With a suffix\n * `pascalCase('tag', { suffix: 'schema' }) // 'TagSchema'`\n */\nexport function pascalCase(text: string, { prefix = '', suffix = '' }: Options = {}): string {\n return toCamelOrPascal(`${prefix} ${text} ${suffix}`, true)\n}\n","/**\n * Coerces an unknown thrown value to an `Error` instance.\n * Returns the value as-is when it is already an `Error`; otherwise wraps it with `String(value)`.\n *\n * @example\n * ```ts\n * try { ... } catch(err) {\n * throw new Error('Build failed', { cause: toError(err) })\n * }\n * ```\n */\nexport function toError(value: unknown): Error {\n return value instanceof Error ? value : new Error(String(value))\n}\n\n/**\n * Extracts a human-readable message from any thrown value.\n *\n * @example\n * ```ts\n * getErrorMessage(new Error('oops')) // 'oops'\n * getErrorMessage('plain string') // 'plain string'\n * ```\n */\nexport function getErrorMessage(value: unknown): string {\n return value instanceof Error ? value.message : String(value)\n}\n","/**\n * Name of the JavaScript runtime executing the current process.\n */\ntype RuntimeName = 'bun' | 'deno' | 'node'\n\n/**\n * Detects the JavaScript runtime executing the current process and exposes its name and version.\n *\n * Prefer the shared {@link runtime} instance over constructing your own.\n */\nclass Runtime {\n /**\n * `true` when the current process is running under Bun.\n *\n * Detection keys off the global `Bun` object rather than `process.versions`,\n * because Bun polyfills `process.versions.node` for Node compatibility and would\n * otherwise look like Node.\n *\n * @example\n * ```ts\n * if (runtime.isBun) {\n * await Bun.write(path, data)\n * }\n * ```\n */\n get isBun(): boolean {\n return typeof Bun !== 'undefined'\n }\n\n /**\n * `true` when the current process is running under Deno.\n */\n get isDeno(): boolean {\n return typeof (globalThis as { Deno?: unknown }).Deno !== 'undefined'\n }\n\n /**\n * `true` when the current process is running under Node.\n *\n * Bun and Deno are excluded first so a polyfilled `process` does not register as Node.\n */\n get isNode(): boolean {\n return !this.isBun && !this.isDeno && typeof process !== 'undefined' && process.versions?.node != null\n }\n\n /**\n * Name of the runtime executing the current process.\n *\n * @example\n * ```ts\n * runtime.name // 'bun' when run with `bun kubb`, 'node' otherwise\n * ```\n */\n get name(): RuntimeName {\n if (this.isBun) return 'bun'\n if (this.isDeno) return 'deno'\n\n return 'node'\n }\n\n /**\n * Version of the active runtime, or an empty string when it cannot be read.\n *\n * @example\n * ```ts\n * runtime.version // '1.3.11' under Bun, '22.22.2' under Node\n * ```\n */\n get version(): string {\n if (this.isBun) return process.versions.bun ?? ''\n if (this.isDeno) return (globalThis as { Deno?: { version?: { deno?: string } } }).Deno?.version?.deno ?? ''\n\n return process.versions?.node ?? ''\n }\n}\n\n/**\n * Shared {@link Runtime} instance describing the JavaScript runtime executing the current process.\n */\nexport const runtime = new Runtime()\n","import { access, mkdir, readFile, rm, writeFile } from 'node:fs/promises'\nimport { dirname, isAbsolute, relative, resolve } from 'node:path'\nimport { runtime } from './runtime.ts'\n\n/**\n * Resolves to `true` when the file or directory at `path` exists.\n * Uses `Bun.file().exists()` when running under Bun, `fs.access` otherwise.\n *\n * @example\n * ```ts\n * if (await exists('./kubb.config.ts')) {\n * const content = await read('./kubb.config.ts')\n * }\n * ```\n */\nexport async function exists(path: string): Promise<boolean> {\n if (runtime.isBun) {\n return Bun.file(path).exists()\n }\n return access(path).then(\n () => true,\n () => false,\n )\n}\n\n/**\n * Reads the file at `path` as a UTF-8 string.\n * Uses `Bun.file().text()` when running under Bun, `fs.readFile` otherwise.\n *\n * @example\n * ```ts\n * const source = await read('./src/Pet.ts')\n * ```\n */\nexport async function read(path: string): Promise<string> {\n if (runtime.isBun) {\n return Bun.file(path).text()\n }\n return readFile(path, { encoding: 'utf8' })\n}\n\ntype WriteOptions = {\n /**\n * Previously read content, or `null` when the file does not exist.\n * Omitting this value reads the file before writing.\n */\n stored?: string | null\n /**\n * When `true`, re-reads the file immediately after writing and throws if the\n * content does not match — useful for catching write failures on unreliable file systems.\n */\n sanity?: boolean\n}\n\n/**\n * Whether `stored` already holds `source`, comparing on the trimmed text rather than the exact\n * bytes. Surrounding whitespace is what a formatter adds and what editors strip, and neither is a\n * reason to rewrite the file.\n *\n * Both sides are trimmed, so a storage that keeps bytes verbatim settles on the same answer as one\n * that normalizes what it stores. Trimming only `stored` would leave a source with leading\n * whitespace rewritten on every build, since the stored copy keeps the whitespace the comparison\n * has already dropped.\n */\nexport function matchesStored({ stored, source }: { stored: string; source: string }): boolean {\n return stored.trim() === source.trim()\n}\n\n/**\n * Writes `data` to `path`, trimming surrounding whitespace and ending the file with a single newline\n * the way prettier, biome, and oxfmt all do.\n * Skips the write when the trimmed content is empty, or when the file already holds that content.\n * Creates any missing parent directories automatically.\n * When `sanity` is `true`, re-reads the file after writing and throws if the content does not match.\n *\n * @example\n * ```ts\n * await write('./src/Pet.ts', source) // writes and returns the trimmed content plus a newline\n * await write('./src/Pet.ts', source) // null — file unchanged\n * await write('./src/Pet.ts', ' ') // null — empty content skipped\n * ```\n */\nexport async function write(path: string, data: string, options: WriteOptions = {}): Promise<string | null> {\n const trimmed = data.trim()\n if (trimmed === '') return null\n\n const content = `${trimmed}\\n`\n const resolved = resolve(path)\n let stored = options.stored\n\n if (stored === undefined) {\n if (runtime.isBun) {\n const file = Bun.file(resolved)\n stored = (await file.exists()) ? await file.text() : null\n } else {\n try {\n stored = await readFile(resolved, { encoding: 'utf-8' })\n } catch {\n /* file doesn't exist yet */\n stored = null\n }\n }\n }\n if (matchesStored({ stored: stored ?? '', source: trimmed })) return null\n\n if (runtime.isBun) {\n await Bun.write(resolved, content)\n return content\n }\n\n // Creating the directory up front costs a syscall per file, and every file after the first in a\n // directory pays it for nothing. Write first and only fall back when the directory is missing,\n // which also stays correct when something removed it mid-run.\n try {\n await writeFile(resolved, content, { encoding: 'utf-8' })\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code !== 'ENOENT') throw error\n\n await mkdir(dirname(resolved), { recursive: true })\n await writeFile(resolved, content, { encoding: 'utf-8' })\n }\n\n if (options.sanity) {\n const savedData = await readFile(resolved, { encoding: 'utf-8' })\n if (savedData !== content) {\n throw new Error(`Sanity check failed for ${path}\\n\\nData[${data.length}]:\\n${data}\\n\\nSaved[${savedData.length}]:\\n${savedData}\\n`)\n }\n return savedData\n }\n\n return content\n}\n\n/**\n * Recursively removes `path`. Silently succeeds when `path` does not exist.\n *\n * @example\n * ```ts\n * await clean('./dist')\n * ```\n */\nexport async function clean(path: string): Promise<void> {\n return rm(path, { recursive: true, force: true })\n}\n\n/**\n * Converts a filesystem path to use POSIX (`/`) separators.\n *\n * Most of the codebase compares and composes paths as strings (prefix matching, joining for\n * import specifiers, splitting on `/`). On POSIX `path.resolve` already returns `/`-separated\n * paths, but on Windows it returns `\\`-separated paths, which breaks every such comparison.\n *\n * Routing every path that crosses a module boundary through `toPosixPath` keeps the rest of the\n * code platform-agnostic. The conversion runs unconditionally so Windows-specific behavior is\n * exercisable from POSIX CI.\n *\n * @example\n * toPosixPath('C:\\\\repo\\\\src\\\\pet.ts') // 'C:/repo/src/pet.ts'\n */\nexport function toPosixPath(filePath: string): string {\n return filePath.replaceAll('\\\\', '/')\n}\n\n/**\n * Strips the file extension from a path or file name.\n * Only removes the last `.ext` segment when the dot is not part of a directory name.\n *\n * @example\n * trimExtName('petStore.ts') // 'petStore'\n * trimExtName('/src/models/pet.ts') // '/src/models/pet'\n * trimExtName('/project.v2/gen/pet.ts') // '/project.v2/gen/pet'\n * trimExtName('noExtension') // 'noExtension'\n */\nexport function trimExtName(text: string): string {\n const dotIndex = text.lastIndexOf('.')\n if (dotIndex > 0 && !text.includes('/', dotIndex)) {\n return text.slice(0, dotIndex)\n }\n return text\n}\n\n/**\n * Resolves to `true` when `path` is `parent` itself or nested inside it. Both sides are resolved\n * to absolute paths first, so relative and `..`-containing inputs compare correctly.\n *\n * Guards a destructive or an out-of-tree operation: before wiping an output directory, check that\n * it does not contain the project root, and before loading a path a caller supplied, check that it\n * did not escape the directory it is allowed to read from.\n *\n * @example\n * isPathInside('./src/gen', '.') // true — nested inside the root\n * isPathInside('.', '.') // true — the same directory counts as inside\n * isPathInside('.', './src/gen') // false — the root is not inside its own output\n * isPathInside('../other', '.') // false — escapes the root\n */\nexport function isPathInside(path: string, parent: string): boolean {\n const resolvedPath = resolve(path)\n const resolvedParent = resolve(parent)\n if (resolvedPath === resolvedParent) {\n return true\n }\n\n const rel = relative(resolvedParent, resolvedPath)\n\n return rel !== '' && !rel.startsWith('..') && !isAbsolute(rel)\n}\n","/** A value that may already be resolved or still pending.\n *\n * @example\n * ```ts\n * function load(id: string): PossiblePromise<string> {\n * return cache.get(id) ?? fetchRemote(id)\n * }\n * ```\n */\nexport type PossiblePromise<T> = Promise<T> | T\n\n/** Returns `true` when `result` is a thenable `Promise`.\n *\n * @example\n * ```ts\n * isPromise(Promise.resolve(1)) // true\n * isPromise(42) // false\n * ```\n */\nexport function isPromise<T>(result: PossiblePromise<T>): result is Promise<T> {\n return result !== null && result !== undefined && typeof (result as Record<string, unknown>)['then'] === 'function'\n}\n\ntype Store<TKey, TValue> = {\n has(key: TKey): boolean\n get(key: TKey): TValue | undefined\n set(key: TKey, value: TValue): unknown\n}\n\n/**\n * Wraps `factory` with a keyed cache backed by the provided store.\n *\n * Pass a `WeakMap` for object keys (results are GC-eligible when the key is\n * collected) or a `Map` for primitive keys. For multi-argument functions,\n * nest two `memoize` calls — the outer keyed by the first argument, the\n * inner (created once per outer miss) keyed by the second.\n *\n * Because the cache is owned by the caller, it can be shared, inspected, or\n * cleared independently of the memoized function.\n *\n * @example Single WeakMap key\n * ```ts\n * const cache = new WeakMap<SchemaNode, Set<string>>()\n * const getRefs = memoize(cache, (node) => collectRefs(node))\n * ```\n *\n * @example Single Map key (primitive)\n * ```ts\n * const cache = new Map<string, Resolver>()\n * const getResolver = memoize(cache, (name) => buildResolver(name))\n * ```\n *\n * @example Two-level (object + primitive)\n * ```ts\n * const outer = new WeakMap<Params[], Map<string, Params[]>>()\n * const fn = memoize(outer, (params) => memoize(new Map(), (key) => transform(params, key)))\n * fn(params)('camelcase')\n * ```\n */\nexport function memoize<TKey, TValue>(store: Store<TKey, TValue>, factory: (key: TKey) => TValue): (key: TKey) => TValue {\n return (key: TKey): TValue => {\n if (store.has(key)) return store.get(key)!\n const value = factory(key)\n store.set(key, value)\n return value\n }\n}\n\ntype ParallelOptions<TItem> = {\n /**\n * Items to work through, handed out in order.\n */\n items: ReadonlyArray<TItem>\n /**\n * How many items may be in flight at once.\n */\n limit: number\n /**\n * Runs once per item, with the item's position so a caller can report progress.\n */\n run(item: TItem, index: number): Promise<void>\n}\n\n/**\n * Runs `run` over every item with at most `limit` in flight. Workers share one iterator, so each\n * takes the next item the moment it frees up instead of waiting for a batch to drain.\n *\n * @example\n * ```ts\n * await inParallel({ items: files, limit: 50, run: (file) => storage.writeItem(file.path, file.source) })\n * ```\n */\nexport async function inParallel<TItem>({ items, limit, run }: ParallelOptions<TItem>): Promise<void> {\n const queue = items.entries()\n\n const worker = async (): Promise<void> => {\n for (const [index, item] of queue) await run(item, index)\n }\n\n await Promise.all(Array.from({ length: Math.min(limit, items.length) }, () => worker()))\n}\n","import { EventEmitter as NodeEventEmitter } from 'node:events'\nimport { toError } from '@internals/utils'\n\n/**\n * A function that can be registered as a hook listener, synchronous or async. Any return value is\n * allowed and ignored, so handlers that return a result for their own callers still register.\n */\ntype AsyncListener<TArgs extends Array<unknown>> = (...args: TArgs) => unknown\n\n/**\n * Typed hook emitter that awaits all async listeners before resolving.\n * Wraps Node's `EventEmitter` with full TypeScript hook-map inference.\n *\n * @example\n * ```ts\n * const hooks = new Hookable<{ build: [name: string] }>()\n * hooks.hook('build', async (name) => { console.log(name) })\n * await hooks.callHook('build', 'petstore') // all listeners awaited\n * ```\n */\nexport class Hookable<THooks extends { [K in keyof THooks]: Array<unknown> }> {\n /**\n * Maximum number of listeners per hook before Node emits a memory-leak warning.\n * @default 10\n */\n constructor(maxListener = 10) {\n this.#emitter.setMaxListeners(maxListener)\n }\n\n #emitter = new NodeEventEmitter()\n\n /**\n * Calls `hookName` and awaits all registered listeners sequentially.\n * Throws if any listener rejects, wrapping the cause in an error that names the hook.\n *\n * @example\n * ```ts\n * await hooks.callHook('build', 'petstore')\n * ```\n */\n callHook<THookName extends keyof THooks & string>(hookName: THookName, ...hookArgs: THooks[THookName]): Promise<void> | void {\n const listeners = this.#emitter.listeners(hookName) as Array<AsyncListener<THooks[THookName]>>\n\n if (listeners.length === 0) {\n return\n }\n\n return this.#emitAll(hookName, listeners, hookArgs)\n }\n\n async #emitAll<THookName extends keyof THooks & string>(\n hookName: THookName,\n listeners: Array<AsyncListener<THooks[THookName]>>,\n hookArgs: THooks[THookName],\n ): Promise<void> {\n for (const listener of listeners) {\n try {\n await listener(...hookArgs)\n } catch (err) {\n // Only the hook name goes in the message: the args can be a whole `Config` or AST subtree.\n throw new Error(`Error in async listener for \"${hookName}\"`, { cause: toError(err) })\n }\n }\n }\n\n /**\n * Registers a persistent listener for `hookName` and returns a function that removes it.\n *\n * @example\n * ```ts\n * const unhook = hooks.hook('build', async (name) => { console.log(name) })\n * unhook() // removes it\n * ```\n */\n hook<THookName extends keyof THooks & string>(hookName: THookName, handler: AsyncListener<THooks[THookName]>): () => void {\n this.#emitter.on(hookName, handler as AsyncListener<Array<unknown>>)\n return () => this.removeHook(hookName, handler)\n }\n\n /**\n * Registers every handler in `configHooks` at once and returns a function that removes them\n * all. Undefined entries are skipped, so a partial hook object registers only its present keys.\n *\n * @example\n * ```ts\n * const unhook = hooks.addHooks({ build: onBuild, done: onDone })\n * unhook() // removes both\n * ```\n */\n addHooks(configHooks: Partial<{ [K in keyof THooks & string]: AsyncListener<THooks[K]> }>): () => void {\n const unhooks = (Object.keys(configHooks) as Array<keyof THooks & string>)\n .filter((name) => configHooks[name])\n .map((name) => this.hook(name, configHooks[name]!))\n\n return () => {\n for (const unhook of unhooks) unhook()\n }\n }\n\n /**\n * Removes a previously registered listener.\n *\n * @example\n * ```ts\n * hooks.removeHook('build', handler)\n * ```\n */\n removeHook<THookName extends keyof THooks & string>(hookName: THookName, handler: AsyncListener<THooks[THookName]>): void {\n this.#emitter.off(hookName, handler as AsyncListener<Array<unknown>>)\n }\n\n /**\n * Returns the number of listeners registered for `hookName`.\n *\n * @example\n * ```ts\n * hooks.hook('build', handler)\n * hooks.listenerCount('build') // 1\n * ```\n */\n listenerCount<THookName extends keyof THooks & string>(hookName: THookName): number {\n return this.#emitter.listenerCount(hookName)\n }\n\n /**\n * Raises or lowers the per-hook listener ceiling before Node warns about a memory leak.\n * Set this above the expected listener count when many listeners attach by design.\n *\n * @example\n * ```ts\n * hooks.setMaxListeners(40)\n * ```\n */\n setMaxListeners(max: number): void {\n this.#emitter.setMaxListeners(max)\n }\n\n /**\n * Removes all listeners from every hook channel.\n *\n * @example\n * ```ts\n * hooks.removeAllHooks()\n * ```\n */\n removeAllHooks(): void {\n this.#emitter.removeAllListeners()\n }\n}\n","import { inParallel, matchesStored, read } from '@internals/utils'\nimport { ast, extractStringsFromNodes, type CodeNode, type FileNode } from '@kubb/ast'\nimport type { RendererFactory } from './createRenderer.ts'\nimport type { Storage } from './createStorage.ts'\nimport type { Parser } from './defineParser.ts'\nimport type { OutputManifest } from './outputManifest.ts'\nimport { Hookable } from './Hookable.ts'\n\n/**\n * Hooks fired around a `FileManager#write` batch: `start` before it, `update` per file, `end` after.\n */\nexport type FileManagerHooks = {\n start: [files: Array<FileNode>]\n update: [params: { file: FileNode; source?: string; processed: number; total: number; percentage: number }]\n end: [files: Array<FileNode>]\n}\n\n/** Files kept in flight at once, writing the output and reading it back for the manifest. */\nexport const FILE_CONCURRENCY = 50\n\ntype ParseOptions = {\n parsers?: Map<FileNode['extname'], Parser>\n}\n\ntype WriteOptions = ParseOptions & {\n storage: Storage\n signal?: AbortSignal\n /**\n * Consulted before each write so a file the output passes already normalized is recognized as\n * unchanged. Omitted when no formatter, linter, or `postGenerate` step is configured.\n */\n manifest?: OutputManifest\n}\n\nfunction joinSources(file: FileNode): string {\n return file.sources\n .map((source) => extractStringsFromNodes(source.nodes as Array<CodeNode>))\n .filter(Boolean)\n .join('\\n\\n')\n}\n\n/**\n * Reads a `copy` file and prints it through the parser's `copy` hook, or verbatim with `banner`/`footer` when there is none.\n */\nasync function parseCopy(file: FileNode, parser: Parser | undefined): Promise<string> {\n let content: string\n try {\n content = await read(file.copy as string)\n } catch (err) {\n throw new Error(`[kubb] Could not copy file into output: ${file.copy}`, { cause: err })\n }\n\n if (parser?.copy) {\n return parser.parse(ast.factory.createFile(parser.copy(file, content)))\n }\n\n return [file.banner, content, file.footer]\n .filter((segment): segment is string => Boolean(segment))\n .map((segment) => segment.trimEnd())\n .join('\\n')\n}\n\nfunction mergeFile<TMeta extends object = object>(a: FileNode<TMeta>, b: FileNode<TMeta>): FileNode<TMeta> {\n return {\n ...a,\n // Incoming file (b) takes precedence for banner/footer so a barrel file (whose\n // banner/footer the barrel plugin resolves last) wins over a plugin-generated\n // file at the same path.\n banner: b.banner,\n footer: b.footer,\n // A verbatim-copy file cannot be merged with rendered content; the incoming `copy` wins.\n copy: b.copy ?? a.copy,\n sources: a.sources.length ? (b.sources.length ? [...a.sources, ...b.sources] : a.sources) : b.sources,\n imports: a.imports.length ? (b.imports.length ? [...a.imports, ...b.imports] : a.imports) : b.imports,\n exports: a.exports.length ? (b.exports.length ? [...a.exports, ...b.exports] : a.exports) : b.exports,\n }\n}\n\nfunction isIndexPath(path: string): boolean {\n return path.endsWith('/index.ts') || path === 'index.ts'\n}\n\n// Sort order: shortest path first. Within a length bucket, index.ts barrels last.\nfunction compareFiles(a: FileNode, b: FileNode): number {\n return a.path.length - b.path.length || Number(isIndexPath(a.path)) - Number(isIndexPath(b.path))\n}\n\n// A file is unchanged either because the storage already holds this content, or because the\n// manifest knows the output passes turn this exact source into what the storage holds.\nfunction isUnchanged({ stored, source, key, manifest }: { stored: string | null; source: string; key: string; manifest?: OutputManifest }): boolean {\n if (stored === null) return false\n if (matchesStored({ stored, source })) return true\n\n return manifest?.isUpToDate({ key, source, disk: stored }) ?? false\n}\n\n/**\n * In-memory file store for generated files, and the writer that turns them into source\n * strings on `storage`. Files sharing a `path` are merged (sources/imports/exports\n * concatenated). The `files` getter is sorted by path length (barrel `index.ts` last\n * within a bucket).\n *\n * @example\n * ```ts\n * const manager = new FileManager()\n * manager.upsert(myFile)\n * manager.files // sorted view\n * await manager.write(manager.files, { storage: fsStorage() })\n * ```\n */\nexport class FileManager {\n readonly hooks = new Hookable<FileManagerHooks>()\n readonly #cache = new Map<string, FileNode>()\n // Cached sorted view, rebuilt lazily on the next `files` read. Nulled (not mutated) on every\n // write so callers holding a prior reference keep their snapshot, `dispose()` included.\n #sorted: Array<FileNode> | null = null\n\n add(...files: Array<FileNode>): Array<FileNode> {\n return this.#store(files, false)\n }\n\n upsert(...files: Array<FileNode>): Array<FileNode> {\n return this.#store(files, true)\n }\n\n /** Stores a generator result: a file array is upserted as is, an element renders through `renderer` first, falsy is a no-op. */\n async dispatch<TElement = unknown>({\n result,\n renderer,\n }: {\n result: TElement | Array<FileNode> | undefined | null\n renderer?: RendererFactory<TElement> | null\n }): Promise<void> {\n if (!result) return\n\n if (Array.isArray(result)) {\n this.upsert(...(result as Array<FileNode>))\n return\n }\n\n if (!renderer) return\n\n using instance = renderer()\n await instance.render(result)\n\n this.upsert(...instance.files)\n }\n\n #store(files: ReadonlyArray<FileNode>, mergeExisting: boolean): Array<FileNode> {\n const batch = files.length > 1 ? this.#dedupe(files) : files\n const resolved: Array<FileNode> = []\n\n for (const file of batch) {\n const existing = this.#cache.get(file.path)\n const merged = existing && mergeExisting ? ast.factory.createFile(mergeFile(existing, file)) : ast.factory.createFile(file)\n this.#cache.set(merged.path, merged)\n resolved.push(merged)\n }\n\n if (resolved.length > 0) this.#sorted = null\n return resolved\n }\n\n // Merges same-path entries within a multi-file batch so the cache update loop stays uniform.\n #dedupe(files: ReadonlyArray<FileNode>): Array<FileNode> {\n const seen = new Map<string, FileNode>()\n for (const file of files) {\n const prev = seen.get(file.path)\n seen.set(file.path, prev ? mergeFile(prev, file) : file)\n }\n return [...seen.values()]\n }\n\n /**\n * Releases all stored files and clears every `hooks` listener. Called by the core after\n * `kubb:build:end`.\n */\n dispose(): void {\n this.#cache.clear()\n this.#sorted = null\n this.hooks.removeAllHooks()\n }\n\n /**\n * All stored files in stable sort order (shortest path first, barrel files\n * last within a length bucket). Returns a cached view, do not mutate.\n */\n get files(): Array<FileNode> {\n return (this.#sorted ??= [...this.#cache.values()].sort(compareFiles))\n }\n\n /**\n * Converts a file's AST sources (or its `copy` source) into the final on-disk string.\n */\n async parse(file: FileNode, { parsers }: ParseOptions = {}): Promise<string> {\n const parser = parsers?.get(file.extname)\n\n if (file.copy) {\n return parseCopy(file, parser)\n }\n\n if (!parser) {\n return joinSources(file)\n }\n\n return parser.parse(file)\n }\n\n /**\n * Parses and writes every file through a bounded pool of workers. A small spec runs all its files\n * at once; a spec with thousands of files keeps at most {@link FILE_CONCURRENCY} parsed sources in\n * memory rather than holding every source, while still overlapping each file's write with the\n * next file's parse. Each `update` carries the file's input position, so a consumer can present\n * the files in generation order even though they finish in whatever order they parse.\n *\n * A file the storage already holds is skipped, so a rebuild that generates identical output\n * writes nothing and leaves every mtime where it was.\n */\n async write(files: Array<FileNode>, { storage, parsers, manifest, signal }: WriteOptions): Promise<void> {\n if (files.length === 0) return\n\n await this.hooks.callHook('start', files)\n\n const total = files.length\n\n await inParallel({\n items: files,\n limit: FILE_CONCURRENCY,\n run: async (file, index) => {\n signal?.throwIfAborted()\n const source = await this.parse(file, { parsers })\n await this.hooks.callHook('update', { file, source, processed: index + 1, total, percentage: ((index + 1) / total) * 100 })\n if (!source) return\n\n signal?.throwIfAborted()\n\n // Checking here rather than inside a driver gives a storage writing to S3 or a database\n // the same guarantee `fsStorage` has, that unchanged content is never rewritten.\n const stored = await storage.readItem(file.path)\n if (isUnchanged({ stored, source, key: file.path, manifest })) return\n\n signal?.throwIfAborted()\n await storage.writeItem(file.path, source, { stored })\n\n // Only a file that was written can have been changed by the output passes.\n manifest?.track({ key: file.path, source })\n },\n })\n\n await this.hooks.callHook('end', files)\n }\n}\n","/**\n * Per-node memo shared by every plugin that generates from the same schema or operation node in\n * one generate pass. The driver creates one `NodeCache` per node during the walk and hands the\n * same instance to each plugin's generator context, so work derived purely from the node (its\n * resolved name, imports, parameters) is computed by the first plugin that needs it and reused by\n * the rest instead of being recomputed per plugin.\n *\n * Keys are namespaced by convention (`'plugin-ts:imports'`) so two plugins caching different\n * derivations of the same node never collide.\n *\n * @example Fill on first read, reuse afterwards\n * ```ts\n * const imports = ctx.cache.ensureItem('plugin-ts:imports', () => ctx.resolver.imports({ node, root, output }))\n * ```\n */\nexport type NodeCache = {\n /**\n * Returns the value stored under `key`, or `undefined` when nothing is stored yet.\n */\n readItem<TValue>(key: string): TValue | undefined\n /**\n * Stores `value` under `key`, overwriting any previous value, and returns it.\n */\n writeItem<TValue>(key: string, value: TValue): TValue\n /**\n * Returns the value stored under `key`, computing and storing it with `factory` on the first\n * call. Later calls with the same key return the stored value without running `factory` again.\n */\n ensureItem<TValue>(key: string, factory: () => TValue): TValue\n}\n\n/**\n * Builds an empty {@link NodeCache} backed by a plain `Map`. Called once per node in the generate\n * walk.\n */\nexport function createNodeCache(): NodeCache {\n const store = new Map<string, unknown>()\n\n return {\n readItem<TValue>(key: string): TValue | undefined {\n return store.get(key) as TValue | undefined\n },\n writeItem<TValue>(key: string, value: TValue): TValue {\n store.set(key, value)\n return value\n },\n ensureItem<TValue>(key: string, factory: () => TValue): TValue {\n if (store.has(key)) return store.get(key) as TValue\n\n const value = factory()\n store.set(key, value)\n return value\n },\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,SAAS,gBAAgB,MAAc,QAAyB;CAC9D,OAAO,KACJ,KAAK,CAAC,CACN,QAAQ,qBAAqB,OAAO,CAAC,CACrC,QAAQ,yBAAyB,OAAO,CAAC,CACzC,QAAQ,gBAAgB,OAAO,CAAC,CAChC,MAAM,eAAe,CAAC,CACtB,OAAO,OAAO,CAAC,CACf,KAAK,MAAM,MAAM;EAChB,IAAI,KAAK,SAAS,KAAK,SAAS,KAAK,YAAY,GAAG,OAAO;EAE3D,QADa,MAAM,KAAK,CAAC,SAAS,KAAK,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,YAAY,KAC9E,KAAK,MAAM,CAAC;CAC5B,CAAC,CAAC,CACD,KAAK,EAAE,CAAC,CACR,QAAQ,iBAAiB,EAAE;AAChC;;;;;;;;;;AAWA,SAAgB,UAAU,MAAc,EAAE,SAAS,IAAI,SAAS,OAAgB,CAAC,GAAW;CAC1F,OAAO,gBAAgB,GAAG,OAAO,GAAG,KAAK,GAAG,UAAU,KAAK;AAC7D;;;;;;;;;;;;;;ACnCA,SAAgB,QAAQ,OAAuB;CAC7C,OAAO,iBAAiB,QAAQ,QAAQ,IAAI,MAAM,OAAO,KAAK,CAAC;AACjE;;;;;;;;;;AAWA,SAAgB,gBAAg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