Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add diagnostic logging to ts-node #960

Open
Tracked by #1504
cspotcode opened this issue Feb 14, 2020 · 1 comment
Open
Tracked by #1504

Add diagnostic logging to ts-node #960

cspotcode opened this issue Feb 14, 2020 · 1 comment
Labels
enhancement you can do this Good candidate for a pull request.
Milestone

Comments

@cspotcode
Copy link
Collaborator

Desired Behavior

ts-node has a flag that enables diagnostic logging from ts-node (not TypeScript) to either a file on disk or to stdout. ts-node's API allows passing a reportDiagnostic function that is called for all ts-node diagnostics, allowing even more customizable reporting. This should match the UX of TypeScript's own DiagnosticReporter hooks.

This will enable end-users to see how ts-node is parsing flags (e.g. if transpile-only is on or off), see when the Program is recreated, see how long TypeScript API calls take, see how the rootFiles array changes over time. We can also log non-fatal invariants, e.g. cases where we expect the typescript compiler to behave one way but it does something else. (for example, recreating the Program instance when nothing has changed)

Is this request related to a problem?

It might help solicit feedback for gnarly issues like #754

@cspotcode cspotcode added enhancement you can do this Good candidate for a pull request. labels Feb 14, 2020
@cspotcode cspotcode added this to the next milestone May 15, 2021
@cspotcode cspotcode modified the milestones: 10.2.0, next Aug 8, 2021
@cspotcode cspotcode modified the milestones: 10.5.0, next Jan 31, 2022
@cspotcode cspotcode modified the milestones: 10.6.0 or 10.5.1, next Feb 21, 2022
@mitulagr2
Copy link

I'll take this if you'd like!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement you can do this Good candidate for a pull request.
Projects
None yet
Development

No branches or pull requests

2 participants