Skip to content

@kubb/plugin-ky: slim ky client plugin with the RequestResult contract #389

Description

@stijnvanhulle

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.

Scope

import ky from 'ky'
import { createClient } from './.kubb/client'

const client = createClient({
  transport: ky.extend({ retry: 3, hooks: { beforeRequest: [addTracing] } }),
})

Done when

  • pnpm build, pnpm test, pnpm typecheck green for the package
  • Runtime tests cover: HTTPErrorResponseError normalization, throwOnError: false, custom ky instance via transport (retry/hooks respected), interceptors, per-call client override
  • Generated output snapshots match the grouped-options RequestResult contract in both modes, with the runtime inlined in .kubb/client.ts
  • Options documented on the plugin's kubb.dev page in the platform repo (Docs and examples for the slim client plugins #393)
  • Example project generates and typechecks

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions