Skip to content

Commit 6802d29

Browse files
committed
Merge branch 'release/2.0.0' into main
2 parents ae8946d + 70dabfe commit 6802d29

62 files changed

Lines changed: 254 additions & 190 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/publish.yml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,26 @@ jobs:
3232
- name: Bootstrap
3333
run: melos bootstrap
3434

35+
- name: Set release train version
36+
run: |
37+
set -euo pipefail
38+
VERSION="${GITHUB_REF_NAME#v}"
39+
echo "Releasing version: $VERSION"
40+
41+
# Force every public workspace package to the exact same version.
42+
# We intentionally avoid committing/tagging here; the tag already exists.
43+
melos version --yes \
44+
--no-changelog \
45+
--no-git-commit-version \
46+
--no-git-tag-version \
47+
-V continuum:$VERSION \
48+
-V continuum_generator:$VERSION \
49+
-V continuum_store_hive:$VERSION \
50+
-V continuum_store_memory:$VERSION
51+
52+
- name: Analyze
53+
run: melos run analyze --no-select
54+
3555
- name: Test
3656
run: melos run test --no-select
3757

@@ -44,4 +64,7 @@ jobs:
4464
printf '%s' "$PUB_CREDENTIALS" > "$HOME/.config/dart/pub-credentials.json"
4565
4666
- name: Publish packages
47-
run: melos publish --no-dry-run --yes
67+
run: |
68+
# Publish in workspace dependency order (dependencies first).
69+
# melos publish is dry-run by default; we explicitly publish.
70+
melos publish --no-private --no-dry-run --yes

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,4 +112,7 @@ lib/generated_plugin_registrant.dart
112112
.history
113113
.ionide
114114

115-
# End of https://www.toptal.com/developers/gitignore/api/dart,flutter,visualstudiocode
115+
# End of https://www.toptal.com/developers/gitignore/api/dart,flutter,visualstudiocode
116+
117+
**/.idea/
118+
**/*.iml

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ class ShoppingCart with _$ShoppingCartEventHandlers {
5353
}
5454

5555
// Creation event (first event in stream)
56-
@Event(ofAggregate: ShoppingCart, type: 'cart.created')
57-
class CartCreated extends DomainEvent {
56+
@AggregateEvent(of: ShoppingCart, type: 'cart.created')
57+
class CartCreated extends ContinuumEvent {
5858
final String cartId;
5959

6060
CartCreated({
@@ -73,8 +73,8 @@ class CartCreated extends DomainEvent {
7373
}
7474

7575
// Mutation event
76-
@Event(ofAggregate: ShoppingCart, type: 'item.added')
77-
class ItemAdded extends DomainEvent {
76+
@AggregateEvent(of: ShoppingCart, type: 'item.added')
77+
class ItemAdded extends ContinuumEvent {
7878
final String productId;
7979

8080
ItemAdded({
@@ -138,7 +138,7 @@ await session.saveChangesAsync();
138138
### continuum
139139

140140
Core library providing:
141-
- `@Aggregate()` and `@Event()` annotations
141+
- `@Aggregate()` and `@AggregateEvent()` annotations
142142
- `DomainEvent` base class
143143
- `EventId` and `StreamId` strong types
144144
- `Session`, `EventStore`, `EventSourcingStore` abstractions

packages/continuum/CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
## 2.0.0 - 2026-01-08
2+
3+
### Breaking Changes
4+
5+
- **BREAKING**: Renamed `@Event` annotation to `@AggregateEvent` to avoid naming conflicts with user code.
6+
- **BREAKING**: Renamed `ofAggregate:` parameter to `of:` in `@AggregateEvent` annotation.
7+
- **BREAKING**: Renamed `DomainEvent` class to `ContinuumEvent` to avoid naming conflicts.
8+
- **BREAKING**: Renamed `Session` interface to `ContinuumSession` to avoid naming conflicts.
9+
- **BREAKING**: Renamed `StoredEvent.fromDomainEvent()` to `StoredEvent.fromContinuumEvent()`.
10+
- **BREAKING**: Updated all parameter names from `domainEvent` to `continuumEvent`.
11+
112
## 1.0.0
213

314
- Initial release with event sourcing core functionality.

packages/continuum/README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,15 @@ class User with _$UserEventHandlers {
9191

9292
```dart
9393
// For Mode 1 (no persistence):
94-
@Event(ofAggregate: User)
95-
class EmailChanged extends DomainEvent {
94+
@AggregateEvent(of: User)
95+
class EmailChanged extends ContinuumEvent {
9696
final String newEmail;
9797
EmailChanged(StreamId aggregateId, this.newEmail) : super(aggregateId);
9898
}
9999
100100
// For Mode 2/3 (with persistence), add type strings:
101-
@Event(ofAggregate: User, type: 'user.email_changed')
102-
class EmailChanged extends DomainEvent {
101+
@AggregateEvent(of: User, type: 'user.email_changed')
102+
class EmailChanged extends ContinuumEvent {
103103
final String newEmail;
104104
EmailChanged(StreamId aggregateId, this.newEmail) : super(aggregateId);
105105
@@ -110,8 +110,8 @@ class EmailChanged extends DomainEvent {
110110
}
111111
}
112112
113-
@Event(ofAggregate: User, type: 'user.registered')
114-
class UserRegistered extends DomainEvent {
113+
@AggregateEvent(of: User, type: 'user.registered')
114+
class UserRegistered extends ContinuumEvent {
115115
final String name;
116116
final String email;
117117
@@ -239,8 +239,8 @@ class Order with _$OrderEventHandlers {
239239
Events represent things that have happened. They are immutable and describe state changes.
240240

241241
```dart
242-
@Event(ofAggregate: Order, type: 'order.item_added') // type required for persistence
243-
class ItemAdded extends DomainEvent {
242+
@AggregateEvent(of: Order, type: 'order.item_added') // type required for persistence
243+
class ItemAdded extends ContinuumEvent {
244244
final String itemId;
245245
ItemAdded(StreamId aggregateId, this.itemId) : super(aggregateId);
246246
}
@@ -326,8 +326,8 @@ try {
326326
Events are serialized to JSON for storage. Implement `toJson()` and `fromJson()`:
327327

328328
```dart
329-
@Event(ofAggregate: User, type: 'user.email_changed')
330-
class EmailChanged extends DomainEvent {
329+
@AggregateEvent(of: User, type: 'user.email_changed')
330+
class EmailChanged extends ContinuumEvent {
331331
final String newEmail;
332332
333333
EmailChanged(StreamId aggregateId, this.newEmail) : super(aggregateId);

packages/continuum/example/lib/domain/events/email_changed.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import 'package:continuum/continuum.dart';
33
import '../user.dart';
44

55
/// Event fired when a user changes their email address.
6-
@Event(ofAggregate: User, type: 'user.email_changed')
7-
class EmailChanged extends DomainEvent {
6+
@AggregateEvent(of: User, type: 'user.email_changed')
7+
class EmailChanged extends ContinuumEvent {
88
final String newEmail;
99

1010
EmailChanged({required super.eventId, required this.newEmail, super.occurredOn, super.metadata});

packages/continuum/example/lib/domain/events/user_deactivated.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import 'package:continuum/continuum.dart';
33
import '../user.dart';
44

55
/// Event fired when a user account is deactivated.
6-
@Event(ofAggregate: User, type: 'user.deactivated')
7-
class UserDeactivated extends DomainEvent {
6+
@AggregateEvent(of: User, type: 'user.deactivated')
7+
class UserDeactivated extends ContinuumEvent {
88
final DateTime deactivatedAt;
99
final String? reason;
1010

packages/continuum/example/lib/domain/events/user_registered.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import 'package:continuum/continuum.dart';
33
import '../user.dart';
44

55
/// Event fired when a new user registers.
6-
@Event(ofAggregate: User, type: 'user.registered')
7-
class UserRegistered extends DomainEvent {
6+
@AggregateEvent(of: User, type: 'user.registered')
7+
class UserRegistered extends ContinuumEvent {
88
final String userId;
99
final String email;
1010
final String name;

packages/continuum/example/lib/domain/user.g.dart

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/continuum/example/lib/event_replay.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ void main() {
2121

2222
// Simulate an event history (as if loaded from an event store)
2323
print('Event history:');
24-
final events = <DomainEvent>[
24+
final events = <ContinuumEvent>[
2525
UserRegistered(
2626
eventId: const EventId('evt-1'),
2727
userId: 'user-789',

0 commit comments

Comments
 (0)