JamieMason / shrinkpack

Fast, resilient, reproducible builds with npm install.
https://www.npmjs.com/package/shrinkpack
MIT License
793 stars 38 forks source link

chore(npm): ignore test files when publishing to npm #66

Closed DrewML closed 7 years ago

kasperlewau commented 8 years ago

Would it not make more sense to go with an explicit files entry in package.json so as to not publish dotfiles etc.

Saves you th hassle of maintaining a blacklist of files that are unnecessary to the consumers.

DrewML commented 8 years ago

Would it not make more sense to go with an explicit files entry in package.json so as to not publish dotfiles etc.

I wouldn't say it "makes more sense"; rather, it's just another option. Each has there trade-offs:

I tend to prefer the npmignore because it's easy to forget to add to the files list. Either way, you're maintaining a list manually, whether it's a whitelist or a blacklist. The only difference I see personally is that one of those options can cause a painful problem post-publish

kasperlewau commented 8 years ago

I'm sorry, that was a poor choice of words on my behalf.

I suppose what I really wanted to bring up was the non-exclusion of dotfiles and/or github templates. I don't see what good they would do as published files.

Unless of course npm already handles that for you, I can't quite recall what the default ignoreset looks lile for npm publish.

files vs npmignore; truth be told I don't know full well why I would bring that up.

fanatid commented 8 years ago

+1 for files in package.json

JamieMason commented 7 years ago

Largely down to preference but I think I'd like to go with files in package.json.

Thanks for putting this together @DrewML, I'm picking up PRs at the moment so will modify your commit if you don't mind (so it's still attributed to you).

JamieMason commented 7 years ago

Merged into master 👍