@base44-preview/cli 0.0.45-pr.420.2fbe700 → 0.0.45-pr.420.83fccbb

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) {
@@ -238132,31 +238127,22 @@ function isUserError(error48) {
238132
238127
  }
238133
238128
 
238134
238129
  // src/cli/utils/command/display.ts
238135
- async function showIntro(fullBanner, isNonInteractive) {
238130
+ async function showCommandStart(fullBanner) {
238136
238131
  if (fullBanner) {
238137
- await printBanner(isNonInteractive);
238132
+ await printBanner();
238138
238133
  We("");
238139
238134
  } else {
238140
238135
  We(theme.colors.base44OrangeBackground(" Base 44 "));
238141
238136
  }
238142
238137
  }
238143
- async function showOutro(result, upgradeCheckPromise, distribution) {
238138
+ async function showCommandEnd(result, upgradeCheckPromise, distribution) {
238144
238139
  await printUpgradeNotification(upgradeCheckPromise, distribution);
238145
238140
  Le(result.outroMessage || "");
238146
238141
  if (result.stdout) {
238147
238142
  process.stdout.write(result.stdout);
238148
238143
  }
238149
238144
  }
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) {
238145
+ function showThemedError(error48, context) {
238160
238146
  const errorMessage = error48 instanceof Error ? error48.message : String(error48);
238161
238147
  R2.error(errorMessage);
238162
238148
  if (isCLIError(error48)) {
@@ -238171,6 +238157,8 @@ function showThemedError(error48) {
238171
238157
  if (process.env.DEBUG === "1" && error48 instanceof Error && error48.stack) {
238172
238158
  R2.error(theme.styles.dim(error48.stack));
238173
238159
  }
238160
+ const errorContext = context.errorReporter.getErrorContext();
238161
+ Le(theme.format.errorContext(errorContext));
238174
238162
  }
238175
238163
  function showPlainError(error48) {
238176
238164
  const errorMessage = error48 instanceof Error ? error48.message : String(error48);
@@ -246628,7 +246616,7 @@ class Base44Command extends Command {
246628
246616
  return super.action(async (...args) => {
246629
246617
  const quiet = this.context.isNonInteractive;
246630
246618
  if (!quiet) {
246631
- await showIntro(this._commandOptions.fullBanner, this.context.isNonInteractive);
246619
+ await showCommandStart(this._commandOptions.fullBanner);
246632
246620
  }
246633
246621
  const upgradeCheckPromise = startUpgradeCheck();
246634
246622
  try {
@@ -246640,12 +246628,22 @@ class Base44Command extends Command {
246640
246628
  }
246641
246629
  const result = await fn(...args) ?? {};
246642
246630
  if (!quiet) {
246643
- await showOutro(result, upgradeCheckPromise, this.context.distribution);
246644
- } else if (result.stdout) {
246645
- process.stdout.write(result.stdout);
246631
+ await showCommandEnd(result, upgradeCheckPromise, this.context.distribution);
246632
+ } else {
246633
+ if (result.outroMessage) {
246634
+ process.stderr.write(`${result.outroMessage}
246635
+ `);
246636
+ }
246637
+ if (result.stdout) {
246638
+ process.stdout.write(result.stdout);
246639
+ }
246646
246640
  }
246647
246641
  } catch (error48) {
246648
- showError(error48, this.context, quiet);
246642
+ if (quiet) {
246643
+ showPlainError(error48);
246644
+ } else {
246645
+ showThemedError(error48, this.context);
246646
+ }
246649
246647
  throw error48;
246650
246648
  }
246651
246649
  });
@@ -256024,4 +256022,4 @@ export {
256024
256022
  CLIExitError
256025
256023
  };
256026
256024
 
256027
- //# debugId=D36A8C91D6E8B2EE64756E2164756E21
256025
+ //# debugId=935CC31256EB022F64756E2164756E21