git-shots-cli 0.5.1 → 0.5.2

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.
Files changed (2) hide show
  1. package/dist/index.js +9 -6
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -312,19 +312,22 @@ async function review(config, options) {
312
312
  console.error(chalk6.red(`Request failed: ${err}`));
313
313
  process.exit(1);
314
314
  }
315
- const allZero = reviewData.diffs.length === 0 || reviewData.diffs.every((d) => d.mismatchPercentage === 0);
316
- if (allZero) {
315
+ if (reviewData.diffs.length === 0) {
317
316
  console.log(chalk6.green("No visual changes detected."));
318
317
  process.exit(0);
319
318
  }
320
319
  const sessionUrl = `${config.server}/reviews/${reviewData.review.id}`;
321
320
  console.log();
322
- console.log(chalk6.bold("Visual changes detected:"));
321
+ console.log(chalk6.bold(`${reviewData.diffs.length} screen${reviewData.diffs.length === 1 ? "" : "s"} changed:`));
323
322
  console.log();
324
323
  for (const d of reviewData.diffs) {
325
- const pct = d.mismatchPercentage.toFixed(2) + "%";
326
- const color = d.mismatchPercentage > 10 ? chalk6.red : d.mismatchPercentage > 1 ? chalk6.yellow : chalk6.green;
327
- console.log(` ${d.screen.padEnd(30)} ${color(pct)}`);
324
+ if (d.mismatchPercentage > 0) {
325
+ const pct = d.mismatchPercentage.toFixed(2) + "%";
326
+ const color = d.mismatchPercentage > 10 ? chalk6.red : d.mismatchPercentage > 1 ? chalk6.yellow : chalk6.green;
327
+ console.log(` ${d.screen.padEnd(30)} ${color(pct)}`);
328
+ } else {
329
+ console.log(` ${d.screen.padEnd(30)} ${chalk6.cyan("changed")}`);
330
+ }
328
331
  }
329
332
  console.log();
330
333
  console.log(`Review: ${chalk6.cyan(sessionUrl)}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-shots-cli",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "CLI for git-shots visual regression platform",
5
5
  "type": "module",
6
6
  "bin": {