@kosdev-code/kos-ui-cli 2.1.29 → 2.1.30

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.29",
3
+ "version": "2.1.30",
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": "beef4579179bbb56c008d896adf2d2f349bb1428"
25
+ "gitHash": "42362dab0707782bdeca97de7c6c8373230d9000"
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 isReady = await checkPortHealth(plugin.port);
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 hostReady = await waitForServer(hostConfig.port, hostConfig.project);
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 isReady = await checkPortHealth(plugin.port);
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 {