THRIFT-3485 don't publish extra files to npm #741
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The thrift npm package is as big as all of our other node dependencies combined. It currently publishes the entire thrift repository, which is ~30mb right now. As far as I can tell, it only requires lib/nodejs, which is 376k.
I propose adding an .npmignore file. You can more info in the npm documentation: https://docs.npmjs.com/misc/developers#keeping-files-out-of-your-package
If the package only requires lib/nodejs, we should be able to add an entry to the npmignore file for every folder (including lib), and then a negated entry for lib/nodejs. We'll also want to include everything from gitignore, because npm will no longer use that once an npmignore file is added.
I've tested this using the method recommended in the npmjs documented, basically installing the package globally and making sure it still requires successfully: