@cnc-tools/storm 0.10.0 → 0.11.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 +17 -9
- package/dist/build-info.js +1 -1
- package/dist/chunks/{chunk-YF3ICDBY.js → chunk-3ZZVZPMG.js} +1 -1
- package/dist/chunks/{chunk-JQ2HK4RN.js → chunk-4EU4AH7E.js} +141 -6
- package/dist/chunks/{chunk-ZJ2USLAT.js → chunk-4PRAB24Y.js} +2 -22
- package/dist/chunks/chunk-AMTYHUYB.js +257 -0
- package/dist/chunks/{chunk-WF4KJ7YG.js → chunk-ETCZ6WP7.js} +1 -1
- package/dist/chunks/chunk-FVMQKYTT.js +10 -0
- package/dist/chunks/{chunk-XHJGHJBW.js → chunk-GRMD7G4J.js} +33 -275
- package/dist/chunks/chunk-ICB4BZJX.js +22 -0
- package/dist/chunks/{chunk-AGWW3HDT.js → chunk-KR7WIYLG.js} +1826 -2201
- package/dist/chunks/{chunk-OVXD7GES.js → chunk-L4ZPMSKQ.js} +4 -37
- package/dist/chunks/chunk-NPPJ57W7.js +569 -0
- package/dist/chunks/{chunk-VJQLMGOH.js → chunk-O4BUT7BE.js} +361 -1716
- package/dist/chunks/chunk-OJOKQRM6.js +1457 -0
- package/dist/chunks/chunk-SLNKW4ZM.js +40 -0
- package/dist/chunks/{chunk-AKKNF3WZ.js → chunk-TRFEAYNC.js} +277 -348
- package/dist/chunks/chunk-VZZTHCBW.js +93 -0
- package/dist/chunks/chunk-WNIQA5J6.js +19 -0
- package/dist/chunks/chunk-WSIF7SR6.js +10 -0
- package/dist/chunks/{live-app-RIJM3QFD.js → live-app-LOGYUBKB.js} +52 -7
- package/dist/commands/exec/cleanup.d.ts +3 -3
- package/dist/commands/exec/cleanup.js +6 -2
- package/dist/commands/exec/command.d.ts +3 -3
- package/dist/commands/exec/command.js +17 -10
- package/dist/commands/exec/job-summary.d.ts +1 -1
- package/dist/commands/exec/job-summary.js +1 -1
- package/dist/commands/exec/live-view.js +5 -5
- package/dist/commands/exec/mint-failed.js +1 -1
- package/dist/commands/exec/outcomes.d.ts +2 -2
- package/dist/commands/exec/outcomes.js +7 -8
- package/dist/commands/exec/plan-run.d.ts +3 -5
- package/dist/commands/exec/progress.d.ts +3 -3
- package/dist/commands/exec/progress.js +6 -6
- package/dist/commands/exec/resource-refusals.d.ts +1 -1
- package/dist/commands/exec/resource-refusals.js +1 -1
- package/dist/commands/exec/run-command.d.ts +14 -9
- package/dist/commands/exec/run-command.js +91 -202
- package/dist/commands/exec/run-metadata.d.ts +2 -2
- package/dist/commands/exec/run-metadata.js +3 -3
- package/dist/commands/exec/test-plan.d.ts +1 -35
- package/dist/commands/exec/test-plan.js +4 -24
- package/dist/commands/exec/view.js +3 -3
- package/dist/commands/exec/waterfall.d.ts +3 -1
- package/dist/commands/exec/waterfall.js +18 -1
- package/dist/commands/runs/facts.d.ts +2 -1
- package/dist/commands/runs/facts.js +1 -1
- package/dist/commands/runs/list/command.js +10 -9
- package/dist/commands/runs/logs/command.js +14 -12
- package/dist/commands/runs/past-run.d.ts +3 -27
- package/dist/commands/runs/past-run.js +3 -37
- package/dist/commands/runs/show/command.js +24 -21
- package/dist/commands/runs/show/outcomes.js +2 -2
- package/dist/commands/vitest/command.d.ts +3 -3
- package/dist/commands/vitest/command.js +24 -17
- package/dist/commands/vitest/outcomes.d.ts +1 -1
- package/dist/commands/vitest/outcomes.js +1 -1
- package/dist/config/credential-resolver.d.ts +6 -3
- package/dist/config/credential-resolver.js +6 -5
- package/dist/context.d.ts +27 -9
- package/dist/context.js +19 -8
- package/dist/core/before-run.d.ts +5 -4
- package/dist/core/before-run.js +6 -6
- package/dist/core/definition-lookup.d.ts +22 -0
- package/dist/core/definition-lookup.js +34 -0
- package/dist/core/events.d.ts +5 -19
- package/dist/core/gateways.d.ts +22 -162
- package/dist/core/index.d.ts +10 -11
- package/dist/core/index.js +9 -11
- package/dist/core/launcher-supplies.js +2 -2
- package/dist/core/live/terminal-command-gateway.d.ts +8 -0
- package/dist/core/live/terminal-command-gateway.js +49 -0
- package/dist/core/presentations.d.ts +4 -3
- package/dist/core/presentations.js +4 -5
- package/dist/core/resource-registry.d.ts +35 -51
- package/dist/core/resource-registry.js +27 -54
- package/dist/core/resource-reports.d.ts +37 -4
- package/dist/core/resource-reports.js +34 -5
- package/dist/core/resources.d.ts +4 -3
- package/dist/core/resources.js +2 -4
- package/dist/core/run-state.d.ts +1 -1
- package/dist/core/run-state.js +1 -1
- package/dist/core/run.d.ts +19 -37
- package/dist/core/run.js +59 -114
- package/dist/core/timeline.js +2 -1
- package/dist/credential/events.d.ts +20 -0
- package/dist/credential/events.js +4 -0
- package/dist/credential/index.d.ts +2 -1
- package/dist/credential/index.js +6 -5
- package/dist/credential/source.d.ts +38 -26
- package/dist/credential/source.js +25 -34
- package/dist/extension-commands.d.ts +12 -6
- package/dist/extension-commands.js +18 -11
- package/dist/extensions/story/command-tree.d.ts +6 -0
- package/dist/extensions/story/command-tree.js +21 -0
- package/dist/extensions/story/commands/app.d.ts +23 -0
- package/dist/extensions/story/commands/app.js +5 -0
- package/dist/extensions/story/commands/run/command.d.ts +211 -0
- package/dist/extensions/story/commands/run/command.js +259 -0
- package/dist/extensions/story/commands/run/metadata.d.ts +4 -0
- package/dist/extensions/story/commands/run/metadata.js +8 -0
- package/dist/extensions/story/commands/run/outcomes.d.ts +101 -0
- package/dist/extensions/story/commands/run/outcomes.js +73 -0
- package/dist/extensions/story/commands/tree.d.ts +2 -0
- package/dist/extensions/story/commands/tree.js +6 -0
- package/dist/extensions/story/extension.d.ts +2 -0
- package/dist/extensions/story/extension.js +8 -0
- package/dist/extensions/testserver/command-tree.d.ts +1 -1
- package/dist/extensions/testserver/command-tree.js +0 -1
- package/dist/extensions/testserver/commands/pool/create/command.js +14 -8
- package/dist/extensions/testserver/commands/pool/list/command.js +8 -4
- package/dist/extensions/testserver/vitest/config.d.ts +7 -5
- package/dist/extensions/testserver/vitest/config.js +7 -5
- package/dist/extensions/testserver/vitest/fixtures.d.ts +2 -0
- package/dist/extensions/testserver/vitest/fixtures.js +36 -5
- package/dist/extensions.d.ts +12 -21
- package/dist/extensions.js +22 -34
- package/dist/forward-sigterm.d.ts +8 -0
- package/dist/forward-sigterm.js +18 -0
- package/dist/launcher-resolvers/index.d.ts +1 -0
- package/dist/launcher-resolvers/index.js +2 -1
- package/dist/launcher-resolvers/local-services.d.ts +57 -0
- package/dist/launcher-resolvers/local-services.js +7 -0
- package/dist/live-app.js +2 -1
- package/dist/local-services.d.ts +19 -0
- package/dist/local-services.js +37 -0
- package/dist/run-directory/gateways.d.ts +167 -0
- package/dist/run-directory/gateways.js +2 -0
- package/dist/run-directory/index.d.ts +8 -0
- package/dist/run-directory/index.js +13 -0
- package/dist/run-directory/plan.d.ts +35 -0
- package/dist/run-directory/plan.js +24 -0
- package/dist/run-directory/reader.d.ts +70 -0
- package/dist/run-directory/reader.js +51 -0
- package/dist/run-directory/recording.d.ts +92 -0
- package/dist/run-directory/recording.js +85 -0
- package/dist/{commands/exec → run-directory}/run-collector.d.ts +9 -8
- package/dist/{commands/exec → run-directory}/run-collector.js +8 -10
- package/dist/{core → run-directory}/run-directory.d.ts +3 -3
- package/dist/{core → run-directory}/run-directory.js +2 -2
- package/dist/{commands/exec → run-directory}/run-record.d.ts +29 -7
- package/dist/{commands/exec → run-directory}/run-record.js +79 -5
- package/dist/{commands/exec → run-directory}/timeline-facts.d.ts +4 -8
- package/dist/{commands/exec → run-directory}/timeline-facts.js +8 -24
- package/dist/runner/events.d.ts +6 -5
- package/dist/runner/index.d.ts +13 -17
- package/dist/runner/index.js +10 -14
- package/dist/runner/prepare.d.ts +28 -6
- package/dist/runner/prepare.js +15 -9
- package/dist/runner/recipe.d.ts +14 -0
- package/dist/runner/recipe.js +12 -0
- package/dist/runner/scope.d.ts +18 -11
- package/dist/runner/scope.js +12 -10
- package/dist/runner/session.d.ts +100 -0
- package/dist/runner/session.js +109 -0
- package/dist/runner/snapshot-save.d.ts +3 -2
- package/dist/runner/snapshot-save.js +6 -5
- package/dist/sdk/extension/ci.d.ts +2 -0
- package/dist/sdk/extension/ci.js +6 -0
- package/dist/sdk/extension/commands.d.ts +11 -13
- package/dist/sdk/extension/commands.js +5 -5
- package/dist/sdk/extension/index.d.ts +1 -0
- package/dist/sdk/extension/index.js +1 -0
- package/dist/sdk/extension/lifecycle.d.ts +4 -3
- package/dist/sdk/extension/progress.js +2 -2
- package/dist/sdk/extension/resource.js +1 -1
- package/dist/story/align.d.ts +1 -1
- package/dist/story/align.js +1 -1
- package/dist/story/command-line.d.ts +6 -16
- package/dist/story/command-line.js +11 -23
- package/dist/story/errors.d.ts +1 -1
- package/dist/story/errors.js +1 -1
- package/dist/story/host.d.ts +1 -1
- package/dist/story/host.js +2 -2
- package/dist/story/index.d.ts +2 -2
- package/dist/story/index.js +4 -3
- package/dist/story/launch.d.ts +70 -0
- package/dist/story/launch.js +77 -0
- package/dist/story/report.d.ts +2 -2
- package/dist/story/report.js +3 -4
- package/dist/story/settle.d.ts +7 -7
- package/dist/story/settle.js +5 -5
- package/dist/story/start.d.ts +2 -2
- package/dist/vendor/testserver-sdk/container/container.d.ts +11 -6
- package/dist/vendor/testserver-sdk/container/container.js +38 -16
- package/dist/vendor/testserver-sdk/testserver/failure.d.ts +4 -3
- package/dist/vendor/testserver-sdk/testserver/failure.js +4 -3
- package/package.json +1 -1
- package/skills/overview.md +3 -0
- package/skills/read-run-output.md +2 -2
- package/dist/chunks/chunk-H2VCSNVU.js +0 -351
- package/dist/chunks/chunk-J6ZNYUDV.js +0 -21
- package/dist/core/mint.d.ts +0 -10
- package/dist/core/mint.js +0 -14
- package/dist/story/mode.d.ts +0 -17
- package/dist/story/mode.js +0 -21
- /package/dist/{core → run-directory}/live/run-directory-gateway.d.ts +0 -0
- /package/dist/{core → run-directory}/live/run-directory-gateway.js +0 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import {
|
|
2
|
+
secondsOf,
|
|
3
|
+
secondsText
|
|
4
|
+
} from "./chunk-KR7WIYLG.js";
|
|
5
|
+
|
|
6
|
+
// src/commands/dashboard.ts
|
|
7
|
+
function projectPage({ team, project }) {
|
|
8
|
+
return `https://vercel.com/${encodeURIComponent(team)}/${encodeURIComponent(project)}`;
|
|
9
|
+
}
|
|
10
|
+
function sandboxPage(where, name) {
|
|
11
|
+
return `${projectPage(where)}/sandboxes/${encodeURIComponent(name)}`;
|
|
12
|
+
}
|
|
13
|
+
function sandboxConnectPage(where, name) {
|
|
14
|
+
return `${sandboxPage(where, name)}/connect`;
|
|
15
|
+
}
|
|
16
|
+
function snapshotPage(where, id) {
|
|
17
|
+
return `${projectPage(where)}/sandboxes/snapshots/${encodeURIComponent(id)}`;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// src/commands/exec/text.ts
|
|
21
|
+
function seconds(ms) {
|
|
22
|
+
return secondsText(secondsOf(ms));
|
|
23
|
+
}
|
|
24
|
+
function keepTimeText(ms) {
|
|
25
|
+
const minutes = Math.round(ms / 6e4);
|
|
26
|
+
return minutes >= 60 && minutes % 60 === 0 ? `${minutes / 60}h` : `${minutes}m`;
|
|
27
|
+
}
|
|
28
|
+
function releaseText(resources, done) {
|
|
29
|
+
return resources.length === 0 ? void 0 : `${done ? "released" : "releasing"} ${resources.join(", ")}`;
|
|
30
|
+
}
|
|
31
|
+
function isoSecondsText(iso) {
|
|
32
|
+
return iso.replace(/\.\d+Z$/, "Z");
|
|
33
|
+
}
|
|
34
|
+
function short(sha) {
|
|
35
|
+
return sha.slice(0, 12);
|
|
36
|
+
}
|
|
37
|
+
function shortFile(file) {
|
|
38
|
+
const parts = file.split("/").filter((part) => part !== "");
|
|
39
|
+
return parts.slice(-2).join("/").replace(/\.(test|spec)\.[cm]?[jt]sx?$/, "").replace(/\.[cm]?[jt]sx?$/, "");
|
|
40
|
+
}
|
|
41
|
+
function median(values) {
|
|
42
|
+
const sorted = [...values].toSorted((a, b) => a - b);
|
|
43
|
+
if (sorted.length === 0) return void 0;
|
|
44
|
+
const middle = Math.floor(sorted.length / 2);
|
|
45
|
+
return sorted.length % 2 === 1 ? sorted[middle] : ((sorted[middle - 1] ?? 0) + (sorted[middle] ?? 0)) / 2;
|
|
46
|
+
}
|
|
47
|
+
var code = (open, close) => (text) => text === "" ? text : `\x1B[${open}m${text}\x1B[${close}m`;
|
|
48
|
+
function paint(color) {
|
|
49
|
+
if (!color) {
|
|
50
|
+
const none = (text) => text;
|
|
51
|
+
return { done: none, failed: none, stopped: none, active: none, faint: none, strong: none };
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
done: code(32, 39),
|
|
55
|
+
failed: code(31, 39),
|
|
56
|
+
stopped: code(33, 39),
|
|
57
|
+
active: code(36, 39),
|
|
58
|
+
faint: code(2, 22),
|
|
59
|
+
strong: code(1, 22)
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
var COLOR_CODE = /\u001b\[[0-9;]*m/g;
|
|
63
|
+
function visibleLength(text) {
|
|
64
|
+
return Array.from(text.replace(COLOR_CODE, "")).length;
|
|
65
|
+
}
|
|
66
|
+
function truncate(text, width) {
|
|
67
|
+
if (visibleLength(text) <= width) return text;
|
|
68
|
+
const plain = Array.from(text.replace(COLOR_CODE, ""));
|
|
69
|
+
return width <= 0 ? "" : `${plain.slice(0, width - 1).join("")}\u2026`;
|
|
70
|
+
}
|
|
71
|
+
function spread(left, right, width) {
|
|
72
|
+
if (right === "") return truncate(left, width);
|
|
73
|
+
const room = width - visibleLength(right) - 1;
|
|
74
|
+
const fitted = truncate(left, Math.max(0, room));
|
|
75
|
+
return `${fitted}${" ".repeat(Math.max(1, width - visibleLength(fitted) - visibleLength(right)))}${right}`;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export {
|
|
79
|
+
sandboxPage,
|
|
80
|
+
sandboxConnectPage,
|
|
81
|
+
snapshotPage,
|
|
82
|
+
seconds,
|
|
83
|
+
keepTimeText,
|
|
84
|
+
releaseText,
|
|
85
|
+
isoSecondsText,
|
|
86
|
+
short,
|
|
87
|
+
shortFile,
|
|
88
|
+
median,
|
|
89
|
+
paint,
|
|
90
|
+
visibleLength,
|
|
91
|
+
truncate,
|
|
92
|
+
spread
|
|
93
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
NodeSignalCancellation
|
|
3
|
+
} from "./chunk-ETCZ6WP7.js";
|
|
4
|
+
|
|
5
|
+
// src/forward-sigterm.ts
|
|
6
|
+
function forwardSigterm(signal) {
|
|
7
|
+
const terminate = new AbortController();
|
|
8
|
+
const forward = () => {
|
|
9
|
+
const reason = signal.reason;
|
|
10
|
+
if (reason instanceof NodeSignalCancellation && reason.signal === "SIGTERM") terminate.abort(reason);
|
|
11
|
+
};
|
|
12
|
+
if (signal.aborted) forward();
|
|
13
|
+
else signal.addEventListener("abort", forward, { once: true });
|
|
14
|
+
return { terminate: terminate.signal, release: () => signal.removeEventListener("abort", forward) };
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export {
|
|
18
|
+
forwardSigterm
|
|
19
|
+
};
|
|
@@ -1,16 +1,30 @@
|
|
|
1
|
+
import {
|
|
2
|
+
forwardSigterm
|
|
3
|
+
} from "./chunk-WNIQA5J6.js";
|
|
1
4
|
import {
|
|
2
5
|
RESOURCES,
|
|
6
|
+
liveVitestListGateway,
|
|
7
|
+
liveWorlds
|
|
8
|
+
} from "./chunk-NPPJ57W7.js";
|
|
9
|
+
import "./chunk-OJOKQRM6.js";
|
|
10
|
+
import "./chunk-GRMD7G4J.js";
|
|
11
|
+
import "./chunk-ETCZ6WP7.js";
|
|
12
|
+
import "./chunk-SLNKW4ZM.js";
|
|
13
|
+
import "./chunk-WSIF7SR6.js";
|
|
14
|
+
import "./chunk-FVMQKYTT.js";
|
|
15
|
+
import "./chunk-ICB4BZJX.js";
|
|
16
|
+
import {
|
|
3
17
|
RUNS_SUBPATH,
|
|
18
|
+
commandExitStatus,
|
|
4
19
|
liveCommandGateway,
|
|
5
20
|
liveJobSummaryGateway,
|
|
6
21
|
liveProgressTerminal,
|
|
7
22
|
liveRunDirectoryGateway,
|
|
8
|
-
|
|
9
|
-
liveWorlds,
|
|
23
|
+
liveTerminalCommandGateway,
|
|
10
24
|
resolveStateDirectory,
|
|
11
25
|
stateDirectoryPattern,
|
|
12
26
|
unavailableRunDirectoryGateway
|
|
13
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-KR7WIYLG.js";
|
|
14
28
|
import {
|
|
15
29
|
RUNNER_SNAPSHOTS_SUBPATH,
|
|
16
30
|
configResolver,
|
|
@@ -26,10 +40,33 @@ import {
|
|
|
26
40
|
systemClock,
|
|
27
41
|
systemTimer,
|
|
28
42
|
unavailableRunnerSnapshotCacheGateway
|
|
29
|
-
} from "./chunk-
|
|
30
|
-
import "./chunk-
|
|
31
|
-
import "./chunk-
|
|
32
|
-
|
|
43
|
+
} from "./chunk-O4BUT7BE.js";
|
|
44
|
+
import "./chunk-AMTYHUYB.js";
|
|
45
|
+
import "./chunk-4PRAB24Y.js";
|
|
46
|
+
|
|
47
|
+
// src/local-services.ts
|
|
48
|
+
import { parse } from "node:path";
|
|
49
|
+
function vitestService(context) {
|
|
50
|
+
return {
|
|
51
|
+
find: async (from) => {
|
|
52
|
+
const root = await context.checkout.repositoryRoot({ cwd: from });
|
|
53
|
+
return await context.vitestList.findVitest({ from, root: root.ok ? root.value : parse(from).root });
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
function terminalService(context) {
|
|
58
|
+
return {
|
|
59
|
+
run: async ({ argv, env, cwd, signal }) => {
|
|
60
|
+
const sigterm = forwardSigterm(signal);
|
|
61
|
+
try {
|
|
62
|
+
const ended = await context.terminalCommands.run({ argv, env, cwd, terminate: sigterm.terminate });
|
|
63
|
+
return ended.kind === "spawn-failed" ? ended : { ...ended, status: commandExitStatus(ended) };
|
|
64
|
+
} finally {
|
|
65
|
+
sigterm.release();
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
}
|
|
33
70
|
|
|
34
71
|
// src/context.ts
|
|
35
72
|
function launcherResolvers(app) {
|
|
@@ -38,6 +75,12 @@ function launcherResolvers(app) {
|
|
|
38
75
|
credentials: credentialResolver(app.context)
|
|
39
76
|
};
|
|
40
77
|
}
|
|
78
|
+
function localServices(app) {
|
|
79
|
+
return {
|
|
80
|
+
vitest: vitestService(app.context),
|
|
81
|
+
terminal: terminalService(app.context)
|
|
82
|
+
};
|
|
83
|
+
}
|
|
41
84
|
function liveContext(options) {
|
|
42
85
|
const snapshots = resolveStateDirectory(options.env, RUNNER_SNAPSHOTS_SUBPATH);
|
|
43
86
|
const runs = resolveStateDirectory(options.env, RUNS_SUBPATH);
|
|
@@ -45,6 +88,7 @@ function liveContext(options) {
|
|
|
45
88
|
credentials: liveCredentialGateway(),
|
|
46
89
|
githubActionsTokens: liveGitHubActionsTokenGateway({ env: options.env, timeoutMs: 1e4 }),
|
|
47
90
|
commands: liveCommandGateway(),
|
|
91
|
+
terminalCommands: liveTerminalCommandGateway(),
|
|
48
92
|
config: liveConfigGateway(),
|
|
49
93
|
checkout: liveCheckoutGateway(),
|
|
50
94
|
runnerSnapshots: snapshots.ok ? liveRunnerSnapshotCacheGateway({ directory: snapshots.directory }) : unavailableRunnerSnapshotCacheGateway(stateDirectoryPattern(RUNNER_SNAPSHOTS_SUBPATH), snapshots.reason),
|
|
@@ -83,6 +127,7 @@ function liveStormApp(host, build, exit) {
|
|
|
83
127
|
worlds: liveWorlds(host.env),
|
|
84
128
|
resourceDefinitions: RESOURCES,
|
|
85
129
|
...launcherResolvers({ context, cwd: host.cwd, resourceDefinitions: RESOURCES }),
|
|
130
|
+
...localServices({ context }),
|
|
86
131
|
env: host.env,
|
|
87
132
|
cwd: host.cwd,
|
|
88
133
|
version: build.version,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Row } from "@vercel/clinkr";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import type { InstanceWarnings, ResourceCleanupRecords,
|
|
3
|
+
import type { InstanceWarnings, ResourceCleanupRecords, RunnerCleanupFacts } from "../../core/index.ts";
|
|
4
4
|
/** One of the runner's sandboxes the run couldn't stop; its own timeout stops it. */
|
|
5
5
|
declare const notStoppedSchema: z.ZodObject<{
|
|
6
6
|
name: z.ZodString;
|
|
@@ -114,6 +114,6 @@ export interface RunCleanup {
|
|
|
114
114
|
facts(report: RunCleanupFacts): StormCleanupFacts;
|
|
115
115
|
rows(cleanup: StormCleanupFacts): readonly Row[];
|
|
116
116
|
}
|
|
117
|
-
/** The run's cleanup,
|
|
118
|
-
export declare
|
|
117
|
+
/** The run's cleanup, as every outcome after the run starts acquiring reports it: the runner's and each resource's. */
|
|
118
|
+
export declare const RUN_CLEANUP: RunCleanup;
|
|
119
119
|
export {};
|
|
@@ -4,8 +4,10 @@
|
|
|
4
4
|
// keep, and the sandboxes it couldn't stop or delete; null without a runner sandbox) and `resources`
|
|
5
5
|
// (what each resource instance's release reported, by resource key, with its definition's name: its warnings, from
|
|
6
6
|
// which the rows come, under `Warnings`). A run's own outcomes declare `cleanup` in their schemas, `resource_refused`
|
|
7
|
-
// among them (`resource-refusals.ts`).
|
|
7
|
+
// among them (`resource-refusals.ts`). `RUN_CLEANUP` is the run's cleanup over the registry's resource reports
|
|
8
|
+
// (`REGISTRY.reports`, `src/extensions.ts`).
|
|
8
9
|
import { z } from "zod";
|
|
10
|
+
import { REGISTRY } from "../../extensions.js";
|
|
9
11
|
import { sandboxConnectPage } from "../dashboard.js";
|
|
10
12
|
import { isoSecondsText } from "./text.js";
|
|
11
13
|
/** One of the runner's sandboxes the run couldn't stop; its own timeout stops it. */
|
|
@@ -100,7 +102,7 @@ export function runnerCleanupWarnings(cleanup) {
|
|
|
100
102
|
];
|
|
101
103
|
}
|
|
102
104
|
/** The run's cleanup, reporting each resource's from `reports`. */
|
|
103
|
-
|
|
105
|
+
function runCleanupOf(reports) {
|
|
104
106
|
const schema = z.object({ runner: runnerCleanupSchema.nullable(), resources: reports.cleanupSchema });
|
|
105
107
|
const rows = (cleanup) => [
|
|
106
108
|
...runnerCleanupRows(cleanup.runner),
|
|
@@ -115,6 +117,8 @@ export function runCleanupOf(reports) {
|
|
|
115
117
|
rows,
|
|
116
118
|
};
|
|
117
119
|
}
|
|
120
|
+
/** The run's cleanup, as every outcome after the run starts acquiring reports it: the runner's and each resource's. */
|
|
121
|
+
export const RUN_CLEANUP = runCleanupOf(REGISTRY.reports);
|
|
118
122
|
/**
|
|
119
123
|
* What closing the runner's sandbox scope left, as outcomes report it, with the kept runner sandbox's Connect page in
|
|
120
124
|
* the project its sandboxes are in; null without a runner sandbox.
|
|
@@ -13,7 +13,7 @@ declare const _default: import("@vercel/clinkr").CommandDefinition<z.ZodObject<{
|
|
|
13
13
|
}>>;
|
|
14
14
|
unsandboxed: z.ZodDefault<z.ZodBoolean>;
|
|
15
15
|
rebuildSnapshot: z.ZodDefault<z.ZodBoolean>;
|
|
16
|
-
saveSnapshot: z.
|
|
16
|
+
saveSnapshot: z.ZodOptional<z.ZodBoolean>;
|
|
17
17
|
showOutput: z.ZodDefault<z.ZodBoolean>;
|
|
18
18
|
keepSandbox: z.ZodOptional<z.ZodString>;
|
|
19
19
|
verbose: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -23,7 +23,7 @@ declare const _default: import("@vercel/clinkr").CommandDefinition<z.ZodObject<{
|
|
|
23
23
|
version: z.ZodString;
|
|
24
24
|
commit: z.ZodNullable<z.ZodString>;
|
|
25
25
|
configFile: z.ZodNullable<z.ZodString>;
|
|
26
|
-
resources: z.ZodType<import("../../core/resource-
|
|
26
|
+
resources: z.ZodType<import("../../core/resource-reports.ts").InstanceFacts, import("../../core/resource-reports.ts").InstanceFacts, z.core.$ZodTypeInternals<import("../../core/resource-reports.ts").InstanceFacts, import("../../core/resource-reports.ts").InstanceFacts>>;
|
|
27
27
|
cleanup: z.ZodType<import("./cleanup.ts").StormCleanupFacts, import("./cleanup.ts").StormCleanupFacts, z.core.$ZodTypeInternals<import("./cleanup.ts").StormCleanupFacts, import("./cleanup.ts").StormCleanupFacts>>;
|
|
28
28
|
command: z.ZodObject<{
|
|
29
29
|
exitCode: z.ZodNullable<z.ZodNumber>;
|
|
@@ -326,7 +326,7 @@ declare const _default: import("@vercel/clinkr").CommandDefinition<z.ZodObject<{
|
|
|
326
326
|
version: z.ZodString;
|
|
327
327
|
commit: z.ZodNullable<z.ZodString>;
|
|
328
328
|
configFile: z.ZodNullable<z.ZodString>;
|
|
329
|
-
resources: z.ZodType<import("../../core/resource-
|
|
329
|
+
resources: z.ZodType<import("../../core/resource-reports.ts").InstanceFacts, import("../../core/resource-reports.ts").InstanceFacts, z.core.$ZodTypeInternals<import("../../core/resource-reports.ts").InstanceFacts, import("../../core/resource-reports.ts").InstanceFacts>>;
|
|
330
330
|
cleanup: z.ZodType<import("./cleanup.ts").StormCleanupFacts, import("./cleanup.ts").StormCleanupFacts, z.core.$ZodTypeInternals<import("./cleanup.ts").StormCleanupFacts, import("./cleanup.ts").StormCleanupFacts>>;
|
|
331
331
|
command: z.ZodObject<{
|
|
332
332
|
exitCode: z.ZodNullable<z.ZodNumber>;
|
|
@@ -6,23 +6,30 @@ import {
|
|
|
6
6
|
outcomes,
|
|
7
7
|
runCommand,
|
|
8
8
|
runProblems
|
|
9
|
-
} from "../../chunks/chunk-
|
|
9
|
+
} from "../../chunks/chunk-TRFEAYNC.js";
|
|
10
10
|
import "../../chunks/chunk-I5GZLOLQ.js";
|
|
11
|
-
import "../../chunks/chunk-
|
|
12
|
-
import "../../chunks/chunk-WF4KJ7YG.js";
|
|
11
|
+
import "../../chunks/chunk-WNIQA5J6.js";
|
|
13
12
|
import {
|
|
14
13
|
resourceRunExamples
|
|
15
|
-
} from "../../chunks/chunk-
|
|
16
|
-
import "../../chunks/chunk-
|
|
17
|
-
import "../../chunks/chunk-
|
|
14
|
+
} from "../../chunks/chunk-4EU4AH7E.js";
|
|
15
|
+
import "../../chunks/chunk-NPPJ57W7.js";
|
|
16
|
+
import "../../chunks/chunk-OJOKQRM6.js";
|
|
17
|
+
import "../../chunks/chunk-GRMD7G4J.js";
|
|
18
|
+
import "../../chunks/chunk-ETCZ6WP7.js";
|
|
19
|
+
import "../../chunks/chunk-SLNKW4ZM.js";
|
|
20
|
+
import "../../chunks/chunk-WSIF7SR6.js";
|
|
21
|
+
import "../../chunks/chunk-FVMQKYTT.js";
|
|
22
|
+
import "../../chunks/chunk-ICB4BZJX.js";
|
|
23
|
+
import "../../chunks/chunk-VZZTHCBW.js";
|
|
24
|
+
import "../../chunks/chunk-KR7WIYLG.js";
|
|
25
|
+
import "../../chunks/chunk-O4BUT7BE.js";
|
|
18
26
|
import {
|
|
19
27
|
NOT_COUNTED
|
|
20
|
-
} from "../../chunks/chunk-
|
|
28
|
+
} from "../../chunks/chunk-AMTYHUYB.js";
|
|
21
29
|
import {
|
|
22
30
|
stormCommands
|
|
23
|
-
} from "../../chunks/chunk-
|
|
24
|
-
import "../../chunks/chunk-
|
|
25
|
-
import "../../chunks/chunk-ZJ2USLAT.js";
|
|
31
|
+
} from "../../chunks/chunk-3ZZVZPMG.js";
|
|
32
|
+
import "../../chunks/chunk-4PRAB24Y.js";
|
|
26
33
|
|
|
27
34
|
// src/commands/exec/command.ts
|
|
28
35
|
import { z } from "zod";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { TimelineFacts } from "../../run-directory/index.ts";
|
|
2
2
|
/**
|
|
3
3
|
* The job summary's Markdown for `timeline`, headed with the invoking command, `storm <command>`; `details` are
|
|
4
4
|
* lines after the critical path, such as the tests'.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// The Markdown summary a run appends to a GitHub Actions job summary: its waterfall as a table, the critical path,
|
|
2
2
|
// and where its run directory is, so a CI run that uploads it as an artifact can find it.
|
|
3
3
|
import { seconds } from "./text.js";
|
|
4
|
-
import { criticalPathStep } from "./
|
|
4
|
+
import { criticalPathStep } from "./waterfall.js";
|
|
5
5
|
/**
|
|
6
6
|
* The job summary's Markdown for `timeline`, headed with the invoking command, `storm <command>`; `details` are
|
|
7
7
|
* lines after the critical path, such as the tests'.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// The live view of a run on a terminal: its phases drawn by pure renderers from the run's state (`RunState`, built
|
|
2
|
-
// by `
|
|
2
|
+
// by `REGISTRY.applyEvent`). A run goes through its phases in order: the credential, then the resources' lanes and the
|
|
3
3
|
// runner side by side (or the resources' lanes alone, unsandboxed; or the runner alone without a resource lane), then
|
|
4
4
|
// the tests and the cleanup. The phase that runs shows live in a block of fixed height; once the next one starts, it is
|
|
5
5
|
// printed above for good in its final form. Each resource lane's rows are its presentation's text
|
|
6
|
-
// (`
|
|
6
|
+
// (`REGISTRY.presentations`), laid out here.
|
|
7
7
|
import { cleanupProblems, megabytesText, } from "../../core/index.js";
|
|
8
8
|
import { mintTargetText } from "../../credential/index.js";
|
|
9
|
-
import {
|
|
9
|
+
import { REGISTRY } from "../../extensions.js";
|
|
10
10
|
import { versionText } from "../../version.js";
|
|
11
11
|
import { commandEnd, LANE_WIDTH } from "./progress.js";
|
|
12
12
|
import { isoSecondsText, keepTimeText, releaseText, seconds, short, shortFile, spread, truncate, visibleLength, } from "./text.js";
|
|
@@ -34,11 +34,11 @@ export function activePhase(state) {
|
|
|
34
34
|
}
|
|
35
35
|
/** The lanes of the run's resource instances, as `started` said, in order; none before it. */
|
|
36
36
|
function instanceLanes(state) {
|
|
37
|
-
return
|
|
37
|
+
return REGISTRY.presentations.lanes(state.instances ?? []);
|
|
38
38
|
}
|
|
39
39
|
/** The lanes of the resource instances whose lanes started, in the order they started. */
|
|
40
40
|
function startedLanes(state) {
|
|
41
|
-
return
|
|
41
|
+
return REGISTRY.presentations.lanes(Object.entries(state.resources).map(([resource, { definition }]) => ({ resource, definition })));
|
|
42
42
|
}
|
|
43
43
|
/** The run's first line: storm's version and, in a sandboxed run, the base. Like a final form, it isn't cut. */
|
|
44
44
|
export function headerLine(state, paint) {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// without it (`runner: false`).
|
|
5
5
|
import { defineErrors } from "@vercel/clinkr";
|
|
6
6
|
import { z } from "zod";
|
|
7
|
-
import { RUN_CLEANUP } from "
|
|
7
|
+
import { RUN_CLEANUP } from "./cleanup.js";
|
|
8
8
|
export const mintFailedErrors = defineErrors({
|
|
9
9
|
mintFailed: {
|
|
10
10
|
exitCode: 1,
|
|
@@ -4,7 +4,7 @@ export declare const ranSchema: z.ZodObject<{
|
|
|
4
4
|
version: z.ZodString;
|
|
5
5
|
commit: z.ZodNullable<z.ZodString>;
|
|
6
6
|
configFile: z.ZodNullable<z.ZodString>;
|
|
7
|
-
resources: z.ZodType<import("../../core/resource-
|
|
7
|
+
resources: z.ZodType<import("../../core/resource-reports.ts").InstanceFacts, import("../../core/resource-reports.ts").InstanceFacts, z.core.$ZodTypeInternals<import("../../core/resource-reports.ts").InstanceFacts, import("../../core/resource-reports.ts").InstanceFacts>>;
|
|
8
8
|
cleanup: z.ZodType<import("./cleanup.ts").StormCleanupFacts, import("./cleanup.ts").StormCleanupFacts, z.core.$ZodTypeInternals<import("./cleanup.ts").StormCleanupFacts, import("./cleanup.ts").StormCleanupFacts>>;
|
|
9
9
|
command: z.ZodObject<{
|
|
10
10
|
exitCode: z.ZodNullable<z.ZodNumber>;
|
|
@@ -501,7 +501,7 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
|
|
|
501
501
|
version: z.ZodString;
|
|
502
502
|
commit: z.ZodNullable<z.ZodString>;
|
|
503
503
|
configFile: z.ZodNullable<z.ZodString>;
|
|
504
|
-
resources: z.ZodType<import("../../core/resource-
|
|
504
|
+
resources: z.ZodType<import("../../core/resource-reports.ts").InstanceFacts, import("../../core/resource-reports.ts").InstanceFacts, z.core.$ZodTypeInternals<import("../../core/resource-reports.ts").InstanceFacts, import("../../core/resource-reports.ts").InstanceFacts>>;
|
|
505
505
|
cleanup: z.ZodType<import("./cleanup.ts").StormCleanupFacts, import("./cleanup.ts").StormCleanupFacts, z.core.$ZodTypeInternals<import("./cleanup.ts").StormCleanupFacts, import("./cleanup.ts").StormCleanupFacts>>;
|
|
506
506
|
command: z.ZodObject<{
|
|
507
507
|
exitCode: z.ZodNullable<z.ZodNumber>;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { defineErrors, defineOutcomes, renderOutcome } from "@vercel/clinkr";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import {
|
|
3
|
+
import { REGISTRY } from "../../extensions.js";
|
|
4
4
|
import { configErrors, credentialErrors } from "../../config/index.js";
|
|
5
|
-
import { keptText, runnerCleanupWarnings } from "./cleanup.js";
|
|
5
|
+
import { keptText, RUN_CLEANUP, runnerCleanupWarnings } from "./cleanup.js";
|
|
6
6
|
import { mintFailedErrors } from "./mint-failed.js";
|
|
7
7
|
import { resourceRefusalErrors } from "./resource-refusals.js";
|
|
8
|
-
import { saveSchema } from "
|
|
9
|
-
import { timelineSchema } from "./timeline-facts.js";
|
|
8
|
+
import { saveSchema, timelineSchema } from "../../run-directory/index.js";
|
|
10
9
|
/** Why the runner couldn't run the command. */
|
|
11
10
|
const runnerFailureSchema = z.union([
|
|
12
11
|
z.object({
|
|
@@ -98,7 +97,7 @@ export const ranSchema = z.object({
|
|
|
98
97
|
* definition's name (`definition`), its facts (`facts`, what its acquire answered, unknown to the schema, or null
|
|
99
98
|
* when it answered none) and the warnings its acquire reported (`warnings`).
|
|
100
99
|
*/
|
|
101
|
-
resources:
|
|
100
|
+
resources: REGISTRY.reports.ranSchema,
|
|
102
101
|
/**
|
|
103
102
|
* What the run's cleanup left: the runner sandbox it kept running and the runner's sandboxes it couldn't stop or
|
|
104
103
|
* delete (`runner`, null without a runner sandbox), and what releasing each of its resource instances couldn't do,
|
|
@@ -128,7 +127,7 @@ export const ranSchema = z.object({
|
|
|
128
127
|
runtime: z.string(),
|
|
129
128
|
/** How long the build step took, in milliseconds. */
|
|
130
129
|
buildMs: z.number(),
|
|
131
|
-
/** How saving the runner sandbox as a branch snapshot ended
|
|
130
|
+
/** How saving the runner sandbox as a branch snapshot ended; null when the run started no save. */
|
|
132
131
|
save: saveSchema.nullable(),
|
|
133
132
|
})
|
|
134
133
|
.nullable(),
|
|
@@ -142,7 +141,7 @@ export const RAN_DESCRIPTION = "The command ran and ended. storm exits with its
|
|
|
142
141
|
/** How a `ran` outcome renders: its warnings, and the runner sandbox the run kept running, if any. */
|
|
143
142
|
export function renderRan(ran) {
|
|
144
143
|
const warnings = [
|
|
145
|
-
...
|
|
144
|
+
...REGISTRY.reports.ranWarnings(ran.resources),
|
|
146
145
|
...(ran.runner !== null && ran.command.exitCode === null && ran.command.signal === null
|
|
147
146
|
? [
|
|
148
147
|
{
|
|
@@ -152,7 +151,7 @@ export function renderRan(ran) {
|
|
|
152
151
|
]
|
|
153
152
|
: []),
|
|
154
153
|
...runnerCleanupWarnings(ran.cleanup.runner),
|
|
155
|
-
...
|
|
154
|
+
...REGISTRY.reports.cleanupWarnings(ran.cleanup.resources),
|
|
156
155
|
];
|
|
157
156
|
// The waterfall, which the run prints on stderr before this, is the human summary; the kept runner sandbox
|
|
158
157
|
// follows it, so a person sees where to connect last.
|
|
@@ -4,7 +4,7 @@ import type { CredentialSourceChoice, MintTarget } from "../../credential/index.
|
|
|
4
4
|
import { type CheckedRecipe, type RunnerSecrets } from "../../runner/index.ts";
|
|
5
5
|
import { type RecipeRun, type ResourceFlagOptions } from "../../config/index.ts";
|
|
6
6
|
import type { RunTestPlan } from "../../sdk/extension/index.ts";
|
|
7
|
-
import {
|
|
7
|
+
import type { ResourceLifecycles } from "../../core/index.ts";
|
|
8
8
|
/**
|
|
9
9
|
* Where a planned run runs: with `--unsandboxed` on this machine; or by default in a runner sandbox, with the runner
|
|
10
10
|
* recipe, the team and project the runner sandbox's credential is minted for, whose one mint the resources share, and
|
|
@@ -34,8 +34,6 @@ export type PlanCommand<TTestPlan extends RunTestPlan, TRefusal> = (where: Plann
|
|
|
34
34
|
readonly ok: false;
|
|
35
35
|
readonly refusal: TRefusal;
|
|
36
36
|
}>;
|
|
37
|
-
/** Every resource's lifecycle, bound once for a command over the run's worlds (`resourceLifecycles`). */
|
|
38
|
-
export type RunLifecycles = ReturnType<typeof resourceLifecycles>;
|
|
39
37
|
/**
|
|
40
38
|
* Where a run runs once its resources' `beforeRun` let it go on: with `--unsandboxed` on this machine, with the
|
|
41
39
|
* credential source it chose when one of the run's resources needs the Vercel credential; or in a runner sandbox, as
|
|
@@ -70,7 +68,7 @@ export interface PlanRequest {
|
|
|
70
68
|
* 5. Plans the merged options for the planned run (`plan`), each function default given the planned run once, and
|
|
71
69
|
* runs the checks across them: `invalid_resource_options`.
|
|
72
70
|
*/
|
|
73
|
-
export declare function planRun<TTestPlan extends RunTestPlan, TRefusal extends CommandError>(app: StormApp, lifecycles:
|
|
71
|
+
export declare function planRun<TTestPlan extends RunTestPlan, TRefusal extends CommandError>(app: StormApp, lifecycles: ResourceLifecycles, request: PlanRequest, planCommand: PlanCommand<TTestPlan, TRefusal>, signal: AbortSignal): Promise<{
|
|
74
72
|
readonly ok: false;
|
|
75
73
|
readonly refusal: CommandError<"invalid_config">;
|
|
76
74
|
} | {
|
|
@@ -118,7 +116,7 @@ export type RunPlan = Extract<Awaited<ReturnType<typeof planRun>>, {
|
|
|
118
116
|
* (`credential_unused`); in an unsandboxed run where a used resource needs the Vercel credential, the credential source
|
|
119
117
|
* (`missing_target` for the mint). Each refusal ends the command before the run starts, so it leaves no run directory.
|
|
120
118
|
*/
|
|
121
|
-
export declare function resourcesBeforeRun(lifecycles:
|
|
119
|
+
export declare function resourcesBeforeRun(lifecycles: ResourceLifecycles, plan: RunPlan, request: Pick<PlanRequest, "credential">): Promise<{
|
|
122
120
|
readonly ok: false;
|
|
123
121
|
readonly refusal: CommandError<"missing_target">;
|
|
124
122
|
} | {
|
|
@@ -18,7 +18,7 @@ export interface LineProgressOptions {
|
|
|
18
18
|
* time since the run started and its lane: `[+4.2s] command running pnpm test`. Lanes that run at once say so:
|
|
19
19
|
* the run says when the resources' lanes and the runner start together, and each says when it is ready and how long
|
|
20
20
|
* it waits for the others. Without a resource lane, the runner readies alone. A resource's own events
|
|
21
|
-
* print as its presentation says (`
|
|
21
|
+
* print as its presentation says (`REGISTRY.presentations`), some only when the run is `verbose`. A step's output (a
|
|
22
22
|
* snapshot build's, applying the changes, the install, the build) streams in full, unprefixed, between its start and end lines; under GitHub Actions (`github`) it is folded in a
|
|
23
23
|
* `::group::`, closed before a failed step's end line, so the failure shows outside the fold. The command's output
|
|
24
24
|
* isn't progress: it reaches the terminal directly, unfolded, between the command's start and end lines.
|
|
@@ -54,8 +54,8 @@ export declare function skippedText(skipped: {
|
|
|
54
54
|
readonly notice: string;
|
|
55
55
|
}): string;
|
|
56
56
|
/**
|
|
57
|
-
* What the runner's local checks noticed: nested Git repositories left out, the cache read's notes, and that
|
|
58
|
-
* `--save-snapshot` saves nothing on a detached HEAD.
|
|
57
|
+
* What the runner's local checks noticed: nested Git repositories left out, the cache read's notes, and that a run
|
|
58
|
+
* that saves always (`--save-snapshot`, or the recipe's `saveSnapshot: true`) saves nothing on a detached HEAD.
|
|
59
59
|
*/
|
|
60
60
|
export declare function preparedNoteTexts(prepared: {
|
|
61
61
|
readonly nestedRepositories: readonly string[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { mintTargetText } from "../../credential/index.js";
|
|
2
2
|
import { megabytesText, secondsOf, secondsText, warningTally, } from "../../core/index.js";
|
|
3
|
-
import {
|
|
3
|
+
import { REGISTRY } from "../../extensions.js";
|
|
4
4
|
import { versionText } from "../../version.js";
|
|
5
5
|
import { isoSecondsText, keepTimeText, releaseText, seconds, short } from "./text.js";
|
|
6
6
|
/**
|
|
@@ -8,7 +8,7 @@ import { isoSecondsText, keepTimeText, releaseText, seconds, short } from "./tex
|
|
|
8
8
|
* time since the run started and its lane: `[+4.2s] command running pnpm test`. Lanes that run at once say so:
|
|
9
9
|
* the run says when the resources' lanes and the runner start together, and each says when it is ready and how long
|
|
10
10
|
* it waits for the others. Without a resource lane, the runner readies alone. A resource's own events
|
|
11
|
-
* print as its presentation says (`
|
|
11
|
+
* print as its presentation says (`REGISTRY.presentations`), some only when the run is `verbose`. A step's output (a
|
|
12
12
|
* snapshot build's, applying the changes, the install, the build) streams in full, unprefixed, between its start and end lines; under GitHub Actions (`github`) it is folded in a
|
|
13
13
|
* `::group::`, closed before a failed step's end line, so the failure shows outside the fold. The command's output
|
|
14
14
|
* isn't progress: it reaches the terminal directly, unfolded, between the command's start and end lines.
|
|
@@ -47,7 +47,7 @@ export function plainRenderer(options) {
|
|
|
47
47
|
cleanupStartedAt: undefined,
|
|
48
48
|
folded: false,
|
|
49
49
|
};
|
|
50
|
-
const resources =
|
|
50
|
+
const resources = REGISTRY.presentations.plain({ verbose: options.verbose === true });
|
|
51
51
|
return ({ event, at }) => {
|
|
52
52
|
const now = at.getTime();
|
|
53
53
|
state.origin ??= now;
|
|
@@ -63,7 +63,7 @@ export function progressLine(elapsedMs, lane, text) {
|
|
|
63
63
|
return `[+${secondsText(secondsOf(elapsedMs))}] ${lane.padEnd(LANE_WIDTH)} ${text}`;
|
|
64
64
|
}
|
|
65
65
|
/** The widest lane a plain line names: `command`, `cleanup`, or a resource's lane. */
|
|
66
|
-
export const LANE_WIDTH = Math.max(...["run", "mint", "runner", "command", "cleanup", ...
|
|
66
|
+
export const LANE_WIDTH = Math.max(...["run", "mint", "runner", "command", "cleanup", ...REGISTRY.presentations.laneKinds.map(({ lane }) => lane)].map((lane) => lane.length));
|
|
67
67
|
function eventLines(event, now, state, line, options) {
|
|
68
68
|
const since = (start) => seconds(now - (start ?? now));
|
|
69
69
|
switch (event.kind) {
|
|
@@ -323,8 +323,8 @@ export function skippedText(skipped) {
|
|
|
323
323
|
return `no ${skipped.resource}: ${skipped.notice}`;
|
|
324
324
|
}
|
|
325
325
|
/**
|
|
326
|
-
* What the runner's local checks noticed: nested Git repositories left out, the cache read's notes, and that
|
|
327
|
-
* `--save-snapshot` saves nothing on a detached HEAD.
|
|
326
|
+
* What the runner's local checks noticed: nested Git repositories left out, the cache read's notes, and that a run
|
|
327
|
+
* that saves always (`--save-snapshot`, or the recipe's `saveSnapshot: true`) saves nothing on a detached HEAD.
|
|
328
328
|
*/
|
|
329
329
|
export function preparedNoteTexts(prepared) {
|
|
330
330
|
return [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import type { ResourceRefusal } from "../../core/index.ts";
|
|
3
3
|
import type { Refusal, RefusalContent, Row } from "../../sdk/extension/index.ts";
|
|
4
|
-
import type
|
|
4
|
+
import { type StormCleanupFacts } from "./cleanup.ts";
|
|
5
5
|
/** The two errors a resource's refusal ends `exec` or `vitest` with. */
|
|
6
6
|
export declare const resourceRefusalErrors: import("@vercel/clinkr").SharedErrors<{
|
|
7
7
|
resourceRefusedBeforeRun: z.ZodObject<{
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
// (`resource_refused`, exit 1), its rows after the refusal's own.
|
|
9
9
|
import { defineErrors } from "@vercel/clinkr";
|
|
10
10
|
import { z } from "zod";
|
|
11
|
-
import { RUN_CLEANUP } from "
|
|
11
|
+
import { RUN_CLEANUP } from "./cleanup.js";
|
|
12
12
|
/** What every resource refusal carries beside what the launcher adds. */
|
|
13
13
|
const refusalShape = {
|
|
14
14
|
/** The resource instance that refused, by its resource key. */
|