[CLOV-64] BpkStarRating Migrate JS to TypeScript#4523
Open
Vincent Liu (xiaogliu) wants to merge 2 commits into
Open
[CLOV-64] BpkStarRating Migrate JS to TypeScript#4523Vincent Liu (xiaogliu) wants to merge 2 commits into
Vincent Liu (xiaogliu) wants to merge 2 commits into
Conversation
Convert the bpk-component-star-rating package from JavaScript/Flow to TypeScript. Replace prop-types and Flow types with typed Props exports and rename all source/test/snapshot files (.js -> .ts/.tsx). No business-logic, JSX, or rendering changes - existing snapshots remain valid. - Rename index.js -> index.ts and re-export per-component *Props types - Rename BpkStar/BpkStarRating/BpkInteractiveStar/BpkInteractiveStarRating to .tsx with typed Props exports; keep className?: string | null and destructuring defaults in place of defaultProps - Convert STAR_TYPES to as const and derive a StarType union - Migrate withInteractiveStarRatingState to .tsx with a generic class component and a public static displayName field - Rename themeAttributes/accessibility/themeAttributes-test files - Rename snapshot files to *-test.tsx.snap so Jest finds them under the new test filenames - Drop the now-unused @ts-expect-error suppressions on the index/component imports in the stories file Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Visit https://backpack.github.io/storybook-prs/4523 to see this build running in a browser. |
|
Visit https://backpack.github.io/storybook-prs/4523 to see this build running in a browser. |
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
bpk-component-star-ratingpackage from JavaScript/Flow to TypeScript.js->.ts/.tsx) and snapshot files (*-test.js.snap->*-test.tsx.snap) so Jest still finds them under the new test filenamespropTypes+ FlowPropswith typedPropsexports forBpkStar,BpkStarRating,BpkInteractiveStar,BpkInteractiveStarRating, re-exported fromindex.tsasBpkStarProps,BpkStarRatingProps,BpkInteractiveStarProps,BpkInteractiveStarRatingPropsSTAR_TYPEStoas constand derive aStarTypeunionwithInteractiveStarRatingStateto a generic class component (P extends object) with apublic static displayName: stringfield@ts-expect-errorsuppressions on the index/component imports in the stories fileTest plan
npm run jest -- packages/backpack-web/src/bpk-component-star-rating- 7 suites, 42 tests, 30 snapshots all passnpx tsc --noEmit- no errors inbpk-component-star-ratingnpx eslint packages/backpack-web/src/bpk-component-star-rating- no errors, no warnings🤖 Generated with Claude Code