@tdk-landscape/tdk-cli-core 1.3.155 → 1.3.156
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/cli/dist/commands/doctor.js +106 -1
- package/cli/dist/commands/up.js +27 -4
- package/cli/dist/generator/template-engine.js +23 -0
- package/cli/dist/utils/doctor-crashloop.js +160 -0
- package/cli/dist/utils/doctor-fix.js +211 -0
- package/cli/dist/utils/tilt-port-owner.js +49 -0
- package/cli/dist-bundle/chunk-I3NXJOZC.js +377 -0
- package/cli/dist-bundle/cli.js +320 -370
- package/cli/dist-bundle/{cold-preflight-3RDK76RY.js → cold-preflight-A2DOE5ZP.js} +1 -1
- package/cli/package.json +1 -1
- package/discovery/manifest/loading.star +7 -1
- package/engine/topologies/platform/docker/build/golden_image_dockerfile.star +5 -4
- package/engine/topologies/platform/docker/compose/compose.star +10 -5
- package/engine/topologies/platform/docker/generators/golden_docker_generator_v2.star +1 -1
- package/engine/topologies/platform/docker/layers/l1_base_layers.star +1 -1
- package/engine/topologies/platform/docker/layers/l3_builder_layers.star +1 -1
- package/engine/topologies/platform/docker/layers/l4_runtime_layers.star +14 -1
- package/engine/topologies/tilt/manifest/constants.star +1 -1
- package/package.json +1 -1
- package/cli/dist-bundle/chunk-XTSHWDDE.js +0 -322
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Copyright (c) 2026 TDK Landscape contributors
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
import { execFileSync } from "node:child_process";
|
|
4
|
+
import { realpathSync } from "node:fs";
|
|
5
|
+
import { resolve } from "node:path";
|
|
6
|
+
import { parseTiltProcesses } from "./doctor-wiring.js";
|
|
7
|
+
const run = (command, args) => execFileSync(command, args, {
|
|
8
|
+
encoding: "utf-8",
|
|
9
|
+
stdio: "pipe",
|
|
10
|
+
timeout: 5000,
|
|
11
|
+
windowsHide: true,
|
|
12
|
+
});
|
|
13
|
+
/**
|
|
14
|
+
* The project whose `tilt up` listens on `port`, or null when it cannot be told (no lsof, Windows, a Tilt started
|
|
15
|
+
* without `-f`, a listener that is not Tilt). Callers must treat null as "unknown", not as "not mine".
|
|
16
|
+
*/
|
|
17
|
+
export function findTiltPortOwner(port, platform = process.platform, commandRunner = run) {
|
|
18
|
+
if (platform === "win32")
|
|
19
|
+
return null;
|
|
20
|
+
try {
|
|
21
|
+
const pids = commandRunner("lsof", ["-nP", `-iTCP:${port}`, "-sTCP:LISTEN", "-t"])
|
|
22
|
+
.split(/\r?\n/)
|
|
23
|
+
.map((line) => line.trim())
|
|
24
|
+
.filter(Boolean);
|
|
25
|
+
for (const pid of pids) {
|
|
26
|
+
const command = commandRunner("ps", ["-p", pid, "-o", "command="]).trim();
|
|
27
|
+
const [owner] = parseTiltProcesses(`${pid} ${command}`);
|
|
28
|
+
if (owner)
|
|
29
|
+
return owner;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
// lsof exits 1 when nothing listens, and may be missing.
|
|
34
|
+
}
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
/** Symlinked checkouts (macOS /tmp -> /private/tmp) must not make a project look foreign to itself. */
|
|
38
|
+
function canonical(path) {
|
|
39
|
+
try {
|
|
40
|
+
return realpathSync(path);
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
return resolve(path);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/** Whether `owner` is another project's Tilt, as opposed to this project's or unknown. */
|
|
47
|
+
export function isForeignTilt(owner, projectRoot) {
|
|
48
|
+
return owner !== null && canonical(owner.root) !== canonical(projectRoot);
|
|
49
|
+
}
|