betterstart-cli 0.0.33 → 0.0.35

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
@@ -1664,8 +1664,8 @@ function ensureDatabasePushDependencies(cwd, pm) {
1664
1664
  Installing database push dependencies (${missing.map((dependency) => dependency.name).join(", ")})...`
1665
1665
  );
1666
1666
  for (const dependency of missing) {
1667
- const installed = installDependency(cwd, pm, dependency.name, dependency.dev);
1668
- if (!installed) {
1667
+ const installed2 = installDependency(cwd, pm, dependency.name, dependency.dev);
1668
+ if (!installed2) {
1669
1669
  console.log(` Failed to install ${dependency.name}`);
1670
1670
  return false;
1671
1671
  }
@@ -3605,7 +3605,7 @@ async function installIntegrations({
3605
3605
  const orderedIntegrationIds = resolveIntegrationInstallOrder(integrationIds);
3606
3606
  const installedIntegrationIds = normalizeInstalledIntegrations(config);
3607
3607
  const skipped = [];
3608
- const installed = [];
3608
+ const installed2 = [];
3609
3609
  const activated = [];
3610
3610
  const warnings = [];
3611
3611
  for (const integrationId of orderedIntegrationIds) {
@@ -3704,7 +3704,7 @@ async function installIntegrations({
3704
3704
  });
3705
3705
  saveInstalledIntegrationManifest(cwd, manifest);
3706
3706
  writeConfigFile(cwd, config);
3707
- installed.push(integrationId);
3707
+ installed2.push(integrationId);
3708
3708
  if (!configureResult.configured && isProviderIntegration(definition)) {
3709
3709
  warnings.push(
3710
3710
  `${integrationId} was installed but not activated because its required environment variables are still missing.`
@@ -3712,7 +3712,7 @@ async function installIntegrations({
3712
3712
  }
3713
3713
  }
3714
3714
  return {
3715
- installed,
3715
+ installed: installed2,
3716
3716
  activated,
3717
3717
  skipped,
3718
3718
  warnings,
@@ -18727,7 +18727,7 @@ async function installPlugins({
18727
18727
  const orderedPluginIds = resolvePluginInstallOrder(pluginIds);
18728
18728
  const installedPluginIds = normalizeInstalledPlugins(config);
18729
18729
  const skipped = [];
18730
- const installed = [];
18730
+ const installed2 = [];
18731
18731
  const warnings = [];
18732
18732
  ensureSnapshotGitFiles(cwd);
18733
18733
  for (const pluginId of orderedPluginIds) {
@@ -18796,10 +18796,10 @@ async function installPlugins({
18796
18796
  };
18797
18797
  saveInstalledPluginManifest(cwd, manifest);
18798
18798
  writeConfigFile(cwd, config);
18799
- installed.push(pluginId);
18799
+ installed2.push(pluginId);
18800
18800
  }
18801
18801
  return {
18802
- installed,
18802
+ installed: installed2,
18803
18803
  skipped,
18804
18804
  warnings,
18805
18805
  config
@@ -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;
@@ -21818,6 +21828,30 @@ import fs39 from "fs";
21818
21828
  import path50 from "path";
21819
21829
  import * as p17 from "@clack/prompts";
21820
21830
 
21831
+ // core-engine/utils/prompt-theme.ts
21832
+ var GREEN_STEP_SUBMIT = "\x1B[32m\u25C7\x1B[39m";
21833
+ var GREEN_CHECK = "\x1B[32m\u2713\x1B[39m";
21834
+ function restyleStepSubmitSymbols(text7) {
21835
+ return text7.split(GREEN_STEP_SUBMIT).join(GREEN_CHECK);
21836
+ }
21837
+ var installed = false;
21838
+ function installPromptCheckmarks() {
21839
+ if (installed || !process.stdout.isTTY || process.env.CI === "true") return () => {
21840
+ };
21841
+ installed = true;
21842
+ const unpatched = process.stdout.write;
21843
+ const original = unpatched.bind(process.stdout);
21844
+ process.stdout.write = ((chunk, encoding, callback) => original(
21845
+ typeof chunk === "string" ? restyleStepSubmitSymbols(chunk) : chunk,
21846
+ encoding,
21847
+ callback
21848
+ ));
21849
+ return () => {
21850
+ process.stdout.write = unpatched;
21851
+ installed = false;
21852
+ };
21853
+ }
21854
+
21821
21855
  // adapters/next/init/prompts/database.ts
21822
21856
  import { execFileSync as execFileSync4 } from "child_process";
21823
21857
  import * as p10 from "@clack/prompts";
@@ -21833,7 +21867,7 @@ async function promptServices(options) {
21833
21867
  options: [
21834
21868
  {
21835
21869
  value: "vercel",
21836
- label: "Vercel",
21870
+ label: "Vercel (Neon)",
21837
21871
  hint: "Automatically provision a Neon Postgres database"
21838
21872
  },
21839
21873
  {
@@ -24253,19 +24287,25 @@ async function ensureVercelAuth(runner, cwd, options) {
24253
24287
  return { authed: false, reason: "login-failed" };
24254
24288
  }
24255
24289
  checkSpinner.clear();
24256
- p13.log.info(
24257
- `Sign in to Vercel to continue ${pc3.dim("(or press Ctrl-C to enter a connection string manually)")}`
24258
- );
24290
+ const signInMessage = `Sign in to Vercel to continue ${pc3.dim("(or press Ctrl-C to enter a connection string manually)")}`;
24291
+ const signInRows = clackLogRows(signInMessage);
24292
+ p13.log.info(signInMessage);
24293
+ let streamedRows = 0;
24259
24294
  const login = await runVercel(runner, ["login"], {
24260
24295
  cwd,
24261
24296
  mode: "stream",
24262
- streamLineFilter: showVercelLoginLine,
24297
+ streamLineFilter: (line) => {
24298
+ const show = showVercelLoginLine(line);
24299
+ if (show) streamedRows += 1;
24300
+ return show;
24301
+ },
24263
24302
  timeoutMs: LOGIN_TIMEOUT_MS,
24264
24303
  env
24265
24304
  });
24266
24305
  if (!login.success) {
24267
24306
  return { authed: false, reason: login.timedOut ? "timeout" : "login-cancelled" };
24268
24307
  }
24308
+ eraseRows(signInRows + streamedRows);
24269
24309
  const verifySpinner = spinner2();
24270
24310
  verifySpinner.start("Verifying Vercel sign-in");
24271
24311
  const after = await checkVercelAuth(runner, cwd, env);
@@ -25371,6 +25411,7 @@ function removeExistingAdminPaths(cwd, namespaces) {
25371
25411
  return removed;
25372
25412
  }
25373
25413
  async function runInitCommand(name, options) {
25414
+ installPromptCheckmarks();
25374
25415
  p17.box(
25375
25416
  `
25376
25417
  \u2584 \u2597 \u2597 \u2584\u2596\u2597 \u2597