jlfwong / speedscope

🔬 A fast, interactive web-based viewer for performance profiles.
https://www.speedscope.app
MIT License
5.59k stars 246 forks source link

Publish type declarations #356

Open danvk opened 3 years ago

danvk commented 3 years ago

speedscope is written in TypeScript, but when you npm install speedscope, you only get the generated JavaScript, not any of the type declarations (.d.ts files).

I have some TypeScript code in my application to convert profile data from pyinstrument format to speedscope's format. So being able to import the types in file-format-spec.ts would be quite helpful for getting this right.

This could be achieved either by putting file-format-spec.ts (which has no dependencies) in the npm release, or by adding --declaration to the tsc command to force it to output .d.ts files.

Related to #16

jlfwong commented 3 years ago

Oh interesting -- yeah, I'm fine with including file-format-spec.ts in the release, but definitely don't want to include all the typescript declarations for the whole project since speedscope intentionally does not expose internals a public API