grats
grats copied to clipboard
Make --watch mode more incremental
To start with, ideally we don't need to re-extract from files that have not changed
Did some research and found a few leads:
- https://github.com/microsoft/TypeScript/pull/20234
- https://github.com/vlcn-io/typed-sql/blob/main/packages/cli/src/Analyzer.ts#L102
- https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#writing-an-incremental-program-watcher
- Using the Language Service API · microsoft/TypeScript Wiki · GitHub https://github.com/microsoft/TypeScript/wiki/Using-the-Language-Service-API
The most promising looking thing so far is these two methods on ts.LanguageServiceHost:
.getProjectVersion().getScriptVersion()
I suspect these will let me track changes more incrementally.
https://github.com/vlcn-io/typed-sql/blob/main/packages/cli/src/Analyzer.ts