TS migration 1: configure TS and migrate git_service
Problem to solve
We decided to proceed with migrating the small codebase of this extension to TypeScript #204 (closed). We are going migrate the extension iteratively. This is the first step.
Proposal
We are going to migrate the git_service.js to typescript. This service is providing the extension with information about the project git repository (branches, remotes ..). The rest of the extension is dependent on this service and we can start immediately benefit from using autocomplete in code dependent on git.
graph TD
A[rest of the extension] -->
B[gitlab_service] -->
C[git_service]
A --> C
Further details
In scope
- write integration tests touching the git service - namely, test functionality that uses:
- branch name
- tracking branch name
- current commit SHA
- remote repository URL
- configure TypeScript compilation in a way that it works with the rest of the extension which is still in JavaScript
- configure TypeScript linting and prettier
- rewrite the
git_service.jsto TypeScript - introduce static
create()method as described in !100 (comment 414925480) - manual testing afterwards
Out of scope
- rewriting any other code to TypeScript
- extensive test coverage with unit test (would take too long)
- redesigning the
git_service.js(for easy review, the code branches and interfaces shouldn't change too much)
Links / references
- original decision to split the work this way: #204 (comment 388292319)
- example of the TS configuration and rewrite can be found in !53 (closed)
Edited by Tomas Vik (OOO back on 2026-01-05)