You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Part of #384 — depends on #386 (shared foundation). Mirrors #387/#388 for ky; first ky support in the repo (today it is only mentioned as a custom importPath example).
Summary
New package @kubb/plugin-ky: a slim client plugin pinned to ky, generating functions with the grouped options object and RequestResult contract from #384. Same option surface as the other slim plugins: output, group, include/exclude/override, baseURL, parser, macros.
transport: the config accepts a user-provided ky instance, defaulting to ky — this is also the pass-through for ky-specific behavior (retry, hooks, prefixUrl):
ky throws HTTPError on non-2xx by default — with throwOnError: true (our default) normalize it to ResponseError with the parsed typed body, so the thrown shape is identical across all three plugins
Part of #384 — depends on #386 (shared foundation). Mirrors #387/#388 for ky; first ky support in the repo (today it is only mentioned as a custom
importPathexample).Summary
New package
@kubb/plugin-ky: a slim client plugin pinned to ky, generating functions with the grouped options object andRequestResultcontract from #384. Same option surface as the other slim plugins:output,group,include/exclude/override,baseURL,parser,macros.Scope
src/clients/ky.ts+templates/ky.source.ts, built from the shared runtime sources in internals/client: shared generator foundation for the slim client plugins #386:clientinstance +createClient/setConfig, per-callclientoverridetransport: the config accepts a user-provided ky instance, defaulting toky— this is also the pass-through for ky-specific behavior (retry, hooks, prefixUrl):querySerializer/bodySerializer, auth hook (Slim client plugins: auth from the spec (security metadata +auth()callback) #395), validator hooks (Zod parser support in the slim client plugins (success-only response, request inputs) #390)HTTPErroron non-2xx by default — withthrowOnError: true(our default) normalize it toResponseErrorwith the parsed typed body, so the thrown shape is identical across all three pluginsthrowOnError: falseusesthrowHttpErrors: falseand assembles{ data, error, request, response }Request/Responseon the result (ky exposes both)macros?: Array<ast.Macro>registered viactx.setMacros(foundation wiring, internals/client: shared generator foundation for the slim client plugins #386) — the standard AST-transform hook, authored withast.defineMacro..kubb/client.ts(same as @kubb/plugin-fetch: slim fetch client plugin with the RequestResult contract #387 — nobundleoption);kyitself stays a regular peer import in the generated code, never inlined.apps/kubb.dev/plugins/plugin-ky.md+extensions/plugins/plugin-ky.yaml(tracked under Docs and examples for the slim client plugins #393); the oldplugins/*.yaml+extension.yamlmechanism was removed in chore: stop shipping extension.yaml and remove the yaml generator #398.Done when
pnpm build,pnpm test,pnpm typecheckgreen for the packageHTTPError→ResponseErrornormalization,throwOnError: false, custom ky instance viatransport(retry/hooks respected), interceptors, per-call client overrideRequestResultcontract in both modes, with the runtime inlined in.kubb/client.ts