feat(cli): make cloud archives size-aware

This commit is contained in:
James
2026-07-17 18:44:58 -04:00
parent 43b52f7d6e
commit e73304fb0e
16 changed files with 426 additions and 42 deletions
+14
View File
@@ -50,6 +50,20 @@ describe("cloud/errors reportApiError", () => {
);
});
it("points oversized projects to dry-run and .hyperframesignore", () => {
const err = new HyperframesApiError({
status: 413,
message: "project too large",
code: "hyperframes_project_too_large",
});
expect(() => reportApiError("Upload failed", err)).toThrow("process.exit called");
expect(errorBox).toHaveBeenCalledWith(
"Upload failed (HTTP 413)",
"project too large",
"The zip exceeded the 200 MB limit. Run `hyperframes cloud render --dry-run`, then add only verified-unneeded paths to `.hyperframesignore` or pre-host required large media.",
);
});
it("prefers the code-specific hint over a caller suggestion", () => {
const err = new HyperframesApiError({
status: 400,
+1 -1
View File
@@ -19,7 +19,7 @@ import { HyperframesApiError } from "./_gen/client.js";
*/
const ERROR_CODE_HINTS: Record<string, string> = {
hyperframes_project_too_large:
"The zip exceeded the 200 MB limit. Trim large media (or pre-host them and reference by URL), then try again.",
"The zip exceeded the 200 MB limit. Run `hyperframes cloud render --dry-run`, then add only verified-unneeded paths to `.hyperframesignore` or pre-host required large media.",
hyperframes_render_not_found:
"The render_id no longer exists — either soft-deleted or never created.",
invalid_parameter: