@absolutejs/absolute 0.19.0-beta.667 → 0.19.0-beta.669

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
@@ -670,7 +670,7 @@ __export(exports_compile, {
670
670
  compile: () => compile
671
671
  });
672
672
  var {env: env3 } = globalThis.Bun;
673
- import { existsSync as existsSync9, readdirSync, readFileSync as readFileSync8, unlinkSync } from "fs";
673
+ import { existsSync as existsSync9, readdirSync, readFileSync as readFileSync9, unlinkSync } from "fs";
674
674
  import { basename as basename2, join as join6, relative, resolve as resolve7 } from "path";
675
675
  var cliTag3 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[cli]\x1B[0m ${color}${message}\x1B[0m`, collectFiles2 = (dir) => {
676
676
  const result = [];
@@ -686,9 +686,9 @@ var cliTag3 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
686
686
  result.push(fullPath);
687
687
  }
688
688
  return result;
689
- }, readPackageVersion2 = (candidate) => {
689
+ }, readPackageVersion3 = (candidate) => {
690
690
  try {
691
- const pkg = JSON.parse(readFileSync8(candidate, "utf-8"));
691
+ const pkg = JSON.parse(readFileSync9(candidate, "utf-8"));
692
692
  if (pkg.name !== "@absolutejs/absolute")
693
693
  return null;
694
694
  const ver = pkg.version;
@@ -696,9 +696,9 @@ var cliTag3 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
696
696
  } catch {
697
697
  return null;
698
698
  }
699
- }, resolvePackageVersion2 = (candidates) => {
699
+ }, resolvePackageVersion3 = (candidates) => {
700
700
  for (const candidate of candidates) {
701
- const version2 = readPackageVersion2(candidate);
701
+ const version2 = readPackageVersion3(candidate);
702
702
  if (version2)
703
703
  return version2;
704
704
  }
@@ -853,7 +853,7 @@ console.log(\`
853
853
  const entryName = basename2(serverEntry).replace(/\.[^.]+$/, "");
854
854
  const resolvedOutdir = resolve7(outdir ?? "dist");
855
855
  const resolvedOutfile = resolve7(outfile ?? "compiled-server");
856
- const absoluteVersion = resolvePackageVersion2([
856
+ const absoluteVersion = resolvePackageVersion3([
857
857
  resolve7(import.meta.dir, "..", "..", "..", "package.json"),
858
858
  resolve7(import.meta.dir, "..", "..", "package.json")
859
859
  ]);
@@ -2379,11 +2379,12 @@ var start = async (serverEntry, outdir, configPath2) => {
2379
2379
  // src/cli/scripts/workspace.ts
2380
2380
  init_constants();
2381
2381
  init_loadConfig();
2382
- import { existsSync as existsSync8 } from "fs";
2382
+ import { existsSync as existsSync8, readFileSync as readFileSync8 } from "fs";
2383
2383
  import { resolve as resolve6 } from "path";
2384
2384
 
2385
2385
  // src/cli/workspaceTui.ts
2386
2386
  init_constants();
2387
+ init_getDurationString();
2387
2388
  import { openSync as openSync2 } from "fs";
2388
2389
  import { ReadStream as ReadStream2 } from "tty";
2389
2390
  var MAX_LOG_ENTRIES = 400;
@@ -2570,21 +2571,10 @@ var getWorkspaceStatus = (services) => {
2570
2571
  }
2571
2572
  return "ready";
2572
2573
  };
2573
- var getStatusSummary = (services) => {
2574
- const publicServices = services.filter((service) => service.visibility === "public" && service.url).map((service) => `${service.name} ${service.url}`);
2575
- const internalServices = services.filter((service) => service.visibility === "internal").map((service) => service.port ? `${service.name} localhost:${service.port}` : service.name);
2576
- const parts = [];
2577
- if (publicServices.length > 0) {
2578
- parts.push(`Public: ${publicServices.join(", ")}`);
2579
- }
2580
- if (internalServices.length > 0) {
2581
- parts.push(`Internal: ${internalServices.join(", ")}`);
2582
- }
2583
- return parts.join(" | ");
2584
- };
2585
2574
  var createWorkspaceTui = ({
2586
2575
  actions,
2587
- services
2576
+ services,
2577
+ version: version2
2588
2578
  }) => {
2589
2579
  let input = null;
2590
2580
  let disposed = false;
@@ -2594,6 +2584,7 @@ var createWorkspaceTui = ({
2594
2584
  let promptBuffer = "";
2595
2585
  let escapeTimer = null;
2596
2586
  let escapeBuffer = "";
2587
+ let readyDurationMs = null;
2597
2588
  const shellHistory = [];
2598
2589
  let shellHistoryIndex = UNFOUND_INDEX;
2599
2590
  const serviceStates = new Map(services.map((service) => [
@@ -2660,16 +2651,15 @@ var createWorkspaceTui = ({
2660
2651
  const height = process.stdout.rows ?? 28;
2661
2652
  const servicesSnapshot = [...serviceStates.values()];
2662
2653
  const workspaceStatus = getWorkspaceStatus(servicesSnapshot);
2663
- const title = `${colors.bold}Absolute Workspace${colors.reset} ${colors.dim}\xB7 ${workspaceStatus}${colors.reset}`;
2664
- const summaryText = truncateText(getStatusSummary(servicesSnapshot), width);
2665
- const summary = `${colors.dim}${summaryText}${colors.reset}`;
2654
+ const statusLabel = workspaceStatus === "ready" && readyDurationMs !== null ? `${colors.dim}ready in${colors.reset} ${colors.bold}${getDurationString(readyDurationMs)}${colors.reset}` : `${colors.dim}${workspaceStatus}${colors.reset}`;
2655
+ const title = `${colors.cyan}${colors.bold}ABSOLUTEJS WORKSPACE${colors.reset} ${colors.dim}v${version2}${colors.reset} ${statusLabel}`;
2666
2656
  const divider = `${colors.dim}${"\u2500".repeat(Math.max(width, 1))}${colors.reset}`;
2667
2657
  const serviceNameWidth = Math.max(7, ...servicesSnapshot.map((service) => service.name.length));
2668
2658
  const visibilityWidth = 8;
2669
2659
  const statusWidth = 10;
2670
2660
  const rows = [];
2671
2661
  rows.push(padLine(title, width));
2672
- rows.push(padLine(summary, width));
2662
+ rows.push(padLine(`${colors.bold}Services${colors.reset}`, width));
2673
2663
  rows.push(divider);
2674
2664
  for (const service of servicesSnapshot) {
2675
2665
  const stateColor = getStatusColor(service.status);
@@ -2726,6 +2716,10 @@ var createWorkspaceTui = ({
2726
2716
  existing.detail = detail;
2727
2717
  scheduleRender();
2728
2718
  };
2719
+ const setReadyDuration = (durationMs) => {
2720
+ readyDurationMs = durationMs;
2721
+ scheduleRender();
2722
+ };
2729
2723
  const addLog = (source, message, level = "info") => {
2730
2724
  const cleanMessage = stripAnsi(message).trimEnd();
2731
2725
  if (!cleanMessage) {
@@ -2913,6 +2907,7 @@ var createWorkspaceTui = ({
2913
2907
  addLog,
2914
2908
  clearLogs,
2915
2909
  dispose,
2910
+ setReadyDuration,
2916
2911
  setServiceStatus,
2917
2912
  start: start2
2918
2913
  };
@@ -2921,6 +2916,32 @@ var createWorkspaceTui = ({
2921
2916
  // src/cli/scripts/workspace.ts
2922
2917
  init_utils();
2923
2918
  var sleep = (ms) => new Promise((resolvePromise) => setTimeout(resolvePromise, ms));
2919
+ var readPackageVersion2 = (candidate) => {
2920
+ try {
2921
+ const pkg = JSON.parse(readFileSync8(candidate, "utf-8"));
2922
+ if (pkg.name !== "@absolutejs/absolute") {
2923
+ return null;
2924
+ }
2925
+ const version2 = pkg.version;
2926
+ return version2;
2927
+ } catch {
2928
+ return null;
2929
+ }
2930
+ };
2931
+ var resolvePackageVersion2 = () => {
2932
+ const candidates = [
2933
+ resolve6(import.meta.dir, "..", "..", "package.json"),
2934
+ resolve6(import.meta.dir, "..", "..", "..", "package.json"),
2935
+ resolve6(import.meta.dir, "..", "..", "..", "..", "package.json")
2936
+ ];
2937
+ for (const candidate of candidates) {
2938
+ const version2 = readPackageVersion2(candidate);
2939
+ if (version2) {
2940
+ return version2;
2941
+ }
2942
+ }
2943
+ return process.env.ABSOLUTE_VERSION || "unknown";
2944
+ };
2924
2945
  var getVisibility = (service) => service.visibility ?? "public";
2925
2946
  var getServiceUrl = (service) => {
2926
2947
  if (!service.port) {
@@ -3097,6 +3118,8 @@ var workspace = async (subcommand, options) => {
3097
3118
  let shuttingDown = false;
3098
3119
  let restarting = false;
3099
3120
  let paused = false;
3121
+ let workspaceBootStartedAt = performance.now();
3122
+ const absoluteVersion = resolvePackageVersion2();
3100
3123
  const tui = createWorkspaceTui({
3101
3124
  actions: {
3102
3125
  open: () => openInBrowser(),
@@ -3117,7 +3140,8 @@ var workspace = async (subcommand, options) => {
3117
3140
  url: service ? getServiceUrl(service) : null,
3118
3141
  visibility: service ? getVisibility(service) : "public"
3119
3142
  };
3120
- })
3143
+ }),
3144
+ version: absoluteVersion
3121
3145
  });
3122
3146
  const killProcesses = async () => {
3123
3147
  const snapshot = [...running];
@@ -3154,6 +3178,7 @@ var workspace = async (subcommand, options) => {
3154
3178
  process.exit(exitCode);
3155
3179
  };
3156
3180
  const startServices = async () => {
3181
+ tui.setReadyDuration(null);
3157
3182
  for (const name of orderedNames) {
3158
3183
  const service = workspaceConfig.services[name];
3159
3184
  if (!service) {
@@ -3214,7 +3239,9 @@ var workspace = async (subcommand, options) => {
3214
3239
  }
3215
3240
  await killProcesses();
3216
3241
  restarting = false;
3242
+ workspaceBootStartedAt = performance.now();
3217
3243
  await startServices();
3244
+ tui.setReadyDuration(performance.now() - workspaceBootStartedAt);
3218
3245
  tui.addLog("workspace", "Workspace ready.", "success");
3219
3246
  };
3220
3247
  const togglePause = () => {
@@ -3287,6 +3314,7 @@ var workspace = async (subcommand, options) => {
3287
3314
  tui.start();
3288
3315
  tui.addLog("workspace", `Workspace booting ${orderedNames.length} services.`, "info");
3289
3316
  await startServices();
3317
+ tui.setReadyDuration(performance.now() - workspaceBootStartedAt);
3290
3318
  tui.addLog("workspace", "Workspace ready.", "success");
3291
3319
  await new Promise(() => {});
3292
3320
  };
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");
@@ -188808,5 +188808,5 @@ export {
188808
188808
  ANGULAR_INIT_TIMEOUT_MS
188809
188809
  };
188810
188810
 
188811
- //# debugId=2F8EDE59772BBE0764756E2164756E21
188811
+ //# debugId=BBBD2775F666C35864756E2164756E21
188812
188812
  //# sourceMappingURL=index.js.map