@rpcbase/cli 0.7.0 → 0.8.0
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": "@rpcbase/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"license": "SSPL-1.0",
|
|
5
5
|
"bin": {
|
|
6
6
|
"rb": "./bin.js"
|
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"bluebird": "3.7.2",
|
|
13
13
|
"chalk": "4.1.2",
|
|
14
|
-
"concurrently": "7.
|
|
14
|
+
"concurrently": "7.2.1",
|
|
15
15
|
"debug": "4.3.4",
|
|
16
|
-
"dotenv": "16.0.
|
|
17
|
-
"semver": "7.3.
|
|
16
|
+
"dotenv": "16.0.1",
|
|
17
|
+
"semver": "7.3.7",
|
|
18
18
|
"validator": "13.7.0",
|
|
19
|
-
"yargs": "17.
|
|
19
|
+
"yargs": "17.5.1"
|
|
20
20
|
}
|
|
21
21
|
}
|
package/src/default_command.js
CHANGED
|
@@ -5,16 +5,19 @@ const fs = require("fs")
|
|
|
5
5
|
const chalk = require("chalk")
|
|
6
6
|
const concurrently = require("concurrently")
|
|
7
7
|
|
|
8
|
+
const docker_runtime_check = require("./helpers/docker_runtime_check")
|
|
8
9
|
const exit_with_message = require("./helpers/exit_with_message")
|
|
9
10
|
const get_run_configs = require("./helpers/get_run_configs")
|
|
10
|
-
const docker_runtime_check = require("./helpers/docker_runtime_check")
|
|
11
11
|
const verify_project = require("./verify_project")
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
// TODO: nuke this
|
|
14
|
+
// server native + docker + docker-native is way too complex
|
|
15
|
+
// either everything is native, or everything is in docker
|
|
14
16
|
const default_command = async(args) => {
|
|
15
17
|
const run_configs = get_run_configs()
|
|
16
18
|
|
|
17
|
-
const run_commands =
|
|
19
|
+
const run_commands = []
|
|
20
|
+
run_configs.forEach((cfg) => {
|
|
18
21
|
let name
|
|
19
22
|
let command
|
|
20
23
|
let prefixColor
|
|
@@ -41,15 +44,16 @@ const default_command = async(args) => {
|
|
|
41
44
|
command = `${command} --coverage`
|
|
42
45
|
}
|
|
43
46
|
|
|
44
|
-
// command
|
|
45
|
-
|
|
47
|
+
// add command
|
|
48
|
+
run_commands.push({
|
|
46
49
|
name,
|
|
47
50
|
command,
|
|
48
51
|
prefixColor,
|
|
49
52
|
cwd: cfg.working_dir
|
|
50
|
-
}
|
|
53
|
+
})
|
|
51
54
|
})
|
|
52
55
|
|
|
56
|
+
// check if docker is running
|
|
53
57
|
if (run_configs.filter((c) => c.type === "server").length > 0) {
|
|
54
58
|
docker_runtime_check()
|
|
55
59
|
}
|
|
@@ -5,11 +5,11 @@ const fs = require("fs")
|
|
|
5
5
|
const ERRORS = require("../errors")
|
|
6
6
|
const exit_with_message = require("./exit_with_message")
|
|
7
7
|
|
|
8
|
-
|
|
9
8
|
// run type is client | server | both
|
|
10
9
|
const get_run_configs = () => {
|
|
11
10
|
const cwd = process.cwd()
|
|
12
11
|
|
|
12
|
+
|
|
13
13
|
// check if running parent of rb project
|
|
14
14
|
const dir_contents = fs.readdirSync(cwd)
|
|
15
15
|
const is_parent_dir = dir_contents.includes("client") && dir_contents.includes("server")
|
|
@@ -57,6 +57,8 @@ const get_run_configs = () => {
|
|
|
57
57
|
working_dir: path.join(cwd, "../infrastructure")
|
|
58
58
|
},
|
|
59
59
|
]
|
|
60
|
+
} else {
|
|
61
|
+
console.log("TODO: server get_run_configs:handle edge case here")
|
|
60
62
|
}
|
|
61
63
|
}
|
|
62
64
|
|