Write HTML. Render video. Built for agents.
JavaScript aiai-agentsanimationclaude-codeffmpegframeworkgsaphtmlhtml-to-videomcpmotion-graphicspuppeteerrenderingtypescriptvideo-editor
fix(cli): resolve typecheck errors in studioServer
Jamesc34cbedbc778
diff --git a/packages/cli/src/server/studioServer.ts b/packages/cli/src/server/studioServer.tsindex f9f1fe3420..33025edbf8 100644--- a/packages/cli/src/server/studioServer.ts+++ b/packages/cli/src/server/studioServer.ts@@ -117,7 +117,7 @@ function buildSubCompositionHtml(// Extract content from <template> if presentconst templateMatch = rawComp.match(/<template>([\s\S]*)<\/template>/i);- let content = templateMatch ? templateMatch[1] : rawComp;+ let content = (templateMatch ? templateMatch[1] : rawComp) ?? rawComp;// Inline nested data-composition-src referencescontent = content.replace(@@ -127,7 +127,7 @@ function buildSubCompositionHtml(if (!existsSync(nestedFile)) return before + srcAttr + after;const nestedRaw = readFileSync(nestedFile, "utf-8");const nestedTemplate = nestedRaw.match(/<template>([\s\S]*)<\/template>/i);- const nestedContent = nestedTemplate ? nestedTemplate[1] : nestedRaw;+ const nestedContent = (nestedTemplate ? nestedTemplate[1] : nestedRaw) ?? nestedRaw;const styles: string[] = [];const scripts: string[] = [];let body = nestedContent@@ -276,7 +276,7 @@ export function createStudioServer(options: StudioServerOptions): StudioServer {const id = c.req.param("id");if (id !== projectId) return c.json({ error: "not found" }, 404);const subPath = decodeURIComponent(- c.req.path.replace(`/api/projects/${id}/preview/`, "").split("?")[0],+ c.req.path.replace(`/api/projects/${id}/preview/`, "").split("?")[0] ?? "",);const file = resolve(projectDir, subPath);if (!isSafePath(projectDir, file) || !existsSync(file) || !statSync(file).isFile()) {