@vizzly-testing/cli 0.36.0 → 0.37.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vizzly-testing/cli",
3
- "version": "0.36.0",
3
+ "version": "0.37.0",
4
4
  "description": "Visual regression testing from your terminal",
5
5
  "keywords": [
6
6
  "llm-context",
@@ -72,17 +72,18 @@
72
72
  "dev:reporter": "cd src/reporter && vite --config vite.dev.config.js",
73
73
  "test:types": "tsd",
74
74
  "prepublishOnly": "pnpm run build",
75
- "test": "node --experimental-test-coverage --test --test-concurrency=1 --test-reporter=spec $(find tests -name '*.test.js')",
75
+ "test": "node --experimental-test-coverage --test --test-concurrency=1 --test-reporter=spec $(find tests clients/swift/tests-js -name '*.test.js')",
76
76
  "test:watch": "node --test --test-reporter=spec --watch $(find tests -name '*.test.js')",
77
77
  "test:reporter": "playwright test --config=tests/reporter/playwright.config.js",
78
78
  "test:reporter:visual": "node bin/vizzly.js tdd run \"pnpm run test:reporter\" --no-open",
79
79
  "test:swift:e2e": "pnpm run build && node clients/swift/scripts/run-e2e.js",
80
+ "test:swift:previews:e2e": "node clients/swift/scripts/run-preview-e2e.js",
80
81
  "test:tui": "node --test --test-reporter=spec tests/tui/*.test.js",
81
82
  "test:tui:docker": "./tests/tui/run-tui-tests.sh",
82
- "lint": "biome check src tests clients/storybook/src clients/storybook/tests clients/static-site/src clients/static-site/tests clients/vitest/src clients/vitest/tests clients/ember/src clients/ember/tests clients/ember/bin",
83
- "lint:fix": "biome check --write --unsafe src tests clients/storybook/src clients/storybook/tests clients/static-site/src clients/static-site/tests clients/vitest/src clients/vitest/tests clients/ember/src clients/ember/tests clients/ember/bin",
84
- "format": "biome format --write src tests clients/storybook/src clients/storybook/tests clients/static-site/src clients/static-site/tests clients/vitest/src clients/vitest/tests clients/ember/src clients/ember/tests clients/ember/bin",
85
- "format:check": "biome format src tests clients/storybook/src clients/storybook/tests clients/static-site/src clients/static-site/tests clients/vitest/src clients/vitest/tests clients/ember/src clients/ember/tests clients/ember/bin",
83
+ "lint": "biome check src tests clients/storybook/src clients/storybook/tests clients/static-site/src clients/static-site/tests clients/vitest/src clients/vitest/tests clients/ember/src clients/ember/tests clients/ember/bin clients/swift/src clients/swift/tests-js clients/swift/scripts",
84
+ "lint:fix": "biome check --write --unsafe src tests clients/storybook/src clients/storybook/tests clients/static-site/src clients/static-site/tests clients/vitest/src clients/vitest/tests clients/ember/src clients/ember/tests clients/ember/bin clients/swift/src clients/swift/tests-js clients/swift/scripts",
85
+ "format": "biome format --write src tests clients/storybook/src clients/storybook/tests clients/static-site/src clients/static-site/tests clients/vitest/src clients/vitest/tests clients/ember/src clients/ember/tests clients/ember/bin clients/swift/src clients/swift/tests-js clients/swift/scripts",
86
+ "format:check": "biome format src tests clients/storybook/src clients/storybook/tests clients/static-site/src clients/static-site/tests clients/vitest/src clients/vitest/tests clients/ember/src clients/ember/tests clients/ember/bin clients/swift/src clients/swift/tests-js clients/swift/scripts",
86
87
  "fix": "pnpm run format && pnpm run lint:fix"
87
88
  },
88
89
  "engines": {
@@ -94,7 +95,7 @@
94
95
  },
95
96
  "dependencies": {
96
97
  "@vizzly-testing/bear-den": "0.1.4",
97
- "@vizzly-testing/honeydiff": "^0.16.0",
98
+ "@vizzly-testing/honeydiff": "^0.17.0",
98
99
  "ansis": "^4.2.0",
99
100
  "commander": "^15.0.0",
100
101
  "cosmiconfig": "^9.0.0",
@@ -20,21 +20,29 @@ test workflow in charge of how the UI is exercised.
20
20
 
21
21
  ## Inspect And Verify
22
22
 
23
+ For cloud API queries, selectable fields, or an authorized review decision,
24
+ start with `vizzly api schema --json` and follow
25
+ [schema discovery](references/cli-context.md#query-the-cloud-api).
26
+ Discover request details as needed instead of loading the entire OpenAPI document.
27
+ Use `vizzly context ... --json` for local evidence and human-readable `context`
28
+ output for guided inspection.
29
+
23
30
  1. Choose the supplied cloud build or comparison when one is named. Otherwise,
24
31
  use current local evidence or find the relevant cloud build.
25
- 2. Request bounded JSON:
32
+ 2. For cloud data, discover the relevant API operations. For locally saved data,
33
+ request JSON context:
26
34
 
27
35
  ```bash
28
- vizzly context build current --source local --agent --json
29
- vizzly context build <build-id> --source cloud --agent --json
36
+ vizzly api schema --json
37
+ vizzly context build current --source local --json
30
38
  ```
31
39
 
32
40
  3. Confirm the build, source, branch, timestamps, baseline, review state, and
33
- pagination before drawing conclusions. If `has_more` is true, run the
34
- returned next-page command before concluding. Missing fields remain unknown.
35
- 4. Follow `suggested_commands` to inspect a comparison. View its baseline,
36
- current, and diff images together. If an image cannot be opened, label the
37
- result metadata-only; do not call it visual verification.
41
+ pagination before drawing conclusions. Follow the schema's page instructions
42
+ for cloud data. Missing fields remain unknown.
43
+ 4. For cloud data, discover the comparison and image operations from the schema.
44
+ View the baseline, current, and diff images together. If an image cannot be
45
+ opened, label the result metadata-only; do not call it visual verification.
38
46
  5. Read image dimensions, viewport, browser, diff regions, fingerprint, and
39
47
  relevant history alongside the images. A prior approval is supporting
40
48
  evidence, not permission to approve the current comparison.
@@ -57,7 +65,7 @@ test workflow in charge of how the UI is exercised.
57
65
  ## Load A Reference When Needed
58
66
 
59
67
  - [CLI context](references/cli-context.md): local and cloud evidence, build
60
- discovery, drill-downs, images, and TDD lifecycle.
68
+ discovery, schema queries, review decisions, images, and TDD lifecycle.
61
69
  - [SDK capture](references/sdks.md): add or change screenshot capture code.
62
70
  - [Dynamic content](references/dynamic-content.md): investigate unstable
63
71
  content and screenshot-specific tolerances.
@@ -4,6 +4,41 @@ Use the repository's established CLI invocation and existing authentication.
4
4
  If cloud authentication is unavailable, report the blocker. Do not start an
5
5
  interactive login unless setup is in scope.
6
6
 
7
+ ## Query The Cloud API
8
+
9
+ Discover the live review API instead of guessing endpoints or adding command flags:
10
+
11
+ ```bash
12
+ vizzly api schema --json
13
+ vizzly api schema <operation-id> --json
14
+ vizzly api schema <operation-id> -q view=fields --json
15
+ vizzly api schema <operation-id> -q view=response --json
16
+ ```
17
+
18
+ The index lists available operations. The default operation view describes the
19
+ method, path, parameters, authentication, and example arguments. Request field
20
+ choices or response types only when needed. API JSON payloads are under
21
+ `data.response`.
22
+
23
+ Call the discovered path using `vizzly api <path>`, `-X` for its method, `-H`
24
+ for headers, and `-q` for query parameters. Send the discovered API version
25
+ header on data requests. Use `fields` to select just the evidence needed.
26
+ Follow the response's pagination values explicitly; the CLI fetches one page
27
+ per request. Keep cursors opaque and preserve the query they belong to.
28
+
29
+ For a review, discover projects/builds, then inspect the build's screenshots,
30
+ comparisons, and image endpoints. Download images with `--output <new-file>`
31
+ and view baseline, current, and diff together. Use file output for large analysis
32
+ responses too. Existing files are not overwritten. Export the full schema only
33
+ when needed: `vizzly api schema --full --output <new-file> --json`.
34
+
35
+ Review decisions require an authorized task, user credentials, and the documented
36
+ organization header. Discover the decision operation's body before sending it
37
+ with `-d @<file>` or `-d @-` for stdin. Generate a fresh `commandId` for each
38
+ intended decision, then read back the review state. Generic writes are not
39
+ automatically replayed; after an uncertain result, inspect state before retrying.
40
+ Treat schema examples as argument arrays, not shell scripts.
41
+
7
42
  ## Choose The Evidence
8
43
 
9
44
  Use an ID supplied by the task. If no cloud build is supplied, list recent
@@ -12,17 +47,18 @@ builds and select the one matching the branch, commit, or pull request:
12
47
  ```bash
13
48
  vizzly builds --branch <branch> --limit 5 --json
14
49
  vizzly status <build-id> --json
15
- vizzly context build <build-id> --source cloud --agent --json
50
+ vizzly api schema sdk.getBuildContext --json
16
51
  ```
17
52
 
18
- Use status for lifecycle facts and build context for visual evidence. Do not
19
- assume the first returned comparison is the most important; preserve API order
20
- and inspect the records relevant to the task.
53
+ Use status for lifecycle facts, then follow the discovered build-context
54
+ operation for visual evidence. Do not assume the first returned comparison is
55
+ the most important; preserve API order and inspect the records relevant to the
56
+ task.
21
57
 
22
58
  For saved local evidence:
23
59
 
24
60
  ```bash
25
- vizzly context build current --source local --agent --json
61
+ vizzly context build current --source local --json
26
62
  vizzly context screenshot "<screenshot-name>" --source local --json
27
63
  vizzly context review-queue --source local --json
28
64
  ```
@@ -54,16 +90,16 @@ When a cloud build is in scope:
54
90
 
55
91
  ```bash
56
92
  vizzly run "<existing visual test command>" --wait --json
57
- vizzly context build <build-id> --source cloud --agent --json
93
+ vizzly api schema --json
58
94
  ```
59
95
 
60
96
  ## Inspect A Comparison
61
97
 
62
- Follow the build response's `suggested_commands`. The direct form is:
98
+ Discover comparison and image operations from the schema:
63
99
 
64
100
  ```bash
65
- vizzly context comparison <comparison-id> --source <local-or-cloud> --agent --json
66
- vizzly context comparison <comparison-id> --source <local-or-cloud> --agent --include diffs --json
101
+ vizzly api schema getComparisonContext --json
102
+ vizzly api schema sdk.getComparisonImage --json
67
103
  ```
68
104
 
69
105
  Open all three images together. Prefer `original_url` and fall back to `url`:
@@ -86,12 +122,10 @@ vizzly context similar <fingerprint-hash> --source cloud --json
86
122
  vizzly context review-queue --source <local-or-cloud> --json
87
123
  ```
88
124
 
89
- Use `--include diffs` only when compact diagnostics are insufficient. Request
90
- comments only when human review context matters.
125
+ Use the documented response and pagination fields to request only the evidence
126
+ needed. Request comments only when human review context matters.
91
127
 
92
128
  ## Continue Without Guessing
93
129
 
94
- Run returned `suggested_commands` rather than reconstructing IDs, sources, or
95
- pagination. When more evidence exists, the next-page command carries the API's
96
- opaque `--cursor`; do not edit or interpret it. Keep follow-up commands pinned
97
- to the source that produced the evidence.
130
+ Use IDs and pagination values from API responses. Keep cursors opaque and
131
+ preserve the query they belong to when requesting the next page.
@@ -36,8 +36,8 @@ vizzly finalize "<shared-ci-run-id>" --json
36
36
  - `vizzly doctor`: local configuration
37
37
  - `vizzly tdd status --json`: a local daemon started by the task
38
38
  - `vizzly status <build-id> --json`: cloud lifecycle
39
- - `vizzly context build <build-id> --source cloud --agent --json`: visual
40
- evidence
39
+ - `vizzly api schema --json`: discover supported cloud review operations and
40
+ their request and response schemas.
41
41
 
42
42
  If screenshots are absent, verify the existing integration, the test path that
43
43
  should capture them, and the active session. If authentication is absent,