@toa.io/boot 1.0.0-alpha.225 → 1.0.0-alpha.227
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/src/bridge.js +10 -0
- package/src/component.js +2 -0
- package/src/index.js +2 -0
- package/src/rc.js +9 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toa.io/boot",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.227",
|
|
4
4
|
"description": "Toa Boot",
|
|
5
5
|
"author": "temich <tema.gurtovoy@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/toa-io/toa#readme",
|
|
@@ -20,14 +20,14 @@
|
|
|
20
20
|
"test": "echo \"Error: run tests from root\" && exit 1"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@toa.io/core": "1.0.0-alpha.
|
|
23
|
+
"@toa.io/core": "1.0.0-alpha.226",
|
|
24
24
|
"@toa.io/filesystem": "1.0.0-alpha.225",
|
|
25
25
|
"@toa.io/generic": "1.0.0-alpha.225",
|
|
26
|
-
"@toa.io/norm": "1.0.0-alpha.
|
|
26
|
+
"@toa.io/norm": "1.0.0-alpha.226",
|
|
27
27
|
"@toa.io/schemas": "1.0.0-alpha.225",
|
|
28
28
|
"clone-deep": "4.0.1",
|
|
29
29
|
"dotenv": "16.1.1",
|
|
30
30
|
"openspan": "1.0.0-alpha.173"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "1f6038e5c57f190cd1c04db7590f13651b909fb1"
|
|
33
33
|
}
|
package/src/bridge.js
CHANGED
|
@@ -13,6 +13,15 @@ const event = (bridge, path, label, context) => resolve(bridge).event(path, labe
|
|
|
13
13
|
const receiver = (bridge, path, label) => resolve(bridge).receiver(path, label)
|
|
14
14
|
const guard = (bridge, path, label, context) => resolve(bridge).guard(path, label, context)
|
|
15
15
|
|
|
16
|
+
async function rc (bridge, path, context) {
|
|
17
|
+
const factory = resolve(bridge)
|
|
18
|
+
|
|
19
|
+
if (factory.rc === undefined)
|
|
20
|
+
return
|
|
21
|
+
|
|
22
|
+
return factory.rc(path, context)
|
|
23
|
+
}
|
|
24
|
+
|
|
16
25
|
const factories = {}
|
|
17
26
|
|
|
18
27
|
const resolve = (bridge) => {
|
|
@@ -29,3 +38,4 @@ exports.algorithm = algorithm
|
|
|
29
38
|
exports.event = event
|
|
30
39
|
exports.receiver = receiver
|
|
31
40
|
exports.guard = guard
|
|
41
|
+
exports.rc = rc
|
package/src/component.js
CHANGED
|
@@ -24,8 +24,10 @@ const component = async (manifest) => {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
const operations = await bootOperations(manifest, context, state)
|
|
27
|
+
const rc = await boot.rc(manifest, context)
|
|
27
28
|
const component = new Component(locator, operations)
|
|
28
29
|
|
|
30
|
+
if (rc) component.depends(rc)
|
|
29
31
|
if (storage) component.depends(storage)
|
|
30
32
|
if (emission) component.depends(emission)
|
|
31
33
|
|
package/src/index.js
CHANGED
|
@@ -15,6 +15,7 @@ const { receivers, receive } = require('./receivers')
|
|
|
15
15
|
const { remote } = require('./remote')
|
|
16
16
|
const { storage } = require('./storage')
|
|
17
17
|
const { guards } = require('./guards')
|
|
18
|
+
const { rc } = require('./rc')
|
|
18
19
|
|
|
19
20
|
exports.bindings = require('./bindings')
|
|
20
21
|
exports.bridge = require('./bridge')
|
|
@@ -36,3 +37,4 @@ exports.receive = receive
|
|
|
36
37
|
exports.remote = remote
|
|
37
38
|
exports.storage = storage
|
|
38
39
|
exports.guards = guards
|
|
40
|
+
exports.rc = rc
|