Overview of @kubb/kit tools and helpers
mainThe @kubb/kit package provides the following core abstractions for plugin development:
Definition Wrappers
definePlugin: Wraps a plugin into the expected build engine shape.defineGenerator: Wraps a generator.defineResolver: Wraps a resolver.defineParser: Wraps a parser.
Factories
createAdapter: Factory for custom spec adapters.createRenderer: Factory for output renderers.createStorage: Factory for custom storage backends.
AST and Macros
ast&factory: Node builders used by generators to construct files, schemas, and operation nodes.ast.applyMacros/setMacros: Used with built-in macro presets likemacroDiscriminatorEnum,macroEnumName,macroRenameSchema, andmacroSimplifyUnion. Useast.defineMacroto build custom macros.
Schema and Graph Helpers
- Schema helpers:
childName,enumPropName,extractRefName,isStringType,mergeAdjacentObjectsLazy,syncSchemaRef, andcontainsCircularRef. - Graph helpers (on
ast):resolveRefName,findCircularSchemas, andcollectUsedSchemaNames.