-
-
Notifications
You must be signed in to change notification settings - Fork 2
Convert to TypeScript #2
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
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 converts the project from Flow to TypeScript while updating build configurations, tests, and dependencies accordingly.
- Added tsconfig files for tests and builds
- Converted source and test files from Flow to TypeScript and updated type definitions
- Updated bundler, Babel, ESLint, and package scripts to support TypeScript
Reviewed Changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tsconfig.tests.json, tsconfig.build.json | New TypeScript configuration files for tests and builds |
| tests/decorator.test.ts | Converted tests to TypeScript with improved type annotations |
| src/index.ts, src/decorator.ts | Converted source files from Flow to TypeScript, updating APIs |
| rollup.config.js | Updated build configuration to use TypeScript and new globals |
| package.json | Updated package configuration and dependencies for TypeScript conversion |
| package-scripts.js | Converted to ESM and updated scripts for TypeScript builds |
| eslint.config.js | New ESLint configuration supporting TypeScript |
| .github/workflows/*, .babelrc | Updated CI/CD and Babel configurations for TypeScript |
Comments suppressed due to low confidence (2)
tests/decorator.test.ts:225
- Please verify that the expected call count for afterSubmitFailed is intentionally set to 2 in this test case, as previous tests anticipated a single call.
expect(afterSubmitFailed).toHaveBeenCalledTimes(2)
rollup.config.js:60
- Confirm that the external predicate correctly covers all intended dependencies and peer dependencies after the TypeScript conversion.
external: makeExternalPredicate([
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 converts the codebase from Flow to TypeScript, updating configuration files, build scripts, and tests accordingly while removing legacy Flow files.
- Introduces new tsconfig files for tests and build
- Converts source and decorator code to TypeScript and updates Babel/Rollup configurations
- Updates ESLint and CI configurations to support TypeScript
Reviewed Changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tsconfig.tests.json | New TypeScript config for tests |
| tsconfig.build.json | New TypeScript config for build |
| tests/decorator.test.ts | Updated tests with TypeScript types and async patterns |
| src/index.ts | Updated entry file using TypeScript exports |
| src/index.js.flow & src/index.js | Removed Flow type files |
| src/decorator.ts | Converted decorator implementation from Flow to TypeScript |
| rollup.config.js | Updated build config for TypeScript and dependency management |
| package.json & package-scripts.js | Updated scripts and metadata for TypeScript conversion and build tooling |
| eslint.config.js & .eslintrc | Updated ESLint configurations to support TypeScript |
| .babelrc | Adjusted Babel config to switch from Flow to TypeScript with decorator support |
| .github/workflows/* | New/updated CI workflows and automation scripts |
Comments suppressed due to low confidence (2)
tests/decorator.test.ts:27
- Using optional chaining when accessing mock call parameters may hide cases where the callback was not invoked; please verify that this behavior is intentional and that the tests accurately capture the expected callback call scenarios.
expect(beforeSubmit.mock.calls[0]?.[0]).toBeDefined()
.babelrc:19
- Ensure that the new decorator configuration aligns with your project's usage patterns, as switching from Flow to TypeScript may require verifying that the decorator settings (e.g. 'decoratorsBeforeExport': true) are compatible with the TypeScript compiler settings.
{ "version": "2018-09", "decoratorsBeforeExport": true }
Goodbye flow! 👋