import path from "node:path"; // --------------------------------------------------------------------------- // The roots, and keeping them apart is the whole point of the rescue: // // SONG_CODE umtool/song -- the tooling and the small JSON state, in the repo // SONG_DATA wav48/, media/, cand2/, asr/ -- 39 GB, re-derivable, not in the repo // SONG_REPORTS the um-song deliverables -- quartering-*.mp4 and their .plan.json // SONG_SCRATCH render scratch, ABOVE SONG_DATA // REPORTS_ROOT the tree every PROJECT hangs off -- songs AND report videos // MEDIA_ROOT where a project's out/ is linked to (UMTOOL_MEDIA_DIR); = REPORTS_ROOT when unset // // Everything the bench reads or writes must resolve inside one of these. Not // because this is exposed -- it is a local tool on a loopback port -- but // because it RENDERS to a path the client names, and a typo that escapes the // tree would overwrite something that took an hour to make. // // The values themselves live in ./paths.mjs, in plain ESM, so `umtool` on the // command line and this app can never disagree about which directory is which. // --------------------------------------------------------------------------- export { CACHE_DIR, CHANNELS_DIR, cacheFile, corpusNotesFile, INDEX_DIR, MEDIA_ROOT, MEDIA_ROOTS, MEDIA_TIERED, MIX_CACHE, READ_ROOTS, REPORTS_ROOT, SONG_DATA, SONG_REPORTS, SONG_SCRATCH, SITES_DIR, WRITE_ROOTS, inside, isCorpusNotesFile, labelFor, mediaMirror, resolveInRoots, } from "./paths.mjs"; // Resolved from cwd rather than import.meta.url: Turbopack rewrites module URLs // into .next/server/chunks, so a path derived from one points at the build // output instead of the source tree. `next dev` and `next start` both run with // cwd at the package root. export const SONG_CODE = process.env.SONG_CODE_DIR ? path.resolve(process.env.SONG_CODE_DIR) : path.join(/* turbopackIgnore: true */ process.cwd(), "song"); export const stateFile = (name: string) => path.join(/* turbopackIgnore: true */ SONG_CODE, name); // dataFile needs SONG_DATA at module scope, which the re-export above does not // bind locally -- so it is imported again rather than duplicated. import { SONG_DATA as DATA } from "./paths.mjs"; export const dataFile = (...parts: string[]) => path.join(DATA, ...parts);