Unnecessary files are included in the published packages
Describe the bug Most (none?) packages don't distinguish between files that are necessary for end-projects and development-related files that happen to be inside the same folder.
Steps to Reproduce
For example, in the package for @std/msgpack, the test spec modules, and test data files are also included.
Expected behavior The packages implement filters described in https://jsr.io/docs/publishing-packages#filtering-files
Environment Not applicable
We used to ignore test files at some point, but reverted it by recommendation from JSR team. https://github.com/denoland/std/pull/4441#issuecomment-1983362882
Can you elaborate on why test files should be excluded from published packages?
As a library author, my thinking is that @std packages are foundations to build other libraries upon. As such, they would ideally be as lean as possible.
I don't want users reviewing their node_modules folder (to determine space-hogging libraries, for example), only to find there are a bunch of test data files being indirectly included by one of my libraries.
I don't want users reviewing their node_modules folder (to determine space-hogging libraries, for example), only to find there are a bunch of test data files being indirectly included by one of my libraries.
Is your package published to npm, or jsr? If you publish your package to npm and let it depends on @std, then your argument make sense to me.
(BTW if you publish your package to JSR and it targets Deno runtime, then test files are not downloaded to the users as Deno only downloads the necessary files.)
Is your package published to npm, or jsr?
It is going to be to both. I currently have the necessary files from std vendored directly into my project.
(BTW if you publish your package to JSR and it targets Deno runtime, then test files are not downloaded to the users as Deno only downloads the necessary files.)
Thanks, that's nice to know!
@lucacasonato (cc @crowlKats) What do you think about the best practice here?
Should we exclude test scripts and fixtures to make npm tarballs smaller? Or should we do something else?