f24597dfdb
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.
11 lines
525 B
TypeScript
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;
|