@reventlessdev/reventless-ppx
v1.0.0-alpha.100
Published
ReScript PPX to eliminate boilerplate from Reventless application code
Readme
@reventlessdev/reventless-ppx
⚠️ Alpha. APIs and on-disk formats can change without notice between releases. Pin exact versions and expect breaking changes.
The ReScript PPX for Reventless — a spec-driven, event-sourced CQRS framework written in ReScript. It is a compile-time preprocessor (native OCaml binary) that eliminates boilerplate from Reventless application code by deriving framework metadata and wiring directly from your component definitions.
What it provides
A single PPX binary, invoked by the ReScript compiler, that runs a set of transforms over component source — among them: display-name and reference inference, DCB tag and read-consistency inference, GWT test inference, authorization injection, allowed-states annotations, and module-URL derivation.
The package ships as a thin launcher that resolves a prebuilt per-platform
binary installed as an optional dependency
(@reventlessdev/reventless-ppx-<platform>), published for macOS arm64 and
Linux x64 — so it installs automatically with no authentication. On platforms
with no prebuilt binary (e.g. macOS x64, Linux arm64, Windows via WSL2), it is
built from source with the OCaml toolchain (opam + dune).
The source reader
The same package ships reventless-ppx-read, which prints one ReScript file's
declarations as JSON, each with its span (byte offsets into the file) and source
text: types with their cases, fields and attributes; top-level lets with a
function's parameters and defaults; and the tests of a GWT file with their
scenario-id markers and step values. It is for tools that edit source in place.
npx reventless-ppx-read [--bsc <path-to-bsc>] src/PlaceOrder.resThe file is parsed by the workspace's own ReScript compiler (found under
node_modules/@rescript, or given with --bsc); nothing is built.
Where it fits
This is build tooling shared across the framework and its example apps, not a
runtime library. It is referenced from a package's rescript.json ppx-flags
and runs only at compile time.
Install
pnpm add -D @reventlessdev/reventless-ppxRegister it in rescript.json:
{
"ppx-flags": ["@reventlessdev/reventless-ppx/bin"]
}The matching platform binary is pulled in automatically via optional dependencies. On an unsupported platform, build from source (requires the OCaml toolchain):
cd src && opam exec -- dune buildLinks
- 📚 Documentation — docs.reventless.dev
- 📦 Repository — ReventlessDev/reventless-core
- 📋 Changelog
