@tdk-landscape/tdk-cli-core 1.3.139 → 1.3.140
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/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 +0 -1
- 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 +0 -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-LMHD62S4.js +315 -0
- package/cli/dist-bundle/cli.js +211 -211
- package/cli/dist-bundle/{cold-preflight-LV5MPGEA.js → cold-preflight-O6LMFPMR.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
|
@@ -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
|
@@ -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
|
package/cli/dist/utils/which.js
CHANGED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{createRequire as __tdkRequire}from'node:module';const require=__tdkRequire(import.meta.url);
|
|
2
|
+
import{randomUUID as M}from"node:crypto";import{existsSync as p,mkdirSync as g,readFileSync as y,statSync as U,writeFileSync as h}from"node:fs";import{homedir as S}from"node:os";import{join as a}from"node:path";import{spawnSync as _}from"node:child_process";import{existsSync as E,mkdirSync as w,mkdtempSync as N,readdirSync as $,renameSync as C,rmSync as v,statSync as j,writeFileSync as O}from"node:fs";import{tmpdir as L}from"node:os";import{join as c}from"node:path";function k(e,n){let r=N(c(L(),"tdk-ext-")),o=c(r,"bundle.tar.gz");O(o,e),w(n,{recursive:!0});let t=process.platform==="win32"?"tar.exe":"tar",i=_(t,["xzf",o,"-C",n,"--strip-components=1"],{stdio:"pipe",windowsHide:!0});if(i.status!==0){let s=c(r,"fallback");w(s,{recursive:!0});let m=_(t,["xzf",o,"-C",s],{stdio:"pipe",windowsHide:!0});if(m.status!==0)throw v(r,{recursive:!0,force:!0}),new Error(`tar extraction failed: ${m.stderr?.toString()||i.stderr?.toString()||"unknown error"}`);let l=$(s),[u]=l,d=l.length===1&&u!==void 0&&E(c(s,u))&&j(c(s,u)).isDirectory()?c(s,u):s;for(let f of $(d))C(c(d,f),c(n,f))}v(r,{recursive:!0,force:!0})}var A="https://tdk-extension-dist.oranguman.workers.dev/v1/premium/bundle.tar.gz",z=["playwright","c4-diagram","logging","agents-md","sablier","verdaccio"],R=720*60*1e3,P={"typescript/playwright_config.star":"engine/topologies/tilt/generators/typescript/playwright_config.star","generators/agents_md.star":"engine/topologies/tilt/generators/agents_md.star","c4_diagram.star":"engine/topologies/tilt/generators/c4_diagram.star","observability/logging.star":"engine/topologies/platform/observability/logging.star","generators/database_provisioner.star":"engine/topologies/tilt/generators/database_provisioner.star","generators/dependency_manifest.star":"engine/topologies/tilt/generators/dependency_manifest.star","generators/fixed_frontend_tsconfig.star":"engine/topologies/tilt/generators/typescript/fixed_frontend_tsconfig.star","synthetic_monitor.star":"engine/resources/synthetic_monitor.star","synthetic-monitor-topology.star":"engine/topologies/platform/services/synthetic-monitor.star","database-management-service.yaml":"platform/services/platform/database-management/service.yaml","networking/sablier_container_cycle.star":"engine/topologies/platform/docker/networking/sablier_container_cycle.star","registries/verdaccio_loader.star":"engine/topologies/platform/registries/verdaccio_loader.star"};function x(){return process.env.TDK_LICENSE_KEY?.trim()||null}function B(){return process.env.TDK_PREMIUM_ENDPOINT?.trim()||A}function I(e){let n=a(e,".tdk",".project-id");if(p(n))return y(n,"utf-8").trim();let r=M();return g(a(e,".tdk"),{recursive:!0}),h(n,`${r}
|
|
3
|
+
`),r}function F(e){let n=e.replace(/[^a-zA-Z0-9_-]/g,"_");return a(S(),".tdk","cache",`premium-${n}`,"premium.tar.gz")}function T(e){return p(e)?Date.now()-U(e).mtimeMs<R:!1}async function D(e,n,r){let o=`${B()}?resource=${encodeURIComponent(n)}&projectId=${encodeURIComponent(r)}`,t=await fetch(o,{headers:{Authorization:`Bearer ${e}`}});return t.status!==401?t:(await t.arrayBuffer().catch(()=>{}),fetch(`${o}&key=${encodeURIComponent(e)}`))}async function H(e,n){let r=[];for(let o of z){let t;try{t=await D(e,o,n)}catch(i){return console.warn(`\u26A0\uFE0F Premium fetch failed (network error): ${i.message}`),null}if(t.ok){let i=Buffer.from(await t.arrayBuffer());return console.info(`\u{1F50E} Premium entitlement probe: granted resource=${o} (HTTP ${t.status}); prior denials=${r.join(", ")||"none"}`),console.info(`\u{1F50E} Premium bundle download: ${i.byteLength} bytes`),i}if(t.status===401||t.status===403){r.push(`${o}=${t.status}`);continue}return console.warn(`\u26A0\uFE0F Premium fetch failed: ${o} returned HTTP ${t.status}; prior entitlement probes: ${r.join(", ")||"none"}`),null}return console.warn(`\u26A0\uFE0F Premium entitlement probes denied: ${r.join(", ")}`),null}async function re(e,n){let r=x();if(!r)return!1;let o=F(r);if(T(o))console.info("\u{1F50E} Premium bundle cache: hit (cached bundle reused)");else{console.info("\u{1F50E} Premium bundle cache: miss; requesting bundle from distribution service");let t=I(e),i=await H(r,t);if(!i)return console.warn("\u26A0\uFE0F No premium resources unlocked for this key - using free tier only."),!1;g(a(o,".."),{recursive:!0}),h(o,i)}try{let t=a(o,"..","extracted");g(t,{recursive:!0}),k(y(o),t);let i=0,s=[];for(let[l,u]of Object.entries(P)){let d=a(t,l);if(!p(d)){s.push(l);continue}let f=a(n,u);g(a(f,".."),{recursive:!0}),h(f,y(d)),i++}let m=a(t,"networking/sablier_container_cycle.star");if(console.info(`\u{1F50E} Premium bundle contents: mapped=${i}/${Object.keys(P).length}; sablier_overlay=${p(m)?"present":"MISSING"}`),s.length>0&&console.info(`\u{1F50E} Premium bundle missing mapped files: ${s.join(", ")}`),!p(m)&&process.env.TDK_PREMIUM_DIAGNOSTICS==="1"){let l=await G(e);console.info(`\u{1F50E} Sablier entitlement check: ${l?"granted":"not confirmed"}; compare with sablier_overlay above to distinguish license access from bundle contents`)}return i>0?(console.log(`\u2713 Premium resources unlocked (${i} file${i===1?"":"s"})`),!0):!1}catch(t){return console.warn(`\u26A0\uFE0F Failed to apply premium overlay: ${t.message}`),!1}}function K(e,n){let r=e.replace(/[^a-zA-Z0-9_-]/g,"_");return a(S(),".tdk","cache",`premium-${r}`,`${n}-access.json`)}async function b(e,n){let r=x();if(!r)return!1;let o=K(r,n);if(T(o))try{let s=JSON.parse(y(o,"utf-8"));return console.info(`\u{1F50E} ${n} entitlement probe: cache=${s.granted===!0?"granted":"denied"}`),s.granted===!0}catch{}let t=I(e),i=!1;try{let s=await D(r,n,t);i=s.ok,console.info(`\u{1F50E} ${n} entitlement probe: HTTP ${s.status} (${i?"granted":"denied"})`),s.body&&await s.arrayBuffer().catch(()=>{})}catch(s){return console.warn(`\u26A0\uFE0F ${n} license check failed (network error): ${s.message}`),!1}try{g(a(o,".."),{recursive:!0}),h(o,JSON.stringify({granted:i,checked:new Date().toISOString()}))}catch{}return i}async function ne(e){return b(e,"verdaccio")}async function oe(e){return b(e,"ddd")}async function G(e){return b(e,"sablier")}export{k as a,re as b,ne as c,oe as d,G as e};
|