Repository navigation
refactor(sdk/ui): code quality, structure, and type fixes - #20
Merged
Merged
Conversation
- Rename hooks to kebab-case (useAction→use-action, useCredits→use-credits) - Move errors.ts and types.ts out of internal/ (they're public API) - Move ApiResponse envelope type into api-client.ts (truly internal) - Fix ActionButton.onResult type to use ActionResult (was hiding credits) - Add error field to UseCreditsResult for parity with useAction - Remove redundant subscribeUrl from UseCreditsResult (use data.subscribeUrl) - Remove dead CanupErrorType export - Robust error handling in api-client (wrap fetch + JSON parse) - Rewrite jwt-cache with async/await and safe JWT parsing - Stable ActionButton callbacks via useRef + useCallback - CreditCounter extends Rows props, forwards spacing/align - Deduplicate error normalization via toCanupError - Merge split vitest imports, use shared renderWithCanva - Fix README: remove nonexistent CLI commands and CanupErrorType Made-with: Cursor
Silences TS2686 UMD global warning in editor. Made-with: Cursor
size-limit report 📦
|
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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.
Summary
errors.ts,types.ts) out ofinternal/, rename hooks to kebab-case (use-action.ts,use-credits.ts)ActionButton.onResultto useActionResulttype, adderrorfield touseCredits, remove redundantsubscribeUrlfrom hook result, drop deadCanupErrorTypeexportuseRef, deduplicate error normalization viatoCanupErrorrenderWithCanva, fix relative import pathsCanupErrorTypefrom READMETest plan
pnpm vitest run src/ui/)pnpm tsc --noEmit)pnpm build)Made with Cursor