dag 0.1.1
dag: ^0.1.1 copied to clipboard
Transpiles .dag files (text with embedded Dart, PHP-style) into plain .dart source. Not a template engine — the .dag file IS Dart code.
0.1.1 #
- Added
LICENSE(MIT) andhomepage/repository/issue_trackerfields topubspec.yaml, required forpub.devpublishing. - Shortened the
pubspec.yamldescriptionto fit pub.dev's recommended 60-180 character range. - Widened dependency constraints (
args,build,path,watcher,build_runner,lints,test) to their current latest versions.
0.1.0 #
Initial release.
- Transpile
.dagfiles (literal text with embedded Dart, PHP-style) into plain.dartsource. Not a template engine — a.dagfile compiles to real Dart, evaluated at compile time, not interpreted at runtime. - Tags:
<?dag ... ?>(raw code, inserted verbatim — can open/close a block across multiple tags, e.g.if (x) {...}),<?dag= expr ?>(echo an expression),<?dag:imports ?>(deduped, hoisted to file top),<?dag:params ?>(render function's parameter list),<?dag:name ?>(rename the generated function, defaultrender). - Generated function is always
Future<String> ... async, so any echo or code canawaitaFuture/Future<String>with no extra setup. - Runtime errors are rethrown as
DagError, carrying the original error, its stack trace, and the exact.dagfile + line that caused it — via a singletry/catcharound the whole function body plus a cheap line-tracking variable (no per-statement try/catch overhead). - Whitespace control:
<?dag- ... ?>/<?dag ... -?>/<?dag- ... -?>trim adjacent whitespace independently on each side (Twig-style), with<?-as shorthand for<?dag-. Lets structural tags (for,if,}) sit on their own line without leaking a blank line into the output. dagCLI (dart run dag:dag <file|dir> [--out] [--watch]) for file/directory transpilation with optional watch mode.package:buildBuilder(lib/builder.dart, registered viabuild.yaml) so.dag -> .g.dartcan run throughbuild_runneras part of a normal Dart build pipeline.