@base44-preview/cli 0.0.45-pr.420.c43b7e8 → 0.0.45-pr.420.fbee2b5

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/index.js CHANGED
@@ -216497,13 +216497,8 @@ var BANNER_LINES = [
216497
216497
  "██████╔╝██║ ██║███████║███████╗ ██║ ██║",
216498
216498
  "╚═════╝ ╚═╝ ╚═╝╚══════╝╚══════╝ ╚═╝ ╚═╝"
216499
216499
  ];
216500
- async function printBanner(isNonInteractive) {
216501
- if (isNonInteractive) {
216502
- console.log(theme.colors.base44Orange(BANNER_LINES.join(`
216503
- `)));
216504
- } else {
216505
- await printAnimatedLines(BANNER_LINES);
216506
- }
216500
+ async function printBanner() {
216501
+ await printAnimatedLines(BANNER_LINES);
216507
216502
  }
216508
216503
  // ../../node_modules/is-plain-obj/index.js
216509
216504
  function isPlainObject(value) {
@@ -237007,6 +237002,10 @@ function formatUpgradeMessage(info, distribution) {
237007
237002
  ].join(`
237008
237003
  `);
237009
237004
  }
237005
+ function formatPlainUpgradeMessage(info, distribution) {
237006
+ const instruction = getUpgradeInstruction(detectInstallMethod(distribution));
237007
+ return `Update available: ${info.currentVersion} → ${info.latestVersion}. ${instruction}`;
237008
+ }
237010
237009
  async function printUpgradeNotification(upgradeCheckPromise, distribution) {
237011
237010
  try {
237012
237011
  const upgradeInfo = await upgradeCheckPromise;
@@ -238132,31 +238131,22 @@ function isUserError(error48) {
238132
238131
  }
238133
238132
 
238134
238133
  // src/cli/utils/command/display.ts
238135
- async function showIntro(fullBanner, isNonInteractive) {
238134
+ async function showCommandStart(fullBanner) {
238136
238135
  if (fullBanner) {
238137
- await printBanner(isNonInteractive);
238136
+ await printBanner();
238138
238137
  We("");
238139
238138
  } else {
238140
238139
  We(theme.colors.base44OrangeBackground(" Base 44 "));
238141
238140
  }
238142
238141
  }
238143
- async function showOutro(result, upgradeCheckPromise, distribution) {
238142
+ async function showCommandEnd(result, upgradeCheckPromise, distribution) {
238144
238143
  await printUpgradeNotification(upgradeCheckPromise, distribution);
238145
238144
  Le(result.outroMessage || "");
238146
238145
  if (result.stdout) {
238147
238146
  process.stdout.write(result.stdout);
238148
238147
  }
238149
238148
  }
238150
- function showError(error48, context, quiet) {
238151
- if (quiet) {
238152
- showPlainError(error48);
238153
- } else {
238154
- showThemedError(error48);
238155
- const errorContext = context.errorReporter.getErrorContext();
238156
- Le(theme.format.errorContext(errorContext));
238157
- }
238158
- }
238159
- function showThemedError(error48) {
238149
+ function showThemedError(error48, context) {
238160
238150
  const errorMessage = error48 instanceof Error ? error48.message : String(error48);
238161
238151
  R2.error(errorMessage);
238162
238152
  if (isCLIError(error48)) {
@@ -238171,6 +238161,8 @@ function showThemedError(error48) {
238171
238161
  if (process.env.DEBUG === "1" && error48 instanceof Error && error48.stack) {
238172
238162
  R2.error(theme.styles.dim(error48.stack));
238173
238163
  }
238164
+ const errorContext = context.errorReporter.getErrorContext();
238165
+ Le(theme.format.errorContext(errorContext));
238174
238166
  }
238175
238167
  function showPlainError(error48) {
238176
238168
  const errorMessage = error48 instanceof Error ? error48.message : String(error48);
@@ -246628,7 +246620,7 @@ class Base44Command extends Command {
246628
246620
  return super.action(async (...args) => {
246629
246621
  const quiet = this.context.isNonInteractive;
246630
246622
  if (!quiet) {
246631
- await showIntro(this._commandOptions.fullBanner, this.context.isNonInteractive);
246623
+ await showCommandStart(this._commandOptions.fullBanner);
246632
246624
  }
246633
246625
  const upgradeCheckPromise = startUpgradeCheck();
246634
246626
  try {
@@ -246640,12 +246632,27 @@ class Base44Command extends Command {
246640
246632
  }
246641
246633
  const result = await fn(...args) ?? {};
246642
246634
  if (!quiet) {
246643
- await showOutro(result, upgradeCheckPromise, this.context.distribution);
246644
- } else if (result.stdout) {
246645
- process.stdout.write(result.stdout);
246635
+ await showCommandEnd(result, upgradeCheckPromise, this.context.distribution);
246636
+ } else {
246637
+ if (result.outroMessage) {
246638
+ process.stdout.write(`${result.outroMessage}
246639
+ `);
246640
+ }
246641
+ if (result.stdout) {
246642
+ process.stdout.write(result.stdout);
246643
+ }
246644
+ const upgradeInfo = await upgradeCheckPromise;
246645
+ if (upgradeInfo) {
246646
+ process.stderr.write(`${formatPlainUpgradeMessage(upgradeInfo, this.context.distribution)}
246647
+ `);
246648
+ }
246646
246649
  }
246647
246650
  } catch (error48) {
246648
- showError(error48, this.context, quiet);
246651
+ if (quiet) {
246652
+ showPlainError(error48);
246653
+ } else {
246654
+ showThemedError(error48, this.context);
246655
+ }
246649
246656
  throw error48;
246650
246657
  }
246651
246658
  });
@@ -248207,12 +248214,21 @@ function getCreateCommand() {
248207
248214
  Examples:
248208
248215
  $ base44 create my-app Creates a base44 project at ./my-app
248209
248216
  $ base44 create my-todo-app --template backend-and-client Creates a base44 backend-and-client project at ./my-todo-app
248210
- $ base44 create my-app --path ./projects/my-app --deploy Creates a base44 project at ./project/my-app and deploys it`).hook("preAction", validateNonInteractiveFlags).action(async (name2, options) => {
248217
+ $ base44 create my-app --path ./projects/my-app --deploy Creates a base44 project at ./project/my-app and deploys it`).hook("preAction", validateNonInteractiveFlags).action(async (name2, options, command2) => {
248211
248218
  if (name2 && !options.path) {
248212
248219
  options.path = `./${import_kebabCase.default(name2)}`;
248213
248220
  }
248214
- const isNonInteractive = !!(options.name ?? name2) && !!options.path;
248215
- if (isNonInteractive) {
248221
+ const skipPrompts = !!(options.name ?? name2) && !!options.path;
248222
+ if (!skipPrompts && command2.isNonInteractive) {
248223
+ throw new InvalidInputError("Project name and --path are required in non-interactive mode", {
248224
+ hints: [
248225
+ {
248226
+ message: "Usage: base44 create <name> --path <path>"
248227
+ }
248228
+ ]
248229
+ });
248230
+ }
248231
+ if (skipPrompts) {
248216
248232
  return await createNonInteractive({
248217
248233
  name: options.name ?? name2,
248218
248234
  ...options
@@ -248455,7 +248471,11 @@ async function link(options) {
248455
248471
  return { outroMessage: "Project linked" };
248456
248472
  }
248457
248473
  function getLinkCommand() {
248458
- return new Base44Command("link", { requireAppConfig: false }).description("Link a local project to a Base44 project (create new or link existing)").option("-c, --create", "Create a new project (skip selection prompt)").option("-n, --name <name>", "Project name (required when --create is used)").option("-d, --description <description>", "Project description").option("-p, --projectId <id>", "Project ID to link to an existing project (skips selection prompt)").hook("preAction", validateNonInteractiveFlags2).action(async (options) => {
248474
+ return new Base44Command("link", { requireAppConfig: false }).description("Link a local project to a Base44 project (create new or link existing)").option("-c, --create", "Create a new project (skip selection prompt)").option("-n, --name <name>", "Project name (required when --create is used)").option("-d, --description <description>", "Project description").option("-p, --projectId <id>", "Project ID to link to an existing project (skips selection prompt)").hook("preAction", validateNonInteractiveFlags2).action(async (options, command2) => {
248475
+ const skipPrompts = !!options.create || !!options.projectId;
248476
+ if (!skipPrompts && command2.isNonInteractive) {
248477
+ throw new InvalidInputError("Either --create --name <name> or --projectId <id> is required in non-interactive mode");
248478
+ }
248459
248479
  return await link(options);
248460
248480
  });
248461
248481
  }
@@ -251747,6 +251767,12 @@ async function eject(options8) {
251747
251767
  }
251748
251768
  function getEjectCommand() {
251749
251769
  return new Base44Command("eject", { requireAppConfig: false }).description("Download the code for an existing Base44 project").option("-p, --path <path>", "Path where to write the project").option("--project-id <id>", "Project ID to eject (skips interactive selection)").option("-y, --yes", "Skip confirmation prompts").action(async (options8, command2) => {
251770
+ if (command2.isNonInteractive && !options8.projectId) {
251771
+ throw new InvalidInputError("--project-id is required in non-interactive mode");
251772
+ }
251773
+ if (command2.isNonInteractive && !options8.path) {
251774
+ throw new InvalidInputError("--path is required in non-interactive mode");
251775
+ }
251750
251776
  return await eject({
251751
251777
  ...options8,
251752
251778
  isNonInteractive: command2.isNonInteractive
@@ -256024,4 +256050,4 @@ export {
256024
256050
  CLIExitError
256025
256051
  };
256026
256052
 
256027
- //# debugId=D36A8C91D6E8B2EE64756E2164756E21
256053
+ //# debugId=633CFCDA24D8535E64756E2164756E21