@tdk-landscape/tdk-cli-core 1.3.53 → 1.3.55
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 +9 -0
- package/README.md +1 -1
- package/cli/dist/commands/doctor.js +21 -3
- package/cli/dist/commands/upgrade.js +7 -7
- package/cli/dist/generator/extension-fetch.js +16 -9
- package/cli/dist/utils/spinner.js +39 -0
- package/cli/package.json +1 -2
- package/package.json +16 -2
- package/.claude/skills/layer-autoresearch/SKILL.md +0 -48
- package/.claude/skills/tdk-troubleshoot/SKILL.md +0 -222
- package/.github/ISSUE_TEMPLATE/bug_report.yml +0 -40
- package/.github/ISSUE_TEMPLATE/config.yml +0 -11
- package/.github/ISSUE_TEMPLATE/feature_request.yml +0 -18
- package/.github/ISSUE_TEMPLATE/premium_license.yml +0 -43
- package/.github/dependabot.yml +0 -33
- package/.github/pull_request_template.md +0 -5
- package/.github/workflows/ci.yml +0 -200
- package/.github/workflows/release-binaries.yml +0 -139
- package/.github/zizmor.yml +0 -9
- package/.pre-commit-config.yaml +0 -57
- package/CODE_OF_CONDUCT.md +0 -9
- package/CONTRIBUTING.md +0 -42
- package/Makefile +0 -92
- package/SECURITY.md +0 -17
- package/benchmarks/results/container-scale-2026-09-25T20-54-49-736Z.json +0 -45
- package/benchmarks/results/container-scale-2026-09-25T21-01-20-540Z.json +0 -150
- package/benchmarks/results/container-scale-2026-09-25T21-15-01-441Z.json +0 -73
- package/benchmarks/results/container-scale-2026-09-25T22-09-01-630Z.json +0 -77
- package/benchmarks/results/container-scale-2026-09-25T22-18-28-371Z.json +0 -202
- package/cli/AGENTS.md +0 -390
- package/cli/DESIGN.md +0 -735
- package/cli/README.md +0 -292
- package/cli/biome.json +0 -40
- package/cli/dependency-graph.svg +0 -1135
- package/cli/dist/cli.d.ts +0 -3
- package/cli/dist/cli.d.ts.map +0 -1
- package/cli/dist/cli.js.map +0 -1
- package/cli/dist/commands/completion.d.ts +0 -3
- package/cli/dist/commands/completion.d.ts.map +0 -1
- package/cli/dist/commands/completion.js.map +0 -1
- package/cli/dist/commands/config.d.ts +0 -3
- package/cli/dist/commands/config.d.ts.map +0 -1
- package/cli/dist/commands/config.js.map +0 -1
- package/cli/dist/commands/doctor.d.ts +0 -19
- package/cli/dist/commands/doctor.d.ts.map +0 -1
- package/cli/dist/commands/doctor.js.map +0 -1
- package/cli/dist/commands/down.d.ts +0 -3
- package/cli/dist/commands/down.d.ts.map +0 -1
- package/cli/dist/commands/down.js.map +0 -1
- package/cli/dist/commands/help.d.ts +0 -2
- package/cli/dist/commands/help.d.ts.map +0 -1
- package/cli/dist/commands/help.js.map +0 -1
- package/cli/dist/commands/networks.d.ts +0 -3
- package/cli/dist/commands/networks.d.ts.map +0 -1
- package/cli/dist/commands/networks.js.map +0 -1
- package/cli/dist/commands/project.d.ts +0 -9
- package/cli/dist/commands/project.d.ts.map +0 -1
- package/cli/dist/commands/project.js.map +0 -1
- package/cli/dist/commands/projects.d.ts +0 -3
- package/cli/dist/commands/projects.d.ts.map +0 -1
- package/cli/dist/commands/projects.js.map +0 -1
- package/cli/dist/commands/resource.d.ts +0 -69
- package/cli/dist/commands/resource.d.ts.map +0 -1
- package/cli/dist/commands/resource.js.map +0 -1
- package/cli/dist/commands/resources.d.ts +0 -3
- package/cli/dist/commands/resources.d.ts.map +0 -1
- package/cli/dist/commands/resources.js.map +0 -1
- package/cli/dist/commands/stack.d.ts +0 -3
- package/cli/dist/commands/stack.d.ts.map +0 -1
- package/cli/dist/commands/stack.js.map +0 -1
- package/cli/dist/commands/stacks.d.ts +0 -3
- package/cli/dist/commands/stacks.d.ts.map +0 -1
- package/cli/dist/commands/stacks.js.map +0 -1
- package/cli/dist/commands/status.d.ts +0 -3
- package/cli/dist/commands/status.d.ts.map +0 -1
- package/cli/dist/commands/status.js.map +0 -1
- package/cli/dist/commands/ui.d.ts +0 -3
- package/cli/dist/commands/ui.d.ts.map +0 -1
- package/cli/dist/commands/ui.js.map +0 -1
- package/cli/dist/commands/up.d.ts +0 -3
- package/cli/dist/commands/up.d.ts.map +0 -1
- package/cli/dist/commands/up.js.map +0 -1
- package/cli/dist/commands/upgrade.d.ts +0 -14
- package/cli/dist/commands/upgrade.d.ts.map +0 -1
- package/cli/dist/commands/upgrade.js.map +0 -1
- package/cli/dist/commands/version.d.ts +0 -3
- package/cli/dist/commands/version.d.ts.map +0 -1
- package/cli/dist/commands/version.js.map +0 -1
- package/cli/dist/components/Accessible.d.ts +0 -8
- package/cli/dist/components/Accessible.d.ts.map +0 -1
- package/cli/dist/components/Accessible.js.map +0 -1
- package/cli/dist/components/BaseTooltip.d.ts +0 -4
- package/cli/dist/components/BaseTooltip.d.ts.map +0 -1
- package/cli/dist/components/BaseTooltip.js.map +0 -1
- package/cli/dist/components/DetailPanel.d.ts +0 -4
- package/cli/dist/components/DetailPanel.d.ts.map +0 -1
- package/cli/dist/components/DetailPanel.js.map +0 -1
- package/cli/dist/components/FileTree.d.ts +0 -4
- package/cli/dist/components/FileTree.d.ts.map +0 -1
- package/cli/dist/components/FileTree.js.map +0 -1
- package/cli/dist/components/ResourceSelectInput.d.ts +0 -4
- package/cli/dist/components/ResourceSelectInput.d.ts.map +0 -1
- package/cli/dist/components/ResourceSelectInput.js.map +0 -1
- package/cli/dist/components/ResourceTable.d.ts +0 -4
- package/cli/dist/components/ResourceTable.d.ts.map +0 -1
- package/cli/dist/components/ResourceTable.js.map +0 -1
- package/cli/dist/components/TabBar.d.ts +0 -4
- package/cli/dist/components/TabBar.d.ts.map +0 -1
- package/cli/dist/components/TabBar.js.map +0 -1
- package/cli/dist/components/Tooltip.d.ts +0 -12
- package/cli/dist/components/Tooltip.d.ts.map +0 -1
- package/cli/dist/components/Tooltip.js.map +0 -1
- package/cli/dist/components/index.d.ts +0 -8
- package/cli/dist/components/index.d.ts.map +0 -1
- package/cli/dist/components/index.js.map +0 -1
- package/cli/dist/config/platform-standards.d.ts +0 -159
- package/cli/dist/config/platform-standards.d.ts.map +0 -1
- package/cli/dist/config/platform-standards.js.map +0 -1
- package/cli/dist/generator/extension-fetch.d.ts +0 -25
- package/cli/dist/generator/extension-fetch.d.ts.map +0 -1
- package/cli/dist/generator/extension-fetch.js.map +0 -1
- package/cli/dist/generator/template-engine.d.ts +0 -62
- package/cli/dist/generator/template-engine.d.ts.map +0 -1
- package/cli/dist/generator/template-engine.js.map +0 -1
- package/cli/dist/index.d.ts +0 -11
- package/cli/dist/index.d.ts.map +0 -1
- package/cli/dist/index.js.map +0 -1
- package/cli/dist/types/index.d.ts +0 -257
- package/cli/dist/types/index.d.ts.map +0 -1
- package/cli/dist/types/index.js.map +0 -1
- package/cli/dist/utils/cache.d.ts +0 -19
- package/cli/dist/utils/cache.d.ts.map +0 -1
- package/cli/dist/utils/cache.js.map +0 -1
- package/cli/dist/utils/command-helpers.d.ts +0 -17
- package/cli/dist/utils/command-helpers.d.ts.map +0 -1
- package/cli/dist/utils/command-helpers.js.map +0 -1
- package/cli/dist/utils/constants.d.ts +0 -53
- package/cli/dist/utils/constants.d.ts.map +0 -1
- package/cli/dist/utils/constants.js.map +0 -1
- package/cli/dist/utils/discovery-context.d.ts +0 -4
- package/cli/dist/utils/discovery-context.d.ts.map +0 -1
- package/cli/dist/utils/discovery-context.js.map +0 -1
- package/cli/dist/utils/docker.d.ts +0 -4
- package/cli/dist/utils/docker.d.ts.map +0 -1
- package/cli/dist/utils/docker.js.map +0 -1
- package/cli/dist/utils/doctor-runtime.d.ts +0 -81
- package/cli/dist/utils/doctor-runtime.d.ts.map +0 -1
- package/cli/dist/utils/doctor-runtime.js.map +0 -1
- package/cli/dist/utils/env-validator.d.ts +0 -15
- package/cli/dist/utils/env-validator.d.ts.map +0 -1
- package/cli/dist/utils/env-validator.js.map +0 -1
- package/cli/dist/utils/errors.d.ts +0 -31
- package/cli/dist/utils/errors.d.ts.map +0 -1
- package/cli/dist/utils/errors.js.map +0 -1
- package/cli/dist/utils/file-helpers.d.ts +0 -14
- package/cli/dist/utils/file-helpers.d.ts.map +0 -1
- package/cli/dist/utils/file-helpers.js.map +0 -1
- package/cli/dist/utils/formatting.d.ts +0 -30
- package/cli/dist/utils/formatting.d.ts.map +0 -1
- package/cli/dist/utils/formatting.js.map +0 -1
- package/cli/dist/utils/paths.d.ts +0 -3
- package/cli/dist/utils/paths.d.ts.map +0 -1
- package/cli/dist/utils/paths.js.map +0 -1
- package/cli/dist/utils/port-assignment.d.ts +0 -6
- package/cli/dist/utils/port-assignment.d.ts.map +0 -1
- package/cli/dist/utils/port-assignment.js.map +0 -1
- package/cli/dist/utils/project-features.d.ts +0 -23
- package/cli/dist/utils/project-features.d.ts.map +0 -1
- package/cli/dist/utils/project-features.js.map +0 -1
- package/cli/dist/utils/project-templates.d.ts +0 -7
- package/cli/dist/utils/project-templates.d.ts.map +0 -1
- package/cli/dist/utils/project-templates.js.map +0 -1
- package/cli/dist/utils/prompt.d.ts +0 -28
- package/cli/dist/utils/prompt.d.ts.map +0 -1
- package/cli/dist/utils/prompt.js.map +0 -1
- package/cli/dist/utils/resource-features.d.ts +0 -29
- package/cli/dist/utils/resource-features.d.ts.map +0 -1
- package/cli/dist/utils/resource-features.js.map +0 -1
- package/cli/dist/utils/service-urls.d.ts +0 -30
- package/cli/dist/utils/service-urls.d.ts.map +0 -1
- package/cli/dist/utils/service-urls.js.map +0 -1
- package/cli/dist/utils/services.d.ts +0 -18
- package/cli/dist/utils/services.d.ts.map +0 -1
- package/cli/dist/utils/services.js.map +0 -1
- package/cli/dist/utils/stack-features.d.ts +0 -22
- package/cli/dist/utils/stack-features.d.ts.map +0 -1
- package/cli/dist/utils/stack-features.js.map +0 -1
- package/cli/dist/utils/tar.d.ts +0 -7
- package/cli/dist/utils/tar.d.ts.map +0 -1
- package/cli/dist/utils/tar.js.map +0 -1
- package/cli/dist/utils/tilt.d.ts +0 -20
- package/cli/dist/utils/tilt.d.ts.map +0 -1
- package/cli/dist/utils/tilt.js.map +0 -1
- package/cli/dist/utils/validation.d.ts +0 -16
- package/cli/dist/utils/validation.d.ts.map +0 -1
- package/cli/dist/utils/validation.js.map +0 -1
- package/cli/knip.json +0 -6
- package/cli/pnpm-lock.yaml +0 -2305
- package/cli/pnpm-workspace.yaml +0 -2
- package/cli/src/cli.ts +0 -72
- package/cli/src/commands/__tests__/always-enabled-infra.test.ts +0 -109
- package/cli/src/commands/__tests__/config.test.ts +0 -146
- package/cli/src/commands/__tests__/doctor.test.ts +0 -730
- package/cli/src/commands/__tests__/error-handling.test.ts +0 -78
- package/cli/src/commands/__tests__/phases-model.test.ts +0 -161
- package/cli/src/commands/__tests__/project-resource-features-e2e.test.ts +0 -187
- package/cli/src/commands/__tests__/project.test.ts +0 -68
- package/cli/src/commands/__tests__/resource.test.ts +0 -226
- package/cli/src/commands/__tests__/saas-starter-integration.test.ts +0 -194
- package/cli/src/commands/__tests__/stack-features-e2e.test.ts +0 -135
- package/cli/src/commands/__tests__/upgrade.test.ts +0 -198
- package/cli/src/commands/completion.ts +0 -300
- package/cli/src/commands/config.ts +0 -299
- package/cli/src/commands/doctor.ts +0 -926
- package/cli/src/commands/down.ts +0 -37
- package/cli/src/commands/help.ts +0 -143
- package/cli/src/commands/networks-design.md +0 -80
- package/cli/src/commands/networks.ts +0 -332
- package/cli/src/commands/project.ts +0 -456
- package/cli/src/commands/projects.ts +0 -82
- package/cli/src/commands/resource.ts +0 -652
- package/cli/src/commands/resources.ts +0 -95
- package/cli/src/commands/stack.ts +0 -128
- package/cli/src/commands/stacks.ts +0 -52
- package/cli/src/commands/status.ts +0 -88
- package/cli/src/commands/ui.tsx +0 -843
- package/cli/src/commands/up.ts +0 -169
- package/cli/src/commands/upgrade.ts +0 -628
- package/cli/src/commands/version.ts +0 -9
- package/cli/src/components/Accessible.tsx +0 -21
- package/cli/src/components/BaseTooltip.tsx +0 -66
- package/cli/src/components/DetailPanel.tsx +0 -146
- package/cli/src/components/FileTree.tsx +0 -89
- package/cli/src/components/ResourceSelectInput.tsx +0 -30
- package/cli/src/components/ResourceTable.tsx +0 -78
- package/cli/src/components/TabBar.tsx +0 -53
- package/cli/src/components/Tooltip.tsx +0 -11
- package/cli/src/components/index.ts +0 -7
- package/cli/src/config/platform-standards.test.ts +0 -11
- package/cli/src/config/platform-standards.ts +0 -196
- package/cli/src/generator/__tests__/extension-fetch.test.ts +0 -242
- package/cli/src/generator/__tests__/template-engine.test.ts +0 -70
- package/cli/src/generator/extension-fetch.ts +0 -286
- package/cli/src/generator/template-engine.ts +0 -752
- package/cli/src/index.ts +0 -86
- package/cli/src/templates.d.ts +0 -4
- package/cli/src/types/index.ts +0 -353
- package/cli/src/utils/__tests__/cache.test.ts +0 -98
- package/cli/src/utils/__tests__/formatting.test.ts +0 -170
- package/cli/src/utils/__tests__/paths.test.ts +0 -180
- package/cli/src/utils/__tests__/port-assignment.test.ts +0 -121
- package/cli/src/utils/__tests__/service-urls.test.ts +0 -174
- package/cli/src/utils/__tests__/services.test.ts +0 -531
- package/cli/src/utils/__tests__/tilt.test.ts +0 -172
- package/cli/src/utils/__tests__/validation.test.ts +0 -148
- package/cli/src/utils/cache.ts +0 -76
- package/cli/src/utils/command-helpers.ts +0 -54
- package/cli/src/utils/constants.ts +0 -130
- package/cli/src/utils/discovery-context.ts +0 -49
- package/cli/src/utils/docker.ts +0 -20
- package/cli/src/utils/doctor-runtime.ts +0 -644
- package/cli/src/utils/env-validator.ts +0 -139
- package/cli/src/utils/errors.ts +0 -168
- package/cli/src/utils/file-helpers.ts +0 -62
- package/cli/src/utils/formatting.ts +0 -215
- package/cli/src/utils/paths.ts +0 -53
- package/cli/src/utils/port-assignment.ts +0 -106
- package/cli/src/utils/project-features.ts +0 -118
- package/cli/src/utils/project-templates.ts +0 -29
- package/cli/src/utils/prompt.ts +0 -128
- package/cli/src/utils/resource-features.ts +0 -215
- package/cli/src/utils/service-urls.ts +0 -124
- package/cli/src/utils/services.ts +0 -364
- package/cli/src/utils/stack-features.ts +0 -30
- package/cli/src/utils/tar.ts +0 -24
- package/cli/src/utils/tilt.ts +0 -133
- package/cli/src/utils/validation.ts +0 -67
- package/cli/tsconfig.json +0 -25
- package/cli/tsconfig.typecheck.json +0 -8
- package/docs/FEATURES.md +0 -281
- package/docs/demo.svg +0 -217
- package/engine/docs/AUTODISCOVERY_TEST.md +0 -182
- package/engine/docs/C4-ARCHITECTURE-operations.md +0 -396
- package/engine/docs/C4-ARCHITECTURE-overview.md +0 -284
- package/engine/docs/C4-ARCHITECTURE.md +0 -17
- package/engine/docs/GOLDEN_IMAGE_INTEGRATION.md +0 -349
- package/engine/docs/MANIFEST_DRIVEN_ARCHITECTURE.md +0 -357
- package/engine/docs/README.md +0 -284
- package/install.sh +0 -19
- package/knip.json +0 -10
- package/openspec/changes/add-vscode-tdk-troubleshooter-plugin/.openspec.yaml +0 -2
- package/openspec/changes/add-vscode-tdk-troubleshooter-plugin/design.md +0 -102
- package/openspec/changes/add-vscode-tdk-troubleshooter-plugin/proposal.md +0 -31
- package/openspec/changes/add-vscode-tdk-troubleshooter-plugin/specs/vscode-tdk-notifications/spec.md +0 -48
- package/openspec/changes/add-vscode-tdk-troubleshooter-plugin/specs/vscode-tdk-orchestration/spec.md +0 -63
- package/openspec/changes/add-vscode-tdk-troubleshooter-plugin/specs/vscode-tdk-troubleshooting/spec.md +0 -56
- package/openspec/changes/add-vscode-tdk-troubleshooter-plugin/tasks.md +0 -61
- package/openspec/changes/archive/2026-04-28-rename-domain-to-stack-service-to-resource/.openspec.yaml +0 -2
- package/openspec/changes/archive/2026-04-28-rename-domain-to-stack-service-to-resource/design.md +0 -114
- package/openspec/changes/archive/2026-04-28-rename-domain-to-stack-service-to-resource/proposal.md +0 -32
- package/openspec/changes/archive/2026-04-28-rename-domain-to-stack-service-to-resource/specs/manifest-field-migration/spec.md +0 -20
- package/openspec/changes/archive/2026-04-28-rename-domain-to-stack-service-to-resource/specs/resource-terminology-standard/spec.md +0 -20
- package/openspec/changes/archive/2026-04-28-rename-domain-to-stack-service-to-resource/specs/stack-terminology-standard/spec.md +0 -20
- package/openspec/changes/archive/2026-04-28-rename-domain-to-stack-service-to-resource/tasks.md +0 -194
- package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/.openspec.yaml +0 -2
- package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/design.md +0 -111
- package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/proposal.md +0 -33
- package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/specs/function-naming-alignment/spec.md +0 -12
- package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/specs/optional-parameter-patterns/spec.md +0 -18
- package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/specs/parameter-documentation/spec.md +0 -16
- package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/specs/parameter-naming-consistency/spec.md +0 -12
- package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/specs/parameter-ordering-standard/spec.md +0 -12
- package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/tasks.md +0 -194
- package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/.openspec.yaml +0 -2
- package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/design.md +0 -84
- package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/proposal.md +0 -31
- package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/specs/codebase-audit/spec.md +0 -27
- package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/specs/dead-code-cleanup/spec.md +0 -27
- package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/specs/test-gap-fill/spec.md +0 -23
- package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/specs/todo-resolution/spec.md +0 -27
- package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/tasks.md +0 -39
- package/openspec/changes/archive/2026-06-25-landscape-consolidation/.openspec.yaml +0 -2
- package/openspec/changes/archive/2026-06-25-landscape-consolidation/design.md +0 -80
- package/openspec/changes/archive/2026-06-25-landscape-consolidation/proposal.md +0 -40
- package/openspec/changes/archive/2026-06-25-landscape-consolidation/spec.md +0 -52
- package/openspec/changes/archive/2026-06-25-landscape-consolidation/tasks.md +0 -51
- package/openspec/changes/archive/2026-09-17-fix-generated-stack-boot/.openspec.yaml +0 -2
- package/openspec/changes/archive/2026-09-17-fix-generated-stack-boot/design.md +0 -43
- package/openspec/changes/archive/2026-09-17-fix-generated-stack-boot/proposal.md +0 -29
- package/openspec/changes/archive/2026-09-17-fix-generated-stack-boot/specs/self-contained-generated-projects/spec.md +0 -67
- package/openspec/changes/archive/2026-09-17-fix-generated-stack-boot/tasks.md +0 -27
- package/openspec/changes/optimize-runtime-docker-layers/.openspec.yaml +0 -3
- package/openspec/changes/optimize-runtime-docker-layers/design.md +0 -81
- package/openspec/changes/optimize-runtime-docker-layers/proposal.md +0 -44
- package/openspec/changes/optimize-runtime-docker-layers/specs/runtime-container-footprint/spec.md +0 -79
- package/openspec/changes/optimize-runtime-docker-layers/tasks.md +0 -36
- package/openspec/changes/prioritized-cold-start/.openspec.yaml +0 -4
- package/openspec/changes/prioritized-cold-start/design.md +0 -137
- package/openspec/changes/prioritized-cold-start/proposal.md +0 -41
- package/openspec/changes/prioritized-cold-start/specs/on-demand-resource-startup/spec.md +0 -98
- package/openspec/changes/prioritized-cold-start/tasks.md +0 -69
- package/openspec/config.yaml +0 -1
- package/openspec/specs/manifest-field-migration/spec.md +0 -24
- package/openspec/specs/resource-terminology-standard/spec.md +0 -24
- package/openspec/specs/self-contained-generated-projects/spec.md +0 -67
- package/openspec/specs/stack-terminology-standard/spec.md +0 -24
- package/platform/services/platform/proxy/service.yaml +0 -14
- package/scripts/audit-codebase.sh +0 -213
- package/scripts/autoresearch/layer-eval.sh +0 -65
- package/scripts/benchmark/README.md +0 -25
- package/scripts/benchmark/container-scale.ts +0 -503
- package/scripts/benchmark/pre-release-gate.sh +0 -9
- package/scripts/install-git-hooks.sh +0 -14
- package/scripts/measure-idle-footprint.sh +0 -58
- package/scripts/record-demo.sh +0 -43
- package/scripts/release-binaries.sh +0 -97
- package/scripts/setup-pre-commit.sh +0 -33
- package/scripts/stage-npm-engine.sh +0 -36
- package/tests/tilt-engine/__init__.py +0 -5
- package/tests/tilt-engine/conftest.py +0 -182
- package/tests/tilt-engine/fixtures/appointment-frontend-service.json +0 -11
- package/tests/tilt-engine/fixtures/identity-backend-service.json +0 -12
- package/tests/tilt-engine/fixtures/invalid-service.json +0 -4
- package/tests/tilt-engine/test_agents_md_generator.py +0 -341
- package/tests/tilt-engine/test_agents_md_integration.py +0 -378
- package/tests/tilt-engine/test_cache_operations.py +0 -181
- package/tests/tilt-engine/test_cache_persistence.py +0 -142
- package/tests/tilt-engine/test_code_executor.py +0 -152
- package/tests/tilt-engine/test_code_viewer.py +0 -127
- package/tests/tilt-engine/test_compose_port_anchors.py +0 -310
- package/tests/tilt-engine/test_config_inspector.py +0 -162
- package/tests/tilt-engine/test_daemon_focus_mode.py +0 -89
- package/tests/tilt-engine/test_daemon_polling.py +0 -122
- package/tests/tilt-engine/test_daemon_registration.py +0 -115
- package/tests/tilt-engine/test_daemon_validation.py +0 -107
- package/tests/tilt-engine/test_docker_generator_bugs.py +0 -493
- package/tests/tilt-engine/test_docker_prune.py +0 -119
- package/tests/tilt-engine/test_dockerignore_path_bug.py +0 -82
- package/tests/tilt-engine/test_file_browser.py +0 -193
- package/tests/tilt-engine/test_frontend_basepath_manifest.py +0 -27
- package/tests/tilt-engine/test_health_dependencies.py +0 -130
- package/tests/tilt-engine/test_health_endpoints.py +0 -118
- package/tests/tilt-engine/test_health_tilt_ui.py +0 -85
- package/tests/tilt-engine/test_runtime_container_footprint.py +0 -162
- package/tests/tilt-engine/test_sablier_defer_start.py +0 -237
- package/tests/tilt-engine/test_safety_aliases.py +0 -84
- package/tests/tilt-engine/test_snapshot_diff.py +0 -136
- package/tests/tilt-engine/test_snapshot_persistence.py +0 -163
- package/tests/tilt-engine/test_snapshot_scanning.py +0 -123
- package/tests/tilt-engine/test_standalone_project_boot.py +0 -61
- package/tests/tilt-engine/test_standalone_traefik.py +0 -160
- package/tests/tilt-engine/test_traefik_static_wake_route.py +0 -187
package/cli/src/commands/down.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import chalk from "chalk";
|
|
2
|
-
import { Command } from "commander";
|
|
3
|
-
import { handleDryRun } from "../utils/command-helpers.js";
|
|
4
|
-
import { handleTiltFailure, withTiltCheck } from "../utils/errors.js";
|
|
5
|
-
import { buildTiltDownArgs, runTilt } from "../utils/tilt.js";
|
|
6
|
-
|
|
7
|
-
export const downCommand = new Command("down")
|
|
8
|
-
.description("Stop all tilt resources")
|
|
9
|
-
.option("-v, --verbose", "Enable verbose output", false)
|
|
10
|
-
.option("-f, --force", "Skip confirmation", false)
|
|
11
|
-
.option("--dry-run", "Show what would be stopped without stopping", false)
|
|
12
|
-
.action(async (options) => {
|
|
13
|
-
await withTiltCheck(async () => {
|
|
14
|
-
if (handleDryRun(options, "not stopping resources", "tilt down")) {
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const tiltArgs = buildTiltDownArgs({
|
|
19
|
-
force: options.force,
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
console.log(chalk.blue("Stopping all tilt resources..."));
|
|
23
|
-
|
|
24
|
-
if (options.verbose) {
|
|
25
|
-
console.log(chalk.gray("Running: tilt down -f .tdk/.tdk-out/Tiltfile"));
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const result = await runTilt("down", tiltArgs, {
|
|
29
|
-
verbose: options.verbose,
|
|
30
|
-
inheritStdio: true,
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
if (result.exitCode !== 0) {
|
|
34
|
-
handleTiltFailure("down", result.exitCode);
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
});
|
package/cli/src/commands/help.ts
DELETED
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
import chalk from "chalk";
|
|
2
|
-
import pkg from "../../package.json" with { type: "json" };
|
|
3
|
-
|
|
4
|
-
const TDK_BANNER = `
|
|
5
|
-
${chalk.bold.cyan("tdk")} ${chalk.gray(`v${pkg.version}`)} ${chalk.white("Tilt Development Kit: run your microservices locally")}
|
|
6
|
-
`;
|
|
7
|
-
|
|
8
|
-
const COMMAND_GROUPS = [
|
|
9
|
-
{
|
|
10
|
-
title: "Project Level",
|
|
11
|
-
color: chalk.blue,
|
|
12
|
-
commands: [
|
|
13
|
-
{
|
|
14
|
-
name: "project",
|
|
15
|
-
desc: "Initialize master configs (TILT_RESOURCE_DEFAULTS.star)",
|
|
16
|
-
alias: "",
|
|
17
|
-
},
|
|
18
|
-
{ name: "projects, info", desc: "Show project information and config status", alias: "" },
|
|
19
|
-
],
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
title: "Stack Level",
|
|
23
|
-
color: chalk.magenta,
|
|
24
|
-
commands: [
|
|
25
|
-
{ name: "stack", desc: "Organize resources into stacks (interactive)", alias: "" },
|
|
26
|
-
{ name: "stacks, ls", desc: "List all stacks and their resources", alias: "" },
|
|
27
|
-
],
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
title: "Resource Level",
|
|
31
|
-
color: chalk.yellow,
|
|
32
|
-
commands: [
|
|
33
|
-
{ name: "resource", desc: "Create new resource with templates", alias: "" },
|
|
34
|
-
{ name: "resources", desc: "List all resources with filtering", alias: "--stack, --ports" },
|
|
35
|
-
],
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
title: "Lifecycle",
|
|
39
|
-
color: chalk.green,
|
|
40
|
-
commands: [
|
|
41
|
-
{ name: "up, deploy", desc: "Start services (optionally by stack)", alias: "[stack-name]" },
|
|
42
|
-
{ name: "down", desc: "Stop all tilt resources", alias: "" },
|
|
43
|
-
{ name: "status", desc: "Show status of services and stacks", alias: "" },
|
|
44
|
-
],
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
title: "Networking",
|
|
48
|
-
color: chalk.blueBright,
|
|
49
|
-
commands: [
|
|
50
|
-
{
|
|
51
|
-
name: "networks, traefik",
|
|
52
|
-
desc: "Show Traefik-routed URLs for all services",
|
|
53
|
-
alias: "--stack, --json",
|
|
54
|
-
},
|
|
55
|
-
],
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
title: "Utilities",
|
|
59
|
-
color: chalk.cyan,
|
|
60
|
-
commands: [
|
|
61
|
-
{ name: "ui, interactive", desc: "Interactive TUI for managing services", alias: "" },
|
|
62
|
-
{
|
|
63
|
-
name: "config",
|
|
64
|
-
desc: "Manage project configuration and regenerate master files",
|
|
65
|
-
alias: "regenerate, verify, edit",
|
|
66
|
-
},
|
|
67
|
-
{ name: "doctor", desc: "Check environment readiness", alias: "" },
|
|
68
|
-
{ name: "completion", desc: "Generate shell completions", alias: "--install --shell zsh" },
|
|
69
|
-
{ name: "upgrade, update", desc: "Self-update to latest version", alias: "--force" },
|
|
70
|
-
{ name: "version, -v", desc: "Display version number", alias: "" },
|
|
71
|
-
{ name: "help", desc: "Show help", alias: "[command]" },
|
|
72
|
-
],
|
|
73
|
-
},
|
|
74
|
-
];
|
|
75
|
-
|
|
76
|
-
function formatCommand(
|
|
77
|
-
name: string,
|
|
78
|
-
desc: string,
|
|
79
|
-
alias: string,
|
|
80
|
-
color: (text: string) => string,
|
|
81
|
-
): string {
|
|
82
|
-
const nameFormatted = color(name.padEnd(20));
|
|
83
|
-
const descFormatted = chalk.white(desc);
|
|
84
|
-
const aliasFormatted = alias ? chalk.gray(` ${alias}`) : "";
|
|
85
|
-
return ` ${nameFormatted} ${descFormatted}${aliasFormatted}`;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export function showHelp(): void {
|
|
89
|
-
console.log(TDK_BANNER);
|
|
90
|
-
|
|
91
|
-
console.log(chalk.bold.white("\n Project → Phase → Stack → Resource\n"));
|
|
92
|
-
|
|
93
|
-
console.log(chalk.gray(" Usage: tdk [command] [options]\n"));
|
|
94
|
-
|
|
95
|
-
console.log(chalk.bold.yellow(" Global Options:"));
|
|
96
|
-
console.log(
|
|
97
|
-
` ${chalk.cyan("-v, --version".padEnd(20))} ${chalk.white("Display version number")}`,
|
|
98
|
-
);
|
|
99
|
-
console.log(` ${chalk.cyan("--verbose".padEnd(20))} ${chalk.white("Enable verbose output")}`);
|
|
100
|
-
console.log(` ${chalk.cyan("-h, --help".padEnd(20))} ${chalk.white("Show help")}`);
|
|
101
|
-
console.log();
|
|
102
|
-
|
|
103
|
-
for (const group of COMMAND_GROUPS) {
|
|
104
|
-
console.log(group.color.bold(` ${group.title}`));
|
|
105
|
-
console.log(group.color(` ${"─".repeat(50)}`));
|
|
106
|
-
|
|
107
|
-
for (const cmd of group.commands) {
|
|
108
|
-
console.log(formatCommand(cmd.name, cmd.desc, cmd.alias, group.color));
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
console.log();
|
|
112
|
-
}
|
|
113
|
-
console.log(chalk.bold.yellow(" Quick start:"));
|
|
114
|
-
console.log(chalk.gray(` ${"─".repeat(50)}`));
|
|
115
|
-
console.log(
|
|
116
|
-
chalk.white(`
|
|
117
|
-
${chalk.cyan("1.")} Initialize project: ${chalk.green("tdk project")}
|
|
118
|
-
${chalk.cyan("2.")} Create a resource: ${chalk.green("tdk resource my-api --type backend")}
|
|
119
|
-
${chalk.cyan("3.")} Assign to stack: ${chalk.green("tdk stack my-stack")}
|
|
120
|
-
${chalk.cyan("4.")} Start development: ${chalk.green("tdk up my-stack")}
|
|
121
|
-
`),
|
|
122
|
-
);
|
|
123
|
-
console.log(chalk.bold.yellow(" Examples:"));
|
|
124
|
-
console.log(chalk.gray(` ${"─".repeat(50)}`));
|
|
125
|
-
console.log(
|
|
126
|
-
chalk.white(`
|
|
127
|
-
${chalk.cyan("$")} tdk project # Create master configs
|
|
128
|
-
${chalk.cyan("$")} tdk resource api --type backend # Create a backend service
|
|
129
|
-
${chalk.cyan("$")} tdk resource app --type frontend # Create a frontend app
|
|
130
|
-
${chalk.cyan("$")} tdk stacks --services # List stacks with their resources
|
|
131
|
-
${chalk.cyan("$")} tdk up my-stack # Start a stack
|
|
132
|
-
${chalk.cyan("$")} tdk networks # Show Traefik-routed URLs
|
|
133
|
-
${chalk.cyan("$")} tdk doctor # Check your environment
|
|
134
|
-
${chalk.cyan("$")} tdk upgrade # Self-update
|
|
135
|
-
`),
|
|
136
|
-
);
|
|
137
|
-
console.log(chalk.gray(` ${"═".repeat(50)}`));
|
|
138
|
-
console.log(chalk.gray(` For more help: ${chalk.cyan("tdk help [command]")}`));
|
|
139
|
-
console.log(
|
|
140
|
-
chalk.gray(` GitHub: ${chalk.cyan("https://github.com/tdk-landscape/tdk-cli-core")}`),
|
|
141
|
-
);
|
|
142
|
-
console.log();
|
|
143
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
# TDK Networks Command Design
|
|
2
|
-
|
|
3
|
-
## Overview
|
|
4
|
-
Display Traefik-routed URLs for all services in a clean, modern CLI format.
|
|
5
|
-
|
|
6
|
-
## Design Principles
|
|
7
|
-
|
|
8
|
-
### 1. Visual Hierarchy
|
|
9
|
-
- Header with clear title and domain info
|
|
10
|
-
- Group by stack with emoji indicators
|
|
11
|
-
- Service name left-aligned, URL right-aligned
|
|
12
|
-
- Status indicators (emoji) for quick scanning
|
|
13
|
-
|
|
14
|
-
### 2. Layout
|
|
15
|
-
```
|
|
16
|
-
┌─────────────────────────────────────────────────────────┐
|
|
17
|
-
│ 🌐 TRAEFIK NETWORKS │
|
|
18
|
-
│ Domain: {project}.localhost │
|
|
19
|
-
├─────────────────────────────────────────────────────────┤
|
|
20
|
-
│ │
|
|
21
|
-
│ 🔐 IDENTITY STACK │
|
|
22
|
-
│ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ │
|
|
23
|
-
│ 🟢 api-api localhost:4004 → /api/api │
|
|
24
|
-
│ 🟢 api-app localhost:3000 → /api │
|
|
25
|
-
│ │
|
|
26
|
-
│ 📅 ORDER STACK │
|
|
27
|
-
│ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ │
|
|
28
|
-
│ 🟢 order-api localhost:4001 → /order│
|
|
29
|
-
│ 🟢 order-app localhost:3001 → /orders│
|
|
30
|
-
│ │
|
|
31
|
-
└─────────────────────────────────────────────────────────┘
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
### 3. Color Scheme
|
|
35
|
-
- **Header**: Cyan background, white bold text
|
|
36
|
-
- **Stack names**: White bold with colored emoji
|
|
37
|
-
- **Service names**: Gray/white
|
|
38
|
-
- **URLs**: Cyan (clickable terminals will underline)
|
|
39
|
-
- **Status**:
|
|
40
|
-
- 🟢 Green (running)
|
|
41
|
-
- 🔴 Red (stopped)
|
|
42
|
-
- ⚪ Gray (unknown)
|
|
43
|
-
|
|
44
|
-
### 4. Alignment
|
|
45
|
-
- Stack headers: Left-aligned, bold
|
|
46
|
-
- Separator line: Full width (━ character)
|
|
47
|
-
- Service name: Left-aligned, 24 chars max
|
|
48
|
-
- Arrow separator: "→" in gray
|
|
49
|
-
- URL: Left-aligned, cyan color
|
|
50
|
-
|
|
51
|
-
### 5. Data Display
|
|
52
|
-
```typescript
|
|
53
|
-
interface DisplayRow {
|
|
54
|
-
status: '🟢' | '🔴' | '⚪'
|
|
55
|
-
serviceName: string // 24 chars max
|
|
56
|
-
separator: '→'
|
|
57
|
-
port?: string // localhost:PORT or internal:PORT
|
|
58
|
-
path: string // /service-path
|
|
59
|
-
fullUrl: string // http://domain/path
|
|
60
|
-
}
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
### 6. Terminal Width
|
|
64
|
-
- Fixed width: 60 characters
|
|
65
|
-
- Truncate service names at 24 chars
|
|
66
|
-
- URL always clickable (http://...)
|
|
67
|
-
|
|
68
|
-
### 7. Features
|
|
69
|
-
- Clickable URLs (plain http:// format)
|
|
70
|
-
- Grouped by stack
|
|
71
|
-
- Status indicators
|
|
72
|
-
- Clean separation between stacks
|
|
73
|
-
|
|
74
|
-
## Implementation Notes
|
|
75
|
-
|
|
76
|
-
1. Use chalk for colors
|
|
77
|
-
2. No ANSI escape codes for hyperlinks (causes issues)
|
|
78
|
-
3. Plain http:// URLs are auto-detected by modern terminals
|
|
79
|
-
4. Pad service names to align arrows
|
|
80
|
-
5. Use box-drawing characters for clean borders
|
|
@@ -1,332 +0,0 @@
|
|
|
1
|
-
import { execSync, spawn } from "node:child_process";
|
|
2
|
-
import chalk from "chalk";
|
|
3
|
-
import { Command } from "commander";
|
|
4
|
-
import { readProjectConfig } from "../generator/template-engine.js";
|
|
5
|
-
import type { ServiceUrl } from "../types/index.js";
|
|
6
|
-
import { getStackEmoji } from "../utils/constants.js";
|
|
7
|
-
import { createDiscoveryContext } from "../utils/discovery-context.js";
|
|
8
|
-
import { logVerbose, requireProjectRoot } from "../utils/errors.js";
|
|
9
|
-
import {
|
|
10
|
-
colorizeByStatus,
|
|
11
|
-
DEFAULT_BOX_WIDTH,
|
|
12
|
-
formatBoxLine,
|
|
13
|
-
formatPadded,
|
|
14
|
-
getStatusIcon,
|
|
15
|
-
printBoxedHeader,
|
|
16
|
-
} from "../utils/formatting.js";
|
|
17
|
-
import { findProjectRoot } from "../utils/paths.js";
|
|
18
|
-
import { checkPortStatus } from "../utils/port-assignment.js";
|
|
19
|
-
import { isValidPort, sanitizeForShell } from "../utils/validation.js";
|
|
20
|
-
|
|
21
|
-
function execSafe(
|
|
22
|
-
command: string,
|
|
23
|
-
args: string[],
|
|
24
|
-
options: { encoding?: string; timeout?: number } = {},
|
|
25
|
-
): Promise<string> {
|
|
26
|
-
return new Promise((resolve, reject) => {
|
|
27
|
-
const child = spawn(command, args, {
|
|
28
|
-
timeout: options.timeout || 5000,
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
let stdout = "";
|
|
32
|
-
let stderr = "";
|
|
33
|
-
|
|
34
|
-
child.stdout?.on("data", (data: Buffer) => {
|
|
35
|
-
stdout += data.toString();
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
child.stderr?.on("data", (data: Buffer) => {
|
|
39
|
-
stderr += data.toString();
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
child.on("close", (code: number | null) => {
|
|
43
|
-
if (code !== 0) {
|
|
44
|
-
reject(new Error(`Command failed with exit code ${code}: ${stderr}`));
|
|
45
|
-
} else {
|
|
46
|
-
resolve(stdout);
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
child.on("error", (err: Error) => {
|
|
51
|
-
reject(err);
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function determineDefaultDomain(): string {
|
|
57
|
-
const projectRoot = findProjectRoot();
|
|
58
|
-
if (projectRoot) {
|
|
59
|
-
const projectConfig = readProjectConfig(projectRoot);
|
|
60
|
-
const projectName = projectConfig.project?.name;
|
|
61
|
-
if (projectName && projectName !== "tdk-project") {
|
|
62
|
-
return `${projectName}.localhost`;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const domains = new Set<string>();
|
|
67
|
-
try {
|
|
68
|
-
const traefikLabels = execSync(
|
|
69
|
-
'docker ps --filter "label=traefik.enable=true" --format "{{.Labels}}" 2>/dev/null',
|
|
70
|
-
{ encoding: "utf-8" },
|
|
71
|
-
);
|
|
72
|
-
|
|
73
|
-
// Capture every Host(`...`) in a rule (multi-host rules included), avoid ReDoS with bounded classes
|
|
74
|
-
const domainRegex = /Host\(`([a-zA-Z0-9_.-]{1,100})`\)/g;
|
|
75
|
-
for (
|
|
76
|
-
let match = domainRegex.exec(traefikLabels);
|
|
77
|
-
match !== null;
|
|
78
|
-
match = domainRegex.exec(traefikLabels)
|
|
79
|
-
) {
|
|
80
|
-
domains.add(match[1]);
|
|
81
|
-
}
|
|
82
|
-
} catch (err: unknown) {
|
|
83
|
-
console.warn(chalk.yellow("⚠️ Could not scan Traefik domains (Docker unavailable)"));
|
|
84
|
-
logVerbose("Docker scan error details", err);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// Filter out service-specific domains (ones that look like individual services)
|
|
88
|
-
// Service domains typically contain the full service name like "myapp-api-frontend.localhost"
|
|
89
|
-
const domainList = Array.from(domains);
|
|
90
|
-
const projectDomains = domainList.filter((domain) => {
|
|
91
|
-
if (/^(app|api)\.[\w-]+\.localhost$/.test(domain)) return true;
|
|
92
|
-
// Skip domains that look like specific service instances
|
|
93
|
-
// These are long, hyphen-heavy domains for individual services
|
|
94
|
-
const servicePatterns = [
|
|
95
|
-
/\w+-\w+-frontend\.localhost$/,
|
|
96
|
-
/\w+-\w+-backend\.localhost$/,
|
|
97
|
-
/\w+-\w+-worker\.localhost$/,
|
|
98
|
-
/\w+-\w+-migrator\.localhost$/,
|
|
99
|
-
];
|
|
100
|
-
return !servicePatterns.some((pattern) => pattern.test(domain));
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
// Prefer project-level domains (shorter, simpler ones)
|
|
104
|
-
if (projectDomains.length > 0) {
|
|
105
|
-
// Sort by length - shortest is likely the project domain
|
|
106
|
-
projectDomains.sort((a, b) => a.length - b.length);
|
|
107
|
-
return projectDomains[0];
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
// If only service-specific domains found, extract base from first one
|
|
111
|
-
// e.g., "myapp-api-frontend.localhost" -> try to find "myapp.localhost"
|
|
112
|
-
if (domainList.length > 0) {
|
|
113
|
-
const firstDomain = domainList[0];
|
|
114
|
-
const localhostMatch = firstDomain.match(/([\w-]+)\.localhost$/);
|
|
115
|
-
if (localhostMatch) {
|
|
116
|
-
const _prefix = localhostMatch[1];
|
|
117
|
-
// If it looks like a service domain, try common project names
|
|
118
|
-
const commonProjects = ["tdk", "project", "app", "api", "myapp"];
|
|
119
|
-
for (const project of commonProjects) {
|
|
120
|
-
const testDomain = `${project}.localhost`;
|
|
121
|
-
if (domainList.includes(testDomain)) {
|
|
122
|
-
return testDomain;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
return "localhost";
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
async function checkServiceStatus(
|
|
132
|
-
serviceName: string,
|
|
133
|
-
port?: number,
|
|
134
|
-
url?: string,
|
|
135
|
-
): Promise<"running" | "stopped" | "unknown"> {
|
|
136
|
-
if (url) {
|
|
137
|
-
try {
|
|
138
|
-
const validUrl = new URL(url);
|
|
139
|
-
if (validUrl.protocol !== "http:" && validUrl.protocol !== "https:") {
|
|
140
|
-
return "stopped";
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
const statusCode = await execSafe(
|
|
144
|
-
"curl",
|
|
145
|
-
["-s", "-o", "/dev/null", "-w", "%{http_code}", "--max-time", "2", validUrl.toString()],
|
|
146
|
-
{ timeout: 3000 },
|
|
147
|
-
);
|
|
148
|
-
|
|
149
|
-
const code = statusCode.trim();
|
|
150
|
-
|
|
151
|
-
if (/^[23]\d\d$/.test(code)) {
|
|
152
|
-
return "running";
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
if (/^[45]\d\d$/.test(code)) {
|
|
156
|
-
return "stopped";
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
// Connection refused or other error - service not accessible
|
|
160
|
-
if (code === "000") {
|
|
161
|
-
return "stopped";
|
|
162
|
-
}
|
|
163
|
-
} catch (err: unknown) {
|
|
164
|
-
console.warn(chalk.yellow(`⚠️ Could not reach ${url} (HTTP check failed)`));
|
|
165
|
-
logVerbose(`HTTP check error details for ${url}`, err);
|
|
166
|
-
return "stopped";
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
if (port && isValidPort(port)) {
|
|
171
|
-
const portStatus = await checkPortStatus(port);
|
|
172
|
-
if (portStatus === "running") {
|
|
173
|
-
return "running";
|
|
174
|
-
}
|
|
175
|
-
if (portStatus === "unknown") {
|
|
176
|
-
console.warn(chalk.yellow(`⚠️ Could not check port ${port} (lsof unavailable)`));
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
try {
|
|
181
|
-
const containerName = sanitizeForShell(serviceName);
|
|
182
|
-
const result = await execSafe(
|
|
183
|
-
"docker",
|
|
184
|
-
["ps", "--filter", `name=${containerName}`, "--format", "{{.Names}}"],
|
|
185
|
-
{ timeout: 5000 },
|
|
186
|
-
);
|
|
187
|
-
|
|
188
|
-
if (result && result.trim().length > 0) {
|
|
189
|
-
return "running";
|
|
190
|
-
}
|
|
191
|
-
} catch (err: unknown) {
|
|
192
|
-
console.warn(chalk.yellow(`⚠️ Could not check Docker for ${serviceName}`));
|
|
193
|
-
logVerbose(`Docker check error details for ${serviceName}`, err);
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
return "stopped";
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
export const networksCommand = new Command("networks")
|
|
200
|
-
.description("Show Traefik-routed URLs for all services")
|
|
201
|
-
.alias("urls")
|
|
202
|
-
.alias("traefik")
|
|
203
|
-
.option("-s, --stack <stack>", "Filter by stack name")
|
|
204
|
-
.option("--json", "Output as JSON")
|
|
205
|
-
.option("--raw", "Output raw URLs only")
|
|
206
|
-
.action(async (options) => {
|
|
207
|
-
const projectRoot = requireProjectRoot();
|
|
208
|
-
const discovery = createDiscoveryContext();
|
|
209
|
-
|
|
210
|
-
const baseDomain = determineDefaultDomain();
|
|
211
|
-
const bareDomain = baseDomain.replace(/^(app|api)\./, "");
|
|
212
|
-
const appDomain = `app.${bareDomain}`;
|
|
213
|
-
const apiDomain = `api.${bareDomain}`;
|
|
214
|
-
const services = discovery.resources;
|
|
215
|
-
const servicesWithUrls: ServiceUrl[] = await Promise.all(
|
|
216
|
-
services
|
|
217
|
-
.filter(
|
|
218
|
-
(s): s is typeof s & { config: { basePath: string } } =>
|
|
219
|
-
typeof s.config?.basePath === "string",
|
|
220
|
-
)
|
|
221
|
-
.map(async (s) => {
|
|
222
|
-
const basePath = s.config.basePath.replace(/^\//, "");
|
|
223
|
-
const isBackend = (s.config as { appType?: string })?.appType === "backend";
|
|
224
|
-
const host = isBackend ? apiDomain : appDomain;
|
|
225
|
-
const url = `http://${host}/${basePath}`;
|
|
226
|
-
const port = s.config.port;
|
|
227
|
-
const status = await checkServiceStatus(s.name, port, url);
|
|
228
|
-
|
|
229
|
-
return {
|
|
230
|
-
name: s.name,
|
|
231
|
-
stack: s.stack,
|
|
232
|
-
basePath: s.config.basePath,
|
|
233
|
-
url,
|
|
234
|
-
port,
|
|
235
|
-
status,
|
|
236
|
-
};
|
|
237
|
-
}),
|
|
238
|
-
);
|
|
239
|
-
|
|
240
|
-
const filteredServices = options.stack
|
|
241
|
-
? servicesWithUrls.filter((s) => s.stack === options.stack)
|
|
242
|
-
: servicesWithUrls;
|
|
243
|
-
|
|
244
|
-
if (filteredServices.length === 0) {
|
|
245
|
-
if (options.stack) {
|
|
246
|
-
console.log(chalk.yellow(`⚠️ No services with basePath found in stack "${options.stack}"`));
|
|
247
|
-
} else {
|
|
248
|
-
console.log(chalk.yellow("⚠️ No services with basePath found"));
|
|
249
|
-
console.log(chalk.gray("\nAdd basePath to your service.json:"));
|
|
250
|
-
console.log(chalk.gray(' "basePath": "/my-service"'));
|
|
251
|
-
}
|
|
252
|
-
process.exit(0);
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
if (options.json) {
|
|
256
|
-
console.log(JSON.stringify(filteredServices, null, 2));
|
|
257
|
-
process.exit(0);
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
if (options.raw) {
|
|
261
|
-
for (const service of filteredServices) {
|
|
262
|
-
console.log(service.url);
|
|
263
|
-
}
|
|
264
|
-
process.exit(0);
|
|
265
|
-
}
|
|
266
|
-
printBoxedHeader("🌐 TRAEFIK NETWORKS", `Domain: http://${baseDomain}`, DEFAULT_BOX_WIDTH);
|
|
267
|
-
|
|
268
|
-
// Group services by stack using discovery context's stack names for consistent ordering
|
|
269
|
-
const stacks = new Map<string, ServiceUrl[]>();
|
|
270
|
-
for (const stackName of discovery.stackNames) {
|
|
271
|
-
const stackServices = filteredServices.filter((s) => s.stack === stackName);
|
|
272
|
-
if (stackServices.length > 0) {
|
|
273
|
-
stacks.set(stackName, stackServices);
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
// Add unstacked services to 'default' group
|
|
277
|
-
const unstackedServices = filteredServices.filter((s) => !s.stack);
|
|
278
|
-
if (unstackedServices.length > 0) {
|
|
279
|
-
stacks.set("default", unstackedServices);
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
let isFirstStack = true;
|
|
283
|
-
for (const [stackName, stackServices] of stacks) {
|
|
284
|
-
if (!isFirstStack) {
|
|
285
|
-
console.log();
|
|
286
|
-
}
|
|
287
|
-
isFirstStack = false;
|
|
288
|
-
|
|
289
|
-
const emoji = getStackEmoji(stackName);
|
|
290
|
-
const stackTitle = `${emoji} ${stackName.toUpperCase()} STACK`;
|
|
291
|
-
|
|
292
|
-
console.log();
|
|
293
|
-
console.log(chalk.bold.white(stackTitle));
|
|
294
|
-
console.log(chalk.gray(formatBoxLine("━", DEFAULT_BOX_WIDTH - 4)));
|
|
295
|
-
|
|
296
|
-
for (const service of stackServices) {
|
|
297
|
-
const statusSymbol = getStatusIcon(service.status);
|
|
298
|
-
const statusEmoji = colorizeByStatus(statusSymbol, service.status);
|
|
299
|
-
|
|
300
|
-
const namePart = formatPadded(service.name, 22);
|
|
301
|
-
const urlPart =
|
|
302
|
-
service.status === "running"
|
|
303
|
-
? chalk.cyan.underline(service.url)
|
|
304
|
-
: chalk.gray(service.url); // Gray out URL if stopped
|
|
305
|
-
|
|
306
|
-
const statusLabel = service.status !== "running" ? chalk.gray(` [${service.status}]`) : "";
|
|
307
|
-
|
|
308
|
-
console.log(` ${statusEmoji} ${chalk.white(namePart)} ${urlPart}${statusLabel}`);
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
console.log();
|
|
312
|
-
console.log(chalk.gray(formatBoxLine("─", DEFAULT_BOX_WIDTH - 2)));
|
|
313
|
-
console.log(chalk.gray("🖱️ Click any URL above to open in browser"));
|
|
314
|
-
console.log(
|
|
315
|
-
chalk.gray("📊 Status: ") +
|
|
316
|
-
chalk.green("✓ Running") +
|
|
317
|
-
" | " +
|
|
318
|
-
chalk.red("✗ Stopped") +
|
|
319
|
-
" | " +
|
|
320
|
-
chalk.gray("? Unknown"),
|
|
321
|
-
);
|
|
322
|
-
|
|
323
|
-
if (baseDomain === "localhost") {
|
|
324
|
-
console.log();
|
|
325
|
-
const projectConfig = readProjectConfig(projectRoot);
|
|
326
|
-
const projectName = projectConfig.project.name;
|
|
327
|
-
console.log(chalk.yellow("💡 Tip: Set custom domain with:"));
|
|
328
|
-
console.log(chalk.cyan(` export TDK_PUBLIC_HOST=${projectName}.localhost`));
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
console.log();
|
|
332
|
-
});
|