@neat.is/core 0.10.2 → 0.10.3-dev.20260930

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/cli.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  resolveNeatVersion,
9
9
  startK8sSubstratePolling,
10
10
  writeDaemonRecord
11
- } from "./chunk-CAGAHYDB.js";
11
+ } from "./chunk-DLQNMU3R.js";
12
12
  import {
13
13
  buildSearchIndex
14
14
  } from "./chunk-BC53SCT7.js";
@@ -82,7 +82,7 @@ import {
82
82
  startStalenessLoop,
83
83
  upsertConnectorEntry,
84
84
  validateConnectorEntry
85
- } from "./chunk-TXKOAART.js";
85
+ } from "./chunk-LNIVRE4L.js";
86
86
  import {
87
87
  startOtelGrpcReceiver
88
88
  } from "./chunk-5SJHA5ZH.js";
@@ -4208,9 +4208,15 @@ async function snapshotProjectStatus(restPort, project, body) {
4208
4208
  }
4209
4209
  return [{ name: project, status: await probeProjectHealth(restPort, project) }];
4210
4210
  }
4211
- async function waitForDaemonReady(restPort, project, timeoutMs) {
4212
- const deadline = Date.now() + timeoutMs;
4213
- let lastBootstrapping = [];
4211
+ var STILL_WAITING_INTERVAL_MS = 1e4;
4212
+ function daemonProgressLine(project, event) {
4213
+ if (event.kind === "starting") return `starting the daemon for ${project}\u2026`;
4214
+ return `still waiting for ${project}'s daemon (${Math.round(event.elapsedMs / 1e3)}s)`;
4215
+ }
4216
+ async function waitForDaemonReady(restPort, project, timeoutMs, onProgress, reminderIntervalMs = STILL_WAITING_INTERVAL_MS) {
4217
+ const startedAt = Date.now();
4218
+ const deadline = startedAt + timeoutMs;
4219
+ let nextReminderAt = startedAt + reminderIntervalMs;
4214
4220
  while (Date.now() < deadline) {
4215
4221
  const body = await fetchDaemonHealth(restPort);
4216
4222
  if (body !== null) {
@@ -4220,15 +4226,10 @@ async function waitForDaemonReady(restPort, project, timeoutMs) {
4220
4226
  if (bootstrapping.length === 0) {
4221
4227
  return { ready: true, brokenProjects: broken, stillBootstrapping: [] };
4222
4228
  }
4223
- const key = bootstrapping.slice().sort().join(",");
4224
- const prevKey = lastBootstrapping.slice().sort().join(",");
4225
- if (key !== prevKey) {
4226
- const plural = bootstrapping.length === 1 ? "" : "s";
4227
- console.log(
4228
- `neat: waiting on ${bootstrapping.length} project${plural}: ${bootstrapping.join(", ")}`
4229
- );
4230
- lastBootstrapping = bootstrapping;
4231
- }
4229
+ }
4230
+ if (Date.now() >= nextReminderAt) {
4231
+ onProgress?.({ kind: "waiting", elapsedMs: Date.now() - startedAt });
4232
+ nextReminderAt += reminderIntervalMs;
4232
4233
  }
4233
4234
  await new Promise((r) => setTimeout(r, PROBE_INTERVAL_MS));
4234
4235
  }
@@ -4440,7 +4441,8 @@ async function ensureProjectDaemon(opts) {
4440
4441
  projectPath: opts.projectPath,
4441
4442
  ports: allocated
4442
4443
  });
4443
- const ready = await waitForDaemonReady(allocated.rest, opts.project, timeoutMs);
4444
+ opts.onProgress?.({ kind: "starting" });
4445
+ const ready = await waitForDaemonReady(allocated.rest, opts.project, timeoutMs, opts.onProgress);
4444
4446
  if (!ready.ready) {
4445
4447
  return {
4446
4448
  status: "timed-out",
@@ -4586,7 +4588,8 @@ async function runOrchestrator(opts) {
4586
4588
  const outcome = await ensureProjectDaemon({
4587
4589
  project: currentProjectName,
4588
4590
  projectPath: opts.scanPath,
4589
- timeoutMs
4591
+ timeoutMs,
4592
+ onProgress: (event) => console.log(`neat: ${daemonProgressLine(currentProjectName, event)}`)
4590
4593
  });
4591
4594
  const allocated = "ports" in outcome ? outcome.ports : null;
4592
4595
  switch (outcome.status) {
@@ -6646,7 +6649,13 @@ async function runUpCommand(argv, deps) {
6646
6649
  err("neat up: that daemon doesn't run on this machine, so it isn't yours to start.");
6647
6650
  return 2;
6648
6651
  }
6649
- const outcome = await ensure({ project: entry2.name, projectPath: entry2.path });
6652
+ const project = entry2.name;
6653
+ const outcome = await ensure({
6654
+ project,
6655
+ projectPath: entry2.path,
6656
+ // `--json` prints one object and nothing else, so progress stays quiet there.
6657
+ ...args.json ? {} : { onProgress: (event) => out(`neat up: ${daemonProgressLine(project, event)}`) }
6658
+ });
6650
6659
  const log = daemonLogPath(entry2.path);
6651
6660
  if (args.json) {
6652
6661
  const ports = "ports" in outcome ? outcome.ports : void 0;