reg-cli 0.17.0 → 0.17.4
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 +4 -4
- package/dist/cli.js +2 -2
- package/dist/index.js +8 -1
- package/package.json +25 -18
- package/report/ui/dist/report.js +2 -49
- package/report/ui/dist/worker.js +1 -1
- package/CHANGELOG.md +0 -29
- package/report/ui/LICENSE +0 -21
- package/report/ui/README.md +0 -85
- package/report/ui/package.json +0 -106
package/README.md
CHANGED
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
|
|
21
21
|
### Requirements
|
|
22
22
|
|
|
23
|
-
- Node.js
|
|
23
|
+
- Node.js v12+
|
|
24
24
|
|
|
25
|
-
`reg-cli` support Node.js
|
|
25
|
+
`reg-cli` support Node.js v12+
|
|
26
26
|
|
|
27
27
|
``` sh
|
|
28
28
|
$ npm i -D reg-cli
|
|
@@ -45,8 +45,8 @@ $ reg-cli /path/to/actual-dir /path/to/expected-dir /path/to/diff-dir -R ./repor
|
|
|
45
45
|
* `-E`, `--extendedErrors` If true, also added/deleted images will throw an error.
|
|
46
46
|
* `-P`, `--urlPrefix` Add prefix to all image src.
|
|
47
47
|
* `-M`, `--matchingThreshold` Matching threshold, ranges from 0 to 1. Smaller values make the comparison more sensitive. 0 by default.
|
|
48
|
-
* `-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`.
|
|
49
|
-
* `-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`.
|
|
48
|
+
* `-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
|
+
* `-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
50
|
* `-C`, `--concurrency` How many processes launches in parallel. If omitted 4.
|
|
51
51
|
* `-A`, `--enableAntialias` Enable antialias. If omitted false.
|
|
52
52
|
* `-X`, `--additionalDetection`. Enable additional difference detection(highly experimental). Select "none" or "client" (default: "none").
|
package/dist/cli.js
CHANGED
|
@@ -115,10 +115,10 @@ var observer = (0, _2.default)({
|
|
|
115
115
|
report: report,
|
|
116
116
|
json: json,
|
|
117
117
|
urlPrefix: urlPrefix,
|
|
118
|
-
matchingThreshold: Number(cli.flags.matchingThreshold),
|
|
118
|
+
matchingThreshold: Number(cli.flags.matchingThreshold || 0),
|
|
119
119
|
thresholdRate: Number(cli.flags.thresholdRate),
|
|
120
120
|
thresholdPixel: Number(cli.flags.thresholdPixel),
|
|
121
|
-
concurrency: Number(cli.flags.concurrency
|
|
121
|
+
concurrency: Number(cli.flags.concurrency || 4),
|
|
122
122
|
enableAntialias: !!cli.flags.enableAntialias,
|
|
123
123
|
enableClientAdditionalDetection: enableClientAdditionalDetection
|
|
124
124
|
});
|
package/dist/index.js
CHANGED
|
@@ -118,12 +118,19 @@ var compareImages = function compareImages(emitter, _ref2) {
|
|
|
118
118
|
|
|
119
119
|
var cleanupExpectedDir = function cleanupExpectedDir(expectedDir, changedFiles) {
|
|
120
120
|
var paths = changedFiles.map(function (image) {
|
|
121
|
-
|
|
121
|
+
var _path$posix;
|
|
122
|
+
|
|
123
|
+
var directories = expectedDir.split("\\");
|
|
124
|
+
return escapeGlob((_path$posix = _path2.default.posix).join.apply(_path$posix, _toConsumableArray(directories).concat([image])));
|
|
122
125
|
});
|
|
123
126
|
// force: true needed to allow deleting outside working directory
|
|
124
127
|
return (0, _del2.default)(paths, { force: true });
|
|
125
128
|
};
|
|
126
129
|
|
|
130
|
+
var escapeGlob = function escapeGlob(fileName) {
|
|
131
|
+
return fileName.replace(/(\*)/g, '[$1]').replace(/(\*)/g, '[$1]').replace(/(\?)/g, '[$1]').replace(/(\[)/g, '[$1]').replace(/(\])/g, '[$1]').replace(/(\{)/g, '[$1]').replace(/(\})/g, '[$1]').replace(/(\))/g, '[$1]').replace(/(\()/g, '[$1]').replace(/(\!)/g, '[$1]');
|
|
132
|
+
};
|
|
133
|
+
|
|
127
134
|
var aggregate = function aggregate(result) {
|
|
128
135
|
var passed = result.filter(function (r) {
|
|
129
136
|
return r.passed;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reg-cli",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"start": "node ./dist/cli.js",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"watch": "babel src --watch -d dist",
|
|
9
9
|
"build": "npm run build:cli && npm run build:report",
|
|
10
10
|
"build:cli": "babel src -d dist",
|
|
11
|
-
"build:report": "sh ./scripts/build-ui.sh v0.2.
|
|
11
|
+
"build:report": "sh ./scripts/build-ui.sh v0.2.1",
|
|
12
12
|
"dev:report": "npm run copy:ximgdiff && webpack-dev-server --hot --inline --open",
|
|
13
13
|
"flow": "flow",
|
|
14
14
|
"copy:ximgdiff": "copyfiles -u 3 node_modules/x-img-diff-js/build/cv-wasm_browser.* report/assets",
|
|
@@ -20,6 +20,9 @@
|
|
|
20
20
|
"test:screenshot": "npm run build:report && npm run reg && npm run screenshot",
|
|
21
21
|
"test": "cross-env NODE_ENV=\"debug\" npm run build:report && npm run build && npm run test:cli && npm run test:screenshot"
|
|
22
22
|
},
|
|
23
|
+
"engines": {
|
|
24
|
+
"node": ">=12"
|
|
25
|
+
},
|
|
23
26
|
"repository": {
|
|
24
27
|
"type": "git",
|
|
25
28
|
"url": "https://github.com/reg-viz/reg-cli/"
|
|
@@ -27,56 +30,60 @@
|
|
|
27
30
|
"author": "bokuweb",
|
|
28
31
|
"license": "MIT",
|
|
29
32
|
"resolutions": {
|
|
30
|
-
"**/set-value": "
|
|
33
|
+
"**/set-value": "4.0.1",
|
|
31
34
|
"**/randomatic": "3.1.1",
|
|
32
35
|
"**/deep-extend": "0.6.0",
|
|
33
36
|
"**/cryptiles": "4.1.3",
|
|
37
|
+
"**/lodash": "4.17.21",
|
|
38
|
+
"**/yargs-parser": "^20.0.0",
|
|
39
|
+
"**/minimist": "^1.2.3",
|
|
34
40
|
"**/hoek": "6.1.3",
|
|
35
|
-
"**/
|
|
41
|
+
"**/glob-parent": "^6.0.1",
|
|
42
|
+
"**/dot-prop": "^6.0.1",
|
|
36
43
|
"**/node-forge": "^0.10.0",
|
|
37
|
-
"**/serialize-javascript": "^
|
|
44
|
+
"**/serialize-javascript": "^6.0.0",
|
|
45
|
+
"**/y18n": "^5.0.0",
|
|
46
|
+
"**/trim-newlines": "^3.0.1"
|
|
38
47
|
},
|
|
39
48
|
"dependencies": {
|
|
40
49
|
"bluebird": "3.7.2",
|
|
41
|
-
"chalk": "4.1.
|
|
50
|
+
"chalk": "4.1.2",
|
|
42
51
|
"cli-spinner": "0.2.10",
|
|
43
52
|
"cross-spawn": "7.0.3",
|
|
44
53
|
"del": "6.0.0",
|
|
45
|
-
"glob": "7.
|
|
46
|
-
"img-diff-js": "0.5.
|
|
47
|
-
"
|
|
54
|
+
"glob": "7.2.0",
|
|
55
|
+
"img-diff-js": "0.5.2",
|
|
56
|
+
"jpeg-js": "^0.4.0",
|
|
57
|
+
"lodash": "4.17.21",
|
|
48
58
|
"make-dir": "3.1.0",
|
|
49
59
|
"md5-file": "4.0.0",
|
|
50
60
|
"meow": "3.7.0",
|
|
51
|
-
"mustache": "4.
|
|
52
|
-
"x-img-diff-js": "0.3.5"
|
|
61
|
+
"mustache": "4.2.0",
|
|
62
|
+
"x-img-diff-js": "0.3.5",
|
|
63
|
+
"yargs-parser": "^20.2.9"
|
|
53
64
|
},
|
|
54
65
|
"devDependencies": {
|
|
55
66
|
"ava": "0.25.0",
|
|
56
67
|
"babel-cli": "6.26.0",
|
|
57
|
-
"babel-loader": "8.
|
|
68
|
+
"babel-loader": "8.2.2",
|
|
58
69
|
"babel-plugin-transform-es2015-block-scoping": "6.26.0",
|
|
59
70
|
"babel-plugin-transform-flow-strip-types": "6.22.0",
|
|
60
71
|
"babel-preset-es2015": "6.24.1",
|
|
61
72
|
"babel-preset-es2016": "6.24.1",
|
|
62
73
|
"babel-preset-es2017": "6.24.1",
|
|
63
74
|
"babel-preset-stage-2": "6.24.1",
|
|
64
|
-
"copyfiles": "2.
|
|
75
|
+
"copyfiles": "2.4.1",
|
|
65
76
|
"cross-env": "7.0.3",
|
|
66
77
|
"finalhandler": "1.1.2",
|
|
67
78
|
"flow-bin": "0.77.0",
|
|
68
79
|
"flow-typed": "3.2.1",
|
|
69
80
|
"husky": "4.3.0",
|
|
70
81
|
"puppeteer": "1.20.0",
|
|
71
|
-
"reg-keygen-git-hash-plugin": "0.10.11",
|
|
72
|
-
"reg-notify-github-plugin": "0.10.10",
|
|
73
|
-
"reg-publish-s3-plugin": "0.10.10",
|
|
74
|
-
"reg-suit": "0.10.10",
|
|
75
82
|
"rimraf": "3.0.2",
|
|
76
83
|
"serve-static": "1.14.1",
|
|
77
84
|
"webpack": "4.40.2",
|
|
78
85
|
"webpack-cli": "3.3.9",
|
|
79
|
-
"webpack-dev-server": "3.
|
|
86
|
+
"webpack-dev-server": "3.11.2"
|
|
80
87
|
},
|
|
81
88
|
"files": [
|
|
82
89
|
"dist",
|