Developer Mode
Compilation
How developer projects compile to .genart files — bundling, state preservation, and watch mode.
The compiler transforms a developer project directory into a single .genart JSON file.
How It Works
- Read
sketch.meta.jsonfor metadata - Bundle
sketch.js+components/+lib/into a single algorithm string - Validate the bundled algorithm against the renderer adapter
- Merge with existing
.genartstate (if preserving) - Write the output
.genartfile
State Preservation
By default, the compiler preserves state from an existing .genart file at the output path:
- Parameters — Current values are retained (new params get defaults)
- Seed — Kept from existing file
- Layers — Design layer stack is preserved
Disable with --no-preserve-state or --no-preserve-layers.
Watch Mode
genart compile ./my-project --watchRecompiles on any file change in the project directory. Useful with external preview tools.
Error Handling
If compilation fails (syntax error, invalid metadata), the compiler:
- Prints the error with source location
- Keeps the previous
.genartfile intact - In watch mode, waits for the next save to retry