From 936fb33ea0698881fe8b374f05023f1078e94b1b Mon Sep 17 00:00:00 2001 From: Matt Stephens <87805115+mstephen19@users.noreply.github.com> Date: Mon, 12 Dec 2022 17:48:53 +0100 Subject: [PATCH 1/3] fix typo --- README.md | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index bfc627b5..75b9a431 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,6 @@ We are using [Statoscope] for this analysis. * [Logux](https://github.com/logux) reduced [90% of the size](https://github.com/logux/logux-client/commit/62b258e20e1818b23ae39b9c4cd49e2495781e91). - ## How It Works 1. Size Limit contains a CLI tool, 3 plugins (`file`, `webpack`, `time`) @@ -89,7 +88,6 @@ We are using [Statoscope] for this analysis. be unstable. [See here](https://github.com/mbalabash/estimo/issues/5) for more details. - ## Usage ### JS Applications @@ -104,7 +102,7 @@ interactive elements, using React/Vue/Svelte lib or vanilla JS. 1. Install the preset: ```sh - $ npm install --save-dev size-limit @size-limit/file + npm install --save-dev size-limit @size-limit/file ``` 2. Add the `size-limit` section and the `size` script to your `package.json`: @@ -158,7 +156,6 @@ interactive elements, using React/Vue/Svelte lib or vanilla JS. - ### JS Application and Time-based Limit File size limit (in kB) is not the best way to describe your JS application @@ -174,7 +171,7 @@ to track the time a browser takes to compile and execute your JS. 1. Install the preset: ```sh - $ npm install --save-dev size-limit @size-limit/preset-app + npm install --save-dev size-limit @size-limit/preset-app ``` 2. Add the `size-limit` section and the `size` script to your `package.json`: @@ -231,7 +228,6 @@ to track the time a browser takes to compile and execute your JS. - ### Big Libraries JS libraries > 10 kB in size. @@ -246,7 +242,7 @@ the size in bytes. Libraries like [React] are good examples for this preset. 1. Install preset: ```sh - $ npm install --save-dev size-limit @size-limit/preset-big-lib + npm install --save-dev size-limit @size-limit/preset-big-lib ``` 2. Add the `size-limit` section and the `size` script to your `package.json`: @@ -326,7 +322,6 @@ the size in bytes. Libraries like [React] are good examples for this preset. - ### Small Libraries JS libraries < 10 kB in size. @@ -341,7 +336,7 @@ for this preset. 1. First, install `size-limit`: ```sh - $ npm install --save-dev size-limit @size-limit/preset-small-lib + npm install --save-dev size-limit @size-limit/preset-small-lib ``` 2. Add the `size-limit` section and the `size` script to your `package.json`: @@ -369,7 +364,7 @@ for this preset. 4. If your project size starts to look bloated, run `--why` for analysis: ```sh - $ npm run size -- --why + npm run size -- --why ``` > We use [Statoscope](https://github.com/statoscope/statoscope) as bundle analyzer. @@ -418,7 +413,6 @@ for this preset. [Nano ID]: https://github.com/ai/nanoid/ [React]: https://github.com/facebook/react/ - ## Reports Size Limit has a [GitHub action] that comments and rejects pull requests based @@ -445,7 +439,6 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} ``` - ## Config ### Plugins and Presets @@ -479,10 +472,9 @@ Plugin presets: [`dual-publish`]: https://github.com/ai/dual-publish - #### Third-Party Plugins -Third-party plugins and presets named start with `size-limit-` are also supported. +Third-party plugins and presets named starting with `size-limit-` are also supported. For example: * [`size-limit-node-esbuild`](https://github.com/un-ts/size-limit/tree/main/packages/node-esbuild) @@ -491,7 +483,6 @@ For example: is like `@size-limit/preset-small-lib` but for Node libraries which contains above `node-esbuild` and core `file` plugins. - ### Limits Config Size Limits supports three ways to define limits config. @@ -569,7 +560,6 @@ inserts `style-loader` runtime (≈2 kB) into the bundle. [Statoscope docs]: https://github.com/statoscope/statoscope/tree/master/packages/webpack-plugin#optionsreports-report [pattern]: https://github.com/sindresorhus/globby#globbing-patterns - ## JS API ```js From 52b71f07008fb1a0950c3d8ae7b546401b849784 Mon Sep 17 00:00:00 2001 From: Matt Stephens <87805115+mstephen19@users.noreply.github.com> Date: Mon, 12 Dec 2022 17:53:19 +0100 Subject: [PATCH 2/3] fix readme --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 75b9a431..765a52c3 100644 --- a/README.md +++ b/README.md @@ -369,7 +369,7 @@ for this preset. > We use [Statoscope](https://github.com/statoscope/statoscope) as bundle analyzer. -6. Now, let’s set the limit. Determine the current size of your library, +5. Now, let’s set the limit. Determine the current size of your library, add just a little bit (a kilobyte, maybe) and use that as the limit in your `package.json`: @@ -382,7 +382,7 @@ for this preset. ], ``` -7. Add the `size` script to your test suite: +6. Add the `size` script to your test suite: ```diff "scripts": { @@ -392,9 +392,9 @@ for this preset. } ``` -8. If you don’t have a continuous integration service running, don’t forget +7. If you don’t have a continuous integration service running, don’t forget to add one — start with [Travis CI]. -9. Add the library size to docs, it will help users to choose your project: +8. Add the library size to docs, it will help users to choose your project: ```diff # Project Name From 15a762e42b139d5768b9177c9c96a2e4205e12bc Mon Sep 17 00:00:00 2001 From: Matt Stephens <87805115+mstephen19@users.noreply.github.com> Date: Wed, 4 Jan 2023 13:29:44 +0100 Subject: [PATCH 3/3] fix: removed empty lines --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 765a52c3..3835ac2d 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,7 @@ We are using [Statoscope] for this analysis. * [Logux](https://github.com/logux) reduced [90% of the size](https://github.com/logux/logux-client/commit/62b258e20e1818b23ae39b9c4cd49e2495781e91). + ## How It Works 1. Size Limit contains a CLI tool, 3 plugins (`file`, `webpack`, `time`) @@ -88,6 +89,7 @@ We are using [Statoscope] for this analysis. be unstable. [See here](https://github.com/mbalabash/estimo/issues/5) for more details. + ## Usage ### JS Applications @@ -156,6 +158,7 @@ interactive elements, using React/Vue/Svelte lib or vanilla JS. + ### JS Application and Time-based Limit File size limit (in kB) is not the best way to describe your JS application @@ -228,6 +231,7 @@ to track the time a browser takes to compile and execute your JS. + ### Big Libraries JS libraries > 10 kB in size. @@ -322,6 +326,7 @@ the size in bytes. Libraries like [React] are good examples for this preset. + ### Small Libraries JS libraries < 10 kB in size. @@ -408,11 +413,13 @@ for this preset. + [Travis CI]: https://github.com/dwyl/learn-travis [Storeon]: https://github.com/ai/storeon/ [Nano ID]: https://github.com/ai/nanoid/ [React]: https://github.com/facebook/react/ + ## Reports Size Limit has a [GitHub action] that comments and rejects pull requests based @@ -439,6 +446,7 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} ``` + ## Config ### Plugins and Presets @@ -472,6 +480,7 @@ Plugin presets: [`dual-publish`]: https://github.com/ai/dual-publish + #### Third-Party Plugins Third-party plugins and presets named starting with `size-limit-` are also supported. @@ -483,6 +492,7 @@ For example: is like `@size-limit/preset-small-lib` but for Node libraries which contains above `node-esbuild` and core `file` plugins. + ### Limits Config Size Limits supports three ways to define limits config. @@ -560,6 +570,7 @@ inserts `style-loader` runtime (≈2 kB) into the bundle. [Statoscope docs]: https://github.com/statoscope/statoscope/tree/master/packages/webpack-plugin#optionsreports-report [pattern]: https://github.com/sindresorhus/globby#globbing-patterns + ## JS API ```js