@base44-preview/cli 0.3.1-pr.693.36e994c → 0.3.1-pr.695.503ca43

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
@@ -270538,6 +270538,19 @@ async function createDevServer(options) {
270538
270538
  return { port, server, shutdown };
270539
270539
  }
270540
270540
 
270541
+ // src/core/project/app-base-url.ts
270542
+ var appPreviewUrl = (appId) => `https://preview--${appId}.base44.app`;
270543
+ var isAppNotPublished = (error) => error instanceof ApiError && error.statusCode === 404;
270544
+ async function resolveAppBaseUrl(appId) {
270545
+ try {
270546
+ return await getSiteUrl();
270547
+ } catch (error) {
270548
+ if (isAppNotPublished(error))
270549
+ return appPreviewUrl(appId);
270550
+ throw error;
270551
+ }
270552
+ }
270553
+
270541
270554
  // src/cli/commands/dev.ts
270542
270555
  function localServerUrl(port) {
270543
270556
  return `http://localhost:${port}`;
@@ -270576,7 +270589,7 @@ async function remoteDevAction(app) {
270576
270589
  if (!site) {
270577
270590
  throw new ConfigInvalidError("base44 dev --remote serves the frontend against the production backend, but this project has no site.serveCommand in base44/config.jsonc.");
270578
270591
  }
270579
- const appBaseUrl = await getSiteUrl();
270592
+ const appBaseUrl = await resolveAppBaseUrl(app.id);
270580
270593
  const runner = createServeCommandRunner({
270581
270594
  ...site,
270582
270595
  appId: app.id,
@@ -270697,17 +270710,6 @@ function inheritedEnv() {
270697
270710
  }
270698
270711
  return env;
270699
270712
  }
270700
- var appPreviewUrl = (appId) => `https://preview--${appId}.base44.app`;
270701
- async function resolveAppBaseUrl(appId) {
270702
- try {
270703
- return await getSiteUrl();
270704
- } catch (error) {
270705
- if (error instanceof ApiError && error.statusCode === 404) {
270706
- return appPreviewUrl(appId);
270707
- }
270708
- throw error;
270709
- }
270710
- }
270711
270713
  async function runScript(options) {
270712
270714
  const { appId, code, local, privileged, dataEnv, serviceToken, sdkVersion } = options;
270713
270715
  verifyDenoInstalled("to run scripts with exec");
@@ -275053,4 +275055,4 @@ export {
275053
275055
  runCLI
275054
275056
  };
275055
275057
 
275056
- //# debugId=8867935948E85B0C64756E2164756E21
275058
+ //# debugId=5897AB86D8A0BE5164756E2164756E21