refactor: consume Url path-template helper from kubb/kit#692
Merged
Conversation
Drop the plugins repo's own copy of the Url class now that kubb core exposes the same toSafeTemplate/toGroupedTemplateString helpers via kubb/kit, so path-template conversion has a single source of truth across both repos. Also drops plugin-msw's getMswUrl, which duplicated Url.toPath's job and was redundantly passed through Url.toPath a second time. Bumps the kubb/@kubb/* catalog pin to 5.0.0-beta.98, the version the companion kubb-labs/kubb changeset produces; this won't resolve (and CI will fail) until that version is published. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012kuZT8RUbKQT5VfC231A8e
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
🦋 Changeset detectedLatest commit: 105d1b6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
getOperationParameters camelCased path params into valid identifiers while leaving query/header/cookie names untouched. Drop that so every param group keeps the exact OpenAPI name, matching kubb core's Url, which no longer needs to rewrite names either (toSafeTemplate is gone, and toGroupedTemplateString falls back to bracket access only for names that aren't valid identifiers). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012kuZT8RUbKQT5VfC231A8e
…onLink The 'pathTemplate' branch reimplemented Url.toPath's job by hand two lines below a call to Url.toPath for the 'urlPath' case. Both branches already produced identical output, so route them both through Url.toPath. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012kuZT8RUbKQT5VfC231A8e
Contributor
📊 Dependency Size ChangesNote 🎉 This PR removes 8.4 kB of dependencies.
Total size change: -8.4 kB |
More templates
@kubb/plugin-axios
@kubb/plugin-cypress
@kubb/plugin-faker
@kubb/plugin-fetch
@kubb/plugin-mcp
@kubb/plugin-msw
@kubb/plugin-react-query
@kubb/plugin-redoc
@kubb/plugin-swr
@kubb/plugin-ts
@kubb/plugin-vue-query
@kubb/plugin-zod
commit: |
Contributor
|
Size Change: -20.7 kB (-6.67%) ✅ Total Size: 290 kB 📦 View Changed
ℹ️ View Unchanged
|
This was referenced Jul 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 Changes
This repo maintained its own copy of the
Urlpath-template helper (internals/utils/src/url.ts), with methods (toSafeTemplate,toGroupedTemplateString) that kubb core's ownUrlclass didn't have. kubb-labs/kubb#3788 adds those methods to kubb core'sUrl, exposed throughkubb/kit.This PR switches every consumer over to
Urlfromkubb/kitand deletes the local duplicate:internals/client/src/components/Operation.tsx,internals/client/src/builders/sdkMethod.ts(Url.toSafeTemplate)packages/plugin-cypress/src/components/Request.tsx(Url.toGroupedTemplateString)packages/plugin-msw/src/components/Mock.tsx(Url.toPath)internals/tanstack-query/src/components/MutationKey.tsx,internals/tanstack-query/src/components/QueryKey.tsx,internals/shared/src/operation.ts(Url.toPath)Also removes
plugin-msw'sgetMswUrl, which manually replaced{/}with:and then had its result passed throughUrl.toPathagain, a redundant double conversion.Mock.tsxnow callsUrl.toPath(node.path)directly.Deletes
internals/utils/src/url.tsand its test, and removes the re-export frominternals/utils/src/index.ts.Bumps the
kubb/@kubb/*catalog pin inpnpm-workspace.yamlto5.0.0-beta.98, the version kubb-labs/kubb#3788's changeset will produce. This version doesn't exist yet, sopnpm installand CI will fail until kubb-labs/kubb#3788 merges and publishes. This PR should land after that one.✅ Checklist
pnpm run test(against a locally built kubb, since the published version doesn't have the newUrlmethods yet).🚀 Release Impact
Generated by Claude Code