@base44-preview/cli 0.0.55-pr.545.0401b80 → 0.0.55-pr.545.1a6240e

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
@@ -255490,7 +255490,6 @@ class ServeRunner {
255490
255490
  logger;
255491
255491
  child;
255492
255492
  stopping = false;
255493
- stopPromise;
255494
255493
  exitListeners = [];
255495
255494
  constructor(options8) {
255496
255495
  this.command = options8.command;
@@ -255502,14 +255501,12 @@ class ServeRunner {
255502
255501
  if (this.child) {
255503
255502
  return;
255504
255503
  }
255505
- const stdin2 = process21.platform === "win32" ? "ignore" : "inherit";
255506
255504
  const child = spawn3(this.command, {
255507
255505
  cwd: this.cwd,
255508
255506
  shell: true,
255509
255507
  detached: process21.platform !== "win32",
255510
255508
  env: { ...process21.env, ...this.env },
255511
- stdio: [stdin2, "pipe", "pipe"],
255512
- windowsHide: true
255509
+ stdio: ["inherit", "pipe", "pipe"]
255513
255510
  });
255514
255511
  this.child = child;
255515
255512
  this.setupHandlers(child);
@@ -255518,13 +255515,6 @@ class ServeRunner {
255518
255515
  this.exitListeners.push(listener);
255519
255516
  }
255520
255517
  async stop() {
255521
- if (this.stopPromise) {
255522
- return this.stopPromise;
255523
- }
255524
- this.stopPromise = this.stopChild();
255525
- return this.stopPromise;
255526
- }
255527
- async stopChild() {
255528
255518
  const child = this.child;
255529
255519
  if (!child || child.exitCode !== null) {
255530
255520
  return;
@@ -255532,14 +255522,7 @@ class ServeRunner {
255532
255522
  this.stopping = true;
255533
255523
  const exited = new Promise((resolve10) => child.once("exit", () => resolve10()));
255534
255524
  if (process21.platform === "win32" && child.pid) {
255535
- const taskkill = spawn3("taskkill", ["/pid", String(child.pid), "/T", "/F"], {
255536
- stdio: "ignore",
255537
- windowsHide: true
255538
- });
255539
- await new Promise((resolve10) => {
255540
- taskkill.once("exit", () => resolve10());
255541
- taskkill.once("error", () => resolve10());
255542
- });
255525
+ spawn3("taskkill", ["/pid", String(child.pid), "/T", "/F"]);
255543
255526
  } else if (child.pid) {
255544
255527
  try {
255545
255528
  process21.kill(-child.pid, "SIGTERM");
@@ -257287,7 +257270,7 @@ async function createDevServer(options8) {
257287
257270
  port: process.env.IS_TEST === "true" ? undefined : DEFAULT_PORT
257288
257271
  });
257289
257272
  const baseUrl = `http://localhost:${port}`;
257290
- const { functions, entities, project: project2, siteUrl } = await options8.loadResources();
257273
+ const { functions, entities, project: project2 } = await options8.loadResources();
257291
257274
  const app = import_express6.default();
257292
257275
  const remoteProxy = import_http_proxy_middleware2.createProxyMiddleware({
257293
257276
  target: BASE44_APP_URL,
@@ -257347,12 +257330,6 @@ async function createDevServer(options8) {
257347
257330
  const customIntegrationRoutes = createCustomIntegrationRoutes(remoteProxy, devLogger);
257348
257331
  app.use("/api/apps/:appId/integrations/custom", customIntegrationRoutes);
257349
257332
  app.use((req, res, next) => {
257350
- if (siteUrl && (req.path === "/login" || req.path.startsWith("/login/"))) {
257351
- const targetUrl = new URL(req.originalUrl, siteUrl);
257352
- devLogger.warn(`"${req.originalUrl}" requires hosted login, redirecting to ${targetUrl.toString()}`);
257353
- res.redirect(targetUrl.toString());
257354
- return;
257355
- }
257356
257333
  if (!req.originalUrl.endsWith("analytics/track/batch")) {
257357
257334
  devLogger.warn(`"${req.originalUrl}" is not supported in local development, passing call to production`);
257358
257335
  }
@@ -257422,30 +257399,12 @@ async function createDevServer(options8) {
257422
257399
  logger: createDevLogger("frontend", theme.colors.base44Orange)
257423
257400
  });
257424
257401
  }
257425
- const closeServer = () => new Promise((resolve12, reject) => {
257426
- server.close((error48) => {
257427
- if (error48) {
257428
- reject(error48);
257429
- return;
257430
- }
257431
- resolve12();
257432
- });
257433
- });
257434
- const handleShutdownError = (error48) => {
257435
- const errorMessage = error48 instanceof Error ? error48.message : String(error48);
257436
- devLogger.error(`Failed to shut down dev server: ${errorMessage}`);
257437
- };
257438
- const runShutdown = async () => {
257402
+ const shutdown = async () => {
257439
257403
  base44ConfigWatcher.close();
257440
257404
  io6.close();
257441
257405
  await functionManager.stopAll();
257442
257406
  await serveRunner?.stop();
257443
- await closeServer();
257444
- };
257445
- let shutdownPromise;
257446
- const shutdown = () => {
257447
- shutdownPromise ??= runShutdown().catch(handleShutdownError);
257448
- return shutdownPromise;
257407
+ server.close();
257449
257408
  };
257450
257409
  process.on("SIGINT", shutdown);
257451
257410
  process.on("SIGTERM", shutdown);
@@ -257476,9 +257435,6 @@ async function devAction(ctx, options8) {
257476
257435
  }
257477
257436
  const port = options8.port ? Number(options8.port) : undefined;
257478
257437
  const appId = app.id;
257479
- const siteUrlPromise = getSiteUrl().catch(() => {
257480
- return;
257481
- });
257482
257438
  const { port: resolvedPort, isServingFrontend } = await createDevServer({
257483
257439
  log,
257484
257440
  port,
@@ -257486,8 +257442,7 @@ async function devAction(ctx, options8) {
257486
257442
  denoWrapperPath: getDenoWrapperPath(),
257487
257443
  loadResources: async () => {
257488
257444
  const { functions, entities, project: project2 } = await readProjectConfig();
257489
- const siteUrl = await siteUrlPromise;
257490
- return { functions, entities, project: project2, siteUrl };
257445
+ return { functions, entities, project: project2 };
257491
257446
  }
257492
257447
  });
257493
257448
  const outroMessage = isServingFrontend ? "Open your app using the frontend dev server URL" : `Dev server is available at ${theme.colors.links(localServerUrl(resolvedPort))}`;
@@ -261973,4 +261928,4 @@ export {
261973
261928
  CLIExitError
261974
261929
  };
261975
261930
 
261976
- //# debugId=EDDC63E20F783F9364756E2164756E21
261931
+ //# debugId=6B1ECA05EAAE1CF664756E2164756E21