[bpk-component-calendar] Migrate remaining JS files to TypeScript#4764
[bpk-component-calendar] Migrate remaining JS files to TypeScript#4764Gert-Jan Vercauteren (gert-janvercauteren) wants to merge 5 commits into
Conversation
Migrates bpk-component-calendar from JavaScript to TypeScript as described in #4751. - 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 #4751
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 remaining bpk-component-calendar JavaScript code toward TypeScript by introducing typed props/utilities and removing prop-types usage in story components.
Changes:
- Added TypeScript type annotations and literal typing (
as const) to legacy prop-type helpers. - Replaced
prop-typesin story components with TypeScript interfaces and destructured defaults. - Removed a
@ts-expect-errorsuppression on thecustom-proptypes-legacyimport.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/backpack-web/src/bpk-component-calendar/src/custom-proptypes-legacy.js | Adds TS types/exports and narrows selection constants. |
| packages/backpack-web/src/bpk-component-calendar/src/BpkCalendar.stories-test-utils.js | Adds TS annotations for date formatting helpers and weekday arrays. |
| packages/backpack-web/src/bpk-component-calendar/src/BpkCalendar.stories-components.js | Migrates story components away from prop-types and adds TS-typed props/state. |
| packages/backpack-web/src/bpk-component-calendar/index.ts | Removes suppression for importing legacy prop-types module. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Visit https://backpack.github.io/storybook-prs/4764 to see this build running in a browser. |
Summary
bpk-component-calendarfrom JavaScript to TypeScriptprop-typeswith TypeScript interfacesdefaultPropsto ES6 destructure defaults.jssource/test/story files to.tsx/.tsCloses #4751