reg-cli 0.17.5 → 0.17.6

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
@@ -1,6 +1,5 @@
1
1
  ![reg-cli](./docs/reg-cli.jpg)
2
2
 
3
- ![[Build Status](https://circleci.com/gh/reg-viz/reg-cli/tree/master)](https://circleci.com/gh/reg-viz/reg-cli/tree/master.svg?style=svg)
4
3
  ![[Build Status](https://travis-ci.org/reg-viz/reg-cli)](https://travis-ci.org/reg-viz/reg-cli.svg?branch=master)
5
4
  ![[Build Status](https://ci.appveyor.com/project/bokuweb/reg-cli)](https://ci.appveyor.com/api/projects/status/ir907qbc633q9na4?svg=true)
6
5
  ![[npm package](https://www.npmjs.com/package/reg-cli)](https://img.shields.io/npm/v/reg-cli.svg)
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('\nInspect your code changes, re-run with `-U` to update them. ');
165
+ _log2.default.fail(customDiffMessage);
164
166
  if (!ignoreChange) process.exit(1);
165
167
  }
166
168
  return process.exit(0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reg-cli",
3
- "version": "0.17.5",
3
+ "version": "0.17.6",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "start": "node ./dist/cli.js",
@@ -38,7 +38,7 @@
38
38
  "**/lodash": "4.17.21",
39
39
  "**/yargs-parser": "^21.0.0",
40
40
  "**/minimist": "^1.2.3",
41
- "**/ajv": "^6.12.4",
41
+ "**/ajv": "^8.0.0",
42
42
  "**/json-schema": "^0.4.0",
43
43
  "**/hoek": "6.1.3",
44
44
  "**/ansi-regex": "^5.0.1",
@@ -47,7 +47,7 @@
47
47
  "**/node-forge": "^1.0.0",
48
48
  "**/serialize-javascript": "^6.0.0",
49
49
  "**/y18n": "^5.0.0",
50
- "**/braces": "^2.3.2",
50
+ "**/braces": "^3.0.0",
51
51
  "**/trim-newlines": "^3.0.1"
52
52
  },
53
53
  "dependencies": {