@base44-preview/cli 0.0.55-pr.545.7ed3721 → 0.0.55-pr.545.8ee8765

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
@@ -255501,13 +255501,12 @@ class ServeRunner {
255501
255501
  if (this.child) {
255502
255502
  return;
255503
255503
  }
255504
- const stdin2 = process21.platform === "win32" ? "ignore" : "inherit";
255505
255504
  const child = spawn3(this.command, {
255506
255505
  cwd: this.cwd,
255507
255506
  shell: true,
255508
255507
  detached: process21.platform !== "win32",
255509
255508
  env: { ...process21.env, ...this.env },
255510
- stdio: [stdin2, "pipe", "pipe"]
255509
+ stdio: ["inherit", "pipe", "pipe"]
255511
255510
  });
255512
255511
  this.child = child;
255513
255512
  this.setupHandlers(child);
@@ -255521,10 +255520,27 @@ class ServeRunner {
255521
255520
  return;
255522
255521
  }
255523
255522
  this.stopping = true;
255523
+ const hasExited = () => child.exitCode !== null || child.signalCode !== null;
255524
255524
  const exited = new Promise((resolve10) => child.once("exit", () => resolve10()));
255525
+ const waitForExit2 = async (timeoutMs) => {
255526
+ await Promise.race([
255527
+ exited,
255528
+ new Promise((resolve10) => setTimeout(resolve10, timeoutMs))
255529
+ ]);
255530
+ };
255525
255531
  if (process21.platform === "win32" && child.pid) {
255526
- spawn3("taskkill", ["/pid", String(child.pid), "/T", "/F"]);
255527
- } else if (child.pid) {
255532
+ const taskkill = spawn3("taskkill", ["/pid", String(child.pid), "/T", "/F"], {
255533
+ stdio: "ignore"
255534
+ });
255535
+ await new Promise((resolve10) => taskkill.once("exit", () => resolve10()));
255536
+ await waitForExit2(3000);
255537
+ if (!hasExited()) {
255538
+ child.kill("SIGKILL");
255539
+ await waitForExit2(1000);
255540
+ }
255541
+ return;
255542
+ }
255543
+ if (child.pid) {
255528
255544
  try {
255529
255545
  process21.kill(-child.pid, "SIGTERM");
255530
255546
  } catch {
@@ -257271,7 +257287,7 @@ async function createDevServer(options8) {
257271
257287
  port: process.env.IS_TEST === "true" ? undefined : DEFAULT_PORT
257272
257288
  });
257273
257289
  const baseUrl = `http://localhost:${port}`;
257274
- const { functions, entities, project: project2, siteUrl } = await options8.loadResources();
257290
+ const { functions, entities, project: project2 } = await options8.loadResources();
257275
257291
  const app = import_express6.default();
257276
257292
  const remoteProxy = import_http_proxy_middleware2.createProxyMiddleware({
257277
257293
  target: BASE44_APP_URL,
@@ -257331,12 +257347,6 @@ async function createDevServer(options8) {
257331
257347
  const customIntegrationRoutes = createCustomIntegrationRoutes(remoteProxy, devLogger);
257332
257348
  app.use("/api/apps/:appId/integrations/custom", customIntegrationRoutes);
257333
257349
  app.use((req, res, next) => {
257334
- if (siteUrl && (req.path === "/login" || req.path.startsWith("/login/"))) {
257335
- const targetUrl = new URL(req.originalUrl, siteUrl);
257336
- devLogger.warn(`"${req.originalUrl}" requires hosted login, redirecting to ${targetUrl.toString()}`);
257337
- res.redirect(targetUrl.toString());
257338
- return;
257339
- }
257340
257350
  if (!req.originalUrl.endsWith("analytics/track/batch")) {
257341
257351
  devLogger.warn(`"${req.originalUrl}" is not supported in local development, passing call to production`);
257342
257352
  }
@@ -257442,9 +257452,6 @@ async function devAction(ctx, options8) {
257442
257452
  }
257443
257453
  const port = options8.port ? Number(options8.port) : undefined;
257444
257454
  const appId = app.id;
257445
- const siteUrlPromise = getSiteUrl().catch(() => {
257446
- return;
257447
- });
257448
257455
  const { port: resolvedPort, isServingFrontend } = await createDevServer({
257449
257456
  log,
257450
257457
  port,
@@ -257452,8 +257459,7 @@ async function devAction(ctx, options8) {
257452
257459
  denoWrapperPath: getDenoWrapperPath(),
257453
257460
  loadResources: async () => {
257454
257461
  const { functions, entities, project: project2 } = await readProjectConfig();
257455
- const siteUrl = await siteUrlPromise;
257456
- return { functions, entities, project: project2, siteUrl };
257462
+ return { functions, entities, project: project2 };
257457
257463
  }
257458
257464
  });
257459
257465
  const outroMessage = isServingFrontend ? "Open your app using the frontend dev server URL" : `Dev server is available at ${theme.colors.links(localServerUrl(resolvedPort))}`;
@@ -261939,4 +261945,4 @@ export {
261939
261945
  CLIExitError
261940
261946
  };
261941
261947
 
261942
- //# debugId=38217A3EFC1ECB9764756E2164756E21
261948
+ //# debugId=C0C3C333AB7ECBC364756E2164756E21