Skip to content

feat(examples,tests): nest by adapter and add an Arazzo example - #794

Draft
stijnvanhulle wants to merge 5 commits into
mainfrom
claude/kubb-plugin-examples-arazzo-waguvs
Draft

feat(examples,tests): nest by adapter and add an Arazzo example#794
stijnvanhulle wants to merge 5 commits into
mainfrom
claude/kubb-plugin-examples-arazzo-waguvs

Conversation

@stijnvanhulle

Copy link
Copy Markdown
Contributor

🎯 Changes

Kubb now supports two adapters, OpenAPI and Arazzo (kubb-labs/kubb#3927). This PR adds the second layer examples/ and tests/ need to say which adapter a project targets, and adds a working Arazzo example to test the new adapter against the plugin ecosystem.

  • Move every existing project from examples/<name> to examples/openapi/<name>, and from tests/3.0.x, tests/e2e, tests/performance to tests/openapi/<name>.
  • Add examples/arazzo/typescript, a runnable example that generates TypeScript types from an Arazzo workflow document with plugin-ts.
  • Add tests/arazzo/1.1.0, an integration test suite for the same combination.
  • Update pnpm-workspace.yaml, root package.json scripts, .github/workflows/pr.yml, README.md, and CONTRIBUTING.md for the new nesting.
  • Add @kubb/adapter-arazzo to the pnpm catalog.

Blocked on kubb-labs/kubb#3927

@kubb/adapter-arazzo isn't published yet, so pnpm install can't resolve it until that PR merges and releases. Until then, this branch is broken for every pnpm run ... command repo-wide (pnpm's dependency status check runs before any script). Opening as draft for that reason; flip to ready once the package publishes and a fresh pnpm install refreshes the lockfile.

What I tested

I built kubb-labs/kubb#3927's branch from source in a separate worktree and linked it in locally (temporary pnpm-workspace.yaml override, not part of this diff) to validate end to end:

  • kubb generate in examples/arazzo/typescript succeeds and produces 6 files from the workflow document.
  • The tests/arazzo/1.1.0 vitest suite passes, and the full tests/openapi/3.0.x suite still passes after the move.
  • oxfmt and oxlint are clean across the repo.

Two issues surfaced that belong in the kubb repo, not here:

  1. Generated output doesn't typecheck. LoginAndReadPetOutputs.ts imports a Pet type that @kubb/adapter-arazzo never emits as a top-level schema, even though the workflow's outputs resolve into it ($steps.readPet.outputs.pet → the OpenAPI source's Pet response schema). tsc fails with Cannot find module './Pet'.
  2. @kubb/plugin-ts's own test suite stops typechecking once built against the @kubb/ast version this PR ships. packages/plugin-ts/src/printers/operationParams.test.ts builds override objects typed via Partial<Parameters<typeof createOperation>[0]>; the new 'arazzo' protocol widens that inferred type enough that the merged object no longer satisfies the HTTP-only overload. This isn't specific to using Arazzo — any consumer bumping @kubb/ast/@kubb/core to the version this PR ships hits it.

✅ Checklist

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is for the docs (no release). No packages/* source changed; examples/, tests/, and docs are excluded from changesets in this repo.

Generated by Claude Code

Kubb now supports two adapters, OpenAPI and Arazzo (kubb-labs/kubb#3927), so
examples/ and tests/ each need a second layer to say which adapter a project
targets. Move every existing project under examples/openapi/ and
tests/openapi/, and add examples/arazzo/typescript and tests/arazzo/1.1.0 to
exercise the new adapter with plugin-ts end to end.

@kubb/adapter-arazzo isn't published yet, so pnpm can't resolve it until
kubb-labs/kubb#3927 merges and releases.

Verified locally against that PR's branch (adapter-arazzo built from source
and linked in): generation succeeds and the vitest suite passes, but the
generated output doesn't typecheck — LoginAndReadPetOutputs.ts imports a
`Pet` type that the adapter never emits as a top-level schema, even though
a workflow's outputs resolve into it. Bumping @kubb/ast to the version that
ships with this PR also breaks plugin-ts's own operationParams.test.ts
typecheck: the new 'arazzo' protocol widens what
Parameters<typeof createOperation> allows through Partial<...>, so the
HTTP-only override object no longer satisfies the HTTP overload.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013suNzME7WSnyEz9kB7JWRa
@codesandbox

codesandbox Bot commented Aug 26, 2026

Copy link
Copy Markdown

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@changeset-bot

changeset-bot Bot commented Aug 26, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 5bec6d0

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

…rride line

The generated example files were hand-written after a container restart
wiped the real `kubb generate` output, and used semicolons and double
quotes instead of the repo's oxfmt style. Regenerated them for real
against a local build of kubb-labs/kubb#3927. pnpm-workspace.yaml also
had the unplugin-kubb override line duplicated from an earlier edit.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013suNzME7WSnyEz9kB7JWRa

Copy link
Copy Markdown
Contributor Author

CI is red on this commit: Lint and format, Build, and Linting all fail. This isn't a bug in the diff — every one of those jobs runs pnpm install first, and that fails with [ERR_PNPM_FETCH_404] GET https://registry.npmjs.org/@kubb%2Fadapter-arazzo: Not Found, exactly as flagged in the PR description under "Blocked on kubb-labs/kubb#3927".

@kubb/adapter-arazzo isn't published yet, so there's no fix to port here — it resolves itself once kubb-labs/kubb#3927 merges and releases and a fresh pnpm install picks up the real package. No re-run needed since the failure is deterministic, not a flake. Keeping this PR watched until that happens.


Generated by Claude Code

…amples-arazzo-waguvs

# Conflicts:
#	examples/openapi/fetch/package.json

Copy link
Copy Markdown
Contributor Author

Merged main in to clear a conflict (a @tanstack/* version bump from #795 landed on examples/vue-query/package.json while I'd renamed the whole examples/ tree — git's rename detection cross-matched it against examples/fetch/package.json, so I fixed the mismatch by hand: fetch's deps stayed as-is, vue-query picked up @tanstack/vue-query^5.102.2). Everything else auto-merged cleanly. oxfmt/oxlint still clean after the merge.

Still blocked on kubb-labs/kubb#3927 for CI, as before — no change there.


Generated by Claude Code

claude added 2 commits August 27, 2026 14:07
… test input paths

Merged main (through PR #802) into this branch. Git's rename detection
couldn't map main's new snapshot files (pluginZod/directionalPrinterNode,
pluginAxios/zodTypes, pluginFetch/zodTypes, pluginFetch/zodTypesSdk) onto
the tests/openapi/3.0.x/ nesting since they never existed at the old path
in this branch's history, so they landed under a stray tests/3.0.x/. Moved
them into tests/openapi/3.0.x/__snapshots__ and removed the stray directory.

The new pluginAxios/pluginFetch/pluginZod test config blocks main added
also carried input paths sized for the old flat tests/3.0.x/ layout
(../../schemas/...), which resolved to nothing one level too shallow.
Fixed to ../../../schemas/... to match every other entry in those files.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013suNzME7WSnyEz9kB7JWRa

Copy link
Copy Markdown
Contributor Author

Merged main in again to clear another conflict (PR #802, a changeset-release version bump that also added new plugin-zod/axios/fetch test snapshots and config blocks).

Two issues from the auto-merge, both fixed:

  • The new snapshot files (pluginZod/directionalPrinterNode, pluginAxios/zodTypes, pluginFetch/zodTypes, pluginFetch/zodTypesSdk) never existed at the old tests/3.0.x/ path in this branch's history, so git couldn't detect them as renames — they landed in a stray tests/3.0.x/ alongside tests/openapi/3.0.x/. Moved them into tests/openapi/3.0.x/__snapshots__ and removed the stray directory.
  • The new test config blocks main added used ../../schemas/... input paths sized for the old flat layout, one level too shallow for tests/openapi/3.0.x/. Fixed to ../../../schemas/... to match every other entry.

Full suite passes: 14 test files, 104 tests. oxfmt/oxlint clean.

Still blocked on kubb-labs/kubb#3927 for CI, as before — no change there.


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants