v0.2.1
[0.2.1] - 2025-11-21
Breaking Changes
- Configuration Structure Update: The
analytics_gen.yamlfile has been completely restructured into logical groups (inputs,outputs,targets,rules) to improve readability and organization.- Migration Guide:
# Old (v0.2.0) analytics_gen: events_path: events output_path: lib/src/analytics docs_path: docs/analytics.md generate_docs: true strict_event_names: true event_parameters_path: events/shared.yaml # New (v0.2.1) analytics_gen: inputs: events: events shared_parameters: - events/shared.yaml outputs: dart: lib/src/analytics docs: docs/analytics.md targets: docs: true rules: strict_event_names: true
- Note: The old flat structure is deprecated but may still work for some fields during a transition period, though migration is strongly recommended.
event_parameters_pathis strictly removed in favor ofinputs.shared_parameters.
- Migration Guide:
Highlights
- Improved error reporting, validation, and generated code ergonomics.
- Better CSV/exports, optional PII scrubbing, and safer enum generation for parameter values.
- Added telemetry hooks and testing helpers (e.g.,
Analytics.reset()).
Documentation & DX
- Clarified
BatchingAnalytics.flush()behavior and updated README guidance. - Added CI example for plan validation in
doc/VALIDATION.md.
Key Additions
- Shared Event Parameters: Support for centrally defined parameters via
shared_parameters.- Reuse parameters across events by referencing them (or leaving value as
null). - Enforce consistency with
enforce_centrally_defined_parameters. - Prevent duplicates with
prevent_event_parameter_duplicates.
- Reuse parameters across events by referencing them (or leaving value as
- Enhanced CSV export (multiple files, better escaping).
- Parameter validation DSL:
regex,min_length,max_length,min,maxwith runtime checks. - PII scrubbing support (
PiiRenderer+Analytics.sanitizeParams). - Enum generation for parameters with
allowed_values.
Internal Improvements
BaseRendererto share common rendering logic across generators.- Generation telemetry (
GenerationTelemetry+ implementations) integrated intoCodeGenerator. - Validator separation:
SchemaValidatorextracted fromYamlParserwith tests. YamlParserrefactored to useloadYamlNodeand enforces strict event-name rules.
Misc
- Added
ignore_for_filelints and generation timestamp to generated files. Analytics.reset()for testing and hot-restart scenarios.
Full Changelog: v0.2.0...v0.2.1