@rpcbase/cli 0.30.0 → 0.32.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
|
@@ -9,9 +9,12 @@ const get_root_dir = require("./get_root_dir")
|
|
|
9
9
|
|
|
10
10
|
const TAILSCALE_PATH = "/Applications/Tailscale.app/Contents/MacOS/Tailscale"
|
|
11
11
|
|
|
12
|
+
const has_tailscale = process.platform === "darwin" && fs.existsSync(TAILSCALE_PATH)
|
|
13
|
+
|
|
12
14
|
const get_port = (run_configs) => {
|
|
13
15
|
const project_root_dir = get_root_dir(run_configs)
|
|
14
16
|
|
|
17
|
+
// TODO: should join w/ .env.base
|
|
15
18
|
const server_env_path = path.join(project_root_dir, "./server/server/.env")
|
|
16
19
|
|
|
17
20
|
const server_env_buf = fs.readFileSync(server_env_path)
|
|
@@ -25,6 +28,8 @@ const get_port = (run_configs) => {
|
|
|
25
28
|
|
|
26
29
|
|
|
27
30
|
const start = (run_configs) => {
|
|
31
|
+
if (!has_tailscale) return
|
|
32
|
+
|
|
28
33
|
const {server_port, wss_port} = get_port(run_configs)
|
|
29
34
|
try {
|
|
30
35
|
execSync(`${TAILSCALE_PATH} serve https:443 /wss http://127.0.0.1:${wss_port}`, {stdio: "inherit"})
|
|
@@ -37,6 +42,8 @@ const start = (run_configs) => {
|
|
|
37
42
|
|
|
38
43
|
|
|
39
44
|
const stop = (run_configs) => {
|
|
45
|
+
if (!has_tailscale) return
|
|
46
|
+
|
|
40
47
|
const {server_port, wss_port} = get_port(run_configs)
|
|
41
48
|
try {
|
|
42
49
|
execSync(`${TAILSCALE_PATH} serve https:443 /wss http://127.0.0.1:${wss_port} off`, {stdio: "inherit"})
|
package/src/start_command.js
CHANGED
|
@@ -6,6 +6,8 @@ const colors = require("picocolors")
|
|
|
6
6
|
const concurrently = require("concurrently")
|
|
7
7
|
const {exec} = require("child_process")
|
|
8
8
|
|
|
9
|
+
const {hideBin} = require("yargs/helpers")
|
|
10
|
+
|
|
9
11
|
const docker_runtime_check = require("./helpers/docker_runtime_check")
|
|
10
12
|
const exit_with_message = require("./helpers/exit_with_message")
|
|
11
13
|
const get_run_configs = require("./helpers/get_run_configs")
|
|
@@ -44,15 +46,7 @@ const start_command = async(args) => {
|
|
|
44
46
|
|
|
45
47
|
// pass through listed args to client and server
|
|
46
48
|
if (["client", "server"].includes(cfg.type)) {
|
|
47
|
-
|
|
48
|
-
command = `${command} --coverage`
|
|
49
|
-
}
|
|
50
|
-
if (args.debug) {
|
|
51
|
-
command = `${command} --debug`
|
|
52
|
-
}
|
|
53
|
-
if (args.verbose) {
|
|
54
|
-
command = `${command} --verbose`
|
|
55
|
-
}
|
|
49
|
+
command = `${command} ${hideBin(process.argv).join(" ")}`
|
|
56
50
|
}
|
|
57
51
|
|
|
58
52
|
|