Minimize eventcore/src/lib.rs exports per ADR-030 #267

Closed
opened 2025-12-31 16:48:22 -08:00 by jwilger · 1 comment
jwilger commented 2025-12-31 16:48:22 -08:00 (Migrated from github.com)

Summary

Update eventcore/src/lib.rs to export only the minimal public API defined in ADR-030.

Parent Issue

  • #266 Implement ADR-030: Layered Crate Public API Design

Changes Required

Keep These Exports

  • execute function
  • run_projection function (from projection module)
  • ProjectionError (error type for run_projection)
  • RetryPolicy, BackoffStrategy, ExecutionResponse, MetricsHook, RetryContext
  • Command derive macro (feature-gated)
  • require! macro
  • eventcore_postgres as postgres (feature-gated)

Re-export from eventcore-types (Application Developer needs)

  • CommandLogic, CommandStreams, CommandError
  • Event, StreamId, StreamDeclarations, NewEvents, StreamResolver
  • Projector, FailureContext, FailureStrategy, StreamPosition
  • DelayMilliseconds, AttemptNumber (needed by RetryPolicy/RetryContext)

Remove from Public API

  • All other re-exports from eventcore-types
  • ProjectionRunner - use run_projection() instead
  • PollMode, PollConfig, EventRetryConfig, NoCheckpointStore

Make Internal Only

Change pub use projection::{...} to only export run_projection and ProjectionError

Acceptance Criteria

  • cargo check passes
  • Only the listed types are publicly visible
  • Unit tests in lib.rs still pass (may need internal imports)
## Summary Update `eventcore/src/lib.rs` to export only the minimal public API defined in ADR-030. ## Parent Issue - #266 Implement ADR-030: Layered Crate Public API Design ## Changes Required ### Keep These Exports - `execute` function - `run_projection` function (from projection module) - `ProjectionError` (error type for run_projection) - `RetryPolicy`, `BackoffStrategy`, `ExecutionResponse`, `MetricsHook`, `RetryContext` - `Command` derive macro (feature-gated) - `require!` macro - `eventcore_postgres as postgres` (feature-gated) ### Re-export from eventcore-types (Application Developer needs) - `CommandLogic`, `CommandStreams`, `CommandError` - `Event`, `StreamId`, `StreamDeclarations`, `NewEvents`, `StreamResolver` - `Projector`, `FailureContext`, `FailureStrategy`, `StreamPosition` - `DelayMilliseconds`, `AttemptNumber` (needed by RetryPolicy/RetryContext) ### Remove from Public API - All other re-exports from `eventcore-types` - `ProjectionRunner` - use `run_projection()` instead - `PollMode`, `PollConfig`, `EventRetryConfig`, `NoCheckpointStore` ### Make Internal Only Change `pub use projection::{...}` to only export `run_projection` and `ProjectionError` ## Acceptance Criteria - [ ] `cargo check` passes - [ ] Only the listed types are publicly visible - [ ] Unit tests in lib.rs still pass (may need internal imports)
jwilger commented 2025-12-31 17:32:20 -08:00 (Migrated from github.com)

Closing: Parent issue closed

Closing: Parent issue closed
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Slipstream/eventcore#267
No description provided.