@kosdev-code/kos-ui-cli 2.1.29 → 2.1.31
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": "@kosdev-code/kos-ui-cli",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.31",
|
|
4
4
|
"bin": {
|
|
5
5
|
"kosui": "./src/lib/cli.mjs"
|
|
6
6
|
},
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"main": "./src/index.js",
|
|
23
23
|
"kos": {
|
|
24
24
|
"build": {
|
|
25
|
-
"gitHash": "
|
|
25
|
+
"gitHash": "292ed660445b69d5a70bd9b40e6f910b97b19867"
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"publishConfig": {
|
|
@@ -66,14 +66,14 @@ async function checkPortHealth(port, endpoint = "/api/kos/ui/plugins/contexts")
|
|
|
66
66
|
/**
|
|
67
67
|
* Wait for server to be ready
|
|
68
68
|
*/
|
|
69
|
-
async function waitForServer(port, name, maxWaitSeconds = 120) {
|
|
69
|
+
async function waitForServer(port, name, maxWaitSeconds = 120, endpoint = "/api/kos/ui/plugins/contexts") {
|
|
70
70
|
console.log(chalk.yellow(`Waiting for ${name} to be ready...`));
|
|
71
71
|
|
|
72
72
|
const startTime = Date.now();
|
|
73
73
|
const maxWaitMs = maxWaitSeconds * 1000;
|
|
74
74
|
|
|
75
75
|
while (Date.now() - startTime < maxWaitMs) {
|
|
76
|
-
const isHealthy = await checkPortHealth(port);
|
|
76
|
+
const isHealthy = await checkPortHealth(port, endpoint);
|
|
77
77
|
if (isHealthy) {
|
|
78
78
|
const elapsed = Math.floor((Date.now() - startTime) / 1000);
|
|
79
79
|
console.log(chalk.green(`✓ ${name} ready on port ${port}! (${elapsed}s)`));
|
|
@@ -161,7 +161,8 @@ async function startInternalDevelopment(hostConfig, plugins, logDir) {
|
|
|
161
161
|
let allReady = true;
|
|
162
162
|
|
|
163
163
|
for (const plugin of plugins) {
|
|
164
|
-
const
|
|
164
|
+
const pluginEndpoint = plugin.healthCheckEndpoint || "/api/kos/ui/plugins/contexts";
|
|
165
|
+
const isReady = await checkPortHealth(plugin.port, pluginEndpoint);
|
|
165
166
|
if (isReady) {
|
|
166
167
|
console.log(chalk.green(` ✓ ${plugin.project} ready on port ${plugin.port}`));
|
|
167
168
|
} else {
|
|
@@ -198,7 +199,8 @@ async function startInternalDevelopment(hostConfig, plugins, logDir) {
|
|
|
198
199
|
console.log("");
|
|
199
200
|
|
|
200
201
|
// Wait for host app
|
|
201
|
-
const
|
|
202
|
+
const hostEndpoint = hostConfig.healthCheckEndpoint || "/api/kos/ui/plugins/contexts";
|
|
203
|
+
const hostReady = await waitForServer(hostConfig.port, hostConfig.project, 120, hostEndpoint);
|
|
202
204
|
|
|
203
205
|
if (!hostReady) {
|
|
204
206
|
console.log(chalk.red("Host app failed to start"));
|
|
@@ -241,7 +243,8 @@ async function startThirdPartyDevelopment(hostConfig, plugins, logDir) {
|
|
|
241
243
|
let allReady = true;
|
|
242
244
|
|
|
243
245
|
for (const plugin of plugins) {
|
|
244
|
-
const
|
|
246
|
+
const pluginEndpoint = plugin.healthCheckEndpoint || "/api/kos/ui/plugins/contexts";
|
|
247
|
+
const isReady = await checkPortHealth(plugin.port, pluginEndpoint);
|
|
245
248
|
if (isReady) {
|
|
246
249
|
console.log(chalk.green(` ✓ ${plugin.project} ready on port ${plugin.port}`));
|
|
247
250
|
} else {
|