Skip to content

Commit af26f7f

Browse files
authored
Merge pull request #5 from zooper-lib/feature/bounded-integration
Added the bounded integration
2 parents 97d938d + 2df29fc commit af26f7f

File tree

10 files changed

+106
-141
lines changed

10 files changed

+106
-141
lines changed

.github/workflows/publish.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
steps:
1818
- name: Checkout
1919
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
2022

2123
- name: Setup Dart
2224
uses: dart-lang/setup-dart@v1
@@ -46,5 +48,13 @@ jobs:
4648
mkdir -p "$HOME/.config/dart"
4749
printf '%s' "$PUB_CREDENTIALS" > "$HOME/.config/dart/pub-credentials.json"
4850
51+
- name: Copy root CHANGELOG into all packages
52+
run: |
53+
for dir in packages/*; do
54+
if [ -d "$dir" ] && [ -f "$dir/pubspec.yaml" ]; then
55+
cp CHANGELOG.md "$dir/CHANGELOG.md"
56+
fi
57+
done
58+
4959
- name: Publish packages
50-
run: melos publish --no-dry-run --yes
60+
run: melos publish --no-private --no-dry-run --yes

CHANGELOG.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Changelog
2+
3+
All notable changes to this workspace will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6+
and this workspace adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
This is a lockstep workspace: all packages share the same version and release notes.
9+
10+
## [Unreleased]
11+
12+
### Changed
13+
14+
- Updated dependencies to use latest versions:
15+
- `zooper_flutter_core: ^2.0.0`
16+
- `bounded: ^1.0.0`
17+
18+
## [3.0.0] - 2026-01-10
19+
20+
### Changed
21+
22+
- **BREAKING**: `RaiserEvent` is now a pure `abstract interface class` instead of a base class with implementation.
23+
- **Note: Using `RaiserEvent` is completely optional - `EventBus` works with ANY type.**
24+
- If you choose to use `RaiserEvent`, you must explicitly implement all three required properties: `id`, `occurredOn`, and `metadata`.
25+
- No more automatic property initialization - implement the interface explicitly.
26+
- This change allows events to use composition and multiple interfaces without inheritance constraints.
27+
- `RaiserEvent` now implements `ZooperDomainEvent` from `zooper_flutter_core` package.
28+
- Event IDs in `RaiserEvent` now use `EventId` type (ULID-based) instead of `String`.
29+
- IDs are generated via `EventId.fromUlid()` for better uniqueness guarantees.
30+
- Access raw string value via `event.id.value` when needed.
31+
- Renamed `RaiserEvent.timestamp` property to `occurredOn` for clarity and DDD alignment.
32+
- Removed `aggregateId` as a direct property from `RaiserEvent`.
33+
- Store aggregate identifiers in the `metadata` map instead: `metadata: {'aggregateId': 'user-123'}`.
34+
- Access via `event.metadata['aggregateId'] as String?`.
35+
- Removed helper mixins and convenience extensions.
36+
- Updated generator dependency constraints to `raiser: ^3.0.0` and `raiser_annotation: ^3.0.0`.
37+
38+
### Important Note
39+
40+
**`EventBus` is fully generic and does not require `RaiserEvent`.** You can publish and subscribe to any type. The `RaiserEvent` interface is purely optional for users who want standardized domain event metadata.
41+
42+
## [2.0.1] - 2026-01-08
43+
44+
### Changed
45+
46+
- Migrated generator implementation away from deprecated analyzer element APIs to remove deprecation warnings.
47+
48+
## [2.0.0] - 2026-01-08
49+
50+
### Changed
51+
52+
- **BREAKING**: Renamed `DomainEvent` to `RaiserEvent` to avoid naming conflicts with other packages.
53+
- Updated documentation references from `DomainEvent` to `RaiserEvent`.
54+
- Updated generator dependency constraints to `raiser: ^2.0.0` and `raiser_annotation: ^2.0.0`.
55+
56+
## [1.0.0] - 2024-12-19
57+
58+
### Added
59+
60+
- **EventBus** — Central dispatcher for publishing and routing domain events.
61+
- **DomainEvent** — Base class with automatic ID generation, timestamps, and optional aggregate ID.
62+
- **EventHandler<T>** — Type-safe interface for class-based event handlers.
63+
- **Subscription** — Handle for cancelling handler registrations.
64+
- **Priority-based ordering** — Higher priority handlers execute first.
65+
- **Error handling strategies**.
66+
- **AggregateException** — Collects multiple handler errors when using `continueOnError`.
67+
- **@RaiserHandler** annotation for marking event handler classes.
68+
- **@RaiserMiddleware** annotation for marking middleware classes.
69+
- Support for dependency injection through annotation metadata.
70+
- **Two-phase builder system** (`raiser_collecting``raiser_aggregating`).
71+
- **Automatic handler discovery** and **middleware discovery**.
72+
- Generated registration functions (`initRaiser()`, `initRaiserWithFactories()`, and named bus variants).
73+
- Dependency injection factory parameter generation.
74+
- Priority support and type-safe code generation.

packages/raiser/CHANGELOG.md

Lines changed: 0 additions & 63 deletions
This file was deleted.

packages/raiser/example/pubspec.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ environment:
77

88
dependencies:
99

10-
zooper_flutter_core: ^1.0.2
10+
bounded: ^1.0.0
11+
12+
zooper_flutter_core: ^2.0.0
1113

1214
raiser:
1315
path: ../
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
import 'package:bounded/bounded.dart';
12
import 'package:zooper_flutter_core/zooper_flutter_core.dart';
23

3-
/// A raiser event is a Zooper domain event with an [EventId] identifier.
4+
/// A raiser event is a Bounded domain event with an [EventId] identifier.
45
///
56
/// This type is intentionally an interface so applications are not forced to
67
/// extend a specific base class (Dart supports only single inheritance).
7-
abstract interface class RaiserEvent implements ZooperDomainEvent {}
8+
abstract interface class RaiserEvent implements BoundedDomainEvent<EventId> {}

packages/raiser/pubspec.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ topics:
1717
- pub-sub
1818

1919
dependencies:
20-
zooper_flutter_core: ^1.0.3
20+
zooper_flutter_core: ^2.0.0
21+
22+
bounded: ^1.0.0
2123

2224
dev_dependencies:
2325
lints: ^6.0.0

packages/raiser_annotation/CHANGELOG.md

Lines changed: 0 additions & 31 deletions
This file was deleted.

packages/raiser_generator/CHANGELOG.md

Lines changed: 0 additions & 41 deletions
This file was deleted.

packages/raiser_generator/example/pubspec.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ environment:
77

88
dependencies:
99

10-
zooper_flutter_core: ^1.0.2
10+
bounded: ^1.0.0
11+
12+
zooper_flutter_core: ^2.0.0
1113

1214
raiser:
1315
path: ../../raiser

pubspec.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ melos:
1717
- packages/**/example
1818

1919
scripts:
20+
sync_changelog:
21+
run: |
22+
for dir in packages/*; do
23+
if [ -d "$dir" ] && [ -f "$dir/pubspec.yaml" ]; then
24+
cp CHANGELOG.md "$dir/CHANGELOG.md"
25+
fi
26+
done
27+
description: Copy root CHANGELOG.md into each package.
28+
2029
analyze:
2130
run: dart analyze .
2231
description: Run static analysis in all packages.

0 commit comments

Comments
 (0)