Comparing version 1.0.0-alpha-09 to 1.0.0-alpha-10
@@ -6,2 +6,3 @@ 'use strict'; | ||
let error = di.load('@{appix}/error'); | ||
let Component = di.load('@{appix}/component'); | ||
let fs = di.load('fs'); | ||
@@ -195,3 +196,3 @@ const COMPONENTS = [ | ||
setComponent(key, config) { | ||
let Component = config; | ||
let ComponentToConstruct = config; | ||
if (this.hasComponent(key)) { | ||
@@ -205,17 +206,17 @@ throw new error.Exception('Component is already initialized', { | ||
if (Type.isString(config.filePath)) { | ||
Component = di.load(config.filePath); | ||
ComponentToConstruct = di.load(config.filePath); | ||
} else if (COMPONENTS.indexOf(key) > -1) { | ||
Component = di.load('@{appix}/components/' + key.slice(5)); | ||
ComponentToConstruct = di.load('@{appix}/components/' + key.slice(5)); | ||
} else if (!Type.isFunction(config)) { | ||
Component = di.load(key); | ||
ComponentToConstruct = di.load(key); | ||
} | ||
if (!Type.isFunction(Component)) { | ||
if (!Type.isFunction(ComponentToConstruct)) { | ||
throw new error.Exception('Component must be function type'); | ||
} | ||
let initialized = new Component(config, this); | ||
let initialized = new ComponentToConstruct(config, this); | ||
if (!(initialized instanceof Type)) { | ||
throw new error.Exception('Component must be inherited from typed-js'); | ||
if (!(initialized instanceof Component)) { | ||
throw new error.Exception('Component must be inherited from {appix}/component'); | ||
} | ||
@@ -222,0 +223,0 @@ |
@@ -7,2 +7,3 @@ 'use strict'; | ||
let error = di.load('@{appix}/error'); | ||
let Component = di.load('@{appix}/component'); | ||
/** | ||
@@ -43,5 +44,5 @@ * @license Mit Licence 2015 | ||
*/ | ||
class Logger extends Type { | ||
constructor(config) { | ||
super({ | ||
class Logger extends Component { | ||
constructor(config, bootstrap) { | ||
super(config, bootstrap, { | ||
config: Type.OBJECT, | ||
@@ -48,0 +49,0 @@ hooks: Type.OBJECT, |
@@ -7,2 +7,3 @@ 'use strict'; | ||
let RouteRule = di.load('@{appix}/route-rule'); | ||
let Component = di.load('@{appix}/component'); | ||
let logger; | ||
@@ -67,5 +68,5 @@ /** | ||
*/ | ||
class Router extends Type { | ||
class Router extends Component { | ||
constructor(config, bootstrap) { | ||
super({ | ||
super(config, bootstrap, { | ||
routes: Type.OBJECT, | ||
@@ -72,0 +73,0 @@ bootstrap: Type.OBJECT, |
@@ -6,2 +6,3 @@ 'use strict'; | ||
let http = di.load('http'); | ||
let Component = di.load('@{appix}/component'); | ||
let logger; | ||
@@ -20,5 +21,5 @@ /** | ||
*/ | ||
class Server extends Type { | ||
class Server extends Component { | ||
constructor(config, bootstrap) { | ||
super({ | ||
super(config, bootstrap, { | ||
server: Type.OBJECT | ||
@@ -25,0 +26,0 @@ }); |
@@ -5,3 +5,3 @@ { | ||
"description": "Lightweight application framework with dyependency injection and dynamic type checking for node js", | ||
"version": "1.0.0-alpha-09", | ||
"version": "1.0.0-alpha-10", | ||
"dependencies": { | ||
@@ -8,0 +8,0 @@ "di-node": "0.2.x", |
@@ -1,2 +0,2 @@ | ||
# Appix 1.0.0-alpha-06 [![Build Status](https://travis-ci.org/igorzg/appix.svg?branch=master)](https://travis-ci.org/igorzg/appix) | ||
# Appix 1.0.0-alpha-10 [![Build Status](https://travis-ci.org/igorzg/appix.svg?branch=master)](https://travis-ci.org/igorzg/appix) | ||
* Es6 Node.js framework dev version | ||
@@ -3,0 +3,0 @@ * Lightweight application framework with dyependency injection and dynamic type checking for node js |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
90417
15
3015