analytics_gen 2.0.0
analytics_gen: ^2.0.0 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.
2.0.0 #
Features #
- Analytics Gen Studio — web-based visual editor for analytics configuration, events, shared parameters, and contexts with real-time YAML preview.
- Schema as Single Source of Truth — JSON schemas in
schema/now drive everything: Studio UI, TypeScript types, YAML templates, and documentation. - Schema-driven generation — YAML templates, schema reference docs, and Studio TypeScript types are all auto-generated from JSON schemas.
- Studio features: search/filter in event tree, keyboard shortcuts (Ctrl+S/O), notifications, compact array inputs, validation error badges on tabs, confirm dialogs for all deletions, auto-fill context name from filename.
Architecture #
- Studio renders all forms dynamically from JSON schemas — no hardcoded data.
- TypeScript types auto-generated from schemas.
- YAML templates and schema reference docs auto-generated from schemas.
- All YAML field names centralized via constants — no raw string literals in parsers.
1.1.0 #
Features #
- Added
booleanas an alias forbooltype across type mapping, parsing, and documentation generation. - Added automatic tracking creation date injection via a new ledger file and
meta.auto_tracking_creation_dateconfig option.- When enabled, the generator maintains a
.analytics_tracking.jsonledger file that records an ISO 8601 timestamp (yyyy-MM-ddTHH:mm:ss) when each event is first seen. - The
tracking_creation_datevalue is automatically injected into each event'smetafield during generation. - Existing entries are never overwritten — the ledger preserves the original creation timestamp.
- The ledger file is placed next to
analytics_gen.yamland should be committed to version control.
- When enabled, the generator maintains a
- Added
meta.include_meta_in_parametersconfig option to include event meta fields in the generatedeventParametersmap sent to analytics providers (e.g. Amplitude, Mixpanel). Default:false.
1.0.8 #
Features #
- Added
dartReservedWordstoStringUtilto prevent enum member name collisions with Dart keywords.
1.0.6 #
Bug Fixes #
- Fixed
NamingStrategy._toTitleCasestripping structural punctuation (e.g.:) fromevent_name_template. Previously, usingcasing: title_casewith a template like"{domain}: {event}"produced"Chat Under Dev Sheet Shown"instead of"Chat: Under Dev Sheet Shown". Only_and-are now treated as word boundaries.
1.0.5 #
- Added
templates/analytics_gen.yamlas a reference for all configuration options. - Added
templates/events.yamldemonstrating event and parameter definitions. - Update README to enhance clarity and structure of
analytics_gendocumentation. - Add onboarding and AI prompt guides to documentation; enhance README with new links.
1.0.4 #
Improvements #
- Introduced
CapabilityProviderBaseto replaceCapabilityProviderMixin(deprecated). - Added
--metricsflag to track generation performance. - Added "Dead Event" Audit Enhancement with git commit info.
- Glob Pattern Support:
EventLoadernow supports glob patterns (e.g.,events/**/*.yaml). - Improved Fingerprint Sensitivity: covers all event/parameter fields.
- Cross-Platform Robustness: Normalized path handling for Windows/macOS/Linux.
- Added
doc/PERFORMANCE.md,doc/TROUBLESHOOTING.md,doc/TESTING.md.
Bug Fixes #
- Fixed data loss bug in
BatchingAnalyticswhere queue would stall after failed auto-flush. - Fixed
ConfigParsercrash when optional fields are explicitlynull. CapabilityRegistrynow throwsStateErroron duplicate capability keys.- Added default error logging to
BatchingAnalyticsandMultiProviderAnalytics.
1.0.3 #
Features #
- Added "Dead Event" Audit Command (
dart run analytics_gen:audit). - Added
test_matcherstarget to generate typedpackage:testmatchers. - Added
dart_typeparameter option to map parameters to existing Dart types. - Added
importsconfiguration for including external types. - Added configurable event naming strategy (
casing:snake_case,title_case,original).
Improvements #
- Generated code now uses
constmaps for constant event parameters. - Removed auto-generated tests in favor of
test_matchers.
1.0.2 #
- Enhanced SQL/CSV/JSON export formats with additional metadata.
- Formalized analytics data representation with
AnalyticsParameterandAnalyticsDomainmodels. - Conditionally generate Flutter or Dart test imports based on project type.
1.0.0 #
- Stable release with full documentation and API reference.
0.2.1 #
Breaking Changes #
- Configuration restructured into logical groups (
inputs,outputs,targets,rules).# Old → New events_path → inputs.events output_path → outputs.dart docs_path → outputs.docs event_parameters_path → inputs.shared_parameters
Features #
- Shared Event Parameters via
shared_parametersconfig. - Parameter validation DSL:
regex,min_length,max_length,min,max. - Enum generation for parameters with
allowed_values. - Enhanced CSV export with multiple files and better escaping.
Analytics.reset()for testing and hot-restart scenarios.
0.2.0 #
Features #
- Extensible Metadata: Support for
metakey-value pairs in YAML. - Batching & Async: Added
BatchingAnalyticsandAsyncAnalyticsAdapter. - Flexible Naming: Configurable naming strategies.
- Strict Mode:
strict_event_namesto prevent high-cardinality.
Improvements #
- Optimized generator with parallel processing.
- Full test coverage (100%).
0.1.6 #
- Added
include_event_descriptionconfig option. - Support interpolated placeholders in
event_name(e.g.,"Screen: {screen_name}").
0.1.5 #
- Full test coverage.
- Added GitHub Actions CI.
0.1.4 #
Features #
- Added CLI flags:
--validate-only,--watch,--verbose,--plan. MultiProviderAnalyticswith error isolation andonProviderFailurehook.- Event deprecation lifecycle with
deprecated+replacement. allowed_valuesfor parameters with runtime validation.- Deterministic fingerprints in exports (no timestamps).
Improvements #
- Stricter YAML parser with better error messages.
RecordedAnalyticsEventfor typed mock assertions.
0.1.3 #
- Fix badge issues.
0.1.2 #
- Refactor string interpolation in code generation.
0.1.1 #
- Minor updates and fixes.
0.1.0 #
- Minor updates and fixes.
0.0.1 #
- Initial release.