Skip to content

Commit 6fbc66c

Browse files
authored
79 extensible streamable registry remove closed dispatcher add builder registration (#80)
* feat: update aimdb-data-contracts version and enhance schema registration - Updated aimdb-data-contracts dependency version to 0.1.0 in Cargo.toml. - Refactored WasmDb to use a new registration method for Streamable types, allowing runtime dispatch. - Introduced a new StreamableRegistry for managing schema types in the WebSocket connector. - Added support for registering Streamable types in the WebSocketConnectorBuilder. - Implemented new data contracts for humidity and GPS location, including simulation and observability features. - Enhanced temperature schema with versioning and migration support for backward compatibility. - Added tests for the new StreamableRegistry and its functionalities. * feat: enhance WebSocketConnector registration examples and update weather station dependencies * feat: update embassy dependencies to latest versions and adjust features in examples * feat: update stm32-metapac source to use git repository and update embassy submodule * fix: update TemperatureV1 schema name for consistency * feat: update dependencies in Cargo.toml files to use specific versions * feat: enhance StreamableRegistry to handle schema name collisions and update WebSocketConnectorBuilder registration * fix: update comments in builder and registry for clarity on type handling * chore: update embassy submodule to latest commit * chore: update embassy submodule to latest commit
1 parent 9d6d355 commit 6fbc66c

35 files changed

Lines changed: 936 additions & 1151 deletions

File tree

Cargo.lock

Lines changed: 13 additions & 44 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ tokio-test = "0.4"
8585
aimdb-tokio-adapter = { path = "./aimdb-tokio-adapter" }
8686

8787
# Embassy ecosystem for embedded async
88-
embassy-stm32 = { version = "0.5.0", path = "./_external/embassy/embassy-stm32", features = [
88+
embassy-stm32 = { version = "0.6.0", path = "./_external/embassy/embassy-stm32", features = [
8989
"defmt",
9090
"stm32h563zi",
9191
"memory-x",
@@ -94,27 +94,27 @@ embassy-stm32 = { version = "0.5.0", path = "./_external/embassy/embassy-stm32",
9494
"unstable-pac",
9595
"low-power",
9696
] }
97-
embassy-sync = { version = "0.7.2", path = "./_external/embassy/embassy-sync", features = [
97+
embassy-sync = { version = "0.8.0", path = "./_external/embassy/embassy-sync", features = [
9898
"defmt",
9999
] }
100-
embassy-executor = { version = "0.9.1", path = "./_external/embassy/embassy-executor", features = [
101-
"arch-cortex-m",
100+
embassy-executor = { version = "0.10.0", path = "./_external/embassy/embassy-executor", features = [
101+
"platform-cortex-m",
102102
"executor-thread",
103103
"defmt",
104104
] }
105-
embassy-time = { version = "0.5.0", path = "./_external/embassy/embassy-time", features = [
105+
embassy-time = { version = "0.5.1", path = "./_external/embassy/embassy-time", features = [
106106
"defmt",
107107
"defmt-timestamp-uptime",
108108
"tick-hz-32_768",
109109
] }
110-
embassy-net = { version = "0.8.0", path = "./_external/embassy/embassy-net", features = [
110+
embassy-net = { version = "0.9.0", path = "./_external/embassy/embassy-net", features = [
111111
"defmt",
112112
"tcp",
113113
"dhcpv4",
114114
"medium-ethernet",
115115
"proto-ipv6",
116116
] }
117-
embassy-usb = { version = "0.5.1", path = "./_external/embassy/embassy-usb", features = [
117+
embassy-usb = { version = "0.6.0", path = "./_external/embassy/embassy-usb", features = [
118118
"defmt",
119119
] }
120120
embassy-futures = { version = "0.1.2", path = "./_external/embassy/embassy-futures" }

Makefile

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -332,73 +332,77 @@ publish:
332332
else \
333333
printf "$(BLUE)Running in CI mode - skipping confirmation$(NC)\n"; \
334334
fi
335-
@printf "$(YELLOW) → Publishing aimdb-executor (1/17)$(NC)\n"
335+
@printf "$(YELLOW) → Publishing aimdb-executor (1/18)$(NC)\n"
336336
@cargo publish -p aimdb-executor
337337
@printf "$(YELLOW) → Waiting 10s for crates.io propagation...$(NC)\n"
338338
@sleep 10
339-
@printf "$(YELLOW) → Publishing aimdb-derive (2/17)$(NC)\n"
339+
@printf "$(YELLOW) → Publishing aimdb-derive (2/18)$(NC)\n"
340340
@cargo publish -p aimdb-derive
341341
@printf "$(YELLOW) → Waiting 10s for crates.io propagation...$(NC)\n"
342342
@sleep 10
343-
@printf "$(YELLOW) → Publishing aimdb-codegen (3/17)$(NC)\n"
343+
@printf "$(YELLOW) → Publishing aimdb-codegen (3/18)$(NC)\n"
344344
@cargo publish -p aimdb-codegen
345345
@printf "$(YELLOW) → Waiting 10s for crates.io propagation...$(NC)\n"
346346
@sleep 10
347-
@printf "$(YELLOW) → Publishing aimdb-core (4/17)$(NC)\n"
347+
@printf "$(YELLOW) → Publishing aimdb-core (4/18)$(NC)\n"
348348
@cargo publish -p aimdb-core
349349
@printf "$(YELLOW) → Waiting 10s for crates.io propagation...$(NC)\n"
350350
@sleep 10
351-
@printf "$(YELLOW) → Publishing aimdb-tokio-adapter (5/17)$(NC)\n"
351+
@printf "$(YELLOW) → Publishing aimdb-data-contracts (5/18)$(NC)\n"
352+
@cargo publish -p aimdb-data-contracts
353+
@printf "$(YELLOW) → Waiting 10s for crates.io propagation...$(NC)\n"
354+
@sleep 10
355+
@printf "$(YELLOW) → Publishing aimdb-tokio-adapter (6/18)$(NC)\n"
352356
@cargo publish -p aimdb-tokio-adapter
353357
@printf "$(YELLOW) → Waiting 10s for crates.io propagation...$(NC)\n"
354358
@sleep 10
355-
@printf "$(YELLOW) → Publishing aimdb-embassy-adapter (6/17)$(NC)\n"
359+
@printf "$(YELLOW) → Publishing aimdb-embassy-adapter (7/18)$(NC)\n"
356360
@cargo publish -p aimdb-embassy-adapter --no-verify
357361
@printf "$(YELLOW) → Waiting 10s for crates.io propagation...$(NC)\n"
358362
@sleep 10
359-
@printf "$(YELLOW) → Publishing aimdb-client (7/17)$(NC)\n"
363+
@printf "$(YELLOW) → Publishing aimdb-client (8/18)$(NC)\n"
360364
@cargo publish -p aimdb-client
361365
@printf "$(YELLOW) → Waiting 10s for crates.io propagation...$(NC)\n"
362366
@sleep 10
363-
@printf "$(YELLOW) → Publishing aimdb-sync (8/17)$(NC)\n"
367+
@printf "$(YELLOW) → Publishing aimdb-sync (9/18)$(NC)\n"
364368
@cargo publish -p aimdb-sync
365369
@printf "$(YELLOW) → Waiting 10s for crates.io propagation...$(NC)\n"
366370
@sleep 10
367-
@printf "$(YELLOW) → Publishing aimdb-persistence (9/17)$(NC)\n"
371+
@printf "$(YELLOW) → Publishing aimdb-persistence (10/18)$(NC)\n"
368372
@cargo publish -p aimdb-persistence
369373
@printf "$(YELLOW) → Waiting 10s for crates.io propagation...$(NC)\n"
370374
@sleep 10
371-
@printf "$(YELLOW) → Publishing aimdb-persistence-sqlite (10/17)$(NC)\n"
375+
@printf "$(YELLOW) → Publishing aimdb-persistence-sqlite (11/18)$(NC)\n"
372376
@cargo publish -p aimdb-persistence-sqlite
373377
@printf "$(YELLOW) → Waiting 10s for crates.io propagation...$(NC)\n"
374378
@sleep 10
375-
@printf "$(YELLOW) → Publishing aimdb-mqtt-connector (11/17)$(NC)\n"
379+
@printf "$(YELLOW) → Publishing aimdb-mqtt-connector (12/18)$(NC)\n"
376380
@cargo publish -p aimdb-mqtt-connector
377381
@printf "$(YELLOW) → Waiting 10s for crates.io propagation...$(NC)\n"
378382
@sleep 10
379-
@printf "$(YELLOW) → Publishing aimdb-knx-connector (12/17)$(NC)\n"
383+
@printf "$(YELLOW) → Publishing aimdb-knx-connector (13/18)$(NC)\n"
380384
@cargo publish -p aimdb-knx-connector
381385
@printf "$(YELLOW) → Waiting 10s for crates.io propagation...$(NC)\n"
382386
@sleep 10
383-
@printf "$(YELLOW) → Publishing aimdb-ws-protocol (13/17)$(NC)\n"
387+
@printf "$(YELLOW) → Publishing aimdb-ws-protocol (14/18)$(NC)\n"
384388
@cargo publish -p aimdb-ws-protocol
385389
@printf "$(YELLOW) → Waiting 10s for crates.io propagation...$(NC)\n"
386390
@sleep 10
387-
@printf "$(YELLOW) → Publishing aimdb-websocket-connector (14/17)$(NC)\n"
391+
@printf "$(YELLOW) → Publishing aimdb-websocket-connector (15/18)$(NC)\n"
388392
@cargo publish -p aimdb-websocket-connector
389393
@printf "$(YELLOW) → Waiting 10s for crates.io propagation...$(NC)\n"
390394
@sleep 10
391-
@printf "$(YELLOW) → Publishing aimdb-wasm-adapter (15/17)$(NC)\n"
395+
@printf "$(YELLOW) → Publishing aimdb-wasm-adapter (16/18)$(NC)\n"
392396
@cargo publish -p aimdb-wasm-adapter --no-verify
393397
@printf "$(YELLOW) → Waiting 10s for crates.io propagation...$(NC)\n"
394398
@sleep 10
395-
@printf "$(YELLOW) → Publishing aimdb-cli (16/17)$(NC)\n"
399+
@printf "$(YELLOW) → Publishing aimdb-cli (17/18)$(NC)\n"
396400
@cargo publish -p aimdb-cli
397401
@printf "$(YELLOW) → Waiting 10s for crates.io propagation...$(NC)\n"
398402
@sleep 10
399-
@printf "$(YELLOW) → Publishing aimdb-mcp (17/17)$(NC)\n"
403+
@printf "$(YELLOW) → Publishing aimdb-mcp (18/18)$(NC)\n"
400404
@cargo publish -p aimdb-mcp
401-
@printf "$(GREEN)✓ All 17 crates published successfully!$(NC)\n"
405+
@printf "$(GREEN)✓ All 18 crates published successfully!$(NC)\n"
402406
@printf "$(BLUE)🎉 AimDB v$(shell grep '^version' Cargo.toml | head -1 | cut -d '"' -f 2) is now live on crates.io!$(NC)\n"
403407

404408
## Convenience commands

_external/embassy

Submodule embassy updated 284 files

_external/knx-pico

Submodule knx-pico updated 1 file

_external/mountain-mqtt

aimdb-data-contracts/Cargo.toml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[package]
22
name = "aimdb-data-contracts"
3-
version.workspace = true
3+
version = "0.1.0"
44
edition.workspace = true
55
authors.workspace = true
66
license.workspace = true
77
repository.workspace = true
88
homepage.workspace = true
9-
description = "Data contracts for AimDB: portable schemas with built-in versioning and simulation support"
9+
description = "Trait definitions for AimDB data contracts: SchemaType, Streamable, Observable, Linkable, Simulatable, Migratable"
1010
keywords = ["aimdb", "iot", "edge", "schema", "contracts"]
1111
categories = ["embedded", "no-std"]
1212

@@ -18,28 +18,23 @@ linkable = ["alloc", "serde_json"]
1818
simulatable = ["rand"]
1919
migratable = ["std", "serde_json"]
2020
observable = ["alloc", "aimdb-core", "aimdb-executor"]
21-
ts = ["std", "ts-rs"]
2221

2322
[dependencies]
2423
serde = { version = "1.0", default-features = false, features = ["derive"] }
2524
serde_json = { version = "1.0", optional = true }
2625

2726
# Optional dependencies for observable feature (log_tap function)
2827
# Note: aimdb-core requires alloc feature for core functionality
29-
aimdb-core = { path = "../aimdb-core", optional = true, default-features = false, features = [
28+
aimdb-core = { version = "1.0.0", path = "../aimdb-core", optional = true, default-features = false, features = [
3029
"alloc",
3130
] }
32-
aimdb-executor = { path = "../aimdb-executor", optional = true, default-features = false }
31+
aimdb-executor = { version = "0.1.0", path = "../aimdb-executor", optional = true, default-features = false }
3332

3433
[dependencies.rand]
3534
version = "0.8"
3635
optional = true
3736
default-features = false
3837
features = ["std_rng"]
3938

40-
[dependencies.ts-rs]
41-
version = "10"
42-
optional = true
43-
4439
[dev-dependencies]
4540
serde_json = "1.0"

aimdb-data-contracts/src/contracts/mod.rs

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

0 commit comments

Comments
 (0)