@vizzly-testing/cli 0.26.0 → 0.26.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.
|
@@ -405,6 +405,15 @@ export const createTddHandler = (config, workingDir, baselineBuild, baselineComp
|
|
|
405
405
|
// Update comparison in report data file
|
|
406
406
|
updateComparison(newComparison);
|
|
407
407
|
|
|
408
|
+
// Log screenshot event for menubar
|
|
409
|
+
// Normalize status to match HTTP response ('failed' -> 'diff')
|
|
410
|
+
let logStatus = comparison.status === 'failed' ? 'diff' : comparison.status;
|
|
411
|
+
output.info(`Screenshot: ${sanitizedName}`, {
|
|
412
|
+
screenshot: sanitizedName,
|
|
413
|
+
status: logStatus,
|
|
414
|
+
diffPercentage: comparison.diffPercentage || 0
|
|
415
|
+
});
|
|
416
|
+
|
|
408
417
|
// Visual diffs return 200 with status: 'diff' - they're not errors
|
|
409
418
|
// The SDK/user can decide whether to fail tests based on this
|
|
410
419
|
if (comparison.status === 'failed') {
|
|
@@ -486,7 +495,13 @@ export const createTddHandler = (config, workingDir, baselineBuild, baselineComp
|
|
|
486
495
|
diff: null
|
|
487
496
|
};
|
|
488
497
|
updateComparison(updatedComparison);
|
|
489
|
-
|
|
498
|
+
|
|
499
|
+
// Log screenshot event for menubar
|
|
500
|
+
output.info(`Screenshot: ${comparison.name}`, {
|
|
501
|
+
screenshot: comparison.name,
|
|
502
|
+
status: 'accepted',
|
|
503
|
+
diffPercentage: 0
|
|
504
|
+
});
|
|
490
505
|
return result;
|
|
491
506
|
} catch (error) {
|
|
492
507
|
output.error(`Failed to accept baseline for ${comparisonId}:`, error);
|
|
@@ -510,7 +525,13 @@ export const createTddHandler = (config, workingDir, baselineBuild, baselineComp
|
|
|
510
525
|
status: 'rejected'
|
|
511
526
|
};
|
|
512
527
|
updateComparison(updatedComparison);
|
|
513
|
-
|
|
528
|
+
|
|
529
|
+
// Log screenshot event for menubar
|
|
530
|
+
output.info(`Screenshot: ${comparison.name}`, {
|
|
531
|
+
screenshot: comparison.name,
|
|
532
|
+
status: 'rejected',
|
|
533
|
+
diffPercentage: comparison.diffPercentage || 0
|
|
534
|
+
});
|
|
514
535
|
return {
|
|
515
536
|
success: true,
|
|
516
537
|
id: comparisonId
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { execSync } from 'node:child_process';
|
|
1
2
|
import { randomBytes } from 'node:crypto';
|
|
2
3
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
3
4
|
import { createServer } from 'node:net';
|
|
@@ -166,13 +167,19 @@ export class ServerRegistry {
|
|
|
166
167
|
/**
|
|
167
168
|
* Notify the menubar app that the registry changed
|
|
168
169
|
*
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
* For now, file watching provides reliable, immediate updates.
|
|
170
|
+
* Uses macOS notifyutil for instant Darwin notification delivery.
|
|
171
|
+
* The menubar app listens for this in addition to file watching.
|
|
172
172
|
*/
|
|
173
173
|
notifyMenubar() {
|
|
174
|
-
|
|
175
|
-
|
|
174
|
+
if (process.platform !== 'darwin') return;
|
|
175
|
+
try {
|
|
176
|
+
execSync('notifyutil -p dev.vizzly.serverChanged', {
|
|
177
|
+
stdio: 'ignore',
|
|
178
|
+
timeout: 500
|
|
179
|
+
});
|
|
180
|
+
} catch {
|
|
181
|
+
// Non-fatal - menubar will still see changes via file watching
|
|
182
|
+
}
|
|
176
183
|
}
|
|
177
184
|
|
|
178
185
|
/**
|
package/dist/utils/output.js
CHANGED
|
@@ -185,6 +185,10 @@ export function getColors() {
|
|
|
185
185
|
*/
|
|
186
186
|
export function success(message, data = {}) {
|
|
187
187
|
stopSpinner();
|
|
188
|
+
writeLog('info', message, {
|
|
189
|
+
status: 'success',
|
|
190
|
+
...data
|
|
191
|
+
});
|
|
188
192
|
if (config.silent) return;
|
|
189
193
|
if (config.json) {
|
|
190
194
|
console.log(JSON.stringify({
|
|
@@ -221,6 +225,7 @@ export function result(message) {
|
|
|
221
225
|
* Show an info message
|
|
222
226
|
*/
|
|
223
227
|
export function info(message, data = {}) {
|
|
228
|
+
writeLog('info', message, data);
|
|
224
229
|
if (!shouldLog('info')) return;
|
|
225
230
|
if (config.json) {
|
|
226
231
|
console.log(JSON.stringify({
|
|
@@ -238,6 +243,7 @@ export function info(message, data = {}) {
|
|
|
238
243
|
*/
|
|
239
244
|
export function warn(message, data = {}) {
|
|
240
245
|
stopSpinner();
|
|
246
|
+
writeLog('warn', message, data);
|
|
241
247
|
if (!shouldLog('warn')) return;
|
|
242
248
|
if (config.json) {
|
|
243
249
|
console.error(JSON.stringify({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vizzly-testing/cli",
|
|
3
|
-
"version": "0.26.
|
|
3
|
+
"version": "0.26.2",
|
|
4
4
|
"description": "Visual review platform for UI developers and designers",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"visual-testing",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"registry": "https://registry.npmjs.org/"
|
|
87
87
|
},
|
|
88
88
|
"dependencies": {
|
|
89
|
-
"@vizzly-testing/honeydiff": "^0.
|
|
89
|
+
"@vizzly-testing/honeydiff": "^0.10.0",
|
|
90
90
|
"ansis": "^4.2.0",
|
|
91
91
|
"commander": "^14.0.0",
|
|
92
92
|
"cosmiconfig": "^9.0.0",
|