Thanks for helping. typescript-perf makes claims about other people's code, so the bar is simple: every result must be backed by a measurement, and every format it reads must be tested against a real compiler output.
npm ci
npm run build
npm test # unit tests: parsers on real TS 5.9 / 6.0 / 7.0 outputs, stats, budget, JSON Schema, renderers
npm run test:integration # the CLI on tests/fixtures with the real compilers (about 6 minutes)The three compilers are dev dependencies (ts5, ts6, ts7), so the tests never depend on what is installed
globally.
| Path | |
|---|---|
src/parse.ts |
parsers for the compiler's text output (the contract with tsc) |
src/measure.ts |
repeated runs, warm-up, build mode |
src/trace.ts, src/stream-json.ts |
streaming trace and types parsing |
src/findings.ts |
findings and their verification |
src/why.ts |
trace analysis and proven patterns |
src/report.ts, src/html.ts, src/markdown.ts |
terminal, HTML and Markdown output |
schema/ |
the JSON Schema of --json |
docs/patterns/ |
one page per finding and pattern |
tests/fixtures/ |
small projects with known costs (node scripts/make-fixtures.mjs regenerates them) |
tests/data/ |
real compiler outputs and reports (npm run outputs:capture regenerates them) |
- Write a fixture in
scripts/make-fixtures.mjsthat has the problem, and keep it small. - Detect it from compiler output (
--extendedDiagnostics,--explainFiles, the trace), not from what the source looks like alone. - If the fix can be applied without editing the user's files (a flag, a temporary tsconfig), verify it. Report it
as
verifiedonly with a gain outside the noise and byte-identical diagnostics. - Add an example in
src/examples.ts, a page indocs/patterns/<id>.md, and the id to the JSON Schema. - Add integration tests on TypeScript 5, 6 and 7.
Add it as a dev dependency, add it to scripts/capture-outputs.mjs, run npm run outputs:capture, and run the tests.
A failing parser test is a format change to handle, not a test to update blindly.
- One topic per pull request, with tests.
- Plain, factual wording in output and docs: say what was measured, how, and how sure it is.
- No new runtime dependency without a strong reason. The CLI has one (
@typescript/analyze-trace).