@toa.io/boot 1.1.0-dev.1 → 1.1.0-dev.2

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/boot",
3
- "version": "1.1.0-dev.1",
3
+ "version": "1.1.0-dev.2",
4
4
  "description": "Toa Boot",
5
5
  "author": "temich <tema.gurtovoy@gmail.com>",
6
6
  "homepage": "https://github.com/toa-io/toa#readme",
@@ -19,13 +19,13 @@
19
19
  "test": "echo \"Error: run tests from root\" && exit 1"
20
20
  },
21
21
  "dependencies": {
22
- "@toa.io/core": "1.1.0-dev.15",
23
- "@toa.io/filesystem": "1.1.0-dev.1",
24
- "@toa.io/generic": "0.11.0-dev.15",
25
- "@toa.io/norm": "1.0.2-dev.15",
26
- "@toa.io/schema": "0.7.6-dev.15",
22
+ "@toa.io/core": "1.1.0-dev.16",
23
+ "@toa.io/filesystem": "1.1.0-dev.2",
24
+ "@toa.io/generic": "0.11.0-dev.16",
25
+ "@toa.io/norm": "1.1.0-dev.0",
26
+ "@toa.io/schema": "0.7.6-dev.16",
27
27
  "clone-deep": "4.0.1",
28
28
  "dotenv": "16.0.3"
29
29
  },
30
- "gitHead": "f479f6e79d5caaa207da4d0a3192425def1abf75"
30
+ "gitHead": "669be360acebac4dbe49735ec506127d9d0a05e3"
31
31
  }
package/src/deployment.js CHANGED
@@ -9,10 +9,26 @@ const { context: load } = require('@toa.io/norm')
9
9
  * @returns {Promise<toa.deployment.Operator>}
10
10
  */
11
11
  const deployment = async (path, environment) => {
12
- const context = await load(path, environment)
13
- const factory = new Factory(context)
12
+ const factory = await getFactory(path, environment)
14
13
 
15
14
  return factory.operator()
16
15
  }
17
16
 
17
+ /**
18
+ * @param {string} path
19
+ * @returns {Promise<toa.deployment.Registry>}
20
+ */
21
+ const registry = async (path) => {
22
+ const factory = await getFactory(path)
23
+
24
+ return factory.registry()
25
+ }
26
+
27
+ async function getFactory (path, environment) {
28
+ const context = await load(path, environment)
29
+
30
+ return new Factory(context)
31
+ }
32
+
18
33
  exports.deployment = deployment
34
+ exports.registry = registry
package/src/index.js CHANGED
@@ -7,7 +7,7 @@ const { cascade } = require('./cascade')
7
7
  const { component } = require('./component')
8
8
  const { composition } = require('./composition')
9
9
  const { context } = require('./context')
10
- const { deployment } = require('./deployment')
10
+ const { deployment, registry } = require('./deployment')
11
11
  const { emission } = require('./emission')
12
12
  const { exposition } = require('./exposition')
13
13
  const { images } = require('./images')
@@ -35,5 +35,6 @@ exports.images = images
35
35
  exports.manifest = manifest
36
36
  exports.operation = operation
37
37
  exports.receivers = receivers
38
+ exports.registry = registry
38
39
  exports.remote = remote
39
40
  exports.storage = storage