Skip to content
Reference

Deprecations

Every deprecated Kubb v5 API, the package it ships in, and what to use instead before Kubb v6 removes it.

Kubb v6 removes every API on this page. Each one still works in v5. Move to the replacement before you upgrade.

@kubb/core

DeprecatedUse instead
definePlugindefineExtension with kind: 'plugin'
defineParserdefineExtension with kind: 'parser'
createAdapterdefineExtension with kind: 'adapter'
BuildOutput.driverfiles, input and storage on the same result, and kubb.config for the plugins
ctx.driver in plugin hooksschemas, getPlugin and memo
Parser.inline as an InlineLanguage objectParser.inline as a function, (files) => InlineResult
driver.getResolver(pluginName)ctx.getResolver(pluginName) in a template, or getResolver(pluginName) from kubb/kit
addGenerator, setResolver, setMacros, addMacro, createResolver, defineResolver, defineGenerator, toFilePath, Resolver from @kubb/coreThe same names from kubb/kit
adapter.document and adapter.sources, which follow the last parse()document and sources on the result of adapter.parse(), which belong to that one call
assertPluginOption from @kubb/coreassertPluginOption from kubb/kit
driver.inputNodedriver.input.node, next to the sources that parse read
KubbDriverDriver
CreateKubbOptions type, also re-exported from kubbKubbOptions
Exclude and Include typesFilter
runHook, HookResult, RunHookOptionsrunCommand, CommandResult, RunCommandOptions
KubbHookStartContext, KubbHookLineContext, KubbHookEndContext typesKubbCommandStartContext, KubbCommandLineContext, KubbCommandEndContext
kubb:hooks:start, kubb:hook:start, kubb:hook:line, kubb:hook:end, kubb:hooks:end events, which still firekubb:commands:start, kubb:command:start, kubb:command:line, kubb:command:end, kubb:commands:end

@kubb/kit

DeprecatedUse instead
definePlugindefineExtension with kind: 'plugin'
defineGeneratordefineTemplate
addGeneratordefineTemplate and addTemplate
setMacrosaddMacro(...macros)
Generator typeTemplate with defineTemplate and addTemplate
camelCasecasing.camel
pascalCasecasing.pascal
extractRefNameast.ref.getName
syncSchemaRefast.ref.mergeSchema
isStringTypeast.schema.is(node, 'string')
macroSimplifyUnionmacroDedupeUnion

In Kubb v6, ctx.printer in a template is typed as possibly undefined, as it is at runtime when the plugin registers no printer. Check it before you use it, for example with if (!ctx.printer) return null.

@kubb/ast

DeprecatedUse instead
isBareRefast.ref.isAlias
mergeRefWithSchemaast.ref.mergeSchema
refName, resolveRefNameast.ref.getName
resolveRefast.ref.getSchema
collectImportedRefNamesast.graph.getImportedNames
collectSchemaRefsast.graph.getRefNames
collectUsedSchemaNamesast.graph.getUsedNames
findCircularSchemasast.graph.getCircularNames
getSchemaLiteralValuesast.schema.getLiterals
inferDiscriminatorPropertyNameast.schema.inferDiscriminator
resolveSchemaPropertiesast.schema.findProperties
isHttpOperationNodeast.http.isOperation
collect, collectSyncast.node.collect
optionalityast.schema.applyOptionality
extractStringsFromNodesast.node.getText
compareEnforceast.macro.compareOrder
applyMacrosast.macro.apply
createPrintercreatePrinter from @kubb/kit
defineMacrodefineMacro from @kubb/kit
nodeKindsast.node.kinds
schemaTypesast.schema.types
findSchemaast.schema.find
narrowSchemaast.schema.narrow
transformast.node.transform
inlineFilesast.file.inline
ast.file.inline, InlineLanguageThe Parser.inline(files) hook, as in parserTs
ast.schema.isStringast.schema.is(node, 'string')
followRefs option of findSchemafollow: ['ref']
ImportNode namenames
ImportNode and ExportNode isTypeOnlyspace: 'type' on each name
ImportNode isNameSpace, ExportNode asAlias{ name: '*', alias } in names
ExportNode namenames
SourceNode isTypeOnlyspace: 'type'
SourceNode isExportable, isIndexableexport
SourceNode inlineinline on the file
ObjectSchemaNode minProperties, maxPropertiesmin, max
NumberSchemaNode exclusiveMinimum, exclusiveMaximumexclusive.min, exclusive.max

@kubb/renderer-jsx

DeprecatedUse instead
File.SourceCode or Raw, or Const, Type or Function directly in File
inline prop on Const, Type and Functioninline on the File

@kubb/parser-ts

DeprecatedUse instead
TsNode (compiler nodes passed to print)Printed strings