betterstart-cli 0.0.76 → 0.0.78

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
@@ -20086,10 +20086,11 @@ import * as p5 from "@clack/prompts";
20086
20086
  var RENDER_OVERHEAD = 7;
20087
20087
  var MIN_MESSAGE_WIDTH = 8;
20088
20088
  function fitSpinnerMessage(message) {
20089
+ const normalized = message.replace(/\t/g, " ");
20089
20090
  const columns = process.stdout.columns ?? 80;
20090
20091
  const max = Math.max(columns - RENDER_OVERHEAD, MIN_MESSAGE_WIDTH);
20091
- const visible = stripVTControlCharacters(message);
20092
- if (visible.length <= max) return message;
20092
+ const visible = stripVTControlCharacters(normalized);
20093
+ if (visible.length <= max) return normalized;
20093
20094
  return `${visible.slice(0, max - 1)}\u2026`;
20094
20095
  }
20095
20096
  var CLACK_LINE_ROWS = 2;
@@ -23539,7 +23540,8 @@ function deploymentLine(line) {
23539
23540
  if (typeof jsonMessage === "string") message = jsonMessage;
23540
23541
  } catch {
23541
23542
  }
23542
- return /^\.+$/.test(message) ? void 0 : message.slice(0, 140);
23543
+ message = message.replace(/\s+/g, " ").trim();
23544
+ return message === "" || /^\.+$/.test(message) ? void 0 : message.slice(0, 140);
23543
23545
  }
23544
23546
  async function readFailedDeploymentLogs(session, cwd, service) {
23545
23547
  const logs = await runRailway(
@@ -23561,24 +23563,33 @@ ${logs.stderr}`);
23561
23563
  }
23562
23564
  async function runRailwayDeployFlow(options) {
23563
23565
  try {
23564
- const service = await ensureRailwayAppService(
23565
- options.session,
23566
- options.cwd,
23567
- options.service?.trim() || "web"
23568
- );
23569
- if ((service.replicaCount ?? 1) > 1) {
23570
- throw new Error(
23571
- `Railway service ${service.name} has ${service.replicaCount} replicas. BetterStart Railway v1 supports one replica because Next.js cache invalidation is process-local.`
23566
+ const prepSpinner = spinner2();
23567
+ prepSpinner.start("Connecting the Railway web service");
23568
+ let service;
23569
+ let url;
23570
+ try {
23571
+ service = await ensureRailwayAppService(
23572
+ options.session,
23573
+ options.cwd,
23574
+ options.service?.trim() || "web"
23575
+ );
23576
+ if ((service.replicaCount ?? 1) > 1) {
23577
+ throw new Error(
23578
+ `Railway service ${service.name} has ${service.replicaCount} replicas. BetterStart Railway v1 supports one replica because Next.js cache invalidation is process-local.`
23579
+ );
23580
+ }
23581
+ await linkRailwayService(
23582
+ options.session.runner,
23583
+ options.cwd,
23584
+ options.session.project,
23585
+ service,
23586
+ options.session.env
23572
23587
  );
23588
+ prepSpinner.message("Setting up the Railway domain");
23589
+ url = await ensureRailwayDomain(options.session, options.cwd, service);
23590
+ } finally {
23591
+ prepSpinner.clear();
23573
23592
  }
23574
- await linkRailwayService(
23575
- options.session.runner,
23576
- options.cwd,
23577
- options.session.project,
23578
- service,
23579
- options.session.env
23580
- );
23581
- const url = await ensureRailwayDomain(options.session, options.cwd, service);
23582
23593
  if (!url) {
23583
23594
  throw new Error("Railway could not create a public domain required for Better Auth.");
23584
23595
  }