-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Consider using TypeScript APIs to find and read tsconfig.json
#4808
Comments
By the way, I am open to use tstyche for type checking if it doesn't patch typescript internals. |
Ah.. Got it. I thought there should be some trick. Thanks for your interest in trying out TSTyche. I was thinking a lot about integrations with JavaScript testing frameworks. Probably a separate issue would suite better to talk about this. Can I ask quickly why do you think that patching is the wrong thing in this case? User has no accesses to those patched TS packages. They are kept outside of repo and are only used for type testing. So only TypeScript itself could call those additional methods during the test run, but we can be 100% sure that it does not. Also since patching is done on demand, it is possible to adjust it if TS codebase is changing. That is not possible with, for example, It also would be wrong to patch TS package installed by the user. But TSTyche does not do that. It does not require TypeScript to be installed in a repo. |
From what I understand, patching requires a separate version of |
Interesting. On surface It is right that patching requires a separate copy of (Closing this issue. The initial question was already cleared out.) |
Actually, it doesn't even work without
Interesting! I was wondering how it works 🤔 |
By the way, I looked for projects using |
One of the goals with Vitest type checker is to replace |
Clear and concise description of the problem
Consider using TypeScript APIs to find and read
tsconfig.json
instead of theget-tsconfig
package.If I get it right, only
typecheck
needstsconfig.json
and it also requirestypescript
to be installed. Hence a dependency (even if it gets bundled) seems to be redundant.It is hard to reason about the exact amount of code which is shipped after bundling in the
get-tsconfig
package. Seems like parsing logic ofjsonc-parser
is still there. That will be always more than these few lines: https://github.com/privatenumber/get-tsconfig/#how-can-i-use-typescript-to-parse-tsconfigjsonSuggested solution
The solution is documented in get-tsconfig repo:
https://github.com/privatenumber/get-tsconfig#how-can-i-use-typescript-to-parse-tsconfigjson
Alternative
No response
Additional context
The install size of the
get-tsconfig
package is . Sounds too much for a library which simply walks the file tree, reads JSON files and parses them.It might be worth checking what else can be shaved off, because currently the install size of Vitest is significantly larger than Jest’s (related discussion in their repo: jestjs/jest#6266).
Validations
The text was updated successfully, but these errors were encountered: