@toa.io/cli 0.24.0-alpha.2 → 0.24.0-alpha.4

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/cli",
3
- "version": "0.24.0-alpha.2",
3
+ "version": "0.24.0-alpha.4",
4
4
  "description": "Toa CLI",
5
5
  "author": "temich <tema.gurtovoy@gmail.com>",
6
6
  "homepage": "https://github.com/toa-io/toa#readme",
@@ -22,15 +22,15 @@
22
22
  "@toa.io/runtime": "*"
23
23
  },
24
24
  "dependencies": {
25
- "@toa.io/console": "0.24.0-alpha.2",
26
- "@toa.io/generic": "0.24.0-alpha.2",
27
- "@toa.io/kubernetes": "0.24.0-alpha.2",
28
- "@toa.io/norm": "0.24.0-alpha.2",
29
- "@toa.io/yaml": "0.24.0-alpha.2",
25
+ "@toa.io/console": "0.24.0-alpha.4",
26
+ "@toa.io/generic": "0.24.0-alpha.4",
27
+ "@toa.io/kubernetes": "0.24.0-alpha.4",
28
+ "@toa.io/norm": "0.24.0-alpha.4",
29
+ "@toa.io/yaml": "0.24.0-alpha.4",
30
30
  "dotenv": "16.1.1",
31
31
  "find-up": "5.0.0",
32
32
  "paseto": "3.1.4",
33
33
  "yargs": "17.6.2"
34
34
  },
35
- "gitHead": "36cea9ed2e8add73748dc921b670ec92a227fed4"
35
+ "gitHead": "41f549ae652b625d65f4ba12ea1025f0214fdb0f"
36
36
  }
@@ -1,12 +1,11 @@
1
1
  'use strict'
2
2
 
3
- const boot = require('@toa.io/boot')
4
-
5
3
  const { context: find } = require('../util/find')
4
+ const operations = require('./operations')
6
5
 
7
6
  const build = async (argv) => {
8
7
  const path = find(argv.path)
9
- const registry = await boot.registry(path)
8
+ const registry = await operations.registry(path)
10
9
 
11
10
  await registry.build()
12
11
  }
@@ -1,9 +1,9 @@
1
1
  'use strict'
2
2
 
3
3
  const { secrets } = require('@toa.io/kubernetes')
4
- const boot = require('@toa.io/boot')
5
4
  const { context: find } = require('../util/find')
6
5
  const { promptSecrets } = require('./env')
6
+ const operations = require('./operations')
7
7
 
8
8
  const conceal = async (argv) => {
9
9
  if (argv.interactive) await concealValues(argv)
@@ -28,7 +28,7 @@ async function concealValue (argv) {
28
28
 
29
29
  async function concealValues (argv) {
30
30
  const path = find(argv.path)
31
- const operator = await boot.deployment(path, argv.environment)
31
+ const operator = await operations.operator(path, argv.environment)
32
32
  const variables = operator.variables()
33
33
  const values = await promptSecrets(variables)
34
34
  const groups = groupValues(values)
@@ -1,7 +1,6 @@
1
1
  'use strict'
2
2
 
3
- const boot = require('@toa.io/boot')
4
-
3
+ const operations = require('./operations')
5
4
  const { context: find } = require('../util/find')
6
5
 
7
6
  /**
@@ -10,7 +9,7 @@ const { context: find } = require('../util/find')
10
9
  */
11
10
  const deploy = async (argv) => {
12
11
  const path = find(argv.path)
13
- const operator = await boot.deployment(path, argv.environment)
12
+ const operator = await operations.operator(path, argv.environment)
14
13
 
15
14
  if (argv.dry === true) {
16
15
  const options = {}
@@ -3,16 +3,15 @@
3
3
  const { join } = require('node:path')
4
4
  const readline = require('node:readline/promises')
5
5
  const { stdin: input, stdout: output } = require('node:process')
6
-
7
6
  const dotenv = require('dotenv')
8
7
  const { file } = require('@toa.io/filesystem')
9
- const boot = require('@toa.io/boot')
8
+ const operations = require('./operations')
10
9
  const { context: find } = require('../util/find')
11
10
 
12
11
  async function env (argv) {
13
12
  const path = find(argv.path)
14
13
  const filepath = join(path, argv.as)
15
- const operator = await boot.deployment(path, argv.environment)
14
+ const operator = await operations.operator(path, argv.environment)
16
15
  const variables = operator.variables()
17
16
  const currentValues = await read(filepath)
18
17
 
@@ -1,20 +1,19 @@
1
1
  'use strict'
2
2
 
3
- const boot = require('@toa.io/boot')
4
3
  const { console } = require('@toa.io/console')
5
-
6
4
  const { context: find } = require('../../util/find')
5
+ const operations = require('../operations')
7
6
 
8
7
  /**
9
8
  * @param {{ path: string, target: string, environment?: string }} argv
10
9
  * @returns {Promise<void>}
11
10
  */
12
11
  const dump = async (argv) => {
13
- const context = find(argv.path)
14
- const operator = await boot.deployment(context, argv.environment)
15
- const path = await operator.export(argv.target)
12
+ const path = find(argv.path)
13
+ const operator = await operations.operator(path, argv.environment)
14
+ const target = await operator.export(argv.target)
16
15
 
17
- console.log(path)
16
+ console.log(target)
18
17
  }
19
18
 
20
19
  exports.dump = dump
@@ -1,24 +1,15 @@
1
1
  'use strict'
2
2
 
3
- const boot = require('@toa.io/boot')
4
3
  const { console } = require('@toa.io/console')
5
-
6
4
  const { context: find } = require('../../util/find')
5
+ const operations = require('../operations')
7
6
 
8
7
  const prepare = async (argv) => {
9
- const context = find(argv.path)
10
- const operator = await boot.deployment(context)
11
- const path = await operator.prepare(argv.target)
8
+ const path = find(argv.path)
9
+ const operator = await operations.operator(path, argv.environment)
10
+ const target = await operator.prepare(argv.target)
12
11
 
13
- console.log(path)
12
+ console.log(target)
14
13
  }
15
14
 
16
- // const prepare = async (argv) => {
17
- // const context = find(argv.path)
18
- // const registry = await boot.registry(context)
19
- // const path = await registry.prepare(argv.target)
20
- //
21
- // console.log(path)
22
- // }
23
-
24
15
  exports.prepare = prepare
@@ -0,0 +1,7 @@
1
+ 'use strict'
2
+
3
+ const { operator } = require('./operator')
4
+ const { registry } = require('./registry')
5
+
6
+ exports.operator = operator
7
+ exports.registry = registry
@@ -0,0 +1,13 @@
1
+ 'use strict'
2
+
3
+ const { context: load } = require('@toa.io/norm')
4
+ const { deployment: { Factory } } = require('@toa.io/operations')
5
+
6
+ async function operator (path, environment) {
7
+ const context = await load(path, environment)
8
+ const factory = new Factory(context)
9
+
10
+ return factory.operator()
11
+ }
12
+
13
+ exports.operator = operator
@@ -0,0 +1,13 @@
1
+ 'use strict'
2
+
3
+ const { context: load } = require('@toa.io/norm')
4
+ const { deployment: { Factory } } = require('@toa.io/operations')
5
+
6
+ async function registry (path) {
7
+ const context = await load(path)
8
+ const factory = new Factory(context)
9
+
10
+ return factory.registry()
11
+ }
12
+
13
+ exports.registry = registry
@@ -1,12 +1,11 @@
1
1
  'use strict'
2
2
 
3
- const boot = require('@toa.io/boot')
4
-
3
+ const operations = require('./operations')
5
4
  const { context: find } = require('../util/find')
6
5
 
7
6
  const push = async (argv) => {
8
7
  const path = find(argv.path)
9
- const registry = await boot.registry(path)
8
+ const registry = await operations.registry(path)
10
9
 
11
10
  await registry.push()
12
11
  }