Skip to content

Commit e4f2719

Browse files
authored
Merge branch 'get-eventually:main' into feat/add-lightswitch-example
2 parents 3f30176 + 33cec3f commit e4f2719

File tree

24 files changed

+232
-138
lines changed

24 files changed

+232
-138
lines changed

.clippy.toml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
allowed-duplicate-crates = [
2+
"thiserror",
3+
"thiserror-impl",
4+
# These are all coming from eventually-postgres, quite likely sqlx...
5+
"hashbrown",
6+
"wasi",
7+
"windows-sys",
8+
"windows-targets",
9+
"windows_aarch64_gnullvm",
10+
"windows_aarch64_msvc",
11+
"windows_i686_gnu",
12+
"windows_i686_msvc",
13+
"windows_x86_64_gnu",
14+
"windows_x86_64_gnullvm",
15+
"windows_x86_64_msvc",
16+
"zerocopy",
17+
"zerocopy-derive",
18+
"getrandom",
19+
]

.editorconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,3 @@ trim_trailing_whitespace = true
1212

1313
[*.{json, md, yaml, yml, proto}]
1414
indent_size = 2
15-

.github/dependabot.yml

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

.github/workflows/ci.yml

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,6 @@ jobs:
2020
required: false
2121
toolchain: nightly
2222

23-
services:
24-
postgres:
25-
env:
26-
POSTGRES_USER: eventually
27-
POSTGRES_PASSWORD: password
28-
POSTGRES_DB: eventually
29-
image: postgres:latest
30-
ports: ["5432:5432"]
31-
options: >-
32-
--health-cmd pg_isready
33-
--health-interval 10s
34-
--health-timeout 5s
35-
--health-retries 5
36-
3723
steps:
3824
- name: Install Protoc
3925
uses: arduino/setup-protoc@v3
@@ -105,7 +91,7 @@ jobs:
10591
DATABASE_URL: postgres://eventually:password@localhost:5432/eventually?sslmode=disable
10692

10793
- name: Upload to codecov.io
108-
uses: codecov/codecov-action@v4
94+
uses: codecov/codecov-action@0565863a31f2c772f9f0395002a31e3f06189574 # v5
10995
with:
11096
files: lcov.info
11197

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
**/target
22
**/*.rs.bk
3-
Cargo.lock
3+
/Cargo.lock
44
lcov.info
5-
65
.direnv

.vscode/settings.json

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,27 @@
11
{
2+
"editor.tabSize": 2,
3+
"editor.formatOnSave": true,
4+
"files.associations": {
5+
"*.json5": "jsonc",
6+
},
7+
"[json][jsonc]": {
8+
"editor.defaultFormatter": "vscode.json-language-features",
9+
"editor.indentSize": "tabSize",
10+
},
11+
"[rust]": {
12+
"editor.tabSize": 4,
13+
},
214
"rust-analyzer.cargo.features": "all",
3-
"rust-analyzer.check.command": "clippy"
15+
"rust-analyzer.check.command": "clippy",
16+
"nix.serverPath": "nil",
17+
"nix.enableLanguageServer": true,
18+
"nix.serverSettings": {
19+
"nil": {
20+
"formatting": {
21+
"command": [
22+
"nixpkgs-fmt"
23+
]
24+
}
25+
}
26+
},
427
}

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ members = [
44
"eventually",
55
"eventually-macros",
66
"eventually-postgres",
7-
8-
# Crates as examples
7+
# Examples
98
"examples/bank-accounting",
109
"examples/light-switch",
1110
]

eventually-macros/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ keywords = ["architecture", "ddd", "event-sourcing", "cqrs", "es"]
2020
proc-macro = true
2121

2222
[dependencies]
23-
syn = { version = "1.0.109", features = ["full"] }
24-
quote = "1.0.35"
23+
syn = { version = "2.0.100", features = ["full"] }
24+
quote = "1.0.40"
2525
eventually = { path = "../eventually" }

eventually-macros/src/lib.rs

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66

77
use proc_macro::TokenStream;
88
use quote::quote;
9-
use syn::{parse_macro_input, AttributeArgs, Fields, ItemStruct, Meta, NestedMeta, Path};
9+
use syn::punctuated::Punctuated;
10+
use syn::{parse_macro_input, Fields, ItemStruct, Token, Type};
1011

1112
/// Implements a newtype to use the [`eventually::aggregate::Root`] instance with
1213
/// user-defined [`eventually::aggregate::Aggregate`] types.
@@ -22,7 +23,7 @@ use syn::{parse_macro_input, AttributeArgs, Fields, ItemStruct, Meta, NestedMeta
2223
/// being an example of user-defined `Aggregate` type) outside the `eventually` crate (E0116).
2324
/// Therefore, a newtype that uses `aggregate::Root<T>` is required.
2425
///
25-
/// This attribute macro makes the implementation of a newtype easy, as it Implements
26+
/// This attribute macro makes the implementation of a newtype easy, as it implements
2627
/// conversion traits from and to `aggregate::Root<T>` and implements automatic deref
2728
/// through [`std::ops::Deref`] and [`std::ops::DerefMut`].
2829
///
@@ -31,19 +32,14 @@ use syn::{parse_macro_input, AttributeArgs, Fields, ItemStruct, Meta, NestedMeta
3132
/// This method will panic if the Aggregate Root type is not provided as a macro parameter.
3233
#[proc_macro_attribute]
3334
pub fn aggregate_root(args: TokenStream, item: TokenStream) -> TokenStream {
34-
let args = parse_macro_input!(args as AttributeArgs);
3535
let mut item = parse_macro_input!(item as ItemStruct);
3636
let item_ident = item.ident.clone();
3737

38-
let aggregate_type = args
39-
.first()
40-
.and_then(|meta| match meta {
41-
NestedMeta::Meta(Meta::Path(Path { segments, .. })) => Some(segments),
42-
_ => None,
43-
})
44-
.and_then(|segments| segments.first())
45-
.map(|segment| segment.ident.clone())
46-
.expect("the aggregate root type must be provided as macro parameter");
38+
let aggregate_type: Type =
39+
parse_macro_input!(args with Punctuated::<Type, Token![,]>::parse_terminated)
40+
.into_iter()
41+
.next()
42+
.expect("the aggregate root type must be provided as macro parameter");
4743

4844
item.fields = Fields::Unnamed(
4945
syn::parse2(quote! { (eventually::aggregate::Root<#aggregate_type>) }).unwrap(),

eventually-postgres/Cargo.toml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,27 @@ categories = ["web-programming", "asynchronous"]
1212
keywords = ["postgres", "postgresql", "database", "ddd", "event-sourcing"]
1313

1414
[dependencies]
15-
anyhow = "1.0.80"
15+
anyhow = "1.0.97"
1616
async-trait = "0.1.77"
17-
chrono = "0.4.34"
17+
chrono = "0.4.40"
1818
eventually = { path = "../eventually", version = "0.5.0", features = [
1919
"serde-json",
2020
] }
21-
futures = "0.3.30"
22-
lazy_static = "1.4.0"
23-
regex = "1.10.3"
24-
sqlx = { version = "0.7.3", features = [
21+
futures = "0.3.31"
22+
regex = "1.11.1"
23+
sqlx = { version = "0.8.3", features = [
2524
"runtime-tokio-rustls",
2625
"postgres",
2726
"migrate",
2827
] }
29-
thiserror = "1.0.57"
28+
thiserror = "2.0.12"
3029

3130
[dev-dependencies]
32-
tokio = { version = "1.36.0", features = ["macros", "rt"] }
31+
tokio = { version = "1.44.1", features = ["macros", "rt"] }
3332
eventually = { path = "../eventually", version = "0.5.0", features = [
3433
"serde-json",
3534
] }
3635
eventually-macros = { path = "../eventually-macros", version = "0.1.0" }
37-
serde = { version = "1.0.197", features = ["derive"] }
38-
rand = "0.8.5"
36+
serde = { version = "1.0.219", features = ["derive"] }
37+
rand = "0.9.0"
38+
testcontainers-modules = { version = "0.11.6", features = ["postgres"] }

0 commit comments

Comments
 (0)