-
Notifications
You must be signed in to change notification settings - Fork 1
fix: typescript #198
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
fix: typescript #198
Conversation
Summary of ChangesHello @UziTech, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request represents a significant refactoring effort to transition the project to TypeScript. This change aims to improve code reliability, enhance developer tooling, and facilitate easier maintenance and future development by leveraging static type analysis. All JavaScript source and test files have been converted, and the build and test infrastructure has been adapted accordingly. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request primarily focuses on migrating the project to TypeScript, introducing type definitions for existing modules and functions, and updating the build and test processes accordingly. Key changes include adding tsconfig.json, introducing a types.ts file for core data structures, and updating package.json to reflect the TypeScript build (tsc) and test execution (tsx). Dependencies like @types/node, check-dts, tsx, and typescript were added, and js-yaml was updated. The .gitignore file was updated to include the new lib output directory. Review comments suggest refining type definitions in src/declarations.d.ts for front-matter and @markedjs/html-differ to be more specific than any, and correcting the return type of parseMarked in src/run-tests.ts to string | Promise<string> to accurately reflect marked.parse()'s behavior.
|
/gemini review |
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.
Code Review
This pull request is an excellent migration from JavaScript to TypeScript. The conversion is thorough, introducing strong typing across the codebase, which significantly improves maintainability and developer experience. Key improvements include the addition of a well-configured tsconfig.json with strict mode, centralized type definitions, and the correction of several async/await related bugs. The changes are clean and adhere to TypeScript best practices. I have only a couple of minor suggestions to further improve type safety in the test files.
|
/gemini review |
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.
Code Review
This pull request primarily focuses on migrating the project to TypeScript, introducing type definitions, and updating the build and test infrastructure accordingly. Key changes include adding a tsconfig.json file, updating package.json to define main, types, and exports fields pointing to a new lib directory for compiled output, and introducing new build and test:types scripts. Many new development dependencies were added to package-lock.json, including typescript, tsx, and @arethetypeswrong/cli, along with various other packages to support the new tooling and type checking. Code files (src/get-tests.ts, src/helpers.ts, src/html-differ.ts, src/load-tests.ts, src/output-table.ts, src/run-tests.ts) were refactored to include TypeScript type annotations, and a new src/types.ts file was added to define core interfaces. Additionally, src/declarations.d.ts was introduced for external module type declarations. Some functions like firstDiff in src/html-differ.ts were made synchronous, and corresponding await calls were removed from test files.
Convert to typescript