Skip to content

Release v1.3.1

Choose a tag to compare

@github-actions github-actions released this 25 Nov 14:24
d755e08

Arc now serves the same event model explorer as the C# Arc, at the same address, /.cratis/event-model, drawn from your commands, events, read models and reactions. The model is generated while you compile and embedded in your application's priv, so nothing is analysed at run time.

Added

  • /.cratis/event-model/ with hierarchy, documents/{project}/{document}/model, documents/{project}/{document}/source and assets/*: the same routes and contract as the C# explorer. It is served in development by default; set event_model: true to serve it elsewhere. introspection decides who may read it.
  • The :arc_event_model compiler. Add compilers: Mix.compilers() ++ [:arc_event_model] and arc: [application: MyApp.Arc] to write priv/cratis/event_model: a catalog, a board model and the Screenplay source for the application, each module and each feature.
  • The explorer itself, a small Vite and React application in Source/event_model_viewer, built into the package by the publish workflow.
  • event_model: and event_model_apps: options on the Arc application, and an Event model page in the documentation.

Changed

  • Every Arc module is now under Cratis.Arc: Arc.Command is Cratis.Arc.Command, Arc.ReadModel is Cratis.Arc.ReadModel, Arc.Test is Cratis.Arc.Test, Arc.MongoDB is Cratis.Arc.MongoDB, and Arc.execute/3, Arc.query/5 and Arc.context/2 are Cratis.Arc.*. Mix tasks, the :arc_* compilers and config :cratis_arc keep their names.
  • A command names its route with an option, like Chronicle: use Cratis.Arc.Command, id: "register-author" replaces the command "register-author" declaration.
  • Cratis.Arc.Plug.Introspection.schema/1 and type_schema/1 are public so the model reuses the schemas of the discovery routes.