@cnc-tools/storm 0.14.1 → 0.15.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/application.js +3 -1
- package/dist/bin/storm.js +18 -8
- package/dist/build-info.js +1 -1
- package/dist/chunks/chunk-4U4DZ7VG.js +40 -0
- package/dist/chunks/{chunk-GSC6SRTW.js → chunk-5CCP36QQ.js} +1 -1
- package/dist/chunks/chunk-5GBMR4HM.js +966 -0
- package/dist/chunks/{chunk-43MWZLJR.js → chunk-5VXBKPW6.js} +1 -1
- package/dist/chunks/{chunk-RA4L2ACU.js → chunk-AWBSONHB.js} +88 -34
- package/dist/chunks/{chunk-BRUIATTR.js → chunk-CN4EFA5J.js} +59 -12
- package/dist/chunks/{chunk-27P2QSIM.js → chunk-CXAT7ZKP.js} +2 -2
- package/dist/chunks/chunk-E4PJNZVG.js +783 -0
- package/dist/chunks/{chunk-T6AZIDZD.js → chunk-F6N34UWB.js} +12 -244
- package/dist/chunks/{chunk-ZH5R7W4A.js → chunk-KC4KDJ5K.js} +147 -26
- package/dist/chunks/{chunk-5ED3IDUJ.js → chunk-L36GBUBB.js} +1652 -681
- package/dist/chunks/{chunk-QBR5VHJ7.js → chunk-OX7X4B2L.js} +7 -2
- package/dist/chunks/{chunk-Z5OXOZD3.js → chunk-PN5ULTTH.js} +140 -130
- package/dist/chunks/chunk-QUHY6FGN.js +108 -0
- package/dist/chunks/chunk-QVS7HRU7.js +74 -0
- package/dist/chunks/{chunk-UC6DULWY.js → chunk-R7XVBZOY.js} +130 -39
- package/dist/chunks/{chunk-YBPTMJUM.js → chunk-RAQEXKL6.js} +1120 -465
- package/dist/chunks/{chunk-RKONDLPS.js → chunk-SZEURWRS.js} +446 -52
- package/dist/chunks/chunk-TJNFVNKR.js +246 -0
- package/dist/chunks/{chunk-BW2ADH7U.js → chunk-VUPZH7J2.js} +1 -1
- package/dist/chunks/{chunk-XPCUINWS.js → chunk-XEVHP5ZW.js} +2 -2
- package/dist/chunks/{chunk-5TMHYH7G.js → chunk-YV7GE6EV.js} +638 -80
- package/dist/chunks/{chunk-GQIL3AHY.js → chunk-ZG3WQ4UF.js} +1 -1
- package/dist/chunks/{live-app-FBVWUUMT.js → live-app-PI3BAN6Y.js} +37 -26
- package/dist/command-tree.d.ts +2 -2
- package/dist/command-tree.js +2 -2
- package/dist/commands/exec/across-sandboxes-outcomes.d.ts +364 -0
- package/dist/commands/exec/across-sandboxes-outcomes.js +229 -0
- package/dist/commands/exec/across-sandboxes-run.d.ts +180 -0
- package/dist/commands/exec/across-sandboxes-run.js +339 -0
- package/dist/commands/exec/command.d.ts +577 -75
- package/dist/commands/exec/command.js +165 -32
- package/dist/commands/exec/driver-plan.d.ts +8 -2
- package/dist/commands/exec/driver-plan.js +13 -3
- package/dist/commands/exec/exec-words.d.ts +17 -3
- package/dist/commands/exec/exec-words.js +27 -16
- package/dist/commands/exec/live-view.d.ts +3 -4
- package/dist/commands/exec/live-view.js +37 -28
- package/dist/commands/exec/metadata.js +2 -2
- package/dist/commands/exec/mint-failed.d.ts +4 -4
- package/dist/commands/exec/mint-failed.js +6 -6
- package/dist/commands/exec/outcomes.d.ts +530 -73
- package/dist/commands/exec/outcomes.js +202 -66
- package/dist/commands/exec/plan-only.d.ts +10 -0
- package/dist/commands/exec/plan-only.js +46 -0
- package/dist/commands/exec/plan-run.d.ts +54 -35
- package/dist/commands/exec/plan-run.js +81 -38
- package/dist/commands/exec/planned-outcome.d.ts +15 -0
- package/dist/commands/exec/planned-outcome.js +35 -0
- package/dist/commands/exec/progress.d.ts +2 -2
- package/dist/commands/exec/progress.js +35 -18
- package/dist/commands/exec/resource-refusals.d.ts +2 -2
- package/dist/commands/exec/resource-refusals.js +3 -3
- package/dist/commands/exec/run-bin.d.ts +1 -1
- package/dist/commands/exec/run-bin.js +2 -2
- package/dist/commands/exec/run-command.d.ts +345 -63
- package/dist/commands/exec/run-command.js +308 -258
- package/dist/commands/exec/run-metadata.d.ts +42 -8
- package/dist/commands/exec/run-metadata.js +40 -21
- package/dist/commands/exec/run-planned.d.ts +20 -0
- package/dist/commands/exec/run-planned.js +22 -0
- package/dist/commands/exec/sandbox-lines.d.ts +42 -0
- package/dist/commands/exec/sandbox-lines.js +59 -0
- package/dist/commands/exec/sandbox-progress.d.ts +30 -0
- package/dist/commands/exec/sandbox-progress.js +232 -0
- package/dist/commands/exec/sandbox-view.d.ts +19 -0
- package/dist/commands/exec/sandbox-view.js +72 -0
- package/dist/commands/exec/view.d.ts +3 -2
- package/dist/commands/exec/view.js +10 -6
- package/dist/commands/runs/facts.d.ts +51 -9
- package/dist/commands/runs/facts.js +49 -29
- package/dist/commands/runs/list/command.d.ts +80 -4
- package/dist/commands/runs/list/command.js +11 -10
- package/dist/commands/runs/list/metadata.js +1 -1
- package/dist/commands/runs/list/outcomes.d.ts +40 -2
- package/dist/commands/runs/logs/command.d.ts +103 -8
- package/dist/commands/runs/logs/command.js +139 -24
- package/dist/commands/runs/logs/metadata.d.ts +4 -0
- package/dist/commands/runs/logs/metadata.js +14 -7
- package/dist/commands/runs/logs/outcomes.d.ts +49 -2
- package/dist/commands/runs/logs/outcomes.js +110 -6
- package/dist/commands/runs/past-run.d.ts +77 -6
- package/dist/commands/runs/past-run.js +133 -4
- package/dist/commands/runs/show/command.d.ts +568 -10
- package/dist/commands/runs/show/command.js +634 -119
- package/dist/commands/runs/show/metadata.d.ts +17 -0
- package/dist/commands/runs/show/metadata.js +48 -7
- package/dist/commands/runs/show/outcomes.d.ts +276 -5
- package/dist/commands/runs/show/outcomes.js +484 -96
- package/dist/commands/snapshots/build/command.d.ts +109 -18
- package/dist/commands/snapshots/build/command.js +72 -36
- package/dist/commands/snapshots/build/metadata.d.ts +4 -0
- package/dist/commands/snapshots/build/metadata.js +5 -1
- package/dist/commands/snapshots/build/outcomes.d.ts +53 -8
- package/dist/commands/snapshots/build/outcomes.js +26 -3
- package/dist/commands/snapshots/list/command.d.ts +72 -7
- package/dist/commands/snapshots/list/command.js +57 -24
- package/dist/commands/snapshots/list/metadata.d.ts +4 -0
- package/dist/commands/snapshots/list/metadata.js +4 -0
- package/dist/commands/snapshots/list/outcomes.d.ts +31 -0
- package/dist/commands/snapshots/list/outcomes.js +25 -2
- package/dist/commands/suites/list/command.d.ts +129 -0
- package/dist/commands/suites/list/command.js +162 -0
- package/dist/commands/suites/list/metadata.d.ts +11 -0
- package/dist/commands/suites/list/metadata.js +15 -0
- package/dist/commands/suites/list/outcomes.d.ts +91 -0
- package/dist/commands/suites/list/outcomes.js +122 -0
- package/dist/commands/suites/metadata.js +8 -0
- package/dist/commands/test/command.d.ts +1389 -0
- package/dist/commands/test/command.js +583 -0
- package/dist/commands/test/metadata.js +8 -0
- package/dist/commands/test/outcomes.d.ts +765 -0
- package/dist/commands/test/outcomes.js +140 -0
- package/dist/commands/test/plan.d.ts +92 -0
- package/dist/commands/test/plan.js +128 -0
- package/dist/commands/test/test-words.d.ts +12 -0
- package/dist/commands/test/test-words.js +42 -0
- package/dist/config/check-resources.d.ts +14 -0
- package/dist/config/check-resources.js +98 -0
- package/dist/config/check-runner.d.ts +13 -0
- package/dist/config/check-runner.js +54 -0
- package/dist/config/check-suites.d.ts +14 -0
- package/dist/config/check-suites.js +99 -0
- package/dist/config/gateways.d.ts +24 -0
- package/dist/config/index.d.ts +6 -3
- package/dist/config/index.js +3 -1
- package/dist/config/live/file-lists-file-gateway.d.ts +4 -0
- package/dist/config/live/file-lists-file-gateway.js +27 -0
- package/dist/config/load.d.ts +11 -10
- package/dist/config/load.js +35 -103
- package/dist/config/recipe-run.d.ts +8 -1
- package/dist/config/recipe-run.js +2 -1
- package/dist/config/resolve.d.ts +3 -2
- package/dist/config/resolve.js +6 -3
- package/dist/config/resolver.d.ts +20 -6
- package/dist/config/resolver.js +11 -8
- package/dist/config/runner.d.ts +24 -0
- package/dist/config/runner.js +4 -0
- package/dist/config/schema.d.ts +26 -18
- package/dist/config/schema.js +41 -9
- package/dist/config/settings-file.d.ts +9 -3
- package/dist/config/settings-file.js +41 -4
- package/dist/config/suite.d.ts +39 -0
- package/dist/config/suite.js +5 -0
- package/dist/config-file/define.d.ts +49 -18
- package/dist/config-file/define.js +9 -8
- package/dist/config-file/runner.d.ts +12 -0
- package/dist/config-file/runner.js +9 -0
- package/dist/context.d.ts +13 -8
- package/dist/context.js +13 -4
- package/dist/core/across-sandboxes.d.ts +43 -0
- package/dist/core/across-sandboxes.js +319 -0
- package/dist/core/before-run.d.ts +5 -3
- package/dist/core/before-run.js +12 -1
- package/dist/core/events.d.ts +62 -6
- package/dist/core/events.js +14 -0
- package/dist/core/index.d.ts +4 -2
- package/dist/core/index.js +3 -1
- package/dist/core/payload.d.ts +7 -4
- package/dist/core/payload.js +10 -4
- package/dist/core/presentations.js +1 -1
- package/dist/core/resource.d.ts +1 -1
- package/dist/core/resources.d.ts +56 -6
- package/dist/core/resources.js +81 -5
- package/dist/core/run-state.js +9 -0
- package/dist/core/run.d.ts +77 -15
- package/dist/core/run.js +150 -86
- package/dist/core/sandbox-end.d.ts +64 -0
- package/dist/core/sandbox-end.js +128 -0
- package/dist/core/timeline.d.ts +4 -4
- package/dist/core/timeline.js +3 -3
- package/dist/credential/live/vercel-cli-gateway.d.ts +7 -0
- package/dist/credential/live/vercel-cli-gateway.js +14 -1
- package/dist/extensions/github/context.d.ts +1 -1
- package/dist/extensions/github/definition.d.ts +11 -9
- package/dist/extensions/github/definition.js +8 -6
- package/dist/extensions/github/extension.d.ts +3 -3
- package/dist/extensions/github/fixture-repo.d.ts +21 -2
- package/dist/extensions/github/fixture-repo.js +31 -2
- package/dist/extensions/github/index.d.ts +2 -2
- package/dist/extensions/github/index.js +2 -2
- package/dist/extensions/github/lifecycle.d.ts +16 -6
- package/dist/extensions/github/lifecycle.js +42 -25
- package/dist/extensions/github/options.d.ts +17 -11
- package/dist/extensions/github/options.js +14 -13
- package/dist/extensions/github/refusals.d.ts +23 -6
- package/dist/extensions/github/refusals.js +34 -12
- package/dist/extensions/github/resource.d.ts +21 -12
- package/dist/extensions/github/resource.js +16 -8
- package/dist/extensions/github/run/payload.d.ts +6 -6
- package/dist/extensions/github/run/payload.js +3 -5
- package/dist/extensions/github/split.d.ts +10 -0
- package/dist/extensions/github/split.js +12 -0
- package/dist/extensions/playwright/driver.js +6 -26
- package/dist/extensions/playwright/extension.js +1 -1
- package/dist/extensions/testserver/commands/pool/create/command.js +8 -8
- package/dist/extensions/testserver/commands/pool/list/command.js +4 -4
- package/dist/extensions/testserver/definition.d.ts +4 -4
- package/dist/extensions/testserver/definition.js +41 -31
- package/dist/extensions/testserver/extension.d.ts +4 -5
- package/dist/extensions/testserver/extension.js +14 -41
- package/dist/extensions/testserver/index.d.ts +1 -1
- package/dist/extensions/testserver/index.js +1 -1
- package/dist/extensions/testserver/lifecycle.d.ts +10 -2
- package/dist/extensions/testserver/lifecycle.js +29 -6
- package/dist/extensions/testserver/options/rules.d.ts +5 -5
- package/dist/extensions/testserver/options/rules.js +10 -8
- package/dist/extensions/testserver/options/sandboxes.d.ts +4 -2
- package/dist/extensions/testserver/options/sandboxes.js +8 -3
- package/dist/extensions/testserver/pool/gateways.d.ts +29 -4
- package/dist/extensions/testserver/pool/index.d.ts +2 -2
- package/dist/extensions/testserver/pool/index.js +1 -1
- package/dist/extensions/testserver/pool/lease.d.ts +10 -0
- package/dist/extensions/testserver/pool/lease.js +21 -0
- package/dist/extensions/testserver/pool/live/pool-store-gateway.js +38 -3
- package/dist/extensions/testserver/refusals.d.ts +12 -0
- package/dist/extensions/testserver/refusals.js +18 -0
- package/dist/extensions/testserver/release.d.ts +16 -0
- package/dist/extensions/testserver/release.js +56 -4
- package/dist/extensions/testserver/resource.d.ts +4 -4
- package/dist/extensions/testserver/resource.js +1 -1
- package/dist/extensions/testserver/split.d.ts +9 -0
- package/dist/extensions/testserver/split.js +22 -0
- package/dist/extensions/testserver/vitest/fixtures.d.ts +5 -5
- package/dist/extensions/testserver/vitest/fixtures.js +9 -38
- package/dist/extensions/vitest/driver.d.ts +7 -0
- package/dist/extensions/vitest/driver.js +33 -37
- package/dist/extensions/vitest/extension.js +1 -1
- package/dist/extensions/vitest/plan/plan-over.d.ts +8 -1
- package/dist/extensions/vitest/plan/plan-over.js +16 -2
- package/dist/extensions.d.ts +17 -16
- package/dist/extensions.js +5 -4
- package/dist/forward-sigterm.js +1 -1
- package/dist/launcher-resolvers/local-services.d.ts +1 -1
- package/dist/live-app.d.ts +3 -1
- package/dist/live-app.js +9 -5
- package/dist/local-services.js +1 -1
- package/dist/planning/driver-file-lists.d.ts +61 -0
- package/dist/planning/driver-file-lists.js +66 -0
- package/dist/{commands/exec → planning}/driver-refusals.d.ts +11 -10
- package/dist/{commands/exec → planning}/driver-refusals.js +18 -14
- package/dist/planning/file-lists-file.d.ts +58 -0
- package/dist/planning/file-lists-file.js +105 -0
- package/dist/planning/file-lists.d.ts +28 -0
- package/dist/planning/file-lists.js +52 -0
- package/dist/{commands/exec → planning}/final-results.d.ts +1 -1
- package/dist/{commands/exec → planning}/final-results.js +6 -6
- package/dist/planning/plan-only.d.ts +81 -0
- package/dist/planning/plan-only.js +83 -0
- package/dist/{commands/exec → planning}/redaction.d.ts +2 -2
- package/dist/{commands/exec → planning}/redaction.js +5 -4
- package/dist/{commands/exec → planning}/resource-flags.d.ts +5 -12
- package/dist/{commands/exec → planning}/resource-flags.js +6 -16
- package/dist/planning/run-kind-flags.d.ts +20 -0
- package/dist/planning/run-kind-flags.js +48 -0
- package/dist/planning/run-plan.d.ts +30 -0
- package/dist/planning/run-plan.js +4 -0
- package/dist/planning/sandbox-placeholders.d.ts +22 -0
- package/dist/planning/sandbox-placeholders.js +60 -0
- package/dist/planning/suite-not-found.d.ts +37 -0
- package/dist/planning/suite-not-found.js +36 -0
- package/dist/planning/suites.d.ts +43 -0
- package/dist/planning/suites.js +89 -0
- package/dist/{commands/exec → planning}/test-plan.d.ts +8 -3
- package/dist/{commands/exec → planning}/test-plan.js +32 -4
- package/dist/playwright/reporter.d.ts +20 -8
- package/dist/playwright/reporter.js +195 -15
- package/dist/presentation.d.ts +10 -6
- package/dist/presentation.js +13 -15
- package/dist/run-directory/gateways.d.ts +60 -4
- package/dist/run-directory/index.d.ts +4 -4
- package/dist/run-directory/index.js +2 -1
- package/dist/run-directory/live/run-directory-gateway.js +92 -16
- package/dist/run-directory/plan.d.ts +35 -2
- package/dist/run-directory/plan.js +44 -7
- package/dist/run-directory/reader.d.ts +26 -5
- package/dist/run-directory/reader.js +24 -1
- package/dist/run-directory/recording.d.ts +75 -49
- package/dist/run-directory/recording.js +214 -28
- package/dist/run-directory/run-directory.d.ts +22 -1
- package/dist/run-directory/run-directory.js +24 -0
- package/dist/run-directory/run-record.d.ts +144 -21
- package/dist/run-directory/run-record.js +118 -19
- package/dist/run-directory/timeline-facts.js +4 -4
- package/dist/runner/build-snapshots.d.ts +7 -7
- package/dist/runner/build-snapshots.js +12 -16
- package/dist/runner/events.d.ts +29 -8
- package/dist/runner/gateways.d.ts +59 -8
- package/dist/runner/index.d.ts +6 -4
- package/dist/runner/index.js +3 -2
- package/dist/runner/live/sandbox-gateway.js +177 -33
- package/dist/runner/live/terminal.d.ts +15 -3
- package/dist/runner/live/terminal.js +25 -3
- package/dist/runner/network-policy.d.ts +55 -0
- package/dist/runner/network-policy.js +46 -0
- package/dist/runner/policy-writes.d.ts +40 -0
- package/dist/runner/policy-writes.js +124 -0
- package/dist/runner/prepare.d.ts +6 -7
- package/dist/runner/ready.d.ts +39 -10
- package/dist/runner/ready.js +59 -47
- package/dist/runner/recipe-check.d.ts +6 -0
- package/dist/runner/recipe-check.js +29 -0
- package/dist/runner/recipe-secrets.d.ts +67 -0
- package/dist/runner/recipe-secrets.js +230 -0
- package/dist/runner/recipe.d.ts +118 -28
- package/dist/runner/recipe.js +147 -154
- package/dist/runner/sandboxed-command.d.ts +24 -10
- package/dist/runner/sandboxed-command.js +37 -12
- package/dist/runner/scope.d.ts +107 -21
- package/dist/runner/scope.js +274 -54
- package/dist/runner/secrets.d.ts +42 -31
- package/dist/runner/secrets.js +62 -40
- package/dist/runner/session.d.ts +59 -26
- package/dist/runner/session.js +82 -41
- package/dist/runner/snapshot-build.d.ts +7 -4
- package/dist/runner/snapshot-build.js +48 -28
- package/dist/runner/snapshot-choice.d.ts +37 -0
- package/dist/runner/snapshot-choice.js +38 -0
- package/dist/runner/snapshot-key.d.ts +16 -14
- package/dist/runner/snapshot-key.js +24 -18
- package/dist/runner/steps.d.ts +13 -5
- package/dist/runner/steps.js +34 -4
- package/dist/runner/time-limit.d.ts +10 -0
- package/dist/runner/time-limit.js +43 -0
- package/dist/sdk/extension/commands.d.ts +1 -7
- package/dist/sdk/extension/driver.d.ts +39 -46
- package/dist/sdk/extension/driver.js +6 -6
- package/dist/sdk/extension/index.d.ts +3 -3
- package/dist/sdk/extension/index.js +3 -4
- package/dist/sdk/extension/lifecycle.d.ts +52 -9
- package/dist/sdk/extension/lifecycle.js +1 -1
- package/dist/sdk/extension/resource-definition.d.ts +13 -10
- package/dist/sdk/extension/resource-definition.js +7 -2
- package/dist/sdk/extension/resource.d.ts +2 -2
- package/dist/sdk/extension/secret-source.d.ts +58 -0
- package/dist/sdk/extension/secret-source.js +78 -0
- package/dist/sdk/index.d.ts +2 -2
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/run/launcher.d.ts +1 -1
- package/dist/sdk/run/launcher.js +1 -1
- package/dist/sdk/run/payload.d.ts +16 -1
- package/dist/sdk/run/payload.js +17 -2
- package/dist/sdk/run/redact.js +2 -2
- package/dist/sdk/run/test-events.d.ts +23 -6
- package/dist/sdk/run/test-events.js +6 -4
- package/dist/sdk/run/test-result-writer.d.ts +8 -3
- package/dist/sdk/run/test-result-writer.js +22 -2
- package/dist/{commands/exec → shared}/cleanup.d.ts +3 -3
- package/dist/{commands/exec → shared}/cleanup.js +11 -6
- package/dist/shared/job-summary.d.ts +19 -0
- package/dist/{commands/exec → shared}/job-summary.js +17 -0
- package/dist/shared/sandbox-table.d.ts +48 -0
- package/dist/shared/sandbox-table.js +109 -0
- package/dist/{commands/exec → shared}/snapshot-text.d.ts +1 -1
- package/dist/{commands/exec → shared}/tests-summary.d.ts +22 -6
- package/dist/{commands/exec → shared}/tests-summary.js +74 -31
- package/dist/{commands/exec → shared}/text.d.ts +7 -2
- package/dist/{commands/exec → shared}/text.js +9 -1
- package/dist/{commands/exec → shared}/waterfall.d.ts +8 -6
- package/dist/{commands/exec → shared}/waterfall.js +71 -24
- package/dist/shared/worker-chart.d.ts +172 -0
- package/dist/shared/worker-chart.js +623 -0
- package/dist/vitest/config.d.ts +35 -11
- package/dist/vitest/config.js +47 -14
- package/dist/vitest/index.d.ts +1 -1
- package/dist/vitest/index.js +3 -3
- package/dist/vitest/sequencer.d.ts +23 -0
- package/dist/vitest/sequencer.js +73 -0
- package/dist/vitest/setup.d.ts +1 -0
- package/dist/vitest/setup.js +34 -0
- package/dist/vitest/test-events.d.ts +32 -6
- package/dist/vitest/test-events.js +25 -5
- package/dist/vitest/test-results.d.ts +8 -3
- package/dist/vitest/test-results.js +6 -0
- package/package.json +7 -2
- package/skills/overview.md +21 -17
- package/skills/plan-runs.md +67 -0
- package/skills/read-run-output.md +51 -19
- package/dist/chunks/chunk-BFLYGMG3.js +0 -607
- package/dist/chunks/chunk-HOKDKP5A.js +0 -49
- package/dist/chunks/chunk-IVRRGGCD.js +0 -201
- package/dist/chunks/chunk-NMVODY3P.js +0 -19
- package/dist/commands/exec/define-run-command.d.ts +0 -671
- package/dist/commands/exec/define-run-command.js +0 -91
- package/dist/commands/exec/job-summary.d.ts +0 -10
- package/dist/commands/exec/worker-chart.d.ts +0 -87
- package/dist/commands/exec/worker-chart.js +0 -343
- package/dist/commands/playwright/command.d.ts +0 -661
- package/dist/commands/playwright/command.js +0 -31
- package/dist/commands/playwright/metadata.js +0 -8
- package/dist/commands/vitest/command.d.ts +0 -662
- package/dist/commands/vitest/command.js +0 -31
- package/dist/commands/vitest/metadata.js +0 -8
- package/dist/sdk/extension/ci.d.ts +0 -2
- package/dist/sdk/extension/ci.js +0 -6
- package/dist/chunks/{chunk-YM6TZV4L.js → chunk-VL7WFTVQ.js} +52 -52
- package/dist/commands/{playwright → suites}/metadata.d.ts +1 -1
- package/dist/commands/{vitest → test}/metadata.d.ts +1 -1
- /package/dist/{commands → shared}/dashboard.d.ts +0 -0
- /package/dist/{commands → shared}/dashboard.js +0 -0
- /package/dist/{commands/exec → shared}/snapshot-text.js +0 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// The check of `suites` in `storm.config.ts`: each suite name matches `SUITE_NAME_PATTERN`, each suite holds only the
|
|
2
|
+
// four suite keys (`driver`, `args`, `runner`, `resources`), each `driver`, `args`, and `runner` passes the same rule
|
|
3
|
+
// as the top level (with a suite's `vercelSandbox` options merging over the top level's), and a suite with no `driver`
|
|
4
|
+
// requires a top-level `driver`.
|
|
5
|
+
import { describeValue } from "../sdk/extension/index.js";
|
|
6
|
+
import { checkResources } from "./check-resources.js";
|
|
7
|
+
import { checkSettingValue } from "./schema.js";
|
|
8
|
+
import { SUITE_NAME_PATTERN } from "./suite.js";
|
|
9
|
+
const SUITE_KEYS = new Set(["driver", "args", "runner", "resources"]);
|
|
10
|
+
/**
|
|
11
|
+
* Checks `suites` in `storm.config.ts`: each key is a valid suite name, each entry holds only `driver`, `args`,
|
|
12
|
+
* `runner`, and `resources`, every `driver` is in `drivers`, every `runner` merges over `topLevelRunnerOptions` when
|
|
13
|
+
* of the same kind, and every suite without its own `driver` requires the top level to name one (`hasTopLevelDriver`).
|
|
14
|
+
*/
|
|
15
|
+
export function checkSuites(value, options, problems) {
|
|
16
|
+
if (value === undefined)
|
|
17
|
+
return {};
|
|
18
|
+
if (!isRecord(value)) {
|
|
19
|
+
problems.push({ key: "suites", location: null, problem: `must be an object, not ${describeValue(value)}` });
|
|
20
|
+
return {};
|
|
21
|
+
}
|
|
22
|
+
const settingContext = {
|
|
23
|
+
drivers: options.drivers,
|
|
24
|
+
topLevelRunnerOptions: options.topLevelRunnerOptions,
|
|
25
|
+
};
|
|
26
|
+
const checked = {};
|
|
27
|
+
for (const [name, raw] of Object.entries(value)) {
|
|
28
|
+
const at = `suites.${name}`;
|
|
29
|
+
if (!SUITE_NAME_PATTERN.test(name)) {
|
|
30
|
+
problems.push({
|
|
31
|
+
key: at,
|
|
32
|
+
location: null,
|
|
33
|
+
problem: "must hold only lowercase letters, digits, and hyphens, starting with a letter or a digit",
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
if (!isRecord(raw)) {
|
|
37
|
+
problems.push({ key: at, location: null, problem: `must be an object, not ${describeValue(raw)}` });
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
let driver;
|
|
41
|
+
let hasOwnDriverKey = false;
|
|
42
|
+
let args;
|
|
43
|
+
let runner;
|
|
44
|
+
let resources = {};
|
|
45
|
+
for (const [key, keyValue] of Object.entries(raw)) {
|
|
46
|
+
if (!SUITE_KEYS.has(key)) {
|
|
47
|
+
problems.push({ key: `${at}.${key}`, location: null, problem: "is not a suite key" });
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
if (keyValue === undefined)
|
|
51
|
+
continue;
|
|
52
|
+
if (key === "driver") {
|
|
53
|
+
hasOwnDriverKey = true;
|
|
54
|
+
const result = checkSettingValue("driver", keyValue, settingContext);
|
|
55
|
+
if (result.ok)
|
|
56
|
+
driver = result.value;
|
|
57
|
+
else
|
|
58
|
+
for (const { path: inside, problem } of result.problems)
|
|
59
|
+
problems.push({ key: [`${at}.driver`, ...inside].join("."), location: null, problem });
|
|
60
|
+
}
|
|
61
|
+
else if (key === "args") {
|
|
62
|
+
const result = checkSettingValue("args", keyValue, settingContext);
|
|
63
|
+
if (result.ok)
|
|
64
|
+
args = result.value;
|
|
65
|
+
else
|
|
66
|
+
for (const { path: inside, problem } of result.problems)
|
|
67
|
+
problems.push({ key: [`${at}.args`, ...inside].join("."), location: null, problem });
|
|
68
|
+
}
|
|
69
|
+
else if (key === "runner") {
|
|
70
|
+
const result = checkSettingValue("runner", keyValue, settingContext);
|
|
71
|
+
if (result.ok)
|
|
72
|
+
runner = result.value;
|
|
73
|
+
else
|
|
74
|
+
for (const { path: inside, problem } of result.problems)
|
|
75
|
+
problems.push({ key: [`${at}.runner`, ...inside].join("."), location: null, problem });
|
|
76
|
+
}
|
|
77
|
+
else if (key === "resources") {
|
|
78
|
+
resources = checkResources(keyValue, options.definitions, problems, `${at}.resources`);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
if (!hasOwnDriverKey && !options.hasTopLevelDriver) {
|
|
82
|
+
problems.push({
|
|
83
|
+
key: `${at}.driver`,
|
|
84
|
+
location: null,
|
|
85
|
+
problem: "must name a driver when the top level names none",
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
checked[name] = {
|
|
89
|
+
...(driver === undefined ? {} : { driver }),
|
|
90
|
+
...(args === undefined ? {} : { args }),
|
|
91
|
+
...(runner === undefined ? {} : { runner }),
|
|
92
|
+
resources,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
return checked;
|
|
96
|
+
}
|
|
97
|
+
function isRecord(value) {
|
|
98
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
99
|
+
}
|
|
@@ -30,3 +30,27 @@ export interface ConfigGateway {
|
|
|
30
30
|
/** Imports the config file at `path`, running it. */
|
|
31
31
|
importConfig(path: string): Promise<ConfigImport>;
|
|
32
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* What reading a caller's file lists file (`--file-lists <path>`) gave:
|
|
35
|
+
*
|
|
36
|
+
* - `read`: the file's JSON, parsed, whatever its shape; the caller checks the shape.
|
|
37
|
+
* - `unreadable`: the file can't be read, such as a path with no file. `message` is the OS's.
|
|
38
|
+
* - `not-json`: the file's text is not JSON. `message` is the parser's.
|
|
39
|
+
*/
|
|
40
|
+
export type FileListsFileRead = {
|
|
41
|
+
readonly kind: "read";
|
|
42
|
+
readonly value: unknown;
|
|
43
|
+
} | {
|
|
44
|
+
readonly kind: "unreadable";
|
|
45
|
+
readonly message: string;
|
|
46
|
+
} | {
|
|
47
|
+
readonly kind: "not-json";
|
|
48
|
+
readonly message: string;
|
|
49
|
+
};
|
|
50
|
+
/** What reading a caller's file lists file needs from the world. No method rejects. */
|
|
51
|
+
export interface FileListsFileGateway {
|
|
52
|
+
/** Reads the file lists file at the absolute path `path`, or stdin when `path` is `"-"`, and parses its JSON. */
|
|
53
|
+
readFileListsFile(request: {
|
|
54
|
+
readonly path: string;
|
|
55
|
+
}): Promise<FileListsFileRead>;
|
|
56
|
+
}
|
package/dist/config/index.d.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
export { type CommandCredentialSource, type CredentialReport, credentialResolver, type CredentialResolver, credentialSourceError, type CredentialSourceError, credentialSourceErrors, type CredentialTarget, } from "./credential-resolver.ts";
|
|
2
2
|
export { credentialErrors, requireTarget, settleCredential } from "./credential-settle.ts";
|
|
3
3
|
export { configErrors, configProblemLine, optionProblemLine } from "./errors.ts";
|
|
4
|
-
export type { ConfigGateway, ConfigImport, ConfigLocation } from "./gateways.ts";
|
|
4
|
+
export type { ConfigGateway, ConfigImport, ConfigLocation, FileListsFileGateway, FileListsFileRead, } from "./gateways.ts";
|
|
5
5
|
export { liveConfigGateway } from "./live/config-gateway.ts";
|
|
6
|
+
export { liveFileListsFileGateway } from "./live/file-lists-file-gateway.ts";
|
|
6
7
|
export { type ConfigProblem, type ConfigValues, findConfigFile, type LoadedConfig, loadConfig } from "./load.ts";
|
|
7
8
|
export { type RecipeResource, type RecipeRun, recipeRun } from "./recipe-run.ts";
|
|
8
9
|
export { type MergedResourceOptions, type MergedRunResources, mergeRunResources, mergeResourceOptions, type PlannedOption, type ResolvedResourceOptions, type ResolvedResourceRecord, type ResolvedSettings, resolveSettings, type ResourceFlagOptions, type ResourceOptionProblem, type ResourceRecord, type SettingFlags, } from "./resolve.ts";
|
|
10
|
+
export type { CheckedRunner, LaunchMachineRunner, RunnerConfig, RunnerKind, SuiteRunnerConfig, VercelSandboxRunner, } from "./runner.ts";
|
|
9
11
|
export { type CheckedSettings, checkWith, CONFIG_FILE_NAME, CONFIG_SETTING_KEYS, type ConfigKey, type ConfigSettingKey, type ConfigSettings, type SettingValue, } from "./schema.ts";
|
|
10
|
-
export { type ConfigLoadError, type ConfigResolver, configResolver, type LoadedResourceSettings, type TargetSettings, } from "./resolver.ts";
|
|
11
|
-
export { fileOptions, fileSettings, invalidConfig, invalidResourceOptions, loadSettingsFile, type SettingsFile, settleRunResources, } from "./settings-file.ts";
|
|
12
|
+
export { type ConfigLoadError, type ConfigResolver, configResolver, type LoadedResourceSettings, type StormConfigResolver, type TargetSettings, } from "./resolver.ts";
|
|
13
|
+
export { effectiveConfig, fileOptions, fileSettings, invalidConfig, invalidResourceOptions, loadSettingsFile, type SettingsFile, settleRunResources, } from "./settings-file.ts";
|
|
14
|
+
export { type CheckedSuite, type CheckedSuiteMap, SUITE_NAME_PATTERN, type SuiteConfig, type SuiteConfigMap, } from "./suite.ts";
|
package/dist/config/index.js
CHANGED
|
@@ -9,9 +9,11 @@ export { credentialResolver, credentialSourceError, credentialSourceErrors, } fr
|
|
|
9
9
|
export { credentialErrors, requireTarget, settleCredential } from "./credential-settle.js";
|
|
10
10
|
export { configErrors, configProblemLine, optionProblemLine } from "./errors.js";
|
|
11
11
|
export { liveConfigGateway } from "./live/config-gateway.js";
|
|
12
|
+
export { liveFileListsFileGateway } from "./live/file-lists-file-gateway.js";
|
|
12
13
|
export { findConfigFile, loadConfig } from "./load.js";
|
|
13
14
|
export { recipeRun } from "./recipe-run.js";
|
|
14
15
|
export { mergeRunResources, mergeResourceOptions, resolveSettings, } from "./resolve.js";
|
|
15
16
|
export { checkWith, CONFIG_FILE_NAME, CONFIG_SETTING_KEYS, } from "./schema.js";
|
|
16
17
|
export { configResolver, } from "./resolver.js";
|
|
17
|
-
export { fileOptions, fileSettings, invalidConfig, invalidResourceOptions, loadSettingsFile, settleRunResources, } from "./settings-file.js";
|
|
18
|
+
export { effectiveConfig, fileOptions, fileSettings, invalidConfig, invalidResourceOptions, loadSettingsFile, settleRunResources, } from "./settings-file.js";
|
|
19
|
+
export { SUITE_NAME_PATTERN, } from "./suite.js";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Readable } from "node:stream";
|
|
2
|
+
import type { FileListsFileGateway } from "../gateways.ts";
|
|
3
|
+
/** The live file lists file gateway: reads UTF-8 from `path` (or `stdin` when `path` is `"-"`), then `JSON.parse`. */
|
|
4
|
+
export declare function liveFileListsFileGateway(stdin?: Readable): FileListsFileGateway;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
async function readStream(stream) {
|
|
3
|
+
const chunks = [];
|
|
4
|
+
for await (const chunk of stream)
|
|
5
|
+
chunks.push(typeof chunk === "string" ? Buffer.from(chunk) : chunk);
|
|
6
|
+
return Buffer.concat(chunks).toString("utf8");
|
|
7
|
+
}
|
|
8
|
+
/** The live file lists file gateway: reads UTF-8 from `path` (or `stdin` when `path` is `"-"`), then `JSON.parse`. */
|
|
9
|
+
export function liveFileListsFileGateway(stdin = process.stdin) {
|
|
10
|
+
return {
|
|
11
|
+
readFileListsFile: async ({ path }) => {
|
|
12
|
+
let text;
|
|
13
|
+
try {
|
|
14
|
+
text = path === "-" ? await readStream(stdin) : await readFile(path, "utf8");
|
|
15
|
+
}
|
|
16
|
+
catch (error) {
|
|
17
|
+
return { kind: "unreadable", message: error instanceof Error ? error.message : String(error) };
|
|
18
|
+
}
|
|
19
|
+
try {
|
|
20
|
+
return { kind: "read", value: JSON.parse(text) };
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
return { kind: "not-json", message: error instanceof Error ? error.message : String(error) };
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
}
|
package/dist/config/load.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { ConfigGateway, ConfigLocation } from "./gateways.ts";
|
|
2
1
|
import { type ResourceDefinition } from "../sdk/extension/index.ts";
|
|
3
|
-
import {
|
|
2
|
+
import type { ConfigGateway, ConfigLocation } from "./gateways.ts";
|
|
4
3
|
import type { ResourceRecord } from "./resolve.ts";
|
|
4
|
+
import { type CheckedSettings } from "./schema.ts";
|
|
5
|
+
import type { CheckedSuiteMap } from "./suite.ts";
|
|
5
6
|
/**
|
|
6
7
|
* One thing wrong with a config file: the key it is about (`null` when none is), where Node said an import failed
|
|
7
8
|
* (`null` otherwise), and the problem, worded to follow the key or the file name.
|
|
@@ -12,15 +13,15 @@ export interface ConfigProblem {
|
|
|
12
13
|
readonly problem: string;
|
|
13
14
|
}
|
|
14
15
|
/**
|
|
15
|
-
* What a loaded config file gave, every value checked: its top-level settings,
|
|
16
|
-
*
|
|
17
|
-
* with no options has empty options.
|
|
16
|
+
* What a loaded config file gave, every value checked: its top-level settings, each resource it has by resource key,
|
|
17
|
+
* and each suite it declares under `suites`. A resource the file holds with no options has empty options.
|
|
18
18
|
*/
|
|
19
19
|
export interface ConfigValues {
|
|
20
20
|
readonly settings: CheckedSettings;
|
|
21
21
|
readonly resources: {
|
|
22
22
|
readonly [key: string]: ResourceRecord;
|
|
23
23
|
};
|
|
24
|
+
readonly suites: CheckedSuiteMap;
|
|
24
25
|
}
|
|
25
26
|
/**
|
|
26
27
|
* What `loadConfig` found:
|
|
@@ -49,9 +50,9 @@ export declare function findConfigFile(gateway: ConfigGateway, startDirectory: s
|
|
|
49
50
|
/**
|
|
50
51
|
* Finds and imports the config file for `startDirectory` (see `findConfigFile`), and checks all of it, whatever
|
|
51
52
|
* command reads it. The file must default-export an object holding only known keys, each top-level setting by its
|
|
52
|
-
* rule,
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
53
|
+
* rule, a `resources` object holding only resources of `definitions`, and a `suites` object whose drivers are in
|
|
54
|
+
* `drivers` (when passed) and whose suites without a driver sit under a top-level `driver`. Every problem found goes
|
|
55
|
+
* into one `invalid`. Whether a resource's options fit together, and whether a required one is given, waits for the
|
|
56
|
+
* merge with the flags (`mergeRunResources`) and its plan.
|
|
56
57
|
*/
|
|
57
|
-
export declare function loadConfig(gateway: ConfigGateway, startDirectory: string, definitions: readonly ResourceDefinition[]): Promise<LoadedConfig>;
|
|
58
|
+
export declare function loadConfig(gateway: ConfigGateway, startDirectory: string, definitions: readonly ResourceDefinition[], drivers: readonly string[]): Promise<LoadedConfig>;
|
package/dist/config/load.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { dirname, join } from "node:path";
|
|
2
|
-
import { defaultResourceKey, resourceCall } from "../sdk/extension/index.js";
|
|
3
2
|
import { describeValue } from "../sdk/extension/index.js";
|
|
4
|
-
import {
|
|
3
|
+
import { checkResources } from "./check-resources.js";
|
|
4
|
+
import { rawVercelSandboxOptions } from "./check-runner.js";
|
|
5
|
+
import { checkSuites } from "./check-suites.js";
|
|
6
|
+
import { CONFIG_FILE_NAME, checkSettingValue, isConfigSettingKey, } from "./schema.js";
|
|
5
7
|
/**
|
|
6
8
|
* Finds the config file for `startDirectory` (absolute): `storm.config.ts` in it, then in each parent up to the
|
|
7
9
|
* git worktree's root, the first directory holding `.git`; outside a git worktree, only in `startDirectory`. The
|
|
@@ -32,12 +34,12 @@ async function worktreeRoot(gateway, directory) {
|
|
|
32
34
|
/**
|
|
33
35
|
* Finds and imports the config file for `startDirectory` (see `findConfigFile`), and checks all of it, whatever
|
|
34
36
|
* command reads it. The file must default-export an object holding only known keys, each top-level setting by its
|
|
35
|
-
* rule,
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
37
|
+
* rule, a `resources` object holding only resources of `definitions`, and a `suites` object whose drivers are in
|
|
38
|
+
* `drivers` (when passed) and whose suites without a driver sit under a top-level `driver`. Every problem found goes
|
|
39
|
+
* into one `invalid`. Whether a resource's options fit together, and whether a required one is given, waits for the
|
|
40
|
+
* merge with the flags (`mergeRunResources`) and its plan.
|
|
39
41
|
*/
|
|
40
|
-
export async function loadConfig(gateway, startDirectory, definitions) {
|
|
42
|
+
export async function loadConfig(gateway, startDirectory, definitions, drivers) {
|
|
41
43
|
const path = await findConfigFile(gateway, startDirectory);
|
|
42
44
|
if (path === undefined)
|
|
43
45
|
return { kind: "none" };
|
|
@@ -56,10 +58,10 @@ export async function loadConfig(gateway, startDirectory, definitions) {
|
|
|
56
58
|
problems: [fileProblem("has no default export; export default defineConfig({ … })")],
|
|
57
59
|
};
|
|
58
60
|
case "default-export":
|
|
59
|
-
return checkFile(path, imported.value, definitions);
|
|
61
|
+
return checkFile(path, imported.value, definitions, drivers);
|
|
60
62
|
}
|
|
61
63
|
}
|
|
62
|
-
function checkFile(path, value, definitions) {
|
|
64
|
+
function checkFile(path, value, definitions, drivers) {
|
|
63
65
|
if (!isRecord(value))
|
|
64
66
|
return {
|
|
65
67
|
kind: "invalid",
|
|
@@ -69,23 +71,42 @@ function checkFile(path, value, definitions) {
|
|
|
69
71
|
const settings = {};
|
|
70
72
|
const problems = [];
|
|
71
73
|
let resources = {};
|
|
74
|
+
let rawSuites;
|
|
75
|
+
let hasSuitesKey = false;
|
|
76
|
+
const settingContext = { drivers };
|
|
77
|
+
const hasTopLevelDriver = value["driver"] !== undefined;
|
|
72
78
|
for (const [key, keyValue] of Object.entries(value)) {
|
|
73
79
|
if (key === "resources")
|
|
74
|
-
resources = checkResources(keyValue, definitions, problems);
|
|
80
|
+
resources = checkResources(keyValue, definitions, problems, "resources");
|
|
81
|
+
else if (key === "suites") {
|
|
82
|
+
hasSuitesKey = true;
|
|
83
|
+
rawSuites = keyValue;
|
|
84
|
+
}
|
|
75
85
|
else if (isConfigSettingKey(key)) {
|
|
76
86
|
if (keyValue !== undefined)
|
|
77
|
-
checkSetting(key, keyValue, settings, problems);
|
|
87
|
+
checkSetting(key, keyValue, settings, settingContext, problems);
|
|
78
88
|
}
|
|
79
89
|
else
|
|
80
90
|
problems.push({ key, location: null, problem: `is not a ${CONFIG_FILE_NAME} key` });
|
|
81
91
|
}
|
|
92
|
+
if (settings.args !== undefined && !hasTopLevelDriver) {
|
|
93
|
+
problems.push({ key: "args", location: null, problem: "requires a top-level driver" });
|
|
94
|
+
}
|
|
95
|
+
const suites = hasSuitesKey
|
|
96
|
+
? checkSuites(rawSuites, {
|
|
97
|
+
definitions,
|
|
98
|
+
drivers,
|
|
99
|
+
hasTopLevelDriver,
|
|
100
|
+
topLevelRunnerOptions: rawVercelSandboxOptions(value["runner"]),
|
|
101
|
+
}, problems)
|
|
102
|
+
: {};
|
|
82
103
|
if (problems.length > 0)
|
|
83
104
|
return { kind: "invalid", path, problems };
|
|
84
|
-
return { kind: "loaded", path, values: { settings, resources } };
|
|
105
|
+
return { kind: "loaded", path, values: { settings, resources, suites } };
|
|
85
106
|
}
|
|
86
107
|
/** Checks one top-level setting, putting its value in `settings` or each thing wrong with it onto `problems`. */
|
|
87
|
-
function checkSetting(key, value, settings, problems) {
|
|
88
|
-
const checked = checkSettingValue(key, value);
|
|
108
|
+
function checkSetting(key, value, settings, context, problems) {
|
|
109
|
+
const checked = checkSettingValue(key, value, context);
|
|
89
110
|
// `Object.assign`, since TypeScript can't relate a union key's value to the mapped type's entry for that key.
|
|
90
111
|
if (checked.ok)
|
|
91
112
|
Object.assign(settings, { [key]: checked.value });
|
|
@@ -93,95 +114,6 @@ function checkSetting(key, value, settings, problems) {
|
|
|
93
114
|
for (const { path: inside, problem } of checked.problems)
|
|
94
115
|
problems.push({ key: [key, ...inside].join("."), location: null, problem });
|
|
95
116
|
}
|
|
96
|
-
/**
|
|
97
|
-
* Each resource `resources` holds, by resource key, its options checked; empty when the file sets `resources`
|
|
98
|
-
* to undefined. Each thing wrong is pushed onto `problems`: a `resources` that isn't an object, a key no definition
|
|
99
|
-
* names, a value that isn't a resource its definition made, a resource whose key isn't its definition's name (for now a
|
|
100
|
-
* config file holds only default resources), an unknown option, or a value its option's rule refuses.
|
|
101
|
-
*/
|
|
102
|
-
function checkResources(value, definitions, problems) {
|
|
103
|
-
if (value === undefined)
|
|
104
|
-
return {};
|
|
105
|
-
if (!isRecord(value)) {
|
|
106
|
-
problems.push({ key: "resources", location: null, problem: `must be an object, not ${describeValue(value)}` });
|
|
107
|
-
return {};
|
|
108
|
-
}
|
|
109
|
-
const byName = new Map(definitions.map((definition) => [definition.name, definition]));
|
|
110
|
-
const holds = definitions.length === 0 ? "none" : definitions.map((each) => each.name).join(", ");
|
|
111
|
-
const found = {};
|
|
112
|
-
for (const [key, resource] of Object.entries(value)) {
|
|
113
|
-
const named = entryName(resource);
|
|
114
|
-
// The definition a resource names, when storm knows it; else the one the key names, which must have made it.
|
|
115
|
-
const definition = byName.get(named !== undefined && byName.has(named) ? named : key);
|
|
116
|
-
// A resource under a key other than its definition's name: `defineConfig` refuses it in the editor, and a file
|
|
117
|
-
// that skips `defineConfig` is refused here.
|
|
118
|
-
if (named !== undefined && definition !== undefined && key !== defaultResourceKey(definition)) {
|
|
119
|
-
problems.push({
|
|
120
|
-
key: `resources.${key}`,
|
|
121
|
-
location: null,
|
|
122
|
-
problem: `holds a ${named} resource; for now a resource's key must be its definition's name: name its key ${defaultResourceKey(definition)}`,
|
|
123
|
-
});
|
|
124
|
-
continue;
|
|
125
|
-
}
|
|
126
|
-
if (definition === undefined) {
|
|
127
|
-
problems.push({
|
|
128
|
-
key: `resources.${key}`,
|
|
129
|
-
location: null,
|
|
130
|
-
problem: `is not a resource; resources holds ${holds}`,
|
|
131
|
-
});
|
|
132
|
-
continue;
|
|
133
|
-
}
|
|
134
|
-
if (resource === undefined)
|
|
135
|
-
continue;
|
|
136
|
-
const options = checkResource(definition, key, resource, problems);
|
|
137
|
-
if (options !== undefined)
|
|
138
|
-
found[key] = { definition: definition.name, options };
|
|
139
|
-
}
|
|
140
|
-
return found;
|
|
141
|
-
}
|
|
142
|
-
/** The definition's name `value` carries, when it is shaped like a resource; undefined otherwise. */
|
|
143
|
-
function entryName(value) {
|
|
144
|
-
return isRecord(value) && typeof value["name"] === "string" ? value["name"] : undefined;
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* The options of resource `key`, of `definition`, each checked; undefined when the value isn't a resource its
|
|
148
|
-
* definition made, or holds an option `definition` doesn't define, or a value an option's rule refuses, each thing
|
|
149
|
-
* wrong pushed onto `problems`.
|
|
150
|
-
*/
|
|
151
|
-
function checkResource(definition, key, value, problems) {
|
|
152
|
-
const { name } = definition;
|
|
153
|
-
const options = isRecord(value) && value["name"] === name ? value["options"] : undefined;
|
|
154
|
-
if (!isRecord(options)) {
|
|
155
|
-
problems.push({
|
|
156
|
-
key: `resources.${key}`,
|
|
157
|
-
location: null,
|
|
158
|
-
problem: `must be made by ${resourceCall(name)}, not ${describeValue(value)}`,
|
|
159
|
-
});
|
|
160
|
-
return undefined;
|
|
161
|
-
}
|
|
162
|
-
const checked = {};
|
|
163
|
-
let valid = true;
|
|
164
|
-
for (const [option, optionValue] of Object.entries(options)) {
|
|
165
|
-
const path = `resources.${key}.${option}`;
|
|
166
|
-
const rule = Object.hasOwn(definition.options, option) ? definition.options[option] : undefined;
|
|
167
|
-
if (rule === undefined) {
|
|
168
|
-
valid = false;
|
|
169
|
-
problems.push({ key: path, location: null, problem: `is not a ${name} option` });
|
|
170
|
-
continue;
|
|
171
|
-
}
|
|
172
|
-
if (optionValue === undefined)
|
|
173
|
-
continue;
|
|
174
|
-
const result = checkWith(rule.schema, optionValue);
|
|
175
|
-
if (result.ok)
|
|
176
|
-
checked[option] = result.value;
|
|
177
|
-
else {
|
|
178
|
-
valid = false;
|
|
179
|
-
for (const { path: inside, problem } of result.problems)
|
|
180
|
-
problems.push({ key: [path, ...inside].join("."), location: null, problem });
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
return valid ? checked : undefined;
|
|
184
|
-
}
|
|
185
117
|
function isRecord(value) {
|
|
186
118
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
187
119
|
}
|
|
@@ -10,6 +10,13 @@ export interface RecipeRun {
|
|
|
10
10
|
* doesn't, such as a resource nothing gives or whose `beforeRun` skipped it.
|
|
11
11
|
*/
|
|
12
12
|
get<D extends ResourceDefinition>(factory: ResourceFactory<D>): Present<OptionsOf<D>>;
|
|
13
|
+
/**
|
|
14
|
+
* The run's number of runner sandboxes: 1 unless the run is across runner sandboxes. storm calls the function once
|
|
15
|
+
* for the run, and every runner sandbox has the size it gives, while a resource's option, such as a count of what the
|
|
16
|
+
* resource provides, is the run's total. So a recipe that sizes the runner sandbox from such an option divides it by
|
|
17
|
+
* this: `Math.ceil(count / run.sandboxes)`.
|
|
18
|
+
*/
|
|
19
|
+
readonly sandboxes: number;
|
|
13
20
|
}
|
|
14
21
|
/** One of the run's resources, as a recipe's `vcpus` function reads it: its definition's name and its options. */
|
|
15
22
|
export interface RecipeResource {
|
|
@@ -23,4 +30,4 @@ export interface RecipeResource {
|
|
|
23
30
|
*/
|
|
24
31
|
export declare function recipeRun(resources: {
|
|
25
32
|
readonly [key: string]: RecipeResource;
|
|
26
|
-
}): VcpusRun<RecipeRun>;
|
|
33
|
+
}, sandboxes?: number): VcpusRun<RecipeRun>;
|
|
@@ -10,8 +10,9 @@ const NOT_PRESENT = Object.freeze({ present: false });
|
|
|
10
10
|
* and the resource keys a problem with the function names. Each value `get` returns is a frozen copy, so a function
|
|
11
11
|
* can't change the run's resources.
|
|
12
12
|
*/
|
|
13
|
-
export function recipeRun(resources) {
|
|
13
|
+
export function recipeRun(resources, sandboxes = 1) {
|
|
14
14
|
const run = {
|
|
15
|
+
sandboxes,
|
|
15
16
|
get: ({ definition }) => {
|
|
16
17
|
const key = defaultResourceKey(definition);
|
|
17
18
|
const resource = Object.hasOwn(resources, key) ? resources[key] : undefined;
|
package/dist/config/resolve.d.ts
CHANGED
|
@@ -10,8 +10,9 @@ export interface SettingFlags {
|
|
|
10
10
|
readonly project?: string | undefined;
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
|
-
* Resolves each top-level setting: the flag's value, else the config file's. `
|
|
14
|
-
* loaded config file's settings, already checked, or `undefined` when no
|
|
13
|
+
* Resolves each top-level setting: the flag's value, else the config file's. `driver`, `args`, `runner`, and
|
|
14
|
+
* `testPlan` have no flag here. `file` is the loaded config file's settings, already checked, or `undefined` when no
|
|
15
|
+
* file applies.
|
|
15
16
|
*/
|
|
16
17
|
export declare function resolveSettings(flags: SettingFlags, file: CheckedSettings | undefined): ResolvedSettings;
|
|
17
18
|
/**
|
package/dist/config/resolve.js
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
import { defaultResourceKey, resourceCall, NOT_COUNTED, optionKeyPath, } from "../sdk/extension/index.js";
|
|
4
4
|
import { settingsOf } from "./typed-options.js";
|
|
5
5
|
/**
|
|
6
|
-
* Resolves each top-level setting: the flag's value, else the config file's. `
|
|
7
|
-
* loaded config file's settings, already checked, or `undefined` when no
|
|
6
|
+
* Resolves each top-level setting: the flag's value, else the config file's. `driver`, `args`, `runner`, and
|
|
7
|
+
* `testPlan` have no flag here. `file` is the loaded config file's settings, already checked, or `undefined` when no
|
|
8
|
+
* file applies.
|
|
8
9
|
*/
|
|
9
10
|
export function resolveSettings(flags, file) {
|
|
10
11
|
const pick = (flag, fromFile) => flag !== undefined
|
|
@@ -15,6 +16,8 @@ export function resolveSettings(flags, file) {
|
|
|
15
16
|
return {
|
|
16
17
|
scope: pick(flags.scope, file?.scope),
|
|
17
18
|
project: pick(flags.project, file?.project),
|
|
19
|
+
driver: pick(undefined, file?.driver),
|
|
20
|
+
args: pick(undefined, file?.args),
|
|
18
21
|
runner: pick(undefined, file?.runner),
|
|
19
22
|
testPlan: pick(undefined, file?.testPlan),
|
|
20
23
|
};
|
|
@@ -123,7 +126,7 @@ function planResources(resources, run) {
|
|
|
123
126
|
const merged = settingsFor(run);
|
|
124
127
|
const settings = merged;
|
|
125
128
|
planned.push(...plannedOptions(definition, key, settings));
|
|
126
|
-
const refused = definition.check(merged);
|
|
129
|
+
const refused = definition.check(merged, run);
|
|
127
130
|
if (refused.length === 0)
|
|
128
131
|
resolved[key] = {
|
|
129
132
|
definition: definition.name,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { Refusable } from "@vercel/clinkr";
|
|
2
|
+
import { type ResourceDefinition, type GivenOptions, type Setting, type SettingsOf } from "../sdk/extension/index.ts";
|
|
2
3
|
import type { configErrors } from "./errors.ts";
|
|
3
4
|
import type { ConfigGateway } from "./gateways.ts";
|
|
4
5
|
import { type SettingFlags } from "./resolve.ts";
|
|
5
|
-
import { type
|
|
6
|
+
import { type SettingsFile } from "./settings-file.ts";
|
|
6
7
|
/** The control plane team and project a command's flags or the file give, each with its source; unset when neither. */
|
|
7
8
|
export interface TargetSettings {
|
|
8
9
|
readonly scope: Setting<string> | undefined;
|
|
@@ -23,18 +24,31 @@ export interface ConfigResolver {
|
|
|
23
24
|
/**
|
|
24
25
|
* Finds `storm.config.ts` from the launcher's working directory and checks all of it, refusing with `invalid_config`.
|
|
25
26
|
* Then it merges the options of resource definition `definition`'s default resource, each from `options` (the
|
|
26
|
-
* command's own flags for them), else the file, else its default, refusing with `invalid_resource_options` when a
|
|
27
|
-
* It runs none of the resource's checks across options. The target's team and project come
|
|
28
|
-
* file.
|
|
27
|
+
* command's own flags for them), else the file, else its default, refusing with `invalid_resource_options` when a
|
|
28
|
+
* required one is missing. It runs none of the resource's checks across options. The target's team and project come
|
|
29
|
+
* from `target`, else the file.
|
|
29
30
|
*/
|
|
30
31
|
load<D extends ResourceDefinition>(definition: D, options: GivenOptions<D>, target: SettingFlags): Promise<Refusable<LoadedResourceSettings<D>, ConfigLoadError>>;
|
|
31
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* The config resolver storm's own commands get: an extension's `load`, and `loadFile`, which gives the whole checked
|
|
35
|
+
* file, which a run, `storm suites list`, and the `snapshots` commands read.
|
|
36
|
+
*/
|
|
37
|
+
export interface StormConfigResolver extends ConfigResolver {
|
|
38
|
+
/**
|
|
39
|
+
* Finds `storm.config.ts` from the launcher's working directory and checks all of it against every resource
|
|
40
|
+
* definition and every driver's name, refusing with `invalid_config`. It gives the file's path and checked values,
|
|
41
|
+
* or neither when no file applies.
|
|
42
|
+
*/
|
|
43
|
+
loadFile(): Promise<Refusable<SettingsFile, ReturnType<typeof configErrors.invalidConfig>>>;
|
|
44
|
+
}
|
|
32
45
|
/**
|
|
33
46
|
* The config launcher resolver over `gateway`, finding the file from `cwd` and checking it against every one of
|
|
34
|
-
* `definitions`.
|
|
47
|
+
* `definitions` and `drivers`.
|
|
35
48
|
*/
|
|
36
49
|
export declare function configResolver(launcher: {
|
|
37
50
|
readonly gateway: ConfigGateway;
|
|
38
51
|
readonly cwd: string;
|
|
39
52
|
readonly definitions: readonly ResourceDefinition[];
|
|
40
|
-
|
|
53
|
+
readonly drivers: readonly string[];
|
|
54
|
+
}): StormConfigResolver;
|
package/dist/config/resolver.js
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
// The config launcher resolver: how a command that reads `storm.config.ts` gets one resource's
|
|
2
|
-
// plane target, from its flags over the file, without calling the loading and merging functions
|
|
3
|
-
// builds it once, over its config gateway, its working directory
|
|
4
|
-
// command
|
|
5
|
-
|
|
1
|
+
// The config launcher resolver: how a command that reads `storm.config.ts` gets the checked file, or one resource's
|
|
2
|
+
// options and the control plane target, from its flags over the file, without calling the loading and merging functions
|
|
3
|
+
// itself. The launcher builds it once, over its config gateway, its working directory, every resource definition, and
|
|
4
|
+
// every driver's name, and hands it to every command: storm's own commands as `StormConfigResolver`, and an
|
|
5
|
+
// extension's commands as the narrower `ConfigResolver`.
|
|
6
6
|
import { defaultResourceKey, NOT_COUNTED, } from "../sdk/extension/index.js";
|
|
7
|
-
import {
|
|
7
|
+
import { mergeResourceOptions } from "./resolve.js";
|
|
8
|
+
import { fileOptions, fileSettings, invalidResourceOptions, loadSettingsFile, } from "./settings-file.js";
|
|
8
9
|
/**
|
|
9
10
|
* The config launcher resolver over `gateway`, finding the file from `cwd` and checking it against every one of
|
|
10
|
-
* `definitions`.
|
|
11
|
+
* `definitions` and `drivers`.
|
|
11
12
|
*/
|
|
12
13
|
export function configResolver(launcher) {
|
|
14
|
+
const loadFile = () => loadSettingsFile(launcher.gateway, launcher.cwd, launcher.definitions, launcher.drivers);
|
|
13
15
|
return {
|
|
16
|
+
loadFile,
|
|
14
17
|
async load(definition, options, target) {
|
|
15
|
-
const file = await
|
|
18
|
+
const file = await loadFile();
|
|
16
19
|
if (!file.ok)
|
|
17
20
|
return file;
|
|
18
21
|
const settings = fileSettings(file, target);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { CheckedRecipe, RunnerRecipe } from "../runner/recipe.ts";
|
|
2
|
+
import type { RecipeRun } from "./recipe-run.ts";
|
|
3
|
+
/** One runner kind storm supports. */
|
|
4
|
+
export type RunnerKind = "launch-machine" | "vercel-sandbox";
|
|
5
|
+
/** The launch machine runner value, made by `launchMachine()`. */
|
|
6
|
+
export interface LaunchMachineRunner {
|
|
7
|
+
readonly kind: "launch-machine";
|
|
8
|
+
}
|
|
9
|
+
/** The Vercel Sandbox runner value, made by `vercelSandbox(options)`. */
|
|
10
|
+
export interface VercelSandboxRunner<TOptions = RunnerRecipe<RecipeRun>> {
|
|
11
|
+
readonly kind: "vercel-sandbox";
|
|
12
|
+
readonly options: TOptions;
|
|
13
|
+
}
|
|
14
|
+
/** A top-level `runner` value in `storm.config.ts`: complete Vercel Sandbox options, or the launch machine. */
|
|
15
|
+
export type RunnerConfig<Run = RecipeRun> = LaunchMachineRunner | VercelSandboxRunner<RunnerRecipe<Run>>;
|
|
16
|
+
/** A suite's `runner` value in `storm.config.ts`: complete or partial Vercel Sandbox options, or the launch machine. */
|
|
17
|
+
export type SuiteRunnerConfig<Run = RecipeRun> = LaunchMachineRunner | VercelSandboxRunner<Partial<RunnerRecipe<Run>>>;
|
|
18
|
+
/** A checked `runner` value after loading `storm.config.ts`, with defaults filled in on a Vercel Sandbox recipe. */
|
|
19
|
+
export type CheckedRunner<Run = RecipeRun> = {
|
|
20
|
+
readonly kind: "launch-machine";
|
|
21
|
+
} | {
|
|
22
|
+
readonly kind: "vercel-sandbox";
|
|
23
|
+
readonly recipe: CheckedRecipe<Run>;
|
|
24
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// The declared `runner` value in `storm.config.ts` and its checked form: two peer runner kinds, the launch machine
|
|
2
|
+
// (`launchMachine()`) and Vercel Sandbox (`vercelSandbox(options)`). Type-only so `@vercel/storm/config`'s
|
|
3
|
+
// declarations reach only `runner/recipe.ts` and `recipe-run.ts`, never Clinkr or zod.
|
|
4
|
+
export {};
|