// What basic-mode.spec.ts walks (lane output-modes): the Basic | Deck switch, // Play in basic, the share line, and the quick-clip job. // // basic-fixture a DECK cut on the channel basicyt (a YouTube channel in the // fixture's corpus, its record naming its watch page): // c01 basicvid 1.0–3.0 (the fixture's synthetic tone window, cached in out/clips-raw) // t01 a teaser (a basic cut leaves it out; Play in basic does not show it) // c02 basicvid 4.0–7.0 // The spec writes render.mode and puts the manifest back. // basicyt/quickvid a recording with no window on disk: the quick-clip job // asks the stub editor for it (editor-stub-fetch-windows.mjs // serves basicyt), renders it basic, and the spec removes the // project it made (reports/quick-clips/) and the window. // // Synthetic, like every fixture. import { copyFileSync, mkdirSync, writeFileSync } from "node:fs"; import path from "node:path"; export const BASIC_CHANNEL = "basicyt"; export const BASIC_PROJECT = "basic-fixture"; const write = (dir, name, doc) => { mkdirSync(dir, { recursive: true }); writeFileSync(path.join(dir, name), JSON.stringify(doc, null, 2) + "\n"); }; /** @param {{ reports: string, channels: string, deckManifest: Function, cachedWindow: string }} o */ export function makeBasicModeFixture({ reports, channels, deckManifest, cachedWindow }) { write(path.join(channels, BASIC_CHANNEL), "config.json", { name: "Basic Fixture", platform: "youtube", url: "https://www.youtube.com/@basicfixture" }); const record = (id, duration) => write(path.join(channels, BASIC_CHANNEL, "data", id), "transcript.cues.json", { title: `Basic fixture ${id}`, uploadDate: "20260101", platform: "youtube", channel: "Basic Fixture", webpageUrl: `https://www.youtube.com/watch?v=${id}`, duration, cues: [{ start: 0, end: duration, text: "a synthetic tone" }], }); record("basicvid", 9); record("quickvid", 60); const dir = path.join(reports, BASIC_PROJECT); mkdirSync(path.join(dir, "out", "clips-raw"), { recursive: true }); copyFileSync(cachedWindow, path.join(dir, "out", "clips-raw", "basicvid_0.00-9.00.mp4")); const m = deckManifest(BASIC_PROJECT, "The Basic Fixture", [ { type: "clip", id: "c01", video: "basicvid", start: 1.0, end: 3.0, cite: 1, section: 0, lock: true, quote: "a synthetic tone" }, { type: "teaser", id: "t01", seconds: 3, lines: ["Next", "The Basic Cut"] }, { type: "clip", id: "c02", video: "basicvid", start: 4.0, end: 7.0, cite: 4, section: 0, lock: true, quote: "the tone again" }, ]); m.provenance = { ...m.provenance, channelSlug: BASIC_CHANNEL }; m.render.fetchPad = 0; write(dir, "video.manifest.json", m); return { dir }; }