@vizzly-testing/cli 0.15.1 → 0.16.1

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 (135) hide show
  1. package/dist/client/index.js +21 -4
  2. package/dist/reporter/reporter-bundle.css +1 -1
  3. package/dist/reporter/reporter-bundle.iife.js +11 -11
  4. package/dist/sdk/index.js +6 -6
  5. package/dist/services/api-service.js +42 -0
  6. package/dist/services/tdd-service.js +189 -6
  7. package/dist/services/test-runner.js +0 -8
  8. package/dist/services/uploader.js +1 -1
  9. package/dist/types/client.d.ts +88 -0
  10. package/dist/types/config.d.ts +29 -0
  11. package/dist/types/index.d.ts +426 -9
  12. package/dist/types/sdk.d.ts +146 -0
  13. package/dist/utils/config-helpers.js +2 -2
  14. package/docs/tdd-mode.md +34 -0
  15. package/package.json +21 -4
  16. package/dist/types/cli.d.ts +0 -2
  17. package/dist/types/client/index.d.ts +0 -80
  18. package/dist/types/commands/doctor.d.ts +0 -11
  19. package/dist/types/commands/finalize.d.ts +0 -13
  20. package/dist/types/commands/init.d.ts +0 -32
  21. package/dist/types/commands/login.d.ts +0 -11
  22. package/dist/types/commands/logout.d.ts +0 -11
  23. package/dist/types/commands/project.d.ts +0 -28
  24. package/dist/types/commands/run.d.ts +0 -16
  25. package/dist/types/commands/status.d.ts +0 -13
  26. package/dist/types/commands/tdd-daemon.d.ts +0 -24
  27. package/dist/types/commands/tdd.d.ts +0 -17
  28. package/dist/types/commands/upload.d.ts +0 -13
  29. package/dist/types/commands/whoami.d.ts +0 -11
  30. package/dist/types/errors/vizzly-error.d.ts +0 -75
  31. package/dist/types/plugin-loader.d.ts +0 -7
  32. package/dist/types/reporter/src/api/client.d.ts +0 -178
  33. package/dist/types/reporter/src/components/app-router.d.ts +0 -1
  34. package/dist/types/reporter/src/components/code-block.d.ts +0 -4
  35. package/dist/types/reporter/src/components/comparison/comparison-actions.d.ts +0 -5
  36. package/dist/types/reporter/src/components/comparison/comparison-card.d.ts +0 -7
  37. package/dist/types/reporter/src/components/comparison/comparison-group.d.ts +0 -10
  38. package/dist/types/reporter/src/components/comparison/comparison-list.d.ts +0 -6
  39. package/dist/types/reporter/src/components/comparison/comparison-modes/onion-skin-mode.d.ts +0 -10
  40. package/dist/types/reporter/src/components/comparison/comparison-modes/overlay-mode.d.ts +0 -11
  41. package/dist/types/reporter/src/components/comparison/comparison-modes/shared/base-comparison-mode.d.ts +0 -14
  42. package/dist/types/reporter/src/components/comparison/comparison-modes/shared/image-renderer.d.ts +0 -30
  43. package/dist/types/reporter/src/components/comparison/comparison-modes/toggle-view.d.ts +0 -8
  44. package/dist/types/reporter/src/components/comparison/comparison-viewer.d.ts +0 -8
  45. package/dist/types/reporter/src/components/comparison/fullscreen-viewer.d.ts +0 -13
  46. package/dist/types/reporter/src/components/comparison/screenshot-display.d.ts +0 -16
  47. package/dist/types/reporter/src/components/comparison/screenshot-list.d.ts +0 -9
  48. package/dist/types/reporter/src/components/comparison/variant-selector.d.ts +0 -9
  49. package/dist/types/reporter/src/components/comparison/view-mode-selector.d.ts +0 -4
  50. package/dist/types/reporter/src/components/dashboard/dashboard-filters.d.ts +0 -16
  51. package/dist/types/reporter/src/components/design-system/alert.d.ts +0 -9
  52. package/dist/types/reporter/src/components/design-system/badge.d.ts +0 -17
  53. package/dist/types/reporter/src/components/design-system/button.d.ts +0 -19
  54. package/dist/types/reporter/src/components/design-system/card.d.ts +0 -31
  55. package/dist/types/reporter/src/components/design-system/empty-state.d.ts +0 -13
  56. package/dist/types/reporter/src/components/design-system/form-controls.d.ts +0 -44
  57. package/dist/types/reporter/src/components/design-system/health-ring.d.ts +0 -7
  58. package/dist/types/reporter/src/components/design-system/index.d.ts +0 -11
  59. package/dist/types/reporter/src/components/design-system/modal.d.ts +0 -10
  60. package/dist/types/reporter/src/components/design-system/skeleton.d.ts +0 -19
  61. package/dist/types/reporter/src/components/design-system/spinner.d.ts +0 -10
  62. package/dist/types/reporter/src/components/design-system/tabs.d.ts +0 -13
  63. package/dist/types/reporter/src/components/layout/header.d.ts +0 -5
  64. package/dist/types/reporter/src/components/layout/index.d.ts +0 -2
  65. package/dist/types/reporter/src/components/layout/layout.d.ts +0 -6
  66. package/dist/types/reporter/src/components/ui/smart-image.d.ts +0 -7
  67. package/dist/types/reporter/src/components/ui/toast.d.ts +0 -4
  68. package/dist/types/reporter/src/components/views/builds-view.d.ts +0 -1
  69. package/dist/types/reporter/src/components/views/comparison-detail-view.d.ts +0 -5
  70. package/dist/types/reporter/src/components/views/comparisons-view.d.ts +0 -5
  71. package/dist/types/reporter/src/components/views/projects-view.d.ts +0 -1
  72. package/dist/types/reporter/src/components/views/settings-view.d.ts +0 -1
  73. package/dist/types/reporter/src/components/views/stats-view.d.ts +0 -1
  74. package/dist/types/reporter/src/components/waiting-for-screenshots.d.ts +0 -1
  75. package/dist/types/reporter/src/hooks/queries/use-auth-queries.d.ts +0 -15
  76. package/dist/types/reporter/src/hooks/queries/use-cloud-queries.d.ts +0 -6
  77. package/dist/types/reporter/src/hooks/queries/use-config-queries.d.ts +0 -6
  78. package/dist/types/reporter/src/hooks/queries/use-tdd-queries.d.ts +0 -9
  79. package/dist/types/reporter/src/hooks/use-comparison-filters.d.ts +0 -20
  80. package/dist/types/reporter/src/hooks/use-image-loader.d.ts +0 -1
  81. package/dist/types/reporter/src/lib/query-client.d.ts +0 -2
  82. package/dist/types/reporter/src/lib/query-keys.d.ts +0 -13
  83. package/dist/types/reporter/src/main.d.ts +0 -1
  84. package/dist/types/reporter/src/services/api-client.d.ts +0 -11
  85. package/dist/types/reporter/src/utils/comparison-helpers.d.ts +0 -16
  86. package/dist/types/reporter/src/utils/constants.d.ts +0 -37
  87. package/dist/types/reporter/vite.config.d.ts +0 -2
  88. package/dist/types/reporter/vite.dev.config.d.ts +0 -2
  89. package/dist/types/sdk/index.d.ts +0 -110
  90. package/dist/types/server/handlers/api-handler.d.ts +0 -88
  91. package/dist/types/server/handlers/tdd-handler.d.ts +0 -162
  92. package/dist/types/server/http-server.d.ts +0 -6
  93. package/dist/types/server/middleware/cors.d.ts +0 -11
  94. package/dist/types/server/middleware/json-parser.d.ts +0 -10
  95. package/dist/types/server/middleware/response.d.ts +0 -50
  96. package/dist/types/server/routers/assets.d.ts +0 -6
  97. package/dist/types/server/routers/auth.d.ts +0 -9
  98. package/dist/types/server/routers/baseline.d.ts +0 -13
  99. package/dist/types/server/routers/cloud-proxy.d.ts +0 -11
  100. package/dist/types/server/routers/config.d.ts +0 -9
  101. package/dist/types/server/routers/dashboard.d.ts +0 -6
  102. package/dist/types/server/routers/health.d.ts +0 -11
  103. package/dist/types/server/routers/projects.d.ts +0 -9
  104. package/dist/types/server/routers/screenshot.d.ts +0 -11
  105. package/dist/types/services/api-service.d.ts +0 -100
  106. package/dist/types/services/auth-service.d.ts +0 -59
  107. package/dist/types/services/build-manager.d.ts +0 -69
  108. package/dist/types/services/config-service.d.ts +0 -97
  109. package/dist/types/services/html-report-generator.d.ts +0 -52
  110. package/dist/types/services/index.d.ts +0 -7
  111. package/dist/types/services/project-service.d.ts +0 -105
  112. package/dist/types/services/report-generator/viewer.d.ts +0 -0
  113. package/dist/types/services/screenshot-server.d.ts +0 -10
  114. package/dist/types/services/server-manager.d.ts +0 -269
  115. package/dist/types/services/static-report-generator.d.ts +0 -25
  116. package/dist/types/services/tdd-service.d.ts +0 -95
  117. package/dist/types/services/test-runner.d.ts +0 -31
  118. package/dist/types/services/uploader.d.ts +0 -36
  119. package/dist/types/utils/browser.d.ts +0 -6
  120. package/dist/types/utils/build-history.d.ts +0 -16
  121. package/dist/types/utils/ci-env.d.ts +0 -55
  122. package/dist/types/utils/colors.d.ts +0 -12
  123. package/dist/types/utils/config-helpers.d.ts +0 -6
  124. package/dist/types/utils/config-loader.d.ts +0 -25
  125. package/dist/types/utils/config-schema.d.ts +0 -51
  126. package/dist/types/utils/environment-config.d.ts +0 -59
  127. package/dist/types/utils/environment.d.ts +0 -36
  128. package/dist/types/utils/fetch-utils.d.ts +0 -1
  129. package/dist/types/utils/file-helpers.d.ts +0 -18
  130. package/dist/types/utils/git.d.ts +0 -56
  131. package/dist/types/utils/global-config.d.ts +0 -84
  132. package/dist/types/utils/image-input-detector.d.ts +0 -71
  133. package/dist/types/utils/output.d.ts +0 -84
  134. package/dist/types/utils/package-info.d.ts +0 -15
  135. package/dist/types/utils/security.d.ts +0 -30
@@ -1,71 +0,0 @@
1
- /**
2
- * @module image-input-detector
3
- * @description Utilities for detecting whether a string is a base64 image or a file path
4
- */
5
- /**
6
- * Check if a string is valid base64 encoded data
7
- *
8
- * Base64 strings consist only of:
9
- * - A-Z, a-z, 0-9, +, /
10
- * - Optional padding with = at the end
11
- * - Must be in groups of 4 characters (with optional 2-3 char group at end with padding)
12
- *
13
- * @param {string} str - String to check
14
- * @returns {boolean} True if the string appears to be valid base64
15
- *
16
- * @example
17
- * isBase64('ZmFrZS1wbmctZGF0YQ==') // true
18
- * isBase64('./screenshot.png') // false
19
- * isBase64('/absolute/path.png') // false
20
- */
21
- export function isBase64(str: string): boolean;
22
- /**
23
- * Check if a string looks like a file path
24
- *
25
- * Detects common file path patterns across platforms:
26
- * - Relative paths: ./file.png, ../file.png, subdirectory/file.png
27
- * - Absolute Unix paths: /absolute/path/file.png
28
- * - Absolute Windows paths: C:\path\file.png, C:/path/file.png
29
- * - File URIs: file:///path/to/file.png
30
- * - Paths with common image extensions
31
- *
32
- * Note: This is heuristic-based and doesn't check file existence
33
- *
34
- * @param {string} str - String to check
35
- * @returns {boolean} True if the string looks like a file path
36
- *
37
- * @example
38
- * looksLikeFilePath('./screenshot.png') // true
39
- * looksLikeFilePath('/abs/path/file.png') // true
40
- * looksLikeFilePath('C:\\Windows\\file.png') // true
41
- * looksLikeFilePath('ZmFrZS1wbmctZGF0YQ==') // false
42
- */
43
- export function looksLikeFilePath(str: string): boolean;
44
- /**
45
- * Detect the type of image input
46
- *
47
- * Determines whether a string input is:
48
- * - 'base64': Base64 encoded image data
49
- * - 'file-path': A file path (relative or absolute)
50
- * - 'unknown': Cannot determine (ambiguous or invalid)
51
- *
52
- * Strategy:
53
- * 1. First check if it's valid base64 (can contain / which might look like paths)
54
- * 2. Then check if it looks like a file path (more specific patterns)
55
- * 3. Otherwise return 'unknown'
56
- *
57
- * This order prevents base64 strings (which can contain /) from being
58
- * misidentified as file paths. Base64 validation is stricter and should
59
- * be checked first.
60
- *
61
- * @param {string} str - String to detect
62
- * @returns {'base64' | 'file-path' | 'unknown'} Detected input type
63
- *
64
- * @example
65
- * detectImageInputType('./screenshot.png') // 'file-path'
66
- * detectImageInputType('ZmFrZS1wbmctZGF0YQ==') // 'base64'
67
- * detectImageInputType('data:image/png;base64,iVBOR...') // 'base64'
68
- * detectImageInputType('C:\\path\\image.png') // 'file-path'
69
- * detectImageInputType('invalid!!!') // 'unknown'
70
- */
71
- export function detectImageInputType(str: string): "base64" | "file-path" | "unknown";
@@ -1,84 +0,0 @@
1
- /**
2
- * Configure output settings
3
- * Call this once at CLI startup with global options
4
- */
5
- export function configure(options?: {}): void;
6
- /**
7
- * Show command header (e.g., "vizzly · tdd · local")
8
- * Only shows once per command execution
9
- */
10
- export function header(command: any, mode?: any): void;
11
- /**
12
- * Get current colors instance (for custom formatting)
13
- */
14
- export function getColors(): {
15
- success: any;
16
- error: any;
17
- warning: any;
18
- info: any;
19
- };
20
- /**
21
- * Show a success message
22
- */
23
- export function success(message: any, data?: {}): void;
24
- /**
25
- * Show final result summary (e.g., "✓ 5 screenshots · 234ms")
26
- */
27
- export function result(message: any): void;
28
- /**
29
- * Show an info message
30
- */
31
- export function info(message: any, data?: {}): void;
32
- /**
33
- * Show a warning message (goes to stderr)
34
- */
35
- export function warn(message: any, data?: {}): void;
36
- /**
37
- * Show an error message (goes to stderr)
38
- * Does NOT exit - caller decides whether to exit
39
- */
40
- export function error(message: any, err?: any, data?: {}): void;
41
- /**
42
- * Print a blank line for spacing
43
- */
44
- export function blank(): void;
45
- /**
46
- * Print raw text without any formatting
47
- */
48
- export function print(text: any): void;
49
- /**
50
- * Print raw text to stderr
51
- */
52
- export function printErr(text: any): void;
53
- /**
54
- * Output structured data
55
- */
56
- export function data(obj: any): void;
57
- /**
58
- * Start a spinner with message
59
- */
60
- export function startSpinner(message: any): void;
61
- /**
62
- * Update spinner message
63
- */
64
- export function updateSpinner(message: any, current?: number, total?: number): void;
65
- /**
66
- * Stop the spinner
67
- */
68
- export function stopSpinner(): void;
69
- /**
70
- * Show progress update
71
- */
72
- export function progress(message: any, current?: number, total?: number): void;
73
- /**
74
- * Log debug message with component prefix (only shown in verbose mode)
75
- *
76
- * @param {string} component - Component name (e.g., 'server', 'config', 'build')
77
- * @param {string} message - Debug message
78
- * @param {Object} data - Optional data object to display inline
79
- */
80
- export function debug(component: string, message: string, data?: any): void;
81
- /**
82
- * Clean up (stop spinner, flush logs)
83
- */
84
- export function cleanup(): void;
@@ -1,15 +0,0 @@
1
- /**
2
- * Get package.json information
3
- * @returns {Object} Package.json data
4
- */
5
- export function getPackageInfo(): any;
6
- /**
7
- * Get package version
8
- * @returns {string} Package version
9
- */
10
- export function getPackageVersion(): string;
11
- /**
12
- * Get package name
13
- * @returns {string} Package name
14
- */
15
- export function getPackageName(): string;
@@ -1,30 +0,0 @@
1
- /**
2
- * Sanitizes a screenshot name to prevent path traversal and ensure safe file naming
3
- * @param {string} name - Original screenshot name
4
- * @param {number} maxLength - Maximum allowed length (default: 255)
5
- * @param {boolean} allowSlashes - Whether to allow forward slashes (for browser version strings)
6
- * @returns {string} Sanitized screenshot name
7
- */
8
- export function sanitizeScreenshotName(name: string, maxLength?: number, allowSlashes?: boolean): string;
9
- /**
10
- * Validates that a path stays within the allowed working directory bounds
11
- * @param {string} targetPath - Path to validate
12
- * @param {string} workingDir - Working directory that serves as the security boundary
13
- * @returns {string} Resolved and normalized path if valid
14
- * @throws {Error} If path is invalid or outside bounds
15
- */
16
- export function validatePathSecurity(targetPath: string, workingDir: string): string;
17
- /**
18
- * Safely constructs a path within the working directory
19
- * @param {string} workingDir - Base working directory
20
- * @param {...string} pathSegments - Path segments to join
21
- * @returns {string} Safely constructed path
22
- * @throws {Error} If resulting path would be outside working directory
23
- */
24
- export function safePath(workingDir: string, ...pathSegments: string[]): string;
25
- /**
26
- * Validates screenshot properties object for safe values
27
- * @param {Object} properties - Properties to validate
28
- * @returns {Object} Validated properties object
29
- */
30
- export function validateScreenshotProperties(properties?: any): any;