Skip to content

Commit 76e5937

Browse files
style: biome format + organize imports on external render routes
Fixes the failing Biome CI check (formatting + unsorted imports) on the API-key-authed external Lambda render endpoints.
1 parent 80e4336 commit 76e5937

3 files changed

Lines changed: 17 additions & 8 deletions

File tree

.claude/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@
7070
"Bash(wait)",
7171
"Bash(cd /home/sanku/work/aesthetic/apps/web; echo \"=== lambda project render route ===\"; sed -n '1,120p' app/api/render/lambda/route.ts 2>/dev/null | grep -n \"composition\\\\|Project\\\\|renderMediaOnLambda\\\\|inputProps\\\\|forceDuration\\\\|forceFps\\\\|calculateMetadata\\\\|clips\" ; echo \"=== Project composition registration / calculateMetadata ===\"; grep -rn \"id=\\\\\"Project\\\\\"\\\\|id='Project'\\\\|calculateMetadata\\\\|defaultProps\" apps/../apps/remotion/src/Root.tsx apps/../apps/remotion/src/index.ts 2>/dev/null | head; find /home/sanku/work/aesthetic/apps/remotion/src -maxdepth 2 -name \"Root*.tsx\" -o -maxdepth 2 -name \"index.ts\" | head)",
7272
"Read(//home/sanku/work/aesthetic/apps/remotion/src/**)",
73-
"Bash(cd /home/sanku/work/aesthetic/apps/web; grep -rn \"id:\" ../remotion/src/compositions/Text/meta.ts | head -1; grep -n \"defaultProps\" ../remotion/src/compositions/Text/meta.ts; sed -n '/textDefaultProps/,/};/p' ../remotion/src/compositions/Text/meta.ts | head -20)"
73+
"Bash(cd /home/sanku/work/aesthetic/apps/web; grep -rn \"id:\" ../remotion/src/compositions/Text/meta.ts | head -1; grep -n \"defaultProps\" ../remotion/src/compositions/Text/meta.ts; sed -n '/textDefaultProps/,/};/p' ../remotion/src/compositions/Text/meta.ts | head -20)",
74+
"Bash(gh auth *)"
7475
],
7576
"additionalDirectories": [
7677
"/home/sanku/work/aesthetic/.claude/skills/apple-human-interface-skills/skills/components/packages/ui/src/components",

apps/web/app/api/render/external/progress/route.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,13 @@ function filenameFromKey(key: string | null, fallback: string): string {
3232
}
3333

3434
function firstErrorMessage(errors: unknown): string {
35-
if (!Array.isArray(errors) || errors.length === 0) return "Lambda render failed.";
36-
const first = errors[0] as { message?: string; name?: string; stack?: string };
35+
if (!Array.isArray(errors) || errors.length === 0)
36+
return "Lambda render failed.";
37+
const first = errors[0] as {
38+
message?: string;
39+
name?: string;
40+
stack?: string;
41+
};
3742
return first.message ?? first.stack ?? first.name ?? "Lambda render failed.";
3843
}
3944

apps/web/app/api/render/external/route.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ import type { AwsRegion } from "@remotion/lambda/client";
22
import { renderMediaOnLambda } from "@remotion/lambda/client";
33
import type { Project } from "@workspace/compositions/project";
44
import { NextResponse } from "next/server";
5-
import { consumeRender } from "@/lib/account";
6-
import { authenticateApiKey } from "@/lib/api-keys";
75
import type { ExportOptions } from "@/features/studio/lib/export-options";
86
import { prepareProjectForExport } from "@/features/studio/lib/prepare-export-project";
97
import { rewriteExternalImageUrls } from "@/features/studio/lib/proxy-external-images";
8+
import { consumeRender } from "@/lib/account";
9+
import { authenticateApiKey } from "@/lib/api-keys";
1010

1111
export const runtime = "nodejs";
1212
export const dynamic = "force-dynamic";
@@ -131,7 +131,11 @@ export async function POST(request: Request) {
131131
// we claim one render against quota; accounts without a subscription row are
132132
// allowed through so a valid key "just works" in development.
133133
const consume = await consumeRender(auth.user.id);
134-
if (!consume.ok && consume.reason && !/no subscription/i.test(consume.reason)) {
134+
if (
135+
!consume.ok &&
136+
consume.reason &&
137+
!/no subscription/i.test(consume.reason)
138+
) {
135139
return NextResponse.json({ error: consume.reason }, { status: 402 });
136140
}
137141

@@ -141,8 +145,7 @@ export async function POST(request: Request) {
141145
typeof body.options?.bitrate === "number"
142146
? body.options.bitrate
143147
: 8_000_000,
144-
scale:
145-
typeof body.options?.scale === "number" ? body.options.scale : 1,
148+
scale: typeof body.options?.scale === "number" ? body.options.scale : 1,
146149
keyframeIntervalSec:
147150
typeof body.options?.keyframeIntervalSec === "number"
148151
? body.options.keyframeIntervalSec

0 commit comments

Comments
 (0)