BranchMetrics / web-branch-deep-linking-attribution

The Branch Web SDK for deep linking and attribution. Once initialized, the Branch Web SDK allows you to create and share links with a banner (web only), over SMS, or your own methods by generating deep links. It also offers event tracking, access to referrals, and management of credits.
https://help.branch.io/developers-hub/docs/web-sdk-overview
MIT License
288 stars 101 forks source link

[CORE-979] Fix broken NPM release #713

Closed jdee closed 4 years ago

jdee commented 4 years ago

Fix #711

Whitelist dist/build.min.js in package.json to ensure npm publish fails if this is not present.

jdee commented 4 years ago

This doesn't actually cause the build to fail if build.min.js is missing. It does clean up a number of things that will make it easier to detect a problem like this though. It makes sure that you have a clean source tree. Building should never leave changes in SCM. We should probably check in the package-lock.json, but for now it's ignored, and the change made by the linter is committed. Later we can modify the release.sh script to check for the existence of build.min.js before trying to pubish.

This change also greatly reduces the size of the tarball by screening out a lot of unnecessary content:

[jimmy.dee@SEA-MBP-JimmyDee web-branch-deep-linking-attribution (CORE-979/fix-bad-release)]$ npm pack
npm notice 
npm notice 📦  branch-sdk@2.53.1
npm notice === Tarball Contents === 
npm notice 1.1kB  LICENSE          
npm notice 78.4kB dist/build.min.js
npm notice 1.0kB  package.json     
npm notice 21.0kB CHANGELOG.md     
npm notice 40.5kB README.md        
npm notice === Tarball Details === 
npm notice name:          branch-sdk                              
npm notice version:       2.53.1                                  
npm notice filename:      branch-sdk-2.53.1.tgz                   
npm notice package size:  43.8 kB                                 
npm notice unpacked size: 142.0 kB                                
npm notice shasum:        3e028580ab0d72e6e6a8aa7652fc7bde93194a41
npm notice integrity:     sha512-X4Z2QyKK53Quy[...]TklAEQgEYPGrg==
npm notice total files:   5                                       
npm notice 
branch-sdk-2.53.1.tgz

The current tarball is 28 MB unpacked.

aaaronlopez commented 4 years ago

👍 this appears to only impact the npm module, which is currently broken, so I think this is safe to do