@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,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The stories shown in a host's line, before the line ends the list with `, …`.
|
|
3
|
+
*/
|
|
4
|
+
const listedStoryCount = 3;
|
|
5
|
+
/**
|
|
6
|
+
* Whether the entry silences the host. Both are compared in lower case. An exact entry silences the host it names, with
|
|
7
|
+
* or without a port: it matches the host as a page reports it, such as `localhost:6006`, and its hostname, such as
|
|
8
|
+
* `localhost`. `*.example.com` silences the subdomains of `example.com` at any depth, by the host or its hostname, so
|
|
9
|
+
* `*.example.com:8443` works too, but not `example.com` itself or a host that only ends the same, such as
|
|
10
|
+
* `badexample.com`.
|
|
11
|
+
*/
|
|
12
|
+
function silences(entry, host) {
|
|
13
|
+
const lowerEntry = entry.toLowerCase();
|
|
14
|
+
const lowerHost = host.toLowerCase();
|
|
15
|
+
const hostname = lowerHost.replace(/:\d+$/, '');
|
|
16
|
+
if (lowerEntry.startsWith('*.')) {
|
|
17
|
+
const suffix = lowerEntry.slice(1);
|
|
18
|
+
return lowerHost.endsWith(suffix) || hostname.endsWith(suffix);
|
|
19
|
+
}
|
|
20
|
+
return lowerEntry === lowerHost || lowerEntry === hostname;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Gives the stories of each host, once per Storybook and story, in the order the snapshots come in, each named by its
|
|
24
|
+
* ID or, with `labelled`, by its Storybook's name and ID. Hosts in `silenceHosts` are left out.
|
|
25
|
+
*/
|
|
26
|
+
function storiesByHostOf(taken, labelled, hostsOf, silenceHosts) {
|
|
27
|
+
const byHost = new Map();
|
|
28
|
+
for (const { storybook, storyId, hosts } of taken) {
|
|
29
|
+
for (const host of hostsOf(hosts)) {
|
|
30
|
+
if (silenceHosts.some((entry) => silences(entry, host))) {
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
const stories = byHost.get(host) ?? new Map();
|
|
34
|
+
stories.set(JSON.stringify([storybook, storyId]), {
|
|
35
|
+
ref: { storybook, story: storyId },
|
|
36
|
+
label: labelled ? `${storybook} ${storyId}` : storyId,
|
|
37
|
+
});
|
|
38
|
+
byHost.set(host, stories);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return byHost;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Builds one warning of `kind` for each host, sorted by host name, with every story that reached it. Its message gives
|
|
45
|
+
* the host, how many stories reach it, the first three of them, `, …` when there are more, and what `sentenceOf` says
|
|
46
|
+
* about them.
|
|
47
|
+
*/
|
|
48
|
+
function warningsOf(kind, byHost, sentenceOf) {
|
|
49
|
+
return [...byHost.entries()]
|
|
50
|
+
.sort(([first], [second]) => (first < second ? -1 : 1))
|
|
51
|
+
.map(([host, reaching]) => {
|
|
52
|
+
const stories = [...reaching.values()];
|
|
53
|
+
const shown = stories
|
|
54
|
+
.slice(0, listedStoryCount)
|
|
55
|
+
.map(({ label }) => label)
|
|
56
|
+
.join(', ');
|
|
57
|
+
const more = stories.length > listedStoryCount ? ', …' : '';
|
|
58
|
+
const count = `${stories.length} ${stories.length === 1 ? 'story' : 'stories'}`;
|
|
59
|
+
return {
|
|
60
|
+
kind,
|
|
61
|
+
host,
|
|
62
|
+
stories: stories.map(({ ref }) => ref),
|
|
63
|
+
message: `${host}: ${count} (${shown}${more})${sentenceOf(stories.length)}`,
|
|
64
|
+
};
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Builds the warnings that end a finished `update`: first one for each host the stories sent real network requests
|
|
69
|
+
* to, then one for each host whose remote content they show, each kind sorted by host name. A warning lists every
|
|
70
|
+
* distinct story, a Storybook's name with a story ID, so a story's modes count once and the same ID in two Storybooks
|
|
71
|
+
* counts twice. Its message counts them and names the first three in the order the snapshots come in, each by its ID,
|
|
72
|
+
* or, when the snapshots come from more than one Storybook, by its Storybook's name and ID, such as `web a--a`. The
|
|
73
|
+
* hosts in `silenceHosts` get no warning.
|
|
74
|
+
*/
|
|
75
|
+
export function networkWarningsOf(taken, silenceHosts) {
|
|
76
|
+
const labelled = new Set(taken.map(({ storybook }) => storybook)).size > 1;
|
|
77
|
+
const requests = storiesByHostOf(taken, labelled, (hosts) => hosts.requests, silenceHosts);
|
|
78
|
+
const remoteContent = storiesByHostOf(taken, labelled, (hosts) => hosts.remoteContent, silenceHosts);
|
|
79
|
+
return [
|
|
80
|
+
...warningsOf('real-requests', requests, (count) => `. ${count === 1 ? 'This story makes' : 'These stories make'} real network requests and may be unreliable.`),
|
|
81
|
+
...warningsOf('remote-content', remoteContent, (count) => ` ${count === 1 ? 'shows' : 'show'} remote content. ` +
|
|
82
|
+
'A CDN can serve it differently on another machine, so CI may fail.'),
|
|
83
|
+
];
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Writes the warnings as stderr ends a finished `update` with them: each message on a line of its own, ending with a
|
|
87
|
+
* newline. Gives an empty string for none.
|
|
88
|
+
*/
|
|
89
|
+
export function warningsTextOf(warnings) {
|
|
90
|
+
return warnings.map(({ message }) => `${message}\n`).join('');
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=network-warning.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"network-warning.js","sourceRoot":"","sources":["../../src/commands/network-warning.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,gBAAgB,GAAG,CAAC,CAAA;AAqB1B;;;;;;GAMG;AACH,SAAS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AAC/D,CAAC"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import type { Reporter } from '../reporter/reporter-choice.js';
|
|
2
|
+
import type { Shard } from '../sharding/shard.js';
|
|
3
|
+
/**
|
|
4
|
+
* A command line that can't be run: an unknown command or flag, a missing, empty or extra argument, a flag that doesn't
|
|
5
|
+
* apply to the command, or flags that clash.
|
|
6
|
+
*/
|
|
7
|
+
export declare class UsageError extends Error {
|
|
8
|
+
/**
|
|
9
|
+
* The class's name, so a stack trace or a log line reads `UsageError`.
|
|
10
|
+
*/
|
|
11
|
+
name: string;
|
|
12
|
+
/**
|
|
13
|
+
* The `test` or `update` run the command line asks for, with what its `--config` and `--reporter` flags give, when
|
|
14
|
+
* the error is in the flags' values or how they combine, or as far as a loose parse tells when they fail to parse.
|
|
15
|
+
* `undefined` for anything else, such as an unknown command or no command.
|
|
16
|
+
*/
|
|
17
|
+
readonly run: UsageErrorRun | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Keeps the message and the run it is about, if any.
|
|
20
|
+
*/
|
|
21
|
+
constructor(message: string, run?: UsageErrorRun);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The `test` or `update` run a command line with a usage error asks for, as far as its flags tell.
|
|
25
|
+
*/
|
|
26
|
+
export interface UsageErrorRun {
|
|
27
|
+
/**
|
|
28
|
+
* The command.
|
|
29
|
+
*/
|
|
30
|
+
command: 'test' | 'update';
|
|
31
|
+
/**
|
|
32
|
+
* The path `--config` gives, or `undefined` when the flag isn't given.
|
|
33
|
+
*/
|
|
34
|
+
config: string | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* The reporter `--reporter` names, or `undefined` when the flag isn't given or names no reporter.
|
|
37
|
+
*/
|
|
38
|
+
reporter: Reporter | undefined;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Which stories a run covers. `default` is no selection flag, which the run turns into `affected` or `all`.
|
|
42
|
+
*/
|
|
43
|
+
export type Selection = {
|
|
44
|
+
kind: 'default';
|
|
45
|
+
} | {
|
|
46
|
+
kind: 'all';
|
|
47
|
+
} | {
|
|
48
|
+
kind: 'affected';
|
|
49
|
+
} | {
|
|
50
|
+
kind: 'filter';
|
|
51
|
+
pattern: RegExp;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* The options `test` and `update` share.
|
|
55
|
+
*/
|
|
56
|
+
export interface RunOptions {
|
|
57
|
+
/**
|
|
58
|
+
* Which stories the run covers.
|
|
59
|
+
*/
|
|
60
|
+
selection: Selection;
|
|
61
|
+
/**
|
|
62
|
+
* The ref `--base` names, which the base of the affected stories is worked out from, or `undefined` when the flag
|
|
63
|
+
* isn't given.
|
|
64
|
+
*/
|
|
65
|
+
baseRef: string | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* The Storybook `--storybook` names, or `undefined` when the flag isn't given.
|
|
68
|
+
*/
|
|
69
|
+
storybook: string | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* The URL `--url` gives, or `undefined` when the flag isn't given.
|
|
72
|
+
*/
|
|
73
|
+
url: string | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* The path `--config` gives, or `undefined` when the flag isn't given.
|
|
76
|
+
*/
|
|
77
|
+
config: string | undefined;
|
|
78
|
+
/**
|
|
79
|
+
* The number of workers `--workers` gives, or `undefined` when the flag isn't given.
|
|
80
|
+
*/
|
|
81
|
+
workers: number | undefined;
|
|
82
|
+
/**
|
|
83
|
+
* Whether `--consistency` is given: `test` only runs the consistency check, over every story, and captures nothing.
|
|
84
|
+
* Always `false` for `update`.
|
|
85
|
+
*/
|
|
86
|
+
consistency: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* The shard `--shard` gives, or `undefined` when the flag isn't given. Always `undefined` for `update`.
|
|
89
|
+
*/
|
|
90
|
+
shard: Shard | undefined;
|
|
91
|
+
/**
|
|
92
|
+
* The reporter `--reporter` names, or `undefined` when the flag isn't given.
|
|
93
|
+
*/
|
|
94
|
+
reporter: Reporter | undefined;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* The options `init` takes.
|
|
98
|
+
*/
|
|
99
|
+
export interface InitOptions {
|
|
100
|
+
/**
|
|
101
|
+
* Whether `--yes` is given: `init` takes every default and asks nothing.
|
|
102
|
+
*/
|
|
103
|
+
yes: boolean;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* What the command line asks for.
|
|
107
|
+
*/
|
|
108
|
+
export type CommandLine = {
|
|
109
|
+
command: 'help';
|
|
110
|
+
} | {
|
|
111
|
+
command: 'version';
|
|
112
|
+
} | {
|
|
113
|
+
command: 'init';
|
|
114
|
+
options: InitOptions;
|
|
115
|
+
} | {
|
|
116
|
+
command: 'test' | 'update';
|
|
117
|
+
options: RunOptions;
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* Reads the command line into the command it names and its options.
|
|
121
|
+
*
|
|
122
|
+
* @throws {UsageError} For an unknown command or flag, a missing, empty or extra argument, a flag that doesn't apply to
|
|
123
|
+
* the command, flags that clash, a `--url` that isn't an http(s) URL or holds a login, two of `--all`, `--affected`
|
|
124
|
+
* and `--filter`, a `--filter` that isn't a regular expression, a `--workers` that isn't a whole number of 1 or more,
|
|
125
|
+
* `--consistency` on `update` or with `--all`, `--affected` or `--filter`, a `--reporter` that isn't `live`, `log` or
|
|
126
|
+
* `json`, a `--shard` that isn't `k/n` with 1 ≤ k ≤ n, or is on `update` or with `--consistency` or `--affected`, a
|
|
127
|
+
* `--base` with `--all`, `--filter`, `--consistency` or `--shard`, and `--yes` on `test` or `update`. Two of `--all`,
|
|
128
|
+
* `--affected` and `--filter` are reported before any other clash of a run's flags. Once the flags parse, an error of
|
|
129
|
+
* a `test` or `update` command line names its run; one whose flags fail to parse names it as far as a loose parse
|
|
130
|
+
* tells. `--help` anywhere before a `--` separator wins, so it never throws.
|
|
131
|
+
*/
|
|
132
|
+
export declare function parseCommandLine(commandLineArguments: string[]): CommandLine;
|
|
133
|
+
//# sourceMappingURL=parse-command-line.d.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IACH,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B;;;OAGG;IACH,WAAW,EAAE,OAAO,CAAA;IACpB;;OAEG;IACH,KAAK,EAAE,KAAK,GAAG,SAAS,CAAA;IACxB;;OAEG;IACH,QAAQ,EAAE,QAAQ,GAAG,SAAS,CAAA;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,GAAG,EAAE,OAAO,CAAA;CACb;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GACnB;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,GACnB;IAAE,OAAO,EAAE,SAAS,CAAA;CAAE,GACtB;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,WAAW,CAAA;CAAE,GACzC;IAAE,OAAO,EAAE,MAAM,GAAG,QAAQ,CAAC;IAAC,OAAO,EAAE,UAAU,CAAA;CAAE,CAAA;AA4UvD;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAC,oBAAoB,EAAE,MAAM,EAAE,GAAG,WAAW,CAwB5E"}
|
|
@@ -0,0 +1,425 @@
|
|
|
1
|
+
import { parseArgs } from 'node:util';
|
|
2
|
+
import { findStorybookUrlProblem, mayHoldLogin, serveStorybookFix } from '../config/find-storybook-url-problem.js';
|
|
3
|
+
/**
|
|
4
|
+
* A command line that can't be run: an unknown command or flag, a missing, empty or extra argument, a flag that doesn't
|
|
5
|
+
* apply to the command, or flags that clash.
|
|
6
|
+
*/
|
|
7
|
+
export class UsageError extends Error {
|
|
8
|
+
/**
|
|
9
|
+
* The class's name, so a stack trace or a log line reads `UsageError`.
|
|
10
|
+
*/
|
|
11
|
+
name = 'UsageError';
|
|
12
|
+
/**
|
|
13
|
+
* The `test` or `update` run the command line asks for, with what its `--config` and `--reporter` flags give, when
|
|
14
|
+
* the error is in the flags' values or how they combine, or as far as a loose parse tells when they fail to parse.
|
|
15
|
+
* `undefined` for anything else, such as an unknown command or no command.
|
|
16
|
+
*/
|
|
17
|
+
run;
|
|
18
|
+
/**
|
|
19
|
+
* Keeps the message and the run it is about, if any.
|
|
20
|
+
*/
|
|
21
|
+
constructor(message, run) {
|
|
22
|
+
super(message);
|
|
23
|
+
this.run = run;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The flags `init` doesn't take, in the order a message names the first one given.
|
|
28
|
+
*/
|
|
29
|
+
const flagsInitRejects = [
|
|
30
|
+
'all',
|
|
31
|
+
'affected',
|
|
32
|
+
'base',
|
|
33
|
+
'filter',
|
|
34
|
+
'storybook',
|
|
35
|
+
'url',
|
|
36
|
+
'config',
|
|
37
|
+
'workers',
|
|
38
|
+
'consistency',
|
|
39
|
+
'shard',
|
|
40
|
+
'reporter',
|
|
41
|
+
];
|
|
42
|
+
/**
|
|
43
|
+
* The flags that take a value, which can't be empty.
|
|
44
|
+
*/
|
|
45
|
+
const flagsWithValue = ['filter', 'base', 'storybook', 'url', 'config', 'workers', 'shard', 'reporter'];
|
|
46
|
+
/**
|
|
47
|
+
* Turns a thrown value into its message.
|
|
48
|
+
*/
|
|
49
|
+
function messageOf(error) {
|
|
50
|
+
return error instanceof Error ? error.message : String(error);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Builds the selection from `--all`, `--affected` and `--filter`.
|
|
54
|
+
*
|
|
55
|
+
* @throws {UsageError} When two of them are given, or `--filter` isn't a regular expression.
|
|
56
|
+
*/
|
|
57
|
+
function selectionOf(values) {
|
|
58
|
+
const { all, affected, filter } = values;
|
|
59
|
+
if ([all === true, affected === true, filter !== undefined].filter(Boolean).length > 1) {
|
|
60
|
+
throw new UsageError("--all, --affected and --filter can't be used together. Pick one.");
|
|
61
|
+
}
|
|
62
|
+
if (all) {
|
|
63
|
+
return { kind: 'all' };
|
|
64
|
+
}
|
|
65
|
+
if (affected) {
|
|
66
|
+
return { kind: 'affected' };
|
|
67
|
+
}
|
|
68
|
+
if (filter === undefined) {
|
|
69
|
+
return { kind: 'default' };
|
|
70
|
+
}
|
|
71
|
+
try {
|
|
72
|
+
return { kind: 'filter', pattern: new RegExp(filter) };
|
|
73
|
+
}
|
|
74
|
+
catch (error) {
|
|
75
|
+
throw new UsageError(`--filter takes a regular expression: ${messageOf(error)}`);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* The CLI's flags, as Node's argument parser takes them.
|
|
80
|
+
*/
|
|
81
|
+
const flagOptions = {
|
|
82
|
+
all: { type: 'boolean' },
|
|
83
|
+
affected: { type: 'boolean' },
|
|
84
|
+
base: { type: 'string' },
|
|
85
|
+
filter: { type: 'string' },
|
|
86
|
+
storybook: { type: 'string' },
|
|
87
|
+
url: { type: 'string' },
|
|
88
|
+
config: { type: 'string' },
|
|
89
|
+
workers: { type: 'string' },
|
|
90
|
+
consistency: { type: 'boolean' },
|
|
91
|
+
shard: { type: 'string' },
|
|
92
|
+
reporter: { type: 'string' },
|
|
93
|
+
yes: { type: 'boolean' },
|
|
94
|
+
help: { type: 'boolean' },
|
|
95
|
+
version: { type: 'boolean' },
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* Runs Node's argument parser, strictly, with the CLI's flags.
|
|
99
|
+
*/
|
|
100
|
+
function parseCommandLineArguments(commandLineArguments) {
|
|
101
|
+
return parseArgs({ args: commandLineArguments, options: flagOptions, strict: true, allowPositionals: true });
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* The flags that take a value, as a command line writes them.
|
|
105
|
+
*/
|
|
106
|
+
const valueFlags = new Set(flagsWithValue.map((flag) => `--${flag}`));
|
|
107
|
+
/**
|
|
108
|
+
* Gives the `test` or `update` run of a command line that fails to parse, as far as a loose parse tells, so a `test`
|
|
109
|
+
* still replaces its report and a run with `--reporter json` still prints its error document. A flag that takes a
|
|
110
|
+
* value counts as missing its value when the next argument is a flag. `undefined` for any other command line.
|
|
111
|
+
*/
|
|
112
|
+
function looseRunOf(commandLineArguments) {
|
|
113
|
+
const { values, positionals } = parseArgs({
|
|
114
|
+
args: commandLineArguments.map((argument, index) => valueFlags.has(argument) && commandLineArguments[index + 1]?.startsWith('-') ? `${argument}=` : argument),
|
|
115
|
+
options: flagOptions,
|
|
116
|
+
strict: false,
|
|
117
|
+
allowPositionals: true,
|
|
118
|
+
});
|
|
119
|
+
const [command] = positionals;
|
|
120
|
+
const { config, reporter } = values;
|
|
121
|
+
if (command !== 'test' && command !== 'update') {
|
|
122
|
+
return undefined;
|
|
123
|
+
}
|
|
124
|
+
// A loose parse gives `true` to a flag missing its value.
|
|
125
|
+
return {
|
|
126
|
+
command,
|
|
127
|
+
config: typeof config === 'string' && config !== '' ? config : undefined,
|
|
128
|
+
reporter: typeof reporter === 'string' && isReporter(reporter) ? reporter : undefined,
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Whether a `--help` token appears before any `--` separator, so `--help` wins over whatever else is on the line.
|
|
133
|
+
*/
|
|
134
|
+
function asksForHelp(commandLineArguments) {
|
|
135
|
+
const separatorIndex = commandLineArguments.indexOf('--');
|
|
136
|
+
return (separatorIndex === -1 ? commandLineArguments : commandLineArguments.slice(0, separatorIndex)).includes('--help');
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Checks the `--url` flag: an http(s) URL that holds no login. A message never shows a login.
|
|
140
|
+
*
|
|
141
|
+
* @throws {UsageError} When the URL isn't an http(s) URL, or holds a user name or password.
|
|
142
|
+
*/
|
|
143
|
+
function checkUrlFlag(url) {
|
|
144
|
+
if (url === undefined) {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
const problem = findStorybookUrlProblem(url);
|
|
148
|
+
if (problem === 'login') {
|
|
149
|
+
throw new UsageError("--url can't hold a user name or password. " +
|
|
150
|
+
`visual-check sends no login: ${serveStorybookFix} and point --url at that.`);
|
|
151
|
+
}
|
|
152
|
+
if (problem === 'not-http') {
|
|
153
|
+
const got = mayHoldLogin(url) ? '' : ` Got '${url}'.`;
|
|
154
|
+
throw new UsageError(`--url takes an http: or https: URL, such as 'http://127.0.0.1:6006'.${got}`);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Reads the `--workers` flag into a number: a whole number of 1 or more, written in digits.
|
|
159
|
+
*
|
|
160
|
+
* @throws {UsageError} When the value is anything else.
|
|
161
|
+
*/
|
|
162
|
+
function workersFlagOf(workers) {
|
|
163
|
+
if (workers === undefined) {
|
|
164
|
+
return undefined;
|
|
165
|
+
}
|
|
166
|
+
const count = Number(workers);
|
|
167
|
+
if (!/^[1-9]\d*$/.test(workers) || !Number.isSafeInteger(count)) {
|
|
168
|
+
throw new UsageError(`--workers takes a whole number of 1 or more. Got '${workers}'.`);
|
|
169
|
+
}
|
|
170
|
+
return count;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Reads the `--consistency` flag for `test` or `update`. It covers every story, so every flag that selects stories is
|
|
174
|
+
* rejected here: `--all`, `--affected` and `--filter`.
|
|
175
|
+
*
|
|
176
|
+
* @throws {UsageError} When it's given to `update`, or with `--all`, `--affected` or `--filter`.
|
|
177
|
+
*/
|
|
178
|
+
function consistencyFlagOf(command, values) {
|
|
179
|
+
if (!values.consistency) {
|
|
180
|
+
return false;
|
|
181
|
+
}
|
|
182
|
+
if (command === 'update') {
|
|
183
|
+
throw new UsageError('--consistency applies only to test.');
|
|
184
|
+
}
|
|
185
|
+
if (values.all || values.affected || values.filter !== undefined) {
|
|
186
|
+
throw new UsageError('--consistency covers every story, so it takes no --all, --affected or --filter. Use --storybook to narrow it.');
|
|
187
|
+
}
|
|
188
|
+
return true;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Checks the `--yes` flag for `test` or `update`, which don't take it.
|
|
192
|
+
*
|
|
193
|
+
* @throws {UsageError} When it's given.
|
|
194
|
+
*/
|
|
195
|
+
function checkYesFlag(yes) {
|
|
196
|
+
if (yes) {
|
|
197
|
+
throw new UsageError('--yes applies only to init.');
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Reads a `k/n` shard: two whole numbers of 1 or more, written in digits, with k no greater than n.
|
|
202
|
+
*/
|
|
203
|
+
function parseShard(value) {
|
|
204
|
+
const match = /^([1-9]\d*)\/([1-9]\d*)$/.exec(value);
|
|
205
|
+
if (!match) {
|
|
206
|
+
return undefined;
|
|
207
|
+
}
|
|
208
|
+
const index = Number(match[1]);
|
|
209
|
+
const total = Number(match[2]);
|
|
210
|
+
if (!Number.isSafeInteger(index) || !Number.isSafeInteger(total) || index > total) {
|
|
211
|
+
return undefined;
|
|
212
|
+
}
|
|
213
|
+
return { index, total };
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Reads the `--shard` flag for `test` into a shard: `k/n`, two whole numbers written in digits, with 1 ≤ k ≤ n.
|
|
217
|
+
* `--filter`, `--all` and `--storybook` narrow the run before the split, so they are accepted. `--consistency` runs in
|
|
218
|
+
* a job of its own, so it is rejected, and so is `--affected`: affected stories differ between machines, so the shards
|
|
219
|
+
* wouldn't agree on the split.
|
|
220
|
+
*
|
|
221
|
+
* @throws {UsageError} When it's given to `update`, with `--consistency` or with `--affected`, or the value isn't `k/n`
|
|
222
|
+
* in range.
|
|
223
|
+
*/
|
|
224
|
+
function shardFlagOf(command, values) {
|
|
225
|
+
const { shard } = values;
|
|
226
|
+
if (shard === undefined) {
|
|
227
|
+
return undefined;
|
|
228
|
+
}
|
|
229
|
+
if (command === 'update') {
|
|
230
|
+
throw new UsageError('--shard applies only to test.');
|
|
231
|
+
}
|
|
232
|
+
if (values.consistency) {
|
|
233
|
+
throw new UsageError('--consistency runs in a job of its own, so it takes no --shard.');
|
|
234
|
+
}
|
|
235
|
+
if (values.affected) {
|
|
236
|
+
throw new UsageError('--shard takes its share of every story, so it takes no --affected: the affected stories differ between machines.');
|
|
237
|
+
}
|
|
238
|
+
const parsed = parseShard(shard);
|
|
239
|
+
if (parsed === undefined) {
|
|
240
|
+
throw new UsageError(`--shard takes k/n, two whole numbers with 1 ≤ k ≤ n, such as 2/4. Got '${shard}'.`);
|
|
241
|
+
}
|
|
242
|
+
return parsed;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* The flags `--base` can't be given with, in the order a message names the first one given: each covers a run whose
|
|
246
|
+
* stories aren't the affected ones.
|
|
247
|
+
*/
|
|
248
|
+
const flagsBaseRejects = ['all', 'filter', 'consistency', 'shard'];
|
|
249
|
+
/**
|
|
250
|
+
* Reads the `--base` flag for `test` or `update`. It applies only to affected stories, so it's rejected with a flag
|
|
251
|
+
* that covers other stories. With no selection flag it's accepted, and a run in CI, which covers every story, leaves
|
|
252
|
+
* it unused.
|
|
253
|
+
*
|
|
254
|
+
* @throws {UsageError} When it's given with `--all`, `--filter`, `--consistency` or `--shard`.
|
|
255
|
+
*/
|
|
256
|
+
function baseFlagOf(values) {
|
|
257
|
+
if (values.base === undefined) {
|
|
258
|
+
return undefined;
|
|
259
|
+
}
|
|
260
|
+
const rejected = flagsBaseRejects.find((flag) => values[flag] !== undefined);
|
|
261
|
+
if (rejected !== undefined) {
|
|
262
|
+
throw new UsageError(`--base applies only to affected stories, so it takes no --${rejected}.`);
|
|
263
|
+
}
|
|
264
|
+
return values.base;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Reads the `--reporter` flag: `live`, `log` or `json`.
|
|
268
|
+
*
|
|
269
|
+
* @throws {UsageError} When the value is anything else.
|
|
270
|
+
*/
|
|
271
|
+
function reporterFlagOf(reporter) {
|
|
272
|
+
if (reporter === undefined) {
|
|
273
|
+
return undefined;
|
|
274
|
+
}
|
|
275
|
+
if (!isReporter(reporter)) {
|
|
276
|
+
throw new UsageError(`--reporter takes live, log or json. Got '${reporter}'.`);
|
|
277
|
+
}
|
|
278
|
+
return reporter;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Reads the command line into the command it names and its options.
|
|
282
|
+
*
|
|
283
|
+
* @throws {UsageError} For an unknown command or flag, a missing, empty or extra argument, a flag that doesn't apply to
|
|
284
|
+
* the command, flags that clash, a `--url` that isn't an http(s) URL or holds a login, two of `--all`, `--affected`
|
|
285
|
+
* and `--filter`, a `--filter` that isn't a regular expression, a `--workers` that isn't a whole number of 1 or more,
|
|
286
|
+
* `--consistency` on `update` or with `--all`, `--affected` or `--filter`, a `--reporter` that isn't `live`, `log` or
|
|
287
|
+
* `json`, a `--shard` that isn't `k/n` with 1 ≤ k ≤ n, or is on `update` or with `--consistency` or `--affected`, a
|
|
288
|
+
* `--base` with `--all`, `--filter`, `--consistency` or `--shard`, and `--yes` on `test` or `update`. Two of `--all`,
|
|
289
|
+
* `--affected` and `--filter` are reported before any other clash of a run's flags. Once the flags parse, an error of
|
|
290
|
+
* a `test` or `update` command line names its run; one whose flags fail to parse names it as far as a loose parse
|
|
291
|
+
* tells. `--help` anywhere before a `--` separator wins, so it never throws.
|
|
292
|
+
*/
|
|
293
|
+
export function parseCommandLine(commandLineArguments) {
|
|
294
|
+
if (asksForHelp(commandLineArguments)) {
|
|
295
|
+
return { command: 'help' };
|
|
296
|
+
}
|
|
297
|
+
let parsed;
|
|
298
|
+
try {
|
|
299
|
+
parsed = parseCommandLineArguments(commandLineArguments);
|
|
300
|
+
}
|
|
301
|
+
catch (error) {
|
|
302
|
+
throw new UsageError(messageOf(error), looseRunOf(commandLineArguments));
|
|
303
|
+
}
|
|
304
|
+
const { values, positionals } = parsed;
|
|
305
|
+
if (values.version) {
|
|
306
|
+
return { command: 'version' };
|
|
307
|
+
}
|
|
308
|
+
try {
|
|
309
|
+
return commandLineOf(values, positionals);
|
|
310
|
+
}
|
|
311
|
+
catch (error) {
|
|
312
|
+
throw withRunOf(error, positionals[0], values);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Gives the error to throw for an error of a parsed command line: a `UsageError` of `test` or `update` names its run,
|
|
317
|
+
* with what `--config` and `--reporter` give. Anything else is given back as it is.
|
|
318
|
+
*/
|
|
319
|
+
function withRunOf(error, command, values) {
|
|
320
|
+
if (!(error instanceof UsageError) || (command !== 'test' && command !== 'update')) {
|
|
321
|
+
return error;
|
|
322
|
+
}
|
|
323
|
+
return new UsageError(error.message, {
|
|
324
|
+
command,
|
|
325
|
+
config: values.config,
|
|
326
|
+
reporter: isReporter(values.reporter) ? values.reporter : undefined,
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Whether a `--reporter` value names a reporter.
|
|
331
|
+
*/
|
|
332
|
+
function isReporter(reporter) {
|
|
333
|
+
return reporter === 'live' || reporter === 'log' || reporter === 'json';
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* The commands the CLI runs.
|
|
337
|
+
*/
|
|
338
|
+
const commands = ['init', 'test', 'update'];
|
|
339
|
+
/**
|
|
340
|
+
* Whether a positional names one of the CLI's commands.
|
|
341
|
+
*/
|
|
342
|
+
function isCommand(command) {
|
|
343
|
+
return commands.includes(command);
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Says that a command is unknown, showing it unless it may hold a password.
|
|
347
|
+
*/
|
|
348
|
+
function unknownCommandMessageOf(command) {
|
|
349
|
+
const shown = mayHoldLogin(command)
|
|
350
|
+
? 'Unknown command (not shown: it may hold a password).'
|
|
351
|
+
: `Unknown command '${command}'.`;
|
|
352
|
+
return `${shown} The commands are init, test and update.`;
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* Says that an argument is unexpected, showing it unless it may hold a password.
|
|
356
|
+
*/
|
|
357
|
+
function unexpectedArgumentMessageOf(extra) {
|
|
358
|
+
return mayHoldLogin(extra)
|
|
359
|
+
? 'Unexpected argument (not shown: it may hold a password).'
|
|
360
|
+
: `Unexpected argument '${extra}'.`;
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Reads the command the positionals name, after checking that no flag that takes a value is empty.
|
|
364
|
+
*
|
|
365
|
+
* @throws {UsageError} For an empty flag value, no command, an unknown command or an extra argument.
|
|
366
|
+
*/
|
|
367
|
+
function commandOf(values, positionals) {
|
|
368
|
+
const empty = flagsWithValue.find((flag) => values[flag] === '');
|
|
369
|
+
if (empty !== undefined) {
|
|
370
|
+
throw new UsageError(`--${empty} needs a value.`);
|
|
371
|
+
}
|
|
372
|
+
const [command, extra] = positionals;
|
|
373
|
+
if (command === undefined) {
|
|
374
|
+
throw new UsageError('No command given.');
|
|
375
|
+
}
|
|
376
|
+
if (!isCommand(command)) {
|
|
377
|
+
throw new UsageError(unknownCommandMessageOf(command));
|
|
378
|
+
}
|
|
379
|
+
if (extra !== undefined) {
|
|
380
|
+
throw new UsageError(unexpectedArgumentMessageOf(extra));
|
|
381
|
+
}
|
|
382
|
+
return command;
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* Reads the parsed flags and positionals into the command they name and its options.
|
|
386
|
+
*
|
|
387
|
+
* @throws {UsageError} As `parseCommandLine` says, for anything after the flags parsed.
|
|
388
|
+
*/
|
|
389
|
+
function commandLineOf(values, positionals) {
|
|
390
|
+
const command = commandOf(values, positionals);
|
|
391
|
+
if (command === 'init') {
|
|
392
|
+
const rejected = flagsInitRejects.find((flag) => values[flag] !== undefined);
|
|
393
|
+
if (rejected !== undefined) {
|
|
394
|
+
throw new UsageError(`--${rejected} doesn't apply to init.`);
|
|
395
|
+
}
|
|
396
|
+
return { command: 'init', options: { yes: values.yes === true } };
|
|
397
|
+
}
|
|
398
|
+
return { command, options: runOptionsOf(command, values) };
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* Reads the options of `test` or `update` from the parsed flags.
|
|
402
|
+
*
|
|
403
|
+
* @throws {UsageError} As `parseCommandLine` says, for a flag of a run.
|
|
404
|
+
*/
|
|
405
|
+
function runOptionsOf(command, values) {
|
|
406
|
+
checkYesFlag(values.yes);
|
|
407
|
+
checkUrlFlag(values.url);
|
|
408
|
+
// The selection flags come first, so flags that clash with each other say so before any other flag rejects them.
|
|
409
|
+
const selection = selectionOf(values);
|
|
410
|
+
const consistency = consistencyFlagOf(command, values);
|
|
411
|
+
const shard = shardFlagOf(command, values);
|
|
412
|
+
const baseRef = baseFlagOf(values);
|
|
413
|
+
return {
|
|
414
|
+
selection,
|
|
415
|
+
baseRef,
|
|
416
|
+
storybook: values.storybook,
|
|
417
|
+
url: values.url,
|
|
418
|
+
config: values.config,
|
|
419
|
+
workers: workersFlagOf(values.workers),
|
|
420
|
+
consistency,
|
|
421
|
+
shard,
|
|
422
|
+
reporter: reporterFlagOf(values.reporter),
|
|
423
|
+
};
|
|
424
|
+
}
|
|
425
|
+
//# sourceMappingURL=parse-command-line.js.map
|