Skip to content
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

Convert code base to Typescript #116

Merged
merged 8 commits into from
Apr 20, 2024

Conversation

connectdotz
Copy link
Collaborator

Changes

  • Convert all codebase to Typescript
  • Replaced most manually maintained duplicated type definitions with the original types (from jest and babel)
  • Given that all the code bases are now TS, I replaced the Babel typescript compiler with tsc.
  • Replace babel-jest with ts-test to run Jest with better type error detection.
  • Removed all flow artifacts
  • Upgraded eslint with prettier
  • Generate index.d.ts from the ts files.
  • Removed husky.

Backward compatibility

This PR does not change functionality, and I try to keep the types as backward-compatible as possible. However, there are still some breaking changes (mainly types). Therefore, mark this as "32.0.0-beta.0" to start preparing for the next major release.

Integration Testing

I have done some preliminary tests with vscode-jest and it seems to work fine. Would encourage other dependent systems to try out and let me know if there are any other unexpected issues.

@seanpoulter
Copy link
Member

I'm curious why you chose to remove husky at the same time.

tsconfig.prod.json Outdated Show resolved Hide resolved
@seanpoulter
Copy link
Member

Wow! 👏 🎉

I'm realizing I won't be able to review a diff this big in my spare time, especially with renaming the files and changes not being picked up
3a9d429#diff-4fa18de8d59e8fbce3df7e88da529ad458bbf37e526d58d30b56707ba4d0d8b6

Sorry. That's as far as I'll get. 😶‍🌫️

@connectdotz
Copy link
Collaborator Author

@seanpoulter, Thanks for taking a look. I know this is a tough PR to review, sorry. I gave up the piecemeal approach as it made the conversion much harder 😰... You already helped, thank you.🙏 It's nice to know that I am not alone on this!

I figure we will bite the bullet and do this in one PR, but we won't release it to prod (thus the 32.0.0-beta.0 version), so we can have more time to test and fix when needed. Does that sound alright?

@connectdotz
Copy link
Collaborator Author

I'm curious why you chose to remove husky at the same time.

Mainly to simplify the env and reduce maintenance overhead. Given we already have lint/CI to detect errors and prettier-write to correct them, I thought husky/lint-staged didn't really add any extra value... Besides, we didn't use them in vscode-jest and it seems to be fine.

@connectdotz connectdotz merged commit a03bf1c into jest-community:master Apr 20, 2024
10 checks passed
@connectdotz connectdotz deleted the convert-to-ts branch April 20, 2024 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants