buncargo 1.0.29 → 3.2.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/dist/bin.d.ts +1 -12
- package/dist/bin.js +261 -253
- package/dist/cli/bin.d.ts +13 -0
- package/dist/cli/bin.js +317 -0
- package/dist/cli/commands/help.d.ts +1 -0
- package/dist/cli/commands/runtime.d.ts +5 -0
- package/dist/cli/commands/version.d.ts +1 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +14 -0
- package/dist/cli/run-cli.d.ts +30 -0
- package/dist/cli.d.ts +1 -22
- package/dist/cli.js +5 -13
- package/dist/config/config.d.ts +1 -0
- package/dist/config/define-config.d.ts +13 -0
- package/dist/config/index.d.ts +3 -0
- package/dist/config/index.js +15 -0
- package/dist/config/merge-configs.d.ts +3 -0
- package/dist/config/validate-config.d.ts +3 -0
- package/dist/config.d.ts +1 -72
- package/dist/config.js +12 -12
- package/dist/core/docker.d.ts +1 -83
- package/dist/core/docker.js +35 -32
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +123 -118
- package/dist/core/network.js +2 -2
- package/dist/core/ports.js +1 -1
- package/dist/core/process.js +1 -1
- package/dist/core/quick-tunnel/cloudflared-process.d.ts +10 -0
- package/dist/core/quick-tunnel/constants.d.ts +9 -0
- package/dist/core/quick-tunnel/index.d.ts +17 -0
- package/dist/core/quick-tunnel/install.d.ts +1 -0
- package/dist/core/tunnel.d.ts +34 -0
- package/dist/core/utils.js +2 -2
- package/dist/core/watchdog-runner.js +45 -42
- package/dist/core/watchdog.d.ts +1 -0
- package/dist/core/watchdog.js +4 -2
- package/dist/docker/index.d.ts +1 -0
- package/dist/docker/index.js +38 -0
- package/dist/docker/runtime.d.ts +87 -0
- package/dist/docker/runtime.js +37 -0
- package/dist/docker-compose/compose.d.ts +1 -0
- package/dist/docker-compose/generated-file.d.ts +7 -0
- package/dist/docker-compose/index.d.ts +3 -0
- package/dist/docker-compose/index.js +15 -0
- package/dist/docker-compose/model.d.ts +6 -0
- package/dist/docker-compose/services/clickhouse.d.ts +16 -0
- package/dist/docker-compose/services/define-docker-service.d.ts +41 -0
- package/dist/docker-compose/services/index.d.ts +23 -0
- package/dist/docker-compose/services/index.js +17 -0
- package/dist/docker-compose/services/postgres.d.ts +12 -0
- package/dist/docker-compose/services/redis.d.ts +12 -0
- package/dist/docker-compose/services/shared.d.ts +7 -0
- package/dist/docker-compose/yaml.d.ts +2 -0
- package/dist/environment/create-dev-environment.d.ts +23 -0
- package/dist/environment/index.d.ts +1 -0
- package/dist/environment/index.js +15 -0
- package/dist/environment/logging.d.ts +17 -0
- package/dist/environment/only-apps.d.ts +10 -0
- package/dist/environment/seeding.d.ts +9 -0
- package/dist/environment.d.ts +1 -23
- package/dist/environment.js +12 -14
- package/dist/index-045jksh5.js +147 -0
- package/dist/index-08wa79cs.js +125 -117
- package/dist/index-0kxnae3z.js +335 -0
- package/dist/index-1mdrf7nz.js +51 -43
- package/dist/index-1yvbwj4k.js +262 -242
- package/dist/index-23ev345g.js +475 -0
- package/dist/index-2ckr49sf.js +228 -0
- package/dist/index-2f47khe5.js +376 -369
- package/dist/index-2fr3g85b.js +220 -183
- package/dist/index-38xnzpa6.js +450 -0
- package/dist/index-3eyrdxw9.js +577 -0
- package/dist/index-3h3dhtf2.js +51 -43
- package/dist/index-42x95209.js +51 -43
- package/dist/index-4gp0az1g.js +145 -0
- package/dist/index-4xrxh8yv.js +72 -0
- package/dist/index-5aq985p4.js +250 -0
- package/dist/index-5gmws6ah.js +181 -0
- package/dist/index-5hka0tff.js +78 -76
- package/dist/index-5rfqps4b.js +3 -0
- package/dist/index-5t9jxqm0.js +428 -0
- package/dist/index-6c1w1xk5.js +101 -0
- package/dist/index-6cmex7m5.js +72 -0
- package/dist/index-6d6x175r.js +572 -0
- package/dist/index-6fm7mvwj.js +118 -97
- package/dist/index-6srpc523.js +127 -128
- package/dist/index-731rzzfp.js +157 -142
- package/dist/index-75y4cg2z.js +51 -43
- package/dist/index-7ja4ywyj.js +126 -127
- package/dist/index-7v19es2e.js +666 -0
- package/dist/index-8bw1cmz4.js +531 -0
- package/dist/index-8hbbj1mp.js +120 -121
- package/dist/index-8xj2p5n5.js +118 -97
- package/dist/index-9wyhzw0h.js +574 -0
- package/dist/index-ag90ry8t.js +576 -0
- package/dist/index-bj79tw5w.js +0 -0
- package/dist/index-bnk6nr0g.js +73 -0
- package/dist/index-brbbzyks.js +72 -0
- package/dist/index-byeqyjrz.js +72 -0
- package/dist/index-c0dr6mcv.js +123 -0
- package/dist/index-cty0bcry.js +235 -218
- package/dist/index-d8tyv5se.js +228 -0
- package/dist/index-d9efy0n4.js +176 -150
- package/dist/index-enj4zdma.js +574 -0
- package/dist/index-etfmqjjf.js +427 -0
- package/dist/index-fb29934k.js +172 -0
- package/dist/index-g50jw1yf.js +72 -0
- package/dist/index-g6eb5wdw.js +118 -117
- package/dist/index-ggq3yryx.js +99 -95
- package/dist/index-h70tce00.js +177 -0
- package/dist/index-hkxtfqtc.js +333 -0
- package/dist/index-k370bech.js +72 -0
- package/dist/index-kf3dhser.js +146 -143
- package/dist/index-ma6tgdb2.js +500 -0
- package/dist/index-mam0bcyz.js +123 -0
- package/dist/index-mm412dkp.js +274 -0
- package/dist/index-n8v18aeb.js +0 -0
- package/dist/index-ndnmnsej.js +378 -371
- package/dist/index-p8wty0e2.js +389 -379
- package/dist/index-qa8akv6y.js +666 -0
- package/dist/index-qfphr2fd.js +78 -76
- package/dist/index-qqmms8rs.js +51 -43
- package/dist/index-qw4093g2.js +51 -43
- package/dist/index-qzwpzjbx.js +121 -122
- package/dist/index-segbnm0h.js +146 -143
- package/dist/index-t0fj6gg1.js +112 -0
- package/dist/index-thdkwnv7.js +122 -0
- package/dist/index-tjbx2r2t.js +270 -0
- package/dist/index-tjqw9vtj.js +62 -54
- package/dist/index-vbpb89jy.js +248 -0
- package/dist/index-vg55rq0y.js +250 -0
- package/dist/index-vhs88xhe.js +99 -95
- package/dist/index-vs81yaks.js +244 -0
- package/dist/index-w8zxnjka.js +249 -0
- package/dist/index-wk2na3t9.js +385 -375
- package/dist/index-wz9x8g7z.js +383 -373
- package/dist/index-x249gyde.js +388 -378
- package/dist/index-x54nbgs7.js +355 -0
- package/dist/index-xkvd0nsd.js +187 -0
- package/dist/index-yedqxm1z.js +80 -0
- package/dist/index-yz4jfz7z.js +338 -0
- package/dist/index-zfjzzjkf.js +240 -199
- package/dist/index.d.ts +12 -8
- package/dist/index.js +56 -34
- package/dist/lint.d.ts +1 -46
- package/dist/lint.js +3 -7
- package/dist/loader/cache.d.ts +4 -0
- package/dist/loader/find-config-file.d.ts +2 -0
- package/dist/loader/index.d.ts +5 -0
- package/dist/loader/index.js +24 -0
- package/dist/loader/load-dev-env.d.ts +5 -0
- package/dist/loader/loader.d.ts +1 -0
- package/dist/loader.d.ts +1 -45
- package/dist/loader.js +22 -20
- package/dist/prisma/index.d.ts +1 -0
- package/dist/prisma/prisma.d.ts +29 -0
- package/dist/prisma.d.ts +1 -29
- package/dist/prisma.js +6 -10
- package/dist/src/bin.js +309 -0
- package/dist/src/cli.js +5 -0
- package/dist/src/config.js +15 -0
- package/dist/src/core/docker.js +38 -0
- package/dist/src/core/index.js +130 -0
- package/dist/src/core/network.js +9 -0
- package/dist/src/core/ports.js +23 -0
- package/dist/src/core/process.js +31 -0
- package/dist/src/core/utils.js +11 -0
- package/dist/src/core/watchdog-runner.js +69 -0
- package/dist/src/core/watchdog.js +28 -0
- package/dist/src/docker/runtime.js +37 -0
- package/dist/src/docker-compose/index.js +16 -0
- package/dist/src/docker-compose/services/index.js +17 -0
- package/dist/src/environment.js +12 -0
- package/dist/src/index.js +122 -0
- package/dist/src/lint.js +3 -0
- package/dist/src/loader.js +25 -0
- package/dist/src/prisma.js +6 -0
- package/dist/src/types.js +0 -0
- package/dist/typecheck/index.d.ts +1 -0
- package/dist/typecheck/index.js +7 -0
- package/dist/typecheck/typecheck.d.ts +46 -0
- package/dist/types/all-types.d.ts +544 -0
- package/dist/types/cli.d.ts +1 -0
- package/dist/types/config.d.ts +6 -0
- package/dist/types/docker.d.ts +15 -0
- package/dist/types/environment.d.ts +8 -0
- package/dist/types/hooks.d.ts +9 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +0 -0
- package/dist/types/prisma.d.ts +1 -0
- package/dist/types.d.ts +1 -399
- package/package.json +55 -48
- package/readme.md +365 -109
- package/src/cli/bin.ts +77 -0
- package/src/cli/commands/help.ts +39 -0
- package/src/cli/commands/runtime.ts +72 -0
- package/src/cli/commands/version.ts +4 -0
- package/src/cli/index.ts +1 -0
- package/{cli.ts → src/cli/run-cli.ts} +114 -10
- package/src/config/define-config.ts +30 -0
- package/src/config/index.ts +3 -0
- package/src/config/merge-configs.ts +33 -0
- package/src/config/validate-config.ts +136 -0
- package/{core → src/core}/index.ts +2 -2
- package/{core → src/core}/ports.ts +5 -2
- package/{core → src/core}/process.ts +6 -2
- package/src/core/quick-tunnel/cloudflared-process.ts +83 -0
- package/src/core/quick-tunnel/constants.ts +31 -0
- package/src/core/quick-tunnel/index.ts +96 -0
- package/src/core/quick-tunnel/install.ts +160 -0
- package/src/core/tunnel.ts +165 -0
- package/{core → src/core}/utils.ts +1 -0
- package/{core → src/core}/watchdog.ts +5 -1
- package/src/docker/index.ts +1 -0
- package/{core/docker.ts → src/docker/runtime.ts} +11 -4
- package/src/docker-compose/generated-file.ts +45 -0
- package/src/docker-compose/index.ts +7 -0
- package/src/docker-compose/model.ts +197 -0
- package/src/docker-compose/services/clickhouse.ts +79 -0
- package/src/docker-compose/services/define-docker-service.ts +109 -0
- package/src/docker-compose/services/index.ts +67 -0
- package/src/docker-compose/services/postgres.ts +60 -0
- package/src/docker-compose/services/redis.ts +48 -0
- package/src/docker-compose/services/shared.ts +79 -0
- package/src/docker-compose/yaml.ts +88 -0
- package/{environment.ts → src/environment/create-dev-environment.ts} +214 -141
- package/src/environment/index.ts +1 -0
- package/src/environment/logging.ts +115 -0
- package/src/environment/only-apps.ts +34 -0
- package/src/environment/seeding.ts +57 -0
- package/{index.ts → src/index.ts} +52 -20
- package/src/loader/cache.ts +23 -0
- package/src/loader/find-config-file.ts +29 -0
- package/src/loader/index.ts +17 -0
- package/src/loader/load-dev-env.ts +38 -0
- package/src/prisma/index.ts +1 -0
- package/{prisma.ts → src/prisma/prisma.ts} +4 -2
- package/src/typecheck/index.ts +1 -0
- package/{types.ts → src/types/all-types.ts} +186 -8
- package/src/types/index.ts +1 -0
- package/bin.ts +0 -192
- package/config.ts +0 -194
- package/loader.ts +0 -126
- /package/{core → src/core}/network.ts +0 -0
- /package/{core → src/core}/watchdog-runner.ts +0 -0
- /package/{lint.ts → src/typecheck/typecheck.ts} +0 -0
package/dist/core/docker.js
CHANGED
|
@@ -1,35 +1,38 @@
|
|
|
1
|
+
import "../index-n8v18aeb.js";
|
|
1
2
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
import"../index-
|
|
19
|
-
import"../index-
|
|
3
|
+
areContainersRunning,
|
|
4
|
+
assertDockerRunning,
|
|
5
|
+
createBuiltInHealthCheck,
|
|
6
|
+
DOCKER_NOT_RUNNING_MESSAGE,
|
|
7
|
+
getComposeArg,
|
|
8
|
+
isContainerRunning,
|
|
9
|
+
isDockerRunning,
|
|
10
|
+
MAX_ATTEMPTS,
|
|
11
|
+
POLL_INTERVAL,
|
|
12
|
+
startContainers,
|
|
13
|
+
startService,
|
|
14
|
+
stopContainers,
|
|
15
|
+
waitForAllServices,
|
|
16
|
+
waitForService,
|
|
17
|
+
waitForServiceByType,
|
|
18
|
+
} from "../index-tjbx2r2t.js";
|
|
19
|
+
import "../index-4gp0az1g.js";
|
|
20
|
+
import "../index-xkvd0nsd.js";
|
|
21
|
+
import "../index-qnx9j3qa.js";
|
|
20
22
|
export {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
23
|
+
waitForServiceByType,
|
|
24
|
+
waitForService,
|
|
25
|
+
waitForAllServices,
|
|
26
|
+
stopContainers,
|
|
27
|
+
startService,
|
|
28
|
+
startContainers,
|
|
29
|
+
isDockerRunning,
|
|
30
|
+
isContainerRunning,
|
|
31
|
+
getComposeArg,
|
|
32
|
+
createBuiltInHealthCheck,
|
|
33
|
+
assertDockerRunning,
|
|
34
|
+
areContainersRunning,
|
|
35
|
+
POLL_INTERVAL,
|
|
36
|
+
MAX_ATTEMPTS,
|
|
37
|
+
DOCKER_NOT_RUNNING_MESSAGE,
|
|
35
38
|
};
|
package/dist/core/index.d.ts
CHANGED
package/dist/core/index.js
CHANGED
|
@@ -1,125 +1,130 @@
|
|
|
1
|
+
import "../index-n8v18aeb.js";
|
|
1
2
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
} from "../index-
|
|
3
|
+
getEnvVar,
|
|
4
|
+
getLocalIp,
|
|
5
|
+
isCI,
|
|
6
|
+
isPortAvailable,
|
|
7
|
+
logApiUrl,
|
|
8
|
+
logExpoApiUrl,
|
|
9
|
+
logFrontendPort,
|
|
10
|
+
sleep,
|
|
11
|
+
waitForDevServers,
|
|
12
|
+
waitForServer,
|
|
13
|
+
} from "../index-4gp0az1g.js";
|
|
13
14
|
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
stopProcess
|
|
27
|
-
} from "../index-1yvbwj4k.js";
|
|
15
|
+
getHeartbeatFile,
|
|
16
|
+
getWatchdogComposeArg,
|
|
17
|
+
getWatchdogPid,
|
|
18
|
+
getWatchdogPidFile,
|
|
19
|
+
isWatchdogRunning,
|
|
20
|
+
readHeartbeat,
|
|
21
|
+
removeHeartbeatFile,
|
|
22
|
+
spawnWatchdog,
|
|
23
|
+
startHeartbeat,
|
|
24
|
+
stopHeartbeat,
|
|
25
|
+
stopWatchdog,
|
|
26
|
+
} from "../index-mam0bcyz.js";
|
|
28
27
|
import {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
} from "../index-zfjzzjkf.js";
|
|
28
|
+
buildApps,
|
|
29
|
+
exec,
|
|
30
|
+
execAsync,
|
|
31
|
+
getProcessOnPort,
|
|
32
|
+
isPortInUse,
|
|
33
|
+
isProcessAlive,
|
|
34
|
+
killProcessesOnAppPorts,
|
|
35
|
+
killProcessOnPort,
|
|
36
|
+
killProcessOnPortAndWait,
|
|
37
|
+
spawnDevServer,
|
|
38
|
+
startDevServers,
|
|
39
|
+
stopAllProcesses,
|
|
40
|
+
stopProcess,
|
|
41
|
+
} from "../index-mm412dkp.js";
|
|
44
42
|
import {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
43
|
+
areContainersRunning,
|
|
44
|
+
assertDockerRunning,
|
|
45
|
+
createBuiltInHealthCheck,
|
|
46
|
+
DOCKER_NOT_RUNNING_MESSAGE,
|
|
47
|
+
getComposeArg,
|
|
48
|
+
isContainerRunning,
|
|
49
|
+
isDockerRunning,
|
|
50
|
+
MAX_ATTEMPTS,
|
|
51
|
+
POLL_INTERVAL,
|
|
52
|
+
startContainers,
|
|
53
|
+
startService,
|
|
54
|
+
stopContainers,
|
|
55
|
+
waitForAllServices,
|
|
56
|
+
waitForService,
|
|
57
|
+
waitForServiceByType,
|
|
58
|
+
} from "../index-tjbx2r2t.js";
|
|
56
59
|
import {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
} from "../index-
|
|
67
|
-
import"../index-qnx9j3qa.js";
|
|
60
|
+
calculatePortOffset,
|
|
61
|
+
computeDevIdentity,
|
|
62
|
+
computePorts,
|
|
63
|
+
computeUrls,
|
|
64
|
+
findMonorepoRoot,
|
|
65
|
+
getProjectName,
|
|
66
|
+
getWorktreeName,
|
|
67
|
+
getWorktreeProjectSuffix,
|
|
68
|
+
isWorktree,
|
|
69
|
+
} from "../index-xkvd0nsd.js";
|
|
70
|
+
import "../index-qnx9j3qa.js";
|
|
68
71
|
export {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
72
|
+
waitForServiceByType,
|
|
73
|
+
waitForService,
|
|
74
|
+
waitForServer,
|
|
75
|
+
waitForDevServers,
|
|
76
|
+
waitForAllServices,
|
|
77
|
+
stopWatchdog,
|
|
78
|
+
stopProcess,
|
|
79
|
+
stopHeartbeat,
|
|
80
|
+
stopContainers,
|
|
81
|
+
stopAllProcesses,
|
|
82
|
+
startService,
|
|
83
|
+
startHeartbeat,
|
|
84
|
+
startDevServers,
|
|
85
|
+
startContainers,
|
|
86
|
+
spawnWatchdog,
|
|
87
|
+
spawnDevServer,
|
|
88
|
+
sleep,
|
|
89
|
+
removeHeartbeatFile,
|
|
90
|
+
readHeartbeat,
|
|
91
|
+
logFrontendPort,
|
|
92
|
+
logExpoApiUrl,
|
|
93
|
+
logApiUrl,
|
|
94
|
+
killProcessesOnAppPorts,
|
|
95
|
+
killProcessOnPortAndWait,
|
|
96
|
+
killProcessOnPort,
|
|
97
|
+
isWorktree,
|
|
98
|
+
isWatchdogRunning,
|
|
99
|
+
isProcessAlive,
|
|
100
|
+
isPortInUse,
|
|
101
|
+
isPortAvailable,
|
|
102
|
+
isDockerRunning,
|
|
103
|
+
isContainerRunning,
|
|
104
|
+
isCI,
|
|
105
|
+
getWorktreeProjectSuffix,
|
|
106
|
+
getWorktreeName,
|
|
107
|
+
getWatchdogPidFile,
|
|
108
|
+
getWatchdogPid,
|
|
109
|
+
getWatchdogComposeArg,
|
|
110
|
+
getProjectName,
|
|
111
|
+
getProcessOnPort,
|
|
112
|
+
getLocalIp,
|
|
113
|
+
getHeartbeatFile,
|
|
114
|
+
getEnvVar,
|
|
115
|
+
getComposeArg,
|
|
116
|
+
findMonorepoRoot,
|
|
117
|
+
execAsync,
|
|
118
|
+
exec,
|
|
119
|
+
createBuiltInHealthCheck,
|
|
120
|
+
computeUrls,
|
|
121
|
+
computePorts,
|
|
122
|
+
computeDevIdentity,
|
|
123
|
+
calculatePortOffset,
|
|
124
|
+
buildApps,
|
|
125
|
+
assertDockerRunning,
|
|
126
|
+
areContainersRunning,
|
|
127
|
+
POLL_INTERVAL,
|
|
128
|
+
MAX_ATTEMPTS,
|
|
129
|
+
DOCKER_NOT_RUNNING_MESSAGE,
|
|
125
130
|
};
|
package/dist/core/network.js
CHANGED
package/dist/core/ports.js
CHANGED
package/dist/core/process.js
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spawn cloudflared and parse the quick-tunnel public URL from output.
|
|
3
|
+
* Derived from unjs/untun (MIT), originally forked from node-cloudflared.
|
|
4
|
+
*/
|
|
5
|
+
import { type ChildProcess } from "node:child_process";
|
|
6
|
+
export declare function startCloudflaredTunnel(options: Record<string, string | number | null>): {
|
|
7
|
+
url: Promise<string>;
|
|
8
|
+
child: ChildProcess;
|
|
9
|
+
stop: () => boolean;
|
|
10
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Paths and release metadata for the cloudflared binary.
|
|
3
|
+
* Derived from unjs/untun (MIT), originally forked from node-cloudflared.
|
|
4
|
+
*/
|
|
5
|
+
export declare const CLOUDFLARED_VERSION: string;
|
|
6
|
+
export declare const RELEASE_BASE = "https://github.com/cloudflare/cloudflared/releases/";
|
|
7
|
+
/** Directory for buncargo-managed cloudflared (avoid clashing with untun's node-untun). */
|
|
8
|
+
export declare const cloudflaredBinPath: string;
|
|
9
|
+
export declare const cloudflaredNotice = "\n\uD83D\uDD25 Your installation of cloudflared software constitutes a symbol of your signature\n indicating that you accept the terms of the Cloudflare License, Terms and Privacy Policy.\n\n\u276F License: `https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/downloads/license/`\n\u276F Terms: `https://www.cloudflare.com/terms/`\n\u276F Privacy Policy: `https://www.cloudflare.com/privacypolicy/`\n";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface QuickTunnelOptions {
|
|
2
|
+
url?: string;
|
|
3
|
+
port?: number | string;
|
|
4
|
+
hostname?: string;
|
|
5
|
+
protocol?: "http" | "https";
|
|
6
|
+
verifyTLS?: boolean;
|
|
7
|
+
acceptCloudflareNotice?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface QuickTunnel {
|
|
10
|
+
getURL: () => Promise<string>;
|
|
11
|
+
close: () => Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Start a Cloudflare quick tunnel to a local HTTP(S) URL.
|
|
15
|
+
* Returns undefined if the user declines the cloudflared install (when binary is missing).
|
|
16
|
+
*/
|
|
17
|
+
export declare function startQuickTunnel(opts: QuickTunnelOptions): Promise<QuickTunnel | undefined>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function installCloudflared(to?: string, version?: string): Promise<string>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { AppConfig, DevEnvironment, ServiceConfig } from "../types";
|
|
2
|
+
export interface PublicExposeTarget {
|
|
3
|
+
kind: "service" | "app";
|
|
4
|
+
name: string;
|
|
5
|
+
port: number;
|
|
6
|
+
}
|
|
7
|
+
export interface PublicTunnel {
|
|
8
|
+
kind: "service" | "app";
|
|
9
|
+
name: string;
|
|
10
|
+
localUrl: string;
|
|
11
|
+
publicUrl: string;
|
|
12
|
+
close: () => Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
interface TunnelBackendResult {
|
|
15
|
+
getURL?: () => Promise<string>;
|
|
16
|
+
url?: string;
|
|
17
|
+
publicUrl?: string;
|
|
18
|
+
tunnelUrl?: string;
|
|
19
|
+
close?: () => void | Promise<void>;
|
|
20
|
+
stop?: () => void | Promise<void>;
|
|
21
|
+
destroy?: () => void | Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
export declare function resolveExposeTargets<TServices extends Record<string, ServiceConfig>, TApps extends Record<string, AppConfig>>(env: DevEnvironment<TServices, TApps>, exposeValue?: string): {
|
|
24
|
+
targets: PublicExposeTarget[];
|
|
25
|
+
unknownNames: string[];
|
|
26
|
+
notEnabledNames: string[];
|
|
27
|
+
};
|
|
28
|
+
export declare function startPublicTunnels(targets: PublicExposeTarget[], options?: {
|
|
29
|
+
start?: (input: {
|
|
30
|
+
url: string;
|
|
31
|
+
}) => Promise<TunnelBackendResult | undefined>;
|
|
32
|
+
}): Promise<PublicTunnel[]>;
|
|
33
|
+
export declare function stopPublicTunnels(tunnels: PublicTunnel[]): Promise<void>;
|
|
34
|
+
export {};
|
package/dist/core/utils.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
// core/watchdog-runner.ts
|
|
1
|
+
// src/core/watchdog-runner.ts
|
|
2
2
|
import { execSync } from "node:child_process";
|
|
3
3
|
import { existsSync, readFileSync, unlinkSync, writeFileSync } from "node:fs";
|
|
4
|
+
|
|
4
5
|
var PROJECT_NAME = process.env.WATCHDOG_PROJECT_NAME ?? "";
|
|
5
6
|
var HEARTBEAT_FILE = process.env.WATCHDOG_HEARTBEAT_FILE ?? "";
|
|
6
7
|
var PID_FILE = process.env.WATCHDOG_PID_FILE ?? "";
|
|
@@ -8,59 +9,61 @@ var IDLE_TIMEOUT = parseInt(process.env.WATCHDOG_TIMEOUT_MS ?? "600000", 10);
|
|
|
8
9
|
var COMPOSE_ARG = process.env.WATCHDOG_COMPOSE_ARG ?? "";
|
|
9
10
|
var CHECK_INTERVAL = 60000;
|
|
10
11
|
if (!PROJECT_NAME || !HEARTBEAT_FILE || !PID_FILE) {
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
console.error("[watchdog] Missing required environment variables");
|
|
13
|
+
process.exit(1);
|
|
13
14
|
}
|
|
14
15
|
var heartbeatFile = HEARTBEAT_FILE;
|
|
15
16
|
var pidFile = PID_FILE;
|
|
16
17
|
writeFileSync(pidFile, process.pid.toString());
|
|
17
18
|
function cleanup() {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
try {
|
|
20
|
+
unlinkSync(pidFile);
|
|
21
|
+
} catch {}
|
|
22
|
+
try {
|
|
23
|
+
unlinkSync(heartbeatFile);
|
|
24
|
+
} catch {}
|
|
24
25
|
}
|
|
25
26
|
process.on("SIGTERM", () => {
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
cleanup();
|
|
28
|
+
process.exit(0);
|
|
28
29
|
});
|
|
29
30
|
process.on("SIGINT", () => {
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
cleanup();
|
|
32
|
+
process.exit(0);
|
|
32
33
|
});
|
|
33
34
|
console.log(`[watchdog] Started for ${PROJECT_NAME} (PID: ${process.pid})`);
|
|
34
35
|
console.log(`[watchdog] Idle timeout: ${IDLE_TIMEOUT / 60000} minutes`);
|
|
35
36
|
async function watchdog() {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
37
|
+
while (true) {
|
|
38
|
+
await new Promise((r) => setTimeout(r, CHECK_INTERVAL));
|
|
39
|
+
if (!existsSync(heartbeatFile)) {
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
let lastBeat;
|
|
43
|
+
try {
|
|
44
|
+
const content = readFileSync(heartbeatFile, "utf-8");
|
|
45
|
+
lastBeat = parseInt(content, 10);
|
|
46
|
+
} catch {
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
if (Number.isNaN(lastBeat)) {
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
const elapsed = Date.now() - lastBeat;
|
|
53
|
+
if (elapsed > IDLE_TIMEOUT) {
|
|
54
|
+
console.log(
|
|
55
|
+
`[watchdog] No heartbeat for ${Math.ceil(elapsed / 60000)} minutes, shutting down...`,
|
|
56
|
+
);
|
|
57
|
+
try {
|
|
58
|
+
execSync(`docker compose ${COMPOSE_ARG} down`.trim(), {
|
|
59
|
+
env: { ...process.env, COMPOSE_PROJECT_NAME: PROJECT_NAME },
|
|
60
|
+
stdio: "ignore",
|
|
61
|
+
});
|
|
62
|
+
} catch {}
|
|
63
|
+
console.log("[watchdog] Containers stopped");
|
|
64
|
+
cleanup();
|
|
65
|
+
process.exit(0);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
65
68
|
}
|
|
66
69
|
watchdog();
|
package/dist/core/watchdog.d.ts
CHANGED
|
@@ -35,6 +35,7 @@ export declare function getWatchdogPid(projectName: string): number | null;
|
|
|
35
35
|
* Spawn watchdog as a detached process.
|
|
36
36
|
* The watchdog monitors the heartbeat file and shuts down containers after idle timeout.
|
|
37
37
|
*/
|
|
38
|
+
export declare function getWatchdogComposeArg(composeFile?: string): string;
|
|
38
39
|
export declare function spawnWatchdog(projectName: string, root: string, options?: {
|
|
39
40
|
timeoutMinutes?: number;
|
|
40
41
|
verbose?: boolean;
|
package/dist/core/watchdog.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getHeartbeatFile,
|
|
3
|
+
getWatchdogComposeArg,
|
|
3
4
|
getWatchdogPid,
|
|
4
5
|
getWatchdogPidFile,
|
|
5
6
|
isWatchdogRunning,
|
|
@@ -9,8 +10,8 @@ import {
|
|
|
9
10
|
startHeartbeat,
|
|
10
11
|
stopHeartbeat,
|
|
11
12
|
stopWatchdog
|
|
12
|
-
} from "../index-
|
|
13
|
-
import"../index-
|
|
13
|
+
} from "../index-mam0bcyz.js";
|
|
14
|
+
import"../index-mm412dkp.js";
|
|
14
15
|
import"../index-qnx9j3qa.js";
|
|
15
16
|
export {
|
|
16
17
|
stopWatchdog,
|
|
@@ -22,5 +23,6 @@ export {
|
|
|
22
23
|
isWatchdogRunning,
|
|
23
24
|
getWatchdogPidFile,
|
|
24
25
|
getWatchdogPid,
|
|
26
|
+
getWatchdogComposeArg,
|
|
25
27
|
getHeartbeatFile
|
|
26
28
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./runtime";
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import"../index-bj79tw5w.js";
|
|
2
|
+
import {
|
|
3
|
+
DOCKER_NOT_RUNNING_MESSAGE,
|
|
4
|
+
MAX_ATTEMPTS,
|
|
5
|
+
POLL_INTERVAL,
|
|
6
|
+
areContainersRunning,
|
|
7
|
+
assertDockerRunning,
|
|
8
|
+
createBuiltInHealthCheck,
|
|
9
|
+
getComposeArg,
|
|
10
|
+
isContainerRunning,
|
|
11
|
+
isDockerRunning,
|
|
12
|
+
startContainers,
|
|
13
|
+
startService,
|
|
14
|
+
stopContainers,
|
|
15
|
+
waitForAllServices,
|
|
16
|
+
waitForService,
|
|
17
|
+
waitForServiceByType
|
|
18
|
+
} from "../index-d8tyv5se.js";
|
|
19
|
+
import"../index-c0dr6mcv.js";
|
|
20
|
+
import"../index-fb29934k.js";
|
|
21
|
+
import"../index-qnx9j3qa.js";
|
|
22
|
+
export {
|
|
23
|
+
waitForServiceByType,
|
|
24
|
+
waitForService,
|
|
25
|
+
waitForAllServices,
|
|
26
|
+
stopContainers,
|
|
27
|
+
startService,
|
|
28
|
+
startContainers,
|
|
29
|
+
isDockerRunning,
|
|
30
|
+
isContainerRunning,
|
|
31
|
+
getComposeArg,
|
|
32
|
+
createBuiltInHealthCheck,
|
|
33
|
+
assertDockerRunning,
|
|
34
|
+
areContainersRunning,
|
|
35
|
+
POLL_INTERVAL,
|
|
36
|
+
MAX_ATTEMPTS,
|
|
37
|
+
DOCKER_NOT_RUNNING_MESSAGE
|
|
38
|
+
};
|