@rpcbase/cli 0.57.0 → 0.59.0-upgradenode20.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.59.0-upgradenode20.0",
|
|
4
4
|
"license": "SSPL-1.0",
|
|
5
5
|
"bin": {
|
|
6
6
|
"rb": "./bin.js"
|
|
@@ -8,6 +8,10 @@
|
|
|
8
8
|
"publishConfig": {
|
|
9
9
|
"registry": "https://registry.npmjs.org/"
|
|
10
10
|
},
|
|
11
|
+
"files": [
|
|
12
|
+
"src/",
|
|
13
|
+
"!src/**/*.test.js"
|
|
14
|
+
],
|
|
11
15
|
"scripts": {
|
|
12
16
|
"test": "echo \"no test specified exiting with code 0\" && exit 0"
|
|
13
17
|
},
|
|
@@ -2,15 +2,19 @@
|
|
|
2
2
|
const path = require("path")
|
|
3
3
|
const fs = require("fs")
|
|
4
4
|
const dotenv = require("dotenv")
|
|
5
|
-
const
|
|
5
|
+
const child_process = require("child_process")
|
|
6
|
+
const util = require("util")
|
|
6
7
|
|
|
7
8
|
const get_root_dir = require("./get_root_dir")
|
|
8
9
|
|
|
9
10
|
|
|
11
|
+
const exec = util.promisify(child_process.exec)
|
|
12
|
+
|
|
10
13
|
const TAILSCALE_PATH = "/Applications/Tailscale.app/Contents/MacOS/Tailscale"
|
|
11
14
|
|
|
12
15
|
const has_tailscale = process.platform === "darwin" && fs.existsSync(TAILSCALE_PATH)
|
|
13
16
|
|
|
17
|
+
|
|
14
18
|
const get_port = (run_configs) => {
|
|
15
19
|
const project_root_dir = get_root_dir(run_configs)
|
|
16
20
|
|
|
@@ -26,29 +30,48 @@ const get_port = (run_configs) => {
|
|
|
26
30
|
}
|
|
27
31
|
|
|
28
32
|
|
|
29
|
-
const
|
|
33
|
+
const check_status = async() => {
|
|
34
|
+
try {
|
|
35
|
+
const {stdout, stderr} = await exec(`${TAILSCALE_PATH} funnel status --json`)
|
|
36
|
+
const out = JSON.parse(stdout)
|
|
37
|
+
return typeof out === "object"
|
|
38
|
+
} catch (err) {
|
|
39
|
+
//
|
|
40
|
+
}
|
|
41
|
+
return false
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const start = async(run_configs) => {
|
|
30
45
|
if (!has_tailscale) return
|
|
31
46
|
|
|
47
|
+
const should_ts_start = await check_status()
|
|
48
|
+
|
|
49
|
+
if (!should_ts_start) return
|
|
50
|
+
|
|
32
51
|
const {server_port, wss_port} = get_port(run_configs)
|
|
33
52
|
try {
|
|
34
|
-
|
|
35
|
-
|
|
53
|
+
await exec(`${TAILSCALE_PATH} funnel --bg --set-path / --https=443 http://127.0.0.1:${server_port}`, {stdio: "inherit"})
|
|
54
|
+
if (wss_port) {
|
|
55
|
+
await exec(`${TAILSCALE_PATH} funnel --bg --set-path /wss --https=${wss_port} http://127.0.0.1:${wss_port}`, {stdio: "inherit"})
|
|
56
|
+
}
|
|
36
57
|
} catch (err) {
|
|
37
58
|
console.log("error starting tailscale, is the tailscale app running ?")
|
|
38
59
|
}
|
|
39
60
|
}
|
|
40
61
|
|
|
41
62
|
|
|
42
|
-
const stop = (run_configs) => {
|
|
63
|
+
const stop = async(run_configs) => {
|
|
43
64
|
if (!has_tailscale) return
|
|
44
65
|
|
|
45
66
|
const {server_port, wss_port} = get_port(run_configs)
|
|
46
67
|
try {
|
|
47
|
-
|
|
48
|
-
|
|
68
|
+
await exec(`${TAILSCALE_PATH} funnel --https=443 off`, {stdio: "inherit"})
|
|
69
|
+
if (wss_port) {
|
|
70
|
+
await exec(`${TAILSCALE_PATH} funnel --https=${wss_port} off`)
|
|
71
|
+
}
|
|
49
72
|
} catch (err) {
|
|
50
73
|
// console.log("TAILSCALE ERR", err)
|
|
51
|
-
console.log("error stopping tailscale, it probably wasn't initally running. you can
|
|
74
|
+
console.log("error stopping tailscale, it probably wasn't initally running. you can ignore it")
|
|
52
75
|
}
|
|
53
76
|
}
|
|
54
77
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"fullyTracked":false,"platform":"linux","arch":"x64","nodeVersion":"v18.19.0","command":"node ../../scripts/prflow/apply-prerelease-versions.js $BRANCH_NAME","extraArgs":[],"clean":true,"files":{},"output":[],"dependencies":{},"env":{}}
|
|
File without changes
|
|
File without changes
|
package/publish-output.txt
DELETED
|
File without changes
|