Skip to content
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

Add explicit files list to package.json #1951

Merged
merged 1 commit into from Nov 11, 2019

Conversation

sehrope
Copy link
Contributor

@sehrope sehrope commented Aug 20, 2019

This PR removes .npmignore and replaces it with a whitelist of files to include in the published module.

It's a bit safer and more convenient as you do not need to keep updating .npmignore to exclude non-release files. For example, I have a separate (work in progress) PR to add code coverage to the CI system which (after this PR is merged) would not need to worry about adding the local coverage or report directories.

I only included the lib directory and the SPONSORS.md file. NPM will always include the README, LICENSE, and CHANGELOG so no need to specify them.

Here's the before / after:

npm pack prior to this PR

npm notice 
npm notice 📦  pg@7.12.1
npm notice === Tarball Contents === 
npm notice 1.2kB  package.json                
npm notice 244B   .eslintrc                   
npm notice 15.3kB CHANGELOG.md                
npm notice 1.1kB  LICENSE                     
npm notice 1.8kB  Makefile                    
npm notice 4.1kB  README.md                   
npm notice 756B   SPONSORS.md                 
npm notice 15.1kB lib/client.js               
npm notice 4.3kB  lib/connection-parameters.js
npm notice 18.6kB lib/connection.js           
npm notice 2.3kB  lib/defaults.js             
npm notice 1.6kB  lib/index.js                
npm notice 7.6kB  lib/native/client.js        
npm notice 50B    lib/native/index.js         
npm notice 4.9kB  lib/native/query.js         
npm notice 6.4kB  lib/query.js                
npm notice 2.6kB  lib/result.js               
npm notice 3.9kB  lib/sasl.js                 
npm notice 983B   lib/type-overrides.js       
npm notice 5.0kB  lib/utils.js                
npm notice === Tarball Details === 
npm notice name:          pg                                      
npm notice version:       7.12.1                                  
npm notice filename:      pg-7.12.1.tgz                           
npm notice package size:  27.3 kB                                 
npm notice unpacked size: 97.8 kB                                 
npm notice shasum:        b37e568520ce0de567e9164cf89e48a4ea8b9f23
npm notice integrity:     sha512-Un81baSQFooIa[...]mONRHY7YXHHhQ==
npm notice total files:   20                                      
npm notice 
pg-7.12.1.tgz

npm pack after this PR

npm notice 
npm notice 📦  pg@7.12.1
npm notice === Tarball Contents === 
npm notice 1.2kB  package.json                
npm notice 15.3kB CHANGELOG.md                
npm notice 1.1kB  LICENSE                     
npm notice 4.1kB  README.md                   
npm notice 756B   SPONSORS.md                 
npm notice 15.1kB lib/client.js               
npm notice 4.3kB  lib/connection-parameters.js
npm notice 18.6kB lib/connection.js           
npm notice 2.3kB  lib/defaults.js             
npm notice 1.6kB  lib/index.js                
npm notice 7.6kB  lib/native/client.js        
npm notice 50B    lib/native/index.js         
npm notice 4.9kB  lib/native/query.js         
npm notice 6.4kB  lib/query.js                
npm notice 2.6kB  lib/result.js               
npm notice 3.9kB  lib/sasl.js                 
npm notice 983B   lib/type-overrides.js       
npm notice 5.0kB  lib/utils.js                
npm notice === Tarball Details === 
npm notice name:          pg                                      
npm notice version:       7.12.1                                  
npm notice filename:      pg-7.12.1.tgz                           
npm notice package size:  26.6 kB                                 
npm notice unpacked size: 95.8 kB                                 
npm notice shasum:        0be958027cf6f5418c3cd705b8ee9c24511c0586
npm notice integrity:     sha512-NjQcW/E2xCCKA[...]CL7yd8chIa0DQ==
npm notice total files:   18                                      
npm notice 
pg-7.12.1.tgz

Only differences are .eslintrc and Makefile are no longer included in the published tgz. Rather than just update .npmignore to exclude them, this should fix things for anything else in the future too.

@charmander
Copy link
Collaborator

… I’m not sure how tests are passing without #1946. Cache?

@sehrope
Copy link
Contributor Author

sehrope commented Aug 21, 2019

@charmander Yah that's weird. I think you're right about it being cached as the npm install line took ~1 second vs the usual of ~7 seconds: https://travis-ci.org/brianc/node-postgres/jobs/574525562#L1465

@brianc
Copy link
Owner

brianc commented Nov 11, 2019

oh nice! thanks. :) Sorry for the delay.

@brianc brianc merged commit cd66c0b into brianc:master Nov 11, 2019
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.

None yet

3 participants