{"action":"created","issue":{"url":"https://api.github.com/repos/apache/thrift/issues/741","labels_url":"https://api.github.com/repos/apache/thrift/issues/741/labels{/name}","comments_url":"https://api.github.com/repos/apache/thrift/issues/741/comments","events_url":"https://api.github.com/repos/apache/thrift/issues/741/events","html_url":"https://github.com/apache/thrift/pull/741","id":121624557,"number":741,"title":"THRIFT-3485 don't publish extra files to npm","user":{"login":"azylman","id":790102,"avatar_url":"https://avatars.githubusercontent.com/u/790102?v=3","gravatar_id":"","url":"https://api.github.com/users/azylman","html_url":"https://github.com/azylman","followers_url":"https://api.github.com/users/azylman/followers","following_url":"https://api.github.com/users/azylman/following{/other_user}","gists_url":"https://api.github.com/users/azylman/gists{/gist_id}","starred_url":"https://api.github.com/users/azylman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azylman/subscriptions","organizations_url":"https://api.github.com/users/azylman/orgs","repos_url":"https://api.github.com/users/azylman/repos","events_url":"https://api.github.com/users/azylman/events{/privacy}","received_events_url":"https://api.github.com/users/azylman/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-12-11T02:47:02Z","updated_at":"2015-12-13T20:12:41Z","closed_at":"2015-12-13T20:12:41Z","pull_request":{"url":"https://api.github.com/repos/apache/thrift/pulls/741","html_url":"https://github.com/apache/thrift/pull/741","diff_url":"https://github.com/apache/thrift/pull/741.diff","patch_url":"https://github.com/apache/thrift/pull/741.patch"},"body":"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.\r\n\r\nI 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\r\n\r\nIf 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.\r\n\r\nI've tested this using the method recommended in the npmjs documented, basically installing the package globally and making sure it still requires successfully:\r\n\r\n```\r\n$ npm install -g .\r\n$ node\r\n> var thrift = require('thrift');\r\nundefined\r\n> thrift\r\n{ Thrift:\r\n   { Type:\r\n  ...etc...\r\n$ du -h -d 1 .\r\n236K\t./lib\r\n812K\t./node_modules\r\n1.2M\t.\r\n```"},"comment":{"url":"https://api.github.com/repos/apache/thrift/issues/comments/164294334","html_url":"https://github.com/apache/thrift/pull/741#issuecomment-164294334","issue_url":"https://api.github.com/repos/apache/thrift/issues/741","id":164294334,"user":{"login":"azylman","id":790102,"avatar_url":"https://avatars.githubusercontent.com/u/790102?v=3","gravatar_id":"","url":"https://api.github.com/users/azylman","html_url":"https://github.com/azylman","followers_url":"https://api.github.com/users/azylman/followers","following_url":"https://api.github.com/users/azylman/following{/other_user}","gists_url":"https://api.github.com/users/azylman/gists{/gist_id}","starred_url":"https://api.github.com/users/azylman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azylman/subscriptions","organizations_url":"https://api.github.com/users/azylman/orgs","repos_url":"https://api.github.com/users/azylman/repos","events_url":"https://api.github.com/users/azylman/events{/privacy}","received_events_url":"https://api.github.com/users/azylman/received_events","type":"User","site_admin":false},"created_at":"2015-12-13T20:12:41Z","updated_at":"2015-12-13T20:12:41Z","body":"@nsuke Looks like that's not published in 0.9.3. I just confirmed that master does _not_ have this problem, making this PR unnecessary. Hopefully that change can get published soon :/"}}