Skip to content

Conversation

@UziTech
Copy link
Member

@UziTech UziTech commented Dec 29, 2025

Convert to typescript

@gemini-code-assist
Copy link

Summary of Changes

Hello @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

  • TypeScript Conversion: The entire project has been migrated from JavaScript to TypeScript, introducing static type checking across the codebase.
  • Type Definitions: New type definition files (src/declarations.d.ts and src/types.ts) have been added to provide strong typing for external modules and internal data structures like Spec, TestSection, and Tests.
  • Build and Test Workflow Updates: The package.json scripts have been updated to include a build command (tsc) and the test command now uses tsx to run TypeScript test files directly, ensuring type-checked tests.
  • Dependency Updates: Numerous development dependencies have been added or updated in package-lock.json and package.json to support the TypeScript ecosystem, including typescript, @types/node, tsx, esbuild, and check-dts.
  • Project Configuration: A tsconfig.json file has been added to configure the TypeScript compiler settings, defining target, module resolution, output directory, and strictness rules.

🧠 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 Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a 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.

@UziTech
Copy link
Member Author

UziTech commented Dec 30, 2025

/gemini review

Copy link

@gemini-code-assist gemini-code-assist bot left a 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.

@UziTech
Copy link
Member Author

UziTech commented Dec 30, 2025

/gemini review

Copy link

@gemini-code-assist gemini-code-assist bot left a 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.

@UziTech UziTech merged commit 0b48e03 into main Dec 30, 2025
6 checks passed
@UziTech UziTech deleted the synchronous branch December 30, 2025 21:07
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.

2 participants