-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
chore: specify files field in package.json #73
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.
The tests are very necessarily published to npm; npm explore foo && npm install && npm test
should always work.
Separately, the files field is dangerous and should never be used - the proper way to control what gets published is an npmignore file.
Thank you for your prompt review!
Given that the current configuration increases the package size by 30kB for every dependency relying on minimist, I believe this change could be beneficial. I hope you're open to discussing this further! |
You misread; after npm explore, a bare npm install is run, which installs dev deps. It’s a scenario that multiple users expect to work, especially the ones that have been around since the beginning of npm. I’m not concerned with package size on disk - only the size in the application. Files that aren’t consumed in the application don’t matter, and FUD-producing “phobia” sites don’t make it a valid concern. |
I understand what you meant now, I wasn't aware of use-cases running |
For interest, I thought we might have accidentally started including tests and looked into it in #23 Turned out Minimist had included tests in the package for years, probably always, and some people think including the development files is a good thing too. I don't do it myself in other packages I maintain, but also don't consider it a fault when done on purpose, with the benefits/use-cases @ljharb outlined. |
Thanks! My apologies for not noticing the issue... |
currently the install size is 53.2kB https://packagephobia.com/result?p=minimist
The size is unnecessarily large because the test files, examples and CHANGELOG are all published to npm. This patch will set the files field in package.json to only include the necessary files when publishing. It should reduce the install size to around 12kB