Skip to content

Commit 619406a

Browse files
committed
fix(cli): complete process lifecycle migration
1 parent e0bda7a commit 619406a

4 files changed

Lines changed: 6 additions & 8 deletions

File tree

‎packages/cli/src/cloud/errors.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ describe("cloud/errors reportApiError", () => {
4545
message: "project too large",
4646
code: "hyperframes_project_too_large",
4747
});
48-
expect(() => reportApiError("Upload failed", err)).toThrow("process.exit called");
48+
expect(() => reportApiError("Upload failed", err)).toThrow(CliRuntimeError);
4949
expect(errorBox).toHaveBeenCalledWith(
5050
"Upload failed (HTTP 413)",
5151
"project too large",

‎packages/cli/src/commands/cloud/render.test.ts‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,13 @@ describe("validateResolutionFormatCombo", () => {
4949

5050
describe("validateDryRunSource", () => {
5151
it("accepts a local directory and rejects already-uploaded sources", () => {
52-
const exit = trapExit();
5352
expect(() => validateDryRunSource({ kind: "dir", dir: "." }, true)).not.toThrow();
5453
expect(() => validateDryRunSource({ kind: "asset_id", assetId: "asst_123" }, true)).toThrow(
55-
"process.exit:1",
54+
CliRuntimeError,
5655
);
5756
expect(() =>
5857
validateDryRunSource({ kind: "url", url: "https://example.com/project.zip" }, true),
59-
).toThrow("process.exit:1");
60-
expect(exit).toHaveBeenCalledTimes(2);
58+
).toThrow(CliRuntimeError);
6159
});
6260
});
6361

‎packages/cli/src/commands/cloud/render.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ export function validateDryRunSource(source: ProjectInputSource, dryRun: boolean
370370
"Invalid --dry-run input",
371371
"--dry-run inspects a local project directory and cannot be combined with --asset-id or --url.",
372372
);
373-
process.exit(1);
373+
failCommand();
374374
}
375375

376376
// ---------------------------------------------------------------------------
@@ -616,7 +616,7 @@ function prepareLocalArchive(
616616
} catch (err) {
617617
const msg = normalizeErrorMessage(err);
618618
errorBox("Zip failed", msg, "Check the project and .hyperframesignore for missing files.");
619-
process.exit(1);
619+
failCommand();
620620
}
621621
}
622622

‎packages/cli/src/commands/render.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2152,7 +2152,7 @@ function handleRenderError(
21522152
const macosRemediation = macosOldChromeCrashRemediation(message);
21532153
if (macosRemediation) {
21542154
errorBox("Render failed — Chrome could not launch", message, macosRemediation);
2155-
process.exit(1);
2155+
failCommand();
21562156
}
21572157
errorBox("Render failed", message, hint);
21582158
failCommand();

0 commit comments

Comments
 (0)