@visual-check/cli 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/dist/addon-build.d.ts +3 -0
- package/dist/addon-build.d.ts.map +1 -0
- package/dist/addon-build.js +4 -0
- package/dist/addon-build.js.map +1 -0
- package/dist/addon-child/addon-child.d.ts +63 -0
- package/dist/addon-child/addon-child.d.ts.map +1 -0
- package/dist/addon-child/addon-child.js +85 -0
- package/dist/addon-child/addon-child.js.map +1 -0
- package/dist/addon-child/image-files.d.ts +11 -0
- package/dist/addon-child/image-files.d.ts.map +1 -0
- package/dist/addon-child/image-files.js +138 -0
- package/dist/addon-child/image-files.js.map +1 -0
- package/dist/addon-child/protocol.d.ts +181 -0
- package/dist/addon-child/protocol.d.ts.map +1 -0
- package/dist/addon-child/protocol.js +2 -0
- package/dist/addon-child/protocol.js.map +1 -0
- package/dist/addon-child/read-request.d.ts +7 -0
- package/dist/addon-child/read-request.d.ts.map +1 -0
- package/dist/addon-child/read-request.js +25 -0
- package/dist/addon-child/read-request.js.map +1 -0
- package/dist/addon-child.d.ts +2 -0
- package/dist/addon-child.d.ts.map +1 -0
- package/dist/addon-child.js +61 -0
- package/dist/addon-child.js.map +1 -0
- package/dist/affected-stories/affected-stories.d.ts +128 -0
- package/dist/affected-stories/affected-stories.d.ts.map +1 -0
- package/dist/affected-stories/affected-stories.js +168 -0
- package/dist/affected-stories/affected-stories.js.map +1 -0
- package/dist/affected-stories/changed-file-rules.d.ts +98 -0
- package/dist/affected-stories/changed-file-rules.d.ts.map +1 -0
- package/dist/affected-stories/changed-file-rules.js +167 -0
- package/dist/affected-stories/changed-file-rules.js.map +1 -0
- package/dist/affected-stories/fallow-graph.d.ts +67 -0
- package/dist/affected-stories/fallow-graph.d.ts.map +1 -0
- package/dist/affected-stories/fallow-graph.js +180 -0
- package/dist/affected-stories/fallow-graph.js.map +1 -0
- package/dist/affected-stories/git-changes.d.ts +57 -0
- package/dist/affected-stories/git-changes.d.ts.map +1 -0
- package/dist/affected-stories/git-changes.js +203 -0
- package/dist/affected-stories/git-changes.js.map +1 -0
- package/dist/affected-stories/group-changes.d.ts +48 -0
- package/dist/affected-stories/group-changes.d.ts.map +1 -0
- package/dist/affected-stories/group-changes.js +41 -0
- package/dist/affected-stories/group-changes.js.map +1 -0
- package/dist/affected-stories/import-graph.d.ts +33 -0
- package/dist/affected-stories/import-graph.d.ts.map +1 -0
- package/dist/affected-stories/import-graph.js +99 -0
- package/dist/affected-stories/import-graph.js.map +1 -0
- package/dist/affected-stories/limited-map.d.ts +9 -0
- package/dist/affected-stories/limited-map.d.ts.map +1 -0
- package/dist/affected-stories/limited-map.js +24 -0
- package/dist/affected-stories/limited-map.js.map +1 -0
- package/dist/affected-stories/package-folder.d.ts +8 -0
- package/dist/affected-stories/package-folder.d.ts.map +1 -0
- package/dist/affected-stories/package-folder.js +45 -0
- package/dist/affected-stories/package-folder.js.map +1 -0
- package/dist/affected-stories/storybook-rules.d.ts +153 -0
- package/dist/affected-stories/storybook-rules.d.ts.map +1 -0
- package/dist/affected-stories/storybook-rules.js +161 -0
- package/dist/affected-stories/storybook-rules.js.map +1 -0
- package/dist/affected-stories/walk-back.d.ts +16 -0
- package/dist/affected-stories/walk-back.d.ts.map +1 -0
- package/dist/affected-stories/walk-back.js +46 -0
- package/dist/affected-stories/walk-back.js.map +1 -0
- package/dist/agent-skill/install-skill.d.ts +34 -0
- package/dist/agent-skill/install-skill.d.ts.map +1 -0
- package/dist/agent-skill/install-skill.js +43 -0
- package/dist/agent-skill/install-skill.js.map +1 -0
- package/dist/agent-skill/refresh-skill.d.ts +62 -0
- package/dist/agent-skill/refresh-skill.d.ts.map +1 -0
- package/dist/agent-skill/refresh-skill.js +105 -0
- package/dist/agent-skill/refresh-skill.js.map +1 -0
- package/dist/agent-skill/setup-file.d.ts +41 -0
- package/dist/agent-skill/setup-file.d.ts.map +1 -0
- package/dist/agent-skill/setup-file.js +38 -0
- package/dist/agent-skill/setup-file.js.map +1 -0
- package/dist/agent-skill/skill-files.d.ts +19 -0
- package/dist/agent-skill/skill-files.d.ts.map +1 -0
- package/dist/agent-skill/skill-files.js +29 -0
- package/dist/agent-skill/skill-files.js.map +1 -0
- package/dist/agent-skill/skill-markdown.d.ts +31 -0
- package/dist/agent-skill/skill-markdown.d.ts.map +1 -0
- package/dist/agent-skill/skill-markdown.js +54 -0
- package/dist/agent-skill/skill-markdown.js.map +1 -0
- package/dist/baselines/baseline-clash.d.ts +31 -0
- package/dist/baselines/baseline-clash.d.ts.map +1 -0
- package/dist/baselines/baseline-clash.js +23 -0
- package/dist/baselines/baseline-clash.js.map +1 -0
- package/dist/baselines/baseline-error.d.ts +39 -0
- package/dist/baselines/baseline-error.d.ts.map +1 -0
- package/dist/baselines/baseline-error.js +42 -0
- package/dist/baselines/baseline-error.js.map +1 -0
- package/dist/baselines/baseline-files.d.ts +130 -0
- package/dist/baselines/baseline-files.d.ts.map +1 -0
- package/dist/baselines/baseline-files.js +292 -0
- package/dist/baselines/baseline-files.js.map +1 -0
- package/dist/baselines/baseline-set.d.ts +42 -0
- package/dist/baselines/baseline-set.d.ts.map +1 -0
- package/dist/baselines/baseline-set.js +104 -0
- package/dist/baselines/baseline-set.js.map +1 -0
- package/dist/bin.d.ts +3 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +57 -0
- package/dist/bin.js.map +1 -0
- package/dist/browser/browser-package.d.ts +54 -0
- package/dist/browser/browser-package.d.ts.map +1 -0
- package/dist/browser/browser-package.js +105 -0
- package/dist/browser/browser-package.js.map +1 -0
- package/dist/browser/browser-version.d.ts +67 -0
- package/dist/browser/browser-version.d.ts.map +1 -0
- package/dist/browser/browser-version.js +61 -0
- package/dist/browser/browser-version.js.map +1 -0
- package/dist/browser/chrome-for-testing-platform.d.ts +24 -0
- package/dist/browser/chrome-for-testing-platform.d.ts.map +1 -0
- package/dist/browser/chrome-for-testing-platform.js +39 -0
- package/dist/browser/chrome-for-testing-platform.js.map +1 -0
- package/dist/browser/image-marker.d.ts +46 -0
- package/dist/browser/image-marker.d.ts.map +1 -0
- package/dist/browser/image-marker.js +81 -0
- package/dist/browser/image-marker.js.map +1 -0
- package/dist/browser/read-browser-package.d.ts +58 -0
- package/dist/browser/read-browser-package.d.ts.map +1 -0
- package/dist/browser/read-browser-package.js +130 -0
- package/dist/browser/read-browser-package.js.map +1 -0
- package/dist/browser-download/browser-download-error.d.ts +19 -0
- package/dist/browser-download/browser-download-error.d.ts.map +1 -0
- package/dist/browser-download/browser-download-error.js +21 -0
- package/dist/browser-download/browser-download-error.js.map +1 -0
- package/dist/browser-download/cache-folder.d.ts +7 -0
- package/dist/browser-download/cache-folder.d.ts.map +1 -0
- package/dist/browser-download/cache-folder.js +34 -0
- package/dist/browser-download/cache-folder.js.map +1 -0
- package/dist/browser-download/download-file.d.ts +45 -0
- package/dist/browser-download/download-file.d.ts.map +1 -0
- package/dist/browser-download/download-file.js +340 -0
- package/dist/browser-download/download-file.js.map +1 -0
- package/dist/browser-download/install-headless-shell.d.ts +96 -0
- package/dist/browser-download/install-headless-shell.d.ts.map +1 -0
- package/dist/browser-download/install-headless-shell.js +491 -0
- package/dist/browser-download/install-headless-shell.js.map +1 -0
- package/dist/browser-download/proxy.d.ts +19 -0
- package/dist/browser-download/proxy.d.ts.map +1 -0
- package/dist/browser-download/proxy.js +102 -0
- package/dist/browser-download/proxy.js.map +1 -0
- package/dist/browser-download/unzip.d.ts +11 -0
- package/dist/browser-download/unzip.d.ts.map +1 -0
- package/dist/browser-download/unzip.js +96 -0
- package/dist/browser-download/unzip.js.map +1 -0
- package/dist/browser-process/start-browser-process.d.ts +30 -0
- package/dist/browser-process/start-browser-process.d.ts.map +1 -0
- package/dist/browser-process/start-browser-process.js +131 -0
- package/dist/browser-process/start-browser-process.js.map +1 -0
- package/dist/capture/capture-session.d.ts +472 -0
- package/dist/capture/capture-session.d.ts.map +1 -0
- package/dist/capture/capture-session.js +701 -0
- package/dist/capture/capture-session.js.map +1 -0
- package/dist/capture/driver/cdp/cdp-connection.d.ts +127 -0
- package/dist/capture/driver/cdp/cdp-connection.d.ts.map +1 -0
- package/dist/capture/driver/cdp/cdp-connection.js +243 -0
- package/dist/capture/driver/cdp/cdp-connection.js.map +1 -0
- package/dist/capture/driver/cdp/cdp-driver.d.ts +42 -0
- package/dist/capture/driver/cdp/cdp-driver.d.ts.map +1 -0
- package/dist/capture/driver/cdp/cdp-driver.js +270 -0
- package/dist/capture/driver/cdp/cdp-driver.js.map +1 -0
- package/dist/capture/driver/cdp/cdp-page.d.ts +10 -0
- package/dist/capture/driver/cdp/cdp-page.d.ts.map +1 -0
- package/dist/capture/driver/cdp/cdp-page.js +704 -0
- package/dist/capture/driver/cdp/cdp-page.js.map +1 -0
- package/dist/capture/driver/cdp/last-lines.d.ts +13 -0
- package/dist/capture/driver/cdp/last-lines.d.ts.map +1 -0
- package/dist/capture/driver/cdp/last-lines.js +49 -0
- package/dist/capture/driver/cdp/last-lines.js.map +1 -0
- package/dist/capture/driver/cdp/launch-arguments.d.ts +16 -0
- package/dist/capture/driver/cdp/launch-arguments.d.ts.map +1 -0
- package/dist/capture/driver/cdp/launch-arguments.js +142 -0
- package/dist/capture/driver/cdp/launch-arguments.js.map +1 -0
- package/dist/capture/driver/cdp/loaded-document.d.ts +61 -0
- package/dist/capture/driver/cdp/loaded-document.d.ts.map +1 -0
- package/dist/capture/driver/cdp/loaded-document.js +104 -0
- package/dist/capture/driver/cdp/loaded-document.js.map +1 -0
- package/dist/capture/driver/cdp/main-frame-navigation.d.ts +127 -0
- package/dist/capture/driver/cdp/main-frame-navigation.d.ts.map +1 -0
- package/dist/capture/driver/cdp/main-frame-navigation.js +214 -0
- package/dist/capture/driver/cdp/main-frame-navigation.js.map +1 -0
- package/dist/capture/driver/cdp/request-watch.d.ts +117 -0
- package/dist/capture/driver/cdp/request-watch.d.ts.map +1 -0
- package/dist/capture/driver/cdp/request-watch.js +244 -0
- package/dist/capture/driver/cdp/request-watch.js.map +1 -0
- package/dist/capture/driver/cdp/time-limit.d.ts +29 -0
- package/dist/capture/driver/cdp/time-limit.d.ts.map +1 -0
- package/dist/capture/driver/cdp/time-limit.js +51 -0
- package/dist/capture/driver/cdp/time-limit.js.map +1 -0
- package/dist/capture/driver/driver.d.ts +500 -0
- package/dist/capture/driver/driver.d.ts.map +1 -0
- package/dist/capture/driver/driver.js +283 -0
- package/dist/capture/driver/driver.js.map +1 -0
- package/dist/capture/end-state.d.ts +131 -0
- package/dist/capture/end-state.d.ts.map +1 -0
- package/dist/capture/end-state.js +818 -0
- package/dist/capture/end-state.js.map +1 -0
- package/dist/capture/page-roots.d.ts +18 -0
- package/dist/capture/page-roots.d.ts.map +1 -0
- package/dist/capture/page-roots.js +67 -0
- package/dist/capture/page-roots.js.map +1 -0
- package/dist/capture/page-script.d.ts +118 -0
- package/dist/capture/page-script.d.ts.map +1 -0
- package/dist/capture/page-script.js +399 -0
- package/dist/capture/page-script.js.map +1 -0
- package/dist/capture/prepare-capture.d.ts +228 -0
- package/dist/capture/prepare-capture.d.ts.map +1 -0
- package/dist/capture/prepare-capture.js +480 -0
- package/dist/capture/prepare-capture.js.map +1 -0
- package/dist/capture/read-options.d.ts +65 -0
- package/dist/capture/read-options.d.ts.map +1 -0
- package/dist/capture/read-options.js +211 -0
- package/dist/capture/read-options.js.map +1 -0
- package/dist/capture/remote-content.d.ts +45 -0
- package/dist/capture/remote-content.d.ts.map +1 -0
- package/dist/capture/remote-content.js +309 -0
- package/dist/capture/remote-content.js.map +1 -0
- package/dist/capture/worker-pool.d.ts +35 -0
- package/dist/capture/worker-pool.d.ts.map +1 -0
- package/dist/capture/worker-pool.js +51 -0
- package/dist/capture/worker-pool.js.map +1 -0
- package/dist/commands/abortable.d.ts +9 -0
- package/dist/commands/abortable.d.ts.map +1 -0
- package/dist/commands/abortable.js +18 -0
- package/dist/commands/abortable.js.map +1 -0
- package/dist/commands/browser-route.d.ts +86 -0
- package/dist/commands/browser-route.d.ts.map +1 -0
- package/dist/commands/browser-route.js +27 -0
- package/dist/commands/browser-route.js.map +1 -0
- package/dist/commands/capture-settings.d.ts +8 -0
- package/dist/commands/capture-settings.d.ts.map +1 -0
- package/dist/commands/capture-settings.js +17 -0
- package/dist/commands/capture-settings.js.map +1 -0
- package/dist/commands/check-story.d.ts +91 -0
- package/dist/commands/check-story.d.ts.map +1 -0
- package/dist/commands/check-story.js +52 -0
- package/dist/commands/check-story.js.map +1 -0
- package/dist/commands/check-storybooks.d.ts +71 -0
- package/dist/commands/check-storybooks.d.ts.map +1 -0
- package/dist/commands/check-storybooks.js +49 -0
- package/dist/commands/check-storybooks.js.map +1 -0
- package/dist/commands/consistency-check.d.ts +62 -0
- package/dist/commands/consistency-check.d.ts.map +1 -0
- package/dist/commands/consistency-check.js +63 -0
- package/dist/commands/consistency-check.js.map +1 -0
- package/dist/commands/consistency-output.d.ts +63 -0
- package/dist/commands/consistency-output.d.ts.map +1 -0
- package/dist/commands/consistency-output.js +63 -0
- package/dist/commands/consistency-output.js.map +1 -0
- package/dist/commands/docker-problem.d.ts +23 -0
- package/dist/commands/docker-problem.d.ts.map +1 -0
- package/dist/commands/docker-problem.js +18 -0
- package/dist/commands/docker-problem.js.map +1 -0
- package/dist/commands/launch-browser.d.ts +123 -0
- package/dist/commands/launch-browser.d.ts.map +1 -0
- package/dist/commands/launch-browser.js +113 -0
- package/dist/commands/launch-browser.js.map +1 -0
- package/dist/commands/missing-library.d.ts +6 -0
- package/dist/commands/missing-library.d.ts.map +1 -0
- package/dist/commands/missing-library.js +19 -0
- package/dist/commands/missing-library.js.map +1 -0
- package/dist/commands/network-warning.d.ts +36 -0
- package/dist/commands/network-warning.d.ts.map +1 -0
- package/dist/commands/network-warning.js +92 -0
- package/dist/commands/network-warning.js.map +1 -0
- package/dist/commands/parse-command-line.d.ts +133 -0
- package/dist/commands/parse-command-line.d.ts.map +1 -0
- package/dist/commands/parse-command-line.js +425 -0
- package/dist/commands/parse-command-line.js.map +1 -0
- package/dist/commands/place-browser.d.ts +75 -0
- package/dist/commands/place-browser.d.ts.map +1 -0
- package/dist/commands/place-browser.js +82 -0
- package/dist/commands/place-browser.js.map +1 -0
- package/dist/commands/plan-snapshots.d.ts +134 -0
- package/dist/commands/plan-snapshots.d.ts.map +1 -0
- package/dist/commands/plan-snapshots.js +278 -0
- package/dist/commands/plan-snapshots.js.map +1 -0
- package/dist/commands/platform-problem.d.ts +7 -0
- package/dist/commands/platform-problem.d.ts.map +1 -0
- package/dist/commands/platform-problem.js +12 -0
- package/dist/commands/platform-problem.js.map +1 -0
- package/dist/commands/read-image-fit.d.ts +16 -0
- package/dist/commands/read-image-fit.d.ts.map +1 -0
- package/dist/commands/read-image-fit.js +26 -0
- package/dist/commands/read-image-fit.js.map +1 -0
- package/dist/commands/remote-content-hint.d.ts +6 -0
- package/dist/commands/remote-content-hint.d.ts.map +1 -0
- package/dist/commands/remote-content-hint.js +37 -0
- package/dist/commands/remote-content-hint.js.map +1 -0
- package/dist/commands/report-entries.d.ts +94 -0
- package/dist/commands/report-entries.d.ts.map +1 -0
- package/dist/commands/report-entries.js +384 -0
- package/dist/commands/report-entries.js.map +1 -0
- package/dist/commands/run-browser.d.ts +128 -0
- package/dist/commands/run-browser.d.ts.map +1 -0
- package/dist/commands/run-browser.js +210 -0
- package/dist/commands/run-browser.js.map +1 -0
- package/dist/commands/run-cli.d.ts +125 -0
- package/dist/commands/run-cli.d.ts.map +1 -0
- package/dist/commands/run-cli.js +656 -0
- package/dist/commands/run-cli.js.map +1 -0
- package/dist/commands/run-output.d.ts +78 -0
- package/dist/commands/run-output.d.ts.map +1 -0
- package/dist/commands/run-output.js +71 -0
- package/dist/commands/run-output.js.map +1 -0
- package/dist/commands/run-report.d.ts +147 -0
- package/dist/commands/run-report.d.ts.map +1 -0
- package/dist/commands/run-report.js +137 -0
- package/dist/commands/run-report.js.map +1 -0
- package/dist/commands/run-selection.d.ts +191 -0
- package/dist/commands/run-selection.d.ts.map +1 -0
- package/dist/commands/run-selection.js +150 -0
- package/dist/commands/run-selection.js.map +1 -0
- package/dist/commands/run-snapshots.d.ts +272 -0
- package/dist/commands/run-snapshots.d.ts.map +1 -0
- package/dist/commands/run-snapshots.js +354 -0
- package/dist/commands/run-snapshots.js.map +1 -0
- package/dist/commands/same-address.d.ts +6 -0
- package/dist/commands/same-address.d.ts.map +1 -0
- package/dist/commands/same-address.js +32 -0
- package/dist/commands/same-address.js.map +1 -0
- package/dist/commands/select-stories.d.ts +40 -0
- package/dist/commands/select-stories.d.ts.map +1 -0
- package/dist/commands/select-stories.js +15 -0
- package/dist/commands/select-stories.js.map +1 -0
- package/dist/commands/shard-share.d.ts +41 -0
- package/dist/commands/shard-share.d.ts.map +1 -0
- package/dist/commands/shard-share.js +61 -0
- package/dist/commands/shard-share.js.map +1 -0
- package/dist/commands/snapshot-result.d.ts +165 -0
- package/dist/commands/snapshot-result.d.ts.map +1 -0
- package/dist/commands/snapshot-result.js +135 -0
- package/dist/commands/snapshot-result.js.map +1 -0
- package/dist/commands/stop-message.d.ts +65 -0
- package/dist/commands/stop-message.d.ts.map +1 -0
- package/dist/commands/stop-message.js +186 -0
- package/dist/commands/stop-message.js.map +1 -0
- package/dist/commands/stopped-run.d.ts +116 -0
- package/dist/commands/stopped-run.d.ts.map +1 -0
- package/dist/commands/stopped-run.js +103 -0
- package/dist/commands/stopped-run.js.map +1 -0
- package/dist/commands/story-run.d.ts +196 -0
- package/dist/commands/story-run.d.ts.map +1 -0
- package/dist/commands/story-run.js +258 -0
- package/dist/commands/story-run.js.map +1 -0
- package/dist/commands/take-snapshot.d.ts +27 -0
- package/dist/commands/take-snapshot.d.ts.map +1 -0
- package/dist/commands/take-snapshot.js +16 -0
- package/dist/commands/take-snapshot.js.map +1 -0
- package/dist/commands/test-plan.d.ts +100 -0
- package/dist/commands/test-plan.d.ts.map +1 -0
- package/dist/commands/test-plan.js +66 -0
- package/dist/commands/test-plan.js.map +1 -0
- package/dist/commands/test-snapshot.d.ts +52 -0
- package/dist/commands/test-snapshot.d.ts.map +1 -0
- package/dist/commands/test-snapshot.js +183 -0
- package/dist/commands/test-snapshot.js.map +1 -0
- package/dist/commands/update-baselines.d.ts +93 -0
- package/dist/commands/update-baselines.d.ts.map +1 -0
- package/dist/commands/update-baselines.js +120 -0
- package/dist/commands/update-baselines.js.map +1 -0
- package/dist/commands/update-snapshot.d.ts +69 -0
- package/dist/commands/update-snapshot.d.ts.map +1 -0
- package/dist/commands/update-snapshot.js +214 -0
- package/dist/commands/update-snapshot.js.map +1 -0
- package/dist/commands/update-story.d.ts +70 -0
- package/dist/commands/update-story.d.ts.map +1 -0
- package/dist/commands/update-story.js +64 -0
- package/dist/commands/update-story.js.map +1 -0
- package/dist/commands/warm-browser.d.ts +43 -0
- package/dist/commands/warm-browser.d.ts.map +1 -0
- package/dist/commands/warm-browser.js +192 -0
- package/dist/commands/warm-browser.js.map +1 -0
- package/dist/config/addon-image-folders.d.ts +13 -0
- package/dist/config/addon-image-folders.d.ts.map +1 -0
- package/dist/config/addon-image-folders.js +7 -0
- package/dist/config/addon-image-folders.js.map +1 -0
- package/dist/config/checks.d.ts +108 -0
- package/dist/config/checks.d.ts.map +1 -0
- package/dist/config/checks.js +190 -0
- package/dist/config/checks.js.map +1 -0
- package/dist/config/config-error.d.ts +23 -0
- package/dist/config/config-error.d.ts.map +1 -0
- package/dist/config/config-error.js +23 -0
- package/dist/config/config-error.js.map +1 -0
- package/dist/config/config-thread.d.ts +25 -0
- package/dist/config/config-thread.d.ts.map +1 -0
- package/dist/config/config-thread.js +73 -0
- package/dist/config/config-thread.js.map +1 -0
- package/dist/config/define-config.d.ts +192 -0
- package/dist/config/define-config.d.ts.map +1 -0
- package/dist/config/define-config.js +9 -0
- package/dist/config/define-config.js.map +1 -0
- package/dist/config/evaluate-config.d.ts +6 -0
- package/dist/config/evaluate-config.d.ts.map +1 -0
- package/dist/config/evaluate-config.js +39 -0
- package/dist/config/evaluate-config.js.map +1 -0
- package/dist/config/find-config.d.ts +35 -0
- package/dist/config/find-config.d.ts.map +1 -0
- package/dist/config/find-config.js +71 -0
- package/dist/config/find-config.js.map +1 -0
- package/dist/config/find-storybook-url-problem.d.ts +29 -0
- package/dist/config/find-storybook-url-problem.d.ts.map +1 -0
- package/dist/config/find-storybook-url-problem.js +34 -0
- package/dist/config/find-storybook-url-problem.js.map +1 -0
- package/dist/config/is-ci.d.ts +7 -0
- package/dist/config/is-ci.d.ts.map +1 -0
- package/dist/config/is-ci.js +10 -0
- package/dist/config/is-ci.js.map +1 -0
- package/dist/config/load-config.d.ts +72 -0
- package/dist/config/load-config.d.ts.map +1 -0
- package/dist/config/load-config.js +95 -0
- package/dist/config/load-config.js.map +1 -0
- package/dist/config/load-storybook-config.d.ts +71 -0
- package/dist/config/load-storybook-config.d.ts.map +1 -0
- package/dist/config/load-storybook-config.js +104 -0
- package/dist/config/load-storybook-config.js.map +1 -0
- package/dist/config/mode-rules.d.ts +42 -0
- package/dist/config/mode-rules.d.ts.map +1 -0
- package/dist/config/mode-rules.js +188 -0
- package/dist/config/mode-rules.js.map +1 -0
- package/dist/config/read-config-afresh.d.ts +13 -0
- package/dist/config/read-config-afresh.d.ts.map +1 -0
- package/dist/config/read-config-afresh.js +28 -0
- package/dist/config/read-config-afresh.js.map +1 -0
- package/dist/config/resolve-config.d.ts +162 -0
- package/dist/config/resolve-config.d.ts.map +1 -0
- package/dist/config/resolve-config.js +181 -0
- package/dist/config/resolve-config.js.map +1 -0
- package/dist/config/story-options.d.ts +69 -0
- package/dist/config/story-options.d.ts.map +1 -0
- package/dist/config/story-options.js +174 -0
- package/dist/config/story-options.js.map +1 -0
- package/dist/config/validate-config.d.ts +9 -0
- package/dist/config/validate-config.d.ts.map +1 -0
- package/dist/config/validate-config.js +185 -0
- package/dist/config/validate-config.js.map +1 -0
- package/dist/container/browser-container.d.ts +57 -0
- package/dist/container/browser-container.d.ts.map +1 -0
- package/dist/container/browser-container.js +112 -0
- package/dist/container/browser-container.js.map +1 -0
- package/dist/container/container-error.d.ts +47 -0
- package/dist/container/container-error.d.ts.map +1 -0
- package/dist/container/container-error.js +43 -0
- package/dist/container/container-error.js.map +1 -0
- package/dist/container/docker-probe.d.ts +37 -0
- package/dist/container/docker-probe.d.ts.map +1 -0
- package/dist/container/docker-probe.js +85 -0
- package/dist/container/docker-probe.js.map +1 -0
- package/dist/container/image-pull.d.ts +11 -0
- package/dist/container/image-pull.d.ts.map +1 -0
- package/dist/container/image-pull.js +40 -0
- package/dist/container/image-pull.js.map +1 -0
- package/dist/container/inside-container.d.ts +8 -0
- package/dist/container/inside-container.d.ts.map +1 -0
- package/dist/container/inside-container.js +11 -0
- package/dist/container/inside-container.js.map +1 -0
- package/dist/container/launch-through-proxy.d.ts +16 -0
- package/dist/container/launch-through-proxy.d.ts.map +1 -0
- package/dist/container/launch-through-proxy.js +51 -0
- package/dist/container/launch-through-proxy.js.map +1 -0
- package/dist/container/own-container.d.ts +12 -0
- package/dist/container/own-container.d.ts.map +1 -0
- package/dist/container/own-container.js +61 -0
- package/dist/container/own-container.js.map +1 -0
- package/dist/container/proxy-reach.d.ts +19 -0
- package/dist/container/proxy-reach.d.ts.map +1 -0
- package/dist/container/proxy-reach.js +101 -0
- package/dist/container/proxy-reach.js.map +1 -0
- package/dist/container/run-docker.d.ts +11 -0
- package/dist/container/run-docker.d.ts.map +1 -0
- package/dist/container/run-docker.js +61 -0
- package/dist/container/run-docker.js.map +1 -0
- package/dist/container/socks-proxy.d.ts +28 -0
- package/dist/container/socks-proxy.d.ts.map +1 -0
- package/dist/container/socks-proxy.js +335 -0
- package/dist/container/socks-proxy.js.map +1 -0
- package/dist/docs-site/docs-url.d.ts +7 -0
- package/dist/docs-site/docs-url.d.ts.map +1 -0
- package/dist/docs-site/docs-url.js +13 -0
- package/dist/docs-site/docs-url.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/init/addon-question.d.ts +99 -0
- package/dist/init/addon-question.d.ts.map +1 -0
- package/dist/init/addon-question.js +111 -0
- package/dist/init/addon-question.js.map +1 -0
- package/dist/init/closing-message.d.ts +182 -0
- package/dist/init/closing-message.d.ts.map +1 -0
- package/dist/init/closing-message.js +189 -0
- package/dist/init/closing-message.js.map +1 -0
- package/dist/init/detect-project.d.ts +111 -0
- package/dist/init/detect-project.d.ts.map +1 -0
- package/dist/init/detect-project.js +166 -0
- package/dist/init/detect-project.js.map +1 -0
- package/dist/init/existing-config.d.ts +68 -0
- package/dist/init/existing-config.d.ts.map +1 -0
- package/dist/init/existing-config.js +149 -0
- package/dist/init/existing-config.js.map +1 -0
- package/dist/init/find-storybooks.d.ts +93 -0
- package/dist/init/find-storybooks.d.ts.map +1 -0
- package/dist/init/find-storybooks.js +165 -0
- package/dist/init/find-storybooks.js.map +1 -0
- package/dist/init/init-checks.d.ts +49 -0
- package/dist/init/init-checks.d.ts.map +1 -0
- package/dist/init/init-checks.js +151 -0
- package/dist/init/init-checks.js.map +1 -0
- package/dist/init/install.d.ts +286 -0
- package/dist/init/install.d.ts.map +1 -0
- package/dist/init/install.js +226 -0
- package/dist/init/install.js.map +1 -0
- package/dist/init/list-of.d.ts +10 -0
- package/dist/init/list-of.d.ts.map +1 -0
- package/dist/init/list-of.js +18 -0
- package/dist/init/list-of.js.map +1 -0
- package/dist/init/package-manager.d.ts +214 -0
- package/dist/init/package-manager.d.ts.map +1 -0
- package/dist/init/package-manager.js +308 -0
- package/dist/init/package-manager.js.map +1 -0
- package/dist/init/package-scripts.d.ts +72 -0
- package/dist/init/package-scripts.d.ts.map +1 -0
- package/dist/init/package-scripts.js +29 -0
- package/dist/init/package-scripts.js.map +1 -0
- package/dist/init/prompter.d.ts +143 -0
- package/dist/init/prompter.d.ts.map +1 -0
- package/dist/init/prompter.js +65 -0
- package/dist/init/prompter.js.map +1 -0
- package/dist/init/questions.d.ts +144 -0
- package/dist/init/questions.d.ts.map +1 -0
- package/dist/init/questions.js +342 -0
- package/dist/init/questions.js.map +1 -0
- package/dist/init/run-command.d.ts +27 -0
- package/dist/init/run-command.d.ts.map +1 -0
- package/dist/init/run-command.js +63 -0
- package/dist/init/run-command.js.map +1 -0
- package/dist/init/run-init.d.ts +133 -0
- package/dist/init/run-init.d.ts.map +1 -0
- package/dist/init/run-init.js +330 -0
- package/dist/init/run-init.js.map +1 -0
- package/dist/init/segment.d.ts +60 -0
- package/dist/init/segment.d.ts.map +1 -0
- package/dist/init/segment.js +54 -0
- package/dist/init/segment.js.map +1 -0
- package/dist/init/setup-files.d.ts +85 -0
- package/dist/init/setup-files.d.ts.map +1 -0
- package/dist/init/setup-files.js +191 -0
- package/dist/init/setup-files.js.map +1 -0
- package/dist/init/setup-progress.d.ts +46 -0
- package/dist/init/setup-progress.d.ts.map +1 -0
- package/dist/init/setup-progress.js +36 -0
- package/dist/init/setup-progress.js.map +1 -0
- package/dist/init/skill-setup.d.ts +55 -0
- package/dist/init/skill-setup.d.ts.map +1 -0
- package/dist/init/skill-setup.js +47 -0
- package/dist/init/skill-setup.js.map +1 -0
- package/dist/init/storybook-scripts.d.ts +47 -0
- package/dist/init/storybook-scripts.d.ts.map +1 -0
- package/dist/init/storybook-scripts.js +114 -0
- package/dist/init/storybook-scripts.js.map +1 -0
- package/dist/init/storybook-start.d.ts +145 -0
- package/dist/init/storybook-start.d.ts.map +1 -0
- package/dist/init/storybook-start.js +109 -0
- package/dist/init/storybook-start.js.map +1 -0
- package/dist/init/unlisted-dependencies.d.ts +75 -0
- package/dist/init/unlisted-dependencies.d.ts.map +1 -0
- package/dist/init/unlisted-dependencies.js +142 -0
- package/dist/init/unlisted-dependencies.js.map +1 -0
- package/dist/init/workspace-packages.d.ts +58 -0
- package/dist/init/workspace-packages.d.ts.map +1 -0
- package/dist/init/workspace-packages.js +86 -0
- package/dist/init/workspace-packages.js.map +1 -0
- package/dist/init/workspace.d.ts +109 -0
- package/dist/init/workspace.d.ts.map +1 -0
- package/dist/init/workspace.js +433 -0
- package/dist/init/workspace.js.map +1 -0
- package/dist/report/display-path.d.ts +7 -0
- package/dist/report/display-path.d.ts.map +1 -0
- package/dist/report/display-path.js +10 -0
- package/dist/report/display-path.js.map +1 -0
- package/dist/report/report-document.d.ts +682 -0
- package/dist/report/report-document.d.ts.map +1 -0
- package/dist/report/report-document.js +90 -0
- package/dist/report/report-document.js.map +1 -0
- package/dist/report/report-folder.d.ts +102 -0
- package/dist/report/report-folder.d.ts.map +1 -0
- package/dist/report/report-folder.js +160 -0
- package/dist/report/report-folder.js.map +1 -0
- package/dist/reporter/counts-line.d.ts +14 -0
- package/dist/reporter/counts-line.d.ts.map +1 -0
- package/dist/reporter/counts-line.js +18 -0
- package/dist/reporter/counts-line.js.map +1 -0
- package/dist/reporter/duration.d.ts +8 -0
- package/dist/reporter/duration.d.ts.map +1 -0
- package/dist/reporter/duration.js +18 -0
- package/dist/reporter/duration.js.map +1 -0
- package/dist/reporter/end-block.d.ts +42 -0
- package/dist/reporter/end-block.d.ts.map +1 -0
- package/dist/reporter/end-block.js +121 -0
- package/dist/reporter/end-block.js.map +1 -0
- package/dist/reporter/log-reporter.d.ts +10 -0
- package/dist/reporter/log-reporter.d.ts.map +1 -0
- package/dist/reporter/log-reporter.js +23 -0
- package/dist/reporter/log-reporter.js.map +1 -0
- package/dist/reporter/reporter-choice.d.ts +27 -0
- package/dist/reporter/reporter-choice.d.ts.map +1 -0
- package/dist/reporter/reporter-choice.js +12 -0
- package/dist/reporter/reporter-choice.js.map +1 -0
- package/dist/reporter/run-event.d.ts +90 -0
- package/dist/reporter/run-event.d.ts.map +1 -0
- package/dist/reporter/run-event.js +2 -0
- package/dist/reporter/run-event.js.map +1 -0
- package/dist/sharding/shard.d.ts +17 -0
- package/dist/sharding/shard.d.ts.map +1 -0
- package/dist/sharding/shard.js +2 -0
- package/dist/sharding/shard.js.map +1 -0
- package/dist/sharding/split-stories-files.d.ts +43 -0
- package/dist/sharding/split-stories-files.d.ts.map +1 -0
- package/dist/sharding/split-stories-files.js +70 -0
- package/dist/sharding/split-stories-files.js.map +1 -0
- package/dist/step-summary/step-summary.d.ts +45 -0
- package/dist/step-summary/step-summary.d.ts.map +1 -0
- package/dist/step-summary/step-summary.js +263 -0
- package/dist/step-summary/step-summary.js.map +1 -0
- package/dist/storybook/options-encoding.d.ts +115 -0
- package/dist/storybook/options-encoding.d.ts.map +1 -0
- package/dist/storybook/options-encoding.js +117 -0
- package/dist/storybook/options-encoding.js.map +1 -0
- package/dist/storybook/options-read.d.ts +146 -0
- package/dist/storybook/options-read.d.ts.map +1 -0
- package/dist/storybook/options-read.js +192 -0
- package/dist/storybook/options-read.js.map +1 -0
- package/dist/storybook/preview-script.d.ts +172 -0
- package/dist/storybook/preview-script.d.ts.map +1 -0
- package/dist/storybook/preview-script.js +804 -0
- package/dist/storybook/preview-script.js.map +1 -0
- package/dist/storybook/read-stories.d.ts +72 -0
- package/dist/storybook/read-stories.d.ts.map +1 -0
- package/dist/storybook/read-stories.js +317 -0
- package/dist/storybook/read-stories.js.map +1 -0
- package/dist/storybook/stories-matchers.d.ts +39 -0
- package/dist/storybook/stories-matchers.d.ts.map +1 -0
- package/dist/storybook/stories-matchers.js +149 -0
- package/dist/storybook/stories-matchers.js.map +1 -0
- package/dist/storybook/storybook-error.d.ts +24 -0
- package/dist/storybook/storybook-error.d.ts.map +1 -0
- package/dist/storybook/storybook-error.js +24 -0
- package/dist/storybook/storybook-error.js.map +1 -0
- package/dist/storybook/storybook-version.d.ts +62 -0
- package/dist/storybook/storybook-version.d.ts.map +1 -0
- package/dist/storybook/storybook-version.js +105 -0
- package/dist/storybook/storybook-version.js.map +1 -0
- package/dist/storybook/test-path.d.ts +19 -0
- package/dist/storybook/test-path.d.ts.map +1 -0
- package/dist/storybook/test-path.js +47 -0
- package/dist/storybook/test-path.js.map +1 -0
- package/dist/storybook/wait-hook.d.ts +64 -0
- package/dist/storybook/wait-hook.d.ts.map +1 -0
- package/dist/storybook/wait-hook.js +50 -0
- package/dist/storybook/wait-hook.js.map +1 -0
- package/dist/system-error/system-reason.d.ts +8 -0
- package/dist/system-error/system-reason.d.ts.map +1 -0
- package/dist/system-error/system-reason.js +15 -0
- package/dist/system-error/system-reason.js.map +1 -0
- package/dist/terminal-ui/answered-line.d.ts +21 -0
- package/dist/terminal-ui/answered-line.d.ts.map +1 -0
- package/dist/terminal-ui/answered-line.js +12 -0
- package/dist/terminal-ui/answered-line.js.map +1 -0
- package/dist/terminal-ui/brand-header.d.ts +21 -0
- package/dist/terminal-ui/brand-header.d.ts.map +1 -0
- package/dist/terminal-ui/brand-header.js +12 -0
- package/dist/terminal-ui/brand-header.js.map +1 -0
- package/dist/terminal-ui/checklist-question.d.ts +26 -0
- package/dist/terminal-ui/checklist-question.d.ts.map +1 -0
- package/dist/terminal-ui/checklist-question.js +62 -0
- package/dist/terminal-ui/checklist-question.js.map +1 -0
- package/dist/terminal-ui/choice-line.d.ts +29 -0
- package/dist/terminal-ui/choice-line.d.ts.map +1 -0
- package/dist/terminal-ui/choice-line.js +13 -0
- package/dist/terminal-ui/choice-line.js.map +1 -0
- package/dist/terminal-ui/coloured-text.d.ts +19 -0
- package/dist/terminal-ui/coloured-text.d.ts.map +1 -0
- package/dist/terminal-ui/coloured-text.js +16 -0
- package/dist/terminal-ui/coloured-text.js.map +1 -0
- package/dist/terminal-ui/confirm-question.d.ts +8 -0
- package/dist/terminal-ui/confirm-question.d.ts.map +1 -0
- package/dist/terminal-ui/confirm-question.js +44 -0
- package/dist/terminal-ui/confirm-question.js.map +1 -0
- package/dist/terminal-ui/init-screen.d.ts +23 -0
- package/dist/terminal-ui/init-screen.d.ts.map +1 -0
- package/dist/terminal-ui/init-screen.js +74 -0
- package/dist/terminal-ui/init-screen.js.map +1 -0
- package/dist/terminal-ui/init-view-state.d.ts +294 -0
- package/dist/terminal-ui/init-view-state.d.ts.map +1 -0
- package/dist/terminal-ui/init-view-state.js +148 -0
- package/dist/terminal-ui/init-view-state.js.map +1 -0
- package/dist/terminal-ui/init-view.d.ts +70 -0
- package/dist/terminal-ui/init-view.d.ts.map +1 -0
- package/dist/terminal-ui/init-view.js +128 -0
- package/dist/terminal-ui/init-view.js.map +1 -0
- package/dist/terminal-ui/live-screen.d.ts +22 -0
- package/dist/terminal-ui/live-screen.d.ts.map +1 -0
- package/dist/terminal-ui/live-screen.js +41 -0
- package/dist/terminal-ui/live-screen.js.map +1 -0
- package/dist/terminal-ui/live-view-state.d.ts +64 -0
- package/dist/terminal-ui/live-view-state.d.ts.map +1 -0
- package/dist/terminal-ui/live-view-state.js +54 -0
- package/dist/terminal-ui/live-view-state.js.map +1 -0
- package/dist/terminal-ui/live-view.d.ts +37 -0
- package/dist/terminal-ui/live-view.d.ts.map +1 -0
- package/dist/terminal-ui/live-view.js +67 -0
- package/dist/terminal-ui/live-view.js.map +1 -0
- package/dist/terminal-ui/message-line.d.ts +31 -0
- package/dist/terminal-ui/message-line.d.ts.map +1 -0
- package/dist/terminal-ui/message-line.js +79 -0
- package/dist/terminal-ui/message-line.js.map +1 -0
- package/dist/terminal-ui/output-tail.d.ts +29 -0
- package/dist/terminal-ui/output-tail.d.ts.map +1 -0
- package/dist/terminal-ui/output-tail.js +52 -0
- package/dist/terminal-ui/output-tail.js.map +1 -0
- package/dist/terminal-ui/progress-bar.d.ts +47 -0
- package/dist/terminal-ui/progress-bar.d.ts.map +1 -0
- package/dist/terminal-ui/progress-bar.js +23 -0
- package/dist/terminal-ui/progress-bar.js.map +1 -0
- package/dist/terminal-ui/question-header.d.ts +23 -0
- package/dist/terminal-ui/question-header.d.ts.map +1 -0
- package/dist/terminal-ui/question-header.js +24 -0
- package/dist/terminal-ui/question-header.js.map +1 -0
- package/dist/terminal-ui/question.d.ts +85 -0
- package/dist/terminal-ui/question.d.ts.map +1 -0
- package/dist/terminal-ui/question.js +77 -0
- package/dist/terminal-ui/question.js.map +1 -0
- package/dist/terminal-ui/select-question.d.ts +19 -0
- package/dist/terminal-ui/select-question.d.ts.map +1 -0
- package/dist/terminal-ui/select-question.js +24 -0
- package/dist/terminal-ui/select-question.js.map +1 -0
- package/dist/terminal-ui/spinner.d.ts +26 -0
- package/dist/terminal-ui/spinner.d.ts.map +1 -0
- package/dist/terminal-ui/spinner.js +39 -0
- package/dist/terminal-ui/spinner.js.map +1 -0
- package/dist/terminal-ui/step-list.d.ts +36 -0
- package/dist/terminal-ui/step-list.d.ts.map +1 -0
- package/dist/terminal-ui/step-list.js +122 -0
- package/dist/terminal-ui/step-list.js.map +1 -0
- package/dist/terminal-ui/summary.d.ts +20 -0
- package/dist/terminal-ui/summary.d.ts.map +1 -0
- package/dist/terminal-ui/summary.js +96 -0
- package/dist/terminal-ui/summary.js.map +1 -0
- package/dist/terminal-ui/text-input.d.ts +65 -0
- package/dist/terminal-ui/text-input.d.ts.map +1 -0
- package/dist/terminal-ui/text-input.js +72 -0
- package/dist/terminal-ui/text-input.js.map +1 -0
- package/dist/terminal-ui/text-question.d.ts +18 -0
- package/dist/terminal-ui/text-question.d.ts.map +1 -0
- package/dist/terminal-ui/text-question.js +60 -0
- package/dist/terminal-ui/text-question.js.map +1 -0
- package/dist/terminal-ui/theme.d.ts +106 -0
- package/dist/terminal-ui/theme.d.ts.map +1 -0
- package/dist/terminal-ui/theme.js +97 -0
- package/dist/terminal-ui/theme.js.map +1 -0
- package/dist/terminal-ui/wrapped-lines.d.ts +15 -0
- package/dist/terminal-ui/wrapped-lines.d.ts.map +1 -0
- package/dist/terminal-ui/wrapped-lines.js +105 -0
- package/dist/terminal-ui/wrapped-lines.js.map +1 -0
- package/dist/terminal-ui/wrapped-segments.d.ts +27 -0
- package/dist/terminal-ui/wrapped-segments.d.ts.map +1 -0
- package/dist/terminal-ui/wrapped-segments.js +37 -0
- package/dist/terminal-ui/wrapped-segments.js.map +1 -0
- package/dist/terminal-ui/wrapped-text.d.ts +21 -0
- package/dist/terminal-ui/wrapped-text.d.ts.map +1 -0
- package/dist/terminal-ui/wrapped-text.js +11 -0
- package/dist/terminal-ui/wrapped-text.js.map +1 -0
- package/dist/visual-diff/diff-thread.d.ts +27 -0
- package/dist/visual-diff/diff-thread.d.ts.map +1 -0
- package/dist/visual-diff/diff-thread.js +233 -0
- package/dist/visual-diff/diff-thread.js.map +1 -0
- package/dist/visual-diff/visual-diff.d.ts +259 -0
- package/dist/visual-diff/visual-diff.d.ts.map +1 -0
- package/dist/visual-diff/visual-diff.js +317 -0
- package/dist/visual-diff/visual-diff.js.map +1 -0
- package/fallow-graph.json +1 -0
- package/package.json +61 -3
- package/skill/SKILL.md +92 -0
- package/skill/scripts/run.mjs +1532 -0
- package/README.md +0 -3
|
@@ -0,0 +1,656 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { dirname, resolve } from 'node:path';
|
|
3
|
+
import { findReachedFilesWithFallow } from '../affected-stories/fallow-graph.js';
|
|
4
|
+
import { InvalidBaseError } from '../affected-stories/git-changes.js';
|
|
5
|
+
import { refreshSkill, skillRefreshLinesOf } from '../agent-skill/refresh-skill.js';
|
|
6
|
+
import { checkBrowserPackage } from '../browser/browser-package.js';
|
|
7
|
+
import { ConfigError } from '../config/config-error.js';
|
|
8
|
+
import { locateConfig } from '../config/find-config.js';
|
|
9
|
+
import { isCi } from '../config/is-ci.js';
|
|
10
|
+
import { loadConfig } from '../config/load-config.js';
|
|
11
|
+
import { probeDocker } from '../container/docker-probe.js';
|
|
12
|
+
import { isInsideContainer } from '../container/inside-container.js';
|
|
13
|
+
import { listProjectFiles } from '../init/find-storybooks.js';
|
|
14
|
+
import { defaultsPrompter } from '../init/prompter.js';
|
|
15
|
+
import { createRunCommand } from '../init/run-command.js';
|
|
16
|
+
import { runInit } from '../init/run-init.js';
|
|
17
|
+
import { plainSetupProgress } from '../init/setup-progress.js';
|
|
18
|
+
import { findUnlistedDependencies } from '../init/unlisted-dependencies.js';
|
|
19
|
+
import { clearReport, ReportError, reportFolderOf, writeReportJson } from '../report/report-folder.js';
|
|
20
|
+
import { testEndLinesOf } from '../reporter/end-block.js';
|
|
21
|
+
import { logReporterOf } from '../reporter/log-reporter.js';
|
|
22
|
+
import { reporterOf } from '../reporter/reporter-choice.js';
|
|
23
|
+
import { appendStepSummary, StepSummaryError } from '../step-summary/step-summary.js';
|
|
24
|
+
import { readStoriesMatchers } from '../storybook/stories-matchers.js';
|
|
25
|
+
import { checkStorybooks } from './check-storybooks.js';
|
|
26
|
+
import { createLaunchBrowser } from './launch-browser.js';
|
|
27
|
+
import { parseCommandLine, UsageError } from './parse-command-line.js';
|
|
28
|
+
import { placeBrowser, workerCountOf } from './place-browser.js';
|
|
29
|
+
import { reportLineOf, runOutputOf } from './run-output.js';
|
|
30
|
+
import { testReportFor, updateReportFor } from './run-report.js';
|
|
31
|
+
import { effectiveSelectionOf, workOutRequiredStorybooks, workOutRunSelection, } from './run-selection.js';
|
|
32
|
+
import { runSnapshots } from './run-snapshots.js';
|
|
33
|
+
import { reportProblemOf } from './stop-message.js';
|
|
34
|
+
import { crashedBy, stoppedBy, stoppedTestOf, stoppedUpdateOf, usageFailureOf } from './stopped-run.js';
|
|
35
|
+
import { ciUpdateRefusal } from './update-baselines.js';
|
|
36
|
+
import { defaultRecaptureDelayMs } from './update-snapshot.js';
|
|
37
|
+
/**
|
|
38
|
+
* The help text `--help` prints.
|
|
39
|
+
*/
|
|
40
|
+
const helpText = `Usage: visual-check <command> [options]
|
|
41
|
+
|
|
42
|
+
Commands:
|
|
43
|
+
init Set up visual-check in this project
|
|
44
|
+
test Capture snapshots and compare them with baselines
|
|
45
|
+
update Write missing and failing baselines and delete orphans (local only)
|
|
46
|
+
|
|
47
|
+
Options for test and update:
|
|
48
|
+
--affected Cover the stories the changed files can alter (default without CI)
|
|
49
|
+
--all Cover every story (default in CI)
|
|
50
|
+
--filter <regex> Cover every story whose ID matches
|
|
51
|
+
--base <ref> Measure changed files from the merge base with this ref
|
|
52
|
+
--storybook <name> Cover only this Storybook
|
|
53
|
+
--url <url> Use this URL for the Storybook (with several Storybooks, needs --storybook)
|
|
54
|
+
--config <path> Use this config instead of searching for one
|
|
55
|
+
--consistency Only check for missing baselines, orphans and stories files that fail to load (test only)
|
|
56
|
+
--workers <n> Capture with this many workers
|
|
57
|
+
--shard <k>/<n> Run one shard's share of the stories files (test only)
|
|
58
|
+
--reporter <name> live (default in a terminal), log (default in CI or without one), or json for the report's JSON
|
|
59
|
+
document on stdout
|
|
60
|
+
|
|
61
|
+
Options for init:
|
|
62
|
+
--yes Take every default
|
|
63
|
+
|
|
64
|
+
Other options:
|
|
65
|
+
--help Show this help
|
|
66
|
+
--version Show the version
|
|
67
|
+
`;
|
|
68
|
+
/**
|
|
69
|
+
* Runs the CLI with the given arguments, environment and folder, and returns what it prints on each stream. Progress is
|
|
70
|
+
* written as it happens, through `options.progress`, and so are a `test` or `update` run's header and snapshot lines,
|
|
71
|
+
* through `options.write`, or drawn on stdout by the `live` reporter; the result holds the rest, which comes after
|
|
72
|
+
* them. `update` also writes and deletes baselines, `test` writes the report folder, and `init` writes the setup files
|
|
73
|
+
* and runs the package manager. Problems with the command line, the config, the run's setup or the browser exit with
|
|
74
|
+
* code 2. A usage error of a `test` command line, even one whose flags fail to parse, writes its error report beside
|
|
75
|
+
* the config the run would load. Once a `test` or `update` has loaded its config, an error that is a bug exits 2 too,
|
|
76
|
+
* with its stack trace on stderr, as an error report for `test` and an error document with `--reporter json`. Other
|
|
77
|
+
* errors are thrown. Whenever `GITHUB_STEP_SUMMARY` is set, every `test` and `update` run, a usage error that names one
|
|
78
|
+
* included, appends its step summary to the file it names, whatever the reporter.
|
|
79
|
+
*
|
|
80
|
+
* @public
|
|
81
|
+
*/
|
|
82
|
+
export async function runCli(commandLineArguments, environment, cwd, options = {}) {
|
|
83
|
+
try {
|
|
84
|
+
const commandLine = parseCommandLine(commandLineArguments);
|
|
85
|
+
switch (commandLine.command) {
|
|
86
|
+
case 'help':
|
|
87
|
+
return { exitCode: 0, stdout: helpText, stderr: '' };
|
|
88
|
+
case 'version':
|
|
89
|
+
return { exitCode: 0, stdout: `${readCliManifest().version}\n`, stderr: '' };
|
|
90
|
+
case 'init':
|
|
91
|
+
return await runInitCommand(commandLine.options.yes, environment, cwd, options);
|
|
92
|
+
case 'test':
|
|
93
|
+
case 'update':
|
|
94
|
+
return await withStepSummary(await runTestOrUpdate(commandLine.command, commandLine.options, environment, cwd, options), environment, cwd);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
catch (error) {
|
|
98
|
+
if (error instanceof UsageError) {
|
|
99
|
+
return await withStepSummary(await usageFailureOf(error, cwd, readCliManifest().version), environment, cwd);
|
|
100
|
+
}
|
|
101
|
+
throw error;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Runs `test` or `update` after the checks that come first: `update` runs only locally, the browser package is
|
|
106
|
+
* installed and readable, the config is found, valid and usable, the browser has a place to run (inside visual-check's
|
|
107
|
+
* image when its marker fits the browser package and the platform, else on the host for `platform: 'host'` when Chrome
|
|
108
|
+
* for Testing builds for the machine, else in a container), Docker answers `docker info` with a running engine of Linux
|
|
109
|
+
* containers when the browser runs in a container, every required Storybook has a supported `storybook` version
|
|
110
|
+
* installed, and every required Storybook answers with an index. In a container, the browser reaches a Storybook by
|
|
111
|
+
* the route the five rules give, from the container the CLI runs in, Docker's engine and the OS. Then it reads and
|
|
112
|
+
* checks the per-story options of every story each required Storybook's index lists, whatever the selection.
|
|
113
|
+
*
|
|
114
|
+
* With no selection flag, a run covers the affected stories, unless the `CI` environment variable says it's in CI or
|
|
115
|
+
* it's a shard, when it covers every story without reading git or the graph. A run that covers the affected stories
|
|
116
|
+
* traces the changed files once, before any Storybook is reached; a `--base` that names no commit stops it there with
|
|
117
|
+
* exit 2. Locally, it then requires only the Storybooks a changed file reaches, and a note after the header names the
|
|
118
|
+
* ones it leaves out, which it never reaches; with no changed file that counts, it requires none and exits 0. Any
|
|
119
|
+
* other run, an affected one in CI included, requires every Storybook in it. Affected stories are then worked out for
|
|
120
|
+
* every required Storybook, before anything is captured: when git or the graph can't answer, the run covers every
|
|
121
|
+
* story, with a warning on stderr that says why; when no story is affected, a note after the header says so and hints
|
|
122
|
+
* at `--all`. The report's `selection` says what picked the stories, with the base, the number of changed files and
|
|
123
|
+
* why it fell back.
|
|
124
|
+
*
|
|
125
|
+
* `test` then runs the consistency check of every required Storybook, reports each missing baseline, each story whose
|
|
126
|
+
* stories file failed to load and each orphan it finds, whatever the selection, and exits 1 when it finds any. Locally,
|
|
127
|
+
* and in CI when it finds nothing, it captures the selected stories that aren't disabled. When the `CI` environment
|
|
128
|
+
* variable says the run is in CI, a `test` whose check finds anything prints the check's findings and exits 1 without
|
|
129
|
+
* capturing. `test --consistency` stops after the check, in CI or not: it captures nothing, prints the check's output,
|
|
130
|
+
* and exits 0 when it finds nothing, else 1. `test --shard k/n` takes only its share of the stories files, worked out
|
|
131
|
+
* from each Storybook's index and baselines folder, and runs no consistency check. `update` captures the selected
|
|
132
|
+
* stories that aren't disabled and the snapshots outside the selection whose baselines are missing, then deletes the
|
|
133
|
+
* orphans of the required Storybooks. A finished `update` ends stderr with a warning for the hosts its stories send
|
|
134
|
+
* real network requests to and the hosts whose remote content they show, grouped by host with the first story IDs of
|
|
135
|
+
* each. The config's `silenceHosts` leaves hosts out. `test` never watches requests. The warning never changes the exit
|
|
136
|
+
* code.
|
|
137
|
+
*
|
|
138
|
+
* Right after the config loads, `test` clears the report folder, `.visual-check/report` beside the config file; one it
|
|
139
|
+
* can't clear exits 2. Every `test` that exits 0 or 1, `test --consistency`, a CI stop and each shard included, then
|
|
140
|
+
* writes `report.json` there and gives the report's path, relative to the folder the CLI runs in, as the report line
|
|
141
|
+
* for stdout. Each of them that captured, so neither `test --consistency` nor a CI stop, ends stdout with its end
|
|
142
|
+
* block, built from the report: its failures, its flaky snapshots, and its counts with how long the run took, counted
|
|
143
|
+
* from the start of the run by `now`. A `test` that exits 2 with its config found, or named by the config error,
|
|
144
|
+
* replaces the folder with a `report.json` holding only the error, naming the Storybooks where nothing answers, and
|
|
145
|
+
* gives the report line for stderr; with no config found, or when the report folder itself is what failed, nothing is
|
|
146
|
+
* written. With `--reporter json`, stdout then holds the error document alone. `update` never touches the report
|
|
147
|
+
* folder. With `--reporter json`, its stdout holds its own document alone, the error document when it exits 2. Whatever
|
|
148
|
+
* the command and exit code, `--reporter json` moves the human lines to stderr, before what the run prints there. An
|
|
149
|
+
* error that is a bug, once the config loads, ends the run as a problem would, with its stack trace and its message.
|
|
150
|
+
*
|
|
151
|
+
* Locally, before anything else, it rewrites an agent skill another CLI version installed beside the config, naming
|
|
152
|
+
* the files on stderr; in CI it never touches the skill.
|
|
153
|
+
*
|
|
154
|
+
* @throws {Error} Any error besides the problems that stop the run with exit 2, before the config loads.
|
|
155
|
+
*/
|
|
156
|
+
async function runTestOrUpdate(command, parsed, environment, cwd, cliOptions) {
|
|
157
|
+
const now = cliOptions.now ?? (() => performance.now());
|
|
158
|
+
const startedAt = now();
|
|
159
|
+
const elapsedMs = () => now() - startedAt;
|
|
160
|
+
const ci = isCi(environment);
|
|
161
|
+
const options = {
|
|
162
|
+
...parsed,
|
|
163
|
+
selection: effectiveSelectionOf(parsed.selection, {
|
|
164
|
+
ci,
|
|
165
|
+
sharded: parsed.shard !== undefined,
|
|
166
|
+
consistencyOnly: parsed.consistency,
|
|
167
|
+
}),
|
|
168
|
+
reporter: reporterOf(parsed.reporter, { ci, tty: cliOptions.tty ?? process.stdout.isTTY === true }),
|
|
169
|
+
};
|
|
170
|
+
const kept = { stdout: '', stderr: '' };
|
|
171
|
+
const write = cliOptions.write ??
|
|
172
|
+
((stream, text) => {
|
|
173
|
+
kept[stream] += text;
|
|
174
|
+
});
|
|
175
|
+
const outcome = command === 'update' && ci
|
|
176
|
+
? stoppedBy(`${ciUpdateRefusal}\n`, { configPath: undefined, storybooks: [] })
|
|
177
|
+
: await runOutcomeOf({ command, options, environment, cwd, cliOptions, ci, elapsedMs, write });
|
|
178
|
+
if ('finished' in outcome) {
|
|
179
|
+
return withKept(kept, outcome.finished);
|
|
180
|
+
}
|
|
181
|
+
if (command === 'update') {
|
|
182
|
+
return withKept(kept, stoppedUpdateOf(outcome.stopped, { version: readCliManifest().version, options }));
|
|
183
|
+
}
|
|
184
|
+
return withKept(kept, await stoppedTestOf(outcome.stopped, { version: readCliManifest().version, cwd, options }));
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Starts each stream of the result with the text the run's reporter wrote to it as it happened and that was kept,
|
|
188
|
+
* since the CLI's caller gave no `write`.
|
|
189
|
+
*/
|
|
190
|
+
function withKept(kept, result) {
|
|
191
|
+
return { ...result, stdout: `${kept.stdout}${result.stdout}`, stderr: `${kept.stderr}${result.stderr}` };
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Appends the step summary of the report or document the run built to the file `GITHUB_STEP_SUMMARY` names, relative
|
|
195
|
+
* to `cwd`, when it is set, and gives the CLI's result. A summary that can't be written adds a warning to stderr and
|
|
196
|
+
* leaves the exit code as it is.
|
|
197
|
+
*
|
|
198
|
+
* @throws {Error} Any error besides a `StepSummaryError`.
|
|
199
|
+
*/
|
|
200
|
+
async function withStepSummary(result, environment, cwd) {
|
|
201
|
+
const { report, ...cliResult } = result;
|
|
202
|
+
const path = environment.GITHUB_STEP_SUMMARY;
|
|
203
|
+
if (report === undefined || path === undefined || path === '') {
|
|
204
|
+
return cliResult;
|
|
205
|
+
}
|
|
206
|
+
try {
|
|
207
|
+
await appendStepSummary(resolve(cwd, path), report);
|
|
208
|
+
}
|
|
209
|
+
catch (error) {
|
|
210
|
+
if (error instanceof StepSummaryError) {
|
|
211
|
+
// The path as the environment gives it, which the person set, rather than the resolved one.
|
|
212
|
+
const warning = `Warning: visual-check couldn't write the GitHub step summary to ${path}: ${error.reason}. ` +
|
|
213
|
+
"The run's result is unchanged.\n";
|
|
214
|
+
return { ...cliResult, stderr: `${cliResult.stderr}${warning}` };
|
|
215
|
+
}
|
|
216
|
+
throw error;
|
|
217
|
+
}
|
|
218
|
+
return cliResult;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Locally, rewrites the agent skill installed beside the config the run would load when another CLI version wrote it,
|
|
222
|
+
* and writes what it did on stderr as it happens. In CI it reads and writes nothing.
|
|
223
|
+
*/
|
|
224
|
+
function refreshInstalledSkill(context) {
|
|
225
|
+
if (context.ci) {
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
const configPath = locateConfig(context.cwd, context.options.config);
|
|
229
|
+
if (configPath === undefined) {
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
const refresh = refreshSkill(dirname(configPath), readCliManifest().version);
|
|
233
|
+
if (refresh !== undefined) {
|
|
234
|
+
context.write('stderr', skillRefreshLinesOf(refresh, context.cwd)
|
|
235
|
+
.map((line) => `${line}\n`)
|
|
236
|
+
.join(''));
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Runs `test` or `update` as `runTestOrUpdate` says, and gives how it ended. Once the config loads, an error that is
|
|
241
|
+
* a bug stops the run too, with its stack trace and its message.
|
|
242
|
+
*
|
|
243
|
+
* @throws {Error} Any error besides the problems that stop the run with exit 2, before the config loads.
|
|
244
|
+
*/
|
|
245
|
+
async function runOutcomeOf(context) {
|
|
246
|
+
refreshInstalledSkill(context);
|
|
247
|
+
const browserCheck = checkBrowserPackage(context.environment);
|
|
248
|
+
if ('problem' in browserCheck) {
|
|
249
|
+
return stoppedBy(browserCheck.problem, {
|
|
250
|
+
configPath: locateConfig(context.cwd, context.options.config),
|
|
251
|
+
storybooks: [],
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
const loaded = await loadedConfigOf(context);
|
|
255
|
+
if ('stopped' in loaded) {
|
|
256
|
+
return loaded;
|
|
257
|
+
}
|
|
258
|
+
try {
|
|
259
|
+
return await configuredOutcomeOf(context, loaded.config, browserCheck.browserPackage);
|
|
260
|
+
}
|
|
261
|
+
catch (error) {
|
|
262
|
+
// A bug once the config loaded still leaves test's error report and prints the error document.
|
|
263
|
+
return crashedBy(error, {
|
|
264
|
+
stdout: '',
|
|
265
|
+
stderr: '',
|
|
266
|
+
configPath: loaded.config.path,
|
|
267
|
+
storybooks: loaded.config.storybooks,
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Loads the run's config, or gives the stop a `ConfigError` makes, naming the config when it was found.
|
|
273
|
+
*
|
|
274
|
+
* @throws {Error} Any error besides a `ConfigError`.
|
|
275
|
+
*/
|
|
276
|
+
async function loadedConfigOf(context) {
|
|
277
|
+
try {
|
|
278
|
+
return { config: await loadConfig(loadConfigOptionsOf(context.options, context.ci, context.cwd)) };
|
|
279
|
+
}
|
|
280
|
+
catch (error) {
|
|
281
|
+
if (error instanceof ConfigError) {
|
|
282
|
+
return stoppedBy(`${error.message}\n`, { configPath: error.configPath, storybooks: [] });
|
|
283
|
+
}
|
|
284
|
+
throw error;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Runs `test` or `update` once its config is loaded: clears the report folder for `test`, places the browser, works
|
|
289
|
+
* out the Storybooks the run requires and checks them, then takes the snapshots.
|
|
290
|
+
*
|
|
291
|
+
* @throws {Error} Any error besides the problems that stop the run with exit 2.
|
|
292
|
+
*/
|
|
293
|
+
async function configuredOutcomeOf(context, config, browserPackage) {
|
|
294
|
+
const inRun = { configPath: config.path, storybooks: config.storybooks };
|
|
295
|
+
const clearProblem = await clearReportProblemOf(context.command, config, context.cwd);
|
|
296
|
+
if (clearProblem !== undefined) {
|
|
297
|
+
return stoppedBy(clearProblem, { ...inRun, configPath: undefined });
|
|
298
|
+
}
|
|
299
|
+
const insideContainer = insideContainerOf(context.cliOptions, context.environment);
|
|
300
|
+
const placement = await placeBrowser(config, browserPackage, insideContainer, context.cliOptions);
|
|
301
|
+
if ('problem' in placement) {
|
|
302
|
+
return stoppedBy(placement.problem, inRun);
|
|
303
|
+
}
|
|
304
|
+
const required = await requiredStorybooksOfRun(context, config);
|
|
305
|
+
if ('stopped' in required) {
|
|
306
|
+
return required;
|
|
307
|
+
}
|
|
308
|
+
const checks = await checkStorybooks(required.required, context.cwd);
|
|
309
|
+
const warnings = checks.warnings.map((warning) => `${warning}\n`).join('');
|
|
310
|
+
if ('problems' in checks) {
|
|
311
|
+
const problems = checks.problems.map((problem) => `${problem}\n`).join('');
|
|
312
|
+
return {
|
|
313
|
+
stopped: {
|
|
314
|
+
...inRun,
|
|
315
|
+
storybooks: required.required,
|
|
316
|
+
stdout: '',
|
|
317
|
+
stderr: `${warnings}${problems}`,
|
|
318
|
+
message: problems,
|
|
319
|
+
unreachable: checks.unreachable,
|
|
320
|
+
},
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
return await snapshotsOutcomeOf(context, config, {
|
|
324
|
+
browserPackage,
|
|
325
|
+
insideContainer,
|
|
326
|
+
placement,
|
|
327
|
+
storybooks: checks.storybooks,
|
|
328
|
+
warnings,
|
|
329
|
+
traced: required.traced,
|
|
330
|
+
leftOut: required.leftOut,
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Works out the Storybooks the run requires, as `workOutRequiredStorybooks` says, finding what the changed files reach
|
|
335
|
+
* with the caller's `findReachedFiles`, else with Fallow, and reading the stories globs with the caller's
|
|
336
|
+
* `readStoriesMatchers`. Gives the stop of a `--base` that names no commit.
|
|
337
|
+
*
|
|
338
|
+
* @throws {Error} Any error besides an `InvalidBaseError`.
|
|
339
|
+
*/
|
|
340
|
+
async function requiredStorybooksOfRun(context, config) {
|
|
341
|
+
try {
|
|
342
|
+
return await workOutRequiredStorybooks({
|
|
343
|
+
selection: context.options.selection,
|
|
344
|
+
ci: context.ci,
|
|
345
|
+
baseRef: context.options.baseRef,
|
|
346
|
+
environment: context.environment,
|
|
347
|
+
cwd: context.cwd,
|
|
348
|
+
storybooks: config.storybooks,
|
|
349
|
+
baselinesFolders: config.baselinesFolders,
|
|
350
|
+
configPath: config.path,
|
|
351
|
+
affected: config.affected,
|
|
352
|
+
findReachedFiles: context.cliOptions.findReachedFiles ?? findReachedFilesWithFallow,
|
|
353
|
+
readStoriesMatchers: context.cliOptions.readStoriesMatchers ?? readStoriesMatchers,
|
|
354
|
+
});
|
|
355
|
+
}
|
|
356
|
+
catch (error) {
|
|
357
|
+
if (error instanceof InvalidBaseError) {
|
|
358
|
+
return stoppedBy(`${error.message}\n`, { configPath: config.path, storybooks: config.storybooks });
|
|
359
|
+
}
|
|
360
|
+
throw error;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* Works out the stories the run takes, then takes the snapshots as `selectedOutcomeOf` says. Gives the stop of a run
|
|
365
|
+
* that stopped with exit 2. An error that is a bug, once the stories are worked out, stops the run after the warnings,
|
|
366
|
+
* with how it picked them.
|
|
367
|
+
*
|
|
368
|
+
* @throws {Error} Any error besides the problems that stop the run with exit 2, before the stories are worked out.
|
|
369
|
+
*/
|
|
370
|
+
async function snapshotsOutcomeOf(context, config, checked) {
|
|
371
|
+
const selection = await workOutRunSelection({
|
|
372
|
+
selection: context.options.selection,
|
|
373
|
+
storybooks: checked.storybooks,
|
|
374
|
+
required: checked,
|
|
375
|
+
});
|
|
376
|
+
try {
|
|
377
|
+
return await selectedOutcomeOf(context, config, checked, selection);
|
|
378
|
+
}
|
|
379
|
+
catch (error) {
|
|
380
|
+
// A bug once the stories are worked out still leaves test's error report with how the run picked them.
|
|
381
|
+
return crashedBy(error, {
|
|
382
|
+
stdout: '',
|
|
383
|
+
stderr: `${checked.warnings}${selection.warning}`,
|
|
384
|
+
configPath: config.path,
|
|
385
|
+
storybooks: checked.storybooks.map(({ storybook }) => storybook),
|
|
386
|
+
selection: selection.report,
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* Takes the snapshots of the stories the run takes, with the run's reporter showing their progress as it happens and
|
|
392
|
+
* ended once they are taken, then for `test` writes the report of a run that exits 0 or 1, and for `update` prints its
|
|
393
|
+
* document with `--reporter json`. Gives the stop of a run that stopped with exit 2.
|
|
394
|
+
*
|
|
395
|
+
* @throws {Error} Any error besides the problems that stop the run with exit 2.
|
|
396
|
+
*/
|
|
397
|
+
async function selectedOutcomeOf(context, config, checked, selection) {
|
|
398
|
+
const { command, options } = context;
|
|
399
|
+
const version = readCliManifest().version;
|
|
400
|
+
const warnings = `${checked.warnings}${selection.warning}`;
|
|
401
|
+
const reporter = await runReporterOf(context);
|
|
402
|
+
let result;
|
|
403
|
+
try {
|
|
404
|
+
result = await runSnapshots({
|
|
405
|
+
command,
|
|
406
|
+
version,
|
|
407
|
+
ci: context.ci,
|
|
408
|
+
consistencyOnly: options.consistency,
|
|
409
|
+
shard: options.shard,
|
|
410
|
+
config,
|
|
411
|
+
workers: workerCountOf(options.workers ?? config.workers, checked.placement.host),
|
|
412
|
+
place: checked.placement.place,
|
|
413
|
+
browserPackage: checked.browserPackage,
|
|
414
|
+
selections: selection.selections,
|
|
415
|
+
selectionNotes: selection.notes,
|
|
416
|
+
cwd: context.cwd,
|
|
417
|
+
insideContainer: checked.insideContainer,
|
|
418
|
+
environment: context.environment,
|
|
419
|
+
...runDefaultsOf(context.cliOptions),
|
|
420
|
+
events: (event) => reporter.event(event),
|
|
421
|
+
});
|
|
422
|
+
}
|
|
423
|
+
catch (error) {
|
|
424
|
+
// The run's error says what went wrong, so a reporter that also fails to end can't hide it.
|
|
425
|
+
await reporter.finish().catch(() => undefined);
|
|
426
|
+
throw error;
|
|
427
|
+
}
|
|
428
|
+
await reporter.finish();
|
|
429
|
+
if ('stopMessage' in result) {
|
|
430
|
+
return {
|
|
431
|
+
stopped: {
|
|
432
|
+
// The lines of the snapshots that finished before the stop are already written.
|
|
433
|
+
stdout: '',
|
|
434
|
+
stderr: `${warnings}${result.stderr}`,
|
|
435
|
+
message: result.stopMessage,
|
|
436
|
+
// The report folder that failed can't take an error report either.
|
|
437
|
+
configPath: result.reportFailed ? undefined : config.path,
|
|
438
|
+
storybooks: checked.storybooks.map(({ storybook }) => storybook),
|
|
439
|
+
unreachable: [],
|
|
440
|
+
selection: selection.report,
|
|
441
|
+
},
|
|
442
|
+
};
|
|
443
|
+
}
|
|
444
|
+
const output = { stdout: result.stdout, stderr: `${warnings}${result.stderr}` };
|
|
445
|
+
const facts = {
|
|
446
|
+
version,
|
|
447
|
+
configPath: config.path,
|
|
448
|
+
selection: selection.report,
|
|
449
|
+
storybooks: checked.storybooks.map(({ storybook }) => storybook),
|
|
450
|
+
exitCode: result.exitCode,
|
|
451
|
+
findings: result.findings,
|
|
452
|
+
};
|
|
453
|
+
if (command === 'update') {
|
|
454
|
+
// update writes no report.json: its document is for --reporter json and the step summary.
|
|
455
|
+
return {
|
|
456
|
+
finished: {
|
|
457
|
+
exitCode: result.exitCode,
|
|
458
|
+
...runOutputOf(output, updateReportFor(facts), options.reporter, undefined),
|
|
459
|
+
},
|
|
460
|
+
};
|
|
461
|
+
}
|
|
462
|
+
return await withTestReport({ exitCode: result.exitCode, ...output }, context, { ...facts, consistencyOnly: options.consistency, shard: options.shard }, result.checkedOnly);
|
|
463
|
+
}
|
|
464
|
+
/**
|
|
465
|
+
* Starts the reporter that shows the run's progress stream as it happens. `live` draws it on stdout in the terminal
|
|
466
|
+
* UI, which it loads only then. `log` and `json` write the `log` lines through the run's `write`: on stdout, or on
|
|
467
|
+
* stderr with `--reporter json`, whose stdout holds its document alone.
|
|
468
|
+
*/
|
|
469
|
+
async function runReporterOf(context) {
|
|
470
|
+
if (context.options.reporter === 'live') {
|
|
471
|
+
// Loaded only here, so log and json never load React and Ink.
|
|
472
|
+
const { startLiveView } = await import('../terminal-ui/live-view.js');
|
|
473
|
+
return startLiveView({ environment: context.environment, stdout: process.stdout, elapsedMs: context.elapsedMs });
|
|
474
|
+
}
|
|
475
|
+
const stream = context.options.reporter === 'json' ? 'stderr' : 'stdout';
|
|
476
|
+
return logReporterOf((text) => context.write(stream, text));
|
|
477
|
+
}
|
|
478
|
+
/**
|
|
479
|
+
* Clears the report folder beside the config for `test`, so an old report never lingers. Gives what to print when it
|
|
480
|
+
* can't. `update` never touches the folder.
|
|
481
|
+
*
|
|
482
|
+
* @throws {Error} Any error besides a `ReportError`.
|
|
483
|
+
*/
|
|
484
|
+
async function clearReportProblemOf(command, config, cwd) {
|
|
485
|
+
if (command === 'update') {
|
|
486
|
+
return undefined;
|
|
487
|
+
}
|
|
488
|
+
try {
|
|
489
|
+
await clearReport(reportFolderOf(config.path));
|
|
490
|
+
}
|
|
491
|
+
catch (error) {
|
|
492
|
+
if (error instanceof ReportError) {
|
|
493
|
+
return reportProblemOf(error, cwd);
|
|
494
|
+
}
|
|
495
|
+
throw error;
|
|
496
|
+
}
|
|
497
|
+
return undefined;
|
|
498
|
+
}
|
|
499
|
+
/**
|
|
500
|
+
* Writes the report of a `test` that exits 0 or 1, then, unless the run stopped after its consistency check, ends
|
|
501
|
+
* stdout with the end block built from the report: the failures, the flaky snapshots, and the counts with how long the
|
|
502
|
+
* run took. It gives the report's path as the report line for stdout. With `--reporter json` stdout holds the report's
|
|
503
|
+
* JSON document alone, the human lines, the end block included, move to stderr, and the report line is for stderr.
|
|
504
|
+
* When the report can't be written, the run stops with exit 2 with what went wrong after its stderr, and no error
|
|
505
|
+
* report is written. An error that is a bug stops it too, after what it printed.
|
|
506
|
+
*/
|
|
507
|
+
async function withTestReport(result, context, facts, checkedOnly) {
|
|
508
|
+
const { cwd } = context;
|
|
509
|
+
const folder = reportFolderOf(facts.configPath);
|
|
510
|
+
try {
|
|
511
|
+
const report = await testReportFor(facts);
|
|
512
|
+
await writeReportJson(folder, report);
|
|
513
|
+
const endLines = checkedOnly
|
|
514
|
+
? []
|
|
515
|
+
: testEndLinesOf(report, { cwd, configFolder: dirname(facts.configPath), elapsedMs: context.elapsedMs() });
|
|
516
|
+
const output = { stdout: `${result.stdout}${endLines.map((line) => `${line}\n`).join('')}`, stderr: result.stderr };
|
|
517
|
+
return {
|
|
518
|
+
finished: {
|
|
519
|
+
...result,
|
|
520
|
+
...runOutputOf(output, report, context.options.reporter, { stream: 'stdout', text: reportLineOf(cwd, folder) }),
|
|
521
|
+
},
|
|
522
|
+
};
|
|
523
|
+
}
|
|
524
|
+
catch (error) {
|
|
525
|
+
if (error instanceof ReportError) {
|
|
526
|
+
const problem = reportProblemOf(error, cwd);
|
|
527
|
+
return {
|
|
528
|
+
stopped: {
|
|
529
|
+
stdout: result.stdout,
|
|
530
|
+
stderr: `${result.stderr}${problem}`,
|
|
531
|
+
message: problem,
|
|
532
|
+
configPath: undefined,
|
|
533
|
+
storybooks: facts.storybooks,
|
|
534
|
+
unreachable: [],
|
|
535
|
+
selection: facts.selection,
|
|
536
|
+
},
|
|
537
|
+
};
|
|
538
|
+
}
|
|
539
|
+
return crashedBy(error, {
|
|
540
|
+
...result,
|
|
541
|
+
configPath: facts.configPath,
|
|
542
|
+
storybooks: facts.storybooks,
|
|
543
|
+
selection: facts.selection,
|
|
544
|
+
});
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
/**
|
|
548
|
+
* Gives what the CLI's caller can give a `test` or `update` run once its checks have passed, each with its default
|
|
549
|
+
* when the caller gives none: the OS, how the browser is launched, how long `update` waits before it captures a page
|
|
550
|
+
* again, and where progress goes.
|
|
551
|
+
*/
|
|
552
|
+
function runDefaultsOf(cliOptions) {
|
|
553
|
+
return {
|
|
554
|
+
os: cliOptions.os ?? process.platform,
|
|
555
|
+
launchBrowser: cliOptions.launchBrowser ?? createLaunchBrowser(),
|
|
556
|
+
recaptureDelayMs: cliOptions.recaptureDelayMs ?? defaultRecaptureDelayMs,
|
|
557
|
+
progress: cliOptions.progress ?? (() => undefined),
|
|
558
|
+
};
|
|
559
|
+
}
|
|
560
|
+
/**
|
|
561
|
+
* Whether the run is inside a container: the option when a test gives it, else what the environment and the root's
|
|
562
|
+
* marker files say.
|
|
563
|
+
*/
|
|
564
|
+
function insideContainerOf(cliOptions, environment) {
|
|
565
|
+
return cliOptions.insideContainer ?? isInsideContainer(environment);
|
|
566
|
+
}
|
|
567
|
+
/**
|
|
568
|
+
* Builds the options for `loadConfig`, leaving out each flag that isn't given.
|
|
569
|
+
*/
|
|
570
|
+
function loadConfigOptionsOf(options, ci, cwd) {
|
|
571
|
+
return {
|
|
572
|
+
cwd,
|
|
573
|
+
ci,
|
|
574
|
+
...(options.config === undefined ? {} : { path: options.config }),
|
|
575
|
+
...(options.storybook === undefined ? {} : { storybook: options.storybook }),
|
|
576
|
+
...(options.url === undefined ? {} : { url: options.url }),
|
|
577
|
+
};
|
|
578
|
+
}
|
|
579
|
+
/**
|
|
580
|
+
* Reads the version and the browser package's peer range from the CLI's `package.json`.
|
|
581
|
+
*/
|
|
582
|
+
function readCliManifest() {
|
|
583
|
+
const manifest = JSON.parse(readFileSync(new URL('../../package.json', import.meta.url), 'utf8'));
|
|
584
|
+
return { version: manifest.version, browserRange: manifest.peerDependencies['@visual-check/chromium'] };
|
|
585
|
+
}
|
|
586
|
+
/**
|
|
587
|
+
* Runs `init`. In a terminal, unless the caller gives a prompter, it loads the terminal UI, which asks the questions,
|
|
588
|
+
* shows the steps and the end of the run, so the result carries only the exit code. Elsewhere it runs with the
|
|
589
|
+
* caller's prompter, else the one that takes every default, and plain progress, and the result carries the text,
|
|
590
|
+
* without the messages and the summary only the terminal UI shows.
|
|
591
|
+
*
|
|
592
|
+
* @throws Any error `runInit` throws, after the terminal UI has stopped drawing.
|
|
593
|
+
*/
|
|
594
|
+
async function runInitCommand(yes, environment, cwd, cliOptions) {
|
|
595
|
+
const interactive = cliOptions.interactive ?? isTerminal(environment);
|
|
596
|
+
if (!interactive || cliOptions.prompter !== undefined) {
|
|
597
|
+
const prompter = cliOptions.prompter ?? defaultsPrompter();
|
|
598
|
+
const progress = plainSetupProgress(cliOptions.progress ?? (() => undefined));
|
|
599
|
+
const { exitCode, stdout, stderr } = await runInit(cwd, initToolsOf(yes, { interactive, prompter, progress }, cliOptions));
|
|
600
|
+
return { exitCode, stdout, stderr };
|
|
601
|
+
}
|
|
602
|
+
// Loaded only here, so `test` and `update` never load init's view.
|
|
603
|
+
const { startInitView } = await import('../terminal-ui/init-view.js');
|
|
604
|
+
const view = startInitView({
|
|
605
|
+
version: readCliManifest().version,
|
|
606
|
+
yes,
|
|
607
|
+
environment,
|
|
608
|
+
stdin: process.stdin,
|
|
609
|
+
stdout: process.stdout,
|
|
610
|
+
});
|
|
611
|
+
let result;
|
|
612
|
+
try {
|
|
613
|
+
result = await runInit(cwd, initToolsOf(yes, { interactive, prompter: view, progress: view.progress }, cliOptions));
|
|
614
|
+
}
|
|
615
|
+
catch (error) {
|
|
616
|
+
await view.finish({ exitCode: 2, stdout: '', stderr: '', messages: [] });
|
|
617
|
+
throw error;
|
|
618
|
+
}
|
|
619
|
+
await view.finish(result);
|
|
620
|
+
return { exitCode: result.exitCode, stdout: '', stderr: '' };
|
|
621
|
+
}
|
|
622
|
+
/**
|
|
623
|
+
* Whether the CLI runs in a terminal a person answers in: standard input and standard output are TTYs, and the `CI`
|
|
624
|
+
* environment variable doesn't say this is a CI run.
|
|
625
|
+
*/
|
|
626
|
+
function isTerminal(environment) {
|
|
627
|
+
return process.stdin.isTTY === true && process.stdout.isTTY === true && !isCi(environment);
|
|
628
|
+
}
|
|
629
|
+
/**
|
|
630
|
+
* Gives `init` what it runs with: how it talks to the person, then what the CLI's caller gives, else the defaults.
|
|
631
|
+
*/
|
|
632
|
+
function initToolsOf(yes, io, cliOptions) {
|
|
633
|
+
const { version, browserRange } = readCliManifest();
|
|
634
|
+
return {
|
|
635
|
+
yes,
|
|
636
|
+
...io,
|
|
637
|
+
nodeVersion: cliOptions.nodeVersion ?? process.versions.node,
|
|
638
|
+
os: cliOptions.os ?? process.platform,
|
|
639
|
+
cliVersion: version,
|
|
640
|
+
browserRange,
|
|
641
|
+
...initAdaptersOf(cliOptions, io.progress),
|
|
642
|
+
};
|
|
643
|
+
}
|
|
644
|
+
/**
|
|
645
|
+
* Gives the tools `init` reaches outside the process with: the caller's, else the ones that run Docker, git, the
|
|
646
|
+
* package manager and Fallow.
|
|
647
|
+
*/
|
|
648
|
+
function initAdaptersOf(cliOptions, progress) {
|
|
649
|
+
return {
|
|
650
|
+
probeDocker: cliOptions.probeDocker ?? probeDocker,
|
|
651
|
+
listFiles: cliOptions.listFiles ?? listProjectFiles,
|
|
652
|
+
runCommand: cliOptions.runCommand ?? createRunCommand((text) => progress.output(text)),
|
|
653
|
+
findUnlistedDependencies: cliOptions.findUnlistedDependencies ?? findUnlistedDependencies,
|
|
654
|
+
};
|
|
655
|
+
}
|
|
656
|
+
//# sourceMappingURL=run-cli.js.map
|