Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

knksmith57
Copy link

resolves #2

@coveralls
Copy link

Coverage Status

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

@knksmith57
Copy link
Author

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
Copy link
Author

@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
Copy link
Author

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

@fraxken
Copy link

fraxken commented Feb 26, 2020

@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
Copy link

RA80533 commented Jun 10, 2021

@epoberezkin Is this actionable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reduce the size of the npm package by limiting the included files
4 participants