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

@types deps should be listed under devDependencies #602

Closed
lionello opened this issue May 10, 2021 · 3 comments
Closed

@types deps should be listed under devDependencies #602

lionello opened this issue May 10, 2021 · 3 comments
Labels

Comments

@lionello
Copy link

"@types/http-proxy": "^1.17.5",

Listing @types/http-proxy under the "dependencies" pulls in other types as runtime dependencies as well. These should only be needed during development.

This issue was introduced in #369

@chimurai
Copy link
Owner

chimurai commented May 10, 2021

http-proxy-middleware types are generated and shipped with the package as well:

"types": "dist/index.d.ts",

Removing @types/http-proxy from dependencies, will lead to a broken developer experience.
target is a transitive property from http-proxy (@types/http-proxy), which will be missing in the code completion.

Below you'll see target is missing:
image

@chimurai
Copy link
Owner

Feel free to reopen if you have suggestions to remove @types/http-proxy without breaking developer experience

@lionello
Copy link
Author

Ah, yeah you're right. Only by listing the types under "dependencies" do they actually get pulled in automatically in the consuming project. TIL!
https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html#dependencies

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants