mirror of
https://github.com/hanzoai/frames.git
synced 2026-09-24 00:08:03 +00:00
Forked from HyperFrames (Apache-2.0), full history preserved. Hosts are mapped explicitly and BEFORE the identifier rename, because hyperframes.heygen.com is not decoration: 175 of its occurrences are $schema identifiers that a validator dereferences. A blind rename would have left them naming a host that never serves them. The schema files are in this repo under docs/schema, so the mapped host is one we can actually serve -- that is the condition that makes the rewrite safe, and serving them is a deploy task, not an edit. docs/schema/hyperframes.json is renamed to frames.json to match the identifier it is now published under. api.heygen.com and the CLI auth against heygen.com are left UNRENAMED on purpose. They are a dependency on HeyGen's SaaS, not a name of ours to take, and the right move is to remove that integration rather than rebrand it. LICENSE and CREDITS.md are untouched; NOTICE records the lineage. Co-authored-by: Hanzo Dev <[email protected]>
48 lines
1.5 KiB
TypeScript
48 lines
1.5 KiB
TypeScript
import { existsSync, readFileSync } from "node:fs";
|
|
import { join } from "node:path";
|
|
import {
|
|
createStudioManualEditsRenderBodyScript,
|
|
type StudioManualEditsRenderScriptOptions,
|
|
} from "../core/src/studio-api/helpers/manualEditsRenderScript";
|
|
import {
|
|
createStudioMotionRenderBodyScript,
|
|
STUDIO_MOTION_PATH,
|
|
} from "../core/src/studio-api/helpers/studioMotionRenderScript";
|
|
|
|
const STUDIO_MANUAL_EDITS_PATH = ".frames/studio-manual-edits.json";
|
|
|
|
function readManifestContent(projectDir: string, manifestPath: string): string {
|
|
const resolvedPath = join(projectDir, manifestPath);
|
|
if (!existsSync(resolvedPath)) return "";
|
|
try {
|
|
return readFileSync(resolvedPath, "utf-8");
|
|
} catch {
|
|
return "";
|
|
}
|
|
}
|
|
|
|
export function readStudioDevManualEditManifestContent(projectDir: string): string {
|
|
return readManifestContent(projectDir, STUDIO_MANUAL_EDITS_PATH);
|
|
}
|
|
|
|
export function readStudioDevMotionManifestContent(projectDir: string): string {
|
|
return readManifestContent(projectDir, STUDIO_MOTION_PATH);
|
|
}
|
|
|
|
export function createStudioDevRenderBodyScripts(
|
|
projectDir: string,
|
|
options: StudioManualEditsRenderScriptOptions = {},
|
|
): string[] {
|
|
const manualEditsRenderScript = createStudioManualEditsRenderBodyScript(
|
|
readStudioDevManualEditManifestContent(projectDir),
|
|
options,
|
|
);
|
|
const motionRenderScript = createStudioMotionRenderBodyScript(
|
|
readStudioDevMotionManifestContent(projectDir),
|
|
options,
|
|
);
|
|
return [manualEditsRenderScript, motionRenderScript].filter(
|
|
(script): script is string => typeof script === "string",
|
|
);
|
|
}
|