@kubb/core 5.0.0-beta.6 → 5.0.0-beta.60

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.
Files changed (56) hide show
  1. package/LICENSE +17 -10
  2. package/README.md +25 -158
  3. package/dist/diagnostics-B-UZnFqP.d.ts +2906 -0
  4. package/dist/index.cjs +2497 -1071
  5. package/dist/index.cjs.map +1 -1
  6. package/dist/index.d.ts +80 -273
  7. package/dist/index.js +2487 -1067
  8. package/dist/index.js.map +1 -1
  9. package/dist/memoryStorage-CUj1hrxa.cjs +823 -0
  10. package/dist/memoryStorage-CUj1hrxa.cjs.map +1 -0
  11. package/dist/memoryStorage-CWFzAz4o.js +714 -0
  12. package/dist/memoryStorage-CWFzAz4o.js.map +1 -0
  13. package/dist/mocks.cjs +79 -19
  14. package/dist/mocks.cjs.map +1 -1
  15. package/dist/mocks.d.ts +35 -9
  16. package/dist/mocks.js +80 -22
  17. package/dist/mocks.js.map +1 -1
  18. package/package.json +8 -28
  19. package/src/FileManager.ts +86 -64
  20. package/src/FileProcessor.ts +170 -44
  21. package/src/KubbDriver.ts +908 -0
  22. package/src/Transform.ts +75 -0
  23. package/src/constants.ts +111 -20
  24. package/src/createAdapter.ts +112 -17
  25. package/src/createKubb.ts +140 -517
  26. package/src/createRenderer.ts +43 -28
  27. package/src/createReporter.ts +134 -0
  28. package/src/createStorage.ts +36 -23
  29. package/src/defineGenerator.ts +147 -17
  30. package/src/defineParser.ts +30 -12
  31. package/src/definePlugin.ts +370 -21
  32. package/src/defineResolver.ts +402 -212
  33. package/src/diagnostics.ts +662 -0
  34. package/src/index.ts +8 -8
  35. package/src/mocks.ts +91 -20
  36. package/src/reporters/cliReporter.ts +89 -0
  37. package/src/reporters/fileReporter.ts +103 -0
  38. package/src/reporters/jsonReporter.ts +20 -0
  39. package/src/reporters/report.ts +85 -0
  40. package/src/storages/fsStorage.ts +23 -55
  41. package/src/types.ts +411 -887
  42. package/dist/PluginDriver-BkTRD2H2.js +0 -946
  43. package/dist/PluginDriver-BkTRD2H2.js.map +0 -1
  44. package/dist/PluginDriver-Cadu4ORh.cjs +0 -1037
  45. package/dist/PluginDriver-Cadu4ORh.cjs.map +0 -1
  46. package/dist/types-DVPKmzw_.d.ts +0 -2159
  47. package/src/Kubb.ts +0 -300
  48. package/src/PluginDriver.ts +0 -426
  49. package/src/defineLogger.ts +0 -19
  50. package/src/defineMiddleware.ts +0 -62
  51. package/src/devtools.ts +0 -59
  52. package/src/renderNode.ts +0 -35
  53. package/src/utils/diagnostics.ts +0 -18
  54. package/src/utils/isInputPath.ts +0 -10
  55. package/src/utils/packageJSON.ts +0 -99
  56. /package/dist/{chunk--u3MIqq1.js → chunk-C0LytTxp.js} +0 -0
package/dist/index.d.ts CHANGED
@@ -1,18 +1,35 @@
1
- import { t as __name } from "./chunk--u3MIqq1.js";
2
- import { $ as defineParser, A as KubbPluginStartContext, B as Override, C as KubbGenerationSummaryContext, D as KubbLifecycleStartContext, E as KubbInfoContext, F as Logger, G as ResolveOptionsContext, H as PossibleConfig, I as LoggerContext, J as ResolverFileParams, K as Resolver, L as LoggerOptions, M as KubbSuccessContext, N as KubbVersionNewContext, O as KubbPluginEndContext, P as KubbWarnContext, Q as Parser, R as NormalizedPlugin, S as KubbGenerationStartContext, T as KubbHookStartContext, U as ResolveBannerContext, V as PluginFactoryOptions, W as ResolveNameParams, X as UserConfig, Y as ResolverPathParams, Z as UserLogger, _ as KubbErrorContext, _t as logLevel, a as Config, at as createKubb, b as KubbFilesProcessingStartContext, c as GeneratorContext, ct as Plugin, d as InputData, dt as defineGenerator, et as Middleware, f as InputPath, ft as Storage, g as KubbDebugContext, gt as createRenderer, h as KubbConfigEndContext, ht as RendererFactory, i as CLIOptions, it as BuildOutput, j as KubbPluginsEndContext, k as KubbPluginSetupContext, l as Group, lt as definePlugin, m as KubbBuildStartContext, mt as Renderer, n as AdapterFactoryOptions, nt as Kubb, o as DevtoolsOptions, ot as PluginDriver, p as KubbBuildEndContext, pt as createStorage, q as ResolverContext, r as AdapterSource, rt as KubbHooks, s as Exclude, st as FileManager, t as Adapter, tt as defineMiddleware, u as Include, ut as Generator, v as KubbFileProcessingUpdateContext, vt as AsyncEventEmitter, w as KubbHookEndContext, x as KubbGenerationEndContext, y as KubbFilesProcessingEndContext, z as Output } from "./types-DVPKmzw_.js";
1
+ import { t as __name } from "./chunk-C0LytTxp.js";
2
+ import { $ as KubbPluginSetupContext, A as KubbHookStartContext, At as Adapter, B as ParsedFile, C as KubbFilesProcessingEndContext, Ct as GenerationResult, D as KubbGenerationStartContext, Dt as UserReporter, E as KubbGenerationEndContext, Et as ReporterName, F as KubbSuccessContext, G as Generator, H as createKubb, I as KubbWarnContext, J as KubbDriver, K as GeneratorContext, L as PossibleConfig, M as KubbInfoContext, Mt as AdapterSource, N as KubbLifecycleStartContext, Nt as createAdapter, O as KubbHookEndContext, Ot as createReporter, P as KubbPluginsEndContext, Pt as AsyncEventEmitter, Q as KubbPluginEndContext, R as UserConfig, S as KubbFileProcessingUpdate, St as createStorage, T as KubbFilesProcessingUpdateContext, Tt as ReporterContext, U as Parser, V as Kubb, W as defineParser, X as Group, Y as Exclude, Z as Include, _ as InputPath, _t as defineResolver, a as DiagnosticLocation, at as Override, b as KubbDiagnosticContext, bt as createRenderer, c as PerformanceDiagnostic, ct as definePlugin, d as SerializedDiagnostic, dt as ResolveBannerFile, et as KubbPluginStartContext, f as UpdateDiagnostic, ft as ResolveOptionsContext, g as InputData, gt as ResolverPathParams, h as Config, ht as ResolverFileParams, i as DiagnosticKind, it as OutputOptions, j as KubbHooks, jt as AdapterFactoryOptions, k as KubbHookLineContext, kt as logLevel, l as ProblemCode, lt as BannerMeta, m as CLIOptions, mt as ResolverContext, n as DiagnosticByCode, nt as Output, o as DiagnosticSeverity, ot as Plugin, p as BuildOutput, pt as Resolver, q as defineGenerator, r as DiagnosticDoc, rt as OutputMode, s as Diagnostics, st as PluginFactoryOptions, t as Diagnostic, tt as NormalizedPlugin, u as ProblemDiagnostic, ut as ResolveBannerContext, v as KubbBuildEndContext, vt as Renderer, w as KubbFilesProcessingStartContext, wt as Reporter, x as KubbErrorContext, xt as Storage, y as KubbBuildStartContext, yt as RendererFactory, z as FileProcessorHooks } from "./diagnostics-B-UZnFqP.js";
3
3
  import * as ast from "@kubb/ast";
4
- import { FileNode, InputNode, Node } from "@kubb/ast";
5
4
 
6
- //#region ../../internals/utils/src/urlPath.d.ts
5
+ //#region ../../internals/utils/src/url.d.ts
7
6
  type URLObject = {
8
7
  /**
9
8
  * The resolved URL string (Express-style or template literal, depending on context).
10
9
  */
11
10
  url: string;
12
11
  /**
13
- * Extracted path parameters as a key-value map, or `undefined` when the path has none.
12
+ * Extracted path parameters as a key-value map, or `null` when the path has none.
14
13
  */
15
- params?: Record<string, string>;
14
+ params: Record<string, string> | null;
15
+ };
16
+ /**
17
+ * Supported identifier casing strategies for path parameters.
18
+ */
19
+ type PathCasing = 'camelcase';
20
+ type TemplateOptions = {
21
+ /**
22
+ * Literal text prepended inside the template literal, e.g. a base URL.
23
+ */
24
+ prefix?: string | null;
25
+ /**
26
+ * Transform applied to each extracted parameter name before interpolation.
27
+ */
28
+ replacer?: (pathParam: string) => string;
29
+ /**
30
+ * Casing strategy applied to path parameter names.
31
+ */
32
+ casing?: PathCasing;
16
33
  };
17
34
  type ObjectOptions = {
18
35
  /**
@@ -21,298 +38,99 @@ type ObjectOptions = {
21
38
  */
22
39
  type?: 'path' | 'template';
23
40
  /**
24
- * Optional transform applied to each extracted parameter name.
41
+ * Transform applied to each extracted parameter name.
25
42
  */
26
43
  replacer?: (pathParam: string) => string;
27
44
  /**
28
45
  * When `true`, the result is serialized to a string expression instead of a plain object.
29
46
  */
30
47
  stringify?: boolean;
31
- };
32
- /**
33
- * Supported identifier casing strategies for path parameters.
34
- */
35
- type PathCasing = 'camelcase';
36
- type Options = {
37
48
  /**
38
49
  * Casing strategy applied to path parameter names.
39
- * @default undefined (original identifier preserved)
40
50
  */
41
51
  casing?: PathCasing;
42
52
  };
43
53
  /**
44
- * Parses and transforms an OpenAPI/Swagger path string into various URL formats.
45
- *
46
- * @example
47
- * const p = new URLPath('/pet/{petId}')
48
- * p.URL // '/pet/:petId'
49
- * p.template // '`/pet/${petId}`'
54
+ * Helpers for OpenAPI/Swagger paths, plus a thin wrapper over the native `URL`.
50
55
  */
51
- declare class URLPath {
52
- #private;
56
+ declare class Url {
53
57
  /**
54
- * The raw OpenAPI/Swagger path string, e.g. `/pet/{petId}`.
55
- */
56
- path: string;
57
- constructor(path: string, options?: Options);
58
- /** Converts the OpenAPI path to Express-style colon syntax, e.g. `/pet/{petId}` → `/pet/:petId`.
58
+ * Reports whether `url` is a parseable absolute URL. Delegates to the native `URL.canParse`.
59
59
  *
60
60
  * @example
61
- * ```ts
62
- * new URLPath('/pet/{petId}').URL // '/pet/:petId'
63
- * ```
61
+ * Url.canParse('https://petstore.swagger.io/v2') // true
62
+ * Url.canParse('/pet/{petId}') // false
64
63
  */
65
- get URL(): string;
66
- /** Returns `true` when `path` is a fully-qualified URL (e.g. starts with `https://`).
64
+ static canParse(url: string, base?: string | URL): boolean;
65
+ /**
66
+ * Converts an OpenAPI/Swagger path to Express-style colon syntax.
67
67
  *
68
68
  * @example
69
- * ```ts
70
- * new URLPath('https://petstore.swagger.io/v2/pet').isURL // true
71
- * new URLPath('/pet/{petId}').isURL // false
72
- * ```
69
+ * Url.toPath('/pet/{petId}') // '/pet/:petId'
73
70
  */
74
- get isURL(): boolean;
71
+ static toPath(path: string): string;
75
72
  /**
76
- * Converts the OpenAPI path to a TypeScript template literal string.
73
+ * Converts an OpenAPI/Swagger path to a TypeScript template literal string.
74
+ * `prefix` is prepended inside the literal, `replacer` transforms each parameter name,
75
+ * and `casing` controls parameter identifier casing.
77
76
  *
78
77
  * @example
79
- * new URLPath('/pet/{petId}').template // '`/pet/${petId}`'
80
- * new URLPath('/account/monetary-accountID').template // '`/account/${monetaryAccountId}`'
81
- */
82
- get template(): string;
83
- /** Returns the path and its extracted params as a structured `URLObject`, or as a stringified expression when `stringify` is set.
78
+ * Url.toTemplateString('/pet/{petId}') // '`/pet/${petId}`'
84
79
  *
85
80
  * @example
86
- * ```ts
87
- * new URLPath('/pet/{petId}').object
88
- * // { url: '/pet/:petId', params: { petId: 'petId' } }
89
- * ```
81
+ * Url.toTemplateString('/pet/{petId}', { prefix: 'https://api' }) // '`https://api/pet/${petId}`'
90
82
  */
91
- get object(): URLObject | string;
92
- /** Returns a map of path parameter names, or `undefined` when the path has no parameters.
83
+ static toTemplateString(path: string, {
84
+ prefix,
85
+ replacer,
86
+ casing
87
+ }?: TemplateOptions): string;
88
+ /**
89
+ * Returns the path and its extracted params as a structured `URLObject`, or as a stringified
90
+ * expression when `stringify` is set.
93
91
  *
94
92
  * @example
95
- * ```ts
96
- * new URLPath('/pet/{petId}').params // { petId: 'petId' }
97
- * new URLPath('/pet').params // undefined
98
- * ```
93
+ * Url.toObject('/pet/{petId}')
94
+ * // { url: '/pet/:petId', params: { petId: 'petId' } }
99
95
  */
100
- get params(): Record<string, string> | undefined;
101
- toObject({
96
+ static toObject(path: string, {
102
97
  type,
103
98
  replacer,
104
- stringify
99
+ stringify,
100
+ casing
105
101
  }?: ObjectOptions): URLObject | string;
106
- /**
107
- * Converts the OpenAPI path to a TypeScript template literal string.
108
- * An optional `replacer` can transform each extracted parameter name before interpolation.
109
- *
110
- * @example
111
- * new URLPath('/pet/{petId}').toTemplateString() // '`/pet/${petId}`'
112
- */
113
- toTemplateString({
114
- prefix,
115
- replacer
116
- }?: {
117
- prefix?: string;
118
- replacer?: (pathParam: string) => string;
119
- }): string;
120
- /**
121
- * Extracts all `{param}` segments from the path and returns them as a key-value map.
122
- * An optional `replacer` transforms each parameter name in both key and value positions.
123
- * Returns `undefined` when no path parameters are found.
124
- *
125
- * @example
126
- * ```ts
127
- * new URLPath('/pet/{petId}/tag/{tagId}').getParams()
128
- * // { petId: 'petId', tagId: 'tagId' }
129
- * ```
130
- */
131
- getParams(replacer?: (pathParam: string) => string): Record<string, string> | undefined;
132
- /** Converts the OpenAPI path to Express-style colon syntax.
133
- *
134
- * @example
135
- * ```ts
136
- * new URLPath('/pet/{petId}').toURLPath() // '/pet/:petId'
137
- * ```
138
- */
139
- toURLPath(): string;
140
102
  }
141
103
  //#endregion
142
- //#region src/createAdapter.d.ts
143
- type AdapterBuilder<T extends AdapterFactoryOptions> = (options: T['options']) => Adapter<T>;
104
+ //#region src/reporters/cliReporter.d.ts
144
105
  /**
145
- * Factory for implementing custom adapters that translate non-OpenAPI specs into Kubb's AST.
146
- *
147
- * Use this to support GraphQL schemas, gRPC definitions, AsyncAPI, or custom domain-specific languages.
148
- * Built-in adapters include `@kubb/adapter-oas` for OpenAPI and Swagger documents.
149
- *
150
- * @note Adapters must parse their input format to Kubb's `InputNode` structure.
151
- *
152
- * @example
153
- * ```ts
154
- * export const myAdapter = createAdapter<MyAdapter>((options) => {
155
- * return {
156
- * name: 'my-adapter',
157
- * options,
158
- * async parse(source) {
159
- * // Transform source format to InputNode
160
- * return { ... }
161
- * },
162
- * }
163
- * })
164
- *
165
- * // Instantiate:
166
- * const adapter = myAdapter({ validate: true })
167
- * ```
106
+ * The default `cli` reporter. Renders the {@link Report} for each config as it finishes, independent
107
+ * of the live logger view. Suppressed at `silent`. The `verbose` level adds the per-plugin timings.
168
108
  */
169
- declare function createAdapter<T extends AdapterFactoryOptions = AdapterFactoryOptions>(build: AdapterBuilder<T>): (options?: T['options']) => Adapter<T>;
109
+ declare const cliReporter: Reporter;
170
110
  //#endregion
171
- //#region src/defineLogger.d.ts
111
+ //#region src/reporters/fileReporter.d.ts
172
112
  /**
173
- * Wraps a logger definition into a typed {@link Logger}.
174
- *
175
- * @example
176
- * ```ts
177
- * export const myLogger = defineLogger({
178
- * name: 'my-logger',
179
- * install(context, options) {
180
- * context.on('kubb:info', (message) => console.log('ℹ', message))
181
- * context.on('kubb:error', (error) => console.error('✗', error.message))
182
- * },
183
- * })
184
- * ```
113
+ * The `file` reporter. Writes a config's {@link Report} to `.kubb/kubb-<name>-<timestamp>.log` as a
114
+ * plain-text document: a `# <name> — <timestamp>` header, a `## Summary` with the same counts the
115
+ * cli and json reporters expose, a `## Problems` section in the miette block format, and a
116
+ * `## Timings` section. Selected with `--reporter file` (or `reporters: ['file']`), replacing the
117
+ * old `--debug` flag.
118
+ *
119
+ * @note Unlike the streaming logger it replaced, it captures the collected diagnostics once a
120
+ * config finishes, not the live `kubb:info`/`kubb:plugin` event stream. Color is stripped so the
121
+ * file stays plain text even when the run is attached to a TTY.
185
122
  */
186
- declare function defineLogger<Options extends LoggerOptions = LoggerOptions>(logger: UserLogger<Options>): Logger<Options>;
123
+ declare const fileReporter: Reporter;
187
124
  //#endregion
188
- //#region src/defineResolver.d.ts
125
+ //#region src/reporters/jsonReporter.d.ts
189
126
  /**
190
- * Builder type for the plugin-specific resolver fields.
191
- *
192
- * `default`, `resolveOptions`, `resolvePath`, `resolveFile`, `resolveBanner`, and `resolveFooter`
193
- * are optional built-in fallbacks are injected when omitted.
194
- *
195
- * The builder receives `ctx` — a reference to the fully assembled resolver — so methods can
196
- * call sibling resolver methods without using `this`. Because `ctx` is captured by the closure
197
- * and the resolver is populated after the builder runs, `ctx` correctly reflects any overrides
198
- * that were applied by the builder itself.
199
- */
200
- type ResolverBuilder<T extends PluginFactoryOptions> = (ctx: T['resolver']) => Omit<T['resolver'], 'default' | 'resolveOptions' | 'resolvePath' | 'resolveFile' | 'resolveBanner' | 'resolveFooter' | 'name' | 'pluginName'> & Partial<Pick<T['resolver'], 'default' | 'resolveOptions' | 'resolvePath' | 'resolveFile' | 'resolveBanner' | 'resolveFooter'>> & {
201
- name: string;
202
- pluginName: T['name'];
203
- };
204
- /**
205
- * Default option resolver — applies include/exclude filters and merges matching override options.
206
- *
207
- * Returns `null` when the node is filtered out by an `exclude` rule or not matched by any `include` rule.
208
- *
209
- * @example Include/exclude filtering
210
- * ```ts
211
- * const options = defaultResolveOptions(operationNode, {
212
- * options: { output: 'types' },
213
- * exclude: [{ type: 'tag', pattern: 'internal' }],
214
- * })
215
- * // → null when node has tag 'internal'
216
- * ```
217
- *
218
- * @example Override merging
219
- * ```ts
220
- * const options = defaultResolveOptions(operationNode, {
221
- * options: { enumType: 'asConst' },
222
- * override: [{ type: 'operationId', pattern: 'listPets', options: { enumType: 'enum' } }],
223
- * })
224
- * // → { enumType: 'enum' } when operationId matches
225
- * ```
127
+ * The `json` reporter. `report` returns one config's {@link Report}, which {@link createReporter}
128
+ * buffers, and `drain` writes them as a single pretty-printed JSON array on `kubb:lifecycle:end`.
129
+ * Buffering keeps a multi-config run one valid JSON document on stdout instead of concatenated
130
+ * objects that would break `jq .`. The terminal reporter is suppressed while `json` is active so
131
+ * stdout stays valid JSON.
226
132
  */
227
- /**
228
- * Defines a resolver for a plugin, injecting built-in defaults for name casing,
229
- * include/exclude/override filtering, path resolution, and file construction.
230
- *
231
- * All four defaults can be overridden by providing them in the builder function:
232
- * - `default` — name casing strategy (camelCase / PascalCase)
233
- * - `resolveOptions` — include/exclude/override filtering
234
- * - `resolvePath` — output path computation
235
- * - `resolveFile` — full `FileNode` construction
236
- *
237
- * The builder receives `ctx` — a reference to the assembled resolver — so methods can
238
- * call sibling resolver methods using `ctx` instead of `this`.
239
- *
240
- * @example Basic resolver with naming helpers
241
- * ```ts
242
- * export const resolver = defineResolver<PluginTs>((ctx) => ({
243
- * name: 'default',
244
- * resolveName(node) {
245
- * return ctx.default(node.name, 'function')
246
- * },
247
- * resolveTypedName(node) {
248
- * return ctx.default(node.name, 'type')
249
- * },
250
- * }))
251
- * ```
252
- *
253
- * @example Override resolvePath for a custom output structure
254
- * ```ts
255
- * export const resolver = defineResolver<PluginTs>((_ctx) => ({
256
- * name: 'custom',
257
- * resolvePath({ baseName }, { root, output }) {
258
- * return path.resolve(root, output.path, 'generated', baseName)
259
- * },
260
- * }))
261
- * ```
262
- *
263
- * @example Use ctx.default inside a helper
264
- * ```ts
265
- * export const resolver = defineResolver<PluginTs>((ctx) => ({
266
- * name: 'default',
267
- * resolveParamName(node, param) {
268
- * return ctx.default(`${node.operationId} ${param.in} ${param.name}`, 'type')
269
- * },
270
- * }))
271
- * ```
272
- */
273
- declare function defineResolver<T extends PluginFactoryOptions>(build: ResolverBuilder<T>): T['resolver'];
274
- //#endregion
275
- //#region src/FileProcessor.d.ts
276
- type ParseOptions = {
277
- parsers?: Map<FileNode['extname'], Parser>;
278
- extension?: Record<FileNode['extname'], FileNode['extname'] | ''>;
279
- };
280
- type RunOptions = ParseOptions & {
281
- /**
282
- * @default 'sequential'
283
- */
284
- mode?: 'sequential' | 'parallel';
285
- onStart?: (files: Array<FileNode>) => Promise<void> | void;
286
- onEnd?: (files: Array<FileNode>) => Promise<void> | void;
287
- onUpdate?: (params: {
288
- file: FileNode;
289
- source?: string;
290
- processed: number;
291
- total: number;
292
- percentage: number;
293
- }) => Promise<void> | void;
294
- };
295
- /**
296
- * Converts a single file to a string using the registered parsers.
297
- * Falls back to joining source values when no matching parser is found.
298
- *
299
- * @internal
300
- */
301
- declare class FileProcessor {
302
- #private;
303
- parse(file: FileNode, {
304
- parsers,
305
- extension
306
- }?: ParseOptions): Promise<string>;
307
- run(files: Array<FileNode>, {
308
- parsers,
309
- mode,
310
- extension,
311
- onStart,
312
- onEnd,
313
- onUpdate
314
- }?: RunOptions): Promise<Array<FileNode>>;
315
- }
133
+ declare const jsonReporter: Reporter;
316
134
  //#endregion
317
135
  //#region src/storages/fsStorage.d.ts
318
136
  /**
@@ -322,11 +140,11 @@ declare class FileProcessor {
322
140
  * Keys are resolved against `process.cwd()`, so root-relative paths such as
323
141
  * `src/gen/api/getPets.ts` are written to the correct location without extra configuration.
324
142
  *
325
- * Internally uses the `write` utility from `@internals/utils`, which:
326
- * - trims leading/trailing whitespace before writing
327
- * - skips the write when file content is already identical (deduplication)
328
- * - creates missing parent directories automatically
329
- * - supports Bun's native file API when running under Bun
143
+ * Writes are deduplicated and directory-safe:
144
+ * - leading and trailing whitespace is trimmed before writing
145
+ * - the write is skipped when the file content is already identical
146
+ * - missing parent directories are created automatically
147
+ * - Bun's native file API is used when running under Bun
330
148
  *
331
149
  * @example
332
150
  * ```ts
@@ -364,16 +182,5 @@ declare const fsStorage: (options?: Record<string, never> | undefined) => Storag
364
182
  */
365
183
  declare const memoryStorage: (options?: Record<string, never> | undefined) => Storage;
366
184
  //#endregion
367
- //#region src/utils/isInputPath.d.ts
368
- /**
369
- * Type guard to check if a given config has an `input.path`.
370
- */
371
- declare function isInputPath(config: UserConfig | undefined): config is UserConfig<InputPath> & {
372
- input: InputPath;
373
- };
374
- declare function isInputPath(config: Config | undefined): config is Config<InputPath> & {
375
- input: InputPath;
376
- };
377
- //#endregion
378
- export { Adapter, AdapterFactoryOptions, AdapterSource, AsyncEventEmitter, BuildOutput, CLIOptions, Config, DevtoolsOptions, Exclude, FileManager, FileProcessor, Generator, GeneratorContext, Group, Include, InputData, InputPath, Kubb, KubbBuildEndContext, KubbBuildStartContext, KubbConfigEndContext, KubbDebugContext, KubbErrorContext, KubbFileProcessingUpdateContext, KubbFilesProcessingEndContext, KubbFilesProcessingStartContext, KubbGenerationEndContext, KubbGenerationStartContext, KubbGenerationSummaryContext, KubbHookEndContext, KubbHookStartContext, KubbHooks, KubbInfoContext, KubbLifecycleStartContext, KubbPluginEndContext, KubbPluginSetupContext, KubbPluginStartContext, KubbPluginsEndContext, KubbSuccessContext, KubbVersionNewContext, KubbWarnContext, Logger, LoggerContext, LoggerOptions, Middleware, NormalizedPlugin, Output, Override, Parser, Plugin, PluginDriver, PluginFactoryOptions, PossibleConfig, Renderer, RendererFactory, ResolveBannerContext, ResolveNameParams, ResolveOptionsContext, Resolver, ResolverContext, ResolverFileParams, ResolverPathParams, Storage, URLPath, UserConfig, UserLogger, ast, createAdapter, createKubb, createRenderer, createStorage, defineGenerator, defineLogger, defineMiddleware, defineParser, definePlugin, defineResolver, fsStorage, isInputPath, logLevel, memoryStorage };
185
+ export { type Adapter, type AdapterFactoryOptions, type AdapterSource, AsyncEventEmitter, type BannerMeta, BuildOutput, CLIOptions, Config, type Diagnostic, type DiagnosticByCode, type DiagnosticDoc, type DiagnosticKind, type DiagnosticLocation, type DiagnosticSeverity, Diagnostics, type Exclude, type FileProcessorHooks, type GenerationResult, type Generator, type GeneratorContext, type Group, type Include, InputData, InputPath, type Kubb, KubbBuildEndContext, KubbBuildStartContext, KubbDiagnosticContext, KubbDriver, KubbErrorContext, KubbFileProcessingUpdate, KubbFilesProcessingEndContext, KubbFilesProcessingStartContext, KubbFilesProcessingUpdateContext, KubbGenerationEndContext, KubbGenerationStartContext, KubbHookEndContext, KubbHookLineContext, KubbHookStartContext, KubbHooks, KubbInfoContext, KubbLifecycleStartContext, type KubbPluginEndContext, type KubbPluginSetupContext, type KubbPluginStartContext, KubbPluginsEndContext, KubbSuccessContext, KubbWarnContext, type NormalizedPlugin, type Output, type OutputMode, type OutputOptions, type Override, type ParsedFile, type Parser, type PerformanceDiagnostic, type Plugin, type PluginFactoryOptions, PossibleConfig, type ProblemCode, type ProblemDiagnostic, type Renderer, type RendererFactory, type Reporter, type ReporterContext, type ReporterName, type ResolveBannerContext, type ResolveBannerFile, type ResolveOptionsContext, type Resolver, type ResolverContext, type ResolverFileParams, type ResolverPathParams, type SerializedDiagnostic, type Storage, type UpdateDiagnostic, Url, UserConfig, type UserReporter, ast, cliReporter, createAdapter, createKubb, createRenderer, createReporter, createStorage, defineGenerator, defineParser, definePlugin, defineResolver, fileReporter, fsStorage, jsonReporter, logLevel, memoryStorage };
379
186
  //# sourceMappingURL=index.d.ts.map