@sketchscreens/core-schema
v0.1.4
Published
The ProjectMap / ScreenSpec contract — the stack-agnostic shape that the extractor produces and the renderer consumes.
Maintainers
Readme
@sketchscreens/core-schema
The ProjectMap contract for SketchScreens — TypeScript types, zod schema, and validator for the stack-agnostic JSON that describes an app's screens, elements, and flow edges.
Everything in SketchScreens pivots on this one shape: extractors produce it, the renderer draws it.
import { validateProjectMap, parseProjectMap } from "@sketchscreens/core-schema";
const result = validateProjectMap(candidate);
if (result.ok) console.log(result.map.screens.length, "screens");
else result.issues.forEach((i) => console.error(i.message));validateProjectMap(raw)— validate + normalize; returns{ ok, map, issues }with error/warning severities.parseProjectMap(raw)— throwing variant with defaults applied../auditsubpath —auditSourceFilesprovenance checks.
Part of the SketchScreens monorepo. Most users want the sketchscreens CLI instead.
