reg-cli 0.17.2 → 0.17.5

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 CHANGED
@@ -44,9 +44,9 @@ $ reg-cli /path/to/actual-dir /path/to/expected-dir /path/to/diff-dir -R ./repor
44
44
  * `-I`, `--ignoreChange` If true, error will not be thrown when image change detected.
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
- * `-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`.
47
+ * `-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
+ * `-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) || 4,
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
- return _path2.default.join(expectedDir, image);
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;
@@ -165,12 +172,14 @@ module.exports = function (params) {
165
172
  expectedDir = params.expectedDir,
166
173
  diffDir = params.diffDir,
167
174
  json = params.json,
168
- concurrency = params.concurrency,
175
+ _params$concurrency = params.concurrency,
176
+ concurrency = _params$concurrency === undefined ? 4 : _params$concurrency,
169
177
  update = params.update,
170
178
  report = params.report,
171
179
  urlPrefix = params.urlPrefix,
172
180
  threshold = params.threshold,
173
- matchingThreshold = params.matchingThreshold,
181
+ _params$matchingThres = params.matchingThreshold,
182
+ matchingThreshold = _params$matchingThres === undefined ? 0 : _params$matchingThres,
174
183
  thresholdRate = params.thresholdRate,
175
184
  thresholdPixel = params.thresholdPixel,
176
185
  enableAntialias = params.enableAntialias,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reg-cli",
3
- "version": "0.17.2",
3
+ "version": "0.17.5",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "start": "node ./dist/cli.js",
@@ -8,8 +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.0",
12
- "dev:report": "npm run copy:ximgdiff && webpack-dev-server --hot --inline --open",
11
+ "build:report": "sh ./scripts/build-ui.sh v0.2.1",
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.0",
32
+ "**/set-value": "4.1.0",
33
+ "**/tar": "^4.4.18",
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": "^20.0.0",
39
+ "**/yargs-parser": "^21.0.0",
39
40
  "**/minimist": "^1.2.3",
41
+ "**/ajv": "^6.12.4",
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.10.0",
47
+ "**/node-forge": "^1.0.0",
44
48
  "**/serialize-javascript": "^6.0.0",
45
49
  "**/y18n": "^5.0.0",
50
+ "**/braces": "^2.3.2",
46
51
  "**/trim-newlines": "^3.0.1"
47
52
  },
48
53
  "dependencies": {
@@ -51,7 +56,7 @@
51
56
  "cli-spinner": "0.2.10",
52
57
  "cross-spawn": "7.0.3",
53
58
  "del": "6.0.0",
54
- "glob": "7.1.7",
59
+ "glob": "7.2.0",
55
60
  "img-diff-js": "0.5.2",
56
61
  "jpeg-js": "^0.4.0",
57
62
  "lodash": "4.17.21",
@@ -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": "^20.2.9"
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.2",
73
+ "babel-loader": "8.2.3",
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",
@@ -77,13 +82,9 @@
77
82
  "finalhandler": "1.1.2",
78
83
  "flow-bin": "0.77.0",
79
84
  "flow-typed": "3.2.1",
80
- "husky": "4.3.0",
81
- "puppeteer": "1.20.0",
85
+ "puppeteer": "13.4.1",
82
86
  "rimraf": "3.0.2",
83
- "serve-static": "1.14.1",
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",