eventuous_generator 0.1.1 eventuous_generator: ^0.1.1 copied to clipboard
Code generator for Eventuous - a lightweight and open-souce Event Sourcing library for Dart.
Example code #
Eventuous code in library test_lib is generated with the command:
pub run build_runner build
This will generate the following files
- lib/test_lib.g.dart - bootstrapping code for aggregates Foo and Bar
- lib/src/foo.g.dart - Foo example aggregate with all classes in one file
- lib/src/bar/bar.g.dart - Bar example aggregate with all classes in separate files
Configuring code generation in a dart project #
When using in a new dart project, the following dependencies must be added to pubspec.yaml
:
environment:
sdk: '>=2.12.0 <3.0.0'
dependencies:
get_it: ^7.2.0
eventuous: ^0.0.4
json_annotation: ^4.3.0
dev_dependencies:
build_runner: ^2.1.4
eventuous_generator: ^0.0.6
json_serializable: ^5.0.2
You also need to install the prerequisites for generating gRPC service.
Generating code #
Code is generated with the following command
pub run build_runner build