@vizzly-testing/cli 0.3.2 → 0.5.0

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 (60) hide show
  1. package/README.md +50 -28
  2. package/dist/cli.js +34 -30
  3. package/dist/client/index.js +1 -1
  4. package/dist/commands/run.js +38 -11
  5. package/dist/commands/tdd.js +30 -18
  6. package/dist/commands/upload.js +56 -5
  7. package/dist/server/handlers/api-handler.js +83 -0
  8. package/dist/server/handlers/tdd-handler.js +138 -0
  9. package/dist/server/http-server.js +132 -0
  10. package/dist/services/api-service.js +22 -2
  11. package/dist/services/server-manager.js +45 -29
  12. package/dist/services/test-runner.js +66 -69
  13. package/dist/services/uploader.js +11 -4
  14. package/dist/types/commands/run.d.ts +4 -1
  15. package/dist/types/commands/tdd.d.ts +5 -1
  16. package/dist/types/sdk/index.d.ts +6 -6
  17. package/dist/types/server/handlers/api-handler.d.ts +49 -0
  18. package/dist/types/server/handlers/tdd-handler.d.ts +85 -0
  19. package/dist/types/server/http-server.d.ts +5 -0
  20. package/dist/types/services/api-service.d.ts +1 -0
  21. package/dist/types/services/server-manager.d.ts +148 -3
  22. package/dist/types/services/test-runner.d.ts +1 -0
  23. package/dist/types/services/uploader.d.ts +2 -1
  24. package/dist/types/utils/ci-env.d.ts +55 -0
  25. package/dist/types/utils/config-helpers.d.ts +1 -1
  26. package/dist/types/utils/console-ui.d.ts +1 -1
  27. package/dist/types/utils/git.d.ts +12 -0
  28. package/dist/utils/ci-env.js +293 -0
  29. package/dist/utils/console-ui.js +4 -14
  30. package/dist/utils/git.js +38 -0
  31. package/docs/api-reference.md +17 -5
  32. package/docs/getting-started.md +1 -1
  33. package/docs/tdd-mode.md +9 -9
  34. package/docs/test-integration.md +9 -17
  35. package/docs/upload-command.md +7 -0
  36. package/package.json +4 -5
  37. package/dist/screenshot-wrapper.js +0 -68
  38. package/dist/server/index.js +0 -522
  39. package/dist/services/service-utils.js +0 -171
  40. package/dist/types/index.js +0 -153
  41. package/dist/types/screenshot-wrapper.d.ts +0 -27
  42. package/dist/types/server/index.d.ts +0 -38
  43. package/dist/types/services/service-utils.d.ts +0 -45
  44. package/dist/types/types/index.d.ts +0 -373
  45. package/dist/types/utils/diagnostics.d.ts +0 -69
  46. package/dist/types/utils/error-messages.d.ts +0 -42
  47. package/dist/types/utils/framework-detector.d.ts +0 -5
  48. package/dist/types/utils/help.d.ts +0 -11
  49. package/dist/types/utils/image-comparison.d.ts +0 -42
  50. package/dist/types/utils/package.d.ts +0 -1
  51. package/dist/types/utils/project-detection.d.ts +0 -19
  52. package/dist/types/utils/ui-helpers.d.ts +0 -23
  53. package/dist/utils/diagnostics.js +0 -184
  54. package/dist/utils/error-messages.js +0 -34
  55. package/dist/utils/framework-detector.js +0 -40
  56. package/dist/utils/help.js +0 -66
  57. package/dist/utils/image-comparison.js +0 -172
  58. package/dist/utils/package.js +0 -9
  59. package/dist/utils/project-detection.js +0 -145
  60. package/dist/utils/ui-helpers.js +0 -86
@@ -1,86 +0,0 @@
1
- /**
2
- * Color and styling utilities for Ink components
3
- */
4
-
5
- /**
6
- * Check if colors should be used
7
- */
8
- export function shouldUseColors(flags = {}) {
9
- return !flags.noColor && !process.env.NO_COLOR && process.stdout.isTTY && process.env.TERM !== 'dumb';
10
- }
11
-
12
- /**
13
- * Get color for text based on type and color support
14
- */
15
- export function getColor(type, flags = {}) {
16
- if (!shouldUseColors(flags)) {
17
- return undefined; // No color
18
- }
19
- const colors = {
20
- success: 'green',
21
- error: 'red',
22
- warning: 'yellow',
23
- info: 'blue',
24
- progress: 'cyan',
25
- dim: 'gray'
26
- };
27
- return colors[type];
28
- }
29
-
30
- /**
31
- * Get status icon with fallback for no-color mode
32
- */
33
- export function getStatusIcon(status, flags = {}) {
34
- if (shouldUseColors(flags)) {
35
- // Colored emoji icons
36
- const icons = {
37
- success: '✅',
38
- error: '❌',
39
- warning: '⚠️',
40
- progress: '🔄',
41
- uploading: '📤',
42
- waiting: '⏳',
43
- running: '🧪',
44
- starting: '🚀'
45
- };
46
- return icons[status] || '•';
47
- } else {
48
- // Text-only fallback
49
- const icons = {
50
- success: '[OK]',
51
- error: '[ERR]',
52
- warning: '[WARN]',
53
- progress: '[...]',
54
- uploading: '[UP]',
55
- waiting: '[WAIT]',
56
- running: '[RUN]',
57
- starting: '[START]'
58
- };
59
- return icons[status] || '[•]';
60
- }
61
- }
62
-
63
- /**
64
- * Responsive layout helper
65
- */
66
- export function getLayout(columns = process.stdout.columns || 80) {
67
- if (columns < 60) {
68
- return {
69
- type: 'compact',
70
- showDetails: false,
71
- maxWidth: columns - 4
72
- };
73
- } else if (columns < 100) {
74
- return {
75
- type: 'normal',
76
- showDetails: true,
77
- maxWidth: columns - 8
78
- };
79
- } else {
80
- return {
81
- type: 'wide',
82
- showDetails: true,
83
- maxWidth: Math.min(columns - 16, 120)
84
- };
85
- }
86
- }