refactor(ui): standardize generated client imports to use barrel - #6930
Open
luizhf42 wants to merge 1 commit into
Open
refactor(ui): standardize generated client imports to use barrel#6930luizhf42 wants to merge 1 commit into
luizhf42 wants to merge 1 commit into
Conversation
`includeInEntry: true` makes the barrel re-export every generated symbol (`*Options`, `*QueryKey`, `*Mutation`, types). Importing from the barrel instead of the internal submodules (`@tanstack/react-query.gen`, `types.gen`) means tests only ever need to mock `@/client`.
|
Claude finished @luizhf42's task in 1m 39s —— View job Code Review CompleteReviewed 77 files across code quality, security, testing, language patterns, and architecture — no new issues found. The code looks good as-is. This is a mechanical, uniform migration of generated-client imports to the
If you push additional changes and want a new review, tag |
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.
What
All hooks and production code now import generated client symbols (
*Options,*QueryKey,*Mutation, types) from the@/clientbarrel instead of internal submodules (@/client/@tanstack/react-query.gen,@/client/types.gen,@/client/sdk.gen).Why
Prerequisite for shellhub-io/team#216 (Task 5). Once every hook imports from the barrel, page and component tests only need a single
vi.mock("@/client")to intercept all SDK calls — eliminating the need to mock individual submodules or hooks.Changes
openapi-ts.config.ts: addedincludeInEntry: trueto all@hey-api/openapi-tsplugin entries so the barrel re-exports every generated symbol../client/@tanstack/react-query.gen,../client/types.gen, and../client/sdk.geninto a single../clientimportConnectDrawer,BillingSection,License,license.ts): same submodule-to-barrel migration@/client/@tanstack/react-query.gento@/clientDeviceLimitBanner,LicenseBanner,LicenseGuard): merged separate@/client/@tanstack/react-query.genmocks into the existing@/clientmock block — these tests had split mocks because the hooks previously imported from different submodulesWebEndpoints):@/client/sdk.gen→@/clientTesting
npm run testpasses. The hook and component tests that changed mock targets were the ones that broke when imports moved to the barrel — each was verified individually.