elastic / tinymath

A tiny arithmetic expression evaluator with pluggable functions
Apache License 2.0
21 stars 16 forks source link

Remove Files from Published NPM Package #21

Closed cqliu1 closed 6 years ago

cqliu1 commented 6 years ago

@w33ble suggested that we remove the docs and src folder from the published version of TinyMath. He also said to add the lib folder to the .gitignore.

w33ble commented 6 years ago

For reference: https://docs.npmjs.com/files/package.json#files

There's no value in publishing docs, tests, build files, etc. on npm. In the case of this module, even the src isn't required. Adding this to the package.json will remove the cruft from the published module on npm.

"files": ["lib"],

The published module will then be the package.json file, the readme, the license, and the built code.

w33ble commented 6 years ago
the following files will be published:

package.json
README.md
LICENSE
lib/tinymath.js
lib/tinymath.min.js
lib/tinymath.js.map
spalger commented 6 years ago

Publishing src and using jsnext:main allows eslint-plugin-import to verify named imports, which I am a huge fan of 😄

w33ble commented 6 years ago

I'm pretty sure jsnext:main was deprecated in favor of module. They seem to be used pretty interchangeably in the associated tooling though. Rollup docs reference.

But, I get your point. Open another issue, I'm not opposed to putting src back into the published package.