feat(examples,tests): nest by adapter and add an Arazzo example - #794
feat(examples,tests): nest by adapter and add an Arazzo example#794stijnvanhulle wants to merge 5 commits into
Conversation
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
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
|
…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
|
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
Generated by Claude Code |
…amples-arazzo-waguvs # Conflicts: # examples/openapi/fetch/package.json
|
Merged Still blocked on kubb-labs/kubb#3927 for CI, as before — no change there. Generated by Claude Code |
…amples-arazzo-waguvs
… 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
|
Merged Two issues from the auto-merge, both fixed:
Full suite passes: 14 test files, 104 tests. Still blocked on kubb-labs/kubb#3927 for CI, as before — no change there. Generated by Claude Code |
🎯 Changes
Kubb now supports two adapters, OpenAPI and Arazzo (kubb-labs/kubb#3927). This PR adds the second layer
examples/andtests/need to say which adapter a project targets, and adds a working Arazzo example to test the new adapter against the plugin ecosystem.examples/<name>toexamples/openapi/<name>, and fromtests/3.0.x,tests/e2e,tests/performancetotests/openapi/<name>.examples/arazzo/typescript, a runnable example that generates TypeScript types from an Arazzo workflow document withplugin-ts.tests/arazzo/1.1.0, an integration test suite for the same combination.pnpm-workspace.yaml, rootpackage.jsonscripts,.github/workflows/pr.yml,README.md, andCONTRIBUTING.mdfor the new nesting.@kubb/adapter-arazzoto the pnpm catalog.Blocked on kubb-labs/kubb#3927
@kubb/adapter-arazzoisn't published yet, sopnpm installcan't resolve it until that PR merges and releases. Until then, this branch is broken for everypnpm 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 freshpnpm installrefreshes the lockfile.What I tested
I built
kubb-labs/kubb#3927's branch from source in a separate worktree and linked it in locally (temporarypnpm-workspace.yamloverride, not part of this diff) to validate end to end:kubb generateinexamples/arazzo/typescriptsucceeds and produces 6 files from the workflow document.tests/arazzo/1.1.0vitest suite passes, and the fulltests/openapi/3.0.xsuite still passes after the move.oxfmtandoxlintare clean across the repo.Two issues surfaced that belong in the kubb repo, not here:
LoginAndReadPetOutputs.tsimports aPettype that@kubb/adapter-arazzonever emits as a top-level schema, even though the workflow'soutputsresolve into it ($steps.readPet.outputs.pet→ the OpenAPI source'sPetresponse schema).tscfails withCannot find module './Pet'.@kubb/plugin-ts's own test suite stops typechecking once built against the@kubb/astversion this PR ships.packages/plugin-ts/src/printers/operationParams.test.tsbuilds override objects typed viaPartial<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/coreto the version this PR ships hits it.✅ Checklist
pnpm run test(against a local build of Adapter arazzo kubb#3927; see above).🚀 Release Impact
packages/*source changed;examples/,tests/, and docs are excluded from changesets in this repo.Generated by Claude Code