fix(cli): complete process lifecycle migration

This commit is contained in:
James
2026-07-20 09:04:03 -07:00
parent e0bda7a171
commit 619406a23b
4 changed files with 6 additions and 8 deletions
+1 -1
View File
@@ -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",
@@ -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);
});
});
+2 -2
View File
@@ -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();
}
}
+1 -1
View File
@@ -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();