Skip to content

Conversation

KenCorbettTruepic
Copy link

This week for Cooldown I decided to try having Github Copilot in Agent mode help me rewrite this library into Typescript. I figured it was an excellent candidate as it had a bunch of unit tests and the code was well structured. It took a bit more than I originally had thought, but I was able to get it converted. As a high level summary, this is what we did:

  • Rewrote everything in Typescript
  • Upgraded to ESLint 9
  • Changed from Jest to Vitest

I did some testing by locally symlinking this library into vision-api and it seems to work like a charm, and best of all it is now type aware!

I don't even know if you want to accept this pull request. queryql is your baby and brain child and I am not trying to take it over. It is just so core to all the list views in Vision, I have wished it was written in typescript for a couple years now. But, if you do not like this rewrite I am happy to just discard it. It was really good practice learning how to prompt agent mode to get it to do what I wanted it to do.

Copy link

@Copilot Copilot AI left a 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 QueryQL library from JavaScript to TypeScript while upgrading the testing framework and linting configuration. The conversion adds comprehensive type safety to a query parsing and validation library that handles filtering, sorting, and pagination for REST APIs.

Key changes include:

  • Complete TypeScript conversion with proper type definitions and interfaces
  • Migration from Jest to Vitest for testing
  • Upgrade from ESLint 8 to ESLint 9 with TypeScript support

Reviewed Changes

Copilot reviewed 83 out of 87 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
vitest.config.ts New Vitest configuration with coverage and reporting setup
src/**/*.ts TypeScript conversion of all source files with type definitions
src/**/*.test.ts Test files converted to TypeScript with Vitest
package.json Dependencies updated for TypeScript, Vitest, and ESLint 9
eslint.config.mjs New ESLint 9 configuration with TypeScript support
tsconfig.json TypeScript compiler configuration (implied)

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@jstayton
Copy link
Collaborator

Hey @KenCorbettTruepic – Wow, crazy! This does seem like something AI would be good at. It's cool to see the result.

Honestly though, I'm not really wanting to convert this to TypeScript at this point. If I were, I'd want to do it manually as an exercise to better learn TypeScript myself. I'd be pretty lost merging this and then having to maintain the code going forward.

Sorry, I imagine you were hoping for a different answer. 😞

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