@vizzly-testing/cli 0.14.0 → 0.15.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.
- package/dist/cli.js +68 -68
- package/dist/commands/doctor.js +30 -34
- package/dist/commands/finalize.js +24 -23
- package/dist/commands/init.js +30 -28
- package/dist/commands/login.js +49 -55
- package/dist/commands/logout.js +14 -19
- package/dist/commands/project.js +83 -103
- package/dist/commands/run.js +77 -89
- package/dist/commands/status.js +48 -49
- package/dist/commands/tdd-daemon.js +90 -86
- package/dist/commands/tdd.js +59 -88
- package/dist/commands/upload.js +57 -57
- package/dist/commands/whoami.js +40 -45
- package/dist/index.js +2 -5
- package/dist/plugin-loader.js +15 -17
- package/dist/reporter/reporter-bundle.css +1 -1
- package/dist/reporter/reporter-bundle.iife.js +74 -41
- package/dist/sdk/index.js +36 -45
- package/dist/server/handlers/api-handler.js +14 -15
- package/dist/server/handlers/tdd-handler.js +34 -37
- package/dist/server/http-server.js +75 -869
- package/dist/server/middleware/cors.js +22 -0
- package/dist/server/middleware/json-parser.js +35 -0
- package/dist/server/middleware/response.js +79 -0
- package/dist/server/routers/assets.js +91 -0
- package/dist/server/routers/auth.js +144 -0
- package/dist/server/routers/baseline.js +163 -0
- package/dist/server/routers/cloud-proxy.js +146 -0
- package/dist/server/routers/config.js +126 -0
- package/dist/server/routers/dashboard.js +130 -0
- package/dist/server/routers/health.js +61 -0
- package/dist/server/routers/projects.js +168 -0
- package/dist/server/routers/screenshot.js +86 -0
- package/dist/services/auth-service.js +1 -1
- package/dist/services/build-manager.js +13 -40
- package/dist/services/config-service.js +2 -4
- package/dist/services/html-report-generator.js +6 -5
- package/dist/services/index.js +64 -0
- package/dist/services/project-service.js +121 -40
- package/dist/services/screenshot-server.js +9 -9
- package/dist/services/server-manager.js +11 -18
- package/dist/services/static-report-generator.js +3 -4
- package/dist/services/tdd-service.js +246 -103
- package/dist/services/test-runner.js +24 -25
- package/dist/services/uploader.js +5 -4
- package/dist/types/commands/init.d.ts +1 -2
- package/dist/types/index.d.ts +2 -3
- package/dist/types/plugin-loader.d.ts +1 -2
- package/dist/types/reporter/src/api/client.d.ts +178 -0
- package/dist/types/reporter/src/components/app-router.d.ts +1 -3
- package/dist/types/reporter/src/components/code-block.d.ts +4 -0
- package/dist/types/reporter/src/components/comparison/comparison-modes/onion-skin-mode.d.ts +10 -0
- package/dist/types/reporter/src/components/comparison/comparison-modes/overlay-mode.d.ts +11 -0
- package/dist/types/reporter/src/components/comparison/comparison-modes/shared/base-comparison-mode.d.ts +14 -0
- package/dist/types/reporter/src/components/comparison/comparison-modes/shared/image-renderer.d.ts +30 -0
- package/dist/types/reporter/src/components/comparison/comparison-modes/toggle-view.d.ts +8 -0
- package/dist/types/reporter/src/components/comparison/comparison-viewer.d.ts +4 -0
- package/dist/types/reporter/src/components/comparison/screenshot-display.d.ts +16 -0
- package/dist/types/reporter/src/components/design-system/alert.d.ts +9 -0
- package/dist/types/reporter/src/components/design-system/badge.d.ts +17 -0
- package/dist/types/reporter/src/components/design-system/button.d.ts +19 -0
- package/dist/types/reporter/src/components/design-system/card.d.ts +31 -0
- package/dist/types/reporter/src/components/design-system/empty-state.d.ts +13 -0
- package/dist/types/reporter/src/components/design-system/form-controls.d.ts +44 -0
- package/dist/types/reporter/src/components/design-system/health-ring.d.ts +7 -0
- package/dist/types/reporter/src/components/design-system/index.d.ts +11 -0
- package/dist/types/reporter/src/components/design-system/modal.d.ts +10 -0
- package/dist/types/reporter/src/components/design-system/skeleton.d.ts +19 -0
- package/dist/types/reporter/src/components/design-system/spinner.d.ts +10 -0
- package/dist/types/reporter/src/components/design-system/tabs.d.ts +13 -0
- package/dist/types/reporter/src/components/layout/header.d.ts +5 -0
- package/dist/types/reporter/src/components/layout/index.d.ts +2 -0
- package/dist/types/reporter/src/components/layout/layout.d.ts +6 -0
- package/dist/types/reporter/src/components/views/builds-view.d.ts +1 -0
- package/dist/types/reporter/src/components/views/comparison-detail-view.d.ts +1 -4
- package/dist/types/reporter/src/components/views/comparisons-view.d.ts +1 -6
- package/dist/types/reporter/src/components/views/stats-view.d.ts +1 -6
- package/dist/types/reporter/src/components/waiting-for-screenshots.d.ts +1 -0
- package/dist/types/reporter/src/hooks/queries/use-auth-queries.d.ts +15 -0
- package/dist/types/reporter/src/hooks/queries/use-cloud-queries.d.ts +6 -0
- package/dist/types/reporter/src/hooks/queries/use-config-queries.d.ts +6 -0
- package/dist/types/reporter/src/hooks/queries/use-tdd-queries.d.ts +9 -0
- package/dist/types/reporter/src/lib/query-client.d.ts +2 -0
- package/dist/types/reporter/src/lib/query-keys.d.ts +13 -0
- package/dist/types/sdk/index.d.ts +2 -4
- package/dist/types/server/handlers/tdd-handler.d.ts +2 -0
- package/dist/types/server/http-server.d.ts +1 -1
- package/dist/types/server/middleware/cors.d.ts +11 -0
- package/dist/types/server/middleware/json-parser.d.ts +10 -0
- package/dist/types/server/middleware/response.d.ts +50 -0
- package/dist/types/server/routers/assets.d.ts +6 -0
- package/dist/types/server/routers/auth.d.ts +9 -0
- package/dist/types/server/routers/baseline.d.ts +13 -0
- package/dist/types/server/routers/cloud-proxy.d.ts +11 -0
- package/dist/types/server/routers/config.d.ts +9 -0
- package/dist/types/server/routers/dashboard.d.ts +6 -0
- package/dist/types/server/routers/health.d.ts +11 -0
- package/dist/types/server/routers/projects.d.ts +9 -0
- package/dist/types/server/routers/screenshot.d.ts +11 -0
- package/dist/types/services/build-manager.d.ts +4 -3
- package/dist/types/services/config-service.d.ts +2 -3
- package/dist/types/services/index.d.ts +7 -0
- package/dist/types/services/project-service.d.ts +6 -4
- package/dist/types/services/screenshot-server.d.ts +5 -5
- package/dist/types/services/server-manager.d.ts +5 -3
- package/dist/types/services/tdd-service.d.ts +12 -1
- package/dist/types/services/test-runner.d.ts +3 -3
- package/dist/types/utils/output.d.ts +84 -0
- package/dist/utils/config-loader.js +24 -48
- package/dist/utils/global-config.js +2 -17
- package/dist/utils/output.js +445 -0
- package/dist/utils/security.js +3 -4
- package/docs/api-reference.md +0 -1
- package/docs/plugins.md +22 -22
- package/package.json +3 -2
- package/dist/container/index.js +0 -215
- package/dist/services/base-service.js +0 -154
- package/dist/types/container/index.d.ts +0 -59
- package/dist/types/reporter/src/components/comparison/viewer-modes/onion-viewer.d.ts +0 -3
- package/dist/types/reporter/src/components/comparison/viewer-modes/overlay-viewer.d.ts +0 -3
- package/dist/types/reporter/src/components/comparison/viewer-modes/side-by-side-viewer.d.ts +0 -3
- package/dist/types/reporter/src/components/comparison/viewer-modes/toggle-viewer.d.ts +0 -3
- package/dist/types/reporter/src/components/dashboard/dashboard-header.d.ts +0 -5
- package/dist/types/reporter/src/components/dashboard/dashboard-stats.d.ts +0 -4
- package/dist/types/reporter/src/components/dashboard/empty-state.d.ts +0 -8
- package/dist/types/reporter/src/components/ui/form-field.d.ts +0 -16
- package/dist/types/reporter/src/components/ui/status-badge.d.ts +0 -5
- package/dist/types/reporter/src/hooks/use-auth.d.ts +0 -10
- package/dist/types/reporter/src/hooks/use-baseline-actions.d.ts +0 -5
- package/dist/types/reporter/src/hooks/use-config.d.ts +0 -9
- package/dist/types/reporter/src/hooks/use-projects.d.ts +0 -10
- package/dist/types/reporter/src/hooks/use-report-data.d.ts +0 -7
- package/dist/types/reporter/src/hooks/use-vizzly-api.d.ts +0 -9
- package/dist/types/services/base-service.d.ts +0 -71
- package/dist/types/utils/console-ui.d.ts +0 -61
- package/dist/types/utils/logger-factory.d.ts +0 -26
- package/dist/types/utils/logger.d.ts +0 -79
- package/dist/utils/console-ui.js +0 -241
- package/dist/utils/logger-factory.js +0 -76
- package/dist/utils/logger.js +0 -231
|
@@ -3,12 +3,14 @@
|
|
|
3
3
|
* Orchestrates the test execution flow
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { EventEmitter } from 'events';
|
|
7
7
|
import { VizzlyError } from '../errors/vizzly-error.js';
|
|
8
8
|
import { spawn } from 'child_process';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
import * as output from '../utils/output.js';
|
|
10
|
+
export class TestRunner extends EventEmitter {
|
|
11
|
+
constructor(config, buildManager, serverManager, tddService) {
|
|
12
|
+
super();
|
|
13
|
+
this.config = config;
|
|
12
14
|
this.buildManager = buildManager;
|
|
13
15
|
this.serverManager = serverManager;
|
|
14
16
|
this.tddService = tddService;
|
|
@@ -36,7 +38,7 @@ export class TestRunner extends BaseService {
|
|
|
36
38
|
tdd: true
|
|
37
39
|
});
|
|
38
40
|
} catch (error) {
|
|
39
|
-
|
|
41
|
+
output.error('Failed to initialize TDD daemon server:', error);
|
|
40
42
|
throw error;
|
|
41
43
|
}
|
|
42
44
|
}
|
|
@@ -80,10 +82,12 @@ export class TestRunner extends BaseService {
|
|
|
80
82
|
const build = await apiService.getBuild(buildId);
|
|
81
83
|
buildUrl = build.url;
|
|
82
84
|
if (buildUrl) {
|
|
83
|
-
|
|
85
|
+
output.info(`Build URL: ${buildUrl}`);
|
|
84
86
|
}
|
|
85
87
|
} catch (error) {
|
|
86
|
-
|
|
88
|
+
output.debug('build', 'could not retrieve url', {
|
|
89
|
+
error: error.message
|
|
90
|
+
});
|
|
87
91
|
}
|
|
88
92
|
}
|
|
89
93
|
}
|
|
@@ -123,7 +127,7 @@ export class TestRunner extends BaseService {
|
|
|
123
127
|
try {
|
|
124
128
|
await this.finalizeBuild(buildId, tdd, testSuccess, executionTime);
|
|
125
129
|
} catch (finalizeError) {
|
|
126
|
-
|
|
130
|
+
output.error('Failed to finalize build:', finalizeError);
|
|
127
131
|
}
|
|
128
132
|
}
|
|
129
133
|
|
|
@@ -134,13 +138,13 @@ export class TestRunner extends BaseService {
|
|
|
134
138
|
try {
|
|
135
139
|
await this.serverManager.stop();
|
|
136
140
|
} catch (stopError) {
|
|
137
|
-
|
|
141
|
+
output.error('Failed to stop server:', stopError);
|
|
138
142
|
}
|
|
139
143
|
}
|
|
140
144
|
|
|
141
145
|
// If there was a test error, throw it now (after cleanup)
|
|
142
146
|
if (testError) {
|
|
143
|
-
|
|
147
|
+
output.error('Test run failed:', testError);
|
|
144
148
|
throw testError;
|
|
145
149
|
}
|
|
146
150
|
return {
|
|
@@ -154,13 +158,11 @@ export class TestRunner extends BaseService {
|
|
|
154
158
|
async createBuild(options, tdd) {
|
|
155
159
|
if (tdd) {
|
|
156
160
|
// TDD mode: create local build
|
|
157
|
-
this.logger.debug('TDD mode: creating local build...');
|
|
158
161
|
const build = await this.buildManager.createBuild(options);
|
|
159
|
-
|
|
162
|
+
output.debug('build', `created ${build.id.substring(0, 8)}`);
|
|
160
163
|
return build.id;
|
|
161
164
|
} else {
|
|
162
165
|
// API mode: create build via API
|
|
163
|
-
this.logger.debug('Creating build via API...');
|
|
164
166
|
const apiService = await this.createApiService();
|
|
165
167
|
if (apiService) {
|
|
166
168
|
const buildResult = await apiService.createBuild({
|
|
@@ -172,7 +174,7 @@ export class TestRunner extends BaseService {
|
|
|
172
174
|
github_pull_request_number: options.pullRequestNumber,
|
|
173
175
|
parallel_id: options.parallelId
|
|
174
176
|
});
|
|
175
|
-
|
|
177
|
+
output.debug('build', `created ${buildResult.id}`);
|
|
176
178
|
|
|
177
179
|
// Emit build created event
|
|
178
180
|
this.emit('build-created', {
|
|
@@ -199,7 +201,6 @@ export class TestRunner extends BaseService {
|
|
|
199
201
|
}
|
|
200
202
|
async finalizeBuild(buildId, isTddMode, success, executionTime) {
|
|
201
203
|
if (!buildId) {
|
|
202
|
-
this.logger.debug('No buildId to finalize');
|
|
203
204
|
return;
|
|
204
205
|
}
|
|
205
206
|
try {
|
|
@@ -207,32 +208,30 @@ export class TestRunner extends BaseService {
|
|
|
207
208
|
// TDD mode: use server handler to finalize (local-only)
|
|
208
209
|
if (this.serverManager.server?.finishBuild) {
|
|
209
210
|
await this.serverManager.server.finishBuild(buildId);
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
this.logger.debug(`TDD build ${buildId} finalization skipped (local-only mode)`);
|
|
211
|
+
output.debug('build', `finalized`, {
|
|
212
|
+
success
|
|
213
|
+
});
|
|
214
214
|
}
|
|
215
215
|
} else {
|
|
216
216
|
// API mode: flush uploads first, then finalize build
|
|
217
217
|
if (this.serverManager.server?.finishBuild) {
|
|
218
|
-
this.logger.debug(`Flushing uploads for build ${buildId}...`);
|
|
219
218
|
await this.serverManager.server.finishBuild(buildId);
|
|
220
|
-
this.logger.debug(`Upload flush complete for build ${buildId}`);
|
|
221
219
|
}
|
|
222
220
|
|
|
223
221
|
// Then update build status via API
|
|
224
|
-
this.logger.debug(`Finalizing build ${buildId} via API...`);
|
|
225
222
|
const apiService = await this.createApiService();
|
|
226
223
|
if (apiService) {
|
|
227
224
|
await apiService.finalizeBuild(buildId, success, executionTime);
|
|
228
|
-
|
|
225
|
+
output.debug('build', 'finalized via api', {
|
|
226
|
+
success
|
|
227
|
+
});
|
|
229
228
|
} else {
|
|
230
|
-
|
|
229
|
+
output.warn(`No API service available to finalize build ${buildId}`);
|
|
231
230
|
}
|
|
232
231
|
}
|
|
233
232
|
} catch (error) {
|
|
234
233
|
// Don't fail the entire run if build finalization fails
|
|
235
|
-
|
|
234
|
+
output.warn(`Failed to finalize build ${buildId}:`, error.message);
|
|
236
235
|
// Emit event for UI handling
|
|
237
236
|
this.emit('build-finalize-failed', {
|
|
238
237
|
buildId,
|
|
@@ -7,7 +7,7 @@ import { glob } from 'glob';
|
|
|
7
7
|
import { readFile, stat } from 'fs/promises';
|
|
8
8
|
import { basename } from 'path';
|
|
9
9
|
import crypto from 'crypto';
|
|
10
|
-
import
|
|
10
|
+
import * as output from '../utils/output.js';
|
|
11
11
|
import { ApiService } from './api-service.js';
|
|
12
12
|
import { getDefaultBranch } from '../utils/git.js';
|
|
13
13
|
import { UploadError, TimeoutError, ValidationError } from '../errors/vizzly-error.js';
|
|
@@ -25,8 +25,7 @@ export function createUploader({
|
|
|
25
25
|
command,
|
|
26
26
|
upload: uploadConfig = {}
|
|
27
27
|
}, options = {}) {
|
|
28
|
-
|
|
29
|
-
const signal = options.signal || new AbortController().signal;
|
|
28
|
+
let signal = options.signal || new AbortController().signal;
|
|
30
29
|
const api = new ApiService({
|
|
31
30
|
baseUrl: apiUrl,
|
|
32
31
|
token: apiKey,
|
|
@@ -156,7 +155,9 @@ export function createUploader({
|
|
|
156
155
|
}
|
|
157
156
|
};
|
|
158
157
|
} catch (error) {
|
|
159
|
-
|
|
158
|
+
output.debug('upload', 'failed', {
|
|
159
|
+
error: error.message
|
|
160
|
+
});
|
|
160
161
|
|
|
161
162
|
// Re-throw if already a VizzlyError
|
|
162
163
|
if (error.name && error.name.includes('Error') && error.code) {
|
|
@@ -5,8 +5,7 @@ export function init(options?: {}): Promise<void>;
|
|
|
5
5
|
* Simple configuration setup for Vizzly CLI
|
|
6
6
|
*/
|
|
7
7
|
export class InitCommand {
|
|
8
|
-
constructor(
|
|
9
|
-
logger: any;
|
|
8
|
+
constructor(plugins?: any[]);
|
|
10
9
|
plugins: any[];
|
|
11
10
|
run(options?: {}): Promise<void>;
|
|
12
11
|
generateConfigFile(configPath: any): Promise<void>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
export { createVizzly } from "./sdk/index.js";
|
|
2
2
|
export { createUploader } from "./services/uploader.js";
|
|
3
3
|
export { createTDDService } from "./services/tdd-service.js";
|
|
4
|
-
export {
|
|
4
|
+
export { createServices } from "./services/index.js";
|
|
5
5
|
export { loadConfig } from "./utils/config-loader.js";
|
|
6
|
-
export
|
|
6
|
+
export * as output from "./utils/output.js";
|
|
7
7
|
export { defineConfig } from "./utils/config-helpers.js";
|
|
8
8
|
export { UploadError } from "./errors/vizzly-error.js";
|
|
9
9
|
export { vizzlyScreenshot, configure, setEnabled } from "./client/index.js";
|
|
10
|
-
export { ServiceContainer, container } from "./container/index.js";
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* Load and register plugins from node_modules and config
|
|
3
3
|
* @param {string|null} configPath - Path to config file
|
|
4
4
|
* @param {Object} config - Loaded configuration
|
|
5
|
-
* @param {Object} logger - Logger instance
|
|
6
5
|
* @returns {Promise<Array>} Array of loaded plugins
|
|
7
6
|
*/
|
|
8
|
-
export function loadPlugins(configPath: string | null, config: any
|
|
7
|
+
export function loadPlugins(configPath: string | null, config: any): Promise<any[]>;
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
export namespace tdd {
|
|
2
|
+
/**
|
|
3
|
+
* Get current report data with comparisons
|
|
4
|
+
* @returns {Promise<Object|null>}
|
|
5
|
+
*/
|
|
6
|
+
function getReportData(): Promise<any | null>;
|
|
7
|
+
/**
|
|
8
|
+
* Get real-time status
|
|
9
|
+
* @returns {Promise<Object>}
|
|
10
|
+
*/
|
|
11
|
+
function getStatus(): Promise<any>;
|
|
12
|
+
/**
|
|
13
|
+
* Accept a single baseline
|
|
14
|
+
* @param {string} id - Comparison ID
|
|
15
|
+
* @returns {Promise<Object>}
|
|
16
|
+
*/
|
|
17
|
+
function acceptBaseline(id: string): Promise<any>;
|
|
18
|
+
/**
|
|
19
|
+
* Accept all baselines
|
|
20
|
+
* @returns {Promise<Object>}
|
|
21
|
+
*/
|
|
22
|
+
function acceptAllBaselines(): Promise<any>;
|
|
23
|
+
/**
|
|
24
|
+
* Reset baselines to previous state
|
|
25
|
+
* @returns {Promise<Object>}
|
|
26
|
+
*/
|
|
27
|
+
function resetBaselines(): Promise<any>;
|
|
28
|
+
/**
|
|
29
|
+
* Download baselines from a remote build
|
|
30
|
+
* @param {string} buildId - Build ID to download from
|
|
31
|
+
* @param {string} [organizationSlug] - Organization slug for OAuth auth
|
|
32
|
+
* @param {string} [projectSlug] - Project slug for OAuth auth
|
|
33
|
+
* @returns {Promise<Object>}
|
|
34
|
+
*/
|
|
35
|
+
function downloadBaselines(buildId: string, organizationSlug?: string, projectSlug?: string): Promise<any>;
|
|
36
|
+
}
|
|
37
|
+
export namespace cloud {
|
|
38
|
+
/**
|
|
39
|
+
* List all user's projects
|
|
40
|
+
* @returns {Promise<Object>}
|
|
41
|
+
*/
|
|
42
|
+
function listProjects(): Promise<any>;
|
|
43
|
+
/**
|
|
44
|
+
* Get builds for a specific project
|
|
45
|
+
* @param {string} organizationSlug
|
|
46
|
+
* @param {string} projectSlug
|
|
47
|
+
* @param {Object} options
|
|
48
|
+
* @param {number} [options.limit=20]
|
|
49
|
+
* @param {string} [options.branch]
|
|
50
|
+
* @returns {Promise<Object>}
|
|
51
|
+
*/
|
|
52
|
+
function getBuilds(organizationSlug: string, projectSlug: string, options?: {
|
|
53
|
+
limit?: number;
|
|
54
|
+
branch?: string;
|
|
55
|
+
}): Promise<any>;
|
|
56
|
+
/**
|
|
57
|
+
* Download baselines from cloud build
|
|
58
|
+
* @param {string} buildId
|
|
59
|
+
* @param {string[]} [screenshotNames] - Optional specific screenshots
|
|
60
|
+
* @returns {Promise<Object>}
|
|
61
|
+
*/
|
|
62
|
+
function downloadBaselines(buildId: string, screenshotNames?: string[]): Promise<any>;
|
|
63
|
+
}
|
|
64
|
+
export namespace config {
|
|
65
|
+
/**
|
|
66
|
+
* Get merged configuration
|
|
67
|
+
* @returns {Promise<Object>}
|
|
68
|
+
*/
|
|
69
|
+
function get(): Promise<any>;
|
|
70
|
+
/**
|
|
71
|
+
* Get project-level configuration
|
|
72
|
+
* @returns {Promise<Object>}
|
|
73
|
+
*/
|
|
74
|
+
function getProject(): Promise<any>;
|
|
75
|
+
/**
|
|
76
|
+
* Get global configuration
|
|
77
|
+
* @returns {Promise<Object>}
|
|
78
|
+
*/
|
|
79
|
+
function getGlobal(): Promise<any>;
|
|
80
|
+
/**
|
|
81
|
+
* Update project configuration
|
|
82
|
+
* @param {Object} data - Config data to update
|
|
83
|
+
* @returns {Promise<Object>}
|
|
84
|
+
*/
|
|
85
|
+
function updateProject(data: any): Promise<any>;
|
|
86
|
+
/**
|
|
87
|
+
* Update global configuration
|
|
88
|
+
* @param {Object} data - Config data to update
|
|
89
|
+
* @returns {Promise<Object>}
|
|
90
|
+
*/
|
|
91
|
+
function updateGlobal(data: any): Promise<any>;
|
|
92
|
+
/**
|
|
93
|
+
* Validate configuration
|
|
94
|
+
* @param {Object} data - Config to validate
|
|
95
|
+
* @returns {Promise<Object>}
|
|
96
|
+
*/
|
|
97
|
+
function validate(data: any): Promise<any>;
|
|
98
|
+
}
|
|
99
|
+
export namespace auth {
|
|
100
|
+
/**
|
|
101
|
+
* Get authentication status
|
|
102
|
+
* @returns {Promise<{authenticated: boolean, user: Object|null}>}
|
|
103
|
+
*/
|
|
104
|
+
function getStatus(): Promise<{
|
|
105
|
+
authenticated: boolean;
|
|
106
|
+
user: any | null;
|
|
107
|
+
}>;
|
|
108
|
+
/**
|
|
109
|
+
* Initiate device flow login
|
|
110
|
+
* @returns {Promise<{deviceCode: string, userCode: string, verificationUri: string, expiresIn: number}>}
|
|
111
|
+
*/
|
|
112
|
+
function initiateLogin(): Promise<{
|
|
113
|
+
deviceCode: string;
|
|
114
|
+
userCode: string;
|
|
115
|
+
verificationUri: string;
|
|
116
|
+
expiresIn: number;
|
|
117
|
+
}>;
|
|
118
|
+
/**
|
|
119
|
+
* Poll device authorization status
|
|
120
|
+
* @param {string} deviceCode
|
|
121
|
+
* @returns {Promise<{status: 'pending'|'complete', user?: Object}>}
|
|
122
|
+
*/
|
|
123
|
+
function pollAuthorization(deviceCode: string): Promise<{
|
|
124
|
+
status: "pending" | "complete";
|
|
125
|
+
user?: any;
|
|
126
|
+
}>;
|
|
127
|
+
/**
|
|
128
|
+
* Logout user
|
|
129
|
+
* @returns {Promise<Object>}
|
|
130
|
+
*/
|
|
131
|
+
function logout(): Promise<any>;
|
|
132
|
+
}
|
|
133
|
+
export namespace projects {
|
|
134
|
+
/**
|
|
135
|
+
* List projects from API
|
|
136
|
+
* @returns {Promise<Object>}
|
|
137
|
+
*/
|
|
138
|
+
function list(): Promise<any>;
|
|
139
|
+
/**
|
|
140
|
+
* List project directory mappings
|
|
141
|
+
* @returns {Promise<Object>}
|
|
142
|
+
*/
|
|
143
|
+
function listMappings(): Promise<any>;
|
|
144
|
+
/**
|
|
145
|
+
* Create or update project mapping
|
|
146
|
+
* @param {Object} data
|
|
147
|
+
* @returns {Promise<Object>}
|
|
148
|
+
*/
|
|
149
|
+
function createMapping(data: any): Promise<any>;
|
|
150
|
+
/**
|
|
151
|
+
* Delete project mapping
|
|
152
|
+
* @param {string} directory
|
|
153
|
+
* @returns {Promise<Object>}
|
|
154
|
+
*/
|
|
155
|
+
function deleteMapping(directory: string): Promise<any>;
|
|
156
|
+
/**
|
|
157
|
+
* Get recent builds for current project
|
|
158
|
+
* @param {Object} options
|
|
159
|
+
* @returns {Promise<Object>}
|
|
160
|
+
*/
|
|
161
|
+
function getRecentBuilds(options?: any): Promise<any>;
|
|
162
|
+
/**
|
|
163
|
+
* Get builds for a specific project
|
|
164
|
+
* @param {string} organizationSlug
|
|
165
|
+
* @param {string} projectSlug
|
|
166
|
+
* @param {Object} options
|
|
167
|
+
* @returns {Promise<Object>}
|
|
168
|
+
*/
|
|
169
|
+
function getBuilds(organizationSlug: string, projectSlug: string, options?: any): Promise<any>;
|
|
170
|
+
}
|
|
171
|
+
export namespace api {
|
|
172
|
+
export { tdd };
|
|
173
|
+
export { cloud };
|
|
174
|
+
export { config };
|
|
175
|
+
export { auth };
|
|
176
|
+
export { projects };
|
|
177
|
+
}
|
|
178
|
+
export default api;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export function OnionSkinMode({ baselineImageUrl, currentImageUrl, sliderPosition, onSliderChange, screenshot, onImageError, onImageLoad, imageErrors, }: {
|
|
2
|
+
baselineImageUrl: any;
|
|
3
|
+
currentImageUrl: any;
|
|
4
|
+
sliderPosition?: number;
|
|
5
|
+
onSliderChange: any;
|
|
6
|
+
screenshot: any;
|
|
7
|
+
onImageError: any;
|
|
8
|
+
onImageLoad: any;
|
|
9
|
+
imageErrors?: Set<any>;
|
|
10
|
+
}): any;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function OverlayMode({ baselineImageUrl, currentImageUrl, diffImageUrl, showDiffOverlay, screenshot, onImageError, onImageLoad, imageErrors, onDiffToggle, }: {
|
|
2
|
+
baselineImageUrl: any;
|
|
3
|
+
currentImageUrl: any;
|
|
4
|
+
diffImageUrl: any;
|
|
5
|
+
showDiffOverlay?: boolean;
|
|
6
|
+
screenshot: any;
|
|
7
|
+
onImageError: any;
|
|
8
|
+
onImageLoad: any;
|
|
9
|
+
imageErrors: any;
|
|
10
|
+
onDiffToggle: any;
|
|
11
|
+
}): any;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export function BaseComparisonMode({ children, containerClassName, onClick, style, ...props }: {
|
|
2
|
+
[x: string]: any;
|
|
3
|
+
children: any;
|
|
4
|
+
containerClassName?: string;
|
|
5
|
+
onClick: any;
|
|
6
|
+
style?: {};
|
|
7
|
+
}): any;
|
|
8
|
+
export function ComparisonContainer({ children, containerClassName, interactive, onClick, style, }: {
|
|
9
|
+
children: any;
|
|
10
|
+
containerClassName?: string;
|
|
11
|
+
interactive?: boolean;
|
|
12
|
+
onClick: any;
|
|
13
|
+
style?: {};
|
|
14
|
+
}): any;
|
package/dist/types/reporter/src/components/comparison/comparison-modes/shared/image-renderer.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simple, reliable image renderer for screenshot comparisons
|
|
3
|
+
* Zoom is handled at the container level, not here
|
|
4
|
+
*/
|
|
5
|
+
export function ImageRenderer({ imageKey, url, alt, position, className, onError, onLoad, imageErrors, style, loading, ...props }: {
|
|
6
|
+
[x: string]: any;
|
|
7
|
+
imageKey: any;
|
|
8
|
+
url: any;
|
|
9
|
+
alt: any;
|
|
10
|
+
position?: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
onError: any;
|
|
13
|
+
onLoad: any;
|
|
14
|
+
imageErrors: any;
|
|
15
|
+
style?: {};
|
|
16
|
+
loading?: string;
|
|
17
|
+
}): any;
|
|
18
|
+
export function ImageWithErrorBoundary({ imageKey, url, alt, position, className, onError, onLoad, imageErrors, showErrorPlaceholder, loading, ...props }: {
|
|
19
|
+
[x: string]: any;
|
|
20
|
+
imageKey: any;
|
|
21
|
+
url: any;
|
|
22
|
+
alt: any;
|
|
23
|
+
position?: string;
|
|
24
|
+
className?: string;
|
|
25
|
+
onError: any;
|
|
26
|
+
onLoad: any;
|
|
27
|
+
imageErrors: any;
|
|
28
|
+
showErrorPlaceholder?: boolean;
|
|
29
|
+
loading?: string;
|
|
30
|
+
}): any;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export function ToggleView({ baselineImageUrl, currentImageUrl, screenshot, onImageError, onImageLoad, imageErrors, }: {
|
|
2
|
+
baselineImageUrl: any;
|
|
3
|
+
currentImageUrl: any;
|
|
4
|
+
screenshot: any;
|
|
5
|
+
onImageError: any;
|
|
6
|
+
onImageLoad: any;
|
|
7
|
+
imageErrors?: Set<any>;
|
|
8
|
+
}): any;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified Screenshot Display Component - matches Observatory architecture
|
|
3
|
+
* Handles zoom calculations and renders the appropriate comparison mode
|
|
4
|
+
* inside a zoom wrapper so all modes scale together
|
|
5
|
+
*/
|
|
6
|
+
export function ScreenshotDisplay({ comparison, viewMode, showDiffOverlay, onionSkinPosition, onOnionSkinChange, onDiffToggle, disableLoadingOverlay, zoom, className, }: {
|
|
7
|
+
comparison: any;
|
|
8
|
+
viewMode?: string;
|
|
9
|
+
showDiffOverlay?: boolean;
|
|
10
|
+
onionSkinPosition?: number;
|
|
11
|
+
onOnionSkinChange: any;
|
|
12
|
+
onDiffToggle: any;
|
|
13
|
+
disableLoadingOverlay?: boolean;
|
|
14
|
+
zoom?: string;
|
|
15
|
+
className?: string;
|
|
16
|
+
}): any;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Badge Component
|
|
3
|
+
* Observatory Design System
|
|
4
|
+
*
|
|
5
|
+
* For status indicators, labels, and counts
|
|
6
|
+
* Variants: default, success, warning, danger, info, purple
|
|
7
|
+
* Sizes: sm, md
|
|
8
|
+
*/
|
|
9
|
+
export function Badge({ children, variant, size, dot, pulseDot, className, ...props }: {
|
|
10
|
+
[x: string]: any;
|
|
11
|
+
children: any;
|
|
12
|
+
variant?: string;
|
|
13
|
+
size?: string;
|
|
14
|
+
dot?: boolean;
|
|
15
|
+
pulseDot?: boolean;
|
|
16
|
+
className?: string;
|
|
17
|
+
}): any;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Button Component
|
|
3
|
+
* Observatory Design System
|
|
4
|
+
*
|
|
5
|
+
* Variants: primary, secondary, ghost, danger, warning, success
|
|
6
|
+
* Sizes: sm, md, lg
|
|
7
|
+
*/
|
|
8
|
+
export function Button({ children, variant, size, disabled, loading, icon: Icon, iconPosition, fullWidth, className, ...props }: {
|
|
9
|
+
[x: string]: any;
|
|
10
|
+
children: any;
|
|
11
|
+
variant?: string;
|
|
12
|
+
size?: string;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
loading?: boolean;
|
|
15
|
+
icon: any;
|
|
16
|
+
iconPosition?: string;
|
|
17
|
+
fullWidth?: boolean;
|
|
18
|
+
className?: string;
|
|
19
|
+
}): any;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Card Component
|
|
3
|
+
* Observatory Design System
|
|
4
|
+
*
|
|
5
|
+
* Container component with optional accent borders
|
|
6
|
+
* Variants: default, success, warning, danger, info, purple
|
|
7
|
+
*/
|
|
8
|
+
export function Card({ children, variant, hover, className, ...props }: {
|
|
9
|
+
[x: string]: any;
|
|
10
|
+
children: any;
|
|
11
|
+
variant: any;
|
|
12
|
+
hover?: boolean;
|
|
13
|
+
className?: string;
|
|
14
|
+
}): any;
|
|
15
|
+
export function CardHeader({ icon: Icon, title, description, iconColor, actions, className, }: {
|
|
16
|
+
icon: any;
|
|
17
|
+
title: any;
|
|
18
|
+
description: any;
|
|
19
|
+
iconColor?: string;
|
|
20
|
+
actions: any;
|
|
21
|
+
className?: string;
|
|
22
|
+
}): any;
|
|
23
|
+
export function CardBody({ children, className, padding }: {
|
|
24
|
+
children: any;
|
|
25
|
+
className?: string;
|
|
26
|
+
padding?: string;
|
|
27
|
+
}): any;
|
|
28
|
+
export function CardFooter({ children, className }: {
|
|
29
|
+
children: any;
|
|
30
|
+
className?: string;
|
|
31
|
+
}): any;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Empty State Component
|
|
3
|
+
* Observatory Design System
|
|
4
|
+
*
|
|
5
|
+
* For empty lists, waiting states, errors
|
|
6
|
+
*/
|
|
7
|
+
export function EmptyState({ icon: Icon, title, description, action, className, }: {
|
|
8
|
+
icon: any;
|
|
9
|
+
title: any;
|
|
10
|
+
description: any;
|
|
11
|
+
action: any;
|
|
12
|
+
className?: string;
|
|
13
|
+
}): any;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Form Controls
|
|
3
|
+
* Observatory Design System
|
|
4
|
+
*
|
|
5
|
+
* Input, Select, Checkbox, Toggle
|
|
6
|
+
*/
|
|
7
|
+
export function Input({ label, hint, error, icon: Icon, size, className, ...props }: {
|
|
8
|
+
[x: string]: any;
|
|
9
|
+
label: any;
|
|
10
|
+
hint: any;
|
|
11
|
+
error: any;
|
|
12
|
+
icon: any;
|
|
13
|
+
size?: string;
|
|
14
|
+
className?: string;
|
|
15
|
+
}): any;
|
|
16
|
+
export function Select({ label, hint, error, options, placeholder, size, className, ...props }: {
|
|
17
|
+
[x: string]: any;
|
|
18
|
+
label: any;
|
|
19
|
+
hint: any;
|
|
20
|
+
error: any;
|
|
21
|
+
options?: any[];
|
|
22
|
+
placeholder?: string;
|
|
23
|
+
size?: string;
|
|
24
|
+
className?: string;
|
|
25
|
+
}): any;
|
|
26
|
+
export function Checkbox({ label, description, checked, onChange, disabled, className, ...props }: {
|
|
27
|
+
[x: string]: any;
|
|
28
|
+
label: any;
|
|
29
|
+
description: any;
|
|
30
|
+
checked: any;
|
|
31
|
+
onChange: any;
|
|
32
|
+
disabled?: boolean;
|
|
33
|
+
className?: string;
|
|
34
|
+
}): any;
|
|
35
|
+
export function Toggle({ label, description, checked, onChange, disabled, size, className, ...props }: {
|
|
36
|
+
[x: string]: any;
|
|
37
|
+
label: any;
|
|
38
|
+
description: any;
|
|
39
|
+
checked: any;
|
|
40
|
+
onChange: any;
|
|
41
|
+
disabled?: boolean;
|
|
42
|
+
size?: string;
|
|
43
|
+
className?: string;
|
|
44
|
+
}): any;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { Button } from "./button.jsx";
|
|
2
|
+
export { Badge } from "./badge.jsx";
|
|
3
|
+
export { Alert } from "./alert.jsx";
|
|
4
|
+
export { HealthRing } from "./health-ring.jsx";
|
|
5
|
+
export { Tabs } from "./tabs.jsx";
|
|
6
|
+
export { EmptyState } from "./empty-state.jsx";
|
|
7
|
+
export { Modal } from "./modal.jsx";
|
|
8
|
+
export { Spinner } from "./spinner.jsx";
|
|
9
|
+
export { Input, Select, Checkbox, Toggle } from "./form-controls.jsx";
|
|
10
|
+
export { Card, CardHeader, CardBody, CardFooter } from "./card.jsx";
|
|
11
|
+
export { Skeleton, SkeletonCard, SkeletonTable } from "./skeleton.jsx";
|