akanjs 3.0.0-alpha.98 → 3.0.0-alpha.99

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/base/baseEnv.ts CHANGED
@@ -164,9 +164,10 @@ export const getEnv = (): ClientEnv => {
164
164
  ? (window.location.host.split(":")[0] ?? "unknown")
165
165
  : "localhost");
166
166
 
167
+ const selfServerPort = serverHost === "localhost" ? process.env.PORT : undefined;
167
168
  const serverPort =
168
169
  side === "server"
169
- ? parseInt(process.env.AKAN_PUBLIC_SERVER_PORT ?? "8282")
170
+ ? parseInt(process.env.AKAN_PUBLIC_SERVER_PORT ?? selfServerPort ?? "8282")
170
171
  : parseInt(window.location.port || (window.location.protocol === "https:" ? "443" : "80"));
171
172
 
172
173
  const serverHttpProtocol: "http:" | "https:" =
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "akanjs",
3
- "version": "3.0.0-alpha.98",
3
+ "version": "3.0.0-alpha.99",
4
4
  "sourceType": "module",
5
5
  "type": "module",
6
6
  "publishConfig": {
package/server/akanApp.ts CHANGED
@@ -312,6 +312,7 @@ export class AkanApp {
312
312
  const role = this.#getRole(0);
313
313
 
314
314
  Object.assign(process.env, {
315
+ PORT: String(this.#port),
315
316
  NODE_ENV: AkanApp.#defaultChildNodeEnv(),
316
317
  AKAN_REPLICA: this.#replica.value,
317
318
  AKAN_REPLICA_IDX: "0",
@@ -324,7 +325,7 @@ export class AkanApp {
324
325
  });
325
326
 
326
327
  resetEnvCache();
327
- this.logger.info(`Starting ${role} replica in this process (solo); set AKAN_SOLO=false for the gateway`);
328
+ this.logger.debug(`Starting ${role} replica in this process (solo); set AKAN_SOLO=false for the gateway`);
328
329
  const mod = (await import(this.#serverPath)) as { server?: SoloServer; app?: SoloServer };
329
330
  const server = mod.server ?? mod.app;
330
331
  if (!server?.start) throw new Error("server.ts must export server or app with start()");
@@ -401,6 +402,8 @@ export class AkanApp {
401
402
  cwd: process.cwd(),
402
403
  env: {
403
404
  ...process.env,
405
+
406
+ PORT: String(this.#port),
404
407
  NODE_ENV: AkanApp.#defaultChildNodeEnv(),
405
408
  AKAN_REPLICA: this.#replica.value,
406
409
  AKAN_REPLICA_IDX: String(idx),
@@ -329,7 +329,7 @@ export class AkanServer {
329
329
  };
330
330
  if (!requestedWeb.ssr) {
331
331
  this.web = requestedWeb;
332
- this.logger.info("web off: serving api only (AKAN_SSR=false, or a build with `web: false`)");
332
+ this.logger.debug("web off: serving api only (AKAN_SSR=false, or a build with `web: false`)");
333
333
  return noWeb();
334
334
  }
335
335
  const { WebRouter } = await import("./webRouter");
@@ -263,7 +263,7 @@ export class DiLifecycle {
263
263
  for (const dependency of dependencies) if (candidates.has(dependency)) pending.push(dependency);
264
264
  }
265
265
  const mounted = [...selected].sort((a, b) => a.localeCompare(b)).join(", ");
266
- this.logger.info(`Mounting ${selected.size} of ${candidates.size} module(s): ${mounted}`);
266
+ this.logger.debug(`Mounting ${selected.size} of ${candidates.size} module(s): ${mounted}`);
267
267
  return selected;
268
268
  }
269
269
 
@@ -662,7 +662,7 @@ export class DiLifecycle {
662
662
  },
663
663
  })),
664
664
  );
665
- if (liveKeys.length) this.logger.info(`Live sync: ${liveKeys.length} live slice(s) — ${liveKeys.join(", ")}`);
665
+ if (liveKeys.length) this.logger.verbose(`Live sync: ${liveKeys.length} live slice(s) — ${liveKeys.join(", ")}`);
666
666
  return { routes, wsRoutes, routeOptions };
667
667
  }
668
668
 
@@ -205,7 +205,7 @@ export class CascadeRunner {
205
205
 
206
206
  if (!this.#anyEdges.length) return;
207
207
  const wildcards = this.#anyEdges.map((edge) => `${edge.refName}.${edge.key}`).join(", ");
208
- this.#logger.info(
208
+ this.#logger.verbose(
209
209
  `${this.#anyEdges.length} wildcard removeWith edge(s) (${wildcards}): every removal probes them, ` +
210
210
  `and no cascade removes in one query`,
211
211
  );