Commit 9b4e511
committed
refactor(typingsInstaller): modernize architecture and improve type safety
- Replace monolithic installer with focused classes (NpmClient, TypingsRegistry, InstallationCache)
- Eliminate undefined usage in favor of explicit union types
- Add async/await pattern replacing blocking execSync operations
- Implement LRU installation cache to prevent redundant installs
- Add retry logic with exponential backoff for failed operations
- Introduce structured logging with JSON format and metrics collection
- Enhance security with package name sanitization and command array building
- Add comprehensive error handling with custom error types
- Implement proper resource management and graceful shutdown
- Fix memory leaks from unbounded cache growth and improve cleanup
Breaking: Constructor parameter order changed, config now uses validated objects1 parent 7956c00 commit 9b4e511
File tree
3 files changed
+1068
-226
lines changed- src/typingsInstaller
3 files changed
+1068
-226
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| |||
0 commit comments