Introduces a ModuleTraverser that starts in the main module, and looks through all the exported objects and their properties recursively - and registers anything it finds annotated with @eventType, @aggregateRoot, @eventHandler, @projection or @embedding automatically. Since traversing all the exported things quickly takes a long time in a real project, there is a blacklist of paths to stop at (currently just the JavaScript.SDK packages itself).
It still requires you to import or require the files containing the annotated types to discover, but it reduces the amount of code for the .setup(...) of the DolittleClient.
Added
Implement the type discovery by traversing the modules that are imported by the main module recursively.
Summary
Introduces a
ModuleTraverser
that starts in the main module, and looks through all the exported objects and their properties recursively - and registers anything it finds annotated with@eventType
,@aggregateRoot
,@eventHandler
,@projection
or@embedding
automatically. Since traversing all the exported things quickly takes a long time in a real project, there is a blacklist of paths to stop at (currently just the JavaScript.SDK packages itself).It still requires you to
import
orrequire
the files containing the annotated types to discover, but it reduces the amount of code for the.setup(...)
of theDolittleClient
.Added