betterstart-cli 0.0.56 → 0.0.58

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
@@ -22237,7 +22238,6 @@ async function promptProject(defaultName) {
22237
22238
  message: "Enter the project name",
22238
22239
  placeholder: defaultName ?? "(Leave blank to skip directory creation)",
22239
22240
  defaultValue: defaultName ?? ".",
22240
- initialValue: defaultName ?? ".",
22241
22241
  validate: (value) => {
22242
22242
  if (!value?.trim()) return void 0;
22243
22243
  if (value.trim() === ".") return void 0;
@@ -25456,6 +25456,48 @@ async function runSeedCommand(options) {
25456
25456
  // adapters/next/commands/init.ts
25457
25457
  var ANSI_ESCAPE_PATTERN2 = /\u001B\[[0-?]*[ -/]*[@-~]/g;
25458
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
+ }
25459
25501
  function normalizeNamespaceForRemoval(value) {
25460
25502
  if (typeof value !== "string") {
25461
25503
  return;
@@ -25535,19 +25577,7 @@ function removeExistingAdminPaths(cwd, namespaces) {
25535
25577
  async function runInitCommand(name, options) {
25536
25578
  installPromptCheckmarks();
25537
25579
  const disposeCancelGuard = installSetupCancelGuard();
25538
- p18.box(
25539
- `
25540
- \u2584 \u2597 \u2597 \u2584\u2596\u2597 \u2597
25541
- \u2599\u2598\u2588\u258C\u259C\u2598\u259C\u2598\u2588\u258C\u259B\u2598\u259A \u259C\u2598\u2580\u258C\u259B\u2598\u259C\u2598
25542
- \u2599\u2598\u2599\u2596\u2590\u2596\u2590\u2596\u2599\u2596\u258C \u2584\u258C\u2590\u2596\u2588\u258C\u258C \u2590\u2596
25543
- `,
25544
- "Setup your Next.js Dashboard",
25545
- {
25546
- rounded: true,
25547
- contentAlign: "center",
25548
- titleAlign: "center"
25549
- }
25550
- );
25580
+ renderInitBanner();
25551
25581
  let cwd = process.cwd();
25552
25582
  let projectName = path50.basename(cwd);
25553
25583
  let forceMode = Boolean(options.force);