betterstart-cli 0.0.51 → 0.0.52

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,
@@ -24804,12 +24824,13 @@ function parseDeployedUrl(stdout, stderr) {
24804
24824
  const fromStdout = stripVTControlCharacters3(stdout).match(/https:\/\/\S+/)?.[0];
24805
24825
  return fromStdout;
24806
24826
  }
24807
- async function deployVercelProject(runner, cwd, env) {
24827
+ async function deployVercelProject(runner, cwd, options = {}) {
24808
24828
  const deploy = await runVercel(runner, ["deploy", "--prod", "--yes"], {
24809
24829
  cwd,
24810
24830
  mode: "capture",
24811
24831
  timeoutMs: DEPLOY_TIMEOUT_MS,
24812
- env
24832
+ env: options.env,
24833
+ onOutputLine: options.onLogLine
24813
24834
  });
24814
24835
  if (deploy.success) {
24815
24836
  return { url: parseDeployedUrl(deploy.stdout, deploy.stderr) };
@@ -25048,10 +25069,13 @@ async function runVercelDeployFlow(options) {
25048
25069
  );
25049
25070
  }
25050
25071
  const deploySpinner = spinner2();
25051
- deploySpinner.start("Deploying to Vercel, This may take a moment");
25072
+ deploySpinner.start("Deploying to Vercel");
25052
25073
  let deploy;
25053
25074
  try {
25054
- deploy = await deployVercelProject(runner, options.cwd, env);
25075
+ deploy = await deployVercelProject(runner, options.cwd, {
25076
+ env,
25077
+ onLogLine: (line) => deploySpinner.message(line)
25078
+ });
25055
25079
  } finally {
25056
25080
  packageGuard.restore();
25057
25081
  }