Skip to content

chore: upgrade @kubb/* to alpha.56, fix barrel middleware bugs, update requestBody snapshots#58

Merged
stijnvanhulle merged 42 commits intomainfrom
copilot/update-kubb-packages-alpha-version
Apr 24, 2026
Merged

chore: upgrade @kubb/* to alpha.56, fix barrel middleware bugs, update requestBody snapshots#58
stijnvanhulle merged 42 commits intomainfrom
copilot/update-kubb-packages-alpha-version

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 23, 2026

🎯 Changes

Upgrades @kubb/* dependencies to alpha.56 and resolves the resulting typecheck and example-generation breakages.

  • Fix examples/client/src/generators/clientStaticGenerator.tsx for the new requestBody.content[] shape.
  • Update example configs to set explicit barrelType:
    • examples/client uses barrelType: 'all'.
    • examples/cypress, examples/fetch, examples/react-query, and examples/simple-single use barrelType: 'named' (preferred default).
    • examples/mcp keeps barrelType: 'all' because its tsconfig enables verbatimModuleSyntax, which is incompatible with the mixed value+type re-exports produced by 'named' (TS1205).
    • examples/advanced disables the root barrel (barrelType: false) due to multi-plugin name collisions, and src/index.ts is updated accordingly.
  • Regenerate all examples to match the new barrel format.
  • Update test snapshots to match the new requestBody.content[] AST:
    • caseSensitivity/types/CreateOrder.ts$ref-based requestBody now resolves to data?: never.
    • issue2619/zod/createReturnTypeASchema.ts — removed typeARequestSchema import and createReturnTypeADataSchema.
    • issue2619/zod/createReturnTypeBSchema.ts — removed typeBRequestSchema import and createReturnTypeBDataSchema.
  • Move the petstore npm run typecheck out of the kubb done: hook in tests/e2e/kubb-petstore.config.js and into an explicit CI step in .github/workflows/pr.yml, so on Windows the actual tsc output is captured (the kubb hook's detached pipe was swallowing stdout from npm.cmd → tsc, hiding the real failure).

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm run test (52 files, 819 tests).
  • pnpm typecheck passes (13/13).
  • pnpm typecheck:examples passes (14/14).
  • pnpm generate succeeds for all examples.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is for the docs (no release).

Copilot AI and others added 3 commits April 23, 2026 18:02
Update all test files to use the new OperationNode requestBody structure
where schema and keysToOmit are nested inside a content array.

OLD: requestBody: { schema: X, contentType: 'Y' }
NEW: requestBody: { content: [{ contentType: 'Y', schema: X }] }

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: stijnvanhulle <5904681+stijnvanhulle@users.noreply.github.com>
…cture

Update all usages across plugin-client, plugin-mcp, plugin-zod,
plugin-react-query, plugin-vue-query, and tanstack-query internals
to use the new nested content array structure introduced in alpha.55:

- node.requestBody?.schema → node.requestBody?.content?.[0]?.schema
- node.requestBody?.contentType → node.requestBody?.content?.[0]?.contentType
- node.requestBody?.keysToOmit → node.requestBody?.content?.[0]?.keysToOmit

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: stijnvanhulle <5904681+stijnvanhulle@users.noreply.github.com>
@codesandbox
Copy link
Copy Markdown

codesandbox Bot commented Apr 23, 2026

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 23, 2026

⚠️ No Changeset found

Latest commit: 7fc296c

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

… upstream)

Agent-Logs-Url: https://github.com/kubb-labs/plugins/sessions/3721bfa6-f2a4-4b65-8120-112b32fbb9a2

Co-authored-by: stijnvanhulle <5904681+stijnvanhulle@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 23, 2026

📊 Dependency Size Changes

Note

🎉 This PR removes 138.2 kB of dependencies.

📦 Package 📏 Size
@redocly/config@0.48.0 → @redocly/config@0.48.1 -126.7 kB
@kubb/middleware-barrel@5.0.0-alpha.67 79.5 kB
@rolldown/binding-linux-x64-gnu@1.0.0-rc.16 → @rolldown/binding-linux-x64-gnu@1.0.0-rc.17 -77.8 kB
@kubb/core@5.0.0-alpha.53 → @kubb/core@5.0.0-alpha.67 -69.2 kB
@emnapi/core@1.9.2 → @emnapi/core@1.10.0 16.3 kB
@tanstack/query-core@5.99.2 → @tanstack/query-core@5.100.1 13.2 kB
@kubb/parser-ts@5.0.0-alpha.53 → @kubb/parser-ts@5.0.0-alpha.67 12.1 kB
@kubb/agent@5.0.0-alpha.53 → @kubb/agent@5.0.0-alpha.67 -11.3 kB
@emnapi/runtime@1.9.2 → @emnapi/runtime@1.10.0 9.3 kB
@kubb/adapter-oas@5.0.0-alpha.53 → @kubb/adapter-oas@5.0.0-alpha.67 6.4 kB
kubb@5.0.0-alpha.53 → kubb@5.0.0-alpha.67 4.1 kB
@kubb/cli@5.0.0-alpha.53 → @kubb/cli@5.0.0-alpha.67 -4 kB
@kubb/ast@5.0.0-alpha.53 → @kubb/ast@5.0.0-alpha.67 2.9 kB
msw@2.13.4 → msw@2.13.5 2.6 kB
oas@32.1.15 → oas@32.1.17 2.3 kB
vite@8.0.9 → vite@8.0.10 515 B
svelte@5.55.4 → svelte@5.55.5 476 B
@tanstack/vue-query@5.99.2 → @tanstack/vue-query@5.100.1 442 B
rolldown@1.0.0-rc.16 → rolldown@1.0.0-rc.17 294 B
@tanstack/react-query@5.99.2 → @tanstack/react-query@5.100.1 240 B
@redocly/openapi-core@2.29.1 → @redocly/openapi-core@2.29.2 -68 B
unplugin-kubb@5.0.0-alpha.53 → unplugin-kubb@5.0.0-alpha.67 41 B
tsdown@0.21.9 → tsdown@0.21.10 6 B
@kubb/renderer-jsx@5.0.0-alpha.53 → @kubb/renderer-jsx@5.0.0-alpha.67 -4 B
@tanstack/react-query-devtools@5.99.2 → @tanstack/react-query-devtools@5.100.1 4 B
@kubb/mcp@5.0.0-alpha.53 → @kubb/mcp@5.0.0-alpha.67 -2 B
@tanstack/query-devtools@5.99.2 → @tanstack/query-devtools@5.100.1 2 B
@rolldown/pluginutils@1.0.0-rc.16 → @rolldown/pluginutils@1.0.0-rc.17 0 B
@oxc-project/types@0.126.0 → @oxc-project/types@0.127.0 0 B
unrun@0.2.36 → unrun@0.2.37 0 B

Total size change: -138.2 kB

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 23, 2026

More templates

@kubb/plugin-client

npm i https://pkg.pr.new/@kubb/plugin-client@58

@kubb/plugin-cypress

npm i https://pkg.pr.new/@kubb/plugin-cypress@58

@kubb/plugin-faker

npm i https://pkg.pr.new/@kubb/plugin-faker@58

@kubb/plugin-mcp

npm i https://pkg.pr.new/@kubb/plugin-mcp@58

@kubb/plugin-msw

npm i https://pkg.pr.new/@kubb/plugin-msw@58

@kubb/plugin-react-query

npm i https://pkg.pr.new/@kubb/plugin-react-query@58

@kubb/plugin-redoc

npm i https://pkg.pr.new/@kubb/plugin-redoc@58

@kubb/plugin-ts

npm i https://pkg.pr.new/@kubb/plugin-ts@58

@kubb/plugin-vue-query

npm i https://pkg.pr.new/@kubb/plugin-vue-query@58

@kubb/plugin-zod

npm i https://pkg.pr.new/@kubb/plugin-zod@58

commit: 7fc296c

@stijnvanhulle
Copy link
Copy Markdown
Contributor

@copilot resolve test issues by updating test cases to follow the changes we did for requestBody in ast and adapter-oas. Also run format en lint:fix and commit those changes

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 23, 2026

@copilot resolve test issues by updating test cases to follow the changes we did for requestBody in ast and adapter-oas. Also run format en lint:fix and commit those changes

Updated all 3 failing snapshots in fd3c5f6:

  • caseSensitivity/types/CreateOrder.ts$ref-based requestBody now resolves to data?: never (the content is no longer inlined)
  • issue2619/zod/createReturnTypeASchema.ts — removed typeARequestSchema import and createReturnTypeADataSchema
  • issue2619/zod/createReturnTypeBSchema.ts — removed typeBRequestSchema import and createReturnTypeBDataSchema

All 819 tests now pass. Lint and format don't touch __snapshots__ (excluded in both oxlint.config.ts and oxfmt.config.ts via **/__snapshots__/**).

Copilot AI changed the title chore: upgrade @kubb/* to alpha.55, migrate requestBody API, document barrel middleware bugs chore: upgrade @kubb/* to alpha.56, fix barrel middleware bugs, update requestBody snapshots Apr 23, 2026
…snapshots

Agent-Logs-Url: https://github.com/kubb-labs/plugins/sessions/04bc86bc-4141-4faf-85f5-4b6d170bfdeb

Co-authored-by: stijnvanhulle <5904681+stijnvanhulle@users.noreply.github.com>
Agent-Logs-Url: https://github.com/kubb-labs/plugins/sessions/fab22cab-b95a-4083-8d70-099e1ccea185

Co-authored-by: stijnvanhulle <5904681+stijnvanhulle@users.noreply.github.com>
@dosubot dosubot Bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:XXL This PR changes 1000+ lines, ignoring generated files. labels Apr 24, 2026
@dosubot dosubot Bot added size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels Apr 24, 2026
@stijnvanhulle
Copy link
Copy Markdown
Contributor

@copilot why does it fail on windows?

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 24, 2026

@copilot why does it fail on windows?

Looked at the failing Windows job (e2e / Build and test on windows-latest, run 24885276002). It's failing during pnpm run generate:petstore — specifically the done: ['npm run typecheck'] hook in tests/e2e/kubb-petstore.config.js:

Hook npm run typecheck started
Hook npm run typecheck completed
##[error]Hook execute failed: npm run typecheck
 ELIFECYCLE  Command failed with exit code 1.

The tsc exit code is non-zero but no output is captured between "started" and "completed". On Linux the same hook executes cleanly and pnpm typecheck from tests/e2e passes. So the failure looks Windows-specific — most likely a verbatimModuleSyntax: true (TS1205) edge case in a generated barrel that doesn't trigger on Linux/macOS.

The reason we can't see the actual TS error is that @kubb/cli's runHook uses tinyexec with nodeOptions: { detached: true }, and on Windows when npm.cmd spawns tsc the stdout from the npm.cmd → node child chain isn't being forwarded back through the detached pipe — so the onStdout sink never fires (tsc writes errors to stdout, not stderr).

Two ways forward, both small and not really part of this PR's scope:

  1. Run typecheck out-of-band in CI (pnpm --filter e2e typecheck after generate:petstore) instead of as a done: hook, so we get the full tsc output.
  2. Fix runHook upstream to drop detached: true on Windows (or pipe through cmd /c) so hook stdout is captured.

Want me to switch the petstore CI step to run typecheck explicitly so we can see the actual TS errors and fix them in this PR? Otherwise the Windows log can't tell us which file/line is failing.

Agent-Logs-Url: https://github.com/kubb-labs/plugins/sessions/857e00eb-b81a-4bfc-9473-266ad0e8a6aa

Co-authored-by: stijnvanhulle <5904681+stijnvanhulle@users.noreply.github.com>
@stijnvanhulle
Copy link
Copy Markdown
Contributor

@copilot yes please

…Windows

Agent-Logs-Url: https://github.com/kubb-labs/plugins/sessions/f9124c5d-49b1-4317-8112-c2f10116a2cf

Co-authored-by: stijnvanhulle <5904681+stijnvanhulle@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 24, 2026

@copilot yes please

Done in 1dc36b9 — moved npm run typecheck out of the done: hook in kubb-petstore.config.js and added it as an explicit step after pnpm run generate:petstore in .github/workflows/pr.yml. The next Windows run should now print the actual tsc errors instead of the silent hook failure.

@stijnvanhulle stijnvanhulle merged commit 5ed1188 into main Apr 24, 2026
17 checks passed
@stijnvanhulle stijnvanhulle deleted the copilot/update-kubb-packages-alpha-version branch April 24, 2026 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants