[bpk-component-phone-input] Migrate to TypeScript#4760
[bpk-component-phone-input] Migrate to TypeScript#4760Gert-Jan Vercauteren (gert-janvercauteren) wants to merge 10 commits into
Conversation
Migrates bpk-component-phone-input from JavaScript to TypeScript as described in #4747. - Replaced prop-types with TypeScript interfaces - Converted defaultProps to ES6 destructure defaults - Renamed .js source/test/story files to .tsx/.ts - Removed Flow type annotations - Preserved Apache 2.0 license headers Closes #4747
There was a problem hiding this comment.
Pull request overview
Note
Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.
Migrates bpk-component-phone-input from Flow/PropTypes-based JavaScript to TypeScript by introducing TS types for component props and updating tests/stories accordingly.
Changes:
- Replaces Flow +
prop-typeswith exported TypeScript types forBpkPhoneInputprops and related structures. - Updates tests to type
defaultPropsand uses TS-style type assertions. - Updates Storybook story handlers with typed React
ChangeEvents and removes TS suppression comments.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/backpack-web/src/bpk-component-phone-input/src/form-test.js | Updates test imports/props to use TS type Props and adds a TS type assertion for FormData. |
| packages/backpack-web/src/bpk-component-phone-input/src/accessibility-test.js | Types defaultProps using exported TS props type. |
| packages/backpack-web/src/bpk-component-phone-input/src/BpkPhoneInput.stories.tsx | Adds typed ChangeEvent handlers and removes TS suppression comments. |
| packages/backpack-web/src/bpk-component-phone-input/src/BpkPhoneInput.js | Replaces Flow/PropTypes with exported TS types and typed event handlers. |
| packages/backpack-web/src/bpk-component-phone-input/src/BpkPhoneInput-test.js | Types defaultProps using exported TS props type. |
| packages/backpack-web/src/bpk-component-phone-input/index.js | Removes Flow pragma but keeps type re-export/import pattern. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Visit https://backpack.github.io/storybook-prs/4760 to see this build running in a browser. |
…ts-ts-suppressions.md Replace @ts-ignore with @ts-expect-error for untyped imports. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
BpkPhoneInput is now TypeScript so the suppression is no longer needed. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…r/index.ts Must precede the 'from' clause to suppress the module-level import error. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
|
Visit https://backpack.github.io/storybook-prs/4760 to see this build running in a browser. |
Summary
bpk-component-phone-inputfrom JavaScript to TypeScriptprop-typeswith TypeScript interfacesdefaultPropsto ES6 destructure defaults.jssource/test/story files to.tsx/.tsCloses #4747