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
include only necessary files in npm package #260
Conversation
All files are necessary, including tests. |
what if you will have 100 MB fixtures in |
I agree that fixtures perhaps don't need to be included - but few packages have fixtures at all, let alone large ones. I agree that "example" and the travis config aren't necessary - but to exclude them, we'd have to add |
there is no need to add |
also there are much more fixtures than people who ever knows about |
I agree with @deepsweet. Why would someone need to run Loading unnecessary files is one of the reasons
Corey Butler also wrote a nice article about why it's important to minimize module footprints, including test suite:
|
|
@deepsweet if we wanted everything included by default, and only certain files excluded, we would need @mistadikay My use case is, when I want to run tests for a module i've installed. I do this occasionally, and as part of automated tests for some of my modules. Package size is npm's problem to solve - package authors should not be trying to solve it. |
ok, I'm going to say goodbye to this TAP implementation because it looks like you are missing the whole point of NPM registry as a package delivery system. |
The package includes its tests. That is what I want delivered. |
I beg to differ. Blacklists might be more dangerous since you can forget to exclude something and introduce a potential security threat if there is a sensitive information. If you forgot to include something into whitelist, at worst you'll have to release a patch version.
I still don't quite understand why would you test someone else's packages. Isn't it what package maintainers should do? What if they didn't write any tests?
How npm can solve this problem? By making some precarious assumptions on what should be loaded and what should not? |
Let's stay kind to the maintainers here - they see value in Also a gentle reminder that it's the maintainer's call of what to do with this package - if they give you a clear "no" please respect that. Thanks! |
It's not nice to chase my PRs even in not related to this maintainer projects. There are still no strong arguments to include tests. |
The strong argument is "I want to be able to run tests in my dependencies when possible". You're creating a huge amount of FUD and future functionality risk by submitting tons of PRs all over the place that use a whitelist approach - files are only downloaded once per version, and are cached. This just isn't a big problem - install time isn't where speed matters. |
that's why I said that you are missing something very important. npm I already answered you why blacklist can be more dangerous than whitelist. sorry but "I want to be able to run tests in my dependencies" is absolutely your point to include tests (even with 100 MB fixtures, because w/o it |
And look, projects like pnpm are solving it and package authors don't have to. It is better to release a working package with sensitive data than a broken package. It's fine if it's wrong for you - you're welcome to exclude test files from your own packages. That doesn't mean it's wrong. |
@deepsweet don't throw out a strawman, There's probably more important things to worry about than |
20 kilobytes. |
See NPM docs for details.