@vizzly-testing/cli 0.29.3 → 0.29.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.
@@ -1,5 +1,8 @@
1
1
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  import { renderToString } from "react-dom/server";
3
+ function isNewComparisonStatus(status) {
4
+ return status === "new" || status === "baseline-created";
5
+ }
3
6
  const statusConfig = {
4
7
  failed: {
5
8
  label: "Changed",
@@ -430,11 +433,11 @@ function StaticReportView({ reportData }) {
430
433
  total: comparisons.length,
431
434
  passed: comparisons.filter((c) => c.status === "passed").length,
432
435
  failed: comparisons.filter((c) => c.status === "failed").length,
433
- new: comparisons.filter((c) => c.status === "new").length,
436
+ new: comparisons.filter((c) => isNewComparisonStatus(c.status)).length,
434
437
  error: comparisons.filter((c) => c.status === "error").length
435
438
  };
436
439
  let failed = comparisons.filter((c) => c.status === "failed");
437
- let newItems = comparisons.filter((c) => c.status === "new");
440
+ let newItems = comparisons.filter((c) => isNewComparisonStatus(c.status));
438
441
  let passed = comparisons.filter((c) => c.status === "passed");
439
442
  let errors = comparisons.filter((c) => c.status === "error");
440
443
  return /* @__PURE__ */ jsxs("div", { className: "min-h-screen bg-slate-900 text-white", children: [
@@ -1038,9 +1038,9 @@ export class TddService {
1038
1038
  }
1039
1039
 
1040
1040
  // Baseline exists - compare
1041
+ let effectiveThreshold = typeof validatedProperties.threshold === 'number' && validatedProperties.threshold >= 0 ? validatedProperties.threshold : this.threshold;
1042
+ let effectiveMinClusterSize = Number.isInteger(validatedProperties.minClusterSize) && validatedProperties.minClusterSize >= 1 ? validatedProperties.minClusterSize : this.minClusterSize;
1041
1043
  try {
1042
- let effectiveThreshold = typeof validatedProperties.threshold === 'number' && validatedProperties.threshold >= 0 ? validatedProperties.threshold : this.threshold;
1043
- let effectiveMinClusterSize = Number.isInteger(validatedProperties.minClusterSize) && validatedProperties.minClusterSize >= 1 ? validatedProperties.minClusterSize : this.minClusterSize;
1044
1044
  let honeydiffResult = await compareImages(baselineImagePath, currentImagePath, diffImagePath, {
1045
1045
  threshold: effectiveThreshold,
1046
1046
  minClusterSize: effectiveMinClusterSize
@@ -1088,29 +1088,25 @@ export class TddService {
1088
1088
  }
1089
1089
  } catch (error) {
1090
1090
  if (isDimensionMismatchError(error)) {
1091
- output.debug('comparison', `${sanitizedName}: dimension mismatch, creating new baseline`);
1092
- saveBaseline(this.baselinePath, filename, imageBuffer);
1093
- if (!this.baselineData) {
1094
- this.baselineData = createEmptyBaselineMetadata({
1095
- threshold: this.threshold,
1096
- signatureProperties: this.signatureProperties
1097
- });
1098
- }
1099
- let screenshotEntry = {
1100
- name: sanitizedName,
1101
- properties: validatedProperties,
1102
- path: baselineImagePath,
1103
- signature
1104
- };
1105
- upsertScreenshotInMetadata(this.baselineData, screenshotEntry, signature);
1106
- saveBaselineMetadata(this.baselinePath, this.baselineData);
1107
- let result = buildNewComparison({
1091
+ output.debug('comparison', `${sanitizedName}: dimension mismatch, marking comparison as failed`, {
1092
+ error: error.message
1093
+ });
1094
+ let result = buildFailedComparison({
1108
1095
  name: sanitizedName,
1109
1096
  signature,
1110
1097
  baselinePath: baselineImagePath,
1111
1098
  currentPath: currentImagePath,
1112
- properties: validatedProperties
1099
+ diffPath: null,
1100
+ properties: validatedProperties,
1101
+ threshold: effectiveThreshold,
1102
+ minClusterSize: effectiveMinClusterSize,
1103
+ honeydiffResult: {
1104
+ isDifferent: true,
1105
+ diffClusters: []
1106
+ }
1113
1107
  });
1108
+ result.reason = 'dimension-mismatch';
1109
+ result.error = error.message;
1114
1110
  this._upsertComparison(result);
1115
1111
  return result;
1116
1112
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vizzly-testing/cli",
3
- "version": "0.29.3",
3
+ "version": "0.29.4",
4
4
  "description": "Visual review platform for UI developers and designers",
5
5
  "keywords": [
6
6
  "visual-testing",
@@ -122,6 +122,7 @@
122
122
  "@vitejs/plugin-react": "^5.0.3",
123
123
  "@vizzly-testing/observatory": "^0.3.3",
124
124
  "autoprefixer": "^10.4.21",
125
+ "babel-plugin-react-compiler": "^1.0.0",
125
126
  "babel-plugin-transform-remove-console": "^6.9.4",
126
127
  "postcss": "^8.5.6",
127
128
  "react": "^19.1.1",