@tdk-landscape/tdk-cli-core 1.3.52 → 1.3.54
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/config.js +1 -1
- package/cli/dist/commands/resource.js +1 -1
- package/cli/dist/generator/extension-fetch.js +16 -9
- package/cli/package.json +1 -1
- package/package.json +16 -1
- 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 -8
- package/.github/ISSUE_TEMPLATE/feature_request.yml +0 -18
- 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 -279
- 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
|
@@ -1,226 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
import {
|
|
3
|
-
BASE_TEMPLATE,
|
|
4
|
-
createPackageJson,
|
|
5
|
-
createServiceJson,
|
|
6
|
-
DOCKERFILE_TEMPLATE,
|
|
7
|
-
getBackendIndexTemplate,
|
|
8
|
-
getWorkerIndexTemplate,
|
|
9
|
-
TSCONFIG_TEMPLATE,
|
|
10
|
-
TYPE_SPECIFIC,
|
|
11
|
-
} from "../../commands/resource.js";
|
|
12
|
-
import { CREATABLE_RESOURCE_TYPES, isCreatableResourceType } from "../../types/index.js";
|
|
13
|
-
import { KEBAB_CASE_REGEX } from "../../utils/validation.js";
|
|
14
|
-
|
|
15
|
-
describe("resource command", () => {
|
|
16
|
-
describe("resource name validation", () => {
|
|
17
|
-
it("should accept valid kebab-case names using KEBAB_CASE_REGEX", () => {
|
|
18
|
-
const validNames = ["my-service", "service123", "api-gateway", "a", "test-123-abc"];
|
|
19
|
-
|
|
20
|
-
for (const name of validNames) {
|
|
21
|
-
expect(KEBAB_CASE_REGEX.test(name)).toBe(true);
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
it("should reject invalid names using KEBAB_CASE_REGEX", () => {
|
|
26
|
-
const invalidNames = [
|
|
27
|
-
"MyService", // camelCase
|
|
28
|
-
"my_service", // underscore
|
|
29
|
-
"my service", // space
|
|
30
|
-
"service.name", // dot
|
|
31
|
-
"Service-Name", // uppercase
|
|
32
|
-
"", // empty
|
|
33
|
-
];
|
|
34
|
-
|
|
35
|
-
for (const name of invalidNames) {
|
|
36
|
-
expect(KEBAB_CASE_REGEX.test(name)).toBe(false);
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
describe("service.json template", () => {
|
|
42
|
-
it("should create valid backend service.json using createServiceJson", () => {
|
|
43
|
-
const name = "test-backend";
|
|
44
|
-
const type = "backend";
|
|
45
|
-
const stack = "main";
|
|
46
|
-
const port = 3001;
|
|
47
|
-
|
|
48
|
-
const serviceJson = createServiceJson(name, type, stack, port);
|
|
49
|
-
|
|
50
|
-
expect(serviceJson).toHaveProperty("name", name);
|
|
51
|
-
expect(serviceJson).toHaveProperty("type", type);
|
|
52
|
-
expect(serviceJson).toHaveProperty("port", port);
|
|
53
|
-
expect(serviceJson).toHaveProperty("stack", stack);
|
|
54
|
-
expect(serviceJson).toHaveProperty("healthCheck", "/health");
|
|
55
|
-
expect(serviceJson).toHaveProperty("dependencies");
|
|
56
|
-
expect(serviceJson).toHaveProperty("build");
|
|
57
|
-
expect(serviceJson).toHaveProperty("dev");
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
it("should create valid frontend service.json using createServiceJson", () => {
|
|
61
|
-
const name = "test-frontend";
|
|
62
|
-
const type = "frontend";
|
|
63
|
-
const stack = "main";
|
|
64
|
-
const port = 3002;
|
|
65
|
-
|
|
66
|
-
const serviceJson = createServiceJson(name, type, stack, port);
|
|
67
|
-
|
|
68
|
-
expect(serviceJson).toHaveProperty("name", name);
|
|
69
|
-
expect(serviceJson).toHaveProperty("type", type);
|
|
70
|
-
expect(serviceJson).toHaveProperty("port", port);
|
|
71
|
-
expect(serviceJson.dev.watch).toContain("public/**/*");
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
it("should create valid worker service.json using createServiceJson", () => {
|
|
75
|
-
const name = "test-worker";
|
|
76
|
-
const type = "worker";
|
|
77
|
-
const stack = "main";
|
|
78
|
-
const port = 0;
|
|
79
|
-
|
|
80
|
-
const serviceJson = createServiceJson(name, type, stack, port);
|
|
81
|
-
|
|
82
|
-
expect(serviceJson).toHaveProperty("name", name);
|
|
83
|
-
expect(serviceJson).toHaveProperty("type", type);
|
|
84
|
-
expect(serviceJson.port).toBe(0); // Workers may not need ports
|
|
85
|
-
expect(serviceJson.dev.command).toBe("bun run worker");
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
it("should have correct TYPE_SPECIFIC extensions for each resource type", () => {
|
|
89
|
-
expect(TYPE_SPECIFIC.backend).toHaveProperty("healthCheck", "/health");
|
|
90
|
-
expect(TYPE_SPECIFIC.frontend.dev?.watch).toContain("public/**/*");
|
|
91
|
-
expect(TYPE_SPECIFIC.worker.dev?.command).toBe("bun run worker");
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
it("should have correct BASE_TEMPLATE structure", () => {
|
|
95
|
-
expect(BASE_TEMPLATE).toHaveProperty("port", 0);
|
|
96
|
-
expect(BASE_TEMPLATE).toHaveProperty("dependencies");
|
|
97
|
-
expect(BASE_TEMPLATE).toHaveProperty("build");
|
|
98
|
-
expect(BASE_TEMPLATE).toHaveProperty("dev");
|
|
99
|
-
expect(BASE_TEMPLATE.build).toHaveProperty("dockerfile", "Dockerfile");
|
|
100
|
-
});
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
describe("package.json template", () => {
|
|
104
|
-
it("should create backend package.json with Hono using createPackageJson", () => {
|
|
105
|
-
const name = "test-backend";
|
|
106
|
-
const type = "backend";
|
|
107
|
-
|
|
108
|
-
const packageJson = createPackageJson(name, type);
|
|
109
|
-
|
|
110
|
-
expect(packageJson.name).toBe(`@project/${name}`);
|
|
111
|
-
expect(packageJson).toHaveProperty("dependencies");
|
|
112
|
-
expect(packageJson.dependencies).toHaveProperty("hono");
|
|
113
|
-
expect(packageJson.dependencies).not.toHaveProperty("vite");
|
|
114
|
-
expect(packageJson.scripts.dev).toBe("bun run --watch src/index.ts");
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
it("should create frontend package.json with Vite using createPackageJson", () => {
|
|
118
|
-
const name = "test-frontend";
|
|
119
|
-
const type = "frontend";
|
|
120
|
-
|
|
121
|
-
const packageJson = createPackageJson(name, type);
|
|
122
|
-
|
|
123
|
-
expect(packageJson.name).toBe(`@project/${name}`);
|
|
124
|
-
expect(packageJson.dependencies).not.toHaveProperty("hono");
|
|
125
|
-
expect(packageJson.devDependencies).toHaveProperty("vite");
|
|
126
|
-
expect(packageJson.scripts.dev).toBe("vite");
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
it("should create worker package.json using createPackageJson", () => {
|
|
130
|
-
const name = "test-worker";
|
|
131
|
-
const type = "worker";
|
|
132
|
-
|
|
133
|
-
const packageJson = createPackageJson(name, type);
|
|
134
|
-
|
|
135
|
-
expect(packageJson.name).toBe(`@project/${name}`);
|
|
136
|
-
expect(packageJson.dependencies).toHaveProperty("hono");
|
|
137
|
-
expect(packageJson.scripts.build).toBe("tsc");
|
|
138
|
-
});
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
describe("tsconfig template", () => {
|
|
142
|
-
it("should have correct TSCONFIG_TEMPLATE structure", () => {
|
|
143
|
-
expect(TSCONFIG_TEMPLATE).toHaveProperty("compilerOptions");
|
|
144
|
-
expect(TSCONFIG_TEMPLATE.compilerOptions).toHaveProperty("target", "ES2022");
|
|
145
|
-
expect(TSCONFIG_TEMPLATE.compilerOptions).toHaveProperty("module", "ESNext");
|
|
146
|
-
expect(TSCONFIG_TEMPLATE.compilerOptions).toHaveProperty("strict", true);
|
|
147
|
-
expect(TSCONFIG_TEMPLATE).toHaveProperty("include");
|
|
148
|
-
expect(TSCONFIG_TEMPLATE.include).toContain("src/**/*");
|
|
149
|
-
});
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
describe("dockerfile template", () => {
|
|
153
|
-
it("should have correct DOCKERFILE_TEMPLATE content", () => {
|
|
154
|
-
expect(DOCKERFILE_TEMPLATE).toContain("FROM oven/bun:1.2");
|
|
155
|
-
expect(DOCKERFILE_TEMPLATE).toContain("WORKDIR /app");
|
|
156
|
-
expect(DOCKERFILE_TEMPLATE).toContain("HEALTHCHECK");
|
|
157
|
-
expect(DOCKERFILE_TEMPLATE).toContain("EXPOSE 3000");
|
|
158
|
-
expect(DOCKERFILE_TEMPLATE).toContain("bun install --frozen-lockfile");
|
|
159
|
-
});
|
|
160
|
-
});
|
|
161
|
-
|
|
162
|
-
describe("backend index.ts template", () => {
|
|
163
|
-
it("should have health check endpoints via getBackendIndexTemplate", () => {
|
|
164
|
-
const name = "test-service";
|
|
165
|
-
const indexContent = getBackendIndexTemplate(name);
|
|
166
|
-
|
|
167
|
-
expect(indexContent).toContain("app.get('/health'");
|
|
168
|
-
expect(indexContent).toContain("app.get('/health/live'");
|
|
169
|
-
expect(indexContent).toContain("app.get('/health/ready'");
|
|
170
|
-
expect(indexContent).toContain("async (c)");
|
|
171
|
-
expect(indexContent).toContain(`service: '${name}'`);
|
|
172
|
-
});
|
|
173
|
-
|
|
174
|
-
it("should have root endpoint with service info", () => {
|
|
175
|
-
const name = "test-service";
|
|
176
|
-
const indexContent = getBackendIndexTemplate(name);
|
|
177
|
-
|
|
178
|
-
expect(indexContent).toContain("app.get('/',");
|
|
179
|
-
expect(indexContent).toContain("endpoints:");
|
|
180
|
-
});
|
|
181
|
-
});
|
|
182
|
-
|
|
183
|
-
describe("worker index.ts template", () => {
|
|
184
|
-
it("should have worker configuration via getWorkerIndexTemplate", () => {
|
|
185
|
-
const name = "test-worker";
|
|
186
|
-
const workerContent = getWorkerIndexTemplate(name);
|
|
187
|
-
|
|
188
|
-
expect(workerContent).toContain("WORKER_POLL_INTERVAL");
|
|
189
|
-
expect(workerContent).toContain("WORKER_MAX_RETRIES");
|
|
190
|
-
expect(workerContent).toContain("WORKER_BATCH_SIZE");
|
|
191
|
-
expect(workerContent).toContain("interface Job");
|
|
192
|
-
expect(workerContent).toContain("async function main()");
|
|
193
|
-
});
|
|
194
|
-
|
|
195
|
-
it("should have graceful shutdown handling", () => {
|
|
196
|
-
const name = "test-worker";
|
|
197
|
-
const workerContent = getWorkerIndexTemplate(name);
|
|
198
|
-
|
|
199
|
-
expect(workerContent).toContain("process.on('SIGTERM'");
|
|
200
|
-
expect(workerContent).toContain("process.on('SIGINT'");
|
|
201
|
-
expect(workerContent).toContain("shutting down gracefully");
|
|
202
|
-
});
|
|
203
|
-
});
|
|
204
|
-
|
|
205
|
-
describe("resource type validation", () => {
|
|
206
|
-
it("should only accept valid resource types via isCreatableResourceType", () => {
|
|
207
|
-
const validTypes = ["backend", "frontend", "worker"];
|
|
208
|
-
const invalidTypes = ["api", "microservice", "service", "app", "library", "sdk"];
|
|
209
|
-
|
|
210
|
-
for (const type of validTypes) {
|
|
211
|
-
expect(isCreatableResourceType(type)).toBe(true);
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
for (const type of invalidTypes) {
|
|
215
|
-
expect(isCreatableResourceType(type)).toBe(false);
|
|
216
|
-
}
|
|
217
|
-
});
|
|
218
|
-
|
|
219
|
-
it("should have correct CREATABLE_RESOURCE_TYPES", () => {
|
|
220
|
-
expect(CREATABLE_RESOURCE_TYPES).toContain("backend");
|
|
221
|
-
expect(CREATABLE_RESOURCE_TYPES).toContain("frontend");
|
|
222
|
-
expect(CREATABLE_RESOURCE_TYPES).toContain("worker");
|
|
223
|
-
expect(CREATABLE_RESOURCE_TYPES).toHaveLength(3);
|
|
224
|
-
});
|
|
225
|
-
});
|
|
226
|
-
});
|
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
import { execSync } from "node:child_process";
|
|
2
|
-
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
3
|
-
import { tmpdir } from "node:os";
|
|
4
|
-
import { dirname, join } from "node:path";
|
|
5
|
-
import { fileURLToPath } from "node:url";
|
|
6
|
-
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
|
7
|
-
|
|
8
|
-
// Get the CLI bin path dynamically
|
|
9
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
10
|
-
const __dirname = dirname(__filename);
|
|
11
|
-
const CLI_BIN_PATH = join(__dirname, "..", "..", "..", "bin", "tdk.js");
|
|
12
|
-
|
|
13
|
-
// `tdk doctor` requires these (see REQUIRED_ENV_VARS in ../../utils/env-validator.ts);
|
|
14
|
-
// an empty .env satisfies `tdk project`'s docker-compose validation but leaves doctor
|
|
15
|
-
// reporting "Environment not ready". Use the same defaults env-validator would generate.
|
|
16
|
-
function writeTestEnvFile(starterRoot: string) {
|
|
17
|
-
writeFileSync(
|
|
18
|
-
join(starterRoot, ".env"),
|
|
19
|
-
"VERDACCIO_URL_DOCKER=http://verdaccio:4873\nTILT_ENV=dev\nDB_PASSWORD=test-password\n",
|
|
20
|
-
);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// tdk-cli-extensions is a sibling checkout, not a dependency of this repo, so its
|
|
24
|
-
// location varies per machine. Respect an explicit override, then fall back to the
|
|
25
|
-
// conventional sibling-directory layout (both repos checked out next to each other),
|
|
26
|
-
// instead of hardcoding one contributor's absolute path.
|
|
27
|
-
const REPO_ROOT = join(__dirname, "..", "..", "..", "..");
|
|
28
|
-
const EXTENSION_SOURCE =
|
|
29
|
-
process.env.TDK_EXTENSION_SOURCE ?? join(REPO_ROOT, "..", "tdk-cli-extensions");
|
|
30
|
-
const EXTENSION_SOURCE_AVAILABLE = existsSync(EXTENSION_SOURCE);
|
|
31
|
-
|
|
32
|
-
describe.skipIf(!EXTENSION_SOURCE_AVAILABLE)("saas-starter cloning and discovery", () => {
|
|
33
|
-
if (!EXTENSION_SOURCE_AVAILABLE) {
|
|
34
|
-
console.warn(
|
|
35
|
-
`Skipping saas-starter integration tests: tdk-cli-extensions not found at ${EXTENSION_SOURCE}. ` +
|
|
36
|
-
"Set TDK_EXTENSION_SOURCE to its checkout path to run these.",
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
let testDir: string;
|
|
41
|
-
|
|
42
|
-
beforeEach(() => {
|
|
43
|
-
testDir = join(tmpdir(), `tdk-saas-test-${Date.now()}`);
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
afterEach(() => {
|
|
47
|
-
try {
|
|
48
|
-
// Safety: only delete if path is under tmpdir and contains our test marker
|
|
49
|
-
if (
|
|
50
|
-
testDir?.startsWith(tmpdir()) &&
|
|
51
|
-
testDir.includes("tdk-saas-test-") &&
|
|
52
|
-
testDir.length > 20
|
|
53
|
-
) {
|
|
54
|
-
execSync(`rm -rf "${testDir}"`, { stdio: "pipe" });
|
|
55
|
-
}
|
|
56
|
-
} catch {
|
|
57
|
-
// cleanup best-effort
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Verifies that `tdk project saas` clones the repo correctly with required
|
|
63
|
-
* structure (services/stack/service/service.json files).
|
|
64
|
-
*/
|
|
65
|
-
it("should clone saas-starter with valid file structure", () => {
|
|
66
|
-
const cwd = testDir;
|
|
67
|
-
execSync(`mkdir -p "${cwd}"`, { stdio: "pipe" });
|
|
68
|
-
|
|
69
|
-
const result = execSync(`cd "${cwd}" && bun "${CLI_BIN_PATH}" project saas --yes`, {
|
|
70
|
-
encoding: "utf-8",
|
|
71
|
-
stdio: "pipe",
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
expect(result).toContain("Cloned");
|
|
75
|
-
expect(existsSync(join(cwd, "tdk-saas-starter", "services"))).toBe(true);
|
|
76
|
-
|
|
77
|
-
// Verify all 4 saas services exist with valid service.json
|
|
78
|
-
const services = [
|
|
79
|
-
"services/app/dashboard-api/service.json",
|
|
80
|
-
"services/app/dashboard-app/service.json",
|
|
81
|
-
"services/billing/billing-api/service.json",
|
|
82
|
-
"services/billing/checkout-app/service.json",
|
|
83
|
-
];
|
|
84
|
-
|
|
85
|
-
for (const svc of services) {
|
|
86
|
-
const path = join(cwd, "tdk-saas-starter", svc);
|
|
87
|
-
expect(existsSync(path)).toBe(true);
|
|
88
|
-
const content = readFileSync(path, "utf-8");
|
|
89
|
-
const manifest = JSON.parse(content);
|
|
90
|
-
expect(manifest).toHaveProperty("appName");
|
|
91
|
-
expect(manifest).toHaveProperty("stack");
|
|
92
|
-
expect(manifest.healthCheck).toBeDefined();
|
|
93
|
-
}
|
|
94
|
-
}, 30000); // 30s: clones the real saas-starter repo over the network
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Verifies that `tdk project --yes` (after cloning) correctly discovers
|
|
98
|
-
* the existing service stacks (app, billing) from service.json files and
|
|
99
|
-
* auto-populates them in project.json's pre_alpha services, so that
|
|
100
|
-
* `tdk up` will enable them (before fix: they were silently filtered out
|
|
101
|
-
* in Tilt discovery).
|
|
102
|
-
*/
|
|
103
|
-
it("should auto-populate discovered services in project.json", () => {
|
|
104
|
-
const cwd = testDir;
|
|
105
|
-
execSync(`mkdir -p "${cwd}"`, { stdio: "pipe" });
|
|
106
|
-
|
|
107
|
-
// Clone
|
|
108
|
-
execSync(`cd "${cwd}" && bun "${CLI_BIN_PATH}" project saas --yes`, {
|
|
109
|
-
stdio: "pipe",
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
const starterRoot = join(cwd, "tdk-saas-starter");
|
|
113
|
-
writeTestEnvFile(starterRoot);
|
|
114
|
-
|
|
115
|
-
// Generate project config
|
|
116
|
-
execSync(
|
|
117
|
-
`cd "${starterRoot}" && TDK_EXTENSION_SOURCE="${EXTENSION_SOURCE}" bun "${CLI_BIN_PATH}" project --yes`,
|
|
118
|
-
{ stdio: "pipe" },
|
|
119
|
-
);
|
|
120
|
-
|
|
121
|
-
// Verify project.json has services populated
|
|
122
|
-
const projectJsonPath = join(starterRoot, ".tdk", "project.json");
|
|
123
|
-
expect(existsSync(projectJsonPath)).toBe(true);
|
|
124
|
-
|
|
125
|
-
const projectJson = JSON.parse(readFileSync(projectJsonPath, "utf-8"));
|
|
126
|
-
expect(projectJson.phases.pre_alpha.enabledStacks).toContain("app");
|
|
127
|
-
expect(projectJson.phases.pre_alpha.enabledStacks).toContain("billing");
|
|
128
|
-
}, 30000); // 30s: clones the real saas-starter repo over the network
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* Verifies that spec.master is generated with PRE_ALPHA_RESOURCES dict
|
|
132
|
-
* containing the discovered stacks, so that Tilt's should_enable() check
|
|
133
|
-
* will allow them to pass through (before fix: PRE_ALPHA_RESOURCES was empty,
|
|
134
|
-
* and only infra resources appeared in `tilt get uiresources`).
|
|
135
|
-
*/
|
|
136
|
-
it("should generate spec.master with discovered services in PRE_ALPHA_RESOURCES", () => {
|
|
137
|
-
const cwd = testDir;
|
|
138
|
-
execSync(`mkdir -p "${cwd}"`, { stdio: "pipe" });
|
|
139
|
-
|
|
140
|
-
execSync(`cd "${cwd}" && bun ${CLI_BIN_PATH} project saas --yes`, {
|
|
141
|
-
stdio: "pipe",
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
const starterRoot = join(cwd, "tdk-saas-starter");
|
|
145
|
-
writeTestEnvFile(starterRoot);
|
|
146
|
-
|
|
147
|
-
execSync(
|
|
148
|
-
`cd "${starterRoot}" && TDK_EXTENSION_SOURCE="${EXTENSION_SOURCE}" bun ${CLI_BIN_PATH} project --yes`,
|
|
149
|
-
{ stdio: "pipe" },
|
|
150
|
-
);
|
|
151
|
-
|
|
152
|
-
const specPath = join(starterRoot, ".tdk", ".tdk-out", "spec.master");
|
|
153
|
-
expect(existsSync(specPath)).toBe(true);
|
|
154
|
-
|
|
155
|
-
const specContent = readFileSync(specPath, "utf-8");
|
|
156
|
-
|
|
157
|
-
// Before fix: PRE_ALPHA_RESOURCES = { }
|
|
158
|
-
// After fix: PRE_ALPHA_RESOURCES = { "app": True, "billing": True, }
|
|
159
|
-
expect(specContent).toContain("PRE_ALPHA_RESOURCES = {");
|
|
160
|
-
expect(specContent).toMatch(/"app":\s*True/);
|
|
161
|
-
expect(specContent).toMatch(/"billing":\s*True/);
|
|
162
|
-
expect(specContent).toContain("FOCUS_PRE_ALPHA = list(PRE_ALPHA_RESOURCES.keys())");
|
|
163
|
-
});
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* Verifies that `tdk doctor` correctly reports master configs as present
|
|
167
|
-
* (they are in .tdk/.tdk-out/, not the project root).
|
|
168
|
-
*/
|
|
169
|
-
it("should pass doctor check after project init", () => {
|
|
170
|
-
const cwd = testDir;
|
|
171
|
-
execSync(`mkdir -p "${cwd}"`, { stdio: "pipe" });
|
|
172
|
-
|
|
173
|
-
execSync(`cd "${cwd}" && bun ${CLI_BIN_PATH} project saas --yes`, {
|
|
174
|
-
stdio: "pipe",
|
|
175
|
-
});
|
|
176
|
-
|
|
177
|
-
const starterRoot = join(cwd, "tdk-saas-starter");
|
|
178
|
-
writeTestEnvFile(starterRoot);
|
|
179
|
-
|
|
180
|
-
execSync(
|
|
181
|
-
`cd "${starterRoot}" && TDK_EXTENSION_SOURCE="${EXTENSION_SOURCE}" bun ${CLI_BIN_PATH} project --yes`,
|
|
182
|
-
{ stdio: "pipe" },
|
|
183
|
-
);
|
|
184
|
-
|
|
185
|
-
// Doctor should pass (all master configs present)
|
|
186
|
-
const doctorResult = execSync(`cd "${starterRoot}" && bun "${CLI_BIN_PATH}" doctor`, {
|
|
187
|
-
encoding: "utf-8",
|
|
188
|
-
stdio: "pipe",
|
|
189
|
-
timeout: 60_000,
|
|
190
|
-
});
|
|
191
|
-
|
|
192
|
-
expect(doctorResult).toContain("Environment ready");
|
|
193
|
-
});
|
|
194
|
-
});
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import { execFileSync } from "node:child_process";
|
|
2
|
-
import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
3
|
-
import { tmpdir } from "node:os";
|
|
4
|
-
import { dirname, join, resolve } from "node:path";
|
|
5
|
-
import { fileURLToPath } from "node:url";
|
|
6
|
-
import { afterEach, describe, expect, it } from "vitest";
|
|
7
|
-
|
|
8
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
9
|
-
const __dirname = dirname(__filename);
|
|
10
|
-
const repoRoot = resolve(__dirname, "../../../..");
|
|
11
|
-
const cliBin = join(repoRoot, "cli", "bin", "tdk.js");
|
|
12
|
-
|
|
13
|
-
function runTdk(args: string[], cwd: string): string {
|
|
14
|
-
return execFileSync("bun", [cliBin, ...args], {
|
|
15
|
-
cwd,
|
|
16
|
-
encoding: "utf-8",
|
|
17
|
-
env: {
|
|
18
|
-
...process.env,
|
|
19
|
-
TDK_EXTENSION_SOURCE: repoRoot,
|
|
20
|
-
},
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
describe("stack feature E2E", () => {
|
|
25
|
-
let projectRoot = "";
|
|
26
|
-
|
|
27
|
-
afterEach(() => {
|
|
28
|
-
if (projectRoot?.startsWith(tmpdir())) {
|
|
29
|
-
rmSync(projectRoot, { recursive: true, force: true });
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
it("generates database-management compose from pre_alpha services", () => {
|
|
34
|
-
projectRoot = mkdtempSync(join(tmpdir(), "tdk-stack-feature-"));
|
|
35
|
-
|
|
36
|
-
const output = runTdk(["project", "--yes"], projectRoot);
|
|
37
|
-
expect(output).toContain("Generated: services/platform/database-management/docker-compose.yml");
|
|
38
|
-
|
|
39
|
-
const projectJson = JSON.parse(
|
|
40
|
-
readFileSync(join(projectRoot, ".tdk", "project.json"), "utf-8"),
|
|
41
|
-
);
|
|
42
|
-
expect(projectJson.stack_features).toBeUndefined();
|
|
43
|
-
expect(projectJson.phases.pre_alpha.enabledStacks).toContain("database-management");
|
|
44
|
-
|
|
45
|
-
const composePath = join(
|
|
46
|
-
projectRoot,
|
|
47
|
-
"services",
|
|
48
|
-
"platform",
|
|
49
|
-
"database-management",
|
|
50
|
-
"docker-compose.yml",
|
|
51
|
-
);
|
|
52
|
-
expect(existsSync(composePath)).toBe(true);
|
|
53
|
-
|
|
54
|
-
const compose = readFileSync(composePath, "utf-8");
|
|
55
|
-
expect(compose).toContain("Stack feature: database-management");
|
|
56
|
-
expect(compose).toContain(
|
|
57
|
-
'Source: .tdk/project.json phases.*.enabledStacks includes "database-management"',
|
|
58
|
-
);
|
|
59
|
-
expect(compose).toContain("container_name: tdk_stack_feature_");
|
|
60
|
-
expect(compose).toContain("_postgres");
|
|
61
|
-
expect(compose).toContain("_database");
|
|
62
|
-
|
|
63
|
-
const spec = readFileSync(join(projectRoot, ".tdk", ".tdk-out", "spec.master"), "utf-8");
|
|
64
|
-
expect(spec).toMatch(/"database-management":\s*True/);
|
|
65
|
-
expect(spec).not.toContain("STACK_FEATURES");
|
|
66
|
-
|
|
67
|
-
const tiltignore = readFileSync(join(projectRoot, ".tiltignore"), "utf-8");
|
|
68
|
-
expect(tiltignore).toContain("**/.autogenerated/**");
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
it("does not keep database-management enabled after it leaves stack services", () => {
|
|
72
|
-
projectRoot = mkdtempSync(join(tmpdir(), "tdk-stack-feature-off-"));
|
|
73
|
-
runTdk(["project", "--yes"], projectRoot);
|
|
74
|
-
|
|
75
|
-
const projectJsonPath = join(projectRoot, ".tdk", "project.json");
|
|
76
|
-
const projectJson = JSON.parse(readFileSync(projectJsonPath, "utf-8"));
|
|
77
|
-
projectJson.phases.pre_alpha.enabledStacks = projectJson.phases.pre_alpha.enabledStacks.filter(
|
|
78
|
-
(service: string) => service !== "database-management",
|
|
79
|
-
);
|
|
80
|
-
writeFileSync(projectJsonPath, `${JSON.stringify(projectJson, null, 2)}\n`);
|
|
81
|
-
|
|
82
|
-
runTdk(["project", "--yes"], projectRoot);
|
|
83
|
-
|
|
84
|
-
const spec = readFileSync(join(projectRoot, ".tdk", ".tdk-out", "spec.master"), "utf-8");
|
|
85
|
-
expect(spec).not.toMatch(/"database-management":\s*True/);
|
|
86
|
-
expect(spec).not.toContain("STACK_FEATURES");
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
it("dedupes a duplicated service name in project.json instead of emitting a duplicate Starlark key", () => {
|
|
90
|
-
projectRoot = mkdtempSync(join(tmpdir(), "tdk-stack-feature-dupe-"));
|
|
91
|
-
runTdk(["project", "--yes"], projectRoot);
|
|
92
|
-
|
|
93
|
-
const projectJsonPath = join(projectRoot, ".tdk", "project.json");
|
|
94
|
-
const projectJson = JSON.parse(readFileSync(projectJsonPath, "utf-8"));
|
|
95
|
-
projectJson.phases.pre_alpha.enabledStacks.push("database-management");
|
|
96
|
-
writeFileSync(projectJsonPath, `${JSON.stringify(projectJson, null, 2)}\n`);
|
|
97
|
-
|
|
98
|
-
runTdk(["project"], projectRoot);
|
|
99
|
-
|
|
100
|
-
const spec = readFileSync(join(projectRoot, ".tdk", ".tdk-out", "spec.master"), "utf-8");
|
|
101
|
-
const matches = spec.match(/"database-management":\s*True/g) ?? [];
|
|
102
|
-
expect(matches.length).toBe(1);
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
it("adds newly discovered unassigned service stacks to pre_alpha on regeneration", () => {
|
|
106
|
-
projectRoot = mkdtempSync(join(tmpdir(), "tdk-stack-discovery-sync-"));
|
|
107
|
-
runTdk(["project", "--yes"], projectRoot);
|
|
108
|
-
|
|
109
|
-
const serviceDir = join(projectRoot, "services", "billing", "checkout-app");
|
|
110
|
-
mkdirSync(serviceDir, { recursive: true });
|
|
111
|
-
writeFileSync(
|
|
112
|
-
join(serviceDir, "service.json"),
|
|
113
|
-
`${JSON.stringify(
|
|
114
|
-
{
|
|
115
|
-
appName: "checkout-app",
|
|
116
|
-
appType: "frontend",
|
|
117
|
-
stack: "billing",
|
|
118
|
-
port: 3210,
|
|
119
|
-
},
|
|
120
|
-
null,
|
|
121
|
-
2,
|
|
122
|
-
)}\n`,
|
|
123
|
-
);
|
|
124
|
-
|
|
125
|
-
runTdk(["project", "--yes"], projectRoot);
|
|
126
|
-
|
|
127
|
-
const projectJson = JSON.parse(
|
|
128
|
-
readFileSync(join(projectRoot, ".tdk", "project.json"), "utf-8"),
|
|
129
|
-
);
|
|
130
|
-
expect(projectJson.phases.pre_alpha.enabledStacks).toContain("billing");
|
|
131
|
-
|
|
132
|
-
const spec = readFileSync(join(projectRoot, ".tdk", ".tdk-out", "spec.master"), "utf-8");
|
|
133
|
-
expect(spec).toMatch(/"billing":\s*True/);
|
|
134
|
-
});
|
|
135
|
-
});
|