liquid_codegen 0.1.2 copy "liquid_codegen: ^0.1.2" to clipboard
liquid_codegen: ^0.1.2 copied to clipboard

Optional YAML → typed LiquidEvent codegen for liquid_analytics. Generates sealed-class compatible event classes with no build_runner required.

Changelog #

0.1.2 #

Input validation, so a bad schema fails as a parse error instead of as generated Dart that will not compile — or, in the worst case, that will.

  • An unknown category is rejected by name, listing the valid ones. It was previously interpolated straight into ConsentCategory.<value> and left for the Dart compiler to complain about. The category list is mirrored as strings, since this package deliberately does not depend on liquid_analytics.
  • Event names, property names and types are validated. Names must convert cleanly into a Dart identifier, and types are checked against a deliberately narrow subset of Dart type syntax because the string is interpolated into a field declaration. Nothing that could break out of the string literal or doc comment it lands in now reaches the generator.
  • generateEventsLibrary escapes ', \, $ and newlines independently of the parser. It is public API and can be handed a schema built by other means, where an unescaped quote would close the literal early and a $ would interpolate into the generated source.

A schema that relied on any of the newly rejected input was already producing broken output, so this is a patch rather than a breaking release.

0.1.1 #

  • Add an example/ demonstrating the YAML schema and generated output.

0.1.0 #

  • Initial release of liquid_codegen.
0
likes
160
points
153
downloads

Documentation

API reference

Publisher

verified publisherketok.id

Weekly Downloads

Optional YAML → typed LiquidEvent codegen for liquid_analytics. Generates sealed-class compatible event classes with no build_runner required.

Homepage
Repository (GitHub)
View/report issues
Contributing

Topics

#analytics #codegen #flutter

License

MIT (license)

Dependencies

args, path, yaml

More

Packages that depend on liquid_codegen