@cnc-tools/storm 0.11.0 → 0.13.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/dist/bin/storm.js +7 -12
- package/dist/build-info.js +1 -1
- package/dist/chunks/chunk-2NZXL6OH.js +62 -0
- package/dist/chunks/{chunk-3ZZVZPMG.js → chunk-43MWZLJR.js} +1 -1
- package/dist/chunks/{chunk-NPPJ57W7.js → chunk-5UMJNVKT.js} +498 -215
- package/dist/chunks/{chunk-KR7WIYLG.js → chunk-6EQKA7LI.js} +200 -985
- package/dist/chunks/{chunk-4EU4AH7E.js → chunk-AX4EQZUS.js} +186 -144
- package/dist/chunks/{chunk-ETCZ6WP7.js → chunk-BW2ADH7U.js} +1 -1
- package/dist/chunks/chunk-DOFB2ACU.js +49 -0
- package/dist/chunks/chunk-EGNP3S6C.js +161 -0
- package/dist/chunks/chunk-GQIL3AHY.js +20 -0
- package/dist/chunks/{chunk-ICB4BZJX.js → chunk-GSC6SRTW.js} +7 -2
- package/dist/chunks/{chunk-OJOKQRM6.js → chunk-IYM44FUX.js} +30 -26
- package/dist/chunks/{chunk-GRMD7G4J.js → chunk-LQKNI3EG.js} +6 -5
- package/dist/chunks/chunk-N7E6DAUE.js +40 -0
- package/dist/chunks/chunk-NMVODY3P.js +19 -0
- package/dist/chunks/{chunk-TRFEAYNC.js → chunk-Q4TKRILH.js} +261 -354
- package/dist/chunks/{chunk-VZZTHCBW.js → chunk-RTILVSYQ.js} +5 -18
- package/dist/chunks/{chunk-L4ZPMSKQ.js → chunk-T6AZIDZD.js} +43 -363
- package/dist/chunks/chunk-X4WBJIOF.js +308 -0
- package/dist/chunks/chunk-YGS5VRQT.js +794 -0
- package/dist/chunks/{chunk-4PRAB24Y.js → chunk-YM6TZV4L.js} +394 -396
- package/dist/chunks/{chunk-AMTYHUYB.js → chunk-YT5OROR7.js} +22 -8
- package/dist/chunks/{chunk-O4BUT7BE.js → chunk-ZDJLKF2G.js} +1625 -1583
- package/dist/chunks/{live-app-LOGYUBKB.js → live-app-QFHS54SX.js} +25 -46
- package/dist/command-tree.d.ts +4 -1
- package/dist/command-tree.js +4 -1
- package/dist/commands/exec/cleanup.js +4 -4
- package/dist/commands/exec/command.d.ts +6 -55
- package/dist/commands/exec/command.js +51 -46
- package/dist/commands/exec/define-run-command.d.ts +664 -0
- package/dist/commands/exec/define-run-command.js +58 -0
- package/dist/commands/exec/driver-plan.d.ts +30 -0
- package/dist/commands/exec/driver-plan.js +44 -0
- package/dist/commands/exec/driver-refusals.d.ts +89 -0
- package/dist/commands/exec/driver-refusals.js +65 -0
- package/dist/commands/exec/exec-words.d.ts +5 -0
- package/dist/commands/exec/exec-words.js +31 -0
- package/dist/commands/exec/live-view.js +68 -42
- package/dist/commands/exec/mint-failed.js +4 -4
- package/dist/commands/exec/outcomes.d.ts +6 -48
- package/dist/commands/exec/outcomes.js +10 -12
- package/dist/commands/exec/plan-run.js +3 -3
- package/dist/commands/exec/progress.d.ts +21 -17
- package/dist/commands/exec/progress.js +59 -78
- package/dist/commands/exec/resource-flags.d.ts +10 -3
- package/dist/commands/exec/resource-flags.js +25 -14
- package/dist/commands/exec/resource-refusals.d.ts +1 -1
- package/dist/commands/exec/resource-refusals.js +9 -9
- package/dist/commands/exec/run-bin.d.ts +35 -0
- package/dist/commands/exec/run-bin.js +32 -0
- package/dist/commands/exec/run-command.d.ts +64 -23
- package/dist/commands/exec/run-command.js +35 -94
- package/dist/commands/exec/run-metadata.d.ts +25 -19
- package/dist/commands/exec/run-metadata.js +34 -18
- package/dist/commands/exec/snapshot-text.d.ts +31 -0
- package/dist/commands/exec/snapshot-text.js +72 -0
- package/dist/commands/exec/test-plan.d.ts +2 -2
- package/dist/commands/exec/test-plan.js +11 -8
- package/dist/commands/exec/tests-summary.d.ts +21 -12
- package/dist/commands/exec/tests-summary.js +67 -39
- package/dist/commands/exec/text.d.ts +5 -0
- package/dist/commands/exec/text.js +7 -0
- package/dist/commands/exec/view.js +12 -13
- package/dist/commands/exec/waterfall.js +4 -4
- package/dist/commands/exec/worker-chart.d.ts +19 -11
- package/dist/commands/exec/worker-chart.js +66 -36
- package/dist/commands/playwright/command.d.ts +658 -0
- package/dist/commands/playwright/command.js +31 -0
- package/dist/commands/playwright/metadata.js +8 -0
- package/dist/commands/runs/facts.d.ts +5 -28
- package/dist/commands/runs/facts.js +11 -33
- package/dist/commands/runs/list/command.d.ts +4 -50
- package/dist/commands/runs/list/command.js +15 -11
- package/dist/commands/runs/list/outcomes.d.ts +2 -25
- package/dist/commands/runs/logs/command.js +13 -9
- package/dist/commands/runs/logs/outcomes.js +1 -1
- package/dist/commands/runs/show/command.d.ts +6 -50
- package/dist/commands/runs/show/command.js +37 -47
- package/dist/commands/runs/show/metadata.js +1 -1
- package/dist/commands/runs/show/outcomes.d.ts +3 -25
- package/dist/commands/runs/show/outcomes.js +18 -31
- package/dist/commands/snapshots/build/command.d.ts +501 -0
- package/dist/commands/snapshots/build/command.js +336 -0
- package/dist/commands/snapshots/build/metadata.d.ts +28 -0
- package/dist/commands/snapshots/build/metadata.js +37 -0
- package/dist/commands/snapshots/build/outcomes.d.ts +254 -0
- package/dist/commands/snapshots/build/outcomes.js +155 -0
- package/dist/commands/snapshots/list/command.d.ts +238 -0
- package/dist/commands/snapshots/list/command.js +269 -0
- package/dist/commands/snapshots/list/metadata.d.ts +16 -0
- package/dist/commands/snapshots/list/metadata.js +24 -0
- package/dist/commands/snapshots/list/outcomes.d.ts +148 -0
- package/dist/commands/snapshots/list/outcomes.js +217 -0
- package/dist/commands/snapshots/metadata.d.ts +3 -0
- package/dist/commands/snapshots/metadata.js +7 -0
- package/dist/commands/vitest/command.d.ts +185 -304
- package/dist/commands/vitest/command.js +23 -181
- package/dist/commands/vitest/metadata.js +1 -1
- package/dist/config-file/define.d.ts +1 -1
- package/dist/context.d.ts +32 -30
- package/dist/context.js +13 -17
- package/dist/core/before-run.d.ts +5 -5
- package/dist/core/before-run.js +8 -8
- package/dist/core/definition-lookup.d.ts +5 -5
- package/dist/core/definition-lookup.js +13 -12
- package/dist/core/drivers-of.d.ts +23 -0
- package/dist/core/drivers-of.js +13 -0
- package/dist/core/events.d.ts +6 -9
- package/dist/core/gateways.d.ts +32 -24
- package/dist/core/index.d.ts +7 -5
- package/dist/core/index.js +9 -6
- package/dist/core/launcher-context.d.ts +11 -0
- package/dist/core/launcher-context.js +31 -0
- package/dist/core/live/package-bin-gateway.d.ts +6 -0
- package/dist/core/live/package-bin-gateway.js +24 -0
- package/dist/core/package-bin.d.ts +7 -0
- package/dist/core/package-bin.js +30 -0
- package/dist/core/presentations.d.ts +1 -1
- package/dist/core/presentations.js +6 -5
- package/dist/core/{resource-registry.d.ts → resource-definition-set.d.ts} +15 -14
- package/dist/core/resource-definition-set.js +31 -0
- package/dist/core/resource-reports.d.ts +1 -1
- package/dist/core/resource-reports.js +16 -15
- package/dist/core/resource.d.ts +4 -4
- package/dist/core/resources.d.ts +6 -6
- package/dist/core/resources.js +11 -11
- package/dist/core/run-state.d.ts +20 -31
- package/dist/core/run-state.js +34 -25
- package/dist/core/run.d.ts +30 -32
- package/dist/core/run.js +33 -39
- package/dist/core/setup-phases.d.ts +14 -0
- package/dist/core/setup-phases.js +24 -0
- package/dist/core/state-directory.d.ts +2 -2
- package/dist/core/state-directory.js +3 -3
- package/dist/core/timeline.d.ts +4 -2
- package/dist/core/timeline.js +11 -5
- package/dist/extension-commands.js +6 -10
- package/dist/extensions/github/{world.d.ts → context.d.ts} +1 -1
- package/dist/extensions/github/context.js +3 -0
- package/dist/extensions/github/definition.d.ts +1 -1
- package/dist/extensions/github/definition.js +3 -3
- package/dist/extensions/github/extension.d.ts +1 -1
- package/dist/extensions/github/index.d.ts +2 -2
- package/dist/extensions/github/index.js +4 -4
- package/dist/extensions/github/lifecycle.d.ts +3 -3
- package/dist/extensions/github/lifecycle.js +14 -14
- package/dist/extensions/github/live/context.d.ts +6 -0
- package/dist/extensions/github/live/context.js +16 -0
- package/dist/extensions/github/resource.d.ts +1 -1
- package/dist/extensions/playwright/driver.d.ts +8 -0
- package/dist/extensions/playwright/driver.js +60 -0
- package/dist/extensions/playwright/extension.d.ts +2 -0
- package/dist/extensions/playwright/extension.js +12 -0
- package/dist/extensions/playwright/plan/gateways.d.ts +62 -0
- package/dist/extensions/playwright/plan/gateways.js +4 -0
- package/dist/extensions/playwright/plan/list-output.d.ts +26 -0
- package/dist/extensions/playwright/plan/list-output.js +101 -0
- package/dist/extensions/playwright/plan/live/list-gateway.d.ts +15 -0
- package/dist/extensions/playwright/plan/live/list-gateway.js +100 -0
- package/dist/extensions/playwright/plan/plan.d.ts +44 -0
- package/dist/extensions/playwright/plan/plan.js +53 -0
- package/dist/extensions/testserver/command-tree.d.ts +1 -1
- package/dist/extensions/testserver/command-tree.js +2 -2
- package/dist/extensions/testserver/commands/app.d.ts +7 -7
- package/dist/extensions/testserver/commands/pool/create/command.d.ts +5 -5
- package/dist/extensions/testserver/commands/pool/create/command.js +12 -13
- package/dist/extensions/testserver/commands/pool/list/command.js +5 -6
- package/dist/extensions/testserver/{world.d.ts → context.d.ts} +1 -1
- package/dist/extensions/testserver/context.js +4 -0
- package/dist/extensions/testserver/definition.d.ts +2 -2
- package/dist/extensions/testserver/definition.js +8 -7
- package/dist/extensions/testserver/events.d.ts +1 -1
- package/dist/extensions/testserver/extension.d.ts +4 -3
- package/dist/extensions/testserver/extension.js +33 -20
- package/dist/extensions/testserver/index.d.ts +2 -2
- package/dist/extensions/testserver/index.js +2 -2
- package/dist/extensions/testserver/lifecycle.d.ts +6 -5
- package/dist/extensions/testserver/lifecycle.js +9 -8
- package/dist/extensions/testserver/live/context.d.ts +8 -0
- package/dist/extensions/testserver/live/{world.js → context.js} +6 -7
- package/dist/extensions/testserver/options/rules.d.ts +3 -3
- package/dist/extensions/testserver/options/rules.js +5 -4
- package/dist/extensions/testserver/options/sandboxes.d.ts +3 -2
- package/dist/extensions/testserver/options/sandboxes.js +3 -2
- package/dist/extensions/testserver/playwright/index.d.ts +33 -0
- package/dist/extensions/testserver/playwright/index.js +43 -0
- package/dist/extensions/testserver/presentation.d.ts +4 -4
- package/dist/extensions/testserver/presentation.js +7 -7
- package/dist/extensions/testserver/progress.d.ts +3 -3
- package/dist/extensions/testserver/progress.js +3 -3
- package/dist/extensions/testserver/provision.d.ts +2 -2
- package/dist/extensions/testserver/provision.js +10 -10
- package/dist/extensions/testserver/resource.d.ts +2 -2
- package/dist/extensions/testserver/result.d.ts +2 -2
- package/dist/extensions/testserver/result.js +1 -1
- package/dist/extensions/testserver/run/connection.d.ts +1 -1
- package/dist/extensions/testserver/run/connection.js +3 -3
- package/dist/extensions/testserver/run/sandbox.d.ts +31 -0
- package/dist/extensions/testserver/run/sandbox.js +58 -0
- package/dist/extensions/testserver/run-sandbox.d.ts +2 -2
- package/dist/extensions/testserver/run-sandbox.js +3 -3
- package/dist/extensions/testserver/vercel-cli/arguments.d.ts +2 -2
- package/dist/extensions/testserver/vercel-cli/arguments.js +6 -6
- package/dist/extensions/testserver/vercel-cli/auth-config.d.ts +7 -7
- package/dist/extensions/testserver/vercel-cli/auth-config.js +4 -4
- package/dist/extensions/testserver/vercel-cli/clock.js +1 -1
- package/dist/extensions/testserver/vercel-cli/config-files.js +1 -1
- package/dist/extensions/testserver/vercel-cli/context.d.ts +1 -1
- package/dist/extensions/testserver/vercel-cli/context.js +2 -2
- package/dist/extensions/testserver/vercel-cli/entry.d.ts +1 -1
- package/dist/extensions/testserver/vercel-cli/entry.js +1 -1
- package/dist/extensions/testserver/vercel-cli/environment.d.ts +5 -5
- package/dist/extensions/testserver/vercel-cli/environment.js +6 -6
- package/dist/extensions/testserver/vercel-cli/gateways.d.ts +1 -1
- package/dist/extensions/testserver/vercel-cli/gateways.js +3 -3
- package/dist/extensions/testserver/vercel-cli/index.d.ts +1 -1
- package/dist/extensions/testserver/vercel-cli/index.js +8 -9
- package/dist/extensions/testserver/vercel-cli/invocation.d.ts +13 -12
- package/dist/extensions/testserver/vercel-cli/invocation.js +1 -1
- package/dist/extensions/testserver/vercel-cli/{driver.d.ts → invoker.d.ts} +18 -17
- package/dist/extensions/testserver/vercel-cli/{driver.js → invoker.js} +8 -8
- package/dist/extensions/testserver/vercel-cli/live/config-files.d.ts +2 -2
- package/dist/extensions/testserver/vercel-cli/live/config-files.js +2 -2
- package/dist/extensions/testserver/vercel-cli/live/process-gateway.js +1 -1
- package/dist/extensions/testserver/vercel-cli/report.js +2 -2
- package/dist/extensions/testserver/vercel-cli/verbose.js +1 -1
- package/dist/extensions/testserver/vitest/config.d.ts +3 -3
- package/dist/extensions/testserver/vitest/config.js +5 -13
- package/dist/extensions/testserver/vitest/container-scope.d.ts +11 -11
- package/dist/extensions/testserver/vitest/container-scope.js +9 -9
- package/dist/extensions/testserver/vitest/container-start.d.ts +6 -6
- package/dist/extensions/testserver/vitest/container-start.js +14 -11
- package/dist/extensions/testserver/vitest/diagnostics.d.ts +1 -1
- package/dist/extensions/testserver/vitest/fixtures.d.ts +11 -11
- package/dist/extensions/testserver/vitest/fixtures.js +14 -23
- package/dist/extensions/testserver/vitest/index.d.ts +1 -1
- package/dist/extensions/testserver/vitest/index.js +4 -4
- package/dist/extensions/testserver/vitest/types.d.ts +16 -18
- package/dist/extensions/testserver/vitest/types.js +2 -2
- package/dist/extensions/testserver/vitest/worker-sandbox.d.ts +8 -0
- package/dist/extensions/testserver/vitest/worker-sandbox.js +17 -0
- package/dist/extensions/vitest/driver.d.ts +8 -0
- package/dist/extensions/vitest/driver.js +62 -0
- package/dist/extensions/vitest/extension.d.ts +2 -0
- package/dist/extensions/vitest/extension.js +8 -0
- package/dist/{vitest → extensions/vitest/plan}/gateways.d.ts +1 -26
- package/dist/extensions/vitest/plan/gateways.js +3 -0
- package/dist/{vitest → extensions/vitest/plan}/live/list-gateway.d.ts +1 -2
- package/dist/{vitest → extensions/vitest/plan}/live/list-gateway.js +1 -20
- package/dist/extensions/vitest/plan/plan-over.d.ts +38 -0
- package/dist/extensions/vitest/plan/plan-over.js +31 -0
- package/dist/extensions/vitest/plan/plan.d.ts +24 -0
- package/dist/{vitest → extensions/vitest/plan}/plan.js +11 -26
- package/dist/extensions.d.ts +40 -18
- package/dist/extensions.js +49 -22
- package/dist/forward-sigterm.js +1 -1
- package/dist/launcher-resolvers/index.d.ts +1 -1
- package/dist/launcher-resolvers/local-services.d.ts +9 -44
- package/dist/launcher-resolvers/local-services.js +4 -5
- package/dist/live-app.js +7 -6
- package/dist/local-services.d.ts +7 -15
- package/dist/local-services.js +8 -29
- package/dist/playwright/index.d.ts +1 -0
- package/dist/playwright/index.js +4 -0
- package/dist/playwright/reporter.d.ts +96 -0
- package/dist/playwright/reporter.js +162 -0
- package/dist/playwright/worker-index.d.ts +7 -0
- package/dist/playwright/worker-index.js +20 -0
- package/dist/run-directory/index.d.ts +1 -1
- package/dist/run-directory/index.js +2 -3
- package/dist/run-directory/plan.d.ts +3 -3
- package/dist/run-directory/plan.js +5 -5
- package/dist/run-directory/reader.js +2 -2
- package/dist/run-directory/recording.d.ts +8 -5
- package/dist/run-directory/recording.js +6 -6
- package/dist/run-directory/run-collector.d.ts +5 -5
- package/dist/run-directory/run-collector.js +5 -5
- package/dist/run-directory/run-record.d.ts +17 -90
- package/dist/run-directory/run-record.js +15 -55
- package/dist/run-directory/timeline-facts.d.ts +2 -1
- package/dist/run-directory/timeline-facts.js +4 -2
- package/dist/runner/build-snapshots.d.ts +115 -0
- package/dist/runner/build-snapshots.js +146 -0
- package/dist/runner/context.js +2 -1
- package/dist/runner/events.d.ts +24 -69
- package/dist/runner/gateways.d.ts +20 -18
- package/dist/runner/index.d.ts +8 -7
- package/dist/runner/index.js +5 -3
- package/dist/runner/live/checkout-gateway.js +15 -7
- package/dist/runner/live/snapshot-records.js +7 -17
- package/dist/runner/prepare.d.ts +17 -50
- package/dist/runner/prepare.js +21 -25
- package/dist/runner/ready.d.ts +15 -11
- package/dist/runner/ready.js +32 -40
- package/dist/runner/recipe.d.ts +4 -18
- package/dist/runner/recipe.js +1 -13
- package/dist/runner/scope.d.ts +8 -32
- package/dist/runner/scope.js +4 -12
- package/dist/runner/secrets.d.ts +6 -0
- package/dist/runner/secrets.js +10 -0
- package/dist/runner/session.d.ts +19 -38
- package/dist/runner/session.js +16 -55
- package/dist/runner/snapshot-build.d.ts +21 -11
- package/dist/runner/snapshot-build.js +11 -16
- package/dist/runner/snapshot-cache.d.ts +98 -72
- package/dist/runner/snapshot-cache.js +69 -118
- package/dist/runner/snapshot-inspect.d.ts +85 -0
- package/dist/runner/snapshot-inspect.js +164 -0
- package/dist/runner/snapshot-key.d.ts +13 -15
- package/dist/runner/snapshot-key.js +15 -22
- package/dist/sdk/extension/commands.d.ts +35 -17
- package/dist/sdk/extension/commands.js +13 -11
- package/dist/sdk/extension/driver.d.ts +143 -0
- package/dist/sdk/extension/driver.js +28 -0
- package/dist/sdk/extension/index.d.ts +2 -1
- package/dist/sdk/extension/index.js +15 -9
- package/dist/sdk/extension/{launcher-supplies.d.ts → launcher-context.d.ts} +3 -3
- package/dist/sdk/extension/launcher-context.js +5 -0
- package/dist/sdk/extension/lifecycle.d.ts +6 -5
- package/dist/sdk/extension/lifecycle.js +2 -2
- package/dist/sdk/extension/resource-definition.d.ts +13 -13
- package/dist/sdk/extension/resource-definition.js +2 -2
- package/dist/sdk/extension/resource.d.ts +13 -13
- package/dist/sdk/extension/resource.js +11 -11
- package/dist/sdk/extension/time.js +2 -2
- package/dist/sdk/index.d.ts +2 -0
- package/dist/sdk/index.js +3 -1
- package/dist/sdk/run/launcher.d.ts +1 -1
- package/dist/sdk/run/launcher.js +4 -3
- package/dist/sdk/run/payload.js +1 -1
- package/dist/sdk/run/test-events.d.ts +24 -18
- package/dist/sdk/run/test-events.js +5 -4
- package/dist/sdk/run/test-result-writer.d.ts +77 -0
- package/dist/sdk/run/test-result-writer.js +143 -0
- package/dist/sdk/run/worker-test-event-writer.d.ts +13 -0
- package/dist/sdk/run/worker-test-event-writer.js +31 -0
- package/dist/vendor/testserver-sdk/container/container.d.ts +1 -6
- package/dist/vendor/testserver-sdk/container/container.js +1 -5
- package/dist/vendor/testserver-sdk/factories/build.d.ts +12 -40
- package/dist/vendor/testserver-sdk/factories/build.js +15 -66
- package/dist/vendor/testserver-sdk/factories/gateways.d.ts +1 -2
- package/dist/vendor/testserver-sdk/factories/index.d.ts +1 -3
- package/dist/vendor/testserver-sdk/factories/index.js +3 -5
- package/dist/vendor/testserver-sdk/index.d.ts +1 -2
- package/dist/vendor/testserver-sdk/index.js +5 -6
- package/dist/vendor/testserver-sdk/records/body.d.ts +1 -1
- package/dist/vendor/testserver-sdk/records/body.js +1 -1
- package/dist/vitest/index.d.ts +2 -1
- package/dist/vitest/index.js +6 -4
- package/dist/vitest/test-events.d.ts +6 -16
- package/dist/vitest/test-events.js +15 -40
- package/dist/vitest/test-results.d.ts +9 -31
- package/dist/vitest/test-results.js +34 -105
- package/dist/vitest/worker-index.d.ts +6 -0
- package/dist/vitest/worker-index.js +17 -0
- package/package.json +23 -9
- package/skills/overview.md +6 -8
- package/skills/read-run-output.md +21 -7
- package/dist/chunks/chunk-FVMQKYTT.js +0 -10
- package/dist/chunks/chunk-SLNKW4ZM.js +0 -40
- package/dist/chunks/chunk-WNIQA5J6.js +0 -19
- package/dist/chunks/chunk-WSIF7SR6.js +0 -10
- package/dist/commands/vitest/outcomes.d.ts +0 -379
- package/dist/commands/vitest/outcomes.js +0 -70
- package/dist/core/launcher-supplies.d.ts +0 -11
- package/dist/core/launcher-supplies.js +0 -28
- package/dist/core/live/terminal-command-gateway.d.ts +0 -8
- package/dist/core/live/terminal-command-gateway.js +0 -49
- package/dist/core/resource-registry.js +0 -30
- package/dist/extensions/github/live/world.d.ts +0 -6
- package/dist/extensions/github/live/world.js +0 -16
- package/dist/extensions/github/world.js +0 -3
- package/dist/extensions/story/command-tree.d.ts +0 -6
- package/dist/extensions/story/command-tree.js +0 -21
- package/dist/extensions/story/commands/app.d.ts +0 -23
- package/dist/extensions/story/commands/app.js +0 -5
- package/dist/extensions/story/commands/run/command.d.ts +0 -211
- package/dist/extensions/story/commands/run/command.js +0 -259
- package/dist/extensions/story/commands/run/metadata.js +0 -8
- package/dist/extensions/story/commands/run/outcomes.d.ts +0 -101
- package/dist/extensions/story/commands/run/outcomes.js +0 -73
- package/dist/extensions/story/commands/tree.d.ts +0 -2
- package/dist/extensions/story/commands/tree.js +0 -6
- package/dist/extensions/story/extension.d.ts +0 -2
- package/dist/extensions/story/extension.js +0 -8
- package/dist/extensions/testserver/live/world.d.ts +0 -8
- package/dist/extensions/testserver/vitest/sandbox.d.ts +0 -25
- package/dist/extensions/testserver/vitest/sandbox.js +0 -43
- package/dist/extensions/testserver/world.js +0 -4
- package/dist/runner/snapshot-save.d.ts +0 -56
- package/dist/runner/snapshot-save.js +0 -151
- package/dist/sdk/extension/launcher-supplies.js +0 -3
- package/dist/story/align.d.ts +0 -37
- package/dist/story/align.js +0 -39
- package/dist/story/command-line.d.ts +0 -24
- package/dist/story/command-line.js +0 -88
- package/dist/story/definition.d.ts +0 -59
- package/dist/story/definition.js +0 -9
- package/dist/story/diff.d.ts +0 -9
- package/dist/story/diff.js +0 -97
- package/dist/story/errors.d.ts +0 -14
- package/dist/story/errors.js +0 -21
- package/dist/story/gateways.d.ts +0 -94
- package/dist/story/gateways.js +0 -3
- package/dist/story/host.d.ts +0 -30
- package/dist/story/host.js +0 -97
- package/dist/story/index.d.ts +0 -8
- package/dist/story/index.js +0 -11
- package/dist/story/json.d.ts +0 -16
- package/dist/story/json.js +0 -59
- package/dist/story/launch.d.ts +0 -70
- package/dist/story/launch.js +0 -77
- package/dist/story/live/recording-gateway.d.ts +0 -2
- package/dist/story/live/recording-gateway.js +0 -103
- package/dist/story/orphans.d.ts +0 -35
- package/dist/story/orphans.js +0 -51
- package/dist/story/recording.d.ts +0 -62
- package/dist/story/recording.js +0 -97
- package/dist/story/report.d.ts +0 -42
- package/dist/story/report.js +0 -129
- package/dist/story/sequence.d.ts +0 -30
- package/dist/story/sequence.js +0 -74
- package/dist/story/settle.d.ts +0 -96
- package/dist/story/settle.js +0 -71
- package/dist/story/start.d.ts +0 -50
- package/dist/story/start.js +0 -183
- package/dist/vendor/testserver-sdk/factories/definition.d.ts +0 -39
- package/dist/vendor/testserver-sdk/factories/definition.js +0 -16
- package/dist/vendor/testserver-sdk/factories/definitions.d.ts +0 -169
- package/dist/vendor/testserver-sdk/factories/definitions.js +0 -245
- package/dist/vendor/testserver-sdk/seed/index.d.ts +0 -1
- package/dist/vendor/testserver-sdk/seed/index.js +0 -3
- package/dist/vendor/testserver-sdk/seed/seed.d.ts +0 -221
- package/dist/vendor/testserver-sdk/seed/seed.js +0 -171
- package/dist/vitest/find-vitest.d.ts +0 -7
- package/dist/vitest/find-vitest.js +0 -28
- package/dist/vitest/gateways.js +0 -4
- package/dist/vitest/plan.d.ts +0 -51
- /package/dist/{extensions/story/commands/run → commands/playwright}/metadata.d.ts +0 -0
- /package/dist/{vitest → extensions/vitest/plan}/list-output.d.ts +0 -0
- /package/dist/{vitest → extensions/vitest/plan}/list-output.js +0 -0
|
@@ -1,189 +1,31 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
RUN_REQUEST_FIELDS,
|
|
7
|
-
RUN_USAGE_FLAGS,
|
|
8
|
-
canceledBeforeStart,
|
|
9
|
-
checkoutFailedRefusal,
|
|
10
|
-
ranSchema,
|
|
11
|
-
renderRan,
|
|
12
|
-
runCommand,
|
|
13
|
-
runProblems
|
|
14
|
-
} from "../../chunks/chunk-TRFEAYNC.js";
|
|
2
|
+
defineRunCommand
|
|
3
|
+
} from "../../chunks/chunk-EGNP3S6C.js";
|
|
4
|
+
import "../../chunks/chunk-DOFB2ACU.js";
|
|
5
|
+
import "../../chunks/chunk-Q4TKRILH.js";
|
|
15
6
|
import "../../chunks/chunk-I5GZLOLQ.js";
|
|
16
|
-
import "../../chunks/chunk-
|
|
7
|
+
import "../../chunks/chunk-N7E6DAUE.js";
|
|
8
|
+
import "../../chunks/chunk-AX4EQZUS.js";
|
|
9
|
+
import "../../chunks/chunk-2NZXL6OH.js";
|
|
17
10
|
import {
|
|
18
|
-
|
|
19
|
-
} from "../../chunks/chunk-
|
|
20
|
-
import
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
import "../../chunks/chunk-
|
|
26
|
-
import "../../chunks/chunk-
|
|
27
|
-
import "../../chunks/chunk-
|
|
28
|
-
import "../../chunks/chunk-
|
|
29
|
-
import "../../chunks/chunk-
|
|
30
|
-
import "../../chunks/chunk-
|
|
31
|
-
import "../../chunks/chunk-
|
|
32
|
-
import "../../chunks/chunk-
|
|
33
|
-
import {
|
|
34
|
-
planSchema
|
|
35
|
-
} from "../../chunks/chunk-KR7WIYLG.js";
|
|
36
|
-
import "../../chunks/chunk-O4BUT7BE.js";
|
|
37
|
-
import "../../chunks/chunk-AMTYHUYB.js";
|
|
38
|
-
import {
|
|
39
|
-
stormCommands
|
|
40
|
-
} from "../../chunks/chunk-3ZZVZPMG.js";
|
|
41
|
-
import {
|
|
42
|
-
defineOutcomes,
|
|
43
|
-
refused
|
|
44
|
-
} from "../../chunks/chunk-4PRAB24Y.js";
|
|
45
|
-
|
|
46
|
-
// src/commands/vitest/command.ts
|
|
47
|
-
import { join } from "node:path";
|
|
48
|
-
import { z as z2 } from "zod";
|
|
49
|
-
|
|
50
|
-
// src/commands/vitest/outcomes.ts
|
|
51
|
-
import { z } from "zod";
|
|
52
|
-
var listedShape = {
|
|
53
|
-
/** The arguments given to `vitest run`, which `vitest list --json` was given too. */
|
|
54
|
-
args: z.array(z.string()),
|
|
55
|
-
/** The directory `vitest list` ran in, on this machine. */
|
|
56
|
-
cwd: z.string()
|
|
57
|
-
};
|
|
58
|
-
var outcomes = defineOutcomes({
|
|
59
|
-
results: {
|
|
60
|
-
ran: {
|
|
61
|
-
schema: ranSchema.extend({
|
|
62
|
-
/**
|
|
63
|
-
* The test plan: what `vitest list` counted before the run, and each resource option whose default is a
|
|
64
|
-
* function of it, with its value and where that came from.
|
|
65
|
-
*/
|
|
66
|
-
plan: planSchema
|
|
67
|
-
}),
|
|
68
|
-
description: RAN_DESCRIPTION,
|
|
69
|
-
render: renderRan
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
errors: {
|
|
73
|
-
...RUN_ERRORS,
|
|
74
|
-
noMatchingTests: {
|
|
75
|
-
exitCode: 1,
|
|
76
|
-
description: "vitest list found no test for the arguments given to vitest run, so nothing was minted, acquired or started.",
|
|
77
|
-
schema: z.object(listedShape),
|
|
78
|
-
render: ({ args, cwd }) => ({
|
|
79
|
-
message: `vitest list found no test for vitest run ${argsText(args)} in ${cwd}. The command didn't run.`,
|
|
80
|
-
next: [
|
|
81
|
-
{
|
|
82
|
-
type: "text",
|
|
83
|
-
text: `Change the arguments given to vitest run (${argsText(args)}), then retry. Put vitest's own dash options after --.`
|
|
84
|
-
}
|
|
85
|
-
]
|
|
86
|
-
})
|
|
87
|
-
},
|
|
88
|
-
vitestListFailed: {
|
|
89
|
-
exitCode: 1,
|
|
90
|
-
description: "storm couldn't count the tests before the run: vitest wasn't found or failed to start, didn't finish within 60s, exited other than 0, or printed something other than a list of tests. Nothing was minted, acquired or started.",
|
|
91
|
-
schema: z.object({
|
|
92
|
-
/** How listing failed: vitest wasn't found or couldn't start (`start-failed`), didn't finish (`timed-out`), exited other than 0 (`exited`), or printed something other than a list of tests (`unreadable-output`). */
|
|
93
|
-
kind: z.enum(["start-failed", "timed-out", "exited", "unreadable-output"]),
|
|
94
|
-
/** What went wrong, such as the directories searched for vitest, or the last line of vitest's stderr. */
|
|
95
|
-
message: z.string(),
|
|
96
|
-
...listedShape
|
|
97
|
-
}),
|
|
98
|
-
render: ({ kind, message, cwd }) => ({
|
|
99
|
-
message: `Couldn't count the tests in ${cwd}: ${/[.!?]$/.test(message) ? message : `${message}.`} The command didn't run.`,
|
|
100
|
-
next: [{ type: "text", text: LIST_FAILED_NEXT[kind] }]
|
|
101
|
-
})
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
function argsText(args) {
|
|
106
|
-
return args.length === 0 ? "(none)" : args.join(" ");
|
|
107
|
-
}
|
|
108
|
-
var LIST_FAILED_NEXT = {
|
|
109
|
-
"start-failed": "Install vitest in the package, or run the command with storm exec, which counts nothing.",
|
|
110
|
-
"timed-out": "Check why vitest list doesn't finish, such as a global setup that waits, then retry.",
|
|
111
|
-
exited: "Fix what vitest list reports, then retry. vitest list takes the arguments vitest run does, but refuses some run-only options.",
|
|
112
|
-
"unreadable-output": "Check that the package's vitest prints its list with --json, then retry."
|
|
113
|
-
};
|
|
11
|
+
driverNamed
|
|
12
|
+
} from "../../chunks/chunk-5UMJNVKT.js";
|
|
13
|
+
import "../../chunks/chunk-IYM44FUX.js";
|
|
14
|
+
import "../../chunks/chunk-LQKNI3EG.js";
|
|
15
|
+
import "../../chunks/chunk-NMVODY3P.js";
|
|
16
|
+
import "../../chunks/chunk-YGS5VRQT.js";
|
|
17
|
+
import "../../chunks/chunk-RTILVSYQ.js";
|
|
18
|
+
import "../../chunks/chunk-6EQKA7LI.js";
|
|
19
|
+
import "../../chunks/chunk-ZDJLKF2G.js";
|
|
20
|
+
import "../../chunks/chunk-YT5OROR7.js";
|
|
21
|
+
import "../../chunks/chunk-BW2ADH7U.js";
|
|
22
|
+
import "../../chunks/chunk-GQIL3AHY.js";
|
|
23
|
+
import "../../chunks/chunk-GSC6SRTW.js";
|
|
24
|
+
import "../../chunks/chunk-43MWZLJR.js";
|
|
25
|
+
import "../../chunks/chunk-YM6TZV4L.js";
|
|
114
26
|
|
|
115
27
|
// src/commands/vitest/command.ts
|
|
116
|
-
var command_default =
|
|
117
|
-
requestSchema: z2.object({ ...RUN_REQUEST_FIELDS, args: z2.array(z2.string()).default([]) }),
|
|
118
|
-
cli: { options: RUN_CLI_OPTIONS, positionals: ["args"] },
|
|
119
|
-
help: {
|
|
120
|
-
usages: [`${RUN_USAGE_FLAGS} [<vitest run args>...] [-- <vitest dash options>...]`],
|
|
121
|
-
fields: {
|
|
122
|
-
...RUN_FIELDS,
|
|
123
|
-
args: {
|
|
124
|
-
valueLabel: "args",
|
|
125
|
-
description: "What vitest run gets, unchanged and in order: every argument that isn't one of storm's flags, such as file filters, then everything after --, such as -t or --project. vitest list --json gets the same arguments when it counts the tests."
|
|
126
|
-
}
|
|
127
|
-
},
|
|
128
|
-
examples: [
|
|
129
|
-
{
|
|
130
|
-
argv: "",
|
|
131
|
-
description: "Run every test in a runner sandbox, with the runner recipe, team, project and resources from storm.config.ts, each resource that sizes itself sized from the test count."
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
argv: "test/api -- -t creates",
|
|
135
|
-
description: "Run the tests named creates in the files under test/api."
|
|
136
|
-
},
|
|
137
|
-
...resourceRunExamples("vitest")
|
|
138
|
-
]
|
|
139
|
-
},
|
|
140
|
-
response: outcomes,
|
|
141
|
-
validate: runProblems,
|
|
142
|
-
handler: async (context, request) => await runCommand(context, request, {
|
|
143
|
-
name: "vitest",
|
|
144
|
-
planCommand: async (where, signal) => await planVitestCommand(context.app, request.args, where, signal),
|
|
145
|
-
ran: (facts, { testPlan, options }) => outcomes.ran({ ...facts, plan: { tests: testPlan.tests, files: testPlan.files, options: [...options] } })
|
|
146
|
-
})
|
|
147
|
-
});
|
|
148
|
-
async function planVitestCommand(app, args, where, signal) {
|
|
149
|
-
let cwd;
|
|
150
|
-
let found;
|
|
151
|
-
if (where.kind === "unsandboxed") {
|
|
152
|
-
cwd = app.cwd;
|
|
153
|
-
found = await app.vitest.find(cwd);
|
|
154
|
-
} else {
|
|
155
|
-
const root = await app.context.checkout.repositoryRoot({ cwd: app.cwd });
|
|
156
|
-
if (!root.ok) return refused(checkoutFailedRefusal(root.failure));
|
|
157
|
-
cwd = join(root.value, where.recipe.cwd);
|
|
158
|
-
found = await app.context.vitestList.findVitest({ from: cwd, root: root.value });
|
|
159
|
-
}
|
|
160
|
-
if (!found.ok)
|
|
161
|
-
return refused(
|
|
162
|
-
outcomes.vitestListFailed({
|
|
163
|
-
kind: "start-failed",
|
|
164
|
-
message: `found no vitest in node_modules/.bin of ${found.searched.join(", ")}`,
|
|
165
|
-
args: [...args],
|
|
166
|
-
cwd
|
|
167
|
-
})
|
|
168
|
-
);
|
|
169
|
-
const planned = await planVitestRun({ args, cwd, executable: found.path, signal }, app.context.vitestList);
|
|
170
|
-
if (!planned.ok) {
|
|
171
|
-
const { failure } = planned;
|
|
172
|
-
if (failure.kind === "canceled") return refused(canceledBeforeStart());
|
|
173
|
-
return refused(
|
|
174
|
-
outcomes.vitestListFailed({
|
|
175
|
-
kind: failure.kind,
|
|
176
|
-
message: describeVitestListFailure(failure),
|
|
177
|
-
args: [...args],
|
|
178
|
-
cwd
|
|
179
|
-
})
|
|
180
|
-
);
|
|
181
|
-
}
|
|
182
|
-
const { tests, files } = planned.plan;
|
|
183
|
-
if (tests === 0) return refused(outcomes.noMatchingTests({ args: [...args], cwd }));
|
|
184
|
-
const executable = where.kind === "unsandboxed" ? found.path : "vitest";
|
|
185
|
-
return { ok: true, argv: vitestRunArgv(executable, args), testPlan: { kind: "counted", tests, files } };
|
|
186
|
-
}
|
|
28
|
+
var command_default = defineRunCommand(driverNamed("vitest"));
|
|
187
29
|
export {
|
|
188
30
|
command_default as default
|
|
189
31
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/commands/vitest/metadata.ts
|
|
2
2
|
var metadata = {
|
|
3
|
-
description: "Run vitest run with the run payload in STORM_RUN, after counting its tests and sizing the run. storm's flags come first; every other argument goes to vitest run unchanged, in order. Put vitest's own dash options, such as -t or --project, after --. Before anything is minted, acquired or started, it counts the tests with vitest list --json and the same arguments, on this machine, with this machine's environment: in the working directory for an unsandboxed run (--unsandboxed), and in <repository root>/<runner cwd> for a sandboxed run, the directory where vitest runs in the runner sandbox. It refuses with no_matching_tests when vitest lists none, and with
|
|
3
|
+
description: "Run vitest run with the run payload in STORM_RUN, after counting its tests and sizing the run. storm's flags come first; every other argument goes to vitest run unchanged, in order. Put vitest's own dash options, such as -t or --project, after --. Before anything is minted, acquired or started, it counts the tests with vitest list --json and the same arguments, on this machine, with this machine's environment: in the working directory for an unsandboxed run (--unsandboxed), and in <repository root>/<runner cwd> for a sandboxed run, the directory where vitest runs in the runner sandbox. It refuses with no_matching_tests when vitest lists none, and with driver_plan_failed when listing fails; vitest list refuses some options only vitest run takes. A signal while it counts stops vitest list and cancels the run. A vitest config that resolves only inside the runner sandbox can't be counted here: run it with storm exec. A resource of the run may size itself from the count: an option whose default is a function of the test plan takes its own flag if given, else its key in storm.config.ts, else the default for the count; the run says each such option's value and where it came from on stderr before it acquires anything. In an unsandboxed run, vitest is the nearest node_modules/.bin/vitest from the working directory up to the repository's root, or the filesystem's root outside a repository; in a sandboxed run, vitest from the runner's PATH, which starts with node_modules/.bin of the runner cwd and of the repository's root. Otherwise it runs as storm exec does: in a runner sandbox by default or on this machine with --unsandboxed, with a live view or plain lines on stderr, a waterfall, a run directory that storm runs show reads back, and the exit code of vitest. The run's result and its run directory's run.json carry the test plan: the tests and files counted, and each option sized from them, with its value and where it came from.",
|
|
4
4
|
summary: "Count the tests, size the run, and run vitest."
|
|
5
5
|
};
|
|
6
6
|
export {
|
|
@@ -5,7 +5,7 @@ import type { RunnerRecipe as RunnerRecipeOf } from "../runner/recipe.ts";
|
|
|
5
5
|
export { pnpmToolchains } from "./toolchain.ts";
|
|
6
6
|
export type { RecipeRun } from "../config/recipe-run.ts";
|
|
7
7
|
export type { Resource } from "../sdk/extension/resource-definition.ts";
|
|
8
|
-
export type { RunnerStep, RunnerStepContext,
|
|
8
|
+
export type { RunnerStep, RunnerStepContext, RunnerStepList } from "../runner/recipe.ts";
|
|
9
9
|
export type { Present } from "../sdk/run/launcher.ts";
|
|
10
10
|
/**
|
|
11
11
|
* The runner recipe, the `runner` key: its `vcpus` may be a function of the run (`RecipeRun`), which reads a resource
|
package/dist/context.d.ts
CHANGED
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
import { type ConfigGateway, type ConfigResolver, type CredentialResolver } from "./config/index.ts";
|
|
2
2
|
import { type CredentialGateway, type GitHubActionsTokenGateway } from "./credential/index.ts";
|
|
3
|
-
import type {
|
|
3
|
+
import type { PackageBinService } from "./launcher-resolvers/index.ts";
|
|
4
4
|
import type { Presentation } from "./presentation.ts";
|
|
5
|
-
import type { RESOURCES,
|
|
6
|
-
import { type CommandGateway, type JobSummaryGateway, type
|
|
5
|
+
import type { RESOURCES, StormDriverContextMap, StormResourceContextMap } from "./extensions.ts";
|
|
6
|
+
import { type CommandGateway, type JobSummaryGateway, type PackageBinGateway, type ProgressTerminal } from "./core/index.ts";
|
|
7
7
|
import { type RunDirectoryGateway } from "./run-directory/index.ts";
|
|
8
8
|
import { type CheckoutGateway, type RunnerSandboxGateway, type RunnerSnapshotCacheGateway, type RunnerTerminal } from "./runner/index.ts";
|
|
9
9
|
import { type Clock, type Timer } from "./time/index.ts";
|
|
10
|
-
import { type VitestListGateway } from "./vitest/plan.ts";
|
|
11
10
|
/**
|
|
12
|
-
* The gateways and DI seams storm's commands reach the outside through. Each resource reaches it through its own
|
|
13
|
-
* instead (`StormApp.
|
|
11
|
+
* The gateways and DI seams storm's commands reach the outside through. Each resource reaches it through its own
|
|
12
|
+
* Context instead (`StormApp.resourceContexts`), and each driver's plan step through its driver's
|
|
13
|
+
* (`StormApp.driverContexts`). Tests build it over fakes.
|
|
14
14
|
*/
|
|
15
15
|
export interface StormContext {
|
|
16
16
|
readonly credentials: CredentialGateway;
|
|
17
17
|
/** GitHub Actions' OIDC token issuer, for `--credential github-actions`. */
|
|
18
18
|
readonly githubActionsTokens: GitHubActionsTokenGateway;
|
|
19
19
|
readonly commands: CommandGateway;
|
|
20
|
-
/** Commands run on this machine in the launcher's terminal, for the terminal local service. */
|
|
21
|
-
readonly terminalCommands: TerminalCommandGateway;
|
|
22
20
|
readonly config: ConfigGateway;
|
|
23
21
|
/** The local Git checkout the runner uploads from. */
|
|
24
22
|
readonly checkout: CheckoutGateway;
|
|
@@ -34,15 +32,15 @@ export interface StormContext {
|
|
|
34
32
|
readonly progressTerminal: ProgressTerminal;
|
|
35
33
|
/** The GitHub Actions job summary a run appends its summary to, in a step that has one. */
|
|
36
34
|
readonly jobSummary: JobSummaryGateway;
|
|
37
|
-
/**
|
|
38
|
-
readonly
|
|
35
|
+
/** The binaries packages install on this machine, among them `vitest` and `playwright`, which a run finds there. */
|
|
36
|
+
readonly packageBins: PackageBinGateway;
|
|
39
37
|
readonly timer: Timer;
|
|
40
38
|
readonly clock: Clock;
|
|
41
39
|
}
|
|
42
40
|
/**
|
|
43
|
-
* Where a command records the status the process exits with, past Clinkr's: a Clinkr handler's result exits only
|
|
44
|
-
*
|
|
45
|
-
*
|
|
41
|
+
* Where a command records the status the process exits with, past Clinkr's: a Clinkr handler's result exits only 0 or
|
|
42
|
+
* 1, so a run records its command's code (or `128 + n` for a signal) here, and `bin/storm.ts` exits with it when it is
|
|
43
|
+
* set.
|
|
46
44
|
*/
|
|
47
45
|
export interface StormExit {
|
|
48
46
|
status: number | undefined;
|
|
@@ -54,11 +52,15 @@ export interface StormExit {
|
|
|
54
52
|
*/
|
|
55
53
|
export interface StormApp extends LauncherResolvers, LocalServices {
|
|
56
54
|
readonly context: StormContext;
|
|
57
|
-
/** Each definition's
|
|
58
|
-
readonly
|
|
55
|
+
/** Each definition's Context, by its name, built once for the command: what a run hands each resource instance. */
|
|
56
|
+
readonly resourceContexts: StormResourceContextMap;
|
|
57
|
+
/**
|
|
58
|
+
* Each driver's Context, by its name, built once for the command: what a run command hands its driver's plan step.
|
|
59
|
+
*/
|
|
60
|
+
readonly driverContexts: StormDriverContextMap;
|
|
59
61
|
/** Every resource definition, which a command checks `storm.config.ts` against. */
|
|
60
62
|
readonly resourceDefinitions: typeof RESOURCES;
|
|
61
|
-
/** The launcher environment: the base of
|
|
63
|
+
/** The launcher environment: the base of the command's environment. */
|
|
62
64
|
readonly env: Readonly<Record<string, string | undefined>>;
|
|
63
65
|
/** The launcher's working directory, where the search for `storm.config.ts` starts. */
|
|
64
66
|
readonly cwd: string;
|
|
@@ -76,8 +78,8 @@ export interface StormApp extends LauncherResolvers, LocalServices {
|
|
|
76
78
|
readonly exit: StormExit;
|
|
77
79
|
}
|
|
78
80
|
/**
|
|
79
|
-
* The launcher resolvers, which every command gets in its app, an extension's own commands among them, so none calls
|
|
80
|
-
* config loading or the credential settling itself.
|
|
81
|
+
* The launcher resolvers, which every command gets in its app, an extension's own commands among them, so none calls
|
|
82
|
+
* the config loading or the credential settling itself.
|
|
81
83
|
*/
|
|
82
84
|
export interface LauncherResolvers {
|
|
83
85
|
/** Loads `storm.config.ts` and gives one resource's options and the control plane target. */
|
|
@@ -92,27 +94,27 @@ export interface LauncherResolvers {
|
|
|
92
94
|
export declare function launcherResolvers(app: Pick<StormApp, "context" | "cwd" | "resourceDefinitions">): LauncherResolvers;
|
|
93
95
|
/**
|
|
94
96
|
* The local services, which every command gets in its app. An extension's own commands reach this machine only through
|
|
95
|
-
* them, since they never see the Context; `storm vitest` finds `vitest` for a run on this machine through the
|
|
96
|
-
* service too, and `exec`'s and `
|
|
97
|
+
* them, since they never see the Context; `storm vitest` finds `vitest` for a run on this machine through the package
|
|
98
|
+
* binary service too, and `exec`'s, `vitest`'s and `playwright`'s runs reach the Context's gateways directly.
|
|
97
99
|
*/
|
|
98
100
|
export interface LocalServices {
|
|
99
|
-
/** Finds
|
|
100
|
-
readonly
|
|
101
|
-
/** Runs a command on this machine in the launcher's terminal. */
|
|
102
|
-
readonly terminal: TerminalService;
|
|
101
|
+
/** Finds a package's binary on this machine, as `storm vitest` finds `vitest` there. */
|
|
102
|
+
readonly packageBins: PackageBinService;
|
|
103
103
|
}
|
|
104
104
|
/** The local services over an app's context. */
|
|
105
|
-
export declare function localServices(
|
|
105
|
+
export declare function localServices(launcher: {
|
|
106
|
+
readonly context: StormContext;
|
|
107
|
+
}): LocalServices;
|
|
106
108
|
/**
|
|
107
109
|
* The live Context: `vercel` for credentials, and for `--credential github-actions` GitHub Actions' token request, read
|
|
108
|
-
* from `env`'s `ACTIONS_ID_TOKEN_REQUEST_*` at each request, with a 10-second timeout;
|
|
109
|
-
* real process
|
|
110
|
+
* from `env`'s `ACTIONS_ID_TOKEN_REQUEST_*` at each request, with a 10-second timeout; the command spawned as a
|
|
111
|
+
* real process; `storm.config.ts`
|
|
110
112
|
* imported by Node; for the runner, git and tar on the local checkout, the runner snapshot cache under `env`'s
|
|
111
113
|
* `XDG_STATE_HOME` or `HOME`, Vercel Sandbox through `@vercel/sandbox` (loaded only when the runner first calls it) and
|
|
112
114
|
* this process's stdout and stderr; the run directories beside the runner snapshot cache; the live view on this
|
|
113
|
-
* process's stderr; the job summary `GITHUB_STEP_SUMMARY` names, if any;
|
|
114
|
-
*
|
|
115
|
-
*
|
|
115
|
+
* process's stderr; the job summary `GITHUB_STEP_SUMMARY` names, if any; a package's binary found in
|
|
116
|
+
* `node_modules/.bin`; and the system timer and clock. When `env` names no place for the state directory, every runner
|
|
117
|
+
* snapshot cache operation fails and says why, which a run treats as an empty cache, and so does opening a run
|
|
116
118
|
* directory, which a run goes on without.
|
|
117
119
|
*/
|
|
118
120
|
export declare function liveContext(options: {
|
package/dist/context.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
// The composition layer's wiring: the one place storm's own live gateways are built. Each resource builds its own
|
|
2
|
-
// (`
|
|
1
|
+
// The composition layer's wiring: the one place storm's own live gateways are built. Each resource builds its own
|
|
2
|
+
// Context (`liveResourceContexts`, through the registry), and each driver its own (`liveDriverContexts`), which the app
|
|
3
|
+
// holds beside the context, so this file names no resource and no driver's gateway.
|
|
3
4
|
import { configResolver, credentialResolver, liveConfigGateway, } from "./config/index.js";
|
|
4
5
|
import { liveCredentialGateway, liveGitHubActionsTokenGateway, } from "./credential/index.js";
|
|
5
|
-
import {
|
|
6
|
-
import { liveCommandGateway, liveJobSummaryGateway,
|
|
6
|
+
import { packageBinService } from "./local-services.js";
|
|
7
|
+
import { liveCommandGateway, liveJobSummaryGateway, livePackageBinGateway, liveProgressTerminal, resolveStateDirectory, stateDirectoryPattern, } from "./core/index.js";
|
|
7
8
|
import { liveRunDirectoryGateway, RUNS_SUBPATH, unavailableRunDirectoryGateway, } from "./run-directory/index.js";
|
|
8
9
|
import { liveCheckoutGateway, liveRunnerSandboxGateway, liveRunnerSnapshotCacheGateway, liveRunnerTerminal, RUNNER_SNAPSHOTS_SUBPATH, unavailableRunnerSnapshotCacheGateway, } from "./runner/index.js";
|
|
9
10
|
import { systemClock, systemTimer } from "./time/index.js";
|
|
10
|
-
import { liveVitestListGateway } from "./vitest/plan.js";
|
|
11
11
|
/**
|
|
12
12
|
* The launcher resolvers over an app's context, from its working directory, checking the file against every resource
|
|
13
13
|
* definition.
|
|
@@ -19,22 +19,19 @@ export function launcherResolvers(app) {
|
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
21
|
/** The local services over an app's context. */
|
|
22
|
-
export function localServices(
|
|
23
|
-
return {
|
|
24
|
-
vitest: vitestService(app.context),
|
|
25
|
-
terminal: terminalService(app.context),
|
|
26
|
-
};
|
|
22
|
+
export function localServices(launcher) {
|
|
23
|
+
return { packageBins: packageBinService(launcher.context) };
|
|
27
24
|
}
|
|
28
25
|
/**
|
|
29
26
|
* The live Context: `vercel` for credentials, and for `--credential github-actions` GitHub Actions' token request, read
|
|
30
|
-
* from `env`'s `ACTIONS_ID_TOKEN_REQUEST_*` at each request, with a 10-second timeout;
|
|
31
|
-
* real process
|
|
27
|
+
* from `env`'s `ACTIONS_ID_TOKEN_REQUEST_*` at each request, with a 10-second timeout; the command spawned as a
|
|
28
|
+
* real process; `storm.config.ts`
|
|
32
29
|
* imported by Node; for the runner, git and tar on the local checkout, the runner snapshot cache under `env`'s
|
|
33
30
|
* `XDG_STATE_HOME` or `HOME`, Vercel Sandbox through `@vercel/sandbox` (loaded only when the runner first calls it) and
|
|
34
31
|
* this process's stdout and stderr; the run directories beside the runner snapshot cache; the live view on this
|
|
35
|
-
* process's stderr; the job summary `GITHUB_STEP_SUMMARY` names, if any;
|
|
36
|
-
*
|
|
37
|
-
*
|
|
32
|
+
* process's stderr; the job summary `GITHUB_STEP_SUMMARY` names, if any; a package's binary found in
|
|
33
|
+
* `node_modules/.bin`; and the system timer and clock. When `env` names no place for the state directory, every runner
|
|
34
|
+
* snapshot cache operation fails and says why, which a run treats as an empty cache, and so does opening a run
|
|
38
35
|
* directory, which a run goes on without.
|
|
39
36
|
*/
|
|
40
37
|
export function liveContext(options) {
|
|
@@ -44,7 +41,6 @@ export function liveContext(options) {
|
|
|
44
41
|
credentials: liveCredentialGateway(),
|
|
45
42
|
githubActionsTokens: liveGitHubActionsTokenGateway({ env: options.env, timeoutMs: 10_000 }),
|
|
46
43
|
commands: liveCommandGateway(),
|
|
47
|
-
terminalCommands: liveTerminalCommandGateway(),
|
|
48
44
|
config: liveConfigGateway(),
|
|
49
45
|
checkout: liveCheckoutGateway(),
|
|
50
46
|
runnerSnapshots: snapshots.ok
|
|
@@ -57,7 +53,7 @@ export function liveContext(options) {
|
|
|
57
53
|
: unavailableRunDirectoryGateway(stateDirectoryPattern(RUNS_SUBPATH), runs.reason),
|
|
58
54
|
progressTerminal: liveProgressTerminal(),
|
|
59
55
|
jobSummary: liveJobSummaryGateway({ path: options.env["GITHUB_STEP_SUMMARY"] }),
|
|
60
|
-
|
|
56
|
+
packageBins: livePackageBinGateway,
|
|
61
57
|
timer: systemTimer,
|
|
62
58
|
clock: systemClock,
|
|
63
59
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Refusal } from "../sdk/extension/index.ts";
|
|
2
2
|
import type { DefinitionLookup } from "./definition-lookup.ts";
|
|
3
|
-
import type { ResourceInputs, ResourceOptions, ResourceRequests, ResourceSkip
|
|
3
|
+
import type { ResourceContextMap, ResourceInputs, ResourceOptions, ResourceRequests, ResourceSkip } from "./resource.ts";
|
|
4
4
|
/**
|
|
5
5
|
* How every resource's `beforeRun` answered, in order: `ok`, with each used instance's part of the run request, each
|
|
6
6
|
* skipped one's notice, the values the run hides as `<token>`, whether any used instance needs the Vercel credential,
|
|
@@ -21,7 +21,7 @@ export type ResourcesBeforeRun = {
|
|
|
21
21
|
readonly refusal: Refusal;
|
|
22
22
|
};
|
|
23
23
|
/**
|
|
24
|
-
* Every resource definition's lifecycle, over its
|
|
24
|
+
* Every resource definition's lifecycle, over its Context, for the run's resources in order.
|
|
25
25
|
*
|
|
26
26
|
* - `secrets`: each resource's secrets from its definition's pure `secrets`, for a refusal that comes before
|
|
27
27
|
* `beforeRun`.
|
|
@@ -32,7 +32,7 @@ export interface ResourceLifecycles {
|
|
|
32
32
|
beforeRun(inputs: ResourceInputs): Promise<ResourcesBeforeRun>;
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
|
-
* Every one of `lookup`'s definitions' lifecycles, each over its own
|
|
36
|
-
* the run's resources in their order.
|
|
35
|
+
* Every one of `lookup`'s definitions' lifecycles, each over its own Context from `resourceContexts`, by its
|
|
36
|
+
* definition's name, for the run's resources in their order.
|
|
37
37
|
*/
|
|
38
|
-
export declare function bindLifecycles(lookup: DefinitionLookup,
|
|
38
|
+
export declare function bindLifecycles(lookup: DefinitionLookup, resourceContexts: ResourceContextMap): ResourceLifecycles;
|
package/dist/core/before-run.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
// How the launcher calls the lifecycle of each of the run's resources before the run starts: each definition's
|
|
2
|
-
// lifecycle, over its own
|
|
3
|
-
// the run to its definition's, with only that resource's options and sources. The
|
|
4
|
-
// it (`
|
|
2
|
+
// lifecycle, over its own Context. `bindLifecycles` builds each definition's lifecycle once, then hands each resource
|
|
3
|
+
// of the run to its definition's, with only that resource's options and sources. The resource definition set's
|
|
4
|
+
// `lifecycles(contexts)` calls it (`resourceDefinitionSet`, `resource-definition-set.ts`).
|
|
5
5
|
/**
|
|
6
|
-
* Every one of `lookup`'s definitions' lifecycles, each over its own
|
|
7
|
-
* the run's resources in their order.
|
|
6
|
+
* Every one of `lookup`'s definitions' lifecycles, each over its own Context from `resourceContexts`, by its
|
|
7
|
+
* definition's name, for the run's resources in their order.
|
|
8
8
|
*/
|
|
9
|
-
export function bindLifecycles(lookup,
|
|
9
|
+
export function bindLifecycles(lookup, resourceContexts) {
|
|
10
10
|
const { definitions: resources, named } = lookup;
|
|
11
|
-
// Each definition's lifecycle, over its own
|
|
12
|
-
const lifecycles = new Map(resources.map((resource) => [resource, resource.lifecycle(
|
|
11
|
+
// Each definition's lifecycle, over its own Context, built once.
|
|
12
|
+
const lifecycles = new Map(resources.map((resource) => [resource, resource.lifecycle(resourceContexts[resource.name])]));
|
|
13
13
|
const lifecycleOf = (definition, key) => {
|
|
14
14
|
const lifecycle = lifecycles.get(named(definition, key));
|
|
15
15
|
if (lifecycle === undefined)
|
|
@@ -5,18 +5,18 @@ export interface InstanceOf<R> {
|
|
|
5
5
|
readonly record: R;
|
|
6
6
|
readonly resource: ResourceDefinition;
|
|
7
7
|
}
|
|
8
|
-
/** Resource definitions, in
|
|
8
|
+
/** Resource definitions, in definition order, looked up by name. */
|
|
9
9
|
export interface DefinitionLookup {
|
|
10
|
-
/** The definitions, in
|
|
10
|
+
/** The definitions, in definition order. */
|
|
11
11
|
readonly definitions: readonly ResourceDefinition[];
|
|
12
12
|
/** The resource definition named `definition`, the definition of resource instance `key`; throws when none is. */
|
|
13
13
|
readonly named: (definition: string, key: string) => ResourceDefinition;
|
|
14
|
-
/** Each of `map`'s resource instances with its definition, in
|
|
15
|
-
readonly
|
|
14
|
+
/** Each of `map`'s resource instances with its definition, in definition order, then the map's order. */
|
|
15
|
+
readonly inDefinitionOrder: <R extends {
|
|
16
16
|
readonly definition: string;
|
|
17
17
|
}>(map: {
|
|
18
18
|
readonly [key: string]: R;
|
|
19
19
|
}) => readonly InstanceOf<R>[];
|
|
20
20
|
}
|
|
21
|
-
/** `definitions`, in
|
|
21
|
+
/** `definitions`, in definition order, looked up by each one's name. */
|
|
22
22
|
export declare function definitionLookup(definitions: readonly ResourceDefinition[]): DefinitionLookup;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
// The
|
|
2
|
-
// over the instances shares:
|
|
3
|
-
// `resource-
|
|
4
|
-
// none of this file. The core holds each definition as `defineResource` returned it,
|
|
5
|
-
// `ResourceDefinition`, whose types are `unknown` wherever the resource has types of its own.
|
|
6
|
-
// the typed object into that view with one cast, which rests on the core's routing: the core
|
|
7
|
-
// taken, event, lane state and record back only to the definition or resource instance that
|
|
8
|
-
// definition's name or its resource key, which `test/unit/core/resource-events.test.ts` holds. It
|
|
9
|
-
|
|
1
|
+
// The resource definition set's lookup of a resource instance's definition by its name, with the one definition order,
|
|
2
|
+
// which every loop over the instances shares: definition order, then the map's order. The definition set
|
|
3
|
+
// (`resourceDefinitionSet`, `resource-definition-set.ts`) builds it once and hands it to what it builds; it stays the
|
|
4
|
+
// core's, since `index.ts` exports none of this file. The core holds each definition as `defineResource` returned it,
|
|
5
|
+
// seen through the bare `ResourceDefinition`, whose types are `unknown` wherever the resource has types of its own.
|
|
6
|
+
// `defineResource` turns the typed object into that view with one cast, which rests on the core's routing: the core
|
|
7
|
+
// hands each Context, thing taken, event, lane state and record back only to the definition or resource instance that
|
|
8
|
+
// produced it, by its definition's name or its resource key, which `test/unit/core/resource-events.test.ts` holds. It
|
|
9
|
+
// names no resource.
|
|
10
|
+
/** `definitions`, in definition order, looked up by each one's name. */
|
|
10
11
|
export function definitionLookup(definitions) {
|
|
11
|
-
// Built once; the first definition of a name wins, as in
|
|
12
|
+
// Built once; the first definition of a name wins, as in definition order.
|
|
12
13
|
const byName = new Map();
|
|
13
14
|
for (const definition of definitions)
|
|
14
15
|
if (!byName.has(definition.name))
|
|
@@ -16,13 +17,13 @@ export function definitionLookup(definitions) {
|
|
|
16
17
|
const named = (definition, key) => {
|
|
17
18
|
const resource = byName.get(definition);
|
|
18
19
|
if (resource === undefined)
|
|
19
|
-
throw new Error(`${key}'s definition, ${definition}, isn't in the
|
|
20
|
+
throw new Error(`${key}'s definition, ${definition}, isn't in the definition set`);
|
|
20
21
|
return resource;
|
|
21
22
|
};
|
|
22
23
|
return {
|
|
23
24
|
definitions,
|
|
24
25
|
named,
|
|
25
|
-
|
|
26
|
+
inDefinitionOrder: (map) => {
|
|
26
27
|
const entries = Object.entries(map).map(([key, record]) => ({
|
|
27
28
|
key,
|
|
28
29
|
record,
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Driver } from "../sdk/extension/index.ts";
|
|
2
|
+
/** What `driversOf` reads of an extension: its drivers, if it brings any, each named. */
|
|
3
|
+
type WithDrivers = {
|
|
4
|
+
readonly drivers?: readonly {
|
|
5
|
+
readonly name: string;
|
|
6
|
+
}[];
|
|
7
|
+
};
|
|
8
|
+
/** One extension's drivers, as the tuple it lists: none for an extension that brings no driver. */
|
|
9
|
+
type DriversIn<Extension extends WithDrivers> = Extension extends {
|
|
10
|
+
readonly drivers?: infer Drivers;
|
|
11
|
+
} ? Drivers extends readonly unknown[] ? Drivers : readonly [] : readonly [];
|
|
12
|
+
/** Every extension's drivers, each extension's in turn, as one tuple, so each driver keeps its place and its type. */
|
|
13
|
+
export type DriversOf<E extends readonly WithDrivers[]> = E extends readonly [
|
|
14
|
+
infer First extends WithDrivers,
|
|
15
|
+
...infer Rest extends readonly WithDrivers[]
|
|
16
|
+
] ? readonly [...DriversIn<First>, ...DriversOf<Rest>] : readonly [];
|
|
17
|
+
/** Every extension's drivers, each extension's in turn: the registry's list of drivers. */
|
|
18
|
+
export declare function driversOf<const E extends readonly WithDrivers[]>(extensions: E): DriversOf<E>;
|
|
19
|
+
/** Each driver's Context, by the driver's name, which the launcher hands only that driver's plan step. */
|
|
20
|
+
export type DriverContextMap = Readonly<Record<string, unknown>>;
|
|
21
|
+
/** Every driver's Context, by its name, each built live by its own `context`. `drivers` lists every driver once. */
|
|
22
|
+
export declare function driverContexts(drivers: readonly Pick<Driver, "name" | "context">[]): DriverContextMap;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// The extensions' drivers as one list, and their Contexts: the registry (`src/extensions.ts`) takes its list,
|
|
2
|
+
// `DRIVERS`, from its extensions with `driversOf`, as it takes their resources with `resourcesOf` (`resources-of.ts`),
|
|
3
|
+
// and builds each driver's Context with `driverContexts`. An extension lists each of its drivers as its `defineDriver`
|
|
4
|
+
// returned it (`src/sdk/extension/driver.ts`). It names no driver.
|
|
5
|
+
/** Every extension's drivers, each extension's in turn: the registry's list of drivers. */
|
|
6
|
+
export function driversOf(extensions) {
|
|
7
|
+
// `flatMap` keeps the order `DriversOf` spells and loses only the tuple.
|
|
8
|
+
return extensions.flatMap(({ drivers }) => drivers ?? []);
|
|
9
|
+
}
|
|
10
|
+
/** Every driver's Context, by its name, each built live by its own `context`. `drivers` lists every driver once. */
|
|
11
|
+
export function driverContexts(drivers) {
|
|
12
|
+
return Object.fromEntries(drivers.map(({ name, context }) => [name, context()]));
|
|
13
|
+
}
|