@visual-check/cli 0.0.0 → 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 -4
- package/skill/SKILL.md +92 -0
- package/skill/scripts/run.mjs +1532 -0
- package/README.md +0 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-config.js","sourceRoot":"","sources":["../../src/config/load-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE/C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzE,OAAO,EAAuB,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AA+BrD;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,IAAY,EAAE,GAAW;IACrD,OAAO,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,oBAAoB,CAAA;AACpD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,cAAsB;IACjD,MAAM,IAAI,GAAG,UAAU,CAAC,cAAc,CAAC,CAAA;IAEvC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,MAAM,IAAI,WAAW,CACnB,6FAA6F;YAC3F,sCAAsC,CACzC,CAAA;IACH,CAAC;IAED,OAAO,IAAI,CAAA;AACb,CAAC;AAED;;;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W,CAAC,CAAA;AAC3C,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAI,IAAY,EAAE,IAAsB;IACxE,IAAI,CAAC;QACH,OAAO,MAAM,IAAI,EAAE,CAAA;IACrB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,WAAW,EAAE,CAAC;YACjC,MAAM,IAAI,WAAW,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAA;QAChF,CAAC;QAED,MAAM,KAAK,CAAA;IACb,CAAC;AACH,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,OAA0B;IACzD,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,CAAA;IAE/G,OAAO,MAAM,YAAY,CAAC,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC,aAAa,CAAC,MAAM,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;AACvH,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { type ResolvedConfig, type ResolvedStorybook } from './resolve-config.js';
|
|
2
|
+
/**
|
|
3
|
+
* What `loadStorybookConfig` needs to know about the running Storybook.
|
|
4
|
+
*
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export interface StorybookConfigOptions {
|
|
8
|
+
/**
|
|
9
|
+
* The absolute path of Storybook's config folder. The search starts there.
|
|
10
|
+
*/
|
|
11
|
+
configDir: string;
|
|
12
|
+
/**
|
|
13
|
+
* Where Storybook is served. It replaces the URL the config gives.
|
|
14
|
+
*/
|
|
15
|
+
url: string;
|
|
16
|
+
/**
|
|
17
|
+
* The absolute folder Storybook runs in. Paths in messages are relative to it.
|
|
18
|
+
*/
|
|
19
|
+
cwd: string;
|
|
20
|
+
/**
|
|
21
|
+
* Whether the `CI` environment variable is set, which picks the `ci` side of every `{ local, ci }` pair.
|
|
22
|
+
*/
|
|
23
|
+
ci: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Stops loading the config, even one that never ends.
|
|
26
|
+
*/
|
|
27
|
+
signal?: AbortSignal;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The config of a running Storybook.
|
|
31
|
+
*
|
|
32
|
+
* @public
|
|
33
|
+
*/
|
|
34
|
+
export interface StorybookConfig {
|
|
35
|
+
/**
|
|
36
|
+
* The config, resolved for that Storybook alone.
|
|
37
|
+
*/
|
|
38
|
+
config: ResolvedConfig;
|
|
39
|
+
/**
|
|
40
|
+
* The Storybook, with the address it's served at as its URL.
|
|
41
|
+
*/
|
|
42
|
+
storybook: ResolvedStorybook;
|
|
43
|
+
/**
|
|
44
|
+
* The URL the config gives the Storybook for the current environment, or `undefined` when it gives none.
|
|
45
|
+
*/
|
|
46
|
+
configUrl: string | undefined;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Finds the config from a running Storybook's config folder, loads it and all it imports as they are now, and resolves
|
|
50
|
+
* it for that Storybook alone, at the address it's served at.
|
|
51
|
+
*
|
|
52
|
+
* @throws {ConfigError} When no config is found, when the config can't be loaded, when it's invalid or can't be used,
|
|
53
|
+
* when it lists no Storybook with that config folder, and when that Storybook's baselines are where the addon writes its
|
|
54
|
+
* images. Once the config is found, the error names its path as `configPath`.
|
|
55
|
+
* @throws {unknown} The signal's reason, when it aborts first.
|
|
56
|
+
*
|
|
57
|
+
* @public
|
|
58
|
+
*/
|
|
59
|
+
export declare function loadStorybookConfig(options: StorybookConfigOptions): Promise<StorybookConfig>;
|
|
60
|
+
/**
|
|
61
|
+
* Finds the config from a Storybook's config folder, loads it and all it imports as they are now, and gives the name of
|
|
62
|
+
* the first Storybook it lists with that config folder. A static build has no address, so it needs no URL.
|
|
63
|
+
*
|
|
64
|
+
* @throws {ConfigError} When no config is found, when the config can't be loaded or is invalid, and when it lists no
|
|
65
|
+
* Storybook with that config folder. Once the config is found, the error names its path as `configPath`.
|
|
66
|
+
* @throws {unknown} The signal's reason, when it aborts first.
|
|
67
|
+
*
|
|
68
|
+
* @public
|
|
69
|
+
*/
|
|
70
|
+
export declare function storybookNameOf(options: Pick<StorybookConfigOptions, 'configDir' | 'cwd' | 'signal'>): Promise<string>;
|
|
71
|
+
//# sourceMappingURL=load-storybook-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-storybook-config.d.ts","sourceRoot":"","sources":["../../src/config/load-storybook-config.ts"],"names":[],"mappings":"AAOA,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,iBAAiB,EAGvB,MAAM,qBAAqB,CAAA;AAE5B;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,EAAE,EAAE,OAAO,CAAA;IACX;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,CAAA;CACrB;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,MAAM,EAAE,cAAc,CAAA;IACtB;;OAEG;IACH,SAAS,EAAE,iBAAiB,CAAA;IAC5B;;OAEG;IACH,SAAS,EAAE,MAAM,GAAG,SAAS,CAAA;CAC9B;AA2ED;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,eAAe,CAAC,CAenG;AAED;;;;;;;;;GASG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,IAAI,CAAC,sBAAsB,EAAE,WAAW,GAAG,KAAK,GAAG,QAAQ,CAAC,GACpE,OAAO,CAAC,MAAM,CAAC,CASjB"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { realpathSync } from 'node:fs';
|
|
2
|
+
import { basename, dirname, isAbsolute, join, relative, sep } from 'node:path';
|
|
3
|
+
import { addonImageFolders } from './addon-image-folders.js';
|
|
4
|
+
import { ConfigError } from './config-error.js';
|
|
5
|
+
import { displayPathOf, namingConfig, searchConfig } from './load-config.js';
|
|
6
|
+
import { readConfigAfresh } from './read-config-afresh.js';
|
|
7
|
+
import { configDirOf, listNames, resolveConfig, urlSideOf, } from './resolve-config.js';
|
|
8
|
+
/**
|
|
9
|
+
* Returns the real path of a folder, in the letter case it has on disk. The part of it that can't be read stays as it
|
|
10
|
+
* is.
|
|
11
|
+
*/
|
|
12
|
+
function realPathOf(path) {
|
|
13
|
+
try {
|
|
14
|
+
return realpathSync.native(path);
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
const parent = dirname(path);
|
|
18
|
+
return parent === path ? path : join(realPathOf(parent), basename(path));
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Whether a path is the folder's or lies under it.
|
|
23
|
+
*/
|
|
24
|
+
function isWithin(path, folder) {
|
|
25
|
+
const fromFolder = relative(folder, path);
|
|
26
|
+
return fromFolder !== '..' && !fromFolder.startsWith(`..${sep}`) && !isAbsolute(fromFolder);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Checks that a Storybook's baselines aren't where the addon writes its images, which it also removes.
|
|
30
|
+
*
|
|
31
|
+
* @throws {ConfigError} When they are.
|
|
32
|
+
*/
|
|
33
|
+
function checkBaselinesFolder({ name, dir, baselines }, cwd) {
|
|
34
|
+
const realBaselines = realPathOf(baselines);
|
|
35
|
+
const folder = addonImageFolders
|
|
36
|
+
.map((imageFolder) => join(dir, '.visual-check', imageFolder))
|
|
37
|
+
.find((path) => isWithin(realBaselines, realPathOf(path)));
|
|
38
|
+
if (folder === undefined) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const inside = baselines === folder ? '' : `inside ${displayPathOf(folder, cwd)}, `;
|
|
42
|
+
throw new ConfigError(`storybooks.${name}.baselines is ${displayPathOf(baselines, cwd)}, ${inside}` +
|
|
43
|
+
'where the Storybook addon writes its own images. Set another folder.');
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Returns the name and the settings of the first Storybook in the config at `path` whose config folder is the running
|
|
47
|
+
* Storybook's.
|
|
48
|
+
*
|
|
49
|
+
* @throws {ConfigError} When there is none. The message lists the config's Storybooks.
|
|
50
|
+
*/
|
|
51
|
+
function findStorybook(config, path, { configDir, cwd }) {
|
|
52
|
+
const storybooks = Object.entries(config.storybooks);
|
|
53
|
+
const realConfigDir = realPathOf(configDir);
|
|
54
|
+
const found = storybooks.find(([, settings]) => realPathOf(configDirOf(settings, path)) === realConfigDir);
|
|
55
|
+
if (found === undefined) {
|
|
56
|
+
const listed = storybooks.map(([name, settings]) => `${name} (${displayPathOf(configDirOf(settings, path), cwd)})`);
|
|
57
|
+
throw new ConfigError(`${displayPathOf(path, cwd)} lists no Storybook whose config folder is ${displayPathOf(configDir, cwd)}. ` +
|
|
58
|
+
`It lists ${listNames(listed)}.`);
|
|
59
|
+
}
|
|
60
|
+
return found;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Finds the config from a running Storybook's config folder, loads it and all it imports as they are now, and resolves
|
|
64
|
+
* it for that Storybook alone, at the address it's served at.
|
|
65
|
+
*
|
|
66
|
+
* @throws {ConfigError} When no config is found, when the config can't be loaded, when it's invalid or can't be used,
|
|
67
|
+
* when it lists no Storybook with that config folder, and when that Storybook's baselines are where the addon writes its
|
|
68
|
+
* images. Once the config is found, the error names its path as `configPath`.
|
|
69
|
+
* @throws {unknown} The signal's reason, when it aborts first.
|
|
70
|
+
*
|
|
71
|
+
* @public
|
|
72
|
+
*/
|
|
73
|
+
export async function loadStorybookConfig(options) {
|
|
74
|
+
const { configDir, url, cwd, ci } = options;
|
|
75
|
+
const path = searchConfig(configDir);
|
|
76
|
+
return await namingConfig(path, async () => {
|
|
77
|
+
const config = await readConfigAfresh(path, cwd, options.signal);
|
|
78
|
+
const [name, settings] = findStorybook(config, path, options);
|
|
79
|
+
const resolved = resolveConfig(config, { path, cwd, ci, storybook: name, url });
|
|
80
|
+
// `resolveConfig` gives the one Storybook it's narrowed to.
|
|
81
|
+
const [storybook] = resolved.storybooks;
|
|
82
|
+
checkBaselinesFolder(storybook, cwd);
|
|
83
|
+
return { config: resolved, storybook, configUrl: urlSideOf(settings, ci) };
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Finds the config from a Storybook's config folder, loads it and all it imports as they are now, and gives the name of
|
|
88
|
+
* the first Storybook it lists with that config folder. A static build has no address, so it needs no URL.
|
|
89
|
+
*
|
|
90
|
+
* @throws {ConfigError} When no config is found, when the config can't be loaded or is invalid, and when it lists no
|
|
91
|
+
* Storybook with that config folder. Once the config is found, the error names its path as `configPath`.
|
|
92
|
+
* @throws {unknown} The signal's reason, when it aborts first.
|
|
93
|
+
*
|
|
94
|
+
* @public
|
|
95
|
+
*/
|
|
96
|
+
export async function storybookNameOf(options) {
|
|
97
|
+
const path = searchConfig(options.configDir);
|
|
98
|
+
return await namingConfig(path, async () => {
|
|
99
|
+
const config = await readConfigAfresh(path, options.cwd, options.signal);
|
|
100
|
+
const [name] = findStorybook(config, path, options);
|
|
101
|
+
return name;
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=load-storybook-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-storybook-config.js","sourceRoot":"","sources":["../../src/config/load-storybook-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,C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GAAG,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;IAE5C,OAAO,MAAM,YAAY,CAAC,IAAI,EAAE,KAAK,IAAI,EAAE;QACzC,MAAM,MAAM,GAAG,MAAM,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,MAAM,CAAC,CAAA;QACxE,MAAM,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;QAEnD,OAAO,IAAI,CAAA;IACb,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { StoryOptions } from './story-options.js';
|
|
2
|
+
/**
|
|
3
|
+
* One story as the mode rules need it.
|
|
4
|
+
*
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export interface ModeRulesStory {
|
|
8
|
+
/**
|
|
9
|
+
* The story's ID.
|
|
10
|
+
*/
|
|
11
|
+
id: string;
|
|
12
|
+
/**
|
|
13
|
+
* The story's options, as `checkStoryOptions` gives them once valid, so no key is set to `undefined`.
|
|
14
|
+
*/
|
|
15
|
+
options: StoryOptions;
|
|
16
|
+
/**
|
|
17
|
+
* The keys of the globals the story or its meta pins in its own `globals`.
|
|
18
|
+
*/
|
|
19
|
+
pinnedGlobals: readonly string[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Checks the mode rules of one Storybook's stories, given in `index.json` order. Gives each issue as
|
|
23
|
+
* `<story-id>: <issue>`, whose key path starts at `visualCheck`: by story, then by rule, then in the order the modes and
|
|
24
|
+
* their globals are held. The rules:
|
|
25
|
+
*
|
|
26
|
+
* 1. A mode's name, `null` entries included, takes lowercase letters, digits and -, and isn't `chromium`, `webkit` or
|
|
27
|
+
* `firefox`. A mode whose name fails skips the other rules.
|
|
28
|
+
* 2. A listed mode means one thing: the first story that lists it fixes its definition, and a later story that lists it
|
|
29
|
+
* with other globals or another viewport has an issue naming the first.
|
|
30
|
+
* 3. A listed mode's global is one the Storybook declares. `declaredGlobals` set to `null` skips this rule.
|
|
31
|
+
* 4. A listed mode's global has a key and a value Storybook reads back from the story's URL.
|
|
32
|
+
* 5. A listed mode's global isn't one the story pins.
|
|
33
|
+
*
|
|
34
|
+
* The helper writes every declared mode into every story, so one bad declaration would repeat in every story. Each
|
|
35
|
+
* issue is given once instead: a name's on the first story that holds it, and a definition's (rules 3 and 4) on the
|
|
36
|
+
* first story that lists the mode. A later story that lists it the same way has none, and one that lists it another
|
|
37
|
+
* way has rule 2's. Rule 5 depends on the story, so each story has its own.
|
|
38
|
+
*
|
|
39
|
+
* @public
|
|
40
|
+
*/
|
|
41
|
+
export declare function checkModeRules(storybookName: string, stories: readonly ModeRulesStory[], declaredGlobals: ReadonlySet<string> | null): string[];
|
|
42
|
+
//# sourceMappingURL=mode-rules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mode-rules.d.ts","sourceRoot":"","sources":["../../src/config/mode-rules.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAkB,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEtE;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IACV;;OAEG;IACH,OAAO,EAAE,YAAY,CAAA;IACrB;;OAEG;IACH,aAAa,EAAE,SAAS,MAAM,EAAE,CAAA;CACjC;AA6RD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,cAAc,CAC5B,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,SAAS,cAAc,EAAE,EAClC,eAAe,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,IAAI,GAC1C,MAAM,EAAE,CAMV"}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { join, lowercaseNamePattern, mustBe, render } from './checks.js';
|
|
2
|
+
/**
|
|
3
|
+
* The key path of a story's modes in an issue.
|
|
4
|
+
*/
|
|
5
|
+
const modesPath = 'visualCheck.modes';
|
|
6
|
+
/**
|
|
7
|
+
* The names kept for browsers' baselines.
|
|
8
|
+
*/
|
|
9
|
+
const reservedNames = ['chromium', 'webkit', 'firefox'];
|
|
10
|
+
/**
|
|
11
|
+
* What a mode-name issue ends with.
|
|
12
|
+
*/
|
|
13
|
+
const renameFix = 'Rename it in <configDir>/visual-check.ts.';
|
|
14
|
+
/**
|
|
15
|
+
* What Storybook keeps of a global's key or string value in the URL. It drops any other character. The storybook
|
|
16
|
+
* module encodes globals with the same pattern, and this module can't import it.
|
|
17
|
+
*/
|
|
18
|
+
const urlSafeGlobalPattern = /^[a-zA-Z0-9 _-]*$/;
|
|
19
|
+
/**
|
|
20
|
+
* What Storybook reads back from the URL as a number: digits with an optional leading `-` and an optional fraction.
|
|
21
|
+
* The storybook module encodes globals with the same pattern, and this module can't import it.
|
|
22
|
+
*/
|
|
23
|
+
const plainDecimalPattern = /^-?\d+(\.\d+)?$/;
|
|
24
|
+
/**
|
|
25
|
+
* The issues of a mode's name: one when it holds other characters than lowercase letters, digits and -, or when it's
|
|
26
|
+
* reserved.
|
|
27
|
+
*/
|
|
28
|
+
function nameIssues(name, path) {
|
|
29
|
+
if (!lowercaseNamePattern.test(name)) {
|
|
30
|
+
return [`${path}: a mode name takes lowercase letters, digits and -. ${renameFix}`];
|
|
31
|
+
}
|
|
32
|
+
if (reservedNames.includes(name)) {
|
|
33
|
+
return [
|
|
34
|
+
`${path}: chromium, webkit and firefox are kept for browsers' baselines, so no mode can take them. ${renameFix}`,
|
|
35
|
+
];
|
|
36
|
+
}
|
|
37
|
+
return [];
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The entries of an object sorted by key, so two objects that hold the same entries give the same list.
|
|
41
|
+
*/
|
|
42
|
+
function sortedEntries(value) {
|
|
43
|
+
return Object.entries(value).sort(([left], [right]) => (left < right ? -1 : 1));
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* What a definition means, as text that two definitions share when they set the same globals and viewport. Key order
|
|
47
|
+
* doesn't count, and absent `globals` or `viewport` reads as empty.
|
|
48
|
+
*/
|
|
49
|
+
function meaningOf({ globals = {}, viewport = {} }) {
|
|
50
|
+
return JSON.stringify([sortedEntries(globals), sortedEntries(viewport)]);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* The issue of a listed mode that means something other than in the first story that lists it. A mode no story listed
|
|
54
|
+
* before has none.
|
|
55
|
+
*/
|
|
56
|
+
function conflictIssues(mode, first) {
|
|
57
|
+
if (first === undefined || meaningOf(first.definition) === meaningOf(mode.definition)) {
|
|
58
|
+
return [];
|
|
59
|
+
}
|
|
60
|
+
const here = render(mode.definition);
|
|
61
|
+
const there = render(first.definition);
|
|
62
|
+
return [
|
|
63
|
+
`${mode.path}: sets ${here} here but ${there} in ${first.storyId}. A mode means one thing in a Storybook, so declare it once in <configDir>/visual-check.ts.`,
|
|
64
|
+
];
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* The issue of a global the Storybook doesn't declare.
|
|
68
|
+
*/
|
|
69
|
+
function undeclaredIssue({ key, path }, storybookName) {
|
|
70
|
+
return `${path}: Storybook ${storybookName} doesn't declare the global ${key}, so it would drop it from the story's URL. Add ${key} to initialGlobals or globalTypes in <configDir>/preview.`;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* The issue of a global's value when Storybook wouldn't read it back from the story's URL.
|
|
74
|
+
*/
|
|
75
|
+
function valueIssues(value, path) {
|
|
76
|
+
if (typeof value === 'boolean') {
|
|
77
|
+
return [];
|
|
78
|
+
}
|
|
79
|
+
if (typeof value === 'number') {
|
|
80
|
+
return Number.isFinite(value) && plainDecimalPattern.test(String(value))
|
|
81
|
+
? []
|
|
82
|
+
: [
|
|
83
|
+
mustBe(path, "a number in plain decimal digits, such as 1.5 or -2, or Storybook doesn't read it from the story's URL as a number", value),
|
|
84
|
+
];
|
|
85
|
+
}
|
|
86
|
+
return urlSafeGlobalPattern.test(value)
|
|
87
|
+
? []
|
|
88
|
+
: [
|
|
89
|
+
mustBe(path, "a string of only letters, digits, spaces, _ and -, or Storybook drops it from the story's URL", value),
|
|
90
|
+
];
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* The issues of a global whose key or value Storybook wouldn't read back from the story's URL: the key's first, then
|
|
94
|
+
* the value's.
|
|
95
|
+
*/
|
|
96
|
+
function characterIssues({ key, value, path }) {
|
|
97
|
+
const keyIssues = key !== '' && urlSafeGlobalPattern.test(key)
|
|
98
|
+
? []
|
|
99
|
+
: [
|
|
100
|
+
`${path}: a global's name may hold only letters, digits, spaces, _ and -, and can't be empty, or Storybook drops it from the story's URL.`,
|
|
101
|
+
];
|
|
102
|
+
return [...keyIssues, ...valueIssues(value, path)];
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* The issue of a global the story or its meta pins, whose value wins over the mode's.
|
|
106
|
+
*/
|
|
107
|
+
function pinnedIssue({ mode, key, path }) {
|
|
108
|
+
return `${path}: the story or its meta pins ${key} in its own globals, which win over the mode's, so the mode's ${key} never reaches the story. Leave ${mode.name} out of the story's modes, or ${key} out of its globals.`;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* The issues of the mode names no story before has held, which it records in `validNames`.
|
|
112
|
+
*/
|
|
113
|
+
function newNameIssues(names, validNames) {
|
|
114
|
+
return names.flatMap((name) => {
|
|
115
|
+
if (validNames.has(name)) {
|
|
116
|
+
return [];
|
|
117
|
+
}
|
|
118
|
+
const issues = nameIssues(name, join(modesPath, name));
|
|
119
|
+
validNames.set(name, issues.length === 0);
|
|
120
|
+
return issues;
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* The modes a story lists, in the order its options hold them. A mode set to `null` is declared but not listed.
|
|
125
|
+
*/
|
|
126
|
+
function listedModesOf(modes) {
|
|
127
|
+
return Object.entries(modes).flatMap(([name, definition]) => definition === null ? [] : [{ name, path: join(modesPath, name), definition }]);
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* The globals the listed modes set, mode by mode, in the order each definition holds them.
|
|
131
|
+
*/
|
|
132
|
+
function modeGlobalsOf(modes) {
|
|
133
|
+
return modes.flatMap((mode) => Object.entries(mode.definition.globals ?? {}).map(([key, value]) => ({
|
|
134
|
+
mode,
|
|
135
|
+
key,
|
|
136
|
+
value,
|
|
137
|
+
path: join(join(mode.path, 'globals'), key),
|
|
138
|
+
})));
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* The issues of one story, in rule order, given what the stories before it showed. Records the names it checks and
|
|
142
|
+
* the modes it lists first in `seen`.
|
|
143
|
+
*/
|
|
144
|
+
function storyIssues(story, storybookName, declaredGlobals, seen) {
|
|
145
|
+
const modes = story.options.modes ?? {};
|
|
146
|
+
const namingIssues = newNameIssues(Object.keys(modes), seen.validNames);
|
|
147
|
+
const listed = listedModesOf(modes).filter(({ name }) => seen.validNames.get(name) === true);
|
|
148
|
+
const conflicts = listed.flatMap((mode) => conflictIssues(mode, seen.firstListings.get(mode.name)));
|
|
149
|
+
const firsts = listed.filter(({ name }) => !seen.firstListings.has(name));
|
|
150
|
+
for (const mode of firsts) {
|
|
151
|
+
seen.firstListings.set(mode.name, { storyId: story.id, definition: mode.definition });
|
|
152
|
+
}
|
|
153
|
+
const firstGlobals = modeGlobalsOf(firsts);
|
|
154
|
+
const undeclared = declaredGlobals === null ? [] : firstGlobals.filter(({ key }) => !declaredGlobals.has(key));
|
|
155
|
+
const pinned = modeGlobalsOf(listed).filter(({ key }) => story.pinnedGlobals.includes(key));
|
|
156
|
+
return [
|
|
157
|
+
...namingIssues,
|
|
158
|
+
...conflicts,
|
|
159
|
+
...undeclared.map((global) => undeclaredIssue(global, storybookName)),
|
|
160
|
+
...firstGlobals.flatMap(characterIssues),
|
|
161
|
+
...pinned.map(pinnedIssue),
|
|
162
|
+
];
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Checks the mode rules of one Storybook's stories, given in `index.json` order. Gives each issue as
|
|
166
|
+
* `<story-id>: <issue>`, whose key path starts at `visualCheck`: by story, then by rule, then in the order the modes and
|
|
167
|
+
* their globals are held. The rules:
|
|
168
|
+
*
|
|
169
|
+
* 1. A mode's name, `null` entries included, takes lowercase letters, digits and -, and isn't `chromium`, `webkit` or
|
|
170
|
+
* `firefox`. A mode whose name fails skips the other rules.
|
|
171
|
+
* 2. A listed mode means one thing: the first story that lists it fixes its definition, and a later story that lists it
|
|
172
|
+
* with other globals or another viewport has an issue naming the first.
|
|
173
|
+
* 3. A listed mode's global is one the Storybook declares. `declaredGlobals` set to `null` skips this rule.
|
|
174
|
+
* 4. A listed mode's global has a key and a value Storybook reads back from the story's URL.
|
|
175
|
+
* 5. A listed mode's global isn't one the story pins.
|
|
176
|
+
*
|
|
177
|
+
* The helper writes every declared mode into every story, so one bad declaration would repeat in every story. Each
|
|
178
|
+
* issue is given once instead: a name's on the first story that holds it, and a definition's (rules 3 and 4) on the
|
|
179
|
+
* first story that lists the mode. A later story that lists it the same way has none, and one that lists it another
|
|
180
|
+
* way has rule 2's. Rule 5 depends on the story, so each story has its own.
|
|
181
|
+
*
|
|
182
|
+
* @public
|
|
183
|
+
*/
|
|
184
|
+
export function checkModeRules(storybookName, stories, declaredGlobals) {
|
|
185
|
+
const seen = { validNames: new Map(), firstListings: new Map() };
|
|
186
|
+
return stories.flatMap((story) => storyIssues(story, storybookName, declaredGlobals, seen).map((issue) => `${story.id}: ${issue}`));
|
|
187
|
+
}
|
|
188
|
+
//# sourceMappingURL=mode-rules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mode-rules.js","sourceRoot":"","sources":["../../src/config/mode-rules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,oBAAoB,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAgGxE;;GAEG;AACH,MAAM,SAAS,GAAG,mBAAmB,CAAA;AAErC;;GAEG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AAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,EAAE,KAAK,KAAK,EAAE,CAAC,CACjG,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Config } from './define-config.js';
|
|
2
|
+
/**
|
|
3
|
+
* Reads a config as `readConfig` does, in a thread of its own. Node's own loader keeps the first version of a file for
|
|
4
|
+
* the life of a thread, so every file the config imports is read as it is now, also in a process that lives for hours.
|
|
5
|
+
* What the config does stays in the thread: a timer it starts ends with it and, unlike with `loadConfig`, a change it
|
|
6
|
+
* makes to `process.env` doesn't reach this process.
|
|
7
|
+
*
|
|
8
|
+
* @throws {ConfigError} As `readConfig` does, with the same message, and when the config stops its thread, waits for a
|
|
9
|
+
* promise that never settles or throws outside its own run.
|
|
10
|
+
* @throws {unknown} The signal's reason, when it aborts first. The thread is stopped then, even one that spins.
|
|
11
|
+
*/
|
|
12
|
+
export declare function readConfigAfresh(path: string, cwd: string, signal?: AbortSignal): Promise<Config>;
|
|
13
|
+
//# sourceMappingURL=read-config-afresh.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-config-afresh.d.ts","sourceRoot":"","sources":["../../src/config/read-config-afresh.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAGhD;;;;;;;;;GASG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAiBvG"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ConfigError } from './config-error.js';
|
|
2
|
+
import { askConfigThread } from './config-thread.js';
|
|
3
|
+
import { displayPathOf, loadErrorOf } from './load-config.js';
|
|
4
|
+
/**
|
|
5
|
+
* Reads a config as `readConfig` does, in a thread of its own. Node's own loader keeps the first version of a file for
|
|
6
|
+
* the life of a thread, so every file the config imports is read as it is now, also in a process that lives for hours.
|
|
7
|
+
* What the config does stays in the thread: a timer it starts ends with it and, unlike with `loadConfig`, a change it
|
|
8
|
+
* makes to `process.env` doesn't reach this process.
|
|
9
|
+
*
|
|
10
|
+
* @throws {ConfigError} As `readConfig` does, with the same message, and when the config stops its thread, waits for a
|
|
11
|
+
* promise that never settles or throws outside its own run.
|
|
12
|
+
* @throws {unknown} The signal's reason, when it aborts first. The thread is stopped then, even one that spins.
|
|
13
|
+
*/
|
|
14
|
+
export async function readConfigAfresh(path, cwd, signal) {
|
|
15
|
+
signal?.throwIfAborted();
|
|
16
|
+
const reply = await askConfigThread(path, cwd, signal).catch((error) => {
|
|
17
|
+
signal?.throwIfAborted();
|
|
18
|
+
throw loadErrorOf(error, path, displayPathOf(path, cwd));
|
|
19
|
+
});
|
|
20
|
+
if ('unsettled' in reply) {
|
|
21
|
+
throw loadErrorOf('it waits for a promise that never settles.', path, displayPathOf(path, cwd));
|
|
22
|
+
}
|
|
23
|
+
if ('error' in reply) {
|
|
24
|
+
throw reply.error.isConfigError ? new ConfigError(reply.error.message) : new Error(reply.error.message);
|
|
25
|
+
}
|
|
26
|
+
return reply.config;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=read-config-afresh.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-config-afresh.js","sourceRoot":"","sources":["../../src/config/read-config-afresh.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAEpD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE7D;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,IAAY,EAAE,GAAW,EAAE,MAAoB;IACpF,MAAM,EAAE,cAAc,EAAE,CAAA;IAExB,MAAM,KAAK,GAAG,MAAM,eAAe,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;QAC9E,MAAM,EAAE,cAAc,EAAE,CAAA;QACxB,MAAM,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE,aAAa,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAA;IAC1D,CAAC,CAAC,CAAA;IAEF,IAAI,WAAW,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,WAAW,CAAC,4CAA4C,EAAE,IAAI,EAAE,aAAa,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAA;IACjG,CAAC;IAED,IAAI,OAAO,IAAI,KAAK,EAAE,CAAC;QACrB,MAAM,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;IACzG,CAAC;IAED,OAAO,KAAK,CAAC,MAAM,CAAA;AACrB,CAAC"}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import type { AffectedSettings, ColorScheme, Config, Platform, StorybookSettings, Tolerance, Viewport } from './define-config.js';
|
|
2
|
+
/**
|
|
3
|
+
* One Storybook with every default filled in and every path made absolute.
|
|
4
|
+
*
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export interface ResolvedStorybook {
|
|
8
|
+
/**
|
|
9
|
+
* The name the config gives the Storybook.
|
|
10
|
+
*/
|
|
11
|
+
name: string;
|
|
12
|
+
/**
|
|
13
|
+
* The absolute folder Storybook runs in.
|
|
14
|
+
*/
|
|
15
|
+
dir: string;
|
|
16
|
+
/**
|
|
17
|
+
* The absolute path of Storybook's config folder.
|
|
18
|
+
*/
|
|
19
|
+
configDir: string;
|
|
20
|
+
/**
|
|
21
|
+
* The absolute path of the folder that holds the baselines.
|
|
22
|
+
*/
|
|
23
|
+
baselines: string;
|
|
24
|
+
/**
|
|
25
|
+
* Where the running Storybook is served, for the current environment.
|
|
26
|
+
*/
|
|
27
|
+
url: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The config with every default filled in, every `{ local, ci }` pair picked for the current environment and every
|
|
31
|
+
* path made absolute.
|
|
32
|
+
*
|
|
33
|
+
* @public
|
|
34
|
+
*/
|
|
35
|
+
export interface ResolvedConfig {
|
|
36
|
+
/**
|
|
37
|
+
* The absolute path of the config file.
|
|
38
|
+
*/
|
|
39
|
+
path: string;
|
|
40
|
+
/**
|
|
41
|
+
* The Storybooks the run covers, in config order: every one, or the one `--storybook` names.
|
|
42
|
+
*/
|
|
43
|
+
storybooks: ResolvedStorybook[];
|
|
44
|
+
/**
|
|
45
|
+
* The absolute baselines folder of every Storybook in the config, in config order, those `--storybook` leaves out
|
|
46
|
+
* included, so a changed baseline is never taken for an image.
|
|
47
|
+
*/
|
|
48
|
+
baselinesFolders: string[];
|
|
49
|
+
/**
|
|
50
|
+
* Where the browser runs.
|
|
51
|
+
*/
|
|
52
|
+
platform: Platform;
|
|
53
|
+
/**
|
|
54
|
+
* The Docker image the browser runs in. `undefined` when the config sets none: the browser package's image is filled
|
|
55
|
+
* in when the run starts.
|
|
56
|
+
*/
|
|
57
|
+
image: string | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* The project's default tolerance.
|
|
60
|
+
*/
|
|
61
|
+
tolerance: Required<Tolerance>;
|
|
62
|
+
/**
|
|
63
|
+
* The project's default viewport.
|
|
64
|
+
*/
|
|
65
|
+
viewport: Required<Viewport>;
|
|
66
|
+
/**
|
|
67
|
+
* The color that paints masked regions.
|
|
68
|
+
*/
|
|
69
|
+
maskColor: string;
|
|
70
|
+
/**
|
|
71
|
+
* The timezone the browser emulates.
|
|
72
|
+
*/
|
|
73
|
+
timezone: string;
|
|
74
|
+
/**
|
|
75
|
+
* The locale the browser emulates.
|
|
76
|
+
*/
|
|
77
|
+
locale: string;
|
|
78
|
+
/**
|
|
79
|
+
* The color scheme the browser emulates.
|
|
80
|
+
*/
|
|
81
|
+
colorScheme: ColorScheme;
|
|
82
|
+
/**
|
|
83
|
+
* The size of the worker pool. `'auto'` is sized from the machine when the run starts.
|
|
84
|
+
*/
|
|
85
|
+
workers: 'auto' | number;
|
|
86
|
+
/**
|
|
87
|
+
* How long to wait for a story to be ready, in milliseconds.
|
|
88
|
+
*/
|
|
89
|
+
readyTimeout: number;
|
|
90
|
+
/**
|
|
91
|
+
* How many more times `test` captures a snapshot that differs from its baseline before it fails.
|
|
92
|
+
*/
|
|
93
|
+
retries: number;
|
|
94
|
+
/**
|
|
95
|
+
* Hosts whose requests `update`'s warnings skip.
|
|
96
|
+
*/
|
|
97
|
+
silenceHosts: string[];
|
|
98
|
+
/**
|
|
99
|
+
* The globs that select every story or none, as written: relative to the config file's folder.
|
|
100
|
+
*/
|
|
101
|
+
affected: Required<AffectedSettings>;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* What `resolveConfig` needs to know about the run.
|
|
105
|
+
*/
|
|
106
|
+
interface ResolveOptions {
|
|
107
|
+
/**
|
|
108
|
+
* The path of the config file, absolute or relative to `cwd`.
|
|
109
|
+
*/
|
|
110
|
+
path: string;
|
|
111
|
+
/**
|
|
112
|
+
* The folder the CLI runs in. Paths in messages are relative to it.
|
|
113
|
+
*/
|
|
114
|
+
cwd: string;
|
|
115
|
+
/**
|
|
116
|
+
* Whether the `CI` environment variable is set, which picks the `ci` side of every `{ local, ci }` pair.
|
|
117
|
+
*/
|
|
118
|
+
ci: boolean;
|
|
119
|
+
/**
|
|
120
|
+
* The Storybook `--storybook` names. The run covers only it, so only it needs a URL for the current environment.
|
|
121
|
+
*/
|
|
122
|
+
storybook?: string;
|
|
123
|
+
/**
|
|
124
|
+
* The URL `--url` gives. It replaces the URL of the one Storybook the run covers. It must be an http(s) URL with no
|
|
125
|
+
* login, which the command line reader has checked.
|
|
126
|
+
*/
|
|
127
|
+
url?: string;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Returns the absolute folder that holds the baselines of a Storybook whose config sets no `baselines`: the default
|
|
131
|
+
* folder in its `dir`.
|
|
132
|
+
*
|
|
133
|
+
* @public
|
|
134
|
+
*/
|
|
135
|
+
export declare function defaultBaselinesIn(dir: string): string;
|
|
136
|
+
/**
|
|
137
|
+
* Lists names as prose: `a`, `a and b`, `a, b and c`.
|
|
138
|
+
*
|
|
139
|
+
* @public
|
|
140
|
+
*/
|
|
141
|
+
export declare function listNames(names: string[]): string;
|
|
142
|
+
/**
|
|
143
|
+
* Returns the absolute path of a Storybook's config folder. `configPath` is the absolute path of the config file.
|
|
144
|
+
*/
|
|
145
|
+
export declare function configDirOf(settings: StorybookSettings, configPath: string): string;
|
|
146
|
+
/**
|
|
147
|
+
* Returns the URL the config gives a Storybook for the current environment, or `undefined` when it gives none.
|
|
148
|
+
*/
|
|
149
|
+
export declare function urlSideOf(settings: StorybookSettings, ci: boolean): string | undefined;
|
|
150
|
+
/**
|
|
151
|
+
* Fills in the defaults, picks the `{ local, ci }` side for the current environment and resolves the paths.
|
|
152
|
+
*
|
|
153
|
+
* `storybook` narrows the result to one Storybook before the URL check, and `url` replaces the URL of the one
|
|
154
|
+
* Storybook the run covers before it. Shared baselines are checked across every Storybook in the config.
|
|
155
|
+
*
|
|
156
|
+
* @throws {ConfigError} For a `storybook` that isn't in the config, for a `url` with several Storybooks and no
|
|
157
|
+
* `storybook`, for a Storybook in the run with no URL for the current environment, and for Storybooks that share a
|
|
158
|
+
* baselines folder.
|
|
159
|
+
*/
|
|
160
|
+
export declare function resolveConfig(config: Config, options: ResolveOptions): ResolvedConfig;
|
|
161
|
+
export {};
|
|
162
|
+
//# sourceMappingURL=resolve-config.d.ts.map
|