# dmx

A Dart code generator that regenerates class members such as copyWith, equality, hashCode and typed JSON inside the same file on every save, using team-owned Mustache templates instead of build_runner part files.

dmx runs when a Dart file is saved and inserts generated members, such as copyWith, equality, hashCode, toString and typed JSON encoding and decoding, directly below a divider in the same file, rather than in a separate part file or a .g.dart file. Annotating a class with an attribute such as dmx('model') selects one of eleven built-in macros, including union types, wire-safe enums, diffing, interpolation, accumulating validation, SQL schema generation, typed deep links, an argv parser, deterministic fixtures and REST client implementations.

Each macro pairs a Rust context builder with a Mustache template that a team can edit to change the generated output; a WebAssembly build of the same generator runs in a browser playground for trying edits without installing anything.

It installs as a VS Code extension that bundles the dmx binary, or as a standalone CLI for other editors, with the runtime added to a project through Dart's package manager.

Website: http://dmx.dev/
