fast-json-stable-stringify icon indicating copy to clipboard operation
fast-json-stable-stringify copied to clipboard

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

Open knksmith57 opened this issue 6 years ago • 6 comments

resolves #2

knksmith57 avatar Jan 06 '19 04:01 knksmith57

Coverage Status

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

coveralls avatar Jan 06 '19 04:01 coveralls

demonstrating effects of change:

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

❯ git clean -fd

❯ npm pack
npm notice
npm notice 📦  [email protected]
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 📦  [email protected]
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 avatar Jan 06 '19 04:01 knksmith57

@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 avatar Jan 06 '19 04:01 knksmith57

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

knksmith57 avatar Apr 29 '19 17:04 knksmith57

@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

fraxken avatar Feb 26 '20 06:02 fraxken

@epoberezkin Is this actionable?

RA80533 avatar Jun 10 '21 11:06 RA80533