@adobe/sizewatcher 1.2.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -7
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
- [Requirements](#requirements)
|
|
15
15
|
- [Installation](#installation)
|
|
16
16
|
- [Usage](#usage)
|
|
17
|
-
- [CI Setup](#ci-setup)
|
|
17
|
+
- [**CI Setup**](#ci-setup)
|
|
18
18
|
- [Configuration](#configuration)
|
|
19
19
|
- [Comparators reference](#comparators-reference)
|
|
20
20
|
- [Contribute](#contribute)
|
|
@@ -33,6 +33,8 @@ While any custom file or folder path can be measured via configuration, various
|
|
|
33
33
|
|
|
34
34
|
`sizewatcher` runs as part of your CI and reports results as comment on the pull request or as github commit status (optional), allowing to block PRs if a certain threshold was exceeded.
|
|
35
35
|
|
|
36
|
+
:warning: **The git size comparison feature (the `git` comparator) is currently not calculating correct values (as of 1.2.1). See [issue #52](https://github.com/adobe/sizewatcher/issues/52) for more details.**
|
|
37
|
+
|
|
36
38
|
This is an example of a `sizewatcher` Github PR comment with a failure (ignore the small numbers):
|
|
37
39
|
|
|
38
40
|
---
|
|
@@ -125,7 +127,7 @@ By default `sizewatcher` will
|
|
|
125
127
|
|
|
126
128
|
## Requirements
|
|
127
129
|
|
|
128
|
-
- [Nodejs](https://nodejs.org) version
|
|
130
|
+
- [Nodejs](https://nodejs.org) version 12+ (since 1.3.0)
|
|
129
131
|
- recommended to use latest stable version "LTS"
|
|
130
132
|
- Github or Github Enterprise
|
|
131
133
|
- if you want to run it on pull requests
|
|
@@ -137,12 +139,14 @@ By default `sizewatcher` will
|
|
|
137
139
|
|
|
138
140
|
## Installation
|
|
139
141
|
|
|
140
|
-
You can install the `sizewatcher` tool locally for testing or checking your changes before committing:
|
|
142
|
+
Local: You can install the `sizewatcher` tool locally for testing or checking your changes before committing:
|
|
141
143
|
|
|
142
144
|
```
|
|
143
145
|
npm install -g @adobe/sizewatcher
|
|
144
146
|
```
|
|
145
147
|
|
|
148
|
+
For setup in Continuous Integration: see [CI Setup](#ci-setup) section.
|
|
149
|
+
|
|
146
150
|
## Usage
|
|
147
151
|
|
|
148
152
|
When run locally, `sizewatcher` will output its results on the command line.
|
|
@@ -230,7 +234,7 @@ npx @adobe/sizewatcher
|
|
|
230
234
|
This command will always use the latest published version. In some cases it might be (temporarily) desireable to stick to a certain version, which can be achieved using:
|
|
231
235
|
|
|
232
236
|
```
|
|
233
|
-
npx @adobe/sizewatcher@1.
|
|
237
|
+
npx @adobe/sizewatcher@1.2.1
|
|
234
238
|
```
|
|
235
239
|
|
|
236
240
|
#### GITHUB_TOKEN
|
|
@@ -289,7 +293,7 @@ jobs:
|
|
|
289
293
|
|
|
290
294
|
For [Travis CI](https://travis-ci.org) you need to
|
|
291
295
|
- use `language: node_js`
|
|
292
|
-
- if you already use a different language, find a way to ensure Nodejs
|
|
296
|
+
- if you already use a different language, find a way to ensure Nodejs 12+ is installed
|
|
293
297
|
- under `script` run `npx @adobe/sizewatcher`
|
|
294
298
|
- set a secret environment variable `GITHUB_TOKEN` in the [Travis repository settings](https://docs.travis-ci.com/user/environment-variables/#defining-variables-in-repository-settings) with a github token with permission to comment on PRs and reporting commit statuses for the repository
|
|
295
299
|
|
|
@@ -309,7 +313,7 @@ script:
|
|
|
309
313
|
### CircleCI
|
|
310
314
|
|
|
311
315
|
For [CircleCI](https://circleci.com) you need to
|
|
312
|
-
- use a docker image with Nodejs
|
|
316
|
+
- use a docker image with Nodejs 12+ installed
|
|
313
317
|
- alternatively install [using nvm](https://www.google.com/search?q=circleci+use+nvm)
|
|
314
318
|
- run `npx @adobe/sizewatcher`
|
|
315
319
|
- set a secret environment variable `GITHUB_TOKEN` in the [CircleCI project settings](https://circleci.com/docs/2.0/env-vars/#setting-an-environment-variable-in-a-project) (or in a [Context](https://circleci.com/docs/2.0/env-vars/#setting-an-environment-variable-in-a-context)) with a github token with permission to comment on PRs and reporting commit statuses for the repository
|
|
@@ -334,7 +338,7 @@ jobs:
|
|
|
334
338
|
|
|
335
339
|
This is not tested well but might work.
|
|
336
340
|
|
|
337
|
-
Ensure Nodejs
|
|
341
|
+
Ensure Nodejs 12+ is installed.
|
|
338
342
|
|
|
339
343
|
Set these environment variables in the CI job:
|
|
340
344
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/sizewatcher",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Warns if your pull requests introduce large size increases.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@adobe/eslint-config-asset-compute": "^1.3.0",
|
|
29
29
|
"coveralls": "^3.1.0",
|
|
30
30
|
"eslint": "^7.1.0",
|
|
31
|
-
"mocha": "^
|
|
31
|
+
"mocha": "^10.2.0",
|
|
32
32
|
"mock-fs": "^4.13.0",
|
|
33
33
|
"nyc": "^15.1.0",
|
|
34
34
|
"supports-color": "^8.1.1"
|