whyts
v0.8.10Find out why a TypeScript project is slow: measured analysis and before/after comparison.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
analyze
Find out why a TypeScript project is slow. Runs one traced type check of the project (plus `runs` untraced timing runs) and returns compact JSON: Check time, file count, compiler error summary (not the full list of errors), `diagnoses` (a known slow-type pattern with location, evidence and a fix), the top 5 measured findings, and warnings. It takes as long as a full type check of the project (seconds to minutes), plus the extra timing runs.
| Parameter | Type | Description |
|---|---|---|
project * | string | Absolute path to a directory with a tsconfig.json, or to a tsconfig file. |
maxOldSpaceMb | integer | Heap limit in MB for the compiler process. Ignored with TypeScript 7. |
runs | integer | Untraced timing runs for a stable Check time (default 1). Each run is one more full type check. Use 3 or more for a median. |
timeoutSeconds | number | Compiler timeout in seconds for each type check. Default 900. |
typescript | string | Path to a typescript package directory to use instead of the one in the project (5.x, 6.x or 7.x). |
compare
Prove whether a change made type checking faster or slower. Runs the full type check `runs` times for the baseline and for the candidate project (a copy or a git worktree of the same project, before and after the change), alternating the order, and returns a decision: `separated` (the ranges do not overlap, a real change, with direction), `within-noise` (no change can be claimed) or `not-comparable` (a side has compiler errors or the compilers differ). It takes about (2 x runs + 2) type checks, so it is slow: `runs` 3 gives a quick answer and 5 or more a firm one.
| Parameter | Type | Description |
|---|---|---|
baseline * | string | Absolute path to the project before the change (directory with tsconfig.json, or a tsconfig file). |
candidate * | string | Absolute path to the project after the change. It must be a separate directory, for example a git worktree. |
maxOldSpaceMb | integer | Heap limit in MB for the compiler process. Ignored with TypeScript 7. |
runs | integer | Measured runs per side (default 5, minimum 3 for a verdict). |
timeoutSeconds | number | Compiler timeout in seconds for each type check. Default 900. |
typescript | string | Path to a typescript package directory to use instead of the one in the project (5.x, 6.x or 7.x). |
explain
Show why one file is in the TypeScript program: the shortest import chain from a configured root and the direct importers. It reads the import graph only and does not run the type checker, so it finishes in seconds.
| Parameter | Type | Description |
|---|---|---|
file * | string | File to explain, relative to the tsconfig directory. |
project * | string | Absolute path to a directory with a tsconfig.json, or to a tsconfig file. |
typescript | string | Path to a typescript package directory to use instead of the one in the project (5.x, 6.x or 7.x). |