-
Notifications
You must be signed in to change notification settings - Fork 9
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
Move @types/tmp to production dependency #38
base: master
Are you sure you want to change the base?
Conversation
Hi! Thanks for this. This was discussed at length in #31, care to add to that? |
The problem now is that |
@yoursunny you do type checking in production rather than as part of your build? Is |
The problem here is that, when I run |
It's been already two years for this issue, haven't you changed your mind? 😅 I am pretty sure that you are aware that, e.g. for the function file(options?: any): Promise<tmp.FileResult> That |
PRs to improve types are welcome (or just port it to TypeScript and export the d.t.s - should be pretty easy). I am happy to guide such work and how I would do it. Also just updating the types in the index.d.ts file to add what's missing, PRs are likely to get merged quickly with improvements for that. That is unrelated to @types/tmp being a production dependency since types don't belong in production dependencies :) |
This also sounds good to me |
If you are shipping the types with the production library (which tmp-promise is doing), then the dependency types belong in dependencies of that package. If you are shipping the types separately from the production library (which tmp does), then the dependency types belong in dependencies of that types package. Like, yes it is a couple extra bytes. But you're already having a couple extra bytes by shipping code+types together. |
Several types from
@types/tmp
package, such as FileOptions and DirOptions, are exposed as part of public typing in index.d.ts. This requires@types/tmp
to be a production dependency instead of a devDependency, so that TypeScript consumers can find the correct typing for these options instead ofany
.