@kaptures/cli 0.12.1 → 0.14.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 (3) hide show
  1. package/README.md +26 -19
  2. package/dist/index.js +71 -68
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -5,12 +5,13 @@ one explicit browser environment. It produces a self-contained visual report
5
5
  and can publish a SHA-bound review status to GitHub.
6
6
 
7
7
  Node.js 24 or later is required. Both Storybook builds must register the
8
- matching `@kaptures/storybook@0.2.0` preview adapter. Kapture does not fall back
8
+ compatible `@kaptures/storybook` preview adapter. Kapture does not fall back
9
9
  to Storybook private globals, legacy decorators, or Chromatic parameters.
10
10
 
11
11
  ```bash
12
- npx -y @kaptures/cli@0.5.0 --help
13
- npx -y @kaptures/cli@0.5.0 browser install
12
+ npm install --save-dev --save-exact @kaptures/cli @kaptures/storybook
13
+ npm exec -- kapture --help
14
+ npm exec -- kapture browser install
14
15
  ```
15
16
 
16
17
  ## Compare Storybooks
@@ -19,20 +20,19 @@ npx -y @kaptures/cli@0.5.0 browser install
19
20
 
20
21
  For a PR whose exact base manifest does not yet declare the adapter, generate
21
22
  workflows with `kapture ci --package-manager <npm|yarn|pnpm|bun>
22
- --adapter-package-json <path> --allow-initial-adoption`. The exact head adapter
23
- must match the CLI version. Malformed manifests and version mismatches remain
23
+ --adapter-package-json <path> --allow-initial-adoption`. The head must declare an adapter; capture validates its protocol and capture contract. Malformed manifests and incompatible capture contracts remain
24
24
  errors. Initial adoption needs no hosting hook, deployment credentials or status/comment write permissions.
25
25
 
26
26
  This mode uses `setup capture` to save PNGs and a separate `setup.json` artifact,
27
27
  and writes a bounded GitHub Job Summary with **Comparison not performed**.
28
28
  It does not publish a dashboard, PR comment, commit status or approval marker.
29
- Inspect each run's Summary and artifact for its result; capture errors fail the job. Once the base includes the matching adapter,
29
+ Inspect each run's Summary and artifact for its result; capture errors fail the job. Once the base includes a compatible adapter,
30
30
  the same workflow automatically takes the normal comparison path.
31
31
 
32
32
  ### Normal comparison
33
33
 
34
34
  ```bash
35
- npx -y @kaptures/cli@0.5.0 test \
35
+ npm exec -- kapture test \
36
36
  --base-dir .kapture/storybook/base \
37
37
  --head-dir .kapture/storybook/head \
38
38
  --base-revision "$BASE_SHA" \
@@ -41,7 +41,7 @@ npx -y @kaptures/cli@0.5.0 test \
41
41
  --install-browser \
42
42
  --output .kapture
43
43
 
44
- npx -y @kaptures/cli@0.5.0 validate \
44
+ npm exec -- kapture validate \
45
45
  --report .kapture/report/report.json
46
46
  ```
47
47
 
@@ -105,7 +105,7 @@ of project-relative Git diff paths to select only stories whose base or head
105
105
  dependency graph is affected:
106
106
 
107
107
  ```bash
108
- npx -y @kaptures/cli@0.5.0 plan \
108
+ npm exec -- kapture plan \
109
109
  --base-dir .kapture/storybook/base \
110
110
  --head-dir .kapture/storybook/head \
111
111
  --changed-files .kapture/changed-files.json \
@@ -126,7 +126,7 @@ artifact is downloaded. To publish a browser URL from a privileged workflow,
126
126
  rebuild the untrusted artifact with the dashboard embedded in the pinned CLI:
127
127
 
128
128
  ```bash
129
- npx -y @kaptures/cli@0.5.0 report build \
129
+ npm exec -- kapture report build \
130
130
  --input downloaded-kapture-report \
131
131
  --output trusted-kapture-report
132
132
  ```
@@ -182,46 +182,46 @@ The raw branch ref remains report metadata; a separate collision-resistant
182
182
  `preview-alias` is used only where a DNS-safe hosting branch is required.
183
183
 
184
184
  ```bash
185
- npx -y @kaptures/cli@0.5.0 github reconcile-run \
185
+ npm exec -- kapture github reconcile-run \
186
186
  --capture-workflow-path .github/workflows/visual-capture.yml \
187
187
  --base-branch main \
188
188
  --status-context "Kapture Visual Review"
189
189
 
190
- npx -y @kaptures/cli@0.5.0 github prepare-run \
190
+ npm exec -- kapture github prepare-run \
191
191
  --capture-workflow-path .github/workflows/visual-capture.yml \
192
192
  --base-branch main \
193
193
  --output "$RUNNER_TEMP/kapture-trusted/report" \
194
194
  --receipt "$RUNNER_TEMP/kapture-trusted/receipt.json" \
195
195
  --storybook-url ./storybook/
196
196
 
197
- npx -y @kaptures/cli@0.5.0 github prepare-storybook-run \
197
+ npm exec -- kapture github prepare-storybook-run \
198
198
  --capture-workflow-path .github/workflows/visual-capture.yml \
199
199
  --base-branch main \
200
200
  --receipt "$RUNNER_TEMP/kapture-trusted/receipt.json" \
201
201
  --output "$RUNNER_TEMP/kapture-trusted/report/storybook"
202
202
 
203
- npx -y @kaptures/cli@0.5.0 github publish-run \
203
+ npm exec -- kapture github publish-run \
204
204
  --receipt "$RUNNER_TEMP/kapture-trusted/receipt.json" \
205
205
  --report "$RUNNER_TEMP/kapture-trusted/report/report.json" \
206
206
  --report-url "https://reports.example.com/builds/1a2b3c4d/" \
207
207
  --status-context "Kapture Visual Review"
208
208
 
209
- npx -y @kaptures/cli@0.5.0 github cleanup \
209
+ npm exec -- kapture github cleanup \
210
210
  --receipt "$RUNNER_TEMP/kapture-trusted/receipt.json"
211
211
 
212
- npx -y @kaptures/cli@0.5.0 github finalize-run \
212
+ npm exec -- kapture github finalize-run \
213
213
  --capture-workflow-path .github/workflows/visual-capture.yml \
214
214
  --base-branch main \
215
215
  --status-context "Kapture Visual Review"
216
216
 
217
- npx -y @kaptures/cli@0.5.0 github verify \
217
+ npm exec -- kapture github verify \
218
218
  --report .kapture/report/report.json
219
219
 
220
- npx -y @kaptures/cli@0.5.0 github report \
220
+ npm exec -- kapture github report \
221
221
  --report trusted-kapture-report/report.json \
222
222
  --report-url "https://reports.example.com/builds/1a2b3c4d/"
223
223
 
224
- npx -y @kaptures/cli@0.5.0 github approve
224
+ npm exec -- kapture github approve
225
225
  ```
226
226
 
227
227
  GitHub commands read authentication and event data only from `GITHUB_TOKEN`
@@ -260,3 +260,10 @@ the verification boundary.
260
260
  ## License
261
261
 
262
262
  MIT © Danggeun Market Inc.
263
+
264
+
265
+ For adapter upgrades, opt into `--allow-adapter-upgrade --adapter-package-json <path>` on `github context`, `github prepare-review`, and `github finalize-run` (or `ci` to generate all three). An exact stable base version strictly older than the head is eligible only when the head adapter matches the running CLI. Same-repository upgrades skip comparison; completed successful runs get the status description `Comparison skipped: adapter upgrade`. This is not visual validation or approval: review all visual changes manually and compare again after merge. Failed runs and invalid, ranged, prerelease, downgraded or mismatched versions remain errors. Trusted handlers revalidate live revisions and the latest run before writing status. Update the default-branch report/finalize workflow as well; older CLI releases cannot apply this policy.
266
+
267
+ Only explicit comparison skipping requires the head adapter version to match the capture CLI. The trusted report CLI may still be the older default-branch version, so it verifies the live upgrade and successful capture run rather than requiring the head adapter to match itself.
268
+
269
+ Normal comparison accepts different adapter package versions with supported wire and capture contracts. Both original builds run under the same CLI and browser. Capture engine/contract changes invalidate cached evidence; actual adapter versions are retained in capture manifests.