thenativeweb / node-cqrs-domain

Node-cqrs-domain is a node.js module based on nodeEventStore that. It can be very useful as domain component if you work with (d)ddd, cqrs, eventdenormalizer, host, etc.
http://cqrs.js.org/pages/domain.html
MIT License
269 stars 57 forks source link

Different behaviour in structure loader #115

Closed alemhnan closed 6 years ago

alemhnan commented 6 years ago

After #113 my codebase is not picking up any more files.

I get this error:

/node_modules/cqrs-domain/lib/structure/structureLoader.js:561
    callback(err, structured, warns);
    ^

TypeError: callback is not a function

I tried using the new options (useLoaderExtensions) with both true/false values.

Any idea? Pinging also @repkins just in case.

alemhnan commented 6 years ago

I've found the culprit.

In 'lib/structure/structureLoader.js', line 554, we have an additional parameter: https://github.com/adrai/node-cqrs-domain/pull/113/files?diff=split#r154949091

I can fix this on my side with no problems. It would be nice maybe to add a default value for that parameters, not sure if that is the right approach though.

alemhnan commented 6 years ago

I'm closing this as the fix is easy on my side.

repkins commented 6 years ago

Perhaps it depends of whenever that function load() is exposed to app requiring modules from this package. I never assumed that package inner modules like "structureParser" and others are open to API of package, but only those which are exported through package index module. And also documented that way according to readme.