reg-cli 0.17.4 → 0.17.7
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 +1 -2
- package/dist/cli.js +5 -3
- package/dist/index.js +4 -2
- package/package.json +16 -15
package/README.md
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|

|
|
2
2
|
|
|
3
|
-
](https://circleci.com/gh/reg-viz/reg-cli/tree/master.svg?style=svg)
|
|
4
3
|
](https://travis-ci.org/reg-viz/reg-cli.svg?branch=master)
|
|
5
4
|
](https://ci.appveyor.com/api/projects/status/ir907qbc633q9na4?svg=true)
|
|
6
5
|
](https://img.shields.io/npm/v/reg-cli.svg)
|
|
@@ -44,7 +43,7 @@ $ reg-cli /path/to/actual-dir /path/to/expected-dir /path/to/diff-dir -R ./repor
|
|
|
44
43
|
* `-I`, `--ignoreChange` If true, error will not be thrown when image change detected.
|
|
45
44
|
* `-E`, `--extendedErrors` If true, also added/deleted images will throw an error.
|
|
46
45
|
* `-P`, `--urlPrefix` Add prefix to all image src.
|
|
47
|
-
* `-M`, `--matchingThreshold` Matching threshold, ranges from 0 to 1. Smaller values make the comparison more sensitive. 0 by default.
|
|
46
|
+
* `-M`, `--matchingThreshold` Matching threshold, ranges from 0 to 1. Smaller values make the comparison more sensitive. 0 by default. Specifically, you can set how much of a difference in the YIQ difference metric should be considered a different pixel. If there is a difference between pixels, it will be treated as "same pixel" if it is within this threshold.
|
|
48
47
|
* `-T`, `--thresholdRate` Rate threshold for detecting change. When the difference ratio of the image is larger than the set rate detects the change. Applied after `matchingThreshold`. 0 by default.
|
|
49
48
|
* `-S`, `--thresholdPixel` Pixel threshold for detecting change. When the difference pixel of the image is larger than the set pixel detects the change. This value takes precedence over `thresholdRate`. Applied after `matchingThreshold`. 0 by default.
|
|
50
49
|
* `-C`, `--concurrency` How many processes launches in parallel. If omitted 4.
|
package/dist/cli.js
CHANGED
|
@@ -39,7 +39,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
39
39
|
var spinner = new _cliSpinner.Spinner();
|
|
40
40
|
spinner.setSpinnerString(18);
|
|
41
41
|
|
|
42
|
-
var cli = (0, _meow2.default)('\n Usage\n $ reg-cli /path/to/actual-dir /path/to/expected-dir /path/to/diff-dir\n Options\n -U, --update Update expected images.(Copy `actual images` to `expected images`).\n -J, --json Specified json report path. If omitted ./reg.json.\n -I, --ignoreChange If true, error will not be thrown when image change detected.\n -E, --extendedErrors If true, also added/deleted images will throw an error. If omitted false.\n -R, --report Output html report to specified directory.\n -P, --urlPrefix Add prefix to all image src.\n -M, --matchingThreshold Matching threshold, ranges from 0 to 1. Smaller values make the comparison more sensitive. 0 by default.\n -T, --thresholdRate Rate threshold for detecting change. When the difference ratio of the image is larger than the set rate detects the change.\n -S, --thresholdPixel Pixel threshold for detecting change. When the difference pixel of the image is larger than the set pixel detects the change. This value takes precedence over `thresholdRate`.\n -C, --concurrency How many processes launches in parallel. If omitted 4.\n -A, --enableAntialias. Enable antialias. If omitted false.\n -X, --additionalDetection. Enable additional difference detection(highly experimental). Select "none" or "client" (default: "none").\n -F, --from Generate report from json. Please specify json file. If set, only report will be output without comparing images.\n Examples\n $ reg-cli /path/to/actual-dir /path/to/expected-dir /path/to/diff-dir -U -D ./reg.json\n', {
|
|
42
|
+
var cli = (0, _meow2.default)('\n Usage\n $ reg-cli /path/to/actual-dir /path/to/expected-dir /path/to/diff-dir\n Options\n -U, --update Update expected images.(Copy `actual images` to `expected images`).\n -J, --json Specified json report path. If omitted ./reg.json.\n -I, --ignoreChange If true, error will not be thrown when image change detected.\n -E, --extendedErrors If true, also added/deleted images will throw an error. If omitted false.\n -R, --report Output html report to specified directory.\n -P, --urlPrefix Add prefix to all image src.\n -M, --matchingThreshold Matching threshold, ranges from 0 to 1. Smaller values make the comparison more sensitive. 0 by default.\n -T, --thresholdRate Rate threshold for detecting change. When the difference ratio of the image is larger than the set rate detects the change.\n -S, --thresholdPixel Pixel threshold for detecting change. When the difference pixel of the image is larger than the set pixel detects the change. This value takes precedence over `thresholdRate`.\n -C, --concurrency How many processes launches in parallel. If omitted 4.\n -A, --enableAntialias. Enable antialias. If omitted false.\n -X, --additionalDetection. Enable additional difference detection(highly experimental). Select "none" or "client" (default: "none").\n -F, --from Generate report from json. Please specify json file. If set, only report will be output without comparing images.\n -D, --customDiffMessage Pass custom massage that will logged to the terminal when there is a diff.\n Examples\n $ reg-cli /path/to/actual-dir /path/to/expected-dir /path/to/diff-dir -U -D ./reg.json\n', {
|
|
43
43
|
alias: {
|
|
44
44
|
U: 'update',
|
|
45
45
|
J: 'json',
|
|
@@ -53,7 +53,8 @@ var cli = (0, _meow2.default)('\n Usage\n $ reg-cli /path/to/actual-dir /pat
|
|
|
53
53
|
C: 'concurrency',
|
|
54
54
|
A: 'enableAntialias',
|
|
55
55
|
X: 'additionalDetection',
|
|
56
|
-
F: 'from'
|
|
56
|
+
F: 'from',
|
|
57
|
+
D: 'customDiffMessage'
|
|
57
58
|
}
|
|
58
59
|
});
|
|
59
60
|
if (!cli.flags.from) {
|
|
@@ -78,6 +79,7 @@ var extendedErrors = !!cli.flags.extendedErrors;
|
|
|
78
79
|
var ignoreChange = !!cli.flags.ignoreChange;
|
|
79
80
|
var enableClientAdditionalDetection = cli.flags.additionalDetection === 'client';
|
|
80
81
|
var from = String(cli.flags.from || '');
|
|
82
|
+
var customDiffMessage = String(cli.flags.customDiffMessage || '\nInspect your code changes, re-run with `-U` to update them. ');
|
|
81
83
|
|
|
82
84
|
// If from option specified, generate report from json and exit.
|
|
83
85
|
if (from) {
|
|
@@ -160,7 +162,7 @@ observer.once('complete', function (_ref) {
|
|
|
160
162
|
if (newItems.length) _log2.default.info(_icon.GREEK_CROSS + ' ' + newItems.length + ' file(s) appended.');
|
|
161
163
|
if (passedItems.length) _log2.default.success(_icon.CHECK_MARK + ' ' + passedItems.length + ' file(s) passed.');
|
|
162
164
|
if (!update && (failedItems.length > 0 || extendedErrors && (newItems.length > 0 || deletedItems.length > 0))) {
|
|
163
|
-
_log2.default.fail(
|
|
165
|
+
_log2.default.fail(customDiffMessage);
|
|
164
166
|
if (!ignoreChange) process.exit(1);
|
|
165
167
|
}
|
|
166
168
|
return process.exit(0);
|
package/dist/index.js
CHANGED
|
@@ -172,12 +172,14 @@ module.exports = function (params) {
|
|
|
172
172
|
expectedDir = params.expectedDir,
|
|
173
173
|
diffDir = params.diffDir,
|
|
174
174
|
json = params.json,
|
|
175
|
-
concurrency = params.concurrency,
|
|
175
|
+
_params$concurrency = params.concurrency,
|
|
176
|
+
concurrency = _params$concurrency === undefined ? 4 : _params$concurrency,
|
|
176
177
|
update = params.update,
|
|
177
178
|
report = params.report,
|
|
178
179
|
urlPrefix = params.urlPrefix,
|
|
179
180
|
threshold = params.threshold,
|
|
180
|
-
|
|
181
|
+
_params$matchingThres = params.matchingThreshold,
|
|
182
|
+
matchingThreshold = _params$matchingThres === undefined ? 0 : _params$matchingThres,
|
|
181
183
|
thresholdRate = params.thresholdRate,
|
|
182
184
|
thresholdPixel = params.thresholdPixel,
|
|
183
185
|
enableAntialias = params.enableAntialias,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reg-cli",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.7",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"start": "node ./dist/cli.js",
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
"build": "npm run build:cli && npm run build:report",
|
|
10
10
|
"build:cli": "babel src -d dist",
|
|
11
11
|
"build:report": "sh ./scripts/build-ui.sh v0.2.1",
|
|
12
|
-
"dev:report": "npm run copy:ximgdiff && webpack-dev-server --hot --inline --open",
|
|
13
12
|
"flow": "flow",
|
|
14
13
|
"copy:ximgdiff": "copyfiles -u 3 node_modules/x-img-diff-js/build/cv-wasm_browser.* report/assets",
|
|
15
14
|
"prepublishOnly": "npm run build",
|
|
@@ -30,19 +29,25 @@
|
|
|
30
29
|
"author": "bokuweb",
|
|
31
30
|
"license": "MIT",
|
|
32
31
|
"resolutions": {
|
|
33
|
-
"**/set-value": "4.0
|
|
32
|
+
"**/set-value": "4.1.0",
|
|
33
|
+
"**/tar": "^6.0.0",
|
|
34
|
+
"**/kind-of": "^6.0.3",
|
|
34
35
|
"**/randomatic": "3.1.1",
|
|
35
36
|
"**/deep-extend": "0.6.0",
|
|
36
37
|
"**/cryptiles": "4.1.3",
|
|
37
38
|
"**/lodash": "4.17.21",
|
|
38
|
-
"**/yargs-parser": "^
|
|
39
|
+
"**/yargs-parser": "^21.0.0",
|
|
39
40
|
"**/minimist": "^1.2.3",
|
|
41
|
+
"**/ajv": "^8.0.0",
|
|
42
|
+
"**/json-schema": "^0.4.0",
|
|
40
43
|
"**/hoek": "6.1.3",
|
|
44
|
+
"**/ansi-regex": "^5.0.1",
|
|
41
45
|
"**/glob-parent": "^6.0.1",
|
|
42
46
|
"**/dot-prop": "^6.0.1",
|
|
43
|
-
"**/node-forge": "^0.
|
|
47
|
+
"**/node-forge": "^1.0.0",
|
|
44
48
|
"**/serialize-javascript": "^6.0.0",
|
|
45
49
|
"**/y18n": "^5.0.0",
|
|
50
|
+
"**/braces": "^3.0.0",
|
|
46
51
|
"**/trim-newlines": "^3.0.1"
|
|
47
52
|
},
|
|
48
53
|
"dependencies": {
|
|
@@ -60,12 +65,12 @@
|
|
|
60
65
|
"meow": "3.7.0",
|
|
61
66
|
"mustache": "4.2.0",
|
|
62
67
|
"x-img-diff-js": "0.3.5",
|
|
63
|
-
"yargs-parser": "^
|
|
68
|
+
"yargs-parser": "^21.0.1"
|
|
64
69
|
},
|
|
65
70
|
"devDependencies": {
|
|
66
71
|
"ava": "0.25.0",
|
|
67
72
|
"babel-cli": "6.26.0",
|
|
68
|
-
"babel-loader": "8.2.
|
|
73
|
+
"babel-loader": "8.2.4",
|
|
69
74
|
"babel-plugin-transform-es2015-block-scoping": "6.26.0",
|
|
70
75
|
"babel-plugin-transform-flow-strip-types": "6.22.0",
|
|
71
76
|
"babel-preset-es2015": "6.24.1",
|
|
@@ -74,16 +79,12 @@
|
|
|
74
79
|
"babel-preset-stage-2": "6.24.1",
|
|
75
80
|
"copyfiles": "2.4.1",
|
|
76
81
|
"cross-env": "7.0.3",
|
|
77
|
-
"finalhandler": "1.
|
|
82
|
+
"finalhandler": "1.2.0",
|
|
78
83
|
"flow-bin": "0.77.0",
|
|
79
|
-
"flow-typed": "3.
|
|
80
|
-
"
|
|
81
|
-
"puppeteer": "1.20.0",
|
|
84
|
+
"flow-typed": "3.7.0",
|
|
85
|
+
"puppeteer": "13.5.1",
|
|
82
86
|
"rimraf": "3.0.2",
|
|
83
|
-
"serve-static": "1.14.
|
|
84
|
-
"webpack": "4.40.2",
|
|
85
|
-
"webpack-cli": "3.3.9",
|
|
86
|
-
"webpack-dev-server": "3.11.2"
|
|
87
|
+
"serve-static": "1.14.2"
|
|
87
88
|
},
|
|
88
89
|
"files": [
|
|
89
90
|
"dist",
|