betterstart-cli 0.0.33 → 0.0.34
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 +21 -5
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -19776,6 +19776,16 @@ function fitSpinnerMessage(message) {
|
|
|
19776
19776
|
return `${visible.slice(0, max - 1)}\u2026`;
|
|
19777
19777
|
}
|
|
19778
19778
|
var CLACK_LINE_ROWS = 2;
|
|
19779
|
+
var LOG_PREFIX_WIDTH = 3;
|
|
19780
|
+
function clackLogRows(message) {
|
|
19781
|
+
const columns = process.stdout.columns ?? 80;
|
|
19782
|
+
const width = stripVTControlCharacters(message).length + LOG_PREFIX_WIDTH;
|
|
19783
|
+
return 1 + Math.max(1, Math.ceil(width / columns));
|
|
19784
|
+
}
|
|
19785
|
+
function eraseRows(rows) {
|
|
19786
|
+
if (rows <= 0 || !process.stdout.isTTY || process.env.CI === "true") return;
|
|
19787
|
+
process.stdout.write(`\x1B[${rows}A\x1B[${rows}M`);
|
|
19788
|
+
}
|
|
19779
19789
|
function eraseClackLine(options = {}) {
|
|
19780
19790
|
if (!process.stdout.isTTY || process.env.CI === "true") return;
|
|
19781
19791
|
const below = (options.linesBelow ?? 0) * CLACK_LINE_ROWS;
|
|
@@ -21833,7 +21843,7 @@ async function promptServices(options) {
|
|
|
21833
21843
|
options: [
|
|
21834
21844
|
{
|
|
21835
21845
|
value: "vercel",
|
|
21836
|
-
label: "Vercel",
|
|
21846
|
+
label: "Vercel (Neon)",
|
|
21837
21847
|
hint: "Automatically provision a Neon Postgres database"
|
|
21838
21848
|
},
|
|
21839
21849
|
{
|
|
@@ -24253,19 +24263,25 @@ async function ensureVercelAuth(runner, cwd, options) {
|
|
|
24253
24263
|
return { authed: false, reason: "login-failed" };
|
|
24254
24264
|
}
|
|
24255
24265
|
checkSpinner.clear();
|
|
24256
|
-
|
|
24257
|
-
|
|
24258
|
-
);
|
|
24266
|
+
const signInMessage = `Sign in to Vercel to continue ${pc3.dim("(or press Ctrl-C to enter a connection string manually)")}`;
|
|
24267
|
+
const signInRows = clackLogRows(signInMessage);
|
|
24268
|
+
p13.log.info(signInMessage);
|
|
24269
|
+
let streamedRows = 0;
|
|
24259
24270
|
const login = await runVercel(runner, ["login"], {
|
|
24260
24271
|
cwd,
|
|
24261
24272
|
mode: "stream",
|
|
24262
|
-
streamLineFilter:
|
|
24273
|
+
streamLineFilter: (line) => {
|
|
24274
|
+
const show = showVercelLoginLine(line);
|
|
24275
|
+
if (show) streamedRows += 1;
|
|
24276
|
+
return show;
|
|
24277
|
+
},
|
|
24263
24278
|
timeoutMs: LOGIN_TIMEOUT_MS,
|
|
24264
24279
|
env
|
|
24265
24280
|
});
|
|
24266
24281
|
if (!login.success) {
|
|
24267
24282
|
return { authed: false, reason: login.timedOut ? "timeout" : "login-cancelled" };
|
|
24268
24283
|
}
|
|
24284
|
+
eraseRows(signInRows + streamedRows);
|
|
24269
24285
|
const verifySpinner = spinner2();
|
|
24270
24286
|
verifySpinner.start("Verifying Vercel sign-in");
|
|
24271
24287
|
const after = await checkVercelAuth(runner, cwd, env);
|