commit e574c2669b048c009b621fbb391442ab7f5113f2
parent c668974c0eb2f1eb9ffc856431f908d5fe8fcf96
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Mon, 26 Oct 2026 08:23:12 -0400
Brand intro: turbopackIgnore on intro.mjs's cwd-derived path and fs calls (the build-trace guard)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
1 file changed, 22 insertions(+), 22 deletions(-)
diff --git a/umtool/report-to-video/intro.mjs b/umtool/report-to-video/intro.mjs
@@ -115,7 +115,7 @@ export function introManifest(manifest) {
*/
export function introSoundPath(entry, manifestDir = process.cwd(), standin = INTRO_STANDIN_SOUND) {
if (entry.sound === false) return null;
- if (typeof entry.sound === "string") return path.resolve(manifestDir, entry.sound);
+ if (typeof entry.sound === "string") return path.resolve(/* turbopackIgnore: true */ manifestDir, entry.sound);
return standin;
}
@@ -152,7 +152,7 @@ export function introEncodeArgs({ framesDir, sound, seconds, render, encode, aud
return [
"-nostdin", "-v", "error", "-y",
"-framerate", String(render.fps), "-reinit_filter", "0", "-start_number", "1",
- "-i", path.join(framesDir, "frame_%06d.png"),
+ "-i", path.join(/* turbopackIgnore: true */ framesDir, "frame_%06d.png"),
...(sound ? ["-i", sound] : []),
"-filter_complex", `[0:v]format=rgba,fps=${render.fps},setsar=1[iv];${audio}`,
"-map", "[iv]", "-map", "[ia]",
@@ -175,7 +175,7 @@ export function introKey({ html, soundSha = null, encode = [], fps, frames, vers
/** Where rendered intros are kept: UMTOOL_INTRO_CACHE, else ~/.cache/umtool/intro (XDG_CACHE_HOME honoured). */
export function introCacheDir(env = process.env) {
if (env.UMTOOL_INTRO_CACHE) return path.resolve(env.UMTOOL_INTRO_CACHE);
- return path.join(env.XDG_CACHE_HOME || path.join(os.homedir(), ".cache"), "umtool", "intro");
+ return path.join(/* turbopackIgnore: true */ env.XDG_CACHE_HOME || path.join(/* turbopackIgnore: true */ os.homedir(), ".cache"), "umtool", "intro");
}
/** The record beside an intro segment: the key it was copied from. */
@@ -211,32 +211,32 @@ export async function renderIntro({ entry, render, encode, manifestDir = process
const sound = introSoundPath(entry, manifestDir, standin);
let soundSha = null;
if (sound) {
- const bytes = await readFile(sound).catch(() => null);
+ const bytes = await readFile(/* turbopackIgnore: true */ sound).catch(() => null);
if (!bytes) throw new Error(missingSoundMessage(sound, standin));
soundSha = sha256(bytes);
}
const frames = frameCount(entry.seconds, fps);
const hf = hyperframesCommand(process.env);
const key = introKey({ html, soundSha, encode, fps, frames, version: hf.version });
- const cached = path.join(cacheDir, `${key}.mp4`);
+ const cached = path.join(/* turbopackIgnore: true */ cacheDir, `${key}.mp4`);
if (await exists(cached)) return { path: cached, key, cached: true };
const t0 = Date.now();
- const proj = path.join(workDir, `intro-${key.slice(0, 12)}`);
- const framesDir = path.join(workDir, `intro-${key.slice(0, 12)}-frames`);
+ const proj = path.join(/* turbopackIgnore: true */ workDir, `intro-${key.slice(0, 12)}`);
+ const framesDir = path.join(/* turbopackIgnore: true */ workDir, `intro-${key.slice(0, 12)}-frames`);
await rm(proj, { recursive: true, force: true });
await rm(framesDir, { recursive: true, force: true });
- await mkdir(path.join(proj, "assets"), { recursive: true });
+ await mkdir(/* turbopackIgnore: true */ path.join(/* turbopackIgnore: true */ proj, "assets"), { recursive: true });
const { HF_JSON, runRenderer } = await import("./compose-chrome.mjs");
const { GSAP_FILE } = await import("./chrome-deck.mjs");
- await copyFile(GSAP_FILE, path.join(proj, "assets", "gsap.min.js"));
- await writeFile(path.join(proj, "index.html"), html, "utf8");
- await writeFile(path.join(proj, "hyperframes.json"), HF_JSON + "\n", "utf8");
+ await copyFile(/* turbopackIgnore: true */ GSAP_FILE, path.join(/* turbopackIgnore: true */ proj, "assets", "gsap.min.js"));
+ await writeFile(/* turbopackIgnore: true */ path.join(/* turbopackIgnore: true */ proj, "index.html"), html, "utf8");
+ await writeFile(/* turbopackIgnore: true */ path.join(/* turbopackIgnore: true */ proj, "hyperframes.json"), HF_JSON + "\n", "utf8");
await runRenderer(hf.cmd, [
...hf.args, "render", "--format", "png-sequence", "--quality", "high", "--fps", String(fps),
"-w", String(workers), "--no-browser-gpu", "--output", framesDir, proj,
]);
- const got = (await readdir(framesDir).catch(() => [])).filter((f) => /^frame_\d+\.png$/.test(f)).length;
+ const got = (await readdir(/* turbopackIgnore: true */ framesDir).catch(() => [])).filter((f) => /^frame_\d+\.png$/.test(f)).length;
if (got !== frames) throw new Error(`the intro render wrote ${got} frames to ${framesDir}, expected ${frames} (${entry.seconds}s at ${fps} fps)`);
emit("chrome", { phase: "render", region: "intro", frames, key, seconds: Number(((Date.now() - t0) / 1000).toFixed(1)) });
@@ -244,7 +244,7 @@ export async function renderIntro({ entry, render, encode, manifestDir = process
seconds: entry.seconds, render, hasSound: !!sound, soundSeconds: sound ? await probeSeconds(sound) : null,
});
await mkdir(cacheDir, { recursive: true });
- const tmp = path.join(cacheDir, `.${key}.${process.pid}.tmp.mp4`);
+ const tmp = path.join(/* turbopackIgnore: true */ cacheDir, `.${key}.${process.pid}.tmp.mp4`);
try {
await execFileP(FFMPEG, introEncodeArgs({ framesDir, sound, seconds: entry.seconds, render, encode, audio, outPath: tmp }), { maxBuffer: 1 << 26 });
await rename(tmp, cached);
@@ -263,16 +263,16 @@ export async function renderIntro({ entry, render, encode, manifestDir = process
* another take's segment).
*/
export async function buildIntroSegment(entry, { render, encode, outDir, manifestDir, workers = 4, emit = () => {}, cacheDir = introCacheDir(), standin = INTRO_STANDIN_SOUND }) {
- const seg = path.join(outDir, "segments", `${entry.id}.mp4`);
+ const seg = path.join(/* turbopackIgnore: true */ outDir, "segments", `${entry.id}.mp4`);
const recPath = introRecordPath(seg);
const r = await renderIntro({ entry, render, encode, manifestDir, workDir: path.join(outDir, "chrome"), cacheDir, workers, emit, standin });
- const rec = await readFile(recPath, "utf8").then(JSON.parse, () => null);
+ const rec = await readFile(/* turbopackIgnore: true */ recPath, "utf8").then(JSON.parse, () => null);
if (rec?.key === r.key && (await exists(seg))) {
emit("note", { id: entry.id, message: `${entry.id}: intro segment unchanged (key ${r.key.slice(0, 12)})` });
return seg;
}
- await mkdir(path.dirname(seg), { recursive: true });
- const tmp = path.join(path.dirname(seg), `.${entry.id}.${process.pid}.tmp.mp4`);
+ await mkdir(/* turbopackIgnore: true */ path.dirname(/* turbopackIgnore: true */ seg), { recursive: true });
+ const tmp = path.join(/* turbopackIgnore: true */ path.dirname(/* turbopackIgnore: true */ seg), `.${entry.id}.${process.pid}.tmp.mp4`);
try {
await copyFile(r.path, tmp);
await rename(tmp, seg);
@@ -280,7 +280,7 @@ export async function buildIntroSegment(entry, { render, encode, outDir, manifes
await rm(tmp, { force: true });
}
const recTmp = `${recPath}.${process.pid}.tmp`;
- await writeFile(recTmp, JSON.stringify({ key: r.key, style: entry.style, ground: entry.ground, seconds: entry.seconds, cached: r.cached }) + "\n");
+ await writeFile(/* turbopackIgnore: true */ recTmp, JSON.stringify({ key: r.key, style: entry.style, ground: entry.ground, seconds: entry.seconds, cached: r.cached }) + "\n");
await rename(recTmp, recPath);
if (r.cached) emit("note", { id: entry.id, message: `${entry.id}: intro from the cache (key ${r.key.slice(0, 12)})` });
return seg;
@@ -304,7 +304,7 @@ async function main(argv) {
const ref = rest.find((a) => !a.startsWith("--"));
if (!ref) throw new Error("usage: intro.mjs extract-sound <reference.mp4> [--out <wav>]");
const out = flag("--out") ?? INTRO_STANDIN_SOUND;
- await mkdir(path.dirname(out), { recursive: true });
+ await mkdir(/* turbopackIgnore: true */ path.dirname(/* turbopackIgnore: true */ out), { recursive: true });
await execFileP(FFMPEG, extractSoundArgs(ref, out));
console.log(`stand-in sound -> ${out}`);
return 0;
@@ -323,7 +323,7 @@ async function main(argv) {
style: flag("--style"),
...(flag("--ground") ? { ground: flag("--ground") } : {}),
...(flag("--seconds") ? { seconds: Number(flag("--seconds")) } : {}),
- ...(rest.includes("--silent") ? { sound: false } : flag("--sound") ? { sound: path.resolve(flag("--sound")) } : {}),
+ ...(rest.includes("--silent") ? { sound: false } : flag("--sound") ? { sound: path.resolve(/* turbopackIgnore: true */ flag("--sound")) } : {}),
};
const render = {
...STANDALONE_RENDER,
@@ -336,10 +336,10 @@ async function main(argv) {
if (!entry) throw new Error(introErrors(intro).join("; "));
const { encodeArgs } = await import("./build-video.mjs");
const run = async () => {
- const workDir = path.join(path.dirname(path.resolve(out)), ".intro-work");
+ const workDir = path.join(/* turbopackIgnore: true */ path.dirname(/* turbopackIgnore: true */ path.resolve(/* turbopackIgnore: true */ out)), ".intro-work");
const r = await renderIntro({ entry, render, encode: encodeArgs(render), workDir, emit: (ev, f) => console.error(`${ev}: ${JSON.stringify(f)}`) });
await rm(workDir, { recursive: true, force: true });
- await mkdir(path.dirname(path.resolve(out)), { recursive: true });
+ await mkdir(/* turbopackIgnore: true */ path.dirname(/* turbopackIgnore: true */ path.resolve(/* turbopackIgnore: true */ out)), { recursive: true });
await copyFile(r.path, out);
console.log(`${entry.style} (${entry.ground}) -> ${out}${r.cached ? " (cached)" : ""} key ${r.key.slice(0, 12)}`);
};