mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-04 13:07:11 +00:00
fix(cli): drop --page-motion-blur from cloud render (#7062)
* fix(cli): drop --page-motion-blur from cloud render The flag sent page_motion_blur to the hosted render API, which never accepted that field and rejects unknown fields. Motion blur is set in the composition with data-motion-blur, and the runtime turns it off on its own when it cannot render correctly, so the cloud flag is removed with its request plumbing, test and docs row. Local render keeps its own --page-motion-blur flag. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * chore(ci): allow deleting the cloud render page motion blur test The deletion guard blocks removed files unless they are listed. The test file only covered the cloud render --page-motion-blur flag that this branch removes. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
0f85af7c7f
commit
dffc640e85
@@ -2432,7 +2432,6 @@ Render parameters mirror local `hyperframes render` where they overlap:
|
||||
| `--fps` | `30` | Integer, 1–240 |
|
||||
| `--quality` | `standard` | `draft`, `standard`, or `high` |
|
||||
| `--format` | `mp4` | `mp4`, `webm`, or `mov` |
|
||||
| `--page-motion-blur` | current cloud behavior | Pass `off` to disable authored page motion blur. Omit to preserve current behavior. Sends the public API field `page_motion_blur: "off"`. |
|
||||
| `--resolution` | `1080p` | `1080p` or `4k`. 4k bills at 1.5×. |
|
||||
| `--aspect-ratio` | auto | `16:9`, `9:16`, or `1:1`. Auto-detected from a local project's `data-width` and `data-height`, so you rarely need it. The renderer cannot reshape a composition — a value that disagrees with the authored ratio is an error. With `--asset-id` or `--url` the server defaults to `16:9`. |
|
||||
| `--composition` / `-c` | `index.html` | Entry HTML file inside the zip |
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
import { runCommand } from "citty";
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import render from "./render.js";
|
||||
import { CliUsageError, consumeCommandResult } from "../../utils/commandResult.js";
|
||||
|
||||
const bodies: unknown[] = [];
|
||||
const baseArgs = ["--asset-id", "asst_fixture", "--no-wait", "--json"];
|
||||
|
||||
beforeEach(() => {
|
||||
bodies.length = 0;
|
||||
vi.stubEnv("HEYGEN_API_KEY", "fixture-key");
|
||||
vi.stubEnv("HEYGEN_API_URL", "https://cloud.fixture.invalid");
|
||||
vi.spyOn(console, "log").mockImplementation(() => undefined);
|
||||
vi.spyOn(console, "error").mockImplementation(() => undefined);
|
||||
vi.stubGlobal("fetch", async (url: unknown, init?: RequestInit) => {
|
||||
expect(String(url)).toBe("https://cloud.fixture.invalid/v3/hyperframes/renders");
|
||||
expect(init?.method).toBe("POST");
|
||||
if (typeof init?.body !== "string") throw new Error("Expected a JSON submit body");
|
||||
const body: unknown = JSON.parse(init.body);
|
||||
bodies.push(body);
|
||||
return Response.json({ data: { render_id: "hfr_fixture" } }, { status: 202 });
|
||||
});
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
vi.unstubAllGlobals();
|
||||
vi.unstubAllEnvs();
|
||||
vi.restoreAllMocks();
|
||||
consumeCommandResult();
|
||||
});
|
||||
|
||||
describe("cloud render page motion blur", () => {
|
||||
it("writes explicit off into the public API request", async () => {
|
||||
await runCommand(render, { rawArgs: [...baseArgs, "--page-motion-blur", "off"] });
|
||||
expect(bodies).toHaveLength(1);
|
||||
expect(bodies[0]).toHaveProperty("page_motion_blur", "off");
|
||||
expect(bodies[0]).not.toHaveProperty("pageMotionBlur");
|
||||
});
|
||||
|
||||
it("omits the override when the flag is absent", async () => {
|
||||
await runCommand(render, { rawArgs: baseArgs });
|
||||
expect(bodies).toHaveLength(1);
|
||||
expect(bodies[0]).not.toHaveProperty("page_motion_blur");
|
||||
});
|
||||
|
||||
it.each(["on", "false", "", "OFF"])("rejects %j before any cloud request", async (value) => {
|
||||
await expect(
|
||||
runCommand(render, { rawArgs: [...baseArgs, "--page-motion-blur", value] }),
|
||||
).rejects.toThrow(CliUsageError);
|
||||
expect(bodies).toHaveLength(0);
|
||||
});
|
||||
});
|
||||
@@ -127,11 +127,6 @@ export default defineCommand({
|
||||
},
|
||||
quality: { type: "string", description: "draft | standard | high (default: standard)" },
|
||||
format: { type: "string", description: "mp4 | webm | mov (default: mp4)" },
|
||||
"page-motion-blur": {
|
||||
type: "string",
|
||||
description:
|
||||
"Set off to disable authored page motion blur. Omit to keep the current cloud behavior.",
|
||||
},
|
||||
resolution: {
|
||||
type: "string",
|
||||
description: "Resolution tier: 1080p | 4k (default: 1080p; 4k is billed at 1.5x)",
|
||||
@@ -227,9 +222,6 @@ export default defineCommand({
|
||||
const asJson = Boolean(args.json);
|
||||
const quality = parseEnumFlag(args.quality, VALID_QUALITY, { flag: "--quality" });
|
||||
const format = parseEnumFlag(args.format, VALID_FORMAT, { flag: "--format" });
|
||||
const pageMotionBlur = parseEnumFlag(args["page-motion-blur"], ["off"] as const, {
|
||||
flag: "--page-motion-blur",
|
||||
});
|
||||
const resolution = parseEnumFlag(args.resolution, VALID_RESOLUTION, {
|
||||
flag: "--resolution",
|
||||
});
|
||||
@@ -309,7 +301,6 @@ export default defineCommand({
|
||||
quality,
|
||||
format,
|
||||
resolution,
|
||||
pageMotionBlur,
|
||||
aspectRatio,
|
||||
composition: args.composition,
|
||||
variables,
|
||||
@@ -842,7 +833,6 @@ interface SubmitOptions {
|
||||
fps: number | undefined;
|
||||
quality: "draft" | "standard" | "high" | undefined;
|
||||
format: "mp4" | "webm" | "mov" | undefined;
|
||||
pageMotionBlur: NonNullable<CreateHyperframesRenderRequest["page_motion_blur"]> | undefined;
|
||||
resolution: CreateHyperframesRenderRequest["resolution"] | undefined;
|
||||
aspectRatio: CreateHyperframesRenderRequest["aspect_ratio"] | undefined;
|
||||
composition: string | undefined;
|
||||
@@ -880,7 +870,6 @@ function buildRenderBody(opts: SubmitOptions): RenderRequestBody {
|
||||
if (opts.fps !== undefined) body.fps = opts.fps;
|
||||
if (opts.quality !== undefined) body.quality = opts.quality;
|
||||
if (opts.format !== undefined) body.format = opts.format;
|
||||
if (opts.pageMotionBlur !== undefined) body.page_motion_blur = opts.pageMotionBlur;
|
||||
if (opts.resolution !== undefined) body.resolution = opts.resolution;
|
||||
if (opts.aspectRatio !== undefined) body.aspect_ratio = opts.aspectRatio;
|
||||
if (opts.composition !== undefined) body.composition = opts.composition;
|
||||
|
||||
@@ -2123,6 +2123,10 @@ export const ALLOWED_DELETIONS = new Map([
|
||||
"skills/remotion-to-hyperframes/scripts/render_diff.sh",
|
||||
"remotion-to-hyperframes now compares with `hyperframes diff` instead of its own shell scripts",
|
||||
],
|
||||
[
|
||||
"packages/cli/src/commands/cloud/render.pageMotionBlur.test.ts",
|
||||
"tests for the removed cloud render --page-motion-blur flag; the hosted render API never accepted the field",
|
||||
],
|
||||
]);
|
||||
|
||||
export function parseBase(argv, fallback = "origin/main") {
|
||||
|
||||
Reference in New Issue
Block a user