@toa.io/bridges.node 1.0.0-alpha.37 → 1.0.0-alpha.39

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toa.io/bridges.node",
3
- "version": "1.0.0-alpha.37",
3
+ "version": "1.0.0-alpha.39",
4
4
  "description": "Toa Node Bridge (inproc)",
5
5
  "homepage": "https://toa.io",
6
6
  "author": {
@@ -26,14 +26,14 @@
26
26
  "test": "echo \"Error: run tests from root\" && exit 1"
27
27
  },
28
28
  "dependencies": {
29
- "@toa.io/core": "1.0.0-alpha.37",
30
- "@toa.io/filesystem": "1.0.0-alpha.37",
31
- "@toa.io/generic": "1.0.0-alpha.37",
29
+ "@toa.io/core": "1.0.0-alpha.39",
30
+ "@toa.io/filesystem": "1.0.0-alpha.39",
31
+ "@toa.io/generic": "1.0.0-alpha.39",
32
32
  "fast-glob": "3.2.7",
33
33
  "matchacho": "0.3.5"
34
34
  },
35
35
  "devDependencies": {
36
36
  "clone-deep": "4.0.1"
37
37
  },
38
- "gitHead": "e78a9aedb64a52dc34b9271fd90791934863d0a6"
38
+ "gitHead": "d9c966c3f8c95c59768e14c61e97d0aeee5ea61f"
39
39
  }
package/readme.md CHANGED
@@ -72,7 +72,7 @@ it defines operation's `scope`.
72
72
 
73
73
  ```javascript
74
74
  class ObjectTransitionFactory {
75
- create () {
75
+ async create () {
76
76
  // ...
77
77
  }
78
78
  }
package/src/factory.js CHANGED
@@ -8,7 +8,7 @@ const { Context } = require('./context')
8
8
  const { extract } = require('./define/operations')
9
9
 
10
10
  class Factory {
11
- algorithm (root, name, context) {
11
+ async algorithm (root, name, context) {
12
12
  const module = load.operation(root, name)
13
13
  const ctx = new Context(context)
14
14
 
@@ -36,11 +36,11 @@ class Factory {
36
36
  * @param {toa.node.Context} context
37
37
  * @returns {Runner}
38
38
  */
39
- function runner (module, context) {
39
+ async function runner (module, context) {
40
40
  const descriptor = extract(module)
41
41
  const func = module[descriptor.name]
42
42
  const factory = require('./algorithms/' + descriptor.syntax)
43
- const instance = factory.create(func)
43
+ const instance = await factory.create(func)
44
44
 
45
45
  return new Runner(instance, context)
46
46
  }
@@ -26,7 +26,7 @@ it('should be', () => {
26
26
 
27
27
  for (const sample of ['fn', 'cls', 'fct']) {
28
28
  it(`should create '${sample}' operation`, async () => {
29
- const algorithm = factory.algorithm(root, sample, context)
29
+ const algorithm = await factory.algorithm(root, sample, context)
30
30
 
31
31
  expect(algorithm).toBeDefined()
32
32