An interactive Bash script to help audit the performance of your Typescript types.
|
tsc --generateTrace
is slow and the output is not very easy to interpret.
If you want to find your cubs and iterate quickly, you need to trace specific parts of your project.
Manually editing a tsconfig.json
each time you want to trace something (or creating as many as you need) and comparing traces is a chore and is a bit messy.
If you are on Windows I imagine you have Git Bash installed (don't ask me why I did not do it in node...)
"install" it with npm (or simply drop ts-trace.sh
somewhere in your project):
npm install github:geoffreytools/ts-trace
Add it to your npm-scripts in package.json
:
"scripts": {
"trace": "bash ./node_modules/ts-trace/ts-trace.sh"
}
By default, the script is looking for a base tsconfig.json
file in the root of your project where it also creates a ts-trace
directory in which your traces/
and the log
will be located .
You can override the location of:
- the base tsconfig with the option
-i
- the output folder with the option
-o
For example
"scripts": {
"trace": "bash ./node_modules/ts-trace/ts-trace.sh -i ./src/tsconfig.json -o ./profiling"
}