betterstart-cli 0.0.51 → 0.0.53

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
@@ -24167,16 +24167,30 @@ function runVercel(runner, args, options) {
24167
24167
  let stdout = "";
24168
24168
  let stderr = "";
24169
24169
  let timedOut = false;
24170
+ const onOutputLine = options.onOutputLine;
24171
+ const createOutputObserver = () => {
24172
+ if (!onOutputLine) return void 0;
24173
+ return createFilteredLineForwarder(
24174
+ (line) => line.length > 0,
24175
+ (text7) => onOutputLine(stripVTControlCharacters2(text7).trim())
24176
+ );
24177
+ };
24178
+ const stdoutObserver = createOutputObserver();
24179
+ const stderrObserver = createOutputObserver();
24170
24180
  if (options.mode === "capture" && options.stdinInput !== void 0) {
24171
24181
  child.stdin?.write(options.stdinInput);
24172
24182
  child.stdin?.end();
24173
24183
  }
24174
24184
  if (options.mode === "capture") {
24175
24185
  child.stdout?.on("data", (chunk) => {
24176
- stdout += chunk.toString();
24186
+ const text7 = chunk.toString();
24187
+ stdout += text7;
24188
+ stdoutObserver?.push(text7);
24177
24189
  });
24178
24190
  child.stderr?.on("data", (chunk) => {
24179
- stderr += chunk.toString();
24191
+ const text7 = chunk.toString();
24192
+ stderr += text7;
24193
+ stderrObserver?.push(text7);
24180
24194
  });
24181
24195
  } else if (options.mode === "stream") {
24182
24196
  const shouldShow = options.streamLineFilter ?? (() => true);
@@ -24192,11 +24206,13 @@ function runVercel(runner, args, options) {
24192
24206
  const text7 = chunk.toString();
24193
24207
  stdout += text7;
24194
24208
  outForwarder.push(text7);
24209
+ stdoutObserver?.push(text7);
24195
24210
  });
24196
24211
  child.stderr?.on("data", (chunk) => {
24197
24212
  const text7 = chunk.toString();
24198
24213
  stderr += text7;
24199
24214
  errForwarder.push(text7);
24215
+ stderrObserver?.push(text7);
24200
24216
  });
24201
24217
  child.on("close", () => {
24202
24218
  outForwarder.flush();
@@ -24209,6 +24225,8 @@ function runVercel(runner, args, options) {
24209
24225
  }, timeoutMs);
24210
24226
  child.on("close", (code, signal) => {
24211
24227
  clearTimeout(timeout);
24228
+ stdoutObserver?.flush();
24229
+ stderrObserver?.flush();
24212
24230
  if (timedOut) {
24213
24231
  resolve({
24214
24232
  success: false,
@@ -24233,6 +24251,8 @@ function runVercel(runner, args, options) {
24233
24251
  });
24234
24252
  child.on("error", (err) => {
24235
24253
  clearTimeout(timeout);
24254
+ stdoutObserver?.flush();
24255
+ stderrObserver?.flush();
24236
24256
  resolve({
24237
24257
  success: false,
24238
24258
  code: null,
@@ -24458,9 +24478,6 @@ function withScope(args, scope) {
24458
24478
  function readLinkedProjectId(cwd) {
24459
24479
  return readLinkedProjectJson(cwd)?.projectId;
24460
24480
  }
24461
- function readLinkedProjectName(cwd) {
24462
- return readLinkedProjectJson(cwd)?.projectName;
24463
- }
24464
24481
  function readLinkedProjectJson(cwd) {
24465
24482
  try {
24466
24483
  const projectJsonPath = path46.join(cwd, ".vercel", "project.json");
@@ -24804,12 +24821,13 @@ function parseDeployedUrl(stdout, stderr) {
24804
24821
  const fromStdout = stripVTControlCharacters3(stdout).match(/https:\/\/\S+/)?.[0];
24805
24822
  return fromStdout;
24806
24823
  }
24807
- async function deployVercelProject(runner, cwd, env) {
24824
+ async function deployVercelProject(runner, cwd, options = {}) {
24808
24825
  const deploy = await runVercel(runner, ["deploy", "--prod", "--yes"], {
24809
24826
  cwd,
24810
24827
  mode: "capture",
24811
24828
  timeoutMs: DEPLOY_TIMEOUT_MS,
24812
- env
24829
+ env: options.env,
24830
+ onOutputLine: options.onLogLine
24813
24831
  });
24814
24832
  if (deploy.success) {
24815
24833
  return { url: parseDeployedUrl(deploy.stdout, deploy.stderr) };
@@ -25048,10 +25066,13 @@ async function runVercelDeployFlow(options) {
25048
25066
  );
25049
25067
  }
25050
25068
  const deploySpinner = spinner2();
25051
- deploySpinner.start("Deploying to Vercel, This may take a moment");
25069
+ deploySpinner.start("Deploying to Vercel");
25052
25070
  let deploy;
25053
25071
  try {
25054
- deploy = await deployVercelProject(runner, options.cwd, env);
25072
+ deploy = await deployVercelProject(runner, options.cwd, {
25073
+ env,
25074
+ onLogLine: (line) => deploySpinner.message(line)
25075
+ });
25055
25076
  } finally {
25056
25077
  packageGuard.restore();
25057
25078
  }
@@ -25061,8 +25082,7 @@ async function runVercelDeployFlow(options) {
25061
25082
  printManualDeployHint();
25062
25083
  return { ok: false };
25063
25084
  }
25064
- const linkedName = readLinkedProjectName(options.cwd);
25065
- const url = linkedName ? `https://${linkedName}.vercel.app` : deploy.url;
25085
+ const url = deploy.url;
25066
25086
  deploySpinner.stop(url ? `Deployed ${pc6.cyan(url)}` : "Deployed to Vercel");
25067
25087
  return { ok: true, url, syncedEnvKeys: sync.synced };
25068
25088
  } catch (error) {