Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: thenativeweb/node-cqrs-domain
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.8.1
Choose a base ref
...
head repository: thenativeweb/node-cqrs-domain
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.9.0
Choose a head ref
  • 3 commits
  • 4 files changed
  • 2 contributors

Commits on Aug 24, 2017

  1. Support default exports. (#104)

    * Support default exports.
    
    * Update README.md
    IRT-fbachmann authored and adrai committed Aug 24, 2017
    Copy the full SHA
    e1fe478 View commit details
  2. prepare version

    adrai committed Aug 24, 2017
    Copy the full SHA
    b04ac7b View commit details
  3. 2.9.0

    adrai committed Aug 24, 2017
    Copy the full SHA
    d54ef0d View commit details
Showing with 30 additions and 1 deletion.
  1. +22 −0 README.md
  2. +4 −0 lib/structure/structureParser.js
  3. +1 −1 package.json
  4. +3 −0 releasenotes.md
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1092,6 +1092,28 @@ Is your use case not solvable without a custom command handling? Sagas? Micro-Se
});
});

## ES6 default exports
Importing ES6 style default exports is supported for all definitions where you also use `module.exports`:
```
module.exports = defineContext({...});
```
works as well as
```
exports.default = defineContext({...});
```
as well as (must be transpiled by babel or tsc to be runnable in node)
```
export default defineContext({...});
```

Also:
```
exports.default = defineAggregate({...});
exports.default = defineCommand({...});
exports.default = defineEvent({...});
// etc...
```
Exports other than the default export are then ignored by this package's structure loader.

[Release notes](https://github.com/adrai/node-cqrs-domain/blob/master/releasenotes.md)

4 changes: 4 additions & 0 deletions lib/structure/structureParser.js
Original file line number Diff line number Diff line change
@@ -99,6 +99,10 @@ function pathToJson (root, paths, addWarning) {
return;
}

if (typeof required === 'object' && typeof required.default !== 'undefined') {
required = required.default;
}

if (_.isArray(required)) {
_.each(required, function (req) {
res.push({
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"author": "adrai",
"name": "cqrs-domain",
"version": "2.8.1",
"version": "2.9.0",
"private": false,
"main": "index.js",
"engines": {
3 changes: 3 additions & 0 deletions releasenotes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## [v2.9.0](https://github.com/adrai/node-cqrs-domain/compare/v2.8.1...v2.9.0)
- Support default exports [#104](https://github.com/adrai/node-cqrs-domain/pull/#104) thanks to [IRT-fbachmann](https://github.com/IRT-fbachmann)

## [v2.8.1](https://github.com/adrai/node-cqrs-domain/compare/v2.8.0...v2.8.1)
- fix aggregateLock [#103](https://github.com/adrai/node-cqrs-domain/pull/#103) thanks to [emmkong](https://github.com/emmkong)