-
-
Notifications
You must be signed in to change notification settings - Fork 185
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
fix: only include necessary files into npm #239
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be a breaking change.
This is quite intentional. Those files must be included.
Tests should be published with every package, so that
npm explore foo && npm install && npm test
always works.Installed package size is irrelevant; if you never require the test files, they'll never affect the runtime of your application.
Duplicate of #235. Duplicate of #58. Duplicate of #44. See #105 (comment).
"files": [ | ||
"/lib", | ||
"/index.js", | ||
"/index.mjs" | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"files" is highly dangerous and should never be used; only .npmignore
should be used to control what files are published.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Highly disagree, but you're the boss here. 🧐
A lot of popular packages are using files
, it makes package cleaner and much easier to maintain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"a lot of packages use it" isn't an argument for it being safe.
The worst possible damage caused by accidental omission from "npmignore" is "the package is slightly larger". The worst possible damage caused by accidental omission from "files" is "every consumer breaks".
close #238
cc @ljharb