mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-12 23:29:50 +00:00
style(skills): apply oxfmt to music-to-video and router docs
Fixes the Format / Preflight CI checks on the new skill files. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
f012b8b846
commit
265b02738e
@@ -61,7 +61,9 @@ if (G.canvas) {
|
||||
if (Number.isFinite(c.w)) WIDTH = c.w;
|
||||
if (Number.isFinite(c.h)) HEIGHT = c.h;
|
||||
} catch {
|
||||
anomalies.push(`could not JSON.parse canvas frontmatter: ${G.canvas} — using ${WIDTH}×${HEIGHT}`);
|
||||
anomalies.push(
|
||||
`could not JSON.parse canvas frontmatter: ${G.canvas} — using ${WIDTH}×${HEIGHT}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +90,9 @@ for (const f of manifest.frames) {
|
||||
const compId = basename(f.src).replace(/\.html?$/i, "");
|
||||
const inner = readFileSync(compAbs, "utf8");
|
||||
if (!inner.trim() || !/<\w/.test(inner))
|
||||
die(`${label}: ${f.src} is empty/blank — the frame-worker wrote a partial file. Re-dispatch it.`);
|
||||
die(
|
||||
`${label}: ${f.src} is empty/blank — the frame-worker wrote a partial file. Re-dispatch it.`,
|
||||
);
|
||||
if (
|
||||
!inner.includes(`data-composition-id="${compId}"`) &&
|
||||
!inner.includes(`data-composition-id='${compId}'`)
|
||||
|
||||
@@ -25,7 +25,8 @@ function die(m) {
|
||||
const fromDir = flag("from", null);
|
||||
if (!fromDir) die("missing --from <srcDir>");
|
||||
const fromAbs = resolve(fromDir);
|
||||
if (!existsSync(fromAbs) || !statSync(fromAbs).isDirectory()) die(`--from is not a directory: ${fromAbs}`);
|
||||
if (!existsSync(fromAbs) || !statSync(fromAbs).isDirectory())
|
||||
die(`--from is not a directory: ${fromAbs}`);
|
||||
const hyperframesDir = resolve(flag("hyperframes", "."));
|
||||
const into = flag("into", "");
|
||||
const destDir = join(hyperframesDir, "assets", into);
|
||||
@@ -50,6 +51,8 @@ for (const name of readdirSync(fromAbs)) {
|
||||
landed.push(join("assets", into, basename(name)));
|
||||
}
|
||||
|
||||
console.log(`✓ stage-assets: ${staged} copied, ${skipped} already present → ${join("assets", into)}/`);
|
||||
console.log(
|
||||
`✓ stage-assets: ${staged} copied, ${skipped} already present → ${join("assets", into)}/`,
|
||||
);
|
||||
for (const l of landed) console.log(` ${l}`);
|
||||
if (staged === 0 && skipped === 0) console.log(` (no media files found in ${fromAbs})`);
|
||||
|
||||
@@ -73,7 +73,9 @@ for (const f of frames) {
|
||||
sum = r3(sum);
|
||||
const tileTarget = Number.isFinite(declaredDur) ? declaredDur : audioDur;
|
||||
if (tileTarget != null && Math.abs(sum - tileTarget) > 0.1)
|
||||
errors.push(`frame durations sum to ${sum}s but the track is ${tileTarget}s — frames must tile it gap-free`);
|
||||
errors.push(
|
||||
`frame durations sum to ${sum}s but the track is ${tileTarget}s — frames must tile it gap-free`,
|
||||
);
|
||||
|
||||
// ---------- group checks (warns) — parse RAW text ----------
|
||||
const FRAME_HEAD = /^##\s+(?:frame|scene|section)\b/i;
|
||||
@@ -116,7 +118,9 @@ const framesWithGroups = new Set(blocks.map((b) => b.frameLabel));
|
||||
for (const f of frames) {
|
||||
const lbl = `Frame ${f.number ?? ""} — ${f.title ?? f.index}`.replace(/\s+—\s+$/, "");
|
||||
if (![...framesWithGroups].some((s) => s.includes(String(f.title ?? "")))) {
|
||||
warns.push(`${lbl}: no parseable groups (expected \`- **gN** — template|free_design|asset …\`)`);
|
||||
warns.push(
|
||||
`${lbl}: no parseable groups (expected \`- **gN** — template|free_design|asset …\`)`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,7 +135,9 @@ for (const b of blocks) {
|
||||
warns.push(`${gid}: template \`${id}\` not found at templates/${id}/index.html`);
|
||||
}
|
||||
if (b.kind === "asset" && b.pacing === "phrase_flow" && /beat_cut/.test(blockText))
|
||||
warns.push(`${gid}: beat_cut asset treatment on a phrase_flow frame — use ken_burns/crossfade instead`);
|
||||
warns.push(
|
||||
`${gid}: beat_cut asset treatment on a phrase_flow frame — use ken_burns/crossfade instead`,
|
||||
);
|
||||
}
|
||||
|
||||
// ---------- report ----------
|
||||
@@ -141,4 +147,6 @@ if (errors.length) {
|
||||
console.error(`\nvalidate-plan: ${errors.length} error(s), ${warns.length} warning(s)`);
|
||||
process.exit(1);
|
||||
}
|
||||
console.log(`✓ validate-plan: ${frames.length} frames tile ${sum}s; ${blocks.length} groups; ${warns.length} warning(s)`);
|
||||
console.log(
|
||||
`✓ validate-plan: ${frames.length} frames tile ${sum}s; ${blocks.length} groups; ${warns.length} warning(s)`,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user