@cnc-tools/storm 0.9.0 → 0.9.1
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/bin/storm.js +3 -14
- package/dist/application.d.ts +18 -10
- package/dist/application.js +10 -11
- package/dist/bin/storm.js +97 -41
- package/dist/build-info.js +1 -1
- package/dist/chunks/chunk-5CQCRX2L.js +5768 -0
- package/dist/chunks/chunk-5U5Q6VZR.js +556 -0
- package/dist/chunks/chunk-7O6UN63H.js +63 -0
- package/dist/chunks/chunk-I5GZLOLQ.js +38 -0
- package/dist/chunks/chunk-NX55IJ5S.js +1842 -0
- package/dist/chunks/chunk-OCZJE5XV.js +910 -0
- package/dist/chunks/chunk-RRQ2ZGSE.js +1512 -0
- package/dist/chunks/chunk-S5NAIZYS.js +13 -0
- package/dist/chunks/chunk-UHO5OCEX.js +360 -0
- package/dist/chunks/chunk-WBIHJM7D.js +188 -0
- package/dist/chunks/chunk-WV6WQFC6.js +436 -0
- package/dist/chunks/live-app-X3PW2W42.js +89 -0
- package/dist/chunks/version-X7RMSKZI.js +12 -0
- package/dist/commands/exec/command.js +35 -21
- package/dist/commands/exec/metadata.js +66 -58
- package/dist/commands/exec/redaction.js +1 -1
- package/dist/commands/exec/run-collector.d.ts +1 -1
- package/dist/commands/exec/run-collector.js +1 -1
- package/dist/commands/exec/run-record.d.ts +1 -1
- package/dist/commands/exec/tests-summary.d.ts +1 -1
- package/dist/commands/exec/worker-chart.d.ts +1 -1
- package/dist/commands/runs/list/command.js +136 -33
- package/dist/commands/runs/list/metadata.js +22 -18
- package/dist/commands/runs/logs/command.js +131 -48
- package/dist/commands/runs/logs/metadata.js +24 -20
- package/dist/commands/runs/metadata.js +6 -2
- package/dist/commands/runs/past-run.d.ts +1 -1
- package/dist/commands/runs/past-run.js +1 -1
- package/dist/commands/runs/show/command.js +396 -74
- package/dist/commands/runs/show/metadata.js +24 -20
- package/dist/commands/vitest/command.js +195 -128
- package/dist/commands/vitest/metadata.js +45 -37
- package/dist/context.d.ts +1 -1
- package/dist/core/events.d.ts +1 -1
- package/dist/core/payload.d.ts +1 -1
- package/dist/core/payload.js +1 -1
- package/dist/core/provider.d.ts +12 -2
- package/dist/core/run.js +1 -1
- package/dist/live-app.d.ts +9 -0
- package/dist/live-app.js +21 -0
- package/dist/resource-commands.d.ts +13 -0
- package/dist/resource-commands.js +22 -0
- package/dist/resources/github/provider.d.ts +1 -1
- package/dist/resources/testserver/command-tree.d.ts +4 -0
- package/dist/resources/testserver/command-tree.js +12 -0
- package/dist/resources/testserver/commands/create/command.js +373 -194
- package/dist/resources/testserver/commands/create/metadata.js +52 -48
- package/dist/resources/testserver/commands/list/command.js +195 -50
- package/dist/resources/testserver/commands/list/metadata.js +12 -8
- package/dist/resources/testserver/provider.d.ts +1 -1
- package/dist/resources/testserver/resource-provider.js +2 -8
- package/dist/resources.d.ts +0 -3
- package/dist/resources.js +5 -10
- package/dist/runner/recipe.js +1 -1
- package/dist/runner/remote-command.js +1 -1
- package/dist/sdk/host.d.ts +2 -0
- package/dist/sdk/host.js +7 -0
- package/dist/version.d.ts +2 -2
- package/dist/version.js +10 -11
- package/dist/vitest/config.d.ts +4 -8
- package/dist/vitest/config.js +5 -9
- package/dist/vitest/container-scope.d.ts +12 -5
- package/dist/vitest/container-scope.js +27 -4
- package/dist/vitest/diagnostics.d.ts +8 -2
- package/dist/vitest/diagnostics.js +7 -4
- package/dist/vitest/fixtures.d.ts +4 -1
- package/dist/vitest/fixtures.js +17 -6
- package/dist/vitest/plan.d.ts +1 -1
- package/dist/vitest/plan.js +2 -2
- package/dist/vitest/sandbox.d.ts +6 -0
- package/dist/vitest/sandbox.js +6 -0
- package/package.json +4 -3
- package/bin/node-version.js +0 -24
- package/dist/closed-terminal.d.ts +0 -7
- package/dist/closed-terminal.js +0 -18
package/bin/storm.js
CHANGED
|
@@ -1,16 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
//
|
|
3
|
-
|
|
4
|
-
// built JavaScript in a published install, where Node cannot strip types under node_modules. The
|
|
5
|
-
// entry is imported dynamically, because static imports load before the check runs.
|
|
6
|
-
import { existsSync } from "node:fs";
|
|
7
|
-
import { nodeVersionProblem } from "./node-version.js";
|
|
2
|
+
// Clinkr's launcher: checks the Node version, turns on the compile cache, and runs `src/` or, installed, `dist/`.
|
|
3
|
+
import { launch } from "@vercel/clinkr/node/launch";
|
|
8
4
|
|
|
9
|
-
|
|
10
|
-
if (problem !== undefined) {
|
|
11
|
-
process.stderr.write(`${problem}\n`);
|
|
12
|
-
process.exitCode = 1;
|
|
13
|
-
} else {
|
|
14
|
-
const source = new URL("../src/bin/storm.ts", import.meta.url);
|
|
15
|
-
await import((existsSync(source) ? source : new URL("../dist/bin/storm.js", import.meta.url)).href);
|
|
16
|
-
}
|
|
5
|
+
await launch({ name: "storm", bin: import.meta.url });
|
package/dist/application.d.ts
CHANGED
|
@@ -1,13 +1,21 @@
|
|
|
1
|
-
import { type ClinkrApplication } from "@vercel/clinkr";
|
|
1
|
+
import { type ApplicationVersion, type ClinkrApplication } from "@vercel/clinkr";
|
|
2
2
|
import type { StormApp } from "./context.ts";
|
|
3
|
+
/** Where storm's code is: `src/` from source, `dist/` built. Everything else resolves from it. */
|
|
4
|
+
export interface StormApplicationOptions {
|
|
5
|
+
/** Whether accessible mode is on (`VERCEL_ACCESSIBLE=1`), which leaves the help logo out of root help. */
|
|
6
|
+
readonly accessible: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* storm's code root, the directory this module's source or build sits in: `src/` or `dist/`. The bin passes it,
|
|
9
|
+
* since a bundled build moves this module's code to another file, where `import.meta.dirname` names another
|
|
10
|
+
* directory.
|
|
11
|
+
*/
|
|
12
|
+
readonly root: string;
|
|
13
|
+
}
|
|
3
14
|
/**
|
|
4
|
-
* Discovers the `storm` command tree under `commands
|
|
5
|
-
* (`
|
|
6
|
-
* and commit as a run's version line shows them
|
|
7
|
-
* (`
|
|
8
|
-
*
|
|
9
|
-
* source and the build.
|
|
15
|
+
* Discovers the `storm` command tree under `commands/` in `root`, and mounts each resource's own command tree beside
|
|
16
|
+
* it (`resourceMounts`, from `resource-commands.ts`, which loads no resource's run code), such as the Testserver pool's
|
|
17
|
+
* `pool`; `version` is what root `--version` prints, the version and commit as a run's version line shows them
|
|
18
|
+
* (`versionText`), or a function Clinkr calls only to print it. Its skills, which `storm skills get` prints for agents,
|
|
19
|
+
* are the Markdown files in `skills/`, beside `src/` and `dist/`.
|
|
10
20
|
*/
|
|
11
|
-
export declare function loadStormApplication(version:
|
|
12
|
-
readonly accessible: boolean;
|
|
13
|
-
}): Promise<ClinkrApplication<StormApp>>;
|
|
21
|
+
export declare function loadStormApplication(version: ApplicationVersion, options: StormApplicationOptions): Promise<ClinkrApplication<StormApp>>;
|
package/dist/application.js
CHANGED
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
2
|
import { createApplication } from "@vercel/clinkr";
|
|
3
3
|
import { stormHelpLogo } from "./help-logo.js";
|
|
4
|
-
import {
|
|
4
|
+
import { resourceMounts } from "./resource-commands.js";
|
|
5
5
|
const DESCRIPTION = "Run a command against Vercel Testserver sandboxes.";
|
|
6
6
|
/**
|
|
7
|
-
* Discovers the `storm` command tree under `commands
|
|
8
|
-
* (`
|
|
9
|
-
* and commit as a run's version line shows them
|
|
10
|
-
* (`
|
|
11
|
-
*
|
|
12
|
-
* source and the build.
|
|
7
|
+
* Discovers the `storm` command tree under `commands/` in `root`, and mounts each resource's own command tree beside
|
|
8
|
+
* it (`resourceMounts`, from `resource-commands.ts`, which loads no resource's run code), such as the Testserver pool's
|
|
9
|
+
* `pool`; `version` is what root `--version` prints, the version and commit as a run's version line shows them
|
|
10
|
+
* (`versionText`), or a function Clinkr calls only to print it. Its skills, which `storm skills get` prints for agents,
|
|
11
|
+
* are the Markdown files in `skills/`, beside `src/` and `dist/`.
|
|
13
12
|
*/
|
|
14
13
|
export async function loadStormApplication(version, options) {
|
|
15
|
-
const { accessible } = options;
|
|
16
|
-
return await createApplication("storm",
|
|
14
|
+
const { accessible, root } = options;
|
|
15
|
+
return await createApplication("storm", root, {
|
|
17
16
|
description: DESCRIPTION,
|
|
18
17
|
version,
|
|
19
18
|
helpLogo: (terminal) => stormHelpLogo(terminal, { accessible }),
|
|
20
|
-
mounts:
|
|
21
|
-
skills: join(
|
|
19
|
+
mounts: resourceMounts(root),
|
|
20
|
+
skills: join(root, "../skills"),
|
|
22
21
|
});
|
|
23
22
|
}
|
package/dist/bin/storm.js
CHANGED
|
@@ -1,45 +1,101 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import {
|
|
2
|
+
testserverPoolCommandTree
|
|
3
|
+
} from "../chunks/chunk-S5NAIZYS.js";
|
|
4
|
+
|
|
5
|
+
// src/bin/storm.ts
|
|
5
6
|
import { readFileSync } from "node:fs";
|
|
7
|
+
import { fileURLToPath } from "node:url";
|
|
6
8
|
import { runNodeCli } from "@vercel/clinkr/node";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
9
|
+
|
|
10
|
+
// src/application.ts
|
|
11
|
+
import { join as join2 } from "node:path";
|
|
12
|
+
import { createApplication } from "@vercel/clinkr";
|
|
13
|
+
|
|
14
|
+
// src/help-logo.ts
|
|
15
|
+
var CLOUD_TOP = [" .-~~~~~-. .-~~~~-.", " .-~( )~-..-~( )~-."];
|
|
16
|
+
var CLOUD_WORDMARK = { indent: " ", left: "( ", wordmark: "storm", right: " )" };
|
|
17
|
+
var CLOUD_BOTTOM = " `~-.._______________________..-~'";
|
|
18
|
+
var BOLTS = 8;
|
|
19
|
+
var SANDBOX_ROWS = [3, 5];
|
|
20
|
+
var HELP_LOGO_WIDTH = CLOUD_WORDMARK.indent.length + CLOUD_WORDMARK.left.length + CLOUD_WORDMARK.wordmark.length + CLOUD_WORDMARK.right.length;
|
|
21
|
+
var code = (open, close) => (text) => text === "" ? text : `\x1B[${open}m${text}\x1B[${close}m`;
|
|
22
|
+
var COLOR = {
|
|
23
|
+
cloud: code("90", "39"),
|
|
24
|
+
wordmark: code("1;36", "22;39"),
|
|
25
|
+
bolt: code("1;93", "22;39"),
|
|
26
|
+
passed: code("32", "39"),
|
|
27
|
+
failed: code("31", "39"),
|
|
28
|
+
bracket: code("90", "39")
|
|
29
|
+
};
|
|
30
|
+
var NO_COLOR = Object.fromEntries(Object.keys(COLOR).map((role) => [role, (text) => text]));
|
|
31
|
+
var UNICODE = { bolt: "\u03DF", passed: "\u2713", failed: "\u2717" };
|
|
32
|
+
var ASCII = { bolt: "/", passed: "+", failed: "x" };
|
|
33
|
+
function stormHelpLogo(terminal, options) {
|
|
34
|
+
if (options.accessible) return void 0;
|
|
35
|
+
const { columns } = terminal.stdout;
|
|
36
|
+
if (columns !== void 0 && columns > 0 && columns < HELP_LOGO_WIDTH) return void 0;
|
|
37
|
+
const paint = terminal.stdout.color === "none" ? NO_COLOR : COLOR;
|
|
38
|
+
const glyph = terminal.unicode ? UNICODE : ASCII;
|
|
39
|
+
const cloudLine = (line) => {
|
|
40
|
+
const text = line.trimStart();
|
|
41
|
+
return `${line.slice(0, line.length - text.length)}${paint.cloud(text)}`;
|
|
42
|
+
};
|
|
43
|
+
const lines = [
|
|
44
|
+
...CLOUD_TOP.map(cloudLine),
|
|
45
|
+
`${CLOUD_WORDMARK.indent}${paint.cloud(CLOUD_WORDMARK.left)}${paint.wordmark(CLOUD_WORDMARK.wordmark)}${paint.cloud(CLOUD_WORDMARK.right)}`,
|
|
46
|
+
cloudLine(CLOUD_BOTTOM),
|
|
47
|
+
` ${paint.bolt(Array.from({ length: BOLTS }, () => glyph.bolt).join(" "))}`,
|
|
48
|
+
...SANDBOX_ROWS.map(
|
|
49
|
+
(failed) => ` ${Array.from(
|
|
50
|
+
{ length: BOLTS },
|
|
51
|
+
(_, index) => index === failed ? paint.failed(glyph.failed) : paint.passed(glyph.passed)
|
|
52
|
+
).map((result) => `${paint.bracket("[")}${result}${paint.bracket("]")}`).join(" ")}`
|
|
53
|
+
)
|
|
54
|
+
];
|
|
55
|
+
return lines.join("\n");
|
|
39
56
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
57
|
+
|
|
58
|
+
// src/resource-commands.ts
|
|
59
|
+
import { join } from "node:path";
|
|
60
|
+
var RESOURCE_COMMAND_TREES = [testserverPoolCommandTree];
|
|
61
|
+
function resourceMounts(root2) {
|
|
62
|
+
return RESOURCE_COMMAND_TREES.map(({ mount, directory }) => ({
|
|
63
|
+
...mount,
|
|
64
|
+
source: { ...mount.source, directory: join(root2, directory) }
|
|
65
|
+
}));
|
|
44
66
|
}
|
|
45
|
-
|
|
67
|
+
|
|
68
|
+
// src/application.ts
|
|
69
|
+
var DESCRIPTION = "Run a command against Vercel Testserver sandboxes.";
|
|
70
|
+
async function loadStormApplication(version2, options) {
|
|
71
|
+
const { accessible: accessible2, root: root2 } = options;
|
|
72
|
+
return await createApplication("storm", root2, {
|
|
73
|
+
description: DESCRIPTION,
|
|
74
|
+
version: version2,
|
|
75
|
+
helpLogo: (terminal) => stormHelpLogo(terminal, { accessible: accessible2 }),
|
|
76
|
+
mounts: resourceMounts(root2),
|
|
77
|
+
skills: join2(root2, "../skills")
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// src/bin/storm.ts
|
|
82
|
+
var root = fileURLToPath(new URL("..", import.meta.url));
|
|
83
|
+
var manifest = JSON.parse(readFileSync(new URL("../../package.json", import.meta.url), "utf8"));
|
|
84
|
+
var commitRead;
|
|
85
|
+
function commit() {
|
|
86
|
+
commitRead ??= import("../chunks/version-X7RMSKZI.js").then(({ buildCommit }) => buildCommit(import.meta.url));
|
|
87
|
+
return commitRead;
|
|
88
|
+
}
|
|
89
|
+
async function version() {
|
|
90
|
+
const [{ versionText }, built] = await Promise.all([import("../chunks/version-X7RMSKZI.js"), commit()]);
|
|
91
|
+
return versionText(manifest.version, built);
|
|
92
|
+
}
|
|
93
|
+
var exit = { status: void 0 };
|
|
94
|
+
var accessible = process.env["VERCEL_ACCESSIBLE"] === "1";
|
|
95
|
+
var status = await runNodeCli(await loadStormApplication(version, { accessible, root }), {
|
|
96
|
+
app: async (host) => {
|
|
97
|
+
const [{ liveStormApp }, built] = await Promise.all([import("../chunks/live-app-X3PW2W42.js"), commit()]);
|
|
98
|
+
return liveStormApp(host, { version: manifest.version, commit: built }, exit);
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
process.exitCode = exit.status ?? status;
|
package/dist/build-info.js
CHANGED