@base44-preview/cli 0.3.1-pr.693.36e994c → 0.3.1-pr.694.631024e

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
@@ -228514,6 +228514,21 @@ class DependencyNotFoundError extends UserError {
228514
228514
  });
228515
228515
  }
228516
228516
  }
228517
+
228518
+ class AppNotPublishedError extends UserError {
228519
+ code = "APP_NOT_PUBLISHED";
228520
+ constructor(message = "This app has not been published yet, so it has no site URL", options) {
228521
+ super(message, {
228522
+ hints: options?.hints ?? [
228523
+ {
228524
+ message: "Publish the app in the Base44 builder, or deploy its site with 'base44 deploy'",
228525
+ command: "base44 deploy"
228526
+ }
228527
+ ],
228528
+ cause: options?.cause
228529
+ });
228530
+ }
228531
+ }
228517
228532
  var MAX_RESPONSE_TEXT_CHARS = 500;
228518
228533
  async function readResponseText(response) {
228519
228534
  try {
@@ -266128,10 +266143,18 @@ function getSiteInstallCommand() {
266128
266143
  }
266129
266144
 
266130
266145
  // src/cli/commands/site/open.ts
266146
+ var isAppNotPublished = (error) => error instanceof ApiError && error.statusCode === 404;
266147
+ async function getPublishedSiteUrl() {
266148
+ try {
266149
+ return await getSiteUrl();
266150
+ } catch (error) {
266151
+ throw isAppNotPublished(error) ? new AppNotPublishedError : error;
266152
+ }
266153
+ }
266131
266154
  async function openAction({
266132
266155
  isNonInteractive
266133
266156
  }) {
266134
- const siteUrl = await getSiteUrl();
266157
+ const siteUrl = await getPublishedSiteUrl();
266135
266158
  if (!isNonInteractive) {
266136
266159
  await open_default(siteUrl);
266137
266160
  }
@@ -275053,4 +275076,4 @@ export {
275053
275076
  runCLI
275054
275077
  };
275055
275078
 
275056
- //# debugId=8867935948E85B0C64756E2164756E21
275079
+ //# debugId=466212F1DC31ACE064756E2164756E21