analytics_gen 0.1.4
analytics_gen: ^0.1.4 copied to clipboard
Type-safe analytics event tracking with code generation from YAML configuration. Supports multiple providers, testing utilities, and export formats.
Changelog #
All notable changes to this project will be documented in this file.
0.1.4 - 2025-11-15 #
- Library vs CLI logging cleanup: internal generators and parsers now emit logs only when a verbose callback is provided, while the CLI keeps the rich user-friendly output.
- Core models (
AnalyticsParameter,AnalyticsEvent,AnalyticsDomain) implement value semantics and have dedicated equality tests. - YAML parser is much stricter: domains/events/parameters must be maps, errors surface file + key context, and malformed structures throw
FormatException. - Public API ergonomics:
- Added
typedef AnalyticsParams = Map<String, Object?>. IAnalytics.logEventand generated methods use typed params while remaining synchronous by design.- README explains serialization expectations and sync logging rationale.
- Added
- Enforced snake_case domain naming and documented expectations so files stay filesystem-safe.
- CLI UX:
- Added
--validate-only,--watch,--verbose, and negatable--code/--docs/--exportsflags for flexible runs. --docs/--exportsnow respectanalytics_gen.yamldefaults with--no-docs/--no-exportsoverrides.--helphighlights all new options.
- Added
- Generators & exports now include thorough tests (code, docs, JSON, SQL, SQLite) using temp directories.
MultiProviderAnalyticscatches provider errors, emits aMultiProviderAnalyticsFailurepayload, fires an optionalonProviderFailurehook for logging/metrics, and still callsonErrorso the rest of the providers keep running.- Documentation expanded with analytics best practices, naming guidance, cardinality tips, and example YAML snippets.
- Internal polish: shared string helpers extracted,
MockAnalyticsServicealigns withAnalyticsParams, and CI discipline enforced viadart analyze/dart test. - Mock analytics service now exposes immutable
RecordedAnalyticsEventsnapshots throughrecordswhile keeping the legacy map helpers for compatibility. - Event deprecation lifecycle: YAML accepts
deprecated+replacement, generators emit@Deprecated, and metadata is surfaced in docs/exports. - Parameters support
allowed_values, propagated through docs/JSON/SQL/CSV with validation. - Validation/DX enhancements:
--validate-onlymode verifies the tracking plan without writing files and fails fast on structural issues. - Docs/JSON/SQL exports embed deterministic fingerprints (no timestamps) so repeated runs stay diff-friendly across machines.
- Docs tables gained a Status column that marks deprecated events (and their replacements) so migrations are visible without leaving the Markdown export.
- Parser now enforces that every analytics event name (custom
event_nameor the default<domain>: <event>) is unique across domains so generation fails fast on collisions. - Added a
--planCLI flag that surfaces the tracking plan fingerprint, domain/event counts, and parameter lists without writing files so teams can inspect instrumentation quickly.
0.1.3 - 2025-11-14 #
- Fix badge issues
0.1.2 - 2025-11-14 #
- Refactor string interpolation and formatting in code generation
0.1.1 - 2025-11-13 #
- Some minor updates and fixes.
0.1.0 - 2025-11-13 #
- Some minor updates and fixes.
0.0.1 - 2025-11-13 #
- Initial release of
analytics_genpackage.