@tdk-landscape/tdk-cli-core 1.3.139 → 1.3.141
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/CHANGELOG.md +1 -0
- package/cli/dist/backend-frameworks/elysia.js +0 -1
- package/cli/dist/backend-frameworks/express.js +0 -1
- package/cli/dist/backend-frameworks/fastify.js +0 -1
- package/cli/dist/backend-frameworks/h3.js +0 -1
- package/cli/dist/backend-frameworks/koa.js +0 -1
- package/cli/dist/backend-frameworks/mcp.js +0 -1
- package/cli/dist/backend-frameworks/nestjs.js +0 -1
- package/cli/dist/backend-frameworks/registry.js +0 -1
- package/cli/dist/backend-frameworks/types.js +0 -1
- package/cli/dist/backend-languages/bun.js +0 -1
- package/cli/dist/backend-languages/go.js +0 -1
- package/cli/dist/backend-languages/python.js +0 -1
- package/cli/dist/backend-languages/registry.js +0 -1
- package/cli/dist/backend-languages/rust.js +0 -1
- package/cli/dist/backend-languages/types.js +0 -1
- package/cli/dist/cli.js +0 -1
- package/cli/dist/commands/__tests__/project-e2e-helpers.js +0 -1
- package/cli/dist/commands/completion.js +0 -1
- package/cli/dist/commands/config.js +3 -14
- package/cli/dist/commands/doctor.js +10 -11
- package/cli/dist/commands/down.js +0 -1
- package/cli/dist/commands/eject.js +0 -1
- package/cli/dist/commands/help.js +0 -1
- package/cli/dist/commands/import.js +0 -1
- package/cli/dist/commands/logs.js +0 -1
- package/cli/dist/commands/maintainers.js +0 -1
- package/cli/dist/commands/mcp.js +0 -1
- package/cli/dist/commands/networks.js +0 -2
- package/cli/dist/commands/project.js +3 -4
- package/cli/dist/commands/projects.js +0 -1
- package/cli/dist/commands/resource.js +8 -9
- package/cli/dist/commands/resources.js +0 -1
- package/cli/dist/commands/runtime.js +0 -1
- package/cli/dist/commands/stack.js +0 -1
- package/cli/dist/commands/stacks.js +0 -1
- package/cli/dist/commands/status.js +0 -1
- package/cli/dist/commands/ui.js +8 -13
- package/cli/dist/commands/up.js +6 -7
- package/cli/dist/commands/upgrade.js +2 -2
- package/cli/dist/commands/version.js +0 -1
- package/cli/dist/components/Accessible.js +4 -3
- package/cli/dist/components/BaseTooltip.js +0 -1
- package/cli/dist/components/DetailPanel.js +0 -1
- package/cli/dist/components/FileTree.js +0 -1
- package/cli/dist/components/ResourceSelectInput.js +3 -3
- package/cli/dist/components/ResourceTable.js +0 -1
- package/cli/dist/components/ServiceIssues.js +0 -1
- package/cli/dist/components/TUIHeader.js +0 -1
- package/cli/dist/components/TabBar.js +0 -1
- package/cli/dist/components/Tooltip.js +0 -1
- package/cli/dist/components/index.js +0 -1
- package/cli/dist/components/ui-theme.js +5 -1
- package/cli/dist/config/platform-standards.js +0 -1
- package/cli/dist/frontend-frameworks/lit.js +0 -1
- package/cli/dist/frontend-frameworks/preact.js +0 -1
- package/cli/dist/frontend-frameworks/qwik.js +0 -1
- package/cli/dist/frontend-frameworks/react.js +0 -1
- package/cli/dist/frontend-frameworks/registry.js +0 -1
- package/cli/dist/frontend-frameworks/solid.js +0 -1
- package/cli/dist/frontend-frameworks/svelte.js +0 -1
- package/cli/dist/frontend-frameworks/tanstack-router.js +0 -1
- package/cli/dist/frontend-frameworks/types.js +0 -1
- package/cli/dist/frontend-frameworks/vanilla.js +0 -1
- package/cli/dist/frontend-frameworks/vue.js +0 -1
- package/cli/dist/generator/__tests__/golden-helpers.js +0 -1
- package/cli/dist/generator/extension-fetch.js +0 -1
- package/cli/dist/generator/resource-templates.js +0 -1
- package/cli/dist/generator/template-engine.js +9 -10
- package/cli/dist/index.js +0 -1
- package/cli/dist/mcp/server.js +0 -1
- package/cli/dist/mcp/tools.js +33 -14
- package/cli/dist/types/index.js +4 -6
- package/cli/dist/utils/agent-host.js +0 -1
- package/cli/dist/utils/atomic-write.js +0 -1
- package/cli/dist/utils/bun-floor.js +0 -1
- package/cli/dist/utils/bun-requirement.js +0 -1
- package/cli/dist/utils/cache.js +0 -1
- package/cli/dist/utils/cold-preflight.js +2 -2
- package/cli/dist/utils/command-helpers.js +0 -1
- package/cli/dist/utils/constants.js +18 -4
- package/cli/dist/utils/discovery-context.js +0 -1
- package/cli/dist/utils/discovery-paths.js +2 -2
- package/cli/dist/utils/docker.js +0 -1
- package/cli/dist/utils/doctor-report.js +0 -1
- package/cli/dist/utils/doctor-runtime.js +4 -5
- package/cli/dist/utils/doctor-starlark.js +0 -1
- package/cli/dist/utils/doctor-wiring.js +8 -9
- package/cli/dist/utils/down-cleanup.js +0 -1
- package/cli/dist/utils/env-validator.js +0 -1
- package/cli/dist/utils/errors.js +2 -3
- package/cli/dist/utils/exec-async.js +0 -1
- package/cli/dist/utils/file-helpers.js +1 -3
- package/cli/dist/utils/formatting.js +0 -1
- package/cli/dist/utils/generated-paths.js +5 -6
- package/cli/dist/utils/help-command.js +0 -1
- package/cli/dist/utils/host-port-config.js +2 -2
- package/cli/dist/utils/host-port-plan.js +0 -1
- package/cli/dist/utils/json-output.js +0 -1
- package/cli/dist/utils/machine-output.js +0 -1
- package/cli/dist/utils/paths.js +2 -2
- package/cli/dist/utils/platform.js +0 -1
- package/cli/dist/utils/port-assignment.js +0 -1
- package/cli/dist/utils/port-conflict-fix.js +0 -1
- package/cli/dist/utils/port-fallback-notice.js +0 -1
- package/cli/dist/utils/port-listener-probe.js +0 -1
- package/cli/dist/utils/project-config-defaults.js +0 -1
- package/cli/dist/utils/project-features.js +0 -1
- package/cli/dist/utils/project-templates.js +0 -1
- package/cli/dist/utils/prompt.js +0 -1
- package/cli/dist/utils/resource-features.js +0 -1
- package/cli/dist/utils/resource-kind.js +0 -1
- package/cli/dist/utils/schema-version-gate.js +0 -1
- package/cli/dist/utils/search-status.js +0 -1
- package/cli/dist/utils/secret-redaction.js +0 -1
- package/cli/dist/utils/service-config-checks.js +0 -1
- package/cli/dist/utils/service-manifest.js +0 -1
- package/cli/dist/utils/service-runtime-state.js +0 -1
- package/cli/dist/utils/service-urls.js +2 -2
- package/cli/dist/utils/services.js +3 -6
- package/cli/dist/utils/shared-platform-postgres.js +2 -3
- package/cli/dist/utils/single-flight.js +0 -1
- package/cli/dist/utils/smoke.js +2 -1
- package/cli/dist/utils/spinner.js +0 -1
- package/cli/dist/utils/stack-features.js +0 -1
- package/cli/dist/utils/stack-status.js +0 -1
- package/cli/dist/utils/startup-report.js +0 -1
- package/cli/dist/utils/status-message.js +0 -1
- package/cli/dist/utils/status-ports.js +0 -1
- package/cli/dist/utils/suggestions.js +6 -3
- package/cli/dist/utils/tar.js +5 -4
- package/cli/dist/utils/tdk-version.js +2 -2
- package/cli/dist/utils/terminal-layout.js +0 -1
- package/cli/dist/utils/tilt-events.js +0 -1
- package/cli/dist/utils/tilt-logs.js +0 -1
- package/cli/dist/utils/tilt-process.js +0 -1
- package/cli/dist/utils/tilt-resource-state.js +0 -1
- package/cli/dist/utils/tilt-startup.js +0 -1
- package/cli/dist/utils/tilt-unreachable-message.js +0 -1
- package/cli/dist/utils/tilt.js +0 -1
- package/cli/dist/utils/ui-keymap.js +1 -2
- package/cli/dist/utils/ui-service-state.js +0 -1
- package/cli/dist/utils/up-only.js +0 -1
- package/cli/dist/utils/up-readiness.js +0 -1
- package/cli/dist/utils/validation.js +0 -1
- package/cli/dist/utils/which.js +0 -1
- package/cli/dist/utils/windows-doctor.js +0 -1
- package/cli/dist-bundle/chunk-42IVF3YT.js +3 -0
- package/cli/dist-bundle/chunk-CJ3L25OH.js +315 -0
- package/cli/dist-bundle/cli.js +211 -211
- package/cli/dist-bundle/{cold-preflight-LV5MPGEA.js → cold-preflight-KLI6R3XF.js} +1 -1
- package/cli/dist-bundle/{extension-fetch-COIG2KR6.js → extension-fetch-6XNTDF44.js} +1 -1
- package/cli/package.json +1 -1
- package/engine/topologies/platform/docker/AGENTS.md +13 -13
- package/engine/topologies/platform/docker/dockerfile/language_dockerfile.star +6 -2
- package/engine/topologies/tilt/manifest/README.md +1 -15
- package/package.json +1 -1
- package/cli/dist-bundle/chunk-7IDEZ54B.js +0 -315
- package/cli/dist-bundle/chunk-OBQS5CYC.js +0 -3
|
@@ -4,7 +4,7 @@ import { execFileSync, execSync } from "node:child_process";
|
|
|
4
4
|
import { existsSync, readdirSync, readFileSync } from "node:fs";
|
|
5
5
|
import { basename, dirname, join, relative } from "node:path";
|
|
6
6
|
import { BACKEND_LANGUAGES } from "../backend-languages/registry.js";
|
|
7
|
-
import { BRING_YOUR_OWN_TYPE, DATABASE_MANAGEMENT_FEATURE } from "./constants.js";
|
|
7
|
+
import { AUTOGENERATED_DIR, BRING_YOUR_OWN_TYPE, DATABASE_MANAGEMENT_FEATURE, DOCKER_COMPOSE_FILE, PACKAGE_JSON, PROJECT_JSON, } from "./constants.js";
|
|
8
8
|
import { execAsync } from "./exec-async.js";
|
|
9
9
|
import { formatCount } from "./formatting.js";
|
|
10
10
|
import { findProjectRoot } from "./paths.js";
|
|
@@ -21,10 +21,10 @@ const EXEC_TIMEOUT_MS = 10_000;
|
|
|
21
21
|
const SOURCE_EXTENSIONS = /\.(?:[cm]?[jt]sx?|vue)$/;
|
|
22
22
|
const TEST_FILE = /(?:\.test\.|\.spec\.|\/tests?\/|\/__tests__\/)/;
|
|
23
23
|
const PRISMA_MAJOR = 7;
|
|
24
|
-
const SKIPPED_DIRS = new Set(["node_modules",
|
|
24
|
+
const SKIPPED_DIRS = new Set(["node_modules", AUTOGENERATED_DIR, "dist", "tests", "__tests__"]);
|
|
25
25
|
function projectName(projectRoot) {
|
|
26
26
|
try {
|
|
27
|
-
const parsed = JSON.parse(readFileSync(join(projectRoot, ".tdk",
|
|
27
|
+
const parsed = JSON.parse(readFileSync(join(projectRoot, ".tdk", PROJECT_JSON), "utf-8"));
|
|
28
28
|
return typeof parsed?.project?.name === "string" ? parsed.project.name : undefined;
|
|
29
29
|
}
|
|
30
30
|
catch {
|
|
@@ -42,7 +42,7 @@ function readParams(configPath) {
|
|
|
42
42
|
}
|
|
43
43
|
function packageJson(resourcePath) {
|
|
44
44
|
try {
|
|
45
|
-
const value = JSON.parse(readFileSync(join(resourcePath,
|
|
45
|
+
const value = JSON.parse(readFileSync(join(resourcePath, PACKAGE_JSON), "utf-8"));
|
|
46
46
|
return value && typeof value === "object" ? value : {};
|
|
47
47
|
}
|
|
48
48
|
catch {
|
|
@@ -69,7 +69,7 @@ function prismaSchemaFindings(path) {
|
|
|
69
69
|
return findings;
|
|
70
70
|
}
|
|
71
71
|
function prismaConfigFindings(resourcePath) {
|
|
72
|
-
const generated = join(resourcePath,
|
|
72
|
+
const generated = join(resourcePath, AUTOGENERATED_DIR, "prisma.config.autogenerated.ts");
|
|
73
73
|
const candidates = [join(resourcePath, "prisma.config.ts"), generated];
|
|
74
74
|
const path = candidates.find((candidate) => existsSync(candidate));
|
|
75
75
|
if (!path)
|
|
@@ -189,7 +189,7 @@ export function checkResourcePackageJson(projectRoot = findProjectRoot() ?? proc
|
|
|
189
189
|
const missing = discoverResourcesFromRoot(projectRoot)
|
|
190
190
|
.filter((resource) => !isBringYourOwn(resource) &&
|
|
191
191
|
!ownsRuntimeFiles(resource) &&
|
|
192
|
-
!existsSync(join(resource.path,
|
|
192
|
+
!existsSync(join(resource.path, PACKAGE_JSON)))
|
|
193
193
|
.map((resource) => resource.name);
|
|
194
194
|
if (missing.length === 0) {
|
|
195
195
|
return {
|
|
@@ -441,7 +441,7 @@ function readText(path) {
|
|
|
441
441
|
}
|
|
442
442
|
}
|
|
443
443
|
function startScriptMigrations(resourceDir) {
|
|
444
|
-
const text = readText(join(resourceDir,
|
|
444
|
+
const text = readText(join(resourceDir, PACKAGE_JSON));
|
|
445
445
|
if (text === undefined)
|
|
446
446
|
return [];
|
|
447
447
|
let scripts = {};
|
|
@@ -527,7 +527,7 @@ export function checkNatsBroker(projectRoot = findProjectRoot() ?? process.cwd()
|
|
|
527
527
|
isSkipped: true,
|
|
528
528
|
};
|
|
529
529
|
}
|
|
530
|
-
if (existsSync(join(projectRoot, "services", "platform", "messaging",
|
|
530
|
+
if (existsSync(join(projectRoot, "services", "platform", "messaging", DOCKER_COMPOSE_FILE))) {
|
|
531
531
|
return {
|
|
532
532
|
name: "NATS broker",
|
|
533
533
|
didPass: true,
|
|
@@ -695,4 +695,3 @@ export async function checkDockerNetworkCapacity(exec = execAsync) {
|
|
|
695
695
|
}
|
|
696
696
|
return { name: "Docker networks", didPass: true, message: "Docker can create networks" };
|
|
697
697
|
}
|
|
698
|
-
//# sourceMappingURL=doctor-wiring.js.map
|
package/cli/dist/utils/errors.js
CHANGED
|
@@ -149,13 +149,12 @@ function showError(message, context, suggestions) {
|
|
|
149
149
|
}
|
|
150
150
|
if (suggestions && suggestions.length > 0) {
|
|
151
151
|
console.error(chalk.yellow("\n💡 Suggestions:"));
|
|
152
|
-
|
|
152
|
+
for (const s of suggestions) {
|
|
153
153
|
console.error(chalk.cyan(` → ${s}`));
|
|
154
|
-
}
|
|
154
|
+
}
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
157
|
export function handleTiltFailure(command, exitCode) {
|
|
158
158
|
console.error(chalk.red(`\ntilt ${command} failed with exit code ${exitCode}`));
|
|
159
159
|
process.exit(exitCode);
|
|
160
160
|
}
|
|
161
|
-
//# sourceMappingURL=errors.js.map
|
|
@@ -4,8 +4,7 @@ import { appendFileSync, existsSync, mkdirSync, readFileSync, writeFileSync } fr
|
|
|
4
4
|
import { resolve } from "node:path";
|
|
5
5
|
import chalk from "chalk";
|
|
6
6
|
export function writeFilesWithProgress(basePath, tasks, onProgress) {
|
|
7
|
-
for (
|
|
8
|
-
const task = tasks[i];
|
|
7
|
+
for (const [i, task] of tasks.entries()) {
|
|
9
8
|
console.log(chalk.blue(`${task.emoji} ${task.description}...`));
|
|
10
9
|
if (task.type === "json") {
|
|
11
10
|
writeJsonFileInDir(basePath, task.filename, task.content);
|
|
@@ -71,4 +70,3 @@ export function ensureGitignore(projectRoot) {
|
|
|
71
70
|
appendFileSync(gitignorePath, `${prefix}${header}${missing.join("\n")}\n`);
|
|
72
71
|
return missing;
|
|
73
72
|
}
|
|
74
|
-
//# sourceMappingURL=file-helpers.js.map
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
import { existsSync, lstatSync } from "node:fs";
|
|
4
4
|
import { isAbsolute, normalize, relative, sep } from "node:path";
|
|
5
|
-
import { TILTIGNORE_FILE } from "./constants.js";
|
|
5
|
+
import { AUTOGENERATED_DIR, PACKAGE_JSON, TILTIGNORE_FILE } from "./constants.js";
|
|
6
6
|
/** Reviewed TDK-owned destinations written by `tdk config regenerate` or Tilt generation. */
|
|
7
7
|
export const TDK_GENERATED_PATH_ALLOWLIST = [
|
|
8
|
-
|
|
8
|
+
`${AUTOGENERATED_DIR}/**`,
|
|
9
9
|
".tdk/.tdk-out/**",
|
|
10
10
|
"Tiltfile",
|
|
11
11
|
"TILT_*.star",
|
|
12
12
|
TILTIGNORE_FILE,
|
|
13
|
-
|
|
13
|
+
`${PACKAGE_JSON} (create only)`,
|
|
14
14
|
"shared-platform-engineering/docker-templates/**",
|
|
15
15
|
"services/platform/database-management/docker-compose.yml",
|
|
16
16
|
"product_autogenerated_resource_manifests/**",
|
|
@@ -20,7 +20,7 @@ export function isTdkGeneratedPath(path) {
|
|
|
20
20
|
const normalized = normalize(path).split(sep).join("/");
|
|
21
21
|
if (isAbsolute(path) || normalized === ".." || normalized.startsWith("../"))
|
|
22
22
|
return false;
|
|
23
|
-
if (normalized.split("/").includes(
|
|
23
|
+
if (normalized.split("/").includes(AUTOGENERATED_DIR) ||
|
|
24
24
|
normalized.startsWith(".tdk/.tdk-out/") ||
|
|
25
25
|
normalized === "shared-platform-engineering/docker-templates" ||
|
|
26
26
|
normalized.startsWith("shared-platform-engineering/docker-templates/") ||
|
|
@@ -31,7 +31,7 @@ export function isTdkGeneratedPath(path) {
|
|
|
31
31
|
return (normalized === "Tiltfile" ||
|
|
32
32
|
/^TILT_[^/]+\.star$/.test(normalized) ||
|
|
33
33
|
normalized === TILTIGNORE_FILE ||
|
|
34
|
-
normalized ===
|
|
34
|
+
normalized === PACKAGE_JSON ||
|
|
35
35
|
normalized === "services/platform/database-management/docker-compose.yml");
|
|
36
36
|
}
|
|
37
37
|
export function assertTdkGeneratedPath(projectRoot, path) {
|
|
@@ -49,4 +49,3 @@ export function assertTdkGeneratedPath(projectRoot, path) {
|
|
|
49
49
|
}
|
|
50
50
|
return absolute;
|
|
51
51
|
}
|
|
52
|
-
//# sourceMappingURL=generated-paths.js.map
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { execFileSync } from "node:child_process";
|
|
4
4
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
5
5
|
import { join } from "node:path";
|
|
6
|
+
import { PROJECT_JSON } from "./constants.js";
|
|
6
7
|
import { createHostPortPlan, isHostPortAvailable } from "./host-port-plan.js";
|
|
7
8
|
const CONFIG_PATH = join(".tdk", ".tdk-out", "host-ports.json");
|
|
8
9
|
export function isDockerPortOwnedByProject(dockerPs, projectPrefix, port) {
|
|
@@ -56,7 +57,7 @@ export async function getHostPortPlan(projectRoot, options = {}) {
|
|
|
56
57
|
return saved;
|
|
57
58
|
let prefix = "";
|
|
58
59
|
try {
|
|
59
|
-
const project = JSON.parse(readFileSync(join(projectRoot, ".tdk",
|
|
60
|
+
const project = JSON.parse(readFileSync(join(projectRoot, ".tdk", PROJECT_JSON), "utf-8"));
|
|
60
61
|
prefix = String(project?.project?.name ?? "tdk-project")
|
|
61
62
|
.replace(/-/g, "_")
|
|
62
63
|
.toLowerCase();
|
|
@@ -87,4 +88,3 @@ export async function getHostPortPlan(projectRoot, options = {}) {
|
|
|
87
88
|
}
|
|
88
89
|
return createHostPortPlan({ isAvailable });
|
|
89
90
|
}
|
|
90
|
-
//# sourceMappingURL=host-port-config.js.map
|
package/cli/dist/utils/paths.js
CHANGED
|
@@ -4,11 +4,12 @@ import { existsSync } from "node:fs";
|
|
|
4
4
|
import { dirname, join, resolve } from "node:path";
|
|
5
5
|
import { cwd } from "node:process";
|
|
6
6
|
import packageJson from "../../package.json" with { type: "json" };
|
|
7
|
+
import { PROJECT_JSON } from "./constants.js";
|
|
7
8
|
export function findProjectRoot(startDir = cwd()) {
|
|
8
9
|
let currentDir = resolve(startDir);
|
|
9
10
|
const root = resolve("/");
|
|
10
11
|
while (currentDir !== root) {
|
|
11
|
-
if (existsSync(join(currentDir, ".tdk",
|
|
12
|
+
if (existsSync(join(currentDir, ".tdk", PROJECT_JSON))) {
|
|
12
13
|
return currentDir;
|
|
13
14
|
}
|
|
14
15
|
const parentDir = dirname(currentDir);
|
|
@@ -40,4 +41,3 @@ function getPackageInfo() {
|
|
|
40
41
|
export function getPackageVersion() {
|
|
41
42
|
return getPackageInfo().version;
|
|
42
43
|
}
|
|
43
|
-
//# sourceMappingURL=paths.js.map
|
|
@@ -23,4 +23,3 @@ export function portConflictFix(message) {
|
|
|
23
23
|
return `Fix: stop the process using port ${port} (${find})`;
|
|
24
24
|
return `Fix: stop the process using port ${port} (${find}), or set ${envVar} to a free port and run tdk up`;
|
|
25
25
|
}
|
|
26
|
-
//# sourceMappingURL=port-conflict-fix.js.map
|
package/cli/dist/utils/prompt.js
CHANGED
|
@@ -182,4 +182,3 @@ export function getDefaultFeaturesForResourceType(appType) {
|
|
|
182
182
|
export function getGeneratorsForResourceType(appType) {
|
|
183
183
|
return Object.values(RESOURCE_FEATURES).filter((f) => f.applies_to.includes(appType));
|
|
184
184
|
}
|
|
185
|
-
//# sourceMappingURL=resource-features.js.map
|
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
import { readFileSync } from "node:fs";
|
|
4
4
|
import { join } from "node:path";
|
|
5
|
+
import { PROJECT_JSON } from "./constants.js";
|
|
5
6
|
import { findProjectRoot } from "./paths.js";
|
|
6
7
|
import { isApiServiceType } from "./resource-kind.js";
|
|
7
8
|
export function getProjectName() {
|
|
8
9
|
const root = findProjectRoot();
|
|
9
10
|
if (root) {
|
|
10
11
|
try {
|
|
11
|
-
const content = readFileSync(join(root, ".tdk",
|
|
12
|
+
const content = readFileSync(join(root, ".tdk", PROJECT_JSON), "utf-8");
|
|
12
13
|
const parsed = JSON.parse(content);
|
|
13
14
|
if (parsed?.project?.name) {
|
|
14
15
|
return parsed.project.name;
|
|
@@ -95,4 +96,3 @@ export async function pingHealthTarget(target, timeoutMs) {
|
|
|
95
96
|
export async function pingHealthTargets(targets, timeoutMs) {
|
|
96
97
|
return Promise.all(targets.map((target) => pingHealthTarget(target, timeoutMs)));
|
|
97
98
|
}
|
|
98
|
-
//# sourceMappingURL=service-urls.js.map
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { existsSync, readdirSync, readFileSync, statSync } from "node:fs";
|
|
4
4
|
import { dirname, join } from "node:path";
|
|
5
5
|
import { Cache, createCacheValidator } from "./cache.js";
|
|
6
|
-
import { AUTOGENERATED_FILE_PATTERNS, SERVICE_JSON, SKIP_DIRECTORIES } from "./constants.js";
|
|
6
|
+
import { AUTOGENERATED_FILE_PATTERNS, DOCKER_COMPOSE_FILE, PACKAGE_JSON, SERVICE_JSON, SKIP_DIRECTORIES, } from "./constants.js";
|
|
7
7
|
import { errorFactories } from "./errors.js";
|
|
8
8
|
import { formatCount } from "./formatting.js";
|
|
9
9
|
import { findProjectRoot } from "./paths.js";
|
|
@@ -240,9 +240,7 @@ function detectFileType(filename, content) {
|
|
|
240
240
|
if (filename === "Tiltfile" || filename.endsWith(".star")) {
|
|
241
241
|
return "tilt";
|
|
242
242
|
}
|
|
243
|
-
if (filename === "vite.config.ts" ||
|
|
244
|
-
filename === "tsconfig.json" ||
|
|
245
|
-
filename === "package.json") {
|
|
243
|
+
if (filename === "vite.config.ts" || filename === "tsconfig.json" || filename === PACKAGE_JSON) {
|
|
246
244
|
return "config";
|
|
247
245
|
}
|
|
248
246
|
if (filename === "schema.prisma" || filename.includes("migration")) {
|
|
@@ -271,7 +269,7 @@ export function getResourceMetadata(resource) {
|
|
|
271
269
|
const autogeneratedFiles = discoverAutogeneratedFiles(resourceDir);
|
|
272
270
|
const hasDockerfile = existsSync(join(resourceDir, "Dockerfile"));
|
|
273
271
|
const hasTiltfile = existsSync(join(resourceDir, "Tiltfile"));
|
|
274
|
-
const hasDockerCompose = existsSync(join(resourceDir,
|
|
272
|
+
const hasDockerCompose = existsSync(join(resourceDir, DOCKER_COMPOSE_FILE)) ||
|
|
275
273
|
existsSync(join(resourceDir, "docker-compose.yaml"));
|
|
276
274
|
const configType = resource.config?.appType;
|
|
277
275
|
let type = configType || "backend";
|
|
@@ -363,4 +361,3 @@ export function getStackMetadata(stack) {
|
|
|
363
361
|
cacheValidator.markUpdated();
|
|
364
362
|
return metadata;
|
|
365
363
|
}
|
|
366
|
-
//# sourceMappingURL=services.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
import { existsSync, readFileSync } from "node:fs";
|
|
4
4
|
import { join } from "node:path";
|
|
5
|
-
import { DATABASE_MANAGEMENT_FEATURE } from "./constants.js";
|
|
5
|
+
import { DATABASE_MANAGEMENT_FEATURE, PROJECT_JSON } from "./constants.js";
|
|
6
6
|
import { DEFAULT_ALWAYS_ENABLED_INFRA } from "./project-config-defaults.js";
|
|
7
7
|
import { discoverResourcesFromRoot } from "./services.js";
|
|
8
8
|
/**
|
|
@@ -26,7 +26,7 @@ export function isSharedPlatformPostgresDependency(name) {
|
|
|
26
26
|
}
|
|
27
27
|
function readProjectJson(projectRoot) {
|
|
28
28
|
try {
|
|
29
|
-
return JSON.parse(readFileSync(join(projectRoot, ".tdk",
|
|
29
|
+
return JSON.parse(readFileSync(join(projectRoot, ".tdk", PROJECT_JSON), "utf-8"));
|
|
30
30
|
}
|
|
31
31
|
catch {
|
|
32
32
|
return undefined;
|
|
@@ -230,4 +230,3 @@ export function sharedPlatformPostgresMessage(evaluation) {
|
|
|
230
230
|
: `resource(s) ${evaluation.dependsOnUsers.join(", ")} depend on postgres/database-management`;
|
|
231
231
|
return `Shared platform Postgres will start because ${why}${projectScopeNote}`;
|
|
232
232
|
}
|
|
233
|
-
//# sourceMappingURL=shared-platform-postgres.js.map
|
package/cli/dist/utils/smoke.js
CHANGED
|
@@ -112,6 +112,8 @@ function readPath(value, path) {
|
|
|
112
112
|
if (current === null || current === undefined)
|
|
113
113
|
return undefined;
|
|
114
114
|
// Own properties only: a path like "__proto__" must not reach inherited values.
|
|
115
|
+
if (part === "__proto__" || part === "constructor" || part === "prototype")
|
|
116
|
+
return undefined;
|
|
115
117
|
if (!Object.hasOwn(current, part))
|
|
116
118
|
return undefined;
|
|
117
119
|
current = current[part];
|
|
@@ -330,4 +332,3 @@ export function formatSmokeFailure(result) {
|
|
|
330
332
|
export async function runSmokePlans(plans, deps = {}) {
|
|
331
333
|
return Promise.all(plans.map((plan) => runSmokePlan(plan, deps)));
|
|
332
334
|
}
|
|
333
|
-
//# sourceMappingURL=smoke.js.map
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
// Copyright (c) 2026 TDK Landscape contributors
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Every cell is written before it is read, so the fallback never changes the result.
|
|
4
|
+
function cell(row, index) {
|
|
5
|
+
return row[index] ?? 0;
|
|
6
|
+
}
|
|
3
7
|
function levenshteinDistance(left, right) {
|
|
4
8
|
let previousRow = Array.from({ length: right.length + 1 }, (_, index) => index);
|
|
5
9
|
for (let leftIndex = 1; leftIndex <= left.length; leftIndex++) {
|
|
6
10
|
const currentRow = [leftIndex];
|
|
7
11
|
for (let rightIndex = 1; rightIndex <= right.length; rightIndex++) {
|
|
8
12
|
const substitutionCost = left[leftIndex - 1] === right[rightIndex - 1] ? 0 : 1;
|
|
9
|
-
currentRow[rightIndex] = Math.min(currentRow
|
|
13
|
+
currentRow[rightIndex] = Math.min(cell(currentRow, rightIndex - 1) + 1, cell(previousRow, rightIndex) + 1, cell(previousRow, rightIndex - 1) + substitutionCost);
|
|
10
14
|
}
|
|
11
15
|
previousRow = currentRow;
|
|
12
16
|
}
|
|
13
|
-
return previousRow
|
|
17
|
+
return cell(previousRow, right.length);
|
|
14
18
|
}
|
|
15
19
|
function isAdjacentTransposition(left, right) {
|
|
16
20
|
if (left.length !== right.length)
|
|
@@ -57,4 +61,3 @@ export function suggestClosest(input, candidates) {
|
|
|
57
61
|
}
|
|
58
62
|
return closest;
|
|
59
63
|
}
|
|
60
|
-
//# sourceMappingURL=suggestions.js.map
|
package/cli/dist/utils/tar.js
CHANGED
|
@@ -31,10 +31,12 @@ export function extractTarball(data, destDir) {
|
|
|
31
31
|
throw new Error(`tar extraction failed: ${fallback.stderr?.toString() || result.stderr?.toString() || "unknown error"}`);
|
|
32
32
|
}
|
|
33
33
|
const entries = readdirSync(fallbackDir);
|
|
34
|
+
const [only] = entries;
|
|
34
35
|
const sourceDir = entries.length === 1 &&
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
only !== undefined &&
|
|
37
|
+
existsSync(join(fallbackDir, only)) &&
|
|
38
|
+
statSync(join(fallbackDir, only)).isDirectory()
|
|
39
|
+
? join(fallbackDir, only)
|
|
38
40
|
: fallbackDir;
|
|
39
41
|
for (const entry of readdirSync(sourceDir)) {
|
|
40
42
|
renameSync(join(sourceDir, entry), join(destDir, entry));
|
|
@@ -42,4 +44,3 @@ export function extractTarball(data, destDir) {
|
|
|
42
44
|
}
|
|
43
45
|
rmSync(tempDir, { recursive: true, force: true });
|
|
44
46
|
}
|
|
45
|
-
//# sourceMappingURL=tar.js.map
|
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
import { readFileSync } from "node:fs";
|
|
4
4
|
import { join } from "node:path";
|
|
5
|
+
import { PROJECT_JSON } from "./constants.js";
|
|
5
6
|
function toParts(raw) {
|
|
6
7
|
const match = raw.trim().match(/(\d+)\.(\d+)(?:\.(\d+))?/);
|
|
7
8
|
return match ? [Number(match[1]), Number(match[2]), Number(match[3] ?? 0)] : null;
|
|
8
9
|
}
|
|
9
10
|
function readMinTdkVersion(projectRoot) {
|
|
10
11
|
try {
|
|
11
|
-
const parsed = JSON.parse(readFileSync(join(projectRoot, ".tdk",
|
|
12
|
+
const parsed = JSON.parse(readFileSync(join(projectRoot, ".tdk", PROJECT_JSON), "utf-8"));
|
|
12
13
|
return parsed?.minTdkVersion;
|
|
13
14
|
}
|
|
14
15
|
catch {
|
|
@@ -48,4 +49,3 @@ export function evaluateTdkVersionFloor(projectRoot, currentVersion) {
|
|
|
48
49
|
}
|
|
49
50
|
return { status: "ok", required: requiredText };
|
|
50
51
|
}
|
|
51
|
-
//# sourceMappingURL=tdk-version.js.map
|
package/cli/dist/utils/tilt.js
CHANGED
|
@@ -5,7 +5,7 @@ export const TABS = [
|
|
|
5
5
|
{ id: "files", label: "FILES", shortcut: "4" },
|
|
6
6
|
{ id: "config", label: "CONFIG", shortcut: "5" },
|
|
7
7
|
];
|
|
8
|
-
const tabRange = `${TABS
|
|
8
|
+
const tabRange = `${TABS.at(0)?.shortcut}-${TABS.at(-1)?.shortcut}`;
|
|
9
9
|
const uiKeymap = [
|
|
10
10
|
{
|
|
11
11
|
id: "list-navigation",
|
|
@@ -115,4 +115,3 @@ export function formatUiKeyHint(id, label, ascii = false) {
|
|
|
115
115
|
const entry = getUiKeymapEntry(id);
|
|
116
116
|
return `[${formatUiKeyNames(id, ascii)}] ${label ?? entry.label}`;
|
|
117
117
|
}
|
|
118
|
-
//# sourceMappingURL=ui-keymap.js.map
|