Skip to content

Write HTML. Render video. Built for agents.

fix(cli): complete process lifecycle migration

James619406a23b06
diff --git a/packages/cli/src/cloud/errors.test.ts b/packages/cli/src/cloud/errors.test.ts
index 1b40239796..6155de8ccb 100644
--- a/packages/cli/src/cloud/errors.test.ts
+++ b/packages/cli/src/cloud/errors.test.ts
@@ -45,7 +45,7 @@ describe("cloud/errors reportApiError", () => {
message: "project too large",
code: "hyperframes_project_too_large",
});
- expect(() => reportApiError("Upload failed", err)).toThrow("process.exit called");
+ expect(() => reportApiError("Upload failed", err)).toThrow(CliRuntimeError);
expect(errorBox).toHaveBeenCalledWith(
"Upload failed (HTTP 413)",
"project too large",
diff --git a/packages/cli/src/commands/cloud/render.test.ts b/packages/cli/src/commands/cloud/render.test.ts
index 8e186809df..028fe99b43 100644
--- a/packages/cli/src/commands/cloud/render.test.ts
+++ b/packages/cli/src/commands/cloud/render.test.ts
@@ -49,15 +49,13 @@ describe("validateResolutionFormatCombo", () => {
describe("validateDryRunSource", () => {
it("accepts a local directory and rejects already-uploaded sources", () => {
- const exit = trapExit();
expect(() => validateDryRunSource({ kind: "dir", dir: "." }, true)).not.toThrow();
expect(() => validateDryRunSource({ kind: "asset_id", assetId: "asst_123" }, true)).toThrow(
- "process.exit:1",
+ CliRuntimeError,
);
expect(() =>
validateDryRunSource({ kind: "url", url: "https://example.com/project.zip" }, true),
- ).toThrow("process.exit:1");
- expect(exit).toHaveBeenCalledTimes(2);
+ ).toThrow(CliRuntimeError);
});
});
diff --git a/packages/cli/src/commands/cloud/render.ts b/packages/cli/src/commands/cloud/render.ts
index 2532501ea8..27284071e5 100644
--- a/packages/cli/src/commands/cloud/render.ts
+++ b/packages/cli/src/commands/cloud/render.ts
@@ -370,7 +370,7 @@ export function validateDryRunSource(source: ProjectInputSource, dryRun: boolean
"Invalid --dry-run input",
"--dry-run inspects a local project directory and cannot be combined with --asset-id or --url.",
);
- process.exit(1);
+ failCommand();
}
// ---------------------------------------------------------------------------
@@ -616,7 +616,7 @@ function prepareLocalArchive(
} catch (err) {
const msg = normalizeErrorMessage(err);
errorBox("Zip failed", msg, "Check the project and .hyperframesignore for missing files.");
- process.exit(1);
+ failCommand();
}
}
diff --git a/packages/cli/src/commands/render.ts b/packages/cli/src/commands/render.ts
index a2db13063b..2de6c4baf4 100644
--- a/packages/cli/src/commands/render.ts
+++ b/packages/cli/src/commands/render.ts
@@ -2152,7 +2152,7 @@ function handleRenderError(
const macosRemediation = macosOldChromeCrashRemediation(message);
if (macosRemediation) {
errorBox("Render failed — Chrome could not launch", message, macosRemediation);
- process.exit(1);
+ failCommand();
}
errorBox("Render failed", message, hint);
failCommand();