Permalink
Browse files

optimization for npm module naming

  • Loading branch information...
1 parent b005db7 commit 6cb1bf9337b03963d09901a1855698592dec55df @adrai committed Feb 3, 2014
Showing with 20 additions and 17 deletions.
  1. +4 −0 README.md
  2. +8 −15 index.js
  3. +7 −1 lib/domain.js
  4. +1 −1 package.json
View
@@ -125,6 +125,10 @@ See [tests](https://github.com/adrai/node-cqrs-domain/tree/master/test) for deta
# Release Notes
+## v0.7.7
+
+- optimization for npm module naming
+
## v0.7.6
- updated eventstore
View
@@ -1,15 +1,8 @@
-var index;
-
-if (typeof module.exports !== 'undefined') {
- index = module.exports;
-} else {
- index = root.index = {};
-}
-
-index.VERSION = '0.0.1';
-
-index.domain = require('./lib/domain');
-index.aggregateBase = require('./lib/bases/aggregateBase');
-index.commandHandlerBase = require('./lib/bases/commandHandlerBase');
-index.sagaBase = require('./lib/bases/sagaBase');
-index.sagaHandlerBase = require('./lib/bases/sagaHandlerBase');
+module.exports = {
+ version: require('./package.json').version,
+ domain: require('./lib/domain'),
+ aggregateBase: require('./lib/bases/aggregateBase'),
+ commandHandlerBase: require('./lib/bases/commandHandlerBase'),
+ sagaBase: require('./lib/bases/sagaBase'),
+ sagaHandlerBase: require('./lib/bases/sagaHandlerBase')
+};
View
@@ -87,7 +87,13 @@ module.exports = domain = _.extend(new EventEmitter2({
var es = eventStore.createStore({ enableDispatching: false });
es.configure(function() {
if (options.eventStore.type !== 'inMemory') {
- this.use(require('eventstore.' + options.eventStore.type).createStorage(options.eventStore));
+ var storeModule;
+ try {
+ storeModule = require('eventstore.' + options.eventStore.type);
+ } catch (e) {
+ storeModule = require('eventstore.' + options.eventStore.type.toLowerCase());
+ }
+ this.use(storeModule.createStorage(options.eventStore));
}
}).start(function(err) {
View
@@ -1,7 +1,7 @@
{
"author": "adrai",
"name": "cqrs-domain",
- "version": "0.7.6",
+ "version": "0.7.7",
"private": false,
"main": "index.js",
"engines": {

0 comments on commit 6cb1bf9

Please sign in to comment.