@tdk-landscape/tdk-cli-core 1.3.45 → 1.3.48
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/.github/workflows/release-binaries.yml +54 -0
- package/.pre-commit-config.yaml +57 -0
- package/Makefile +92 -0
- package/bun.lock +538 -0
- package/cli/AGENTS.md +390 -0
- package/cli/DESIGN.md +735 -0
- package/cli/biome.json +44 -0
- package/cli/dependency-graph.svg +1135 -0
- package/cli/knip.json +6 -0
- package/cli/package.json +77 -0
- package/cli/pnpm-lock.yaml +2305 -0
- package/cli/pnpm-workspace.yaml +2 -0
- package/cli/shared-platform-engineering/docker-templates/bun-hoisted-symlink-fix.sh +23 -0
- package/cli/shared-platform-engineering/docker-templates/infisical-entrypoint.sh +464 -0
- package/cli/shared-platform-engineering/docker-templates/install-deps.sh +152 -0
- package/cli/shared-platform-engineering/docker-templates/prisma-bun-client-link-fix.sh +12 -0
- package/cli/shared-platform-engineering/docker-templates/prisma-normalize-client.sh +56 -0
- package/{dist/cli.js → cli/src/cli.ts} +21 -13
- package/cli/src/commands/__tests__/always-enabled-infra.test.ts +115 -0
- package/cli/src/commands/__tests__/config.test.ts +146 -0
- package/cli/src/commands/__tests__/doctor.test.ts +557 -0
- package/cli/src/commands/__tests__/error-handling.test.ts +78 -0
- package/cli/src/commands/__tests__/phases-model.test.ts +163 -0
- package/cli/src/commands/__tests__/project-resource-features-e2e.test.ts +207 -0
- package/cli/src/commands/__tests__/project.test.ts +68 -0
- package/cli/src/commands/__tests__/resource.test.ts +226 -0
- package/cli/src/commands/__tests__/saas-starter-integration.test.ts +196 -0
- package/cli/src/commands/__tests__/stack-features-e2e.test.ts +129 -0
- package/cli/src/commands/__tests__/upgrade.test.ts +101 -0
- package/{dist/commands/completion.js → cli/src/commands/completion.ts} +78 -72
- package/cli/src/commands/config.ts +299 -0
- package/cli/src/commands/doctor.ts +790 -0
- package/cli/src/commands/down.ts +37 -0
- package/cli/src/commands/help.ts +150 -0
- package/cli/src/commands/networks-design.md +80 -0
- package/cli/src/commands/networks.ts +332 -0
- package/cli/src/commands/project.ts +439 -0
- package/cli/src/commands/projects.ts +82 -0
- package/cli/src/commands/resource.ts +652 -0
- package/cli/src/commands/resources.ts +95 -0
- package/cli/src/commands/stack.ts +128 -0
- package/cli/src/commands/stacks.ts +52 -0
- package/cli/src/commands/status.ts +88 -0
- package/cli/src/commands/ui.tsx +843 -0
- package/cli/src/commands/up.ts +150 -0
- package/cli/src/commands/upgrade.ts +570 -0
- package/{dist/commands/version.js → cli/src/commands/version.ts} +5 -5
- package/cli/src/components/Accessible.tsx +21 -0
- package/cli/src/components/BaseTooltip.tsx +66 -0
- package/cli/src/components/DetailPanel.tsx +146 -0
- package/cli/src/components/FileTree.tsx +89 -0
- package/cli/src/components/ResourceSelectInput.tsx +30 -0
- package/cli/src/components/ResourceTable.tsx +78 -0
- package/cli/src/components/TabBar.tsx +53 -0
- package/cli/src/components/Tooltip.tsx +11 -0
- package/{dist/components/index.js → cli/src/components/index.ts} +0 -1
- package/cli/src/config/platform-standards.test.ts +11 -0
- package/cli/src/config/platform-standards.ts +196 -0
- package/cli/src/generator/__tests__/extension-fetch.test.ts +220 -0
- package/cli/src/generator/__tests__/template-engine.test.ts +70 -0
- package/cli/src/generator/extension-fetch.ts +279 -0
- package/cli/src/generator/template-engine.ts +754 -0
- package/cli/src/index.ts +86 -0
- package/cli/src/templates.d.ts +4 -0
- package/cli/src/types/index.ts +351 -0
- package/cli/src/utils/__tests__/cache.test.ts +98 -0
- package/cli/src/utils/__tests__/formatting.test.ts +170 -0
- package/cli/src/utils/__tests__/paths.test.ts +180 -0
- package/cli/src/utils/__tests__/port-assignment.test.ts +121 -0
- package/cli/src/utils/__tests__/service-urls.test.ts +174 -0
- package/cli/src/utils/__tests__/services.test.ts +531 -0
- package/cli/src/utils/__tests__/tilt.test.ts +143 -0
- package/cli/src/utils/__tests__/validation.test.ts +148 -0
- package/cli/src/utils/cache.ts +76 -0
- package/cli/src/utils/command-helpers.ts +54 -0
- package/cli/src/utils/constants.ts +126 -0
- package/cli/src/utils/discovery-context.ts +49 -0
- package/cli/src/utils/docker.ts +20 -0
- package/cli/src/utils/doctor-runtime.ts +604 -0
- package/cli/src/utils/env-validator.ts +139 -0
- package/cli/src/utils/errors.ts +168 -0
- package/cli/src/utils/file-helpers.ts +62 -0
- package/cli/src/utils/formatting.ts +215 -0
- package/cli/src/utils/paths.ts +53 -0
- package/cli/src/utils/port-assignment.ts +106 -0
- package/cli/src/utils/project-features.ts +118 -0
- package/cli/src/utils/project-templates.ts +28 -0
- package/cli/src/utils/prompt.ts +123 -0
- package/cli/src/utils/resource-features.ts +209 -0
- package/cli/src/utils/service-urls.ts +124 -0
- package/cli/src/utils/services.ts +363 -0
- package/cli/src/utils/stack-features.ts +30 -0
- package/cli/src/utils/tar.ts +24 -0
- package/cli/src/utils/tilt.ts +113 -0
- package/cli/src/utils/validation.ts +67 -0
- package/{templates → cli/templates}/Tiltfile.hbs +1 -1
- package/cli/tsconfig.json +25 -0
- package/cli/tsconfig.typecheck.json +8 -0
- package/docs/FEATURES.md +279 -0
- package/engine/topologies/platform/docker/dockerfile/dockerfile.star +3 -3
- package/engine/topologies/platform/docker/generators/golden_docker_generator_v2.star +1 -1
- package/engine/topologies/platform/docker/layers/l2_dependency_layers.star +0 -3
- package/engine/topologies/platform/docker/layers/l3_builder_layers.star +1 -1
- package/engine/topologies/platform/docker/layers/l4_runtime_layers.star +1 -1
- package/engine/topologies/platform/docker/secrets/infisical.star +19 -47
- package/engine/topologies/tilt/resources/orchestrator/apply_migrator_orchestration.star +1 -1
- package/install.sh +242 -0
- package/knip.json +10 -0
- package/openspec/changes/add-vscode-tdk-troubleshooter-plugin/.openspec.yaml +2 -0
- package/openspec/changes/add-vscode-tdk-troubleshooter-plugin/design.md +102 -0
- package/openspec/changes/add-vscode-tdk-troubleshooter-plugin/proposal.md +31 -0
- package/openspec/changes/add-vscode-tdk-troubleshooter-plugin/specs/vscode-tdk-notifications/spec.md +48 -0
- package/openspec/changes/add-vscode-tdk-troubleshooter-plugin/specs/vscode-tdk-orchestration/spec.md +63 -0
- package/openspec/changes/add-vscode-tdk-troubleshooter-plugin/specs/vscode-tdk-troubleshooting/spec.md +56 -0
- package/openspec/changes/add-vscode-tdk-troubleshooter-plugin/tasks.md +61 -0
- package/openspec/changes/archive/2026-04-28-rename-domain-to-stack-service-to-resource/.openspec.yaml +2 -0
- package/openspec/changes/archive/2026-04-28-rename-domain-to-stack-service-to-resource/design.md +114 -0
- package/openspec/changes/archive/2026-04-28-rename-domain-to-stack-service-to-resource/proposal.md +32 -0
- package/openspec/changes/archive/2026-04-28-rename-domain-to-stack-service-to-resource/specs/manifest-field-migration/spec.md +20 -0
- package/openspec/changes/archive/2026-04-28-rename-domain-to-stack-service-to-resource/specs/resource-terminology-standard/spec.md +20 -0
- package/openspec/changes/archive/2026-04-28-rename-domain-to-stack-service-to-resource/specs/stack-terminology-standard/spec.md +20 -0
- package/openspec/changes/archive/2026-04-28-rename-domain-to-stack-service-to-resource/tasks.md +194 -0
- package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/.openspec.yaml +2 -0
- package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/design.md +111 -0
- package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/proposal.md +33 -0
- package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/specs/function-naming-alignment/spec.md +12 -0
- package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/specs/optional-parameter-patterns/spec.md +18 -0
- package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/specs/parameter-documentation/spec.md +16 -0
- package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/specs/parameter-naming-consistency/spec.md +12 -0
- package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/specs/parameter-ordering-standard/spec.md +12 -0
- package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/tasks.md +194 -0
- package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/.openspec.yaml +2 -0
- package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/codebase-audit-report.md +62 -0
- package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/design.md +84 -0
- package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/proposal.md +31 -0
- package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/specs/codebase-audit/spec.md +27 -0
- package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/specs/dead-code-cleanup/spec.md +27 -0
- package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/specs/test-gap-fill/spec.md +23 -0
- package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/specs/todo-resolution/spec.md +27 -0
- package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/tasks.md +39 -0
- package/openspec/changes/archive/2026-05-04-comprehensive-cleanup-final/.openspec.yaml +5 -0
- package/openspec/changes/archive/2026-05-04-comprehensive-cleanup-final/design.md +94 -0
- package/openspec/changes/archive/2026-05-04-comprehensive-cleanup-final/proposal.md +46 -0
- package/openspec/changes/archive/2026-05-04-comprehensive-cleanup-final/specs/ai-slop-cleanup/CLEANUP_REPORT_8.md +174 -0
- package/openspec/changes/archive/2026-05-04-comprehensive-cleanup-final/specs/ai-slop-cleanup/CRITICAL_ASSESSMENT_8.md +160 -0
- package/openspec/changes/archive/2026-05-04-comprehensive-cleanup-final/specs/circular-deps/CRITICAL_ASSESSMENT_4.md +381 -0
- package/openspec/changes/archive/2026-05-04-comprehensive-cleanup-final/specs/dead-code/CRITICAL_ASSESSMENT_3.md +316 -0
- package/openspec/changes/archive/2026-05-04-comprehensive-cleanup-final/specs/deduplication/CRITICAL_ASSESSMENT_1.md +290 -0
- package/openspec/changes/archive/2026-05-04-comprehensive-cleanup-final/specs/deduplication/IMPLEMENTATION_SUMMARY_1.md +233 -0
- package/openspec/changes/archive/2026-05-04-comprehensive-cleanup-final/specs/defensive-cleanup/CRITICAL_ASSESSMENT_6.md +835 -0
- package/openspec/changes/archive/2026-05-04-comprehensive-cleanup-final/specs/legacy-cleanup/CRITICAL_ASSESSMENT_7.md +254 -0
- package/openspec/changes/archive/2026-05-04-comprehensive-cleanup-final/specs/legacy-cleanup/IMPLEMENTATION_SUMMARY_7.md +187 -0
- package/openspec/changes/archive/2026-05-04-comprehensive-cleanup-final/specs/strong-typing/CRITICAL_ASSESSMENT_5.md +269 -0
- package/openspec/changes/archive/2026-05-04-comprehensive-cleanup-final/specs/type-consolidation/CRITICAL_ASSESSMENT_2.md +312 -0
- package/openspec/changes/archive/2026-05-04-comprehensive-cleanup-final/specs/type-consolidation/IMPLEMENTATION_SUMMARY.md +170 -0
- package/openspec/changes/archive/2026-05-04-comprehensive-cleanup-final/tasks.md +137 -0
- package/openspec/changes/archive/2026-06-25-landscape-consolidation/.openspec.yaml +2 -0
- package/openspec/changes/archive/2026-06-25-landscape-consolidation/design.md +80 -0
- package/openspec/changes/archive/2026-06-25-landscape-consolidation/proposal.md +40 -0
- package/openspec/changes/archive/2026-06-25-landscape-consolidation/spec.md +52 -0
- package/openspec/changes/archive/2026-06-25-landscape-consolidation/tasks.md +51 -0
- package/openspec/changes/archive/2026-09-17-fix-generated-stack-boot/.openspec.yaml +2 -0
- package/openspec/changes/archive/2026-09-17-fix-generated-stack-boot/design.md +43 -0
- package/openspec/changes/archive/2026-09-17-fix-generated-stack-boot/proposal.md +29 -0
- package/openspec/changes/archive/2026-09-17-fix-generated-stack-boot/specs/self-contained-generated-projects/spec.md +67 -0
- package/openspec/changes/archive/2026-09-17-fix-generated-stack-boot/tasks.md +27 -0
- package/openspec/specs/manifest-field-migration/spec.md +24 -0
- package/openspec/specs/resource-terminology-standard/spec.md +24 -0
- package/openspec/specs/self-contained-generated-projects/spec.md +67 -0
- package/openspec/specs/stack-terminology-standard/spec.md +24 -0
- package/package.json +27 -64
- package/platform/services/platform/proxy/service.yaml +14 -0
- package/scripts/audit-codebase.sh +213 -0
- package/scripts/install-git-hooks.sh +14 -0
- package/scripts/release-binaries.sh +94 -0
- package/scripts/setup-pre-commit.sh +33 -0
- package/scripts/stage-npm-engine.sh +36 -0
- package/shared-platform-engineering/docker-templates/bun-hoisted-symlink-fix.sh +23 -0
- package/shared-platform-engineering/docker-templates/infisical-entrypoint.sh +464 -0
- package/shared-platform-engineering/docker-templates/install-deps.sh +152 -0
- package/shared-platform-engineering/docker-templates/prisma-bun-client-link-fix.sh +12 -0
- package/shared-platform-engineering/docker-templates/prisma-normalize-client.sh +56 -0
- package/tests/tilt-engine/__init__.py +5 -0
- package/tests/tilt-engine/conftest.py +182 -0
- package/tests/tilt-engine/fixtures/appointment-frontend-service.json +11 -0
- package/tests/tilt-engine/fixtures/identity-backend-service.json +12 -0
- package/tests/tilt-engine/fixtures/invalid-service.json +4 -0
- package/tests/tilt-engine/test_agents_md_generator.py +341 -0
- package/tests/tilt-engine/test_agents_md_integration.py +378 -0
- package/tests/tilt-engine/test_cache_operations.py +181 -0
- package/tests/tilt-engine/test_cache_persistence.py +142 -0
- package/tests/tilt-engine/test_code_executor.py +152 -0
- package/tests/tilt-engine/test_code_viewer.py +127 -0
- package/tests/tilt-engine/test_compose_port_anchors.py +310 -0
- package/tests/tilt-engine/test_config_inspector.py +162 -0
- package/tests/tilt-engine/test_daemon_focus_mode.py +89 -0
- package/tests/tilt-engine/test_daemon_polling.py +122 -0
- package/tests/tilt-engine/test_daemon_registration.py +115 -0
- package/tests/tilt-engine/test_daemon_validation.py +107 -0
- package/tests/tilt-engine/test_docker_generator_bugs.py +493 -0
- package/tests/tilt-engine/test_docker_prune.py +119 -0
- package/tests/tilt-engine/test_dockerignore_path_bug.py +82 -0
- package/tests/tilt-engine/test_file_browser.py +193 -0
- package/tests/tilt-engine/test_frontend_basepath_manifest.py +27 -0
- package/tests/tilt-engine/test_health_dependencies.py +130 -0
- package/tests/tilt-engine/test_health_endpoints.py +118 -0
- package/tests/tilt-engine/test_health_tilt_ui.py +85 -0
- package/tests/tilt-engine/test_safety_aliases.py +84 -0
- package/tests/tilt-engine/test_snapshot_diff.py +136 -0
- package/tests/tilt-engine/test_snapshot_persistence.py +163 -0
- package/tests/tilt-engine/test_snapshot_scanning.py +123 -0
- package/tests/tilt-engine/test_standalone_project_boot.py +61 -0
- package/tests/tilt-engine/test_standalone_traefik.py +108 -0
- package/dist/cli.d.ts +0 -3
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/commands/completion.d.ts +0 -3
- package/dist/commands/completion.d.ts.map +0 -1
- package/dist/commands/completion.js.map +0 -1
- package/dist/commands/config.d.ts +0 -3
- package/dist/commands/config.d.ts.map +0 -1
- package/dist/commands/config.js +0 -231
- package/dist/commands/config.js.map +0 -1
- package/dist/commands/doctor.d.ts +0 -7
- package/dist/commands/doctor.d.ts.map +0 -1
- package/dist/commands/doctor.js +0 -597
- package/dist/commands/doctor.js.map +0 -1
- package/dist/commands/down.d.ts +0 -3
- package/dist/commands/down.d.ts.map +0 -1
- package/dist/commands/down.js +0 -32
- package/dist/commands/down.js.map +0 -1
- package/dist/commands/help.d.ts +0 -2
- package/dist/commands/help.d.ts.map +0 -1
- package/dist/commands/help.js +0 -130
- package/dist/commands/help.js.map +0 -1
- package/dist/commands/networks.d.ts +0 -3
- package/dist/commands/networks.d.ts.map +0 -1
- package/dist/commands/networks.js +0 -260
- package/dist/commands/networks.js.map +0 -1
- package/dist/commands/project.d.ts +0 -3
- package/dist/commands/project.d.ts.map +0 -1
- package/dist/commands/project.js +0 -373
- package/dist/commands/project.js.map +0 -1
- package/dist/commands/projects.d.ts +0 -3
- package/dist/commands/projects.d.ts.map +0 -1
- package/dist/commands/projects.js +0 -71
- package/dist/commands/projects.js.map +0 -1
- package/dist/commands/resource.d.ts +0 -69
- package/dist/commands/resource.d.ts.map +0 -1
- package/dist/commands/resource.js +0 -579
- package/dist/commands/resource.js.map +0 -1
- package/dist/commands/resources.d.ts +0 -3
- package/dist/commands/resources.d.ts.map +0 -1
- package/dist/commands/resources.js +0 -73
- package/dist/commands/resources.js.map +0 -1
- package/dist/commands/stack.d.ts +0 -3
- package/dist/commands/stack.d.ts.map +0 -1
- package/dist/commands/stack.js +0 -97
- package/dist/commands/stack.js.map +0 -1
- package/dist/commands/stacks.d.ts +0 -3
- package/dist/commands/stacks.d.ts.map +0 -1
- package/dist/commands/stacks.js +0 -43
- package/dist/commands/stacks.js.map +0 -1
- package/dist/commands/status.d.ts +0 -3
- package/dist/commands/status.d.ts.map +0 -1
- package/dist/commands/status.js +0 -71
- package/dist/commands/status.js.map +0 -1
- package/dist/commands/ui.d.ts +0 -3
- package/dist/commands/ui.d.ts.map +0 -1
- package/dist/commands/ui.js +0 -445
- package/dist/commands/ui.js.map +0 -1
- package/dist/commands/up.d.ts +0 -3
- package/dist/commands/up.d.ts.map +0 -1
- package/dist/commands/up.js +0 -110
- package/dist/commands/up.js.map +0 -1
- package/dist/commands/upgrade.d.ts +0 -11
- package/dist/commands/upgrade.d.ts.map +0 -1
- package/dist/commands/upgrade.js +0 -496
- package/dist/commands/upgrade.js.map +0 -1
- package/dist/commands/version.d.ts +0 -3
- package/dist/commands/version.d.ts.map +0 -1
- package/dist/commands/version.js.map +0 -1
- package/dist/components/Accessible.d.ts +0 -8
- package/dist/components/Accessible.d.ts.map +0 -1
- package/dist/components/Accessible.js +0 -10
- package/dist/components/Accessible.js.map +0 -1
- package/dist/components/BaseTooltip.d.ts +0 -4
- package/dist/components/BaseTooltip.d.ts.map +0 -1
- package/dist/components/BaseTooltip.js +0 -28
- package/dist/components/BaseTooltip.js.map +0 -1
- package/dist/components/DetailPanel.d.ts +0 -4
- package/dist/components/DetailPanel.d.ts.map +0 -1
- package/dist/components/DetailPanel.js +0 -18
- package/dist/components/DetailPanel.js.map +0 -1
- package/dist/components/FileTree.d.ts +0 -4
- package/dist/components/FileTree.d.ts.map +0 -1
- package/dist/components/FileTree.js +0 -47
- package/dist/components/FileTree.js.map +0 -1
- package/dist/components/ResourceSelectInput.d.ts +0 -4
- package/dist/components/ResourceSelectInput.d.ts.map +0 -1
- package/dist/components/ResourceSelectInput.js +0 -7
- package/dist/components/ResourceSelectInput.js.map +0 -1
- package/dist/components/ResourceTable.d.ts +0 -4
- package/dist/components/ResourceTable.d.ts.map +0 -1
- package/dist/components/ResourceTable.js +0 -18
- package/dist/components/ResourceTable.js.map +0 -1
- package/dist/components/TabBar.d.ts +0 -4
- package/dist/components/TabBar.d.ts.map +0 -1
- package/dist/components/TabBar.js +0 -17
- package/dist/components/TabBar.js.map +0 -1
- package/dist/components/Tooltip.d.ts +0 -12
- package/dist/components/Tooltip.d.ts.map +0 -1
- package/dist/components/Tooltip.js +0 -12
- package/dist/components/Tooltip.js.map +0 -1
- package/dist/components/index.d.ts +0 -8
- package/dist/components/index.d.ts.map +0 -1
- package/dist/components/index.js.map +0 -1
- package/dist/config/platform-standards.d.ts +0 -159
- package/dist/config/platform-standards.d.ts.map +0 -1
- package/dist/config/platform-standards.js +0 -181
- package/dist/config/platform-standards.js.map +0 -1
- package/dist/generator/extension-fetch.d.ts +0 -25
- package/dist/generator/extension-fetch.d.ts.map +0 -1
- package/dist/generator/extension-fetch.js +0 -252
- package/dist/generator/extension-fetch.js.map +0 -1
- package/dist/generator/template-engine.d.ts +0 -61
- package/dist/generator/template-engine.d.ts.map +0 -1
- package/dist/generator/template-engine.js +0 -557
- package/dist/generator/template-engine.js.map +0 -1
- package/dist/index.d.ts +0 -11
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -11
- package/dist/index.js.map +0 -1
- package/dist/types/index.d.ts +0 -255
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -17
- package/dist/types/index.js.map +0 -1
- package/dist/utils/cache.d.ts +0 -19
- package/dist/utils/cache.d.ts.map +0 -1
- package/dist/utils/cache.js +0 -64
- package/dist/utils/cache.js.map +0 -1
- package/dist/utils/command-helpers.d.ts +0 -17
- package/dist/utils/command-helpers.d.ts.map +0 -1
- package/dist/utils/command-helpers.js +0 -41
- package/dist/utils/command-helpers.js.map +0 -1
- package/dist/utils/constants.d.ts +0 -52
- package/dist/utils/constants.d.ts.map +0 -1
- package/dist/utils/constants.js +0 -112
- package/dist/utils/constants.js.map +0 -1
- package/dist/utils/discovery-context.d.ts +0 -4
- package/dist/utils/discovery-context.d.ts.map +0 -1
- package/dist/utils/discovery-context.js +0 -39
- package/dist/utils/discovery-context.js.map +0 -1
- package/dist/utils/docker.d.ts +0 -4
- package/dist/utils/docker.d.ts.map +0 -1
- package/dist/utils/docker.js +0 -19
- package/dist/utils/docker.js.map +0 -1
- package/dist/utils/doctor-runtime.d.ts +0 -66
- package/dist/utils/doctor-runtime.d.ts.map +0 -1
- package/dist/utils/doctor-runtime.js +0 -469
- package/dist/utils/doctor-runtime.js.map +0 -1
- package/dist/utils/env-validator.d.ts +0 -15
- package/dist/utils/env-validator.d.ts.map +0 -1
- package/dist/utils/env-validator.js +0 -109
- package/dist/utils/env-validator.js.map +0 -1
- package/dist/utils/errors.d.ts +0 -31
- package/dist/utils/errors.d.ts.map +0 -1
- package/dist/utils/errors.js +0 -140
- package/dist/utils/errors.js.map +0 -1
- package/dist/utils/file-helpers.d.ts +0 -14
- package/dist/utils/file-helpers.d.ts.map +0 -1
- package/dist/utils/file-helpers.js +0 -45
- package/dist/utils/file-helpers.js.map +0 -1
- package/dist/utils/formatting.d.ts +0 -30
- package/dist/utils/formatting.d.ts.map +0 -1
- package/dist/utils/formatting.js +0 -164
- package/dist/utils/formatting.js.map +0 -1
- package/dist/utils/paths.d.ts +0 -3
- package/dist/utils/paths.d.ts.map +0 -1
- package/dist/utils/paths.js +0 -41
- package/dist/utils/paths.js.map +0 -1
- package/dist/utils/port-assignment.d.ts +0 -6
- package/dist/utils/port-assignment.d.ts.map +0 -1
- package/dist/utils/port-assignment.js +0 -81
- package/dist/utils/port-assignment.js.map +0 -1
- package/dist/utils/project-features.d.ts +0 -23
- package/dist/utils/project-features.d.ts.map +0 -1
- package/dist/utils/project-features.js +0 -98
- package/dist/utils/project-features.js.map +0 -1
- package/dist/utils/project-templates.d.ts +0 -7
- package/dist/utils/project-templates.d.ts.map +0 -1
- package/dist/utils/project-templates.js +0 -24
- package/dist/utils/project-templates.js.map +0 -1
- package/dist/utils/prompt.d.ts +0 -28
- package/dist/utils/prompt.d.ts.map +0 -1
- package/dist/utils/prompt.js +0 -79
- package/dist/utils/prompt.js.map +0 -1
- package/dist/utils/resource-features.d.ts +0 -29
- package/dist/utils/resource-features.d.ts.map +0 -1
- package/dist/utils/resource-features.js +0 -171
- package/dist/utils/resource-features.js.map +0 -1
- package/dist/utils/service-urls.d.ts +0 -30
- package/dist/utils/service-urls.d.ts.map +0 -1
- package/dist/utils/service-urls.js +0 -93
- package/dist/utils/service-urls.js.map +0 -1
- package/dist/utils/services.d.ts +0 -18
- package/dist/utils/services.d.ts.map +0 -1
- package/dist/utils/services.js +0 -291
- package/dist/utils/services.js.map +0 -1
- package/dist/utils/stack-features.d.ts +0 -22
- package/dist/utils/stack-features.d.ts.map +0 -1
- package/dist/utils/stack-features.js +0 -13
- package/dist/utils/stack-features.js.map +0 -1
- package/dist/utils/tar.d.ts +0 -7
- package/dist/utils/tar.d.ts.map +0 -1
- package/dist/utils/tar.js +0 -21
- package/dist/utils/tar.js.map +0 -1
- package/dist/utils/tilt.d.ts +0 -19
- package/dist/utils/tilt.d.ts.map +0 -1
- package/dist/utils/tilt.js +0 -78
- package/dist/utils/tilt.js.map +0 -1
- package/dist/utils/validation.d.ts +0 -16
- package/dist/utils/validation.d.ts.map +0 -1
- package/dist/utils/validation.js +0 -58
- package/dist/utils/validation.js.map +0 -1
- /package/{README.md → cli/README.md} +0 -0
- /package/{bin → cli/bin}/tdk.js +0 -0
- /package/{templates → cli/templates}/.tiltignore.hbs +0 -0
- /package/{templates → cli/templates}/TILT_RESOURCE_DEFAULTS.star.hbs +0 -0
- /package/{templates → cli/templates}/TILT_TECH_STACK.star.hbs +0 -0
- /package/{templates → cli/templates}/spec.master.hbs +0 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { ValidationResult } from "../types/index.js";
|
|
2
|
+
import { OPTIONAL_INFRA_SERVICES } from "./constants.js";
|
|
3
|
+
|
|
4
|
+
export const KEBAB_CASE_REGEX = /^[a-z0-9-]+$/;
|
|
5
|
+
|
|
6
|
+
function isKebabCase(value: string): boolean {
|
|
7
|
+
return KEBAB_CASE_REGEX.test(value);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function validateResourceName(name: string): ValidationResult {
|
|
11
|
+
if (!name.trim()) {
|
|
12
|
+
return { valid: false, error: "Resource name is required" };
|
|
13
|
+
}
|
|
14
|
+
if (!isKebabCase(name)) {
|
|
15
|
+
return {
|
|
16
|
+
valid: false,
|
|
17
|
+
error: "Use lowercase letters, numbers, and hyphens only",
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
return { valid: true };
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function createKebabCaseValidator(context: "resource" | "stack") {
|
|
24
|
+
return (input: string): true | string => {
|
|
25
|
+
if (!input.trim()) {
|
|
26
|
+
return context === "resource" ? "Resource name is required" : "Stack name is required";
|
|
27
|
+
}
|
|
28
|
+
if (!isKebabCase(input)) {
|
|
29
|
+
return context === "resource"
|
|
30
|
+
? "Use lowercase letters, numbers, and hyphens only"
|
|
31
|
+
: "Use kebab-case (lowercase, numbers, hyphens only)";
|
|
32
|
+
}
|
|
33
|
+
return true;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function validateOptionalInfraService(service: string): ValidationResult {
|
|
38
|
+
if (includes(OPTIONAL_INFRA_SERVICES, service)) {
|
|
39
|
+
return { valid: true };
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
valid: false,
|
|
43
|
+
error: `Invalid service. Must be one of: ${OPTIONAL_INFRA_SERVICES.join(", ")}`,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function isValidPort(port: number): boolean {
|
|
48
|
+
return Number.isInteger(port) && port > 0 && port <= 65535;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Check a filesystem path segment for characters that are unsafe to use in a
|
|
53
|
+
* path (null bytes, or characters that are invalid on common filesystems).
|
|
54
|
+
* Does not check for path traversal (`..`) - callers that resolve the path
|
|
55
|
+
* against a base directory should check that separately.
|
|
56
|
+
*/
|
|
57
|
+
export function isPathSafe(path: string): boolean {
|
|
58
|
+
return !path.includes("\0") && !/[<>:"|?*]/.test(path);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function sanitizeForShell(value: string, replacement: string = "_"): string {
|
|
62
|
+
return value.replace(/[^a-zA-Z0-9-]/g, replacement).substring(0, 100);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function includes<T extends readonly string[]>(array: T, value: string): value is T[number] {
|
|
66
|
+
return (array as readonly string[]).includes(value);
|
|
67
|
+
}
|
|
@@ -166,7 +166,7 @@ FOCUS_MODE, FOCUS_ENABLED_ALL, FOCUS_ENABLED_RESOURCES = Config.apply_focus(cfg)
|
|
|
166
166
|
ALWAYS_ENABLED_INFRA = {{starlarkArray alwaysEnabledInfra}}
|
|
167
167
|
|
|
168
168
|
def should_enable(resource_name):
|
|
169
|
-
# Always-enabled infra (proxy/Traefik, verdaccio, database-management
|
|
169
|
+
# Always-enabled infra (proxy/Traefik, verdaccio, database-management) must stay
|
|
170
170
|
# enabled independent of focus mode: FOCUS_MODE collapses to False whenever the pre-alpha
|
|
171
171
|
# stack bucket is empty (the default on a freshly generated project.json), which used to
|
|
172
172
|
# silently disable Traefik and friends on every out-of-the-box `tdk up`.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "bundler",
|
|
6
|
+
"lib": ["ES2022", "DOM"],
|
|
7
|
+
"types": ["node", "react"],
|
|
8
|
+
"outDir": "./dist",
|
|
9
|
+
"rootDir": "./src",
|
|
10
|
+
"strict": true,
|
|
11
|
+
"esModuleInterop": true,
|
|
12
|
+
"skipLibCheck": true,
|
|
13
|
+
"forceConsistentCasingInFileNames": true,
|
|
14
|
+
"declaration": true,
|
|
15
|
+
"declarationMap": true,
|
|
16
|
+
"sourceMap": true,
|
|
17
|
+
"resolveJsonModule": true,
|
|
18
|
+
"allowSyntheticDefaultImports": true,
|
|
19
|
+
"isolatedModules": true,
|
|
20
|
+
"noEmitOnError": true,
|
|
21
|
+
"jsx": "react-jsx"
|
|
22
|
+
},
|
|
23
|
+
"include": ["src/**/*"],
|
|
24
|
+
"exclude": ["node_modules", "dist", "**/*.test.ts"]
|
|
25
|
+
}
|
package/docs/FEATURES.md
ADDED
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
# TDK Features Reference
|
|
2
|
+
|
|
3
|
+
This document describes all available features in TDK and how to control them.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
TDK has two levels of feature control:
|
|
8
|
+
|
|
9
|
+
1. **Project-Level Features** - Infrastructure services available to all resources (proxy, database, etc.)
|
|
10
|
+
2. **Resource-Level Features** - Code generators for individual services (api-client, prisma, etc.)
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Project-Level Features
|
|
15
|
+
|
|
16
|
+
Project-level features are configured in `.tdk/project.json` and control infrastructure services.
|
|
17
|
+
|
|
18
|
+
### CORE Features (Pre-Enabled)
|
|
19
|
+
|
|
20
|
+
These are always enabled in the `pre_alpha` stack:
|
|
21
|
+
|
|
22
|
+
#### `proxy` (Traefik)
|
|
23
|
+
- **Purpose**: Reverse proxy and API gateway for routing all services
|
|
24
|
+
- **Default**: ✅ Enabled
|
|
25
|
+
- **Service Name**: `proxy`
|
|
26
|
+
- **Port**: 80 (HTTP), 443 (HTTPS)
|
|
27
|
+
- **Configuration**: Routes all HTTP traffic based on path/domain rules
|
|
28
|
+
|
|
29
|
+
#### `database-management` (PostgreSQL)
|
|
30
|
+
- **Purpose**: Primary relational database for data persistence
|
|
31
|
+
- **Default**: ✅ Enabled
|
|
32
|
+
- **Service Name**: `database-management`
|
|
33
|
+
- **Port**: 5432
|
|
34
|
+
- **Database**: `app_dev` (default)
|
|
35
|
+
- **Configuration**: Backend services use `DATABASE_URL` env var
|
|
36
|
+
|
|
37
|
+
### PREMIUM Features (Requires License Key)
|
|
38
|
+
|
|
39
|
+
Enable these with a premium license key set via `export TDK_LICENSE_KEY=<key>`:
|
|
40
|
+
|
|
41
|
+
#### `verdaccio` (Verdaccio)
|
|
42
|
+
- **Purpose**: Local npm registry for package management and publishing
|
|
43
|
+
- **Default**: ❌ Disabled (Premium feature)
|
|
44
|
+
- **Service Name**: `verdaccio`
|
|
45
|
+
- **Port**: 4873
|
|
46
|
+
- **License**: Premium (requires `TDK_LICENSE_KEY` environment variable)
|
|
47
|
+
- **Configuration**: Services use this for `npm install` and `bun install` when enabled
|
|
48
|
+
|
|
49
|
+
### OPTIONAL Features (Disabled by Default)
|
|
50
|
+
|
|
51
|
+
Enable these in `.tdk/project.json` under `optional_infra`:
|
|
52
|
+
|
|
53
|
+
```json
|
|
54
|
+
{
|
|
55
|
+
"optional_infra": {
|
|
56
|
+
"monitoring": true,
|
|
57
|
+
"elk": true,
|
|
58
|
+
"debezium": true,
|
|
59
|
+
"golden_image": true
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
#### `monitoring` (SigNoz/SkyWalking)
|
|
65
|
+
- **Purpose**: Observability platform for metrics, traces, and logs
|
|
66
|
+
- **Default**: ❌ Disabled
|
|
67
|
+
- **Resource Usage**: High (requires database-management)
|
|
68
|
+
|
|
69
|
+
#### `elk` (Elasticsearch, Logstash, Kibana)
|
|
70
|
+
- **Purpose**: Log aggregation and analysis stack
|
|
71
|
+
- **Default**: ❌ Disabled
|
|
72
|
+
- **Resource Usage**: High
|
|
73
|
+
|
|
74
|
+
#### `debezium` (Change Data Capture)
|
|
75
|
+
- **Purpose**: Stream database changes in real-time
|
|
76
|
+
- **Default**: ❌ Disabled
|
|
77
|
+
- **Requires**: PostgreSQL (database-management)
|
|
78
|
+
|
|
79
|
+
#### `golden-image` (Pre-built Docker Layer)
|
|
80
|
+
- **Purpose**: Faster Docker builds by caching dependencies
|
|
81
|
+
- **Default**: ✅ Enabled
|
|
82
|
+
- **Benefit**: Reduces build time from minutes to seconds
|
|
83
|
+
|
|
84
|
+
### Enable/Disable
|
|
85
|
+
|
|
86
|
+
To enable optional or premium features, edit `.tdk/project.json`:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
# Edit .tdk/project.json
|
|
90
|
+
{
|
|
91
|
+
"optional_infra": {
|
|
92
|
+
"monitoring": true, # Optional feature (Free)
|
|
93
|
+
"verdaccio": true # Premium feature (requires TDK_LICENSE_KEY)
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
# Regenerate
|
|
98
|
+
tdk config regenerate
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
**For Premium Features:** Set your license key before running `tdk up`:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
export TDK_LICENSE_KEY=<your-premium-key>
|
|
105
|
+
tdk up
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## Resource-Level Features
|
|
111
|
+
|
|
112
|
+
Resource-level features are configured in each `service.json` file via the `features: []` array.
|
|
113
|
+
|
|
114
|
+
### Frontend Services
|
|
115
|
+
|
|
116
|
+
Default features for frontend services (appType: "frontend"):
|
|
117
|
+
|
|
118
|
+
```json
|
|
119
|
+
{
|
|
120
|
+
"appName": "my-app",
|
|
121
|
+
"appType": "frontend",
|
|
122
|
+
"features": ["api-client", "env-config", "api-index"]
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
#### `api-client`
|
|
127
|
+
- **Generates**: `.autogenerated/api-client.ts`
|
|
128
|
+
- **Purpose**: Pre-configured API client wrapper for backend communication
|
|
129
|
+
- **Imports**: `import { apiClient } from './.autogenerated/api-client'`
|
|
130
|
+
- **Customize**: Edit `service.json` → `apiClient` config section
|
|
131
|
+
|
|
132
|
+
#### `env-config`
|
|
133
|
+
- **Generates**: `.autogenerated/env.ts`
|
|
134
|
+
- **Purpose**: Environment constants and configuration
|
|
135
|
+
- **Imports**: `import { API_URL } from './.autogenerated/env'`
|
|
136
|
+
- **Default**: Uses `VITE_API_URL` env var with fallback to local dev URL
|
|
137
|
+
|
|
138
|
+
#### `api-index`
|
|
139
|
+
- **Generates**: `.autogenerated/api-index.ts`
|
|
140
|
+
- **Purpose**: Barrel export for cleaner imports
|
|
141
|
+
- **Imports**: `import { apiClient, API_URL } from './.autogenerated'`
|
|
142
|
+
|
|
143
|
+
### Backend Services
|
|
144
|
+
|
|
145
|
+
Default features for backend services (appType: "backend", "worker", "migrator"):
|
|
146
|
+
|
|
147
|
+
```json
|
|
148
|
+
{
|
|
149
|
+
"appName": "my-api",
|
|
150
|
+
"appType": "backend",
|
|
151
|
+
"features": ["prisma"]
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
#### `prisma`
|
|
156
|
+
- **Generates**: `.autogenerated/prisma.config.autogenerated.ts`
|
|
157
|
+
- **Purpose**: Prisma CLI configuration for database access
|
|
158
|
+
- **Usage**: `npx prisma generate`, `npx prisma migrate`, `npx prisma db push`
|
|
159
|
+
- **Database**: Uses `DATABASE_URL` env var from project-level database
|
|
160
|
+
|
|
161
|
+
#### `ddd` (Premium)
|
|
162
|
+
- **Generates**: Domain-driven design folders and backend path aliases
|
|
163
|
+
- **Purpose**: Scaffolds `domain`, `application`, `infrastructure`, and `presentation` layers
|
|
164
|
+
- **License**: Premium (requires `TDK_LICENSE_KEY` with the `ddd` resource grant)
|
|
165
|
+
- **Usage**: `tdk resource add <name> --type backend --ddd`
|
|
166
|
+
|
|
167
|
+
### Enable/Disable Features
|
|
168
|
+
|
|
169
|
+
**To enable a feature**, add it to `features: []`:
|
|
170
|
+
|
|
171
|
+
```json
|
|
172
|
+
{
|
|
173
|
+
"features": ["api-client", "env-config", "api-index", "prisma"]
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
**To disable a feature**, remove it from `features: []`:
|
|
178
|
+
|
|
179
|
+
```json
|
|
180
|
+
{
|
|
181
|
+
"features": ["api-client"] // Only api-client runs
|
|
182
|
+
}
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
After editing `service.json`, regenerate:
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
tdk config regenerate
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## Always-Enabled Generators
|
|
194
|
+
|
|
195
|
+
These generators always run and don't have a feature flag:
|
|
196
|
+
|
|
197
|
+
- **vite** - Frontend/backend build configuration
|
|
198
|
+
- **tsconfig** - TypeScript configuration (local and Docker)
|
|
199
|
+
- **dockerfile** - Container configuration
|
|
200
|
+
- **npmrc/bunfig** - Package manager configuration
|
|
201
|
+
- **nginx** - Static file serving (frontend)
|
|
202
|
+
- **env** - Backend environment setup
|
|
203
|
+
- **agents-md** - AI safety guard rail
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## Quick Reference
|
|
208
|
+
|
|
209
|
+
### Frontend (appType: "frontend")
|
|
210
|
+
|
|
211
|
+
| Feature | Default | Customizable |
|
|
212
|
+
|---------|---------|--------------|
|
|
213
|
+
| api-client | ✅ | Yes |
|
|
214
|
+
| env-config | ✅ | Yes |
|
|
215
|
+
| api-index | ✅ | Yes |
|
|
216
|
+
| vite | ✅ (always) | No |
|
|
217
|
+
| tsconfig | ✅ (always) | No |
|
|
218
|
+
| dockerfile | ✅ (always) | No |
|
|
219
|
+
| nginx | ✅ (always) | No |
|
|
220
|
+
|
|
221
|
+
### Backend (appType: "backend")
|
|
222
|
+
|
|
223
|
+
| Feature | Default | Customizable |
|
|
224
|
+
|---------|---------|--------------|
|
|
225
|
+
| prisma | ✅ | Yes |
|
|
226
|
+
| ddd | ❌ | Yes (Premium) |
|
|
227
|
+
| vite | ✅ (always) | No |
|
|
228
|
+
| tsconfig | ✅ (always) | No |
|
|
229
|
+
| dockerfile | ✅ (always) | No |
|
|
230
|
+
| npmrc | ✅ (always) | No |
|
|
231
|
+
| env | ✅ (always) | No |
|
|
232
|
+
|
|
233
|
+
### Project Infrastructure
|
|
234
|
+
|
|
235
|
+
| Feature | Default | Customizable | License |
|
|
236
|
+
|---------|---------|--------------|---------|
|
|
237
|
+
| proxy | ✅ | No | Free |
|
|
238
|
+
| database | ✅ | No | Free |
|
|
239
|
+
| verdaccio | ❌ | Yes | Premium |
|
|
240
|
+
| monitoring | ❌ | Yes | Free |
|
|
241
|
+
| elk | ❌ | Yes | Free |
|
|
242
|
+
| debezium | ❌ | Yes | Free |
|
|
243
|
+
| golden-image | ✅ | Yes | Free |
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
## Examples
|
|
248
|
+
|
|
249
|
+
### Disable API Client Generation
|
|
250
|
+
|
|
251
|
+
```json
|
|
252
|
+
{
|
|
253
|
+
"appName": "dashboard-app",
|
|
254
|
+
"appType": "frontend",
|
|
255
|
+
"features": ["env-config", "api-index"] // Remove api-client
|
|
256
|
+
}
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
### Backend Without Prisma
|
|
260
|
+
|
|
261
|
+
```json
|
|
262
|
+
{
|
|
263
|
+
"appName": "worker",
|
|
264
|
+
"appType": "backend",
|
|
265
|
+
"features": [] // No prisma
|
|
266
|
+
}
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
### Enable Monitoring
|
|
270
|
+
|
|
271
|
+
```json
|
|
272
|
+
{
|
|
273
|
+
"optional_infra": {
|
|
274
|
+
"monitoring": true
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
Then run `tdk config regenerate && tdk up`.
|
|
@@ -8,7 +8,7 @@ BASE_PORT_BACKEND = 4000
|
|
|
8
8
|
load('../generators/golden_docker_generator_v2.star', 'L4_generate_orchestrator')
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
def generate_frontend_dockerfile(res_path, resource_name, port=BASE_PORT_FRONTEND, target_path='/app/dist', build_cmd='bun run build', cmd='bun run start', use_nginx=False, use_infisical=
|
|
11
|
+
def generate_frontend_dockerfile(res_path, resource_name, port=BASE_PORT_FRONTEND, target_path='/app/dist', build_cmd='bun run build', cmd='bun run start', use_nginx=False, use_infisical=False, use_shared_libs=True, use_prisma=False, use_golden=True, manifest=None):
|
|
12
12
|
"""Generate Dockerfile for frontend services."""
|
|
13
13
|
return L4_generate_orchestrator(
|
|
14
14
|
res_path=res_path,
|
|
@@ -26,7 +26,7 @@ def generate_frontend_dockerfile(res_path, resource_name, port=BASE_PORT_FRONTEN
|
|
|
26
26
|
manifest=manifest,
|
|
27
27
|
)
|
|
28
28
|
|
|
29
|
-
def generate_app_dockerfile(res_path, resource_name, port=BASE_PORT_BACKEND, build_cmd='bun run build', cmd='bun run start', use_infisical=
|
|
29
|
+
def generate_app_dockerfile(res_path, resource_name, port=BASE_PORT_BACKEND, build_cmd='bun run build', cmd='bun run start', use_infisical=False, use_shared_libs=True, use_prisma=True, use_golden=True, manifest=None):
|
|
30
30
|
"""Generate Dockerfile for backend/app services."""
|
|
31
31
|
return L4_generate_orchestrator(
|
|
32
32
|
res_path=res_path,
|
|
@@ -42,7 +42,7 @@ def generate_app_dockerfile(res_path, resource_name, port=BASE_PORT_BACKEND, bui
|
|
|
42
42
|
manifest=manifest,
|
|
43
43
|
)
|
|
44
44
|
|
|
45
|
-
def generate_migrator_dockerfile(res_path, resource_name, use_infisical=
|
|
45
|
+
def generate_migrator_dockerfile(res_path, resource_name, use_infisical=False, use_golden=True, manifest=None):
|
|
46
46
|
"""Generate Dockerfile for database migrator services."""
|
|
47
47
|
return L4_generate_orchestrator(
|
|
48
48
|
res_path=res_path,
|
|
@@ -25,7 +25,7 @@ load('../layers/l4_runtime_layers.star',
|
|
|
25
25
|
'L4_generate_frontend_runtime',
|
|
26
26
|
)
|
|
27
27
|
|
|
28
|
-
def L4_generate_orchestrator(res_path, res_type = 'backend', resource_name = 'service', use_nginx = False, port = 3000, target_path = '/app/dist', build_cmd = 'bun run build', cmd = 'bun run start', use_infisical =
|
|
28
|
+
def L4_generate_orchestrator(res_path, res_type = 'backend', resource_name = 'service', use_nginx = False, port = 3000, target_path = '/app/dist', build_cmd = 'bun run build', cmd = 'bun run start', use_infisical = False, use_shared_libs = True, use_prisma = True, use_golden = True, manifest = None):
|
|
29
29
|
parts = []
|
|
30
30
|
migrator_name_match = (
|
|
31
31
|
resource_name == 'migrator'
|
|
@@ -86,8 +86,6 @@ def L2_generate_dependency_manifest(res_path, manager = RUNTIME, use_golden = Tr
|
|
|
86
86
|
# Normalize res_path for Docker COPY (must be relative to build context)
|
|
87
87
|
res_path_rel = normalize_res_path(res_path)
|
|
88
88
|
|
|
89
|
-
lockfile = "bun.lock*"
|
|
90
|
-
|
|
91
89
|
# Prefer golden L2 image when enabled and defined; fall back to plain Bun image.
|
|
92
90
|
base_image = GOLDEN_L2_IMAGE if (use_golden and GOLDEN_L2_IMAGE) else BUN_BASE
|
|
93
91
|
use_golden_for_manifest = base_image == GOLDEN_L2_IMAGE
|
|
@@ -125,7 +123,6 @@ RUN echo '🔍 DEPENDENCY INSTALLATION DIAGNOSTICS (debug)' && \\
|
|
|
125
123
|
+ "WORKDIR /app/" + res_path + "\n"
|
|
126
124
|
+ "COPY " + res_path_rel + "/package.json ./package.json\n"
|
|
127
125
|
+ "COPY " + res_path_rel + "/" + AUTOGENERATED_CONFIG_PATHS['npmrc_docker'] + " .npmrc\n"
|
|
128
|
-
+ "COPY " + lockfile + " ./\n"
|
|
129
126
|
+ "COPY " + res_path_rel + "/" + AUTOGENERATED_CONFIG_PATHS['bunfig_docker'] + " .bunfig.toml\n"
|
|
130
127
|
+ "\n"
|
|
131
128
|
+ diagnostics_block
|
|
@@ -50,7 +50,7 @@ GOLDEN_L3_BACKEND_IMAGE = _docker_cfg.get('golden_l3_backend_image', _GOLDEN_PRE
|
|
|
50
50
|
GOLDEN_L3_FRONTEND_IMAGE = _docker_cfg.get('golden_l3_frontend_image', _GOLDEN_PREFIX + '-l3-frontend:latest')
|
|
51
51
|
|
|
52
52
|
|
|
53
|
-
def L3_generate_backend_compiler(res_path, build_cmd = RUNTIME_CONFIG["bun"]["backend_start_command"], use_prisma = True, use_shared_libs = True, use_infisical =
|
|
53
|
+
def L3_generate_backend_compiler(res_path, build_cmd = RUNTIME_CONFIG["bun"]["backend_start_command"], use_prisma = True, use_shared_libs = True, use_infisical = False, use_golden = True, has_prisma_config = False):
|
|
54
54
|
"""
|
|
55
55
|
Generate the backend compiler layer for TypeScript services.
|
|
56
56
|
|
|
@@ -55,7 +55,7 @@ GOLDEN_L4_FRONTEND_IMAGE = _docker_cfg.get('golden_l4_frontend_image', _GOLDEN_P
|
|
|
55
55
|
_docker_health = get_docker_healthcheck_config()
|
|
56
56
|
|
|
57
57
|
|
|
58
|
-
def L4_generate_backend_runtime(res_path, port = BASE_PORT_BACKEND, cmd = 'bun run start', use_infisical =
|
|
58
|
+
def L4_generate_backend_runtime(res_path, port = BASE_PORT_BACKEND, cmd = 'bun run start', use_infisical = False, resource_name = 'service', use_golden = True, use_prisma = True, has_prisma_config = False, manifest = None):
|
|
59
59
|
"""
|
|
60
60
|
Generate the backend runtime layer for deployed services.
|
|
61
61
|
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
# =============================================================================
|
|
2
|
-
# 🔐
|
|
2
|
+
# 🔐 LOCAL ENVIRONMENT GENERATOR
|
|
3
3
|
# =============================================================================
|
|
4
|
-
#
|
|
4
|
+
# Free-tier service env injection. Premium overlays may replace this module with
|
|
5
|
+
# Infisical-backed secret injection.
|
|
5
6
|
# =============================================================================
|
|
6
7
|
#
|
|
7
8
|
# This module provides:
|
|
8
|
-
# - Environment variable generation for
|
|
9
|
-
# -
|
|
9
|
+
# - Environment variable generation for docker-compose/.env injection
|
|
10
|
+
# - No external secret manager required in the public/free engine
|
|
10
11
|
#
|
|
11
12
|
# Usage:
|
|
12
13
|
# load("../secrets/infisical.star", "InfisicalEnv")
|
|
@@ -14,8 +15,6 @@
|
|
|
14
15
|
# =============================================================================
|
|
15
16
|
|
|
16
17
|
load("../constants.star", "PlatformDockerConstants")
|
|
17
|
-
load("../../../tilt/generators/infisical/secrets_generator.star", "SecretsGenerator")
|
|
18
|
-
load("../../../tilt/generators/infisical/path_manager.star", "PathManager")
|
|
19
18
|
|
|
20
19
|
def _get_infisical_base_url():
|
|
21
20
|
"""Get the Infisical base URL."""
|
|
@@ -23,9 +22,11 @@ def _get_infisical_base_url():
|
|
|
23
22
|
|
|
24
23
|
def get_infisical_environment_vars(as_array=True, resource_name=None, resource_type="backend"):
|
|
25
24
|
"""
|
|
26
|
-
Generate environment variables for
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
Generate environment variables for local Compose/.env injection.
|
|
26
|
+
|
|
27
|
+
Kept under the historical function name so existing Starlark callers do not
|
|
28
|
+
break. The free engine intentionally avoids Infisical credentials; premium
|
|
29
|
+
overlays can replace this implementation with a real secret-provider bridge.
|
|
29
30
|
|
|
30
31
|
Args:
|
|
31
32
|
as_array: If True, return as YAML array format; else as dict format
|
|
@@ -35,52 +36,23 @@ def get_infisical_environment_vars(as_array=True, resource_name=None, resource_t
|
|
|
35
36
|
Returns:
|
|
36
37
|
String with environment variables in YAML format
|
|
37
38
|
"""
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
# Use generator for service-specific configuration
|
|
42
|
-
secret_path = PathManager.get_known_resource_path(resource_name)
|
|
43
|
-
if not secret_path:
|
|
44
|
-
path_plan = PathManager.plan_resource_path(resource_name, resource_type)
|
|
45
|
-
secret_path = path_plan["full_path"]
|
|
46
|
-
|
|
47
|
-
config = SecretsGenerator.generate_for_service(
|
|
48
|
-
resource_name=resource_name,
|
|
49
|
-
secret_path=secret_path,
|
|
50
|
-
resource_type=resource_type,
|
|
51
|
-
)
|
|
52
|
-
|
|
53
|
-
env = config["docker_compose"]["environment"]
|
|
54
|
-
|
|
55
|
-
if as_array:
|
|
56
|
-
lines = []
|
|
57
|
-
for key, value in env.items():
|
|
58
|
-
lines.append(" - {}={}".format(key, value))
|
|
59
|
-
return "\n".join(lines)
|
|
60
|
-
else:
|
|
61
|
-
lines = []
|
|
62
|
-
for key, value in env.items():
|
|
63
|
-
lines.append(" {}: {}".format(key, value))
|
|
64
|
-
return "\n".join(lines)
|
|
65
|
-
|
|
66
|
-
# Fallback to base configuration (no service-specific paths)
|
|
67
|
-
base_env = {
|
|
68
|
-
"INFISICAL_CLIENT_ID": "${INFISICAL_CLIENT_ID:-}",
|
|
69
|
-
"INFISICAL_CLIENT_SECRET": "${INFISICAL_CLIENT_SECRET:-}",
|
|
70
|
-
"INFISICAL_PROJECT_ID": "${INFISICAL_PROJECT_ID:-}",
|
|
71
|
-
"INFISICAL_SITE_URL": "${INFISICAL_SITE_URL:-" + infisical_url + "}",
|
|
72
|
-
"INFISICAL_ENV": "${INFISICAL_ENV:-dev}",
|
|
73
|
-
"INFISICAL_ENABLED": "${INFISICAL_ENABLED:-true}",
|
|
39
|
+
env = {
|
|
40
|
+
"TDK_SECRET_PROVIDER": "${TDK_SECRET_PROVIDER:-env-file}",
|
|
41
|
+
"TDK_ENV": "${TILT_ENV:-development}",
|
|
74
42
|
}
|
|
43
|
+
|
|
44
|
+
if resource_name:
|
|
45
|
+
env["TDK_RESOURCE_NAME"] = resource_name
|
|
46
|
+
env["TDK_RESOURCE_TYPE"] = resource_type
|
|
75
47
|
|
|
76
48
|
if as_array:
|
|
77
49
|
lines = []
|
|
78
|
-
for key, value in
|
|
50
|
+
for key, value in env.items():
|
|
79
51
|
lines.append(" - {}={}".format(key, value))
|
|
80
52
|
return "\n".join(lines)
|
|
81
53
|
else:
|
|
82
54
|
lines = []
|
|
83
|
-
for key, value in
|
|
55
|
+
for key, value in env.items():
|
|
84
56
|
lines.append(" {}: {}".format(key, value))
|
|
85
57
|
return "\n".join(lines)
|
|
86
58
|
|
|
@@ -69,7 +69,7 @@ def register_migrators(resource_config, ctx, runtime_flags, compose_project_name
|
|
|
69
69
|
target_path='/app/dist',
|
|
70
70
|
build_cmd='echo "No build needed for migrator"',
|
|
71
71
|
cmd='bun run db:migrate',
|
|
72
|
-
use_infisical=
|
|
72
|
+
use_infisical=False,
|
|
73
73
|
use_shared_libs=True,
|
|
74
74
|
use_prisma=True,
|
|
75
75
|
use_golden=should_enable('golden-image'),
|