Skip to content

Commit

Permalink
Stop publishing non-essential files (like tests and gruntfile) to npm
Browse files Browse the repository at this point in the history
I noticed that we were publishing a bunch of unnecessary files (like the
`test` directory and `gruntfile.js`) to npm. At best, this wastes space.
At worst, we could accidentally publish some sensitive file (though
that's unlikely).

Tested this by:

1. Ran `npm pack` and verified that no unnecessary files were included
2. Copied the resulting tarbal, `airtable-0.7.0.tgz`, into a temporary
   directory
3. Ran `npm i airtable-0.7.0.tgz`
4. Verified that `node -p "require('airtable')"` didn't break

See documentation for the [`files`][1] key in `package.json` for more
info here.

[1]: https://docs.npmjs.com/files/package.json#files
  • Loading branch information
Evan Hahn authored and EvanHahn committed Jul 16, 2019
1 parent f1d7de1 commit 1396775
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@
"browser": {
"request": "xhr"
},
"files": [
"/README.md",
"/CHANGELOG.md",
"/LICENSE.txt",
"/build/airtable.browser.js",
"/lib/"
],
"devDependencies": {
"body-parser": "^1.19.0",
"envify": "^4.1.0",
Expand Down

0 comments on commit 1396775

Please sign in to comment.