Skip to content

Release v1.7.0

Choose a tag to compare

@github-actions github-actions released this 03 Aug 17:37
· 103 commits to ba9b203e607b5f2df95ab908e521afce919806de since this release

Summary

Eight language additions delivered together, each one all the way through: grammar, compiler, printer, Monaco/VS Code language service, documentation, and the invoicing sample. The theme is that a Screenplay should be complete and meaningful before any code exists — several of these close gaps where the language could only point at code instead of describing behavior.

Added

  • type <Name> declares a composite value type — the child-record shapes events routinely carry (lines InvoiceLine[]). Referencable from event, command and type properties (#29)
  • pii reason "…" / sensitive reason "…" in a concept body records why a value is personal data — purpose, lawful basis, whose subject it lives under — instead of losing it to a bare marker (#38)
  • identifier marks the command property a runtime resolves the event source id from. At most one per command; without it a new Uuid is assumed (#52)
  • then error with no reason states a rejection the specification does not name, replacing then error "" as the only expressible form (#46)
  • description on a reactor and on each on trigger, and reactor trigger bodies are now optional — a reactor is describable before any code exists (#40)
  • Queries gain a description, parameters sourced from the context with from $context.…, and a performer block — the query's counterpart to a command handler, as a file reference or an inline csharp/sql block (#53)
  • CommandContext and QueryContext in Cratis.Screenplay.Contexts establish what a command handler and a query performer are given — the command or arguments, TenantId, CausedBy, Causation and when it occurred (#54, #55)
  • sql as an inline code block language
  • Documentation pages for composite types and for the command and query context, plus a declarative-first section in the grammar stating that a document must be expressible — and meaningful — with zero file references

Changed

  • $context. paths are validated against the members of CommandContext/QueryContextcommand, arguments, tenant, causedBy, causation, occurred, identity — and an unknown path is reported
  • Property and query-parameter type references resolve against the primitives, declared concepts, declared types and imports; a reference to something the document never declares is reported. Query return types name read models and are not checked
  • Concept and type names share one namespace, so declaring both is an error
  • ConceptSyntax.Attributes is now IEnumerable<ConceptAttributeSyntax> (name plus optional reason); ConceptSyntax.AttributeNames gives the previous string sequence
  • SpecificationErrorSyntax.Name is nullable — null is a rejection with no named reason
  • The Monaco language service and the VS Code extension know every new construct: keywords, completions, hover, embedded SQL highlighting, and diagnostics matching the compiler