@absolutejs/absolute 0.19.0-beta.663 → 0.19.0-beta.665
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/angular/index.js +2 -2
- package/dist/angular/index.js.map +1 -1
- package/dist/angular/server.js +2 -2
- package/dist/angular/server.js.map +1 -1
- package/dist/build.js +2 -2
- package/dist/build.js.map +1 -1
- package/dist/cli/index.js +283 -92
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -668,7 +668,7 @@ var exports_compile = {};
|
|
|
668
668
|
__export(exports_compile, {
|
|
669
669
|
compile: () => compile
|
|
670
670
|
});
|
|
671
|
-
var {env:
|
|
671
|
+
var {env: env4 } = globalThis.Bun;
|
|
672
672
|
import { existsSync as existsSync9, readdirSync, readFileSync as readFileSync8, unlinkSync } from "fs";
|
|
673
673
|
import { basename as basename2, join as join6, relative, resolve as resolve7 } from "path";
|
|
674
674
|
var cliTag3 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[cli]\x1B[0m ${color}${message}\x1B[0m`, collectFiles2 = (dir) => {
|
|
@@ -847,7 +847,7 @@ console.log(\`
|
|
|
847
847
|
\`);
|
|
848
848
|
`;
|
|
849
849
|
}, stubPlugin, FRAMEWORK_EXTERNALS, compile = async (serverEntry, outdir, outfile, configPath2) => {
|
|
850
|
-
const prerenderPort = Number(
|
|
850
|
+
const prerenderPort = Number(env4.COMPILE_PORT) || Number(env4.PORT) || DEFAULT_PORT + 1;
|
|
851
851
|
killStaleProcesses(prerenderPort);
|
|
852
852
|
const entryName = basename2(serverEntry).replace(/\.[^.]+$/, "");
|
|
853
853
|
const resolvedOutdir = resolve7(outdir ?? "dist");
|
|
@@ -2379,9 +2379,10 @@ var start = async (serverEntry, outdir, configPath2) => {
|
|
|
2379
2379
|
init_constants();
|
|
2380
2380
|
init_loadConfig();
|
|
2381
2381
|
init_startupBanner();
|
|
2382
|
-
|
|
2382
|
+
var {$: $3 } = globalThis.Bun;
|
|
2383
2383
|
import { existsSync as existsSync8 } from "fs";
|
|
2384
2384
|
import { resolve as resolve6 } from "path";
|
|
2385
|
+
init_utils();
|
|
2385
2386
|
var serviceTag = (name, color) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[${name}]\x1B[0m`;
|
|
2386
2387
|
var workspaceTag = (color, message) => `${serviceTag("workspace", color)} ${color}${message}\x1B[0m`;
|
|
2387
2388
|
var sleep = (ms) => new Promise((resolvePromise) => setTimeout(resolvePromise, ms));
|
|
@@ -2392,6 +2393,16 @@ var getServiceUrl = (service) => {
|
|
|
2392
2393
|
}
|
|
2393
2394
|
return `http://localhost:${service.port}/`;
|
|
2394
2395
|
};
|
|
2396
|
+
var getServicePortLabel = (service) => service.port ? `${service.port}` : "no-port";
|
|
2397
|
+
var getHealthcheckUrl = (service) => {
|
|
2398
|
+
if (service.healthcheck) {
|
|
2399
|
+
return service.healthcheck;
|
|
2400
|
+
}
|
|
2401
|
+
if (service.kind === "absolute" && service.port) {
|
|
2402
|
+
return `http://127.0.0.1:${service.port}/hmr-status`;
|
|
2403
|
+
}
|
|
2404
|
+
return;
|
|
2405
|
+
};
|
|
2395
2406
|
var ensureWorkspaceConfig = (config) => {
|
|
2396
2407
|
if (!config.workspace?.services || Object.keys(config.workspace.services).length === 0) {
|
|
2397
2408
|
throw new Error("absolute.config.ts is missing workspace.services. Add a workspace section before using `absolute workspace dev`.");
|
|
@@ -2415,7 +2426,7 @@ var resolveHealthcheck = (healthcheck) => {
|
|
|
2415
2426
|
url: healthcheck.url
|
|
2416
2427
|
};
|
|
2417
2428
|
};
|
|
2418
|
-
var waitForHealthcheck = async (
|
|
2429
|
+
var waitForHealthcheck = async (healthcheck) => {
|
|
2419
2430
|
const resolved = resolveHealthcheck(healthcheck);
|
|
2420
2431
|
if (!resolved) {
|
|
2421
2432
|
return;
|
|
@@ -2425,13 +2436,12 @@ var waitForHealthcheck = async (name, healthcheck) => {
|
|
|
2425
2436
|
try {
|
|
2426
2437
|
const response = await fetch(resolved.url);
|
|
2427
2438
|
if (response.ok) {
|
|
2428
|
-
console.log(workspaceTag("\x1B[32m", `${name} passed healthcheck ${resolved.url}`));
|
|
2429
2439
|
return;
|
|
2430
2440
|
}
|
|
2431
2441
|
} catch {}
|
|
2432
2442
|
await sleep(resolved.intervalMs);
|
|
2433
2443
|
}
|
|
2434
|
-
throw new Error(
|
|
2444
|
+
throw new Error(`service did not become healthy within ${resolved.timeoutMs}ms (${resolved.url})`);
|
|
2435
2445
|
};
|
|
2436
2446
|
var topologicallySortServices = (services) => {
|
|
2437
2447
|
const ordered = [];
|
|
@@ -2464,8 +2474,17 @@ var topologicallySortServices = (services) => {
|
|
|
2464
2474
|
}
|
|
2465
2475
|
return ordered;
|
|
2466
2476
|
};
|
|
2467
|
-
var createLineForwarder = (name, color, dest) => {
|
|
2477
|
+
var createLineForwarder = (name, color, dest, onBeforeWrite, onAfterWrite) => {
|
|
2468
2478
|
let buffer = "";
|
|
2479
|
+
const writeLine = (line) => {
|
|
2480
|
+
if (line.trim().length === 0) {
|
|
2481
|
+
return;
|
|
2482
|
+
}
|
|
2483
|
+
onBeforeWrite?.();
|
|
2484
|
+
dest.write(`${serviceTag(name, color)} ${line}
|
|
2485
|
+
`);
|
|
2486
|
+
onAfterWrite?.();
|
|
2487
|
+
};
|
|
2469
2488
|
return {
|
|
2470
2489
|
push: (chunk) => {
|
|
2471
2490
|
buffer += Buffer.from(chunk).toString();
|
|
@@ -2473,24 +2492,42 @@ var createLineForwarder = (name, color, dest) => {
|
|
|
2473
2492
|
`);
|
|
2474
2493
|
buffer = lines.pop() ?? "";
|
|
2475
2494
|
for (const line of lines) {
|
|
2476
|
-
|
|
2477
|
-
`);
|
|
2495
|
+
writeLine(line);
|
|
2478
2496
|
}
|
|
2479
2497
|
},
|
|
2480
2498
|
flush: () => {
|
|
2481
|
-
if (!buffer) {
|
|
2499
|
+
if (!buffer || buffer.trim().length === 0) {
|
|
2500
|
+
buffer = "";
|
|
2482
2501
|
return;
|
|
2483
2502
|
}
|
|
2484
|
-
|
|
2485
|
-
`);
|
|
2503
|
+
writeLine(buffer);
|
|
2486
2504
|
buffer = "";
|
|
2487
2505
|
}
|
|
2488
2506
|
};
|
|
2489
2507
|
};
|
|
2490
|
-
var pipeProcessLogs = (name, processHandle) => {
|
|
2491
|
-
const stdoutForwarder = createLineForwarder(name, "\x1B[36m", process.stdout);
|
|
2492
|
-
const stderrForwarder = createLineForwarder(name, "\x1B[31m", process.stderr);
|
|
2493
|
-
|
|
2508
|
+
var pipeProcessLogs = (name, processHandle, onBeforeWrite, onAfterWrite) => {
|
|
2509
|
+
const stdoutForwarder = createLineForwarder(name, "\x1B[36m", process.stdout, onBeforeWrite, onAfterWrite);
|
|
2510
|
+
const stderrForwarder = createLineForwarder(name, "\x1B[31m", process.stderr, onBeforeWrite, onAfterWrite);
|
|
2511
|
+
let bufferingStartupLogs = true;
|
|
2512
|
+
const stdoutStartupChunks = [];
|
|
2513
|
+
const stderrStartupChunks = [];
|
|
2514
|
+
const releaseStartupLogs = () => {
|
|
2515
|
+
if (!bufferingStartupLogs) {
|
|
2516
|
+
return;
|
|
2517
|
+
}
|
|
2518
|
+
bufferingStartupLogs = false;
|
|
2519
|
+
for (const chunk of stdoutStartupChunks) {
|
|
2520
|
+
stdoutForwarder.push(chunk);
|
|
2521
|
+
}
|
|
2522
|
+
stdoutStartupChunks.length = 0;
|
|
2523
|
+
stdoutForwarder.flush();
|
|
2524
|
+
for (const chunk of stderrStartupChunks) {
|
|
2525
|
+
stderrForwarder.push(chunk);
|
|
2526
|
+
}
|
|
2527
|
+
stderrStartupChunks.length = 0;
|
|
2528
|
+
stderrForwarder.flush();
|
|
2529
|
+
};
|
|
2530
|
+
const forward = async (stream, forwarder, startupBuffer) => {
|
|
2494
2531
|
const reader = stream.getReader();
|
|
2495
2532
|
try {
|
|
2496
2533
|
while (true) {
|
|
@@ -2498,21 +2535,29 @@ var pipeProcessLogs = (name, processHandle) => {
|
|
|
2498
2535
|
if (done) {
|
|
2499
2536
|
break;
|
|
2500
2537
|
}
|
|
2501
|
-
if (value) {
|
|
2502
|
-
|
|
2538
|
+
if (!value) {
|
|
2539
|
+
continue;
|
|
2540
|
+
}
|
|
2541
|
+
if (bufferingStartupLogs) {
|
|
2542
|
+
startupBuffer.push(value);
|
|
2543
|
+
continue;
|
|
2503
2544
|
}
|
|
2545
|
+
forwarder.push(value);
|
|
2504
2546
|
}
|
|
2505
2547
|
} finally {
|
|
2506
|
-
|
|
2548
|
+
if (!bufferingStartupLogs) {
|
|
2549
|
+
forwarder.flush();
|
|
2550
|
+
}
|
|
2507
2551
|
reader.releaseLock();
|
|
2508
2552
|
}
|
|
2509
2553
|
};
|
|
2510
|
-
forward(processHandle.stdout, stdoutForwarder);
|
|
2511
|
-
forward(processHandle.stderr, stderrForwarder);
|
|
2554
|
+
forward(processHandle.stdout, stdoutForwarder, stdoutStartupChunks);
|
|
2555
|
+
forward(processHandle.stderr, stderrForwarder, stderrStartupChunks);
|
|
2556
|
+
return { releaseStartupLogs };
|
|
2512
2557
|
};
|
|
2513
2558
|
var resolveService = (name, service, options) => {
|
|
2514
2559
|
const cwd = resolve6(service.cwd ?? ".");
|
|
2515
|
-
const
|
|
2560
|
+
const envVars = {
|
|
2516
2561
|
...process.env,
|
|
2517
2562
|
...service.env,
|
|
2518
2563
|
ABSOLUTE_WORKSPACE_SERVICE_NAME: name,
|
|
@@ -2520,13 +2565,13 @@ var resolveService = (name, service, options) => {
|
|
|
2520
2565
|
FORCE_COLOR: "1",
|
|
2521
2566
|
NODE_ENV: "development"
|
|
2522
2567
|
};
|
|
2523
|
-
if (service.port && !
|
|
2524
|
-
|
|
2568
|
+
if (service.port && !envVars.PORT) {
|
|
2569
|
+
envVars.PORT = String(service.port);
|
|
2525
2570
|
}
|
|
2526
2571
|
if (service.kind === "absolute") {
|
|
2527
2572
|
const configPath2 = service.config ? resolve6(cwd, service.config) : options.configPath ? resolve6(options.configPath) : process.env.ABSOLUTE_CONFIG ? resolve6(process.env.ABSOLUTE_CONFIG) : undefined;
|
|
2528
2573
|
if (configPath2) {
|
|
2529
|
-
|
|
2574
|
+
envVars.ABSOLUTE_CONFIG = configPath2;
|
|
2530
2575
|
}
|
|
2531
2576
|
const command = [
|
|
2532
2577
|
process.execPath,
|
|
@@ -2538,7 +2583,7 @@ var resolveService = (name, service, options) => {
|
|
|
2538
2583
|
command,
|
|
2539
2584
|
configPath: configPath2,
|
|
2540
2585
|
cwd,
|
|
2541
|
-
env:
|
|
2586
|
+
env: envVars,
|
|
2542
2587
|
name,
|
|
2543
2588
|
service,
|
|
2544
2589
|
visibility: getVisibility(service)
|
|
@@ -2547,12 +2592,19 @@ var resolveService = (name, service, options) => {
|
|
|
2547
2592
|
return {
|
|
2548
2593
|
command: service.command,
|
|
2549
2594
|
cwd,
|
|
2550
|
-
env:
|
|
2595
|
+
env: envVars,
|
|
2551
2596
|
name,
|
|
2552
2597
|
service,
|
|
2553
2598
|
visibility: getVisibility(service)
|
|
2554
2599
|
};
|
|
2555
2600
|
};
|
|
2601
|
+
var renderWorkspaceStepStart = (message) => {
|
|
2602
|
+
process.stdout.write(`${workspaceTag("\x1B[36m", message)}\r`);
|
|
2603
|
+
};
|
|
2604
|
+
var renderWorkspaceStepDone = (message, color = "\x1B[32m") => {
|
|
2605
|
+
process.stdout.write(`\r\x1B[2K${workspaceTag(color, message)}
|
|
2606
|
+
`);
|
|
2607
|
+
};
|
|
2556
2608
|
var workspace = async (subcommand, options) => {
|
|
2557
2609
|
if (subcommand !== "dev") {
|
|
2558
2610
|
throw new Error(subcommand ? `Unknown workspace command: ${subcommand}` : "No workspace subcommand specified. Use `absolute workspace dev`.");
|
|
@@ -2562,85 +2614,224 @@ var workspace = async (subcommand, options) => {
|
|
|
2562
2614
|
const orderedNames = topologicallySortServices(workspaceConfig.services);
|
|
2563
2615
|
const running = [];
|
|
2564
2616
|
let shuttingDown = false;
|
|
2565
|
-
|
|
2566
|
-
|
|
2617
|
+
let restarting = false;
|
|
2618
|
+
let paused = false;
|
|
2619
|
+
let workspaceReady = false;
|
|
2620
|
+
let interactive = null;
|
|
2621
|
+
const withPromptHidden = () => {
|
|
2622
|
+
if (!workspaceReady) {
|
|
2567
2623
|
return;
|
|
2568
2624
|
}
|
|
2569
|
-
|
|
2570
|
-
|
|
2625
|
+
interactive?.clearPrompt();
|
|
2626
|
+
};
|
|
2627
|
+
const restorePrompt = () => {
|
|
2628
|
+
if (!workspaceReady) {
|
|
2629
|
+
return;
|
|
2630
|
+
}
|
|
2631
|
+
interactive?.showPrompt();
|
|
2632
|
+
};
|
|
2633
|
+
const killProcesses = async () => {
|
|
2634
|
+
const snapshot = [...running];
|
|
2635
|
+
running.length = 0;
|
|
2636
|
+
for (const service of snapshot) {
|
|
2571
2637
|
try {
|
|
2572
2638
|
service.process.kill();
|
|
2573
2639
|
} catch {}
|
|
2574
2640
|
}
|
|
2575
|
-
await Promise.all(
|
|
2641
|
+
await Promise.all(snapshot.map((service) => service.process.exited));
|
|
2642
|
+
};
|
|
2643
|
+
const sendSignalToService = (processHandle, signal) => {
|
|
2644
|
+
try {
|
|
2645
|
+
process.kill(-processHandle.pid, signal);
|
|
2646
|
+
return;
|
|
2647
|
+
} catch {}
|
|
2648
|
+
try {
|
|
2649
|
+
process.kill(processHandle.pid, signal);
|
|
2650
|
+
} catch {}
|
|
2651
|
+
};
|
|
2652
|
+
const shutdown = async (exitCode = 0) => {
|
|
2653
|
+
if (shuttingDown) {
|
|
2654
|
+
return;
|
|
2655
|
+
}
|
|
2656
|
+
shuttingDown = true;
|
|
2657
|
+
if (interactive) {
|
|
2658
|
+
interactive.dispose();
|
|
2659
|
+
}
|
|
2660
|
+
if (paused) {
|
|
2661
|
+
for (const service of running) {
|
|
2662
|
+
sendSignalToService(service.process, "SIGCONT");
|
|
2663
|
+
}
|
|
2664
|
+
paused = false;
|
|
2665
|
+
}
|
|
2666
|
+
await killProcesses();
|
|
2576
2667
|
process.exit(exitCode);
|
|
2577
2668
|
};
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2669
|
+
const buildWorkspaceReadySummary = () => {
|
|
2670
|
+
const publicServices = orderedNames.map((name) => {
|
|
2671
|
+
const service = workspaceConfig.services[name];
|
|
2672
|
+
if (!service || getVisibility(service) !== "public") {
|
|
2673
|
+
return null;
|
|
2674
|
+
}
|
|
2675
|
+
const url = getServiceUrl(service);
|
|
2676
|
+
return url ? `${name} ${url}` : name;
|
|
2677
|
+
}).filter((value) => Boolean(value));
|
|
2678
|
+
const internalServices = orderedNames.map((name) => {
|
|
2679
|
+
const service = workspaceConfig.services[name];
|
|
2680
|
+
if (!service || getVisibility(service) !== "internal") {
|
|
2681
|
+
return null;
|
|
2682
|
+
}
|
|
2683
|
+
return service.port ? `${name} on ${service.port}` : name;
|
|
2684
|
+
}).filter((value) => Boolean(value));
|
|
2685
|
+
const segments = [];
|
|
2686
|
+
if (publicServices.length > 0) {
|
|
2687
|
+
segments.push(...publicServices);
|
|
2593
2688
|
}
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
if (port > 0) {
|
|
2597
|
-
killStaleProcesses(port);
|
|
2689
|
+
if (internalServices.length > 0) {
|
|
2690
|
+
segments.push(`internal: ${internalServices.join(", ")}`);
|
|
2598
2691
|
}
|
|
2599
|
-
|
|
2600
|
-
|
|
2692
|
+
return segments.join(" \xB7 ");
|
|
2693
|
+
};
|
|
2694
|
+
const startServices = async () => {
|
|
2695
|
+
workspaceReady = false;
|
|
2696
|
+
for (const name of orderedNames) {
|
|
2697
|
+
const service = workspaceConfig.services[name];
|
|
2698
|
+
if (!service) {
|
|
2699
|
+
throw new Error(`workspace.services is missing "${name}"`);
|
|
2700
|
+
}
|
|
2701
|
+
const resolved = resolveService(name, service, options);
|
|
2702
|
+
const port = (resolved.service.port ?? Number(resolved.env.PORT ?? "")) || DEFAULT_PORT;
|
|
2703
|
+
if (port > 0) {
|
|
2704
|
+
killStaleProcesses(port);
|
|
2705
|
+
}
|
|
2706
|
+
if (resolved.service.kind === "absolute" && resolved.configPath && !existsSync8(resolved.configPath)) {
|
|
2707
|
+
throw new Error(`${name} references missing config "${resolved.configPath}"`);
|
|
2708
|
+
}
|
|
2709
|
+
renderWorkspaceStepStart(`Starting ${name} (${resolved.visibility}, ${getServicePortLabel(resolved.service)})...`);
|
|
2710
|
+
const processHandle = Bun.spawn(resolved.command, {
|
|
2711
|
+
cwd: resolved.cwd,
|
|
2712
|
+
env: resolved.env,
|
|
2713
|
+
stderr: "pipe",
|
|
2714
|
+
stdin: "ignore",
|
|
2715
|
+
stdout: "pipe"
|
|
2716
|
+
});
|
|
2717
|
+
const { releaseStartupLogs } = pipeProcessLogs(name, processHandle, withPromptHidden, restorePrompt);
|
|
2718
|
+
const runningService = {
|
|
2719
|
+
name,
|
|
2720
|
+
process: processHandle,
|
|
2721
|
+
resolved,
|
|
2722
|
+
releaseStartupLogs
|
|
2723
|
+
};
|
|
2724
|
+
running.push(runningService);
|
|
2725
|
+
processHandle.exited.then((exitCode) => {
|
|
2726
|
+
if (shuttingDown || restarting) {
|
|
2727
|
+
return;
|
|
2728
|
+
}
|
|
2729
|
+
if (!running.includes(runningService)) {
|
|
2730
|
+
return;
|
|
2731
|
+
}
|
|
2732
|
+
console.error(workspaceTag("\x1B[31m", `${name} exited with code ${exitCode}. Shutting down workspace.`));
|
|
2733
|
+
shutdown(exitCode || 1);
|
|
2734
|
+
});
|
|
2735
|
+
await waitForHealthcheck(getHealthcheckUrl(resolved.service));
|
|
2736
|
+
renderWorkspaceStepDone(`${name} ready`);
|
|
2737
|
+
releaseStartupLogs();
|
|
2601
2738
|
}
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2739
|
+
workspaceReady = true;
|
|
2740
|
+
console.log(workspaceTag("\x1B[32m", `Ready \xB7 ${buildWorkspaceReadySummary()}`));
|
|
2741
|
+
printHint();
|
|
2742
|
+
interactive?.showPrompt();
|
|
2743
|
+
};
|
|
2744
|
+
const restartWorkspace = async () => {
|
|
2745
|
+
if (shuttingDown || restarting) {
|
|
2746
|
+
return;
|
|
2747
|
+
}
|
|
2748
|
+
restarting = true;
|
|
2749
|
+
workspaceReady = false;
|
|
2750
|
+
if (paused) {
|
|
2751
|
+
for (const service of running) {
|
|
2752
|
+
sendSignalToService(service.process, "SIGCONT");
|
|
2615
2753
|
}
|
|
2616
|
-
|
|
2617
|
-
shutdown(exitCode || 1);
|
|
2618
|
-
});
|
|
2619
|
-
await waitForHealthcheck(name, resolved.service.healthcheck);
|
|
2620
|
-
}
|
|
2621
|
-
console.log(workspaceTag("\x1B[32m", `Workspace ready with ${running.length} services.`));
|
|
2622
|
-
const publicServices = orderedNames.map((name) => {
|
|
2623
|
-
const service = workspaceConfig.services[name];
|
|
2624
|
-
if (!service || getVisibility(service) !== "public") {
|
|
2625
|
-
return null;
|
|
2754
|
+
paused = false;
|
|
2626
2755
|
}
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2756
|
+
withPromptHidden();
|
|
2757
|
+
console.log(workspaceTag("\x1B[36m", "Restarting workspace..."));
|
|
2758
|
+
await killProcesses();
|
|
2759
|
+
restarting = false;
|
|
2760
|
+
await startServices();
|
|
2761
|
+
};
|
|
2762
|
+
const togglePause = () => {
|
|
2763
|
+
if (paused) {
|
|
2764
|
+
for (const service of running) {
|
|
2765
|
+
sendSignalToService(service.process, "SIGCONT");
|
|
2766
|
+
}
|
|
2767
|
+
paused = false;
|
|
2768
|
+
console.log(workspaceTag("\x1B[32m", "Workspace resumed."));
|
|
2769
|
+
} else {
|
|
2770
|
+
for (const service of running) {
|
|
2771
|
+
sendSignalToService(service.process, "SIGSTOP");
|
|
2772
|
+
}
|
|
2773
|
+
paused = true;
|
|
2774
|
+
console.log(`${workspaceTag("\x1B[33m", "Workspace paused.")} \x1B[90m[paused]\x1B[0m`);
|
|
2634
2775
|
}
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2776
|
+
};
|
|
2777
|
+
const runShellCommand2 = async (command) => {
|
|
2778
|
+
await $3`${{ raw: command }}`.env({ ...process.env, FORCE_COLOR: "1" }).nothrow();
|
|
2779
|
+
};
|
|
2780
|
+
const openInBrowser = async () => {
|
|
2781
|
+
const publicService = orderedNames.map((name) => workspaceConfig.services[name]).find((service) => service && getVisibility(service) === "public");
|
|
2782
|
+
const url = publicService ? getServiceUrl(publicService) : null;
|
|
2783
|
+
if (!url) {
|
|
2784
|
+
console.log(workspaceTag("\x1B[33m", "No public service to open."));
|
|
2785
|
+
return;
|
|
2786
|
+
}
|
|
2787
|
+
const { platform: platform4 } = process;
|
|
2788
|
+
const isWSL = platform4 === "linux" && isWSLEnvironment();
|
|
2789
|
+
let cmd;
|
|
2790
|
+
if (isWSL) {
|
|
2791
|
+
cmd = "cmd.exe";
|
|
2792
|
+
} else if (platform4 === "darwin") {
|
|
2793
|
+
cmd = "open";
|
|
2794
|
+
} else if (platform4 === "win32") {
|
|
2795
|
+
cmd = "start";
|
|
2796
|
+
} else {
|
|
2797
|
+
cmd = "xdg-open";
|
|
2798
|
+
}
|
|
2799
|
+
const args = isWSL ? ["/c", "start", url] : [url];
|
|
2800
|
+
try {
|
|
2801
|
+
Bun.spawn([cmd, ...args], {
|
|
2802
|
+
stderr: "ignore",
|
|
2803
|
+
stdout: "ignore"
|
|
2804
|
+
});
|
|
2805
|
+
console.log(workspaceTag("\x1B[36m", `Opening ${url}`));
|
|
2806
|
+
} catch {
|
|
2807
|
+
console.log(workspaceTag("\x1B[33m", `Could not open browser. Visit ${url}`));
|
|
2808
|
+
}
|
|
2809
|
+
};
|
|
2810
|
+
interactive = createInteractiveHandler({
|
|
2811
|
+
shell: runShellCommand2,
|
|
2812
|
+
clear: () => {
|
|
2813
|
+
process.stdout.write("\x1Bc");
|
|
2814
|
+
},
|
|
2815
|
+
help: () => {
|
|
2816
|
+
printHelp();
|
|
2817
|
+
},
|
|
2818
|
+
open: () => openInBrowser(),
|
|
2819
|
+
pause: () => {
|
|
2820
|
+
togglePause();
|
|
2821
|
+
},
|
|
2822
|
+
quit: () => {
|
|
2823
|
+
shutdown(0);
|
|
2824
|
+
},
|
|
2825
|
+
restart: () => restartWorkspace()
|
|
2826
|
+
});
|
|
2827
|
+
process.on("SIGINT", () => {
|
|
2828
|
+
shutdown(0);
|
|
2829
|
+
});
|
|
2830
|
+
process.on("SIGTERM", () => {
|
|
2831
|
+
shutdown(0);
|
|
2832
|
+
});
|
|
2833
|
+
await startServices();
|
|
2834
|
+
await new Promise(() => {});
|
|
2644
2835
|
};
|
|
2645
2836
|
|
|
2646
2837
|
// src/cli/index.ts
|
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("typescript");
|
|
174806
|
+
const tsPath = __require.resolve("/home/alexkahn/abs/absolutejs/node_modules/typescript/lib/typescript.js");
|
|
174807
174807
|
const tsRootDir = dirname9(tsPath);
|
|
174808
174808
|
tsLibDir = tsRootDir.endsWith("lib") ? tsRootDir : resolve18(tsRootDir, "lib");
|
|
174809
174809
|
const config = readConfiguration("./tsconfig.json");
|
|
@@ -188807,5 +188807,5 @@ export {
|
|
|
188807
188807
|
ANGULAR_INIT_TIMEOUT_MS
|
|
188808
188808
|
};
|
|
188809
188809
|
|
|
188810
|
-
//# debugId=
|
|
188810
|
+
//# debugId=2B2FCBFEECB6C7FA64756E2164756E21
|
|
188811
188811
|
//# sourceMappingURL=index.js.map
|