epoberezkin / fast-json-stable-stringify

Deterministic JSON.stringify() - a faster version of @substack's json-stable-strigify without jsonify.
Other
285 stars 34 forks source link

chore: add files property to package.json to restrict tarball contents #4

Open knksmith57 opened 5 years ago

knksmith57 commented 5 years ago

resolves #2

coveralls commented 5 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 374fdefcfd0345eb821605c80a59d62e320a50b4 on knksmith57:reduce-package-tarball-size into e0017726aa0cf7696c6685c27a5d7529e8e5e7cc on epoberezkin:master.

knksmith57 commented 5 years ago

demonstrating effects of change:

❯ git branch
* master
  reduce-package-tarball-size

❯ git clean -fd

❯ npm pack
npm notice
npm notice 📦  fast-json-stable-stringify@2.0.0
npm notice === Tarball Contents ===
npm notice 1.2kB package.json
npm notice 562B  .eslintrc.yml
npm notice 108B  .travis.yml
npm notice 1.8kB index.js
npm notice 1.1kB LICENSE
npm notice 2.9kB README.md
npm notice 740B  benchmark/index.js
npm notice 3.8kB benchmark/test.json
npm notice 177B  example/key_cmp.js
npm notice 109B  example/nested.js
npm notice 97B   example/str.js
npm notice 188B  example/value_cmp.js
npm notice 350B  test/cmp.js
npm notice 1.1kB test/nested.js
npm notice 1.1kB test/str.js
npm notice 607B  test/to-json.js
npm notice === Tarball Details ===
npm notice name:          fast-json-stable-stringify
npm notice version:       2.0.0
npm notice filename:      fast-json-stable-stringify-2.0.0.tgz
npm notice package size:  5.9 kB
npm notice unpacked size: 16.0 kB
npm notice shasum:        bf298303470c7dd6c0d45e9114c1d51ca6852736
npm notice integrity:     sha512-6hW72sQYQntlq[...]jmxVNSWEx8V+w==
npm notice total files:   16
npm notice
fast-json-stable-stringify-2.0.0.tgz

❯ git checkout reduce-package-tarball-size
Switched to branch 'reduce-package-tarball-size'
Your branch is up to date with 'origin/reduce-package-tarball-size'.

❯ git clean -fd
Removing fast-json-stable-stringify-2.0.0.tgz

❯ npm pack
npm notice
npm notice 📦  fast-json-stable-stringify@2.0.0
npm notice === Tarball Contents ===
npm notice 1.3kB package.json
npm notice 1.8kB index.js
npm notice 1.1kB LICENSE
npm notice 2.9kB README.md
npm notice === Tarball Details ===
npm notice name:          fast-json-stable-stringify
npm notice version:       2.0.0
npm notice filename:      fast-json-stable-stringify-2.0.0.tgz
npm notice package size:  2.9 kB
npm notice unpacked size: 7.0 kB
npm notice shasum:        ebac7614189ccdf531da4a57f8532f11d3ee461a
npm notice integrity:     sha512-ujiJBT8iksV3u[...]6opdDF7xjO9OQ==
npm notice total files:   4
npm notice
fast-json-stable-stringify-2.0.0.tgz
knksmith57 commented 5 years ago

@epoberezkin per discussion in #2, this PR configures the files property in package.json to exclude unwanted files from the package tarball.

Whenever you have a chance, this is ready for review. thanks!

knksmith57 commented 5 years ago

heya @epoberezkin, just checking in --please let me know if there's anything else I can do to help land this. thanks!

fraxken commented 4 years ago

@knksmith57 There is no need to include index.js (automatically included). I have created a cool CLI to show the files list if you are interested: https://github.com/fraxken/publish-preview

And i think you need to include the index.d.ts and the example directory (depending on the author for the example directory).

Best Regards, Thomas

RA80533 commented 3 years ago

@epoberezkin Is this actionable?