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
remove @types/node dependency #3226
Conversation
because this is causing the node types to be included by default for any consumer of rollup fixes rollup#3224
Codecov Report
@@ Coverage Diff @@
## master #3226 +/- ##
==========================================
- Coverage 91.31% 90.64% -0.68%
==========================================
Files 170 167 -3
Lines 5930 5911 -19
Branches 1797 1793 -4
==========================================
- Hits 5415 5358 -57
- Misses 310 336 +26
- Partials 205 217 +12
Continue to review full report at Codecov.
|
Also wondering if "@types/estree" should be a dev dependency? |
How do you intend to fix Rollup’s types for users of Rollup that typically do not install its devDependencies? Tell everyone what to install manually? Use a peerDependency and cause an warning for everyone, even though they do not care about the Node types? |
I am saying this because this has been discussed by countless people for a long time and just removing the dependency is just not a solution. If you can rework Rollup’s types so that we have our own version of |
Hmm I see.
This just exports interfaces and doesn't register anything on any globals, so doesn't seem like an issue. "@types/node" registers types on globals though. I guess the root problem here is the way typescript automatically brings in all types in the "@types" dir. Maybe the advice for consumers should be to explicitly list the types you want with the |
see rollup/rollup#3226 (comment) rollup brings in types for node, which are then automatically registered, and mean typecript won't error if you use an API that is only available in node
@lukastaegert what's your take on the last comment? It seems reasonable but I'm no TS expert. |
This sounds like a reasonable documentation request |
ok. here's a suggested change to the docs: #3300 |
This PR contains:
Are tests included?
Breaking Changes?
List any relevant issue numbers:
Description
Remove @types/node dependency because this is causing the node types to be included by default for any consumer of rollup.
Note "@types/node" is still brought in for development as it's a dev dependency of "@types/fs-extra", "@types/resolve", "@types/rimraf" and "rollup"(!)
fixes #3224
Here is an updated version of the repro which now correctly fails on an
npm run build