@evosphere/legato
Advanced tools
Comparing version 0.0.5 to 0.0.6
{ | ||
"name": "@evosphere/legato", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "Service management system", | ||
@@ -23,6 +23,3 @@ "main": "src/index.js", | ||
"jest": "^20.0.4" | ||
}, | ||
"dependencies": { | ||
"shaara-core": "^0.1.0" | ||
} | ||
} |
@@ -16,5 +16,6 @@ /** | ||
*/ | ||
export default function Bundle(params : { name: string, definitions: () => ServiceMap }) { | ||
export default function Bundle(params : { name: string, getDefinitions: () => ServiceMap }) { | ||
this.name = params.name; | ||
this.getDefinitions = params.getDefinitions.bind(this); | ||
this.afterSetup = typeof params.afterSetup === "function" ? params.afterSetup.bind(this) : undefined; | ||
} | ||
@@ -21,0 +22,0 @@ |
@@ -23,3 +23,3 @@ /** | ||
export type KernelType = { | ||
export type ApplicationType = { | ||
register: (name : string, service : ServiceType) => void, | ||
@@ -30,6 +30,6 @@ initialize: Function, | ||
export type ApplicationType = { | ||
export type LegatoType = { | ||
createBundle: (params : Object) => BundleType, | ||
createService: (definition : ServiceType) => ServiceType, | ||
create: (params : Object) => KernelType, | ||
create: (params : Object) => ApplicationType, | ||
} | ||
@@ -41,2 +41,3 @@ | ||
getDefinitions: () => ServiceMap, | ||
afterSetup?: (app : ApplicationType) => void, | ||
} |
@@ -11,5 +11,5 @@ // @flow | ||
import type { | ||
LegatoType, | ||
BundleType, | ||
ApplicationType, | ||
BundleType, | ||
KernelType, | ||
ServiceDefinitionMap, ServiceDefinitionType, | ||
@@ -20,3 +20,3 @@ ServiceMap, | ||
export const Application : ApplicationType = { | ||
export const Application : LegatoType = { | ||
/** | ||
@@ -45,3 +45,3 @@ * Shortcut for Bundle.create | ||
*/ | ||
create(params : Object) : KernelType { | ||
create(params : Object) : ApplicationType { | ||
let definitions : ?ServiceDefinitionMap = {}; | ||
@@ -66,2 +66,10 @@ let services : ServiceMap = {}; | ||
function callAfterSetup(app) { | ||
bundles.forEach((bundle : BundleType) => { | ||
if(typeof bundle.afterSetup === "function") { | ||
bundle.afterSetup(app); | ||
} | ||
}) | ||
} | ||
return { | ||
@@ -95,2 +103,3 @@ /** | ||
initialized = true; | ||
callAfterSetup(this); | ||
return; | ||
@@ -137,2 +146,4 @@ } | ||
initialized = true; | ||
callAfterSetup(this); | ||
}, | ||
@@ -139,0 +150,0 @@ |
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
107745
0
317
- Removedshaara-core@^0.1.0
- Removedshaara-core@0.1.0(transitive)