npm.io
3.0.0-alpha.250 • Published 11h ago

@reventlessdev/reventless-core

Licence
Apache-2.0
Version
3.0.0-alpha.250
Deps
13
Size
3.4 MB
Vulns
0
Weekly
0
Stars
1

npm License: Apache-2.0 Docs

@reventlessdev/reventless-core

Alpha. APIs and on-disk formats can change without notice between releases. Pin exact versions and expect breaking changes.

The provider-agnostic core of Reventless — a spec-driven, event-sourced CQRS framework written in ReScript. This package is the runtime you model your domain against: the type-safe building blocks for commands, events, projections, and the behaviors that evolve state — with no cloud or storage dependency. The provider-specific adapters live in separate packages (see Where it fits).

What it provides

ReScript modules, consumed by adding the package to your rescript.json dependencies:

  • Message — command / event message contracts and their service interface.
  • Behavior — the write-side behavior spec: event-sourced state transitions (evolve(state, event) => state).
  • Projection / ProjectionMapper — read models projected from event streams.
  • Mapper / Mapper1toN / MapperNto1 — cross-component event translation (encode/decode between a source and a target contract).
  • ComponentType — the hierarchical component-kind vocabulary.
  • PluginRuntimeOperations — the provider-agnostic interface a runtime adapter implements.
  • RequestContext — per-invocation context threaded through the effect pipeline.
  • Env — environment access.

Domain code written against these modules is provider-agnostic: the same components run unchanged on any adapter.

Where it fits

reventless-core is one package in the Reventless framework. It builds on @reventlessdev/reventless-spec (type specifications) and is paired at runtime with a storage/cloud adapter:

You normally obtain reventless-core transitively by scaffolding an app rather than installing it on its own.

Install

pnpm add @reventlessdev/reventless-core

Then register it as a ReScript dependency in rescript.json:

{
  "dependencies": ["@reventlessdev/reventless-core"]
}

Requires ReScript ^12.3.0 (peer dependency).

License

Apache-2.0