-
Notifications
You must be signed in to change notification settings - Fork 834
Fix components package tsconfig #44177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR broadens the TypeScript configuration to include all TS files for type checking and introduces a separate build config that excludes tests and stories.
- Expand
tsconfig.json
to cover all source directories - Add
tsconfig.build.json
to exclude test and story files during build - Update the
compile-ts
script inpackage.json
to use the new build config
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
projects/js-packages/components/tsconfig.json | Expanded include to source, lib, and tools directories |
projects/js-packages/components/tsconfig.build.json | Added build-only config excluding tests and stories |
projects/js-packages/components/package.json | Updated compile-ts script to use tsconfig.build.json |
components/toggle-control/index.tsx | Exported ToggleControlProps |
components/testimonials/test/component.tsx | Switched userEvent to named import |
components/status/index.tsx | Exported StatusProps |
components/radio-control/index.tsx | Exported RadioControlProps |
components/pricing-card/test/component.tsx | Added @ts-expect-error comment for pure subpath import |
components/jetpack-footer/test/component.tsx | Switched userEvent to named import |
changelog/fix-components-tsconfig | Added changelog entry |
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
e3871d9
to
0c47561
Compare
Code Coverage SummaryThis PR did not change code coverage! That could be good or bad, depending on the situation. Everything covered before, and still is? Great! Nothing was covered before? Not so great. 🤷 |
0c47561
to
bcf7bbe
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM now 👍
We should probably look at where we can do this for other TS-using stuff too, and see what we can do about having jetpack generate
nudge people in the right direction. 😀
Right now the components package has tons of TS files but only a couple of them are included for type checking.
jetpack/projects/js-packages/components/tsconfig.json
Line 3 in d8ffb6c
We have TS files for unit tests and storybook stories but none of them are included in type checking.
Related p1751525387197869/1750998434.606469-slack-C05Q5HSS013
Proposed changes:
Other information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions: