@kubb/core 5.0.0-alpha.19 → 5.0.0-alpha.20

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.
@@ -585,11 +585,13 @@ type AdapterSource = {
585
585
  * - `TName` — unique string identifier (e.g. `'oas'`, `'asyncapi'`)
586
586
  * - `TOptions` — raw user-facing options passed to the adapter factory
587
587
  * - `TResolvedOptions` — defaults applied; what the adapter stores as `options`
588
+ * - `TDocument` — type of the raw source document exposed by the adapter after `parse()`
588
589
  */
589
- type AdapterFactoryOptions<TName extends string = string, TOptions extends object = object, TResolvedOptions extends object = TOptions> = {
590
+ type AdapterFactoryOptions<TName extends string = string, TOptions extends object = object, TResolvedOptions extends object = TOptions, TDocument = unknown> = {
590
591
  name: TName;
591
592
  options: TOptions;
592
593
  resolvedOptions: TResolvedOptions;
594
+ document: TDocument;
593
595
  };
594
596
  /**
595
597
  * An adapter converts a source file or data into a `@kubb/ast` `RootNode`.
@@ -618,6 +620,11 @@ type Adapter<TOptions extends AdapterFactoryOptions = AdapterFactoryOptions> = {
618
620
  * Resolved options (after defaults have been applied).
619
621
  */
620
622
  options: TOptions['resolvedOptions'];
623
+ /**
624
+ * The raw source document produced after the first `parse()` call.
625
+ * `undefined` before parsing; typed by the adapter's `TDocument` generic.
626
+ */
627
+ document?: TOptions['document'];
621
628
  /**
622
629
  * Convert the raw source into a universal `RootNode`.
623
630
  */
@@ -1193,4 +1200,4 @@ declare class PluginDriver {
1193
1200
  }
1194
1201
  //#endregion
1195
1202
  export { ResolveOptionsContext as A, ReactGeneratorV2 as B, PluginParameter as C, Printer as D, Presets as E, UserPlugin as F, formatters as G, KubbEvents as H, UserPluginWithLifeCycle as I, PossiblePromise as J, linters as K, UserResolver as L, Resolver as M, UserConfig as N, PrinterFactoryOptions as O, UserLogger as P, CoreGeneratorV2 as R, PluginLifecycleHooks as S, Preset as T, Storage as U, defineGenerator as V, createStorage as W, AsyncEventEmitter as Y, Output as _, AdapterFactoryOptions as a, PluginFactoryOptions as b, CompatibilityPreset as c, Group as d, InputData as f, LoggerOptions as g, LoggerContext as h, Adapter as i, ResolvePathParams as j, ResolveNameParams as k, Config as l, Logger as m, PluginDriver as n, AdapterSource as o, InputPath as p, logLevel as q, getMode as r, BarrelType as s, GetFileOptions as t, DevtoolsOptions as u, Plugin as v, PluginWithLifeCycle as w, PluginLifecycle as x, PluginContext as y, Generator as z };
1196
- //# sourceMappingURL=PluginDriver-BRTrzfiD.d.ts.map
1203
+ //# sourceMappingURL=PluginDriver-BkSenc-R.d.ts.map
package/dist/hooks.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { t as __name } from "./chunk--u3MIqq1.js";
2
- import { b as PluginFactoryOptions, j as ResolvePathParams, k as ResolveNameParams, l as Config, n as PluginDriver, t as GetFileOptions, v as Plugin } from "./PluginDriver-BRTrzfiD.js";
2
+ import { b as PluginFactoryOptions, j as ResolvePathParams, k as ResolveNameParams, l as Config, n as PluginDriver, t as GetFileOptions, v as Plugin } from "./PluginDriver-BkSenc-R.js";
3
3
  import { RootNode } from "@kubb/ast/types";
4
4
  import { KubbFile } from "@kubb/fabric-core/types";
5
5
 
package/dist/index.cjs CHANGED
@@ -1469,7 +1469,7 @@ const fsStorage = createStorage(() => ({
1469
1469
  }));
1470
1470
  //#endregion
1471
1471
  //#region package.json
1472
- var version = "5.0.0-alpha.19";
1472
+ var version = "5.0.0-alpha.20";
1473
1473
  //#endregion
1474
1474
  //#region src/utils/diagnostics.ts
1475
1475
  /**
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { t as __name } from "./chunk--u3MIqq1.js";
2
- import { A as ResolveOptionsContext, B as ReactGeneratorV2, C as PluginParameter, D as Printer, E as Presets, F as UserPlugin, G as formatters, H as KubbEvents, I as UserPluginWithLifeCycle, J as PossiblePromise, K as linters, L as UserResolver, M as Resolver, N as UserConfig, O as PrinterFactoryOptions, P as UserLogger, R as CoreGeneratorV2, S as PluginLifecycleHooks, T as Preset, U as Storage, V as defineGenerator, W as createStorage, Y as AsyncEventEmitter, _ as Output, a as AdapterFactoryOptions, b as PluginFactoryOptions, c as CompatibilityPreset, d as Group, f as InputData, g as LoggerOptions, h as LoggerContext, i as Adapter, j as ResolvePathParams, k as ResolveNameParams, l as Config, m as Logger, n as PluginDriver, o as AdapterSource, p as InputPath, q as logLevel, r as getMode, s as BarrelType, u as DevtoolsOptions, v as Plugin, w as PluginWithLifeCycle, x as PluginLifecycle, y as PluginContext, z as Generator } from "./PluginDriver-BRTrzfiD.js";
2
+ import { A as ResolveOptionsContext, B as ReactGeneratorV2, C as PluginParameter, D as Printer, E as Presets, F as UserPlugin, G as formatters, H as KubbEvents, I as UserPluginWithLifeCycle, J as PossiblePromise, K as linters, L as UserResolver, M as Resolver, N as UserConfig, O as PrinterFactoryOptions, P as UserLogger, R as CoreGeneratorV2, S as PluginLifecycleHooks, T as Preset, U as Storage, V as defineGenerator, W as createStorage, Y as AsyncEventEmitter, _ as Output, a as AdapterFactoryOptions, b as PluginFactoryOptions, c as CompatibilityPreset, d as Group, f as InputData, g as LoggerOptions, h as LoggerContext, i as Adapter, j as ResolvePathParams, k as ResolveNameParams, l as Config, m as Logger, n as PluginDriver, o as AdapterSource, p as InputPath, q as logLevel, r as getMode, s as BarrelType, u as DevtoolsOptions, v as Plugin, w as PluginWithLifeCycle, x as PluginLifecycle, y as PluginContext, z as Generator } from "./PluginDriver-BkSenc-R.js";
3
3
  import { definePrinter } from "@kubb/ast";
4
4
  import { Node, OperationNode, SchemaNode, Visitor } from "@kubb/ast/types";
5
5
  import { Fabric, KubbFile } from "@kubb/fabric-core/types";
package/dist/index.js CHANGED
@@ -1463,7 +1463,7 @@ const fsStorage = createStorage(() => ({
1463
1463
  }));
1464
1464
  //#endregion
1465
1465
  //#region package.json
1466
- var version$1 = "5.0.0-alpha.19";
1466
+ var version$1 = "5.0.0-alpha.20";
1467
1467
  //#endregion
1468
1468
  //#region src/utils/diagnostics.ts
1469
1469
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/core",
3
- "version": "5.0.0-alpha.19",
3
+ "version": "5.0.0-alpha.20",
4
4
  "description": "Core functionality for Kubb's plugin-based code generation system, providing the foundation for transforming OpenAPI specifications.",
5
5
  "keywords": [
6
6
  "typescript",
@@ -71,7 +71,7 @@
71
71
  "remeda": "^2.33.6",
72
72
  "semver": "^7.7.4",
73
73
  "tinyexec": "^1.0.4",
74
- "@kubb/ast": "5.0.0-alpha.19"
74
+ "@kubb/ast": "5.0.0-alpha.20"
75
75
  },
76
76
  "devDependencies": {
77
77
  "@types/semver": "^7.7.1",
package/src/types.ts CHANGED
@@ -65,11 +65,18 @@ export type AdapterSource = { type: 'path'; path: string } | { type: 'data'; dat
65
65
  * - `TName` — unique string identifier (e.g. `'oas'`, `'asyncapi'`)
66
66
  * - `TOptions` — raw user-facing options passed to the adapter factory
67
67
  * - `TResolvedOptions` — defaults applied; what the adapter stores as `options`
68
+ * - `TDocument` — type of the raw source document exposed by the adapter after `parse()`
68
69
  */
69
- export type AdapterFactoryOptions<TName extends string = string, TOptions extends object = object, TResolvedOptions extends object = TOptions> = {
70
+ export type AdapterFactoryOptions<
71
+ TName extends string = string,
72
+ TOptions extends object = object,
73
+ TResolvedOptions extends object = TOptions,
74
+ TDocument = unknown,
75
+ > = {
70
76
  name: TName
71
77
  options: TOptions
72
78
  resolvedOptions: TResolvedOptions
79
+ document: TDocument
73
80
  }
74
81
 
75
82
  /**
@@ -99,6 +106,11 @@ export type Adapter<TOptions extends AdapterFactoryOptions = AdapterFactoryOptio
99
106
  * Resolved options (after defaults have been applied).
100
107
  */
101
108
  options: TOptions['resolvedOptions']
109
+ /**
110
+ * The raw source document produced after the first `parse()` call.
111
+ * `undefined` before parsing; typed by the adapter's `TDocument` generic.
112
+ */
113
+ document?: TOptions['document']
102
114
  /**
103
115
  * Convert the raw source into a universal `RootNode`.
104
116
  */