@kubb/core
Advanced tools
Sorry, the diff of this file is too big to display
+1
-1
| import { t as __name } from "./chunk-C0LytTxp.js"; | ||
| 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-DiaUv_iK.js"; | ||
| 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-D0G07LHG.js"; | ||
| import * as ast from "@kubb/ast"; | ||
@@ -4,0 +4,0 @@ |
+1
-1
| import { t as __name } from "./chunk-C0LytTxp.js"; | ||
| import { At as Adapter, G as Generator, J as KubbDriver, U as Parser, h as Config, jt as AdapterFactoryOptions, st as PluginFactoryOptions, tt as NormalizedPlugin } from "./diagnostics-DiaUv_iK.js"; | ||
| import { At as Adapter, G as Generator, J as KubbDriver, U as Parser, h as Config, jt as AdapterFactoryOptions, st as PluginFactoryOptions, tt as NormalizedPlugin } from "./diagnostics-D0G07LHG.js"; | ||
| import { FileNode, InputMeta, Macro, OperationNode, SchemaNode } from "@kubb/ast"; | ||
@@ -4,0 +4,0 @@ |
+4
-4
| { | ||
| "name": "@kubb/core", | ||
| "version": "5.0.0-beta.61", | ||
| "version": "5.0.0-beta.62", | ||
| "description": "Core engine for Kubb's plugin-based code generation system. Provides the plugin driver, file manager, defineConfig, and build orchestration used by every Kubb plugin.", | ||
@@ -59,10 +59,10 @@ "keywords": [ | ||
| "dependencies": { | ||
| "@kubb/ast": "5.0.0-beta.61" | ||
| "@kubb/ast": "5.0.0-beta.62" | ||
| }, | ||
| "devDependencies": { | ||
| "@internals/utils": "0.0.0", | ||
| "@kubb/renderer-jsx": "5.0.0-beta.61" | ||
| "@kubb/renderer-jsx": "5.0.0-beta.62" | ||
| }, | ||
| "peerDependencies": { | ||
| "@kubb/renderer-jsx": "5.0.0-beta.61" | ||
| "@kubb/renderer-jsx": "5.0.0-beta.62" | ||
| }, | ||
@@ -69,0 +69,0 @@ "engines": { |
@@ -1,2 +0,2 @@ | ||
| import type { FileNode, HttpMethod, Macro, UserFileNode } from '@kubb/ast' | ||
| import type { Enforce, FileNode, HttpMethod, Macro, UserFileNode } from '@kubb/ast' | ||
| import { diagnosticCode } from './constants.ts' | ||
@@ -354,3 +354,3 @@ import type { Generator } from './defineGenerator.ts' | ||
| */ | ||
| enforce?: 'pre' | 'post' | ||
| enforce?: Enforce | ||
| /** | ||
@@ -357,0 +357,0 @@ * The options passed by the user when calling the plugin factory. |
+10
-26
@@ -5,3 +5,3 @@ import { resolve } from 'node:path' | ||
| import { collectUsedSchemaNames } from '@kubb/ast/utils' | ||
| import type { FileNode, InputMeta, InputNode, OperationNode, SchemaNode } from '@kubb/ast' | ||
| import type { Enforce, FileNode, InputMeta, InputNode, OperationNode, SchemaNode } from '@kubb/ast' | ||
| import { OPERATION_FILTER_TYPES, SCHEMA_PARALLEL } from './constants.ts' | ||
@@ -49,3 +49,3 @@ import { type Diagnostic, Diagnostics, type ProblemDiagnostic } from './diagnostics.ts' | ||
| function enforceOrder(enforce: 'pre' | 'post' | undefined): number { | ||
| function enforceOrder(enforce: Enforce | undefined): number { | ||
| return enforce === 'pre' ? -1 : enforce === 'post' ? 1 : 0 | ||
@@ -287,34 +287,18 @@ } | ||
| registerGenerator(pluginName: string, generator: Generator): void { | ||
| if (generator.schema) { | ||
| const schemaHandler = async (node: SchemaNode, ctx: GeneratorContext) => { | ||
| if (ctx.plugin.name !== pluginName) return | ||
| const result = await generator.schema!(node, ctx) | ||
| const register = <TNode>(event: keyof KubbHooks & string, method: ((node: TNode, ctx: GeneratorContext) => unknown) | undefined): void => { | ||
| if (!method) return | ||
| await this.dispatch({ result, renderer: generator.renderer }) | ||
| } | ||
| this.#trackListener('kubb:generate:schema', schemaHandler) | ||
| } | ||
| if (generator.operation) { | ||
| const operationHandler = async (node: OperationNode, ctx: GeneratorContext) => { | ||
| const handler = async (node: TNode, ctx: GeneratorContext) => { | ||
| if (ctx.plugin.name !== pluginName) return | ||
| const result = await generator.operation!(node, ctx) | ||
| const result = await method(node, ctx) | ||
| await this.dispatch({ result, renderer: generator.renderer }) | ||
| } | ||
| this.#trackListener('kubb:generate:operation', operationHandler) | ||
| this.#trackListener(event, handler as HookListener<KubbHooks[typeof event], unknown>) | ||
| } | ||
| if (generator.operations) { | ||
| const operationsHandler = async (nodes: Array<OperationNode>, ctx: GeneratorContext) => { | ||
| if (ctx.plugin.name !== pluginName) return | ||
| const result = await generator.operations!(nodes, ctx) | ||
| await this.dispatch({ result, renderer: generator.renderer }) | ||
| } | ||
| register('kubb:generate:schema', generator.schema) | ||
| register('kubb:generate:operation', generator.operation) | ||
| register('kubb:generate:operations', generator.operations) | ||
| this.#trackListener('kubb:generate:operations', operationsHandler) | ||
| } | ||
| this.#eventGeneratorPlugins.add(pluginName) | ||
@@ -321,0 +305,0 @@ } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
1103154
-0.28%16230
-0.29%+ Added
+ Added
- Removed
- Removed
Updated