@absolutejs/absolute 0.19.0-beta.662 → 0.19.0-beta.664

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
@@ -2385,6 +2385,14 @@ import { resolve as resolve6 } from "path";
2385
2385
  var serviceTag = (name, color) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[${name}]\x1B[0m`;
2386
2386
  var workspaceTag = (color, message) => `${serviceTag("workspace", color)} ${color}${message}\x1B[0m`;
2387
2387
  var sleep = (ms) => new Promise((resolvePromise) => setTimeout(resolvePromise, ms));
2388
+ var getVisibility = (service) => service.visibility ?? "public";
2389
+ var getServiceUrl = (service) => {
2390
+ if (!service.port) {
2391
+ return null;
2392
+ }
2393
+ return `http://localhost:${service.port}/`;
2394
+ };
2395
+ var getServicePortLabel = (service) => service.port ? `:${service.port}` : "no-port";
2388
2396
  var ensureWorkspaceConfig = (config) => {
2389
2397
  if (!config.workspace?.services || Object.keys(config.workspace.services).length === 0) {
2390
2398
  throw new Error("absolute.config.ts is missing workspace.services. Add a workspace section before using `absolute workspace dev`.");
@@ -2418,7 +2426,7 @@ var waitForHealthcheck = async (name, healthcheck) => {
2418
2426
  try {
2419
2427
  const response = await fetch(resolved.url);
2420
2428
  if (response.ok) {
2421
- console.log(workspaceTag("\x1B[32m", `${name} passed healthcheck ${resolved.url}`));
2429
+ console.log(workspaceTag("\x1B[32m", `${name} ready`));
2422
2430
  return;
2423
2431
  }
2424
2432
  } catch {}
@@ -2466,12 +2474,15 @@ var createLineForwarder = (name, color, dest) => {
2466
2474
  `);
2467
2475
  buffer = lines.pop() ?? "";
2468
2476
  for (const line of lines) {
2477
+ if (line.trim().length === 0) {
2478
+ continue;
2479
+ }
2469
2480
  dest.write(`${serviceTag(name, color)} ${line}
2470
2481
  `);
2471
2482
  }
2472
2483
  },
2473
2484
  flush: () => {
2474
- if (!buffer) {
2485
+ if (!buffer || buffer.trim().length === 0) {
2475
2486
  return;
2476
2487
  }
2477
2488
  dest.write(`${serviceTag(name, color)} ${buffer}
@@ -2508,6 +2519,8 @@ var resolveService = (name, service, options) => {
2508
2519
  const env3 = {
2509
2520
  ...process.env,
2510
2521
  ...service.env,
2522
+ ABSOLUTE_WORKSPACE_SERVICE_NAME: name,
2523
+ ABSOLUTE_WORKSPACE_SERVICE_VISIBILITY: getVisibility(service),
2511
2524
  FORCE_COLOR: "1",
2512
2525
  NODE_ENV: "development"
2513
2526
  };
@@ -2531,7 +2544,8 @@ var resolveService = (name, service, options) => {
2531
2544
  cwd,
2532
2545
  env: env3,
2533
2546
  name,
2534
- service
2547
+ service,
2548
+ visibility: getVisibility(service)
2535
2549
  };
2536
2550
  }
2537
2551
  return {
@@ -2539,7 +2553,8 @@ var resolveService = (name, service, options) => {
2539
2553
  cwd,
2540
2554
  env: env3,
2541
2555
  name,
2542
- service
2556
+ service,
2557
+ visibility: getVisibility(service)
2543
2558
  };
2544
2559
  };
2545
2560
  var workspace = async (subcommand, options) => {
@@ -2570,7 +2585,11 @@ var workspace = async (subcommand, options) => {
2570
2585
  process.on("SIGTERM", () => {
2571
2586
  shutdown(0);
2572
2587
  });
2573
- console.log(workspaceTag("\x1B[36m", `Starting workspace services: ${orderedNames.join(", ")}`));
2588
+ console.log(workspaceTag("\x1B[36m", `Services: ${orderedNames.map((name) => {
2589
+ const service = workspaceConfig.services[name];
2590
+ const visibility = service ? getVisibility(service) : "public";
2591
+ return visibility === "internal" ? `${name} (internal)` : `${name} (public)`;
2592
+ }).join(", ")}`));
2574
2593
  for (const name of orderedNames) {
2575
2594
  const service = workspaceConfig.services[name];
2576
2595
  if (!service) {
@@ -2584,7 +2603,7 @@ var workspace = async (subcommand, options) => {
2584
2603
  if (resolved.service.kind === "absolute" && resolved.configPath && !existsSync8(resolved.configPath)) {
2585
2604
  throw new Error(`${name} references missing config "${resolved.configPath}"`);
2586
2605
  }
2587
- console.log(workspaceTag("\x1B[36m", `Starting ${name}: ${resolved.command.join(" ")}`));
2606
+ console.log(workspaceTag("\x1B[36m", `Starting ${name} (${resolved.visibility}, ${getServicePortLabel(resolved.service)})`));
2588
2607
  const processHandle = Bun.spawn(resolved.command, {
2589
2608
  cwd: resolved.cwd,
2590
2609
  env: resolved.env,
@@ -2604,6 +2623,27 @@ var workspace = async (subcommand, options) => {
2604
2623
  await waitForHealthcheck(name, resolved.service.healthcheck);
2605
2624
  }
2606
2625
  console.log(workspaceTag("\x1B[32m", `Workspace ready with ${running.length} services.`));
2626
+ const publicServices = orderedNames.map((name) => {
2627
+ const service = workspaceConfig.services[name];
2628
+ if (!service || getVisibility(service) !== "public") {
2629
+ return null;
2630
+ }
2631
+ const url = getServiceUrl(service);
2632
+ return url ? `${name}: ${url}` : `${name}`;
2633
+ }).filter(Boolean);
2634
+ const internalServices = orderedNames.map((name) => {
2635
+ const service = workspaceConfig.services[name];
2636
+ if (!service || getVisibility(service) !== "internal") {
2637
+ return null;
2638
+ }
2639
+ return service.port ? `${name}: :${service.port}` : `${name}`;
2640
+ }).filter(Boolean);
2641
+ if (publicServices.length > 0) {
2642
+ console.log(workspaceTag("\x1B[32m", `Public services: ${publicServices.join(", ")}`));
2643
+ }
2644
+ if (internalServices.length > 0) {
2645
+ console.log(workspaceTag("\x1B[2m", `Internal services: ${internalServices.join(", ")}`));
2646
+ }
2607
2647
  await Promise.all(running.map((service) => service.process.exited));
2608
2648
  };
2609
2649
 
package/dist/index.js CHANGED
@@ -174803,7 +174803,7 @@ ${registrations}
174803
174803
  ({ tsLibDir } = cached);
174804
174804
  cached.lastUsed = Date.now();
174805
174805
  } else {
174806
- const tsPath = __require.resolve("/home/alexkahn/abs/absolutejs/node_modules/typescript/lib/typescript.js");
174806
+ const tsPath = __require.resolve("typescript");
174807
174807
  const tsRootDir = dirname9(tsPath);
174808
174808
  tsLibDir = tsRootDir.endsWith("lib") ? tsRootDir : resolve18(tsRootDir, "lib");
174809
174809
  const config = readConfiguration("./tsconfig.json");
@@ -182354,6 +182354,7 @@ var getLocalIPAddress = () => {
182354
182354
  init_startupBanner();
182355
182355
  var host = env4.HOST ?? "localhost";
182356
182356
  var port = env4.PORT ?? DEFAULT_PORT;
182357
+ var visibility = env4.ABSOLUTE_WORKSPACE_SERVICE_VISIBILITY ?? "public";
182357
182358
  var localIP;
182358
182359
  var args = argv;
182359
182360
  var hostFlag = args.includes("--host");
@@ -182384,6 +182385,9 @@ var networking = (app) => app.listen({
182384
182385
  }
182385
182386
  } : {}
182386
182387
  }, () => {
182388
+ if (visibility === "internal") {
182389
+ return;
182390
+ }
182387
182391
  const isHotReload = Boolean(globalThis.__hmrServerStartup);
182388
182392
  globalThis.__hmrServerStartup = true;
182389
182393
  if (isHotReload) {
@@ -188803,5 +188807,5 @@ export {
188803
188807
  ANGULAR_INIT_TIMEOUT_MS
188804
188808
  };
188805
188809
 
188806
- //# debugId=CDE81E54B75AFAE164756E2164756E21
188810
+ //# debugId=845140FABD0993C064756E2164756E21
188807
188811
  //# sourceMappingURL=index.js.map