dmx 0.1.0
dmx: ^0.1.0 copied to clipboard
Infrastructure for the dmx Dart code generator: the @dmx annotation, the runtime, and the API for writing macros in Dart.
Changelog #
0.1.0 #
First release.
@dmx('macro', {…})— the one annotation that triggers generation [surface.annotations]. It carries a macro name and plain-data arguments, and runs nothing at runtime.- The runtime generated code composes with:
Result/Ok/Err,DecodeErrorwith a dotted path to the failure, thedmxString/dmxInt/dmxList/dmxMapdecoders [model.json-codec],DmxPatch/DmxKeep/DmxToforcopyWith[model.copywith], anddmxDeepEquals/dmxDeepHash[model.equality]. package:dmx/macros.dart— write a macro in Dart [dartmacros.api]. ExtendDmxMacro, readDmxInvocation.declaration, return aDmxFragment, aDmxGeneratedFile, or aDmxRefusal, and serve it withdmxServeMacros.- A macro can hand its model to a Mustache template through
invocation.templates.render(…)and get back rendered Dart from the same engine the built-in macros use [dartmacros.render]. DmxTransport,DmxRequestandDmxResponse, which generated REST clients call so the app chooses its own HTTP client.DmxPackage.versionreports what this package's pubspec declares, generated by the package's own macro worker rather than typed twice [release.version].