@base44-preview/cli 0.0.55-pr.545.7e19dbc → 0.0.55-pr.545.81d207d
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 +8 -58
- package/dist/cli/index.js.map +5 -5
- package/package.json +1 -1
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: [
|
|
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
|
-
|
|
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
|
|
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,35 +257399,12 @@ async function createDevServer(options8) {
|
|
|
257422
257399
|
logger: createDevLogger("frontend", theme.colors.base44Orange)
|
|
257423
257400
|
});
|
|
257424
257401
|
}
|
|
257425
|
-
const
|
|
257426
|
-
const errorMessage = error48 instanceof Error ? error48.message : String(error48);
|
|
257427
|
-
devLogger.error(`Failed to shut down dev server: ${errorMessage}`);
|
|
257428
|
-
};
|
|
257429
|
-
const closeServerIfRunning = async () => {
|
|
257430
|
-
if (!server.listening) {
|
|
257431
|
-
return;
|
|
257432
|
-
}
|
|
257433
|
-
await new Promise((resolve12, reject) => {
|
|
257434
|
-
server.close((error48) => {
|
|
257435
|
-
if (error48) {
|
|
257436
|
-
reject(error48);
|
|
257437
|
-
return;
|
|
257438
|
-
}
|
|
257439
|
-
resolve12();
|
|
257440
|
-
});
|
|
257441
|
-
});
|
|
257442
|
-
};
|
|
257443
|
-
const runShutdown = async () => {
|
|
257402
|
+
const shutdown = async () => {
|
|
257444
257403
|
base44ConfigWatcher.close();
|
|
257445
|
-
|
|
257404
|
+
io6.close();
|
|
257446
257405
|
await functionManager.stopAll();
|
|
257447
257406
|
await serveRunner?.stop();
|
|
257448
|
-
|
|
257449
|
-
};
|
|
257450
|
-
let shutdownPromise;
|
|
257451
|
-
const shutdown = () => {
|
|
257452
|
-
shutdownPromise ??= runShutdown().catch(handleShutdownError);
|
|
257453
|
-
return shutdownPromise;
|
|
257407
|
+
server.close();
|
|
257454
257408
|
};
|
|
257455
257409
|
process.on("SIGINT", shutdown);
|
|
257456
257410
|
process.on("SIGTERM", shutdown);
|
|
@@ -257481,9 +257435,6 @@ async function devAction(ctx, options8) {
|
|
|
257481
257435
|
}
|
|
257482
257436
|
const port = options8.port ? Number(options8.port) : undefined;
|
|
257483
257437
|
const appId = app.id;
|
|
257484
|
-
const siteUrlPromise = getSiteUrl().catch(() => {
|
|
257485
|
-
return;
|
|
257486
|
-
});
|
|
257487
257438
|
const { port: resolvedPort, isServingFrontend } = await createDevServer({
|
|
257488
257439
|
log,
|
|
257489
257440
|
port,
|
|
@@ -257491,8 +257442,7 @@ async function devAction(ctx, options8) {
|
|
|
257491
257442
|
denoWrapperPath: getDenoWrapperPath(),
|
|
257492
257443
|
loadResources: async () => {
|
|
257493
257444
|
const { functions, entities, project: project2 } = await readProjectConfig();
|
|
257494
|
-
|
|
257495
|
-
return { functions, entities, project: project2, siteUrl };
|
|
257445
|
+
return { functions, entities, project: project2 };
|
|
257496
257446
|
}
|
|
257497
257447
|
});
|
|
257498
257448
|
const outroMessage = isServingFrontend ? "Open your app using the frontend dev server URL" : `Dev server is available at ${theme.colors.links(localServerUrl(resolvedPort))}`;
|
|
@@ -261978,4 +261928,4 @@ export {
|
|
|
261978
261928
|
CLIExitError
|
|
261979
261929
|
};
|
|
261980
261930
|
|
|
261981
|
-
//# debugId=
|
|
261931
|
+
//# debugId=6B1ECA05EAAE1CF664756E2164756E21
|