@tdk-landscape/tdk-cli-core 1.3.15 → 1.3.22
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/Tiltfile +144 -0
- package/discovery/AGENTS.md +362 -0
- package/discovery/TILT_DISCOVERY.star +424 -0
- package/discovery/Tiltfile +58 -0
- package/discovery/config.star +258 -0
- package/discovery/constants.star +127 -0
- package/discovery/deterministic.star +211 -0
- package/discovery/discovery_daemon.star +191 -0
- package/discovery/discovery_orchestrator.star +460 -0
- package/discovery/filtering.star +5 -0
- package/discovery/identity-management-backend/service.yaml +26 -0
- package/discovery/identity-management-frontend/service.yaml +29 -0
- package/discovery/identity-sdk/service.yaml +9 -0
- package/discovery/incremental_discovery.star +213 -0
- package/discovery/indexing.star +7 -0
- package/discovery/json_manifest_scanner.star +51 -0
- package/discovery/libraries.star +46 -0
- package/discovery/loading.star +23 -0
- package/discovery/manifest/constants.star +104 -0
- package/discovery/manifest/loading.star +386 -0
- package/discovery/manifest/normalize.star +281 -0
- package/discovery/manifest/validation.star +108 -0
- package/discovery/normalization.star +11 -0
- package/discovery/registry.star +544 -0
- package/discovery/resource_snapshot.py +382 -0
- package/discovery/resource_snapshot.star +143 -0
- package/discovery/schemas.star +1 -0
- package/discovery/services/platform/cdc/debezium/nats-connector/service.yaml +9 -0
- package/discovery/services/platform/cdc/nats-http-bridge/service.yaml +9 -0
- package/discovery/services/platform/orchestrator/orchestrator-glue-backend/service.yaml +26 -0
- package/discovery/services/platform/synthetic-monitor/service.yaml +9 -0
- package/discovery/test_resource_snapshot.py +251 -0
- package/discovery/validation.star +78 -0
- package/discovery/versioning.star +1 -0
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +11 -0
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +1 -2
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/project.d.ts.map +1 -1
- package/dist/commands/project.js +36 -41
- package/dist/commands/project.js.map +1 -1
- package/dist/commands/resource.d.ts.map +1 -1
- package/dist/commands/resource.js +51 -55
- package/dist/commands/resource.js.map +1 -1
- package/dist/commands/stack.d.ts.map +1 -1
- package/dist/commands/stack.js +22 -24
- package/dist/commands/stack.js.map +1 -1
- package/dist/commands/ui.d.ts.map +1 -1
- package/dist/commands/ui.js +1 -2
- package/dist/commands/ui.js.map +1 -1
- package/dist/commands/up.d.ts.map +1 -1
- package/dist/commands/up.js +1 -2
- package/dist/commands/up.js.map +1 -1
- package/dist/commands/upgrade.d.ts +8 -0
- package/dist/commands/upgrade.d.ts.map +1 -1
- package/dist/commands/upgrade.js +59 -18
- package/dist/commands/upgrade.js.map +1 -1
- package/dist/generator/extension-fetch.d.ts +19 -0
- package/dist/generator/extension-fetch.d.ts.map +1 -1
- package/dist/generator/extension-fetch.js +71 -5
- package/dist/generator/extension-fetch.js.map +1 -1
- package/dist/generator/template-engine.d.ts +1 -0
- package/dist/generator/template-engine.d.ts.map +1 -1
- package/dist/generator/template-engine.js +50 -6
- package/dist/generator/template-engine.js.map +1 -1
- package/dist/utils/command-helpers.d.ts.map +1 -1
- package/dist/utils/command-helpers.js +7 -9
- package/dist/utils/command-helpers.js.map +1 -1
- package/dist/utils/constants.d.ts +1 -0
- package/dist/utils/constants.d.ts.map +1 -1
- package/dist/utils/constants.js +1 -0
- package/dist/utils/constants.js.map +1 -1
- package/dist/utils/errors.d.ts +2 -0
- package/dist/utils/errors.d.ts.map +1 -1
- package/dist/utils/errors.js +6 -1
- package/dist/utils/errors.js.map +1 -1
- package/dist/utils/project-features.d.ts.map +1 -1
- package/dist/utils/project-features.js +1 -1
- package/dist/utils/project-features.js.map +1 -1
- package/dist/utils/resource-features.d.ts.map +1 -1
- package/dist/utils/resource-features.js +2 -2
- package/dist/utils/resource-features.js.map +1 -1
- package/dist/utils/tar.js +4 -4
- package/dist/utils/tar.js.map +1 -1
- package/dist/utils/validation.d.ts +7 -0
- package/dist/utils/validation.d.ts.map +1 -1
- package/dist/utils/validation.js +9 -0
- package/dist/utils/validation.js.map +1 -1
- package/engine/AGENTS.md +705 -0
- package/engine/README.md +29 -0
- package/engine/REFACTORING_MANIFEST_SYSTEM.md +974 -0
- package/engine/Tiltfile +80 -0
- package/engine/assets/docker/golden-layers.Dockerfile +221 -0
- package/engine/assets/scripts/cleanup-completed-migrator-images.sh +37 -0
- package/engine/assets/scripts/cleanup-tilt-images.sh +120 -0
- package/engine/assets/scripts/mac-m1-resource-monitor.sh +121 -0
- package/engine/config.star +3 -0
- package/engine/docs/AUTODISCOVERY_TEST.md +182 -0
- package/engine/docs/C4-ARCHITECTURE-operations.md +396 -0
- package/engine/docs/C4-ARCHITECTURE-overview.md +284 -0
- package/engine/docs/C4-ARCHITECTURE.md +17 -0
- package/engine/docs/GOLDEN_IMAGE_INTEGRATION.md +349 -0
- package/engine/docs/MANIFEST_DRIVEN_ARCHITECTURE.md +357 -0
- package/engine/docs/README.md +284 -0
- package/engine/entrypoint.star +97 -0
- package/engine/lifecycle/orchestrator.star +260 -0
- package/engine/paths.star +717 -0
- package/engine/schemas/manifest-schema.json +301 -0
- package/engine/schemas/service-schema.json +301 -0
- package/engine/scripts/README.md +89 -0
- package/engine/scripts/build-and-publish-lib.sh +205 -0
- package/engine/scripts/check-lib-publish.sh +85 -0
- package/engine/scripts/debug-container.sh +258 -0
- package/engine/scripts/generate-manifest.sh +197 -0
- package/engine/spec.master +702 -0
- package/engine/spec.master.example +341 -0
- package/engine/topologies/README.md +34 -0
- package/engine/topologies/platform/docker/AGENTS.md +59 -0
- package/engine/topologies/platform/docker/auth/auth.star +167 -0
- package/engine/topologies/platform/docker/build/golden_image.star +37 -0
- package/engine/topologies/platform/docker/build/golden_image_build.star +82 -0
- package/engine/topologies/platform/docker/build/golden_image_constants.star +93 -0
- package/engine/topologies/platform/docker/build/golden_image_dockerfile.star +291 -0
- package/engine/topologies/platform/docker/compose/compose.star +636 -0
- package/engine/topologies/platform/docker/compose/compose_helpers.star +52 -0
- package/engine/topologies/platform/docker/compose/traefik_standalone.star +53 -0
- package/engine/topologies/platform/docker/config/bunignore.star +142 -0
- package/engine/topologies/platform/docker/config/dockerignore.star +150 -0
- package/engine/topologies/platform/docker/constants.star +170 -0
- package/engine/topologies/platform/docker/dockerfile/dockerfile.star +54 -0
- package/engine/topologies/platform/docker/generators/golden_docker_generator_v2.star +73 -0
- package/engine/topologies/platform/docker/index.star +27 -0
- package/engine/topologies/platform/docker/layers/bun_helpers.star +23 -0
- package/engine/topologies/platform/docker/layers/infisical/index.star +40 -0
- package/engine/topologies/platform/docker/layers/infisical/infisical_docker.star +262 -0
- package/engine/topologies/platform/docker/layers/l1_base_layers.star +87 -0
- package/engine/topologies/platform/docker/layers/l2_dependency_layers.star +125 -0
- package/engine/topologies/platform/docker/layers/l3_builder_layers.star +209 -0
- package/engine/topologies/platform/docker/layers/l4_runtime_layers.star +214 -0
- package/engine/topologies/platform/docker/layers/prisma/constants.star +135 -0
- package/engine/topologies/platform/docker/layers/prisma/db_readiness.star +96 -0
- package/engine/topologies/platform/docker/layers/prisma/filesystem_setup.star +109 -0
- package/engine/topologies/platform/docker/layers/prisma/migrate_script.star +98 -0
- package/engine/topologies/platform/docker/layers/prisma/prisma_build.star +126 -0
- package/engine/topologies/platform/docker/layers/prisma/prisma_runtime.star +161 -0
- package/engine/topologies/platform/docker/layers/prisma/secret_resolution.star +119 -0
- package/engine/topologies/platform/docker/networking/api_path_constants.star +230 -0
- package/engine/topologies/platform/docker/networking/sablier_container_cycle.star +27 -0
- package/engine/topologies/platform/docker/networking/traefik.star +232 -0
- package/engine/topologies/platform/docker/networking/traefik_constants.star +146 -0
- package/engine/topologies/platform/docker/networking/traefik_helpers.star +160 -0
- package/engine/topologies/platform/docker/secrets/infisical.star +135 -0
- package/engine/topologies/platform/net/proxy.star +4 -0
- package/engine/topologies/platform/registries/local.star +4 -0
- package/engine/topologies/platform/security/secrets.star +239 -0
- package/engine/topologies/platform/state/relational.star +4 -0
- package/engine/topologies/tilt/common/AGENTS.md +59 -0
- package/engine/topologies/tilt/common/utils.star +364 -0
- package/engine/topologies/tilt/common/utils_debug.star +69 -0
- package/engine/topologies/tilt/common/utils_deterministic.star +168 -0
- package/engine/topologies/tilt/common/utils_docker_networks.star +46 -0
- package/engine/topologies/tilt/common/utils_env.star +43 -0
- package/engine/topologies/tilt/common/utils_output.star +97 -0
- package/engine/topologies/tilt/config/AGENTS.md +68 -0
- package/engine/topologies/tilt/config/defaults.star +3 -0
- package/engine/topologies/tilt/config/feature_flags.star +10 -0
- package/engine/topologies/tilt/config/global.star +55 -0
- package/engine/topologies/tilt/config/profiles.star +382 -0
- package/engine/topologies/tilt/generators/agents_md.star +62 -0
- package/engine/topologies/tilt/generators/api_gateway.star +145 -0
- package/engine/topologies/tilt/generators/index.star +124 -0
- package/engine/topologies/tilt/generators/infisical/README.md +424 -0
- package/engine/topologies/tilt/generators/infisical/examples.star +312 -0
- package/engine/topologies/tilt/generators/infisical/index.star +57 -0
- package/engine/topologies/tilt/generators/infisical/machine_identity.star +420 -0
- package/engine/topologies/tilt/generators/infisical/organization.star +534 -0
- package/engine/topologies/tilt/generators/infisical/path_manager.star +476 -0
- package/engine/topologies/tilt/generators/infisical/secrets_generator.star +420 -0
- package/engine/topologies/tilt/generators/nginx_conf.star +143 -0
- package/engine/topologies/tilt/generators/npmrc.star +111 -0
- package/engine/topologies/tilt/generators/tsconfig.star +23 -0
- package/engine/topologies/tilt/generators/typescript/backend_library_tsconfig.star +71 -0
- package/engine/topologies/tilt/generators/typescript/backend_tsconfig.star +124 -0
- package/engine/topologies/tilt/generators/typescript/common.star +7 -0
- package/engine/topologies/tilt/generators/typescript/frontend_library_tsconfig.star +76 -0
- package/engine/topologies/tilt/generators/typescript/frontend_tsconfig.star +110 -0
- package/engine/topologies/tilt/generators/typescript/include.star +23 -0
- package/engine/topologies/tilt/generators/typescript/playwright_config.star +40 -0
- package/engine/topologies/tilt/generators/typescript/prisma_config.star +49 -0
- package/engine/topologies/tilt/generators/validators.star +853 -0
- package/engine/topologies/tilt/generators/vite/backend.star +78 -0
- package/engine/topologies/tilt/generators/vite/frontend.star +98 -0
- package/engine/topologies/tilt/generators/vite/generators.star +43 -0
- package/engine/topologies/tilt/generators/vite/helpers.star +244 -0
- package/engine/topologies/tilt/generators/vite/library.star +65 -0
- package/engine/topologies/tilt/generators/vite/sdk.star +73 -0
- package/engine/topologies/tilt/generators/vite/templates.star +737 -0
- package/engine/topologies/tilt/generators/vite_config.star +22 -0
- package/engine/topologies/tilt/manifest/AGENTS.md +61 -0
- package/engine/topologies/tilt/manifest/README.md +693 -0
- package/engine/topologies/tilt/manifest/__init__.star +218 -0
- package/engine/topologies/tilt/manifest/constants.star +252 -0
- package/engine/topologies/tilt/manifest/errors.star +266 -0
- package/engine/topologies/tilt/manifest/integration.star +339 -0
- package/engine/topologies/tilt/manifest/json_to_yaml.py +54 -0
- package/engine/topologies/tilt/manifest/loader.star +214 -0
- package/engine/topologies/tilt/manifest/mapper.star +227 -0
- package/engine/topologies/tilt/manifest/parser.star +400 -0
- package/engine/topologies/tilt/manifest/schema.star +462 -0
- package/engine/topologies/tilt/manifest/tests/test_integration.star +276 -0
- package/engine/topologies/tilt/manifest/tests/test_loader_parser.star +397 -0
- package/engine/topologies/tilt/manifest/tests/test_manifest.star +316 -0
- package/engine/topologies/tilt/manifest/tests/test_validator.star +470 -0
- package/engine/topologies/tilt/manifest/validator.star +717 -0
- package/engine/topologies/tilt/manifest/yaml_to_json.py +18 -0
- package/engine/topologies/tilt/resources/AGENTS.md +71 -0
- package/engine/topologies/tilt/resources/conditions.star +3 -0
- package/engine/topologies/tilt/resources/databases.star +244 -0
- package/engine/topologies/tilt/resources/declaration.star +3 -0
- package/engine/topologies/tilt/resources/deps.star +3 -0
- package/engine/topologies/tilt/resources/infra-loader.star +437 -0
- package/engine/topologies/tilt/resources/libs.star +30 -0
- package/engine/topologies/tilt/resources/libs_discovery.star +102 -0
- package/engine/topologies/tilt/resources/libs_paths.star +79 -0
- package/engine/topologies/tilt/resources/libs_resource_definition.star +151 -0
- package/engine/topologies/tilt/resources/libs_setup.star +164 -0
- package/engine/topologies/tilt/resources/libs_tsconfig.star +37 -0
- package/engine/topologies/tilt/resources/orchestrator/apply.star +77 -0
- package/engine/topologies/tilt/resources/orchestrator/apply_compose_resource_registration.star +431 -0
- package/engine/topologies/tilt/resources/orchestrator/apply_manifest_orchestration.star +81 -0
- package/engine/topologies/tilt/resources/orchestrator/apply_migrator_orchestration.star +148 -0
- package/engine/topologies/tilt/resources/orchestrator/apply_resource_validation.star +36 -0
- package/engine/topologies/tilt/resources/orchestrator/apply_runtime_flags.star +44 -0
- package/engine/topologies/tilt/resources/orchestrator/builders/typescript.star +164 -0
- package/engine/topologies/tilt/resources/orchestrator/generators/dependencies/AGENTS.md +75 -0
- package/engine/topologies/tilt/resources/orchestrator/generators/dependencies/index.star +21 -0
- package/engine/topologies/tilt/resources/orchestrator/generators/dependencies/resolver.star +134 -0
- package/engine/topologies/tilt/resources/orchestrator/generators/env.star +258 -0
- package/engine/topologies/tilt/resources/orchestrator/generators/frontend.star +169 -0
- package/engine/topologies/tilt/resources/orchestrator/generators/manifest_resource.star +524 -0
- package/engine/topologies/tilt/resources/orchestrator/helpers.star +33 -0
- package/engine/topologies/tilt/resources/orchestrator.star +54 -0
- package/engine/topologies/tilt/resources/ordering.star +3 -0
- package/engine/topologies/tilt/resources/triggers.star +3 -0
- package/engine/topologies/tilt/resources/watchers.star +299 -0
- package/engine/where-things-live.star +717 -0
- package/ext/Tiltfile +66 -0
- package/ext/ide-components/README.md +219 -0
- package/ext/ide-components/code_executor/server.py +268 -0
- package/ext/ide-components/code_viewer/server.py +206 -0
- package/ext/ide-components/config_inspector/server.py +1050 -0
- package/ext/ide-components/file_browser/server.py +285 -0
- package/ext/ide-components/shared/config_service.py +469 -0
- package/ext/ide-components/shared/file_utils.py +298 -0
- package/ext/ide-components/shared/http_utils.py +232 -0
- package/ext/ide-components/shared/static/styles.css +1334 -0
- package/ext/ide-components/shared/syntax_highlighter.py +140 -0
- package/ext/ide-components/shared/template_engine.py +123 -0
- package/ext/ide-components/shared/templates/base.html +121 -0
- package/ext/ide-components/shared/test_config_service.py +326 -0
- package/ext/ide-components/shared/tilt_integration.py +158 -0
- package/ext/ui-enhancements/cron-status-server.sh +49 -0
- package/ext/ui-enhancements/cron-status-tracker.sh +146 -0
- package/ext/ui-enhancements/extension.yaml +36 -0
- package/ext/ui-enhancements/tiltfile.py +99 -0
- package/ext/ui-enhancements/ui/cron-jobs-tab.css +396 -0
- package/ext/ui-enhancements/ui/help-panel.css +279 -0
- package/ext/ui-enhancements/ui/icons.css +125 -0
- package/ext/ui-enhancements/ui/tooltips.css +114 -0
- package/package.json +13 -9
- package/specs/specs/TILT_SERVICE_DEFAULTS.star +205 -0
- package/specs/specs/TILT_TECH_STACK.star +159 -0
|
@@ -0,0 +1,717 @@
|
|
|
1
|
+
#!/usr/bin/env starlark
|
|
2
|
+
# Tilt Master Spec File
|
|
3
|
+
# SYSTEM PATHS SPECIFICATION - No Hidden Magic
|
|
4
|
+
# Format: Explicit constants for all system paths
|
|
5
|
+
# Philosophy: Make it obvious (Zig-style explicitness)
|
|
6
|
+
|
|
7
|
+
# =============================================================================
|
|
8
|
+
# 🚀 QUICK START (I Just Want to Add a Service)
|
|
9
|
+
# =============================================================================
|
|
10
|
+
|
|
11
|
+
# 1. Create your service directory:
|
|
12
|
+
# mkdir -p services/product/my-service/backend
|
|
13
|
+
#
|
|
14
|
+
# 2. Create a manifest file:
|
|
15
|
+
# echo '{"appName":"my-service","port":4001}' > services/product/my-service/service.json
|
|
16
|
+
#
|
|
17
|
+
# 3. Run Tilt:
|
|
18
|
+
# tilt up
|
|
19
|
+
#
|
|
20
|
+
# 4. Done! Your service is running. Configs generated at:
|
|
21
|
+
# .tilt/output/configs/my-service/
|
|
22
|
+
#
|
|
23
|
+
# Need to debug? See DEBUG section at the bottom of this file.
|
|
24
|
+
|
|
25
|
+
# =============================================================================
|
|
26
|
+
# 📖 HOW TO USE THIS FILE
|
|
27
|
+
# =============================================================================
|
|
28
|
+
|
|
29
|
+
# In your Tiltfile or topology module, load this spec:
|
|
30
|
+
#
|
|
31
|
+
# load(PROJECT_ROOT + "/.tilt-engine/spec.master", "SPEC", "CONSTANTS", "VALIDATION", "DEBUG")
|
|
32
|
+
#
|
|
33
|
+
# Then use the constants:
|
|
34
|
+
#
|
|
35
|
+
# registry_path = SPEC.DISCOVERY.REGISTRY
|
|
36
|
+
# max_port = VALIDATION.MAX_PORT
|
|
37
|
+
# timeout = CONSTANTS.DEFAULT_TIMEOUT
|
|
38
|
+
#
|
|
39
|
+
# That's it! No magic paths. Everything is explicit.
|
|
40
|
+
|
|
41
|
+
# =============================================================================
|
|
42
|
+
# 📁 WHAT'S IN THIS FILE
|
|
43
|
+
# =============================================================================
|
|
44
|
+
|
|
45
|
+
# SPEC = File paths and directory locations
|
|
46
|
+
# (Where things live - TOPOLOGIES, DISCOVERY, GENERATORS, etc.)
|
|
47
|
+
#
|
|
48
|
+
# CONSTANTS = System values and defaults
|
|
49
|
+
# (Timeouts, intervals, supported features, system info)
|
|
50
|
+
#
|
|
51
|
+
# VALIDATION = Constraints and limits
|
|
52
|
+
# (Port ranges, replica limits, naming rules)
|
|
53
|
+
#
|
|
54
|
+
# DEBUG = Debugging and observability toggles
|
|
55
|
+
# (How to see what's happening when things break)
|
|
56
|
+
#
|
|
57
|
+
# Don't see what you need? Ctrl+F to search this file.
|
|
58
|
+
|
|
59
|
+
# =============================================================================
|
|
60
|
+
# ⚠️ IMPORTANT NOTES
|
|
61
|
+
# =============================================================================
|
|
62
|
+
|
|
63
|
+
# PROJECT_ROOT is automatically set by Tiltfile based on where you run `tilt up`.
|
|
64
|
+
# You don't need to set it. Example:
|
|
65
|
+
# - If you run in /home/dev/my-project, PROJECT_ROOT = "/home/dev/my-project"
|
|
66
|
+
# - All other paths are built from this root.
|
|
67
|
+
#
|
|
68
|
+
# This file is manually maintained to match the directory structure.
|
|
69
|
+
# If you add new topology modules, update this file and increment SYSTEM_VERSION.
|
|
70
|
+
|
|
71
|
+
# =============================================================================
|
|
72
|
+
# 🔧 DEBUGGING CHECKLIST (When Things Break)
|
|
73
|
+
# =============================================================================
|
|
74
|
+
|
|
75
|
+
# Error: "port X outside valid range [1024-65535]"
|
|
76
|
+
# → Check which service has "port": X in its service.json
|
|
77
|
+
# → Enable DEBUG logging to see full validation output
|
|
78
|
+
#
|
|
79
|
+
# Error: "dependency Y not found"
|
|
80
|
+
# → Check SPEC.DISCOVERY.RESOURCE_SEARCH_PATHS (where we look)
|
|
81
|
+
# → Verify service Y exists in one of those paths
|
|
82
|
+
# → Check service Y has a service.json file
|
|
83
|
+
#
|
|
84
|
+
# Error: "cannot load module Z"
|
|
85
|
+
# → Check SPEC for the path - does the file actually exist?
|
|
86
|
+
# → Run `ls -la` on the path to verify
|
|
87
|
+
#
|
|
88
|
+
# Something else broken?
|
|
89
|
+
# → Set DEBUG.DUMP_CONTEXT_ON_GENERATION = True (see DEBUG section)
|
|
90
|
+
# → Re-run tilt up and check the logs
|
|
91
|
+
# → The full context will be printed showing exactly what's happening
|
|
92
|
+
|
|
93
|
+
# =============================================================================
|
|
94
|
+
# 🗓️ FEATURE FLAGS (What's Working vs Planned)
|
|
95
|
+
# =============================================================================
|
|
96
|
+
|
|
97
|
+
# Legend:
|
|
98
|
+
# ✅ = Feature is working and enabled
|
|
99
|
+
# ⏸️ = Feature exists but disabled
|
|
100
|
+
# 🗓️ = Feature planned for future (not implemented yet)
|
|
101
|
+
#
|
|
102
|
+
# ISTIO_INTEGRATION = False (🗓️ ROADMAP - Q2 2026)
|
|
103
|
+
# - We plan to auto-generate Istio service mesh configs
|
|
104
|
+
# - Currently using Traefik for routing (working great!)
|
|
105
|
+
#
|
|
106
|
+
# BAZEL_INTEGRATION = False (🗓️ ROADMAP - when requested)
|
|
107
|
+
# - We plan Bazel integration for hermetic builds
|
|
108
|
+
# - Currently using Docker layer caching (90% of the benefits)
|
|
109
|
+
#
|
|
110
|
+
# Don't panic if you see 🗓️ - it just means "coming soon, not ready yet"
|
|
111
|
+
|
|
112
|
+
# =============================================================================
|
|
113
|
+
# 🗂️ WHERE FILES GO (And Why They Sometimes Disappear)
|
|
114
|
+
# =============================================================================
|
|
115
|
+
|
|
116
|
+
# Generated files live in: .tilt/output/configs/<service-name>/
|
|
117
|
+
#
|
|
118
|
+
# 🫥 They disappear when:
|
|
119
|
+
# - You change service.json (Tilt regenerates them)
|
|
120
|
+
# - You run tilt down (cleanup)
|
|
121
|
+
# - Something broke (check tilt logs)
|
|
122
|
+
#
|
|
123
|
+
# 😌 DON'T PANIC! They're auto-generated.
|
|
124
|
+
# They come back when you run tilt up.
|
|
125
|
+
# The SOURCE is your service.json, not these generated files.
|
|
126
|
+
#
|
|
127
|
+
# To see them again: tilt up
|
|
128
|
+
# To keep them forever: Look at OUTPUT.CONFIGS path (see below)
|
|
129
|
+
|
|
130
|
+
# =============================================================================
|
|
131
|
+
# 😰 MY SERVICE WON'T LAUNCH - CHECKLIST
|
|
132
|
+
# =============================================================================
|
|
133
|
+
|
|
134
|
+
# 1️⃣ Is service.json in the RIGHT PLACE?
|
|
135
|
+
# ✅ Good: services/product/my-service/service.json
|
|
136
|
+
# ❌ Bad: my-service/service.json (wrong folder!)
|
|
137
|
+
# ❌ Bad: service.json (no folder!)
|
|
138
|
+
#
|
|
139
|
+
# 2️⃣ Is the JSON valid?
|
|
140
|
+
# ✅ Test: python3 -m json.tool service.json
|
|
141
|
+
# ❌ If error: Fix the JSON syntax
|
|
142
|
+
#
|
|
143
|
+
# 3️⃣ Did you wait 5 seconds?
|
|
144
|
+
# Tilt scans every 5 seconds for new services
|
|
145
|
+
# Be patient! 🐱
|
|
146
|
+
#
|
|
147
|
+
# 4️⃣ Still not working?
|
|
148
|
+
# Run: tilt doctor
|
|
149
|
+
# Look for 🔴 red errors
|
|
150
|
+
# Ask in Slack with the error message
|
|
151
|
+
|
|
152
|
+
# =============================================================================
|
|
153
|
+
# 🐱 WHAT IS THIS FILE? (In Simple Words)
|
|
154
|
+
# =============================================================================
|
|
155
|
+
|
|
156
|
+
# This is a MAP 🗺️ that shows where all the Tilt files live.
|
|
157
|
+
#
|
|
158
|
+
# Think of it like this:
|
|
159
|
+
# - Your house = Project folder
|
|
160
|
+
# - spec.master = List of rooms and what's in them
|
|
161
|
+
# - You = Cat exploring the house 🐱
|
|
162
|
+
#
|
|
163
|
+
# YOU DON'T NEED TO EDIT THIS FILE.
|
|
164
|
+
# It's for the computer to find things.
|
|
165
|
+
#
|
|
166
|
+
# Just look at it when you need to know where something is.
|
|
167
|
+
# Ctrl+F to search! 🔍
|
|
168
|
+
#
|
|
169
|
+
# Example searches:
|
|
170
|
+
# - "DISCOVERY" → Find where services are discovered
|
|
171
|
+
# - "GENERATOR" → Find what creates config files
|
|
172
|
+
# - "OUTPUT" → Find where files are written
|
|
173
|
+
|
|
174
|
+
# =============================================================================
|
|
175
|
+
# 🗺️ FOLDER STRUCTURE (Visual Guide)
|
|
176
|
+
# =============================================================================
|
|
177
|
+
|
|
178
|
+
# 📁 .tilt (Tilt's home)
|
|
179
|
+
# 📁 topologies (neighborhoods)
|
|
180
|
+
# 📁 platform (Docker stuff)
|
|
181
|
+
# 📁 tilt (Tilt stuff)
|
|
182
|
+
# 📁 discovery 🔍 (find services)
|
|
183
|
+
# 📄 resource_registry.star (the list of all services)
|
|
184
|
+
# 📁 generators 🏭 (make configs)
|
|
185
|
+
# 📄 vite_config.star (makes vite configs)
|
|
186
|
+
# 📄 tsconfig.star (makes tsconfig)
|
|
187
|
+
# 📁 resources (service resources)
|
|
188
|
+
# 📄 spec.master ← YOU ARE HERE (this file!)
|
|
189
|
+
#
|
|
190
|
+
# 📁 services (Your services live here)
|
|
191
|
+
# 📁 product (Product services)
|
|
192
|
+
# 📁 my-service (Your service folder)
|
|
193
|
+
# 📄 service.json (Your service definition)
|
|
194
|
+
# 📁 backend (Backend code)
|
|
195
|
+
# 📁 frontend (Frontend code)
|
|
196
|
+
#
|
|
197
|
+
# 📁 .tilt/output/configs (Generated configs go here)
|
|
198
|
+
# 📁 my-service/
|
|
199
|
+
# 📄 vite.config.ts (auto-generated)
|
|
200
|
+
# 📄 tsconfig.json (auto-generated)
|
|
201
|
+
# 📄 docker-compose.yml (auto-generated)
|
|
202
|
+
|
|
203
|
+
# =============================================================================
|
|
204
|
+
# 🎯 FIND THE RIGHT CONSTANT (Quick Lookup)
|
|
205
|
+
# =============================================================================
|
|
206
|
+
|
|
207
|
+
# If you want to... Use this...
|
|
208
|
+
# ─────────────────────────────────────────────────────────────────
|
|
209
|
+
# Find where services are discovered SPEC.DISCOVERY.REGISTRY
|
|
210
|
+
# Find where configs are generated SPEC.GENERATORS
|
|
211
|
+
# Find where files are written OUTPUT.CONFIGS
|
|
212
|
+
# Find port limits VALIDATION.MAX_PORT
|
|
213
|
+
# Find timeout values CONSTANTS.HEALTH_CHECK_TIMEOUT
|
|
214
|
+
# Turn on debugging DEBUG.DUMP_GENERATED_CONFIGS
|
|
215
|
+
# Check if feature is enabled FEATURES.XXX
|
|
216
|
+
#
|
|
217
|
+
# Still confused? Ctrl+F what you're looking for! 🔍
|
|
218
|
+
|
|
219
|
+
# =============================================================================
|
|
220
|
+
# 😰 SCARY ERRORS EXPLAINED (Don't Panic!)
|
|
221
|
+
# =============================================================================
|
|
222
|
+
|
|
223
|
+
# Error: "port X outside valid range [1024-65535]"
|
|
224
|
+
# → 💚 Don't worry! Just change the port number
|
|
225
|
+
# → Fix: Change "port": X to something between 1024-65535
|
|
226
|
+
# → Check VALIDATION.MIN_PORT and MAX_PORT in this file
|
|
227
|
+
#
|
|
228
|
+
# Error: "dependency Y not found"
|
|
229
|
+
# → 💚 Don't worry! Your service needs another service
|
|
230
|
+
# → Fix: Check "dependencies" list in your service.json
|
|
231
|
+
# → Make sure the other service exists and has service.json
|
|
232
|
+
#
|
|
233
|
+
# Error: "cannot load module Z"
|
|
234
|
+
# → 💚 Don't worry! This might be a Tilt bug
|
|
235
|
+
# → Try: tilt up again
|
|
236
|
+
# → Or: restart Docker Desktop
|
|
237
|
+
# → Check: Does the file path in SPEC actually exist?
|
|
238
|
+
#
|
|
239
|
+
# Error: "cannot load ext://..."
|
|
240
|
+
# → 💚 Don't worry! This is usually a Tilt extension issue
|
|
241
|
+
# → Try: tilt up again
|
|
242
|
+
# → Or: Run `tilt doctor` to check setup
|
|
243
|
+
#
|
|
244
|
+
# 🔴 Red text ≠ Your fault!
|
|
245
|
+
# Most errors are fixable! 😊
|
|
246
|
+
|
|
247
|
+
# =============================================================================
|
|
248
|
+
# ✅ BOSS-READY CHECKLIST (Before Showing Your Work)
|
|
249
|
+
# =============================================================================
|
|
250
|
+
|
|
251
|
+
# Use this if your boss can only review once (sick, busy, etc.)
|
|
252
|
+
#
|
|
253
|
+
# Before showing your work, verify:
|
|
254
|
+
#
|
|
255
|
+
# □ Your service shows up in `tilt up`
|
|
256
|
+
# □ No 🔴 red error messages
|
|
257
|
+
# □ Service status says 🟢 "Running"
|
|
258
|
+
# □ You can open the URL (if there is one)
|
|
259
|
+
# □ Run: tilt doctor (should be mostly green)
|
|
260
|
+
#
|
|
261
|
+
# Quick check command:
|
|
262
|
+
# $ tilt get uiresources | grep your-service-name
|
|
263
|
+
#
|
|
264
|
+
# If you see your service name → Good! 🎉
|
|
265
|
+
# If not → Check the troubleshooting section above
|
|
266
|
+
|
|
267
|
+
# =============================================================================
|
|
268
|
+
# 🎓 AM I DOING THIS RIGHT?
|
|
269
|
+
# =============================================================================
|
|
270
|
+
|
|
271
|
+
# Scenario 1: Adding a new service
|
|
272
|
+
# → You DON'T need to edit spec.master
|
|
273
|
+
# → Just create service.json and run tilt up
|
|
274
|
+
# → ✅ You're doing it right!
|
|
275
|
+
#
|
|
276
|
+
# Scenario 2: Finding where configs are
|
|
277
|
+
# → Open spec.master
|
|
278
|
+
# → Ctrl+F "OUTPUT" or "CONFIGS"
|
|
279
|
+
# → Look at the path
|
|
280
|
+
# → ✅ You're doing it right!
|
|
281
|
+
#
|
|
282
|
+
# Scenario 3: Something is broken
|
|
283
|
+
# → Open spec.master
|
|
284
|
+
# → Look at DEBUG section
|
|
285
|
+
# → Enable DEBUG.DUMP_CONTEXT_ON_GENERATION
|
|
286
|
+
# → Run tilt up again, check logs
|
|
287
|
+
# → ✅ You're doing it right!
|
|
288
|
+
#
|
|
289
|
+
# Most of the time:
|
|
290
|
+
# You DON'T need to edit spec.master.
|
|
291
|
+
# You just LOOK at it to find things.
|
|
292
|
+
# That's using it right! 😊
|
|
293
|
+
|
|
294
|
+
# =============================================================================
|
|
295
|
+
# 🔍 SEARCH THIS FILE
|
|
296
|
+
# =============================================================================
|
|
297
|
+
|
|
298
|
+
# Don't read all 400+ lines! Use Ctrl+F 🔍
|
|
299
|
+
#
|
|
300
|
+
# Suggested searches:
|
|
301
|
+
# - "DISCOVERY" → Where we find services
|
|
302
|
+
# - "GENERATORS" → What creates config files
|
|
303
|
+
# - "OUTPUT" → Where files are written
|
|
304
|
+
# - "DEBUG" → How to troubleshoot
|
|
305
|
+
# - "VALIDATION" → Port/replica limits
|
|
306
|
+
# - "CONSTANTS" → Timeouts, defaults
|
|
307
|
+
#
|
|
308
|
+
# Search for what you need, then close the file!
|
|
309
|
+
|
|
310
|
+
# =============================================================================
|
|
311
|
+
# 📛 FILE ALIASES (Easier Names)
|
|
312
|
+
# =============================================================================
|
|
313
|
+
|
|
314
|
+
# Can't remember "spec.master"? Use these aliases:
|
|
315
|
+
#
|
|
316
|
+
# .tilt/paths.star → Same file, easier name!
|
|
317
|
+
# .tilt/where-things-live.star → Same file, fun name!
|
|
318
|
+
#
|
|
319
|
+
# So you can do:
|
|
320
|
+
# load(PROJECT_ROOT + "/.tilt/paths.star", "SPEC")
|
|
321
|
+
#
|
|
322
|
+
# Instead of:
|
|
323
|
+
# load(PROJECT_ROOT + "/.tilt-engine/spec.master", "SPEC")
|
|
324
|
+
#
|
|
325
|
+
# Both work! Use whichever you remember. 😊
|
|
326
|
+
|
|
327
|
+
# =============================================================================
|
|
328
|
+
# 🗓️ FEATURE FLAGS (What's Working vs Planned)
|
|
329
|
+
# =============================================================================
|
|
330
|
+
|
|
331
|
+
# Project root - automatically set by Tiltfile
|
|
332
|
+
# You don't need to change this. It's based on where you run `tilt up`.
|
|
333
|
+
PROJECT_ROOT = "{PROJECT_ROOT}" # Auto-substituted by Tiltfile at load time
|
|
334
|
+
|
|
335
|
+
# Core system paths
|
|
336
|
+
SPEC = struct(
|
|
337
|
+
# Root directories - EXPLICIT, no discovery magic
|
|
338
|
+
ROOT = PROJECT_ROOT,
|
|
339
|
+
TILT_DIR = PROJECT_ROOT + "/.tilt",
|
|
340
|
+
RESOURCES_DIR = PROJECT_ROOT + "/services",
|
|
341
|
+
SHARED_DIR = PROJECT_ROOT + "/shared",
|
|
342
|
+
|
|
343
|
+
# Topology paths - ALL EXPLICIT
|
|
344
|
+
# NOTE: These paths are relative to TDK CLI installation root (engine/ directory)
|
|
345
|
+
TOPOLOGIES = struct(
|
|
346
|
+
BASE = PROJECT_ROOT + "/engine/topologies",
|
|
347
|
+
PLATFORM = PROJECT_ROOT + "/engine/topologies/platform",
|
|
348
|
+
TILT = PROJECT_ROOT + "/engine/topologies/tilt",
|
|
349
|
+
PRODUCT_GENERATED = PROJECT_ROOT + "/engine/topologies/product_autogenerated_*",
|
|
350
|
+
),
|
|
351
|
+
|
|
352
|
+
# Discovery paths - Active discovery system at root level
|
|
353
|
+
# Note: Deprecated engine/topologies/tilt/discovery/ removed 2026-05-01
|
|
354
|
+
DISCOVERY = struct(
|
|
355
|
+
REGISTRY = PROJECT_ROOT + "/discovery/registry.star",
|
|
356
|
+
LOADING = PROJECT_ROOT + "/discovery/loading.star",
|
|
357
|
+
LIBRARIES = PROJECT_ROOT + "/discovery/libraries.star",
|
|
358
|
+
),
|
|
359
|
+
|
|
360
|
+
# Generator paths - EXPLICIT, no magic imports
|
|
361
|
+
GENERATORS = struct(
|
|
362
|
+
BASE = PROJECT_ROOT + "/engine/topologies/tilt/generators",
|
|
363
|
+
VITE = PROJECT_ROOT + "/engine/topologies/tilt/generators/vite_config.star",
|
|
364
|
+
TSCONFIG = PROJECT_ROOT + "/engine/topologies/tilt/generators/tsconfig.star",
|
|
365
|
+
DOCKERFILE = PROJECT_ROOT + "/engine/topologies/tilt/generators/dockerfile.star",
|
|
366
|
+
NPMRC = PROJECT_ROOT + "/engine/topologies/tilt/generators/npmrc.star",
|
|
367
|
+
MANIFEST_RESOURCE = PROJECT_ROOT + "/engine/topologies/tilt/generators/manifest_resource.star",
|
|
368
|
+
),
|
|
369
|
+
|
|
370
|
+
# Resource paths - EXPLICIT
|
|
371
|
+
RESOURCES = struct(
|
|
372
|
+
BASE = PROJECT_ROOT + "/engine/topologies/tilt/resources",
|
|
373
|
+
DEPS = PROJECT_ROOT + "/engine/topologies/tilt/resources/deps.star",
|
|
374
|
+
DATABASES = PROJECT_ROOT + "/engine/topologies/tilt/resources/databases.star",
|
|
375
|
+
INFRA = PROJECT_ROOT + "/engine/topologies/tilt/resources/infra.star",
|
|
376
|
+
ORCHESTRATOR = PROJECT_ROOT + "/engine/topologies/tilt/resources/orchestrator.star",
|
|
377
|
+
LIBS = PROJECT_ROOT + "/engine/topologies/tilt/resources/libs.star",
|
|
378
|
+
),
|
|
379
|
+
|
|
380
|
+
# Platform topology paths - EXPLICIT
|
|
381
|
+
PLATFORM = struct(
|
|
382
|
+
DOCKER = PROJECT_ROOT + "/engine/topologies/platform/docker",
|
|
383
|
+
NET = PROJECT_ROOT + "/engine/topologies/platform/net",
|
|
384
|
+
STATE = PROJECT_ROOT + "/engine/topologies/platform/state",
|
|
385
|
+
SECURITY = PROJECT_ROOT + "/engine/topologies/platform/security",
|
|
386
|
+
REGISTRIES = PROJECT_ROOT + "/engine/topologies/platform/registries",
|
|
387
|
+
OBSERVABILITY = PROJECT_ROOT + "/engine/topologies/platform/observability",
|
|
388
|
+
),
|
|
389
|
+
|
|
390
|
+
# Configuration paths - EXPLICIT
|
|
391
|
+
CONFIG = struct(
|
|
392
|
+
BASE = PROJECT_ROOT + "/engine/topologies/tilt/config",
|
|
393
|
+
GLOBAL = PROJECT_ROOT + "/engine/topologies/tilt/config/global_config.star",
|
|
394
|
+
PROFILES = PROJECT_ROOT + "/engine/topologies/tilt/config/profiles.star",
|
|
395
|
+
FEATURE_FLAGS = PROJECT_ROOT + "/engine/topologies/tilt/config/feature_flags.star",
|
|
396
|
+
),
|
|
397
|
+
|
|
398
|
+
# Common utilities - EXPLICIT
|
|
399
|
+
COMMON = struct(
|
|
400
|
+
BASE = PROJECT_ROOT + "/engine/topologies/tilt/common",
|
|
401
|
+
UTILS = PROJECT_ROOT + "/engine/topologies/tilt/common/utils.star",
|
|
402
|
+
CONSTANTS = PROJECT_ROOT + "/engine/topologies/tilt/common/constants.star",
|
|
403
|
+
VALIDATION = PROJECT_ROOT + "/engine/topologies/tilt/common/validation.star",
|
|
404
|
+
),
|
|
405
|
+
)
|
|
406
|
+
|
|
407
|
+
# =============================================================================
|
|
408
|
+
# SERVICE PATTERNS - Explicit naming conventions
|
|
409
|
+
# =============================================================================
|
|
410
|
+
|
|
411
|
+
RESOURCE_PATTERNS = struct(
|
|
412
|
+
# Manifest file names - EXPLICIT, no guessing
|
|
413
|
+
MANIFEST_FILE = "service.json",
|
|
414
|
+
|
|
415
|
+
# Service structure - EXPLICIT expectations
|
|
416
|
+
BACKEND_DIR = "backend",
|
|
417
|
+
FRONTEND_DIR = "frontend",
|
|
418
|
+
MIGRATOR_DIR = "migrator",
|
|
419
|
+
SHARED_DIR = "shared",
|
|
420
|
+
|
|
421
|
+
# Config files - EXPLICIT
|
|
422
|
+
PACKAGE_JSON = "package.json",
|
|
423
|
+
BUN_LOCK = "bun.lock",
|
|
424
|
+
DOCKERFILE = "Dockerfile",
|
|
425
|
+
DOCKER_COMPOSE = "docker-compose.yml",
|
|
426
|
+
|
|
427
|
+
# Generated files - EXPLICIT outputs
|
|
428
|
+
GENERATED_TSCONFIG = "tsconfig.json",
|
|
429
|
+
GENERATED_VITE_CONFIG = "vite.config.ts",
|
|
430
|
+
GENERATED_VITE_DOCKER = "vite.config.docker.ts",
|
|
431
|
+
GENERATED_NPMRC = ".npmrc",
|
|
432
|
+
GENERATED_BUNFIG = "bunfig.toml",
|
|
433
|
+
)
|
|
434
|
+
|
|
435
|
+
# =============================================================================
|
|
436
|
+
# DISCOVERY PATTERNS - Explicit file discovery rules
|
|
437
|
+
# =============================================================================
|
|
438
|
+
|
|
439
|
+
DISCOVERY = struct(
|
|
440
|
+
# Where to look for service manifests - EXPLICIT paths
|
|
441
|
+
RESOURCE_SEARCH_PATHS = [
|
|
442
|
+
PROJECT_ROOT + "/services/product/*",
|
|
443
|
+
PROJECT_ROOT + "/services/platform/*",
|
|
444
|
+
PROJECT_ROOT + "/services/identity/*",
|
|
445
|
+
],
|
|
446
|
+
|
|
447
|
+
# Library discovery - EXPLICIT
|
|
448
|
+
LIBRARY_SEARCH_PATHS = [
|
|
449
|
+
PROJECT_ROOT + "/shared/*",
|
|
450
|
+
],
|
|
451
|
+
|
|
452
|
+
# Manifest patterns - EXPLICIT glob patterns
|
|
453
|
+
MANIFEST_PATTERNS = [
|
|
454
|
+
"**/service.json",
|
|
455
|
+
],
|
|
456
|
+
|
|
457
|
+
# Exclusion patterns - EXPLICIT (no hidden exclusions)
|
|
458
|
+
EXCLUDE_PATTERNS = [
|
|
459
|
+
"**/node_modules/**",
|
|
460
|
+
"**/.git/**",
|
|
461
|
+
"**/dist/**",
|
|
462
|
+
"**/build/**",
|
|
463
|
+
"**/*.autogenerated.*",
|
|
464
|
+
],
|
|
465
|
+
)
|
|
466
|
+
|
|
467
|
+
# =============================================================================
|
|
468
|
+
# GENERATOR OUTPUT PATHS - Explicit where files are written
|
|
469
|
+
# =============================================================================
|
|
470
|
+
|
|
471
|
+
OUTPUT = struct(
|
|
472
|
+
# Base output directory - EXPLICIT
|
|
473
|
+
BASE = PROJECT_ROOT + "/.tilt/output",
|
|
474
|
+
|
|
475
|
+
# Generated configs location - EXPLICIT
|
|
476
|
+
CONFIGS = PROJECT_ROOT + "/.tilt/output/configs",
|
|
477
|
+
|
|
478
|
+
# Autogenerated topology files - EXPLICIT
|
|
479
|
+
TOPOLOGIES = PROJECT_ROOT + "/.tilt/topologies/product_autogenerated_*",
|
|
480
|
+
|
|
481
|
+
# Cache location - EXPLICIT
|
|
482
|
+
CACHE = PROJECT_ROOT + "/.tilt/.cache",
|
|
483
|
+
|
|
484
|
+
# Log location - EXPLICIT
|
|
485
|
+
LOGS = PROJECT_ROOT + "/.tilt/logs",
|
|
486
|
+
|
|
487
|
+
# Autogenerated folder name within service directories - EXPLICIT
|
|
488
|
+
# This is where generated configs (Dockerfile, tsconfig, etc.) are placed per-service
|
|
489
|
+
# Teams can customize this in ./spec.master to use custom folder names
|
|
490
|
+
AUTOGENERATED_FOLDER = ".autogenerated", # Changed from "autogenerated" to ".autogenerated"
|
|
491
|
+
)
|
|
492
|
+
|
|
493
|
+
# =============================================================================
|
|
494
|
+
# VALIDATION RULES - Explicit constraints
|
|
495
|
+
# =============================================================================
|
|
496
|
+
|
|
497
|
+
VALIDATION = struct(
|
|
498
|
+
# Port ranges - EXPLICIT
|
|
499
|
+
MIN_PORT = 1024,
|
|
500
|
+
MAX_PORT = 65535,
|
|
501
|
+
RESERVED_PORTS = [3000, 8080, 5432, 6379, 4222], # EXPLICIT: common conflicts
|
|
502
|
+
|
|
503
|
+
# Replica constraints - EXPLICIT
|
|
504
|
+
MIN_REPLICAS = 1,
|
|
505
|
+
MAX_REPLICAS = 100,
|
|
506
|
+
DEFAULT_REPLICAS = 1,
|
|
507
|
+
|
|
508
|
+
# Naming constraints - EXPLICIT regex patterns
|
|
509
|
+
VALID_RESOURCE_NAME_PATTERN = "^[a-z0-9-]+$",
|
|
510
|
+
MAX_RESOURCE_NAME_LENGTH = 63,
|
|
511
|
+
|
|
512
|
+
# Dependency constraints - EXPLICIT
|
|
513
|
+
MAX_DEPENDENCY_DEPTH = 10, # Prevent circular deps
|
|
514
|
+
ALLOWED_DEPENDENCY_TYPES = ["internal", "external", "platform"],
|
|
515
|
+
)
|
|
516
|
+
|
|
517
|
+
# =============================================================================
|
|
518
|
+
# FEATURE FLAGS - Explicit feature toggles
|
|
519
|
+
# =============================================================================
|
|
520
|
+
|
|
521
|
+
# LEGEND:
|
|
522
|
+
# ✅ True = Feature is working and enabled now
|
|
523
|
+
# ⏸️ False = Feature exists but currently disabled
|
|
524
|
+
# 🗓️ False = Feature is on the roadmap (not implemented yet)
|
|
525
|
+
#
|
|
526
|
+
# "🗓️ ROADMAP" means we're planning to build it, but it's not ready.
|
|
527
|
+
# Don't worry - the core features (✅) work great!
|
|
528
|
+
|
|
529
|
+
FEATURES = struct(
|
|
530
|
+
# ✅ Core features - Working today
|
|
531
|
+
AUTO_DISCOVERY = True, # Automatically find new service.json files
|
|
532
|
+
INCREMENTAL_GENERATION = True, # Only regenerate changed configs
|
|
533
|
+
PARALLEL_GENERATION = True, # Generate configs in parallel
|
|
534
|
+
|
|
535
|
+
# 🗓️ Roadmap features - Planned but not built yet
|
|
536
|
+
# These will be added in future versions. Don't wait for them -
|
|
537
|
+
# what's here today works great!
|
|
538
|
+
|
|
539
|
+
ISTIO_INTEGRATION = False,
|
|
540
|
+
# 🗓️ ROADMAP (Target: Q2 2026)
|
|
541
|
+
# Auto-generate Istio service mesh configs
|
|
542
|
+
# Currently using Traefik for routing - works great!
|
|
543
|
+
|
|
544
|
+
BAZEL_INTEGRATION = False,
|
|
545
|
+
# 🗓️ ROADMAP (Target: When requested)
|
|
546
|
+
# Bazel build system for hermetic builds
|
|
547
|
+
# Currently using Docker layer caching (90% of benefits, simpler)
|
|
548
|
+
|
|
549
|
+
CUE_VALIDATION = False,
|
|
550
|
+
# 🗓️ ROADMAP (Target: Future)
|
|
551
|
+
# Type-safe validation using Cue lang
|
|
552
|
+
# Currently using JSON Schema + Starlark validation (works well)
|
|
553
|
+
|
|
554
|
+
# ⏸️ Debug features - Toggle these when troubleshooting
|
|
555
|
+
VERBOSE_LOGGING = False, # Lots of output for debugging
|
|
556
|
+
GENERATION_DEBUG = False, # Step-by-step generation logging
|
|
557
|
+
CONTEXT_INSPECTION = False, # See full context object (see DEBUG section)
|
|
558
|
+
)
|
|
559
|
+
|
|
560
|
+
# =============================================================================
|
|
561
|
+
# CONSTANTS - System-wide constants
|
|
562
|
+
# =============================================================================
|
|
563
|
+
|
|
564
|
+
# Load project name for system identity
|
|
565
|
+
# Use TDK_PROJECT_ROOT env var set by Tilt, fallback to current directory
|
|
566
|
+
def _load_system_name_prefix():
|
|
567
|
+
project_root = os.environ.get('TDK_PROJECT_ROOT', '')
|
|
568
|
+
project_json_path = '.tdk/project.json'
|
|
569
|
+
if project_root:
|
|
570
|
+
project_json_path = project_root + '/' + project_json_path
|
|
571
|
+
|
|
572
|
+
if os.path.exists(project_json_path):
|
|
573
|
+
_project_json = read_json(project_json_path)
|
|
574
|
+
return _project_json.get('project', {}).get('name', 'tdk-project')
|
|
575
|
+
return 'tdk-project'
|
|
576
|
+
|
|
577
|
+
_SYSTEM_NAME_PREFIX = _load_system_name_prefix()
|
|
578
|
+
|
|
579
|
+
CONSTANTS = struct(
|
|
580
|
+
# System identity - EXPLICIT (dynamic from project.json)
|
|
581
|
+
SYSTEM_NAME = _SYSTEM_NAME_PREFIX + "-tilt-platform",
|
|
582
|
+
SYSTEM_VERSION = "2.0.0",
|
|
583
|
+
|
|
584
|
+
# Runtimes - EXPLICIT supported options
|
|
585
|
+
SUPPORTED_RUNTIMES = ["bun", "node", "deno"],
|
|
586
|
+
DEFAULT_RUNTIME = "bun",
|
|
587
|
+
|
|
588
|
+
# App types - EXPLICIT
|
|
589
|
+
SUPPORTED_APP_TYPES = ["backend", "frontend", "library", "sdk"],
|
|
590
|
+
|
|
591
|
+
# Features - EXPLICIT
|
|
592
|
+
SUPPORTED_FEATURES = [
|
|
593
|
+
"nats",
|
|
594
|
+
"prisma",
|
|
595
|
+
"vite",
|
|
596
|
+
"vite-node",
|
|
597
|
+
"traefik",
|
|
598
|
+
"redis",
|
|
599
|
+
"postgres",
|
|
600
|
+
],
|
|
601
|
+
|
|
602
|
+
# Timeouts - EXPLICIT (seconds)
|
|
603
|
+
DEFAULT_TIMEOUT = 300,
|
|
604
|
+
HEALTH_CHECK_TIMEOUT = 30,
|
|
605
|
+
GENERATION_TIMEOUT = 60,
|
|
606
|
+
|
|
607
|
+
# Intervals - EXPLICIT (seconds)
|
|
608
|
+
DISCOVERY_SCAN_INTERVAL = 5,
|
|
609
|
+
HEALTH_CHECK_INTERVAL = 10,
|
|
610
|
+
)
|
|
611
|
+
|
|
612
|
+
# =============================================================================
|
|
613
|
+
# 🐛 DEBUGGING - How to Fix Things When They Break
|
|
614
|
+
# =============================================================================
|
|
615
|
+
|
|
616
|
+
# THREE WAYS TO USE DEBUG FLAGS:
|
|
617
|
+
#
|
|
618
|
+
# Method 1: Edit this file (affects all future runs)
|
|
619
|
+
# DEBUG = DEBUG | struct(DUMP_CONTEXT_ON_GENERATION = True)
|
|
620
|
+
# Then run `tilt up`
|
|
621
|
+
#
|
|
622
|
+
# Method 2: Environment variable (one-time, quick)
|
|
623
|
+
# $ TILT_DEBUG_DUMP_CONTEXT=true tilt up
|
|
624
|
+
# (Checks os.environ.get("TILT_DEBUG_DUMP_CONTEXT") at runtime)
|
|
625
|
+
#
|
|
626
|
+
# Method 3: Tilt args (when we implement --debug flags)
|
|
627
|
+
# $ tilt up -- --debug-context
|
|
628
|
+
#
|
|
629
|
+
# WHAT EACH FLAG DOES:
|
|
630
|
+
#
|
|
631
|
+
# DUMP_CONTEXT_ON_GENERATION = True
|
|
632
|
+
# → Prints the entire context object to logs
|
|
633
|
+
# → Shows: resource_name, port, dependencies, paths
|
|
634
|
+
# → Use when: "What values are being used?"
|
|
635
|
+
#
|
|
636
|
+
# DUMP_GENERATED_CONFIGS = True
|
|
637
|
+
# → Writes all generated configs to OUTPUT.CONFIGS
|
|
638
|
+
# → You can open and read them
|
|
639
|
+
# → Use when: "What configs were generated?"
|
|
640
|
+
#
|
|
641
|
+
# LOG_LEVEL = "DEBUG"
|
|
642
|
+
# → Very verbose output showing every step
|
|
643
|
+
# → Use when: "Where is it failing?"
|
|
644
|
+
#
|
|
645
|
+
# ENABLE_DEBUG_ENDPOINTS = True
|
|
646
|
+
# → Opens http://localhost:10350 for live inspection
|
|
647
|
+
# → Use when: "I want to browse the current state"
|
|
648
|
+
|
|
649
|
+
DEBUG = struct(
|
|
650
|
+
# Live debugging endpoint
|
|
651
|
+
ENABLE_DEBUG_ENDPOINTS = False,
|
|
652
|
+
DEBUG_ENDPOINT_PORT = 10350,
|
|
653
|
+
|
|
654
|
+
# What to dump/print during generation
|
|
655
|
+
DUMP_CONTEXT_ON_GENERATION = False, # Print full context to logs
|
|
656
|
+
DUMP_GENERATED_CONFIGS = True, # Write configs to disk for inspection
|
|
657
|
+
|
|
658
|
+
# Logging configuration
|
|
659
|
+
LOG_LEVEL = "INFO", # Options: DEBUG (verbose), INFO (normal), WARN, ERROR
|
|
660
|
+
LOG_FORMAT = "JSON", # Options: JSON (structured), TEXT (readable)
|
|
661
|
+
|
|
662
|
+
# Validation strictness
|
|
663
|
+
STRICT_VALIDATION = True, # Fail on any validation error
|
|
664
|
+
FAIL_ON_WARNING = False, # Also fail on warnings (stricter)
|
|
665
|
+
)
|
|
666
|
+
|
|
667
|
+
# =============================================================================
|
|
668
|
+
# ZIG-STYLE EXPLICITNESS MANIFESTO
|
|
669
|
+
# =============================================================================
|
|
670
|
+
|
|
671
|
+
"""
|
|
672
|
+
PHILOSOPHY: No hidden control flow. No hidden allocations. No magic.
|
|
673
|
+
|
|
674
|
+
This spec file makes EVERYTHING explicit:
|
|
675
|
+
1. ALL paths are constants - no runtime discovery
|
|
676
|
+
2. ALL patterns are declared - no hidden globbing
|
|
677
|
+
3. ALL features are toggled - no surprise behavior
|
|
678
|
+
4. ALL outputs are defined - no mystery files
|
|
679
|
+
|
|
680
|
+
COMPARISON:
|
|
681
|
+
|
|
682
|
+
❌ BEFORE (Implicit):
|
|
683
|
+
load("./discovery/resource_registry.star", "get_app_resources")
|
|
684
|
+
# Where does this file live? Magic.
|
|
685
|
+
# What does it return? Runtime mystery.
|
|
686
|
+
|
|
687
|
+
✅ AFTER (Explicit):
|
|
688
|
+
load(SPEC.DISCOVERY.REGISTRY, "get_app_resources")
|
|
689
|
+
# Path is: {PROJECT_ROOT}/.tilt/topologies/tilt/discovery/resource_registry.star
|
|
690
|
+
# Behavior defined in this spec file.
|
|
691
|
+
|
|
692
|
+
USAGE:
|
|
693
|
+
load("{}/.tilt/spec.master".format(PROJECT_ROOT), "SPEC", "CONSTANTS")
|
|
694
|
+
|
|
695
|
+
# Now EVERYTHING is explicit
|
|
696
|
+
registry_path = SPEC.DISCOVERY.REGISTRY
|
|
697
|
+
max_port = VALIDATION.MAX_PORT
|
|
698
|
+
features = CONSTANTS.SUPPORTED_FEATURES
|
|
699
|
+
|
|
700
|
+
This is our answer to the Zig developer's critique:
|
|
701
|
+
"Make it obvious. No hidden state."
|
|
702
|
+
"""
|
|
703
|
+
|
|
704
|
+
# =============================================================================
|
|
705
|
+
# EXPORTS - Explicit what's available
|
|
706
|
+
# =============================================================================
|
|
707
|
+
|
|
708
|
+
__all__ = [
|
|
709
|
+
"SPEC",
|
|
710
|
+
"RESOURCE_PATTERNS",
|
|
711
|
+
"DISCOVERY",
|
|
712
|
+
"OUTPUT",
|
|
713
|
+
"VALIDATION",
|
|
714
|
+
"FEATURES",
|
|
715
|
+
"CONSTANTS",
|
|
716
|
+
"DEBUG",
|
|
717
|
+
]
|