From a40e4a598baaca72ca817e3ac9e896faff96e278 Mon Sep 17 00:00:00 2001 From: rt2zz Date: Fri, 2 Feb 2018 17:14:21 -0800 Subject: [PATCH] (ops): explicit newline for package size --- LIBSIZE.md | 4 ++-- scripts/size-estimator.js | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/LIBSIZE.md b/LIBSIZE.md index dff0f25f8..79660075e 100644 --- a/LIBSIZE.md +++ b/LIBSIZE.md @@ -1,5 +1,5 @@ ### Redux Persist Size Estimate The following is a history of size estimates in bytes. This is calculated as a rollup minified production build, excluding the size of redux which is an assumed peer dependency. YMMV. -v5.6.7: 4724 Bytes -v5.6.8: 4724 Bytes +**v5.6.7**: 4724 Bytes +**v5.6.8**: 4724 Bytes diff --git a/scripts/size-estimator.js b/scripts/size-estimator.js index 017b1f6d8..d8d79ee85 100644 --- a/scripts/size-estimator.js +++ b/scripts/size-estimator.js @@ -2,10 +2,11 @@ const { execSync } = require('child_process') const packageJson = require('../package.json') +let packageVersion = packageJson.version // we estimate redux size based on the content length of the minified umd build hosted by unpkg. This script is brittle but works. let reduxSize = execSync("curl -sIL https://unpkg.com/redux/dist/redux.min.js | grep -i Content-Length | tail -1 | awk '{print $2}'").toString() // we need to substract redux size from our umd build to get an estimate of our first party code size let persistSize = execSync("wc -c < dist/redux-persist.min.js") - reduxSize -let packageVersion = packageJson.version -console.log(`v${packageVersion}: ${persistSize} Bytes`) +// note: markdown formatted for conveinence when appending to LIBSIZE.md +console.log(`**v${packageVersion}**: ${persistSize} Bytes `)