Files
Rosea/tools/art-prep/test/fixtures.ts
T
mnovak f24597dfdb [art-prep] ArtBoard: Build prompts, stand-ins and the art board from the manifest, and accept pictures into art/final
tools/art-prep reads art/STYLE.md (draft) and art/manifest.json (25 Phase 1
pictures), refuses forbidden words in any prompt, writes 29 stand-ins and the
board files, and cuts and encodes accepted pictures as WebP within budget.
2026-11-01 20:16:59 +01:00

11 lines
525 B
TypeScript

import { readFileSync } from 'node:fs';
import { fileURLToPath } from 'node:url';
import type { Manifest } from '../src/manifest.js';
export const root = fileURLToPath(new URL('../../../', import.meta.url));
export const readManifest = (): Manifest => JSON.parse(readFileSync(`${root}art/manifest.json`, 'utf8')) as Manifest;
export const readStyle = (): string => readFileSync(`${root}art/STYLE.md`, 'utf8');
/** A deep copy to break on purpose. */
export const clone = <T>(v: T): T => JSON.parse(JSON.stringify(v)) as T;