betterstart-cli 0.0.57 → 0.0.59

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
@@ -21843,6 +21843,7 @@ ${validationErrors.map((error) => ` - ${error}`).join("\n")}`
21843
21843
  import { execFileSync as execFileSync5, spawn as spawn5 } from "child_process";
21844
21844
  import fs39 from "fs";
21845
21845
  import path50 from "path";
21846
+ import { PassThrough } from "stream";
21846
21847
  import * as p18 from "@clack/prompts";
21847
21848
 
21848
21849
  // core-engine/utils/cancel-guard.ts
@@ -25455,6 +25456,48 @@ async function runSeedCommand(options) {
25455
25456
  // adapters/next/commands/init.ts
25456
25457
  var ANSI_ESCAPE_PATTERN2 = /\u001B\[[0-?]*[ -/]*[@-~]/g;
25457
25458
  var REMOVABLE_NAMESPACE_PATTERN = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
25459
+ function addVersionToBoxBottomBorder(box2, version2) {
25460
+ const lines = box2.split("\n");
25461
+ const bottomLineIndex = lines.length - 2;
25462
+ const bottomLine = lines[bottomLineIndex];
25463
+ if (!bottomLine) {
25464
+ return box2;
25465
+ }
25466
+ const leftCornerIndex = bottomLine.indexOf(p18.S_CORNER_BOTTOM_LEFT);
25467
+ const rightCornerIndex = bottomLine.lastIndexOf(p18.S_CORNER_BOTTOM_RIGHT);
25468
+ const label = ` v${version2} `;
25469
+ const borderWidth = rightCornerIndex - leftCornerIndex - p18.S_CORNER_BOTTOM_LEFT.length;
25470
+ if (leftCornerIndex === -1 || rightCornerIndex === -1 || borderWidth < label.length) {
25471
+ return box2;
25472
+ }
25473
+ const leftBorderWidth = Math.floor((borderWidth - label.length) / 2);
25474
+ const rightBorderWidth = borderWidth - label.length - leftBorderWidth;
25475
+ lines[bottomLineIndex] = `${bottomLine.slice(0, leftCornerIndex + p18.S_CORNER_BOTTOM_LEFT.length)}${p18.S_BAR_H.repeat(leftBorderWidth)}${label}${p18.S_BAR_H.repeat(rightBorderWidth)}${bottomLine.slice(rightCornerIndex)}`;
25476
+ return lines.join("\n");
25477
+ }
25478
+ function renderInitBanner() {
25479
+ const output = new PassThrough();
25480
+ Object.defineProperty(output, "columns", { value: process.stdout.columns });
25481
+ let box2 = "";
25482
+ output.on("data", (chunk) => {
25483
+ box2 += chunk.toString();
25484
+ });
25485
+ p18.box(
25486
+ `
25487
+ \u2584 \u2597 \u2597 \u2584\u2596\u2597 \u2597
25488
+ \u2599\u2598\u2588\u258C\u259C\u2598\u259C\u2598\u2588\u258C\u259B\u2598\u259A \u259C\u2598\u2580\u258C\u259B\u2598\u259C\u2598
25489
+ \u2599\u2598\u2599\u2596\u2590\u2596\u2590\u2596\u2599\u2596\u258C \u2584\u258C\u2590\u2596\u2588\u258C\u258C \u2590\u2596
25490
+ `,
25491
+ "Setup your Next.js Dashboard",
25492
+ {
25493
+ rounded: true,
25494
+ contentAlign: "center",
25495
+ titleAlign: "center",
25496
+ output
25497
+ }
25498
+ );
25499
+ process.stdout.write(addVersionToBoxBottomBorder(box2, getCurrentCliVersion()));
25500
+ }
25458
25501
  function normalizeNamespaceForRemoval(value) {
25459
25502
  if (typeof value !== "string") {
25460
25503
  return;
@@ -25534,19 +25577,7 @@ function removeExistingAdminPaths(cwd, namespaces) {
25534
25577
  async function runInitCommand(name, options) {
25535
25578
  installPromptCheckmarks();
25536
25579
  const disposeCancelGuard = installSetupCancelGuard();
25537
- p18.box(
25538
- `
25539
- \u2584 \u2597 \u2597 \u2584\u2596\u2597 \u2597
25540
- \u2599\u2598\u2588\u258C\u259C\u2598\u259C\u2598\u2588\u258C\u259B\u2598\u259A \u259C\u2598\u2580\u258C\u259B\u2598\u259C\u2598
25541
- \u2599\u2598\u2599\u2596\u2590\u2596\u2590\u2596\u2599\u2596\u258C \u2584\u258C\u2590\u2596\u2588\u258C\u258C \u2590\u2596
25542
- `,
25543
- "Setup your Next.js Dashboard",
25544
- {
25545
- rounded: true,
25546
- contentAlign: "center",
25547
- titleAlign: "center"
25548
- }
25549
- );
25580
+ renderInitBanner();
25550
25581
  let cwd = process.cwd();
25551
25582
  let projectName = path50.basename(cwd);
25552
25583
  let forceMode = Boolean(options.force);
@@ -25642,7 +25673,6 @@ async function runInitCommand(name, options) {
25642
25673
  options: [
25643
25674
  { value: "pnpm", label: "pnpm", hint: "recommended" },
25644
25675
  { value: "npm", label: "npm" },
25645
- { value: "yarn", label: "yarn" },
25646
25676
  { value: "bun", label: "bun" }
25647
25677
  ]
25648
25678
  });