@tdk-landscape/tdk-cli-core 1.3.123 → 1.3.125
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +284 -18
- package/README.md +20 -2
- package/cli/dist/commands/doctor.js +5 -133
- package/cli/dist/commands/down.js +8 -1
- package/cli/dist/commands/eject.js +2 -2
- package/cli/dist/commands/logs.js +16 -10
- package/cli/dist/commands/networks.js +10 -10
- package/cli/dist/commands/resource.js +7 -126
- package/cli/dist/commands/ui.js +35 -14
- package/cli/dist/commands/up.js +8 -0
- package/cli/dist/commands/upgrade.js +39 -52
- package/cli/dist/components/TabBar.js +2 -7
- package/cli/dist/generator/resource-templates.js +127 -0
- package/cli/dist/utils/bun-requirement.js +11 -0
- package/cli/dist/utils/cold-preflight.js +14 -9
- package/cli/dist/utils/doctor-starlark.js +131 -0
- package/cli/dist/utils/env-validator.js +97 -29
- package/cli/dist/utils/schema-version-gate.js +39 -0
- package/cli/dist/utils/service-manifest.js +11 -0
- package/cli/dist/utils/services.js +7 -1
- package/cli/dist/utils/tilt.js +2 -1
- package/cli/dist/utils/ui-keymap.js +118 -0
- package/cli/package.json +1 -1
- package/engine/topologies/tilt/common/utils.star +3 -3
- package/engine/topologies/tilt/common/utils_debug.star +1 -1
- package/engine/topologies/tilt/generators/typescript/frontend_tsconfig.star +4 -6
- package/engine/topologies/tilt/resources/infra-loader.star +12 -11
- package/engine/topologies/tilt/resources/orchestrator/apply.star +2 -1
- package/engine/topologies/tilt/resources/orchestrator/apply_compose_resource_registration.star +19 -18
- package/package.json +1 -1
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
# Infra.load_all(should_enable_fn)
|
|
19
19
|
# =============================================================================
|
|
20
20
|
|
|
21
|
+
load("../common/utils_debug.star", "debug_log")
|
|
21
22
|
load("../../platform/docker/constants.star", "PlatformDockerConstants")
|
|
22
23
|
load("../../platform/docker/compose/traefik_standalone.star", "generate_standalone_traefik_compose")
|
|
23
24
|
load("../../platform/docker/networking/sablier_container_cycle.star", "sablier_middleware_suffix")
|
|
@@ -130,14 +131,14 @@ def _register_platform_postgres(should_enable, root_prefix="", env_file=None, wr
|
|
|
130
131
|
"""
|
|
131
132
|
postgres_compose = _ensure_database_management_compose(root_prefix, write_fn)
|
|
132
133
|
if _file_exists(postgres_compose):
|
|
133
|
-
|
|
134
|
+
debug_log("INFRA: Loading postgres compose from {}".format(postgres_compose))
|
|
134
135
|
_docker_compose(postgres_compose, env_file)
|
|
135
136
|
dc_resource('postgres', labels=['infra.tools'], resource_deps=['init-networks'], auto_init=True)
|
|
136
137
|
return
|
|
137
138
|
message = "Shared platform Postgres compose was not materialized at {}".format(postgres_compose)
|
|
138
139
|
if required:
|
|
139
140
|
fail(message + " (write_fn present: {}). Refusing to register a postgres Tilt resource with no compose.".format(write_fn != None))
|
|
140
|
-
|
|
141
|
+
debug_log("INFRA: Skipping postgres (compose file not found): {}".format(message))
|
|
141
142
|
|
|
142
143
|
|
|
143
144
|
def force_start_platform_postgres(should_enable, root_prefix="", env_file=None, write_fn=None):
|
|
@@ -161,7 +162,7 @@ def force_start_platform_postgres(should_enable, root_prefix="", env_file=None,
|
|
|
161
162
|
def _load_database_management(should_enable, root_prefix="", env_file=None, write_fn=None):
|
|
162
163
|
"""Load database and messaging infrastructure."""
|
|
163
164
|
if not should_enable('database-management'):
|
|
164
|
-
|
|
165
|
+
debug_log("INFRA: database-management not enabled")
|
|
165
166
|
return
|
|
166
167
|
|
|
167
168
|
print("🗃️ Loading database management services...")
|
|
@@ -172,7 +173,7 @@ def _load_database_management(should_enable, root_prefix="", env_file=None, writ
|
|
|
172
173
|
# Load messaging if compose file exists
|
|
173
174
|
messaging_compose = root_prefix + 'services/platform/messaging/docker-compose.yml'
|
|
174
175
|
if _file_exists(messaging_compose):
|
|
175
|
-
|
|
176
|
+
debug_log("INFRA: Loading messaging compose from {}".format(messaging_compose))
|
|
176
177
|
_docker_compose(messaging_compose, env_file)
|
|
177
178
|
# Register only services present in the project compose file. Minimal
|
|
178
179
|
# NATS-only examples should not need to add an unrelated Redis broker.
|
|
@@ -181,7 +182,7 @@ def _load_database_management(should_enable, root_prefix="", env_file=None, writ
|
|
|
181
182
|
if _compose_has_service(messaging_compose, 'nats'):
|
|
182
183
|
dc_resource('nats', labels=['infra.messaging'], auto_init=True)
|
|
183
184
|
else:
|
|
184
|
-
|
|
185
|
+
debug_log("INFRA: Skipping messaging (compose file not found)")
|
|
185
186
|
|
|
186
187
|
# Only create kafka resources if debezium is enabled AND messaging exists
|
|
187
188
|
cdc_enabled = should_enable('debezium')
|
|
@@ -211,7 +212,7 @@ def _load_infisical(should_enable, root_prefix="", env_file=None):
|
|
|
211
212
|
|
|
212
213
|
compose_file = root_prefix + 'docker-compose.infisical.yml'
|
|
213
214
|
if not _file_exists(compose_file):
|
|
214
|
-
|
|
215
|
+
debug_log("INFRA: Skipping Infisical (compose file not found)")
|
|
215
216
|
return
|
|
216
217
|
|
|
217
218
|
print("🔐 Loading Infisical...")
|
|
@@ -254,7 +255,7 @@ def _load_standalone_traefik(root_prefix, env_file, write_fn):
|
|
|
254
255
|
def _load_proxy(should_enable, root_prefix="", env_file=None, write_fn=None):
|
|
255
256
|
"""Load Traefik reverse proxy with proper health check sequencing."""
|
|
256
257
|
if not should_enable('proxy'):
|
|
257
|
-
|
|
258
|
+
debug_log("INFRA: proxy not enabled")
|
|
258
259
|
return
|
|
259
260
|
|
|
260
261
|
compose_files = [
|
|
@@ -266,7 +267,7 @@ def _load_proxy(should_enable, root_prefix="", env_file=None, write_fn=None):
|
|
|
266
267
|
]
|
|
267
268
|
missing = [path for path in compose_files if not _file_exists(path)]
|
|
268
269
|
if missing:
|
|
269
|
-
|
|
270
|
+
debug_log("INFRA: Platform proxy compose missing ({}), using standalone Traefik".format(missing[0]))
|
|
270
271
|
_load_standalone_traefik(root_prefix, env_file, write_fn)
|
|
271
272
|
return
|
|
272
273
|
|
|
@@ -422,11 +423,11 @@ def load_all_infrastructure(should_enable, fix_docker_networks_fn=None, docker_p
|
|
|
422
423
|
"""
|
|
423
424
|
# Initialize networks first
|
|
424
425
|
if fix_docker_networks_fn:
|
|
425
|
-
|
|
426
|
+
debug_log("INFRA: Initializing networks...")
|
|
426
427
|
_init_networks(fix_docker_networks_fn)
|
|
427
|
-
|
|
428
|
+
debug_log("INFRA: Networks initialized")
|
|
428
429
|
else:
|
|
429
|
-
|
|
430
|
+
debug_log("INFRA: SKIPPING network initialization (no fix_docker_networks_fn)")
|
|
430
431
|
|
|
431
432
|
# These stacks both define an `elasticsearch` resource (and host port 9200).
|
|
432
433
|
# Running both at once causes compose/resource collisions and unstable startup.
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
# Purpose: thin coordinator for service apply lifecycle.
|
|
5
5
|
# =============================================================================
|
|
6
6
|
|
|
7
|
+
load("../../common/utils_debug.star", "debug_log")
|
|
7
8
|
load('../databases.star', 'Database')
|
|
8
9
|
load('./apply_runtime_flags.star', 'RuntimeFlags')
|
|
9
10
|
load('./apply_resource_validation.star', 'ResourceValidation')
|
|
@@ -38,7 +39,7 @@ def apply_app_service(resource_config, ctx):
|
|
|
38
39
|
for nested in resource_config.get('resources', []):
|
|
39
40
|
nested_name = nested.get('name', '')
|
|
40
41
|
if nested_name and should_enable(nested_name):
|
|
41
|
-
|
|
42
|
+
debug_log("APPLY: stack '{}' not individually enabled, but nested service '{}' is - proceeding".format(resource_name, nested_name))
|
|
42
43
|
service_enabled = True
|
|
43
44
|
break
|
|
44
45
|
|
package/engine/topologies/tilt/resources/orchestrator/apply_compose_resource_registration.star
CHANGED
|
@@ -7,6 +7,7 @@ OUTPUT = struct(AUTOGENERATED_FOLDER = ".autogenerated")
|
|
|
7
7
|
# === END INLINED CONSTANTS ===
|
|
8
8
|
|
|
9
9
|
|
|
10
|
+
load("../../common/utils_debug.star", "debug_log")
|
|
10
11
|
load('../../../platform/docker/index.star', 'Docker')
|
|
11
12
|
load('../../../platform/docker/constants.star', 'PlatformDockerConstants')
|
|
12
13
|
load('../../../tilt/manifest/constants.star', 'BASE_PORT_FRONTEND', 'BASE_PORT_BACKEND')
|
|
@@ -57,7 +58,7 @@ def force_start_shared_platform_postgres_once(ctx, should_enable, resource_name=
|
|
|
57
58
|
(already started this run, or database-management is already on).
|
|
58
59
|
"""
|
|
59
60
|
if ctx.get('_shared_platform_postgres_force_started', False):
|
|
60
|
-
|
|
61
|
+
debug_log("COMPOSE: shared platform Postgres already force-started this run; skip for '{}'".format(resource_name))
|
|
61
62
|
return False
|
|
62
63
|
if should_enable('database-management'):
|
|
63
64
|
return False
|
|
@@ -68,7 +69,7 @@ def force_start_shared_platform_postgres_once(ctx, should_enable, resource_name=
|
|
|
68
69
|
write_fn = ctx.get('write_file', None)
|
|
69
70
|
if write_fn == None:
|
|
70
71
|
fail("dependsOn postgres/database-management on selected resource '{}' requires ctx.write_file to materialize services/platform/database-management/docker-compose.yml".format(resource_name))
|
|
71
|
-
|
|
72
|
+
debug_log("COMPOSE: force-starting shared platform Postgres once (selected '{}' dependsOn)".format(resource_name))
|
|
72
73
|
Infra.force_start_postgres(should_enable, root_prefix=root_prefix, env_file=env_file, write_fn=write_fn)
|
|
73
74
|
ctx['_shared_platform_postgres_force_started'] = True
|
|
74
75
|
return True
|
|
@@ -520,11 +521,11 @@ def _register_single_resource(config, resource_path, compose_project_name, auto_
|
|
|
520
521
|
defers_start = resource_defers_start(config.get('manifest', {}))
|
|
521
522
|
effective_auto_init = auto_init_apps and not defers_start
|
|
522
523
|
|
|
523
|
-
|
|
524
|
+
debug_log("REGISTER: Registering '{}' app_type='{}' auto_init={}".format(res_name, app_type, effective_auto_init))
|
|
524
525
|
|
|
525
526
|
# Skip docker_build for libraries and SDKs - they don't have Dockerfiles
|
|
526
527
|
if app_type not in ['library', 'sdk', 'bring-your-own'] and config.get('syncs'):
|
|
527
|
-
|
|
528
|
+
debug_log("REGISTER: '{}' has syncs, calling docker_build".format(res_name))
|
|
528
529
|
live_update_rules = _build_live_update_rules(
|
|
529
530
|
config['res_path'],
|
|
530
531
|
config['res_path'],
|
|
@@ -537,16 +538,16 @@ def _register_single_resource(config, resource_path, compose_project_name, auto_
|
|
|
537
538
|
if defers_start:
|
|
538
539
|
_register_deferred_image_prebuild(config, auto_init_apps)
|
|
539
540
|
else:
|
|
540
|
-
|
|
541
|
+
debug_log("REGISTER: '{}' skipping docker_build (app_type='{}', syncs={})".format(res_name, app_type, config.get('syncs')))
|
|
541
542
|
|
|
542
|
-
|
|
543
|
+
debug_log("REGISTER: Calling dc_resource for '{}' with deps={}".format(res_name, config['res_deps']))
|
|
543
544
|
dc_resource(
|
|
544
545
|
config['res_name'],
|
|
545
546
|
labels=config['labels'],
|
|
546
547
|
resource_deps=config['res_deps'],
|
|
547
548
|
auto_init=effective_auto_init,
|
|
548
549
|
)
|
|
549
|
-
|
|
550
|
+
debug_log("REGISTER: dc_resource completed for '{}'".format(res_name))
|
|
550
551
|
|
|
551
552
|
_register_run_only_resource(config, resource_path, compose_project_name, effective_auto_init)
|
|
552
553
|
_register_replicas(config, effective_auto_init)
|
|
@@ -652,7 +653,7 @@ def register_compose_resources(resource_config, ctx, runtime_flags, manifest_sta
|
|
|
652
653
|
resource_name = resource_config.get('name', '')
|
|
653
654
|
resource_path = resource_config.get('path', '')
|
|
654
655
|
|
|
655
|
-
|
|
656
|
+
debug_log("COMPOSE: register_compose_resources called for '{}' path='{}'".format(resource_name, resource_path))
|
|
656
657
|
|
|
657
658
|
if not resource_name:
|
|
658
659
|
print("⚠️ Skipping service without name")
|
|
@@ -661,10 +662,10 @@ def register_compose_resources(resource_config, ctx, runtime_flags, manifest_sta
|
|
|
661
662
|
if not resource_path:
|
|
662
663
|
# Silently skip services without paths - these may be library references
|
|
663
664
|
# or incomplete manifests
|
|
664
|
-
|
|
665
|
+
debug_log("COMPOSE: SKIPPING '{}' - no path".format(resource_name))
|
|
665
666
|
return {'compose_project_name': ''}
|
|
666
667
|
|
|
667
|
-
|
|
668
|
+
debug_log("COMPOSE: Proceeding with '{}' - creating compose resources".format(resource_name))
|
|
668
669
|
should_enable = ctx['should_enable']
|
|
669
670
|
write_file = ctx['write_file']
|
|
670
671
|
compose_project_name = resource_name + '-autogenerated'
|
|
@@ -704,7 +705,7 @@ def register_compose_resources(resource_config, ctx, runtime_flags, manifest_sta
|
|
|
704
705
|
continue
|
|
705
706
|
res_manifest = resource_manifests.get(res['name'], {})
|
|
706
707
|
if manifest_needs_shared_platform_postgres(res_manifest):
|
|
707
|
-
|
|
708
|
+
debug_log("COMPOSE: selected '{}' dependsOn shared platform Postgres; force-starting postgres".format(res.get('name', '')))
|
|
708
709
|
force_start_shared_platform_postgres_once(ctx, should_enable, res.get('name', ''))
|
|
709
710
|
break
|
|
710
711
|
|
|
@@ -728,7 +729,7 @@ def register_compose_resources(resource_config, ctx, runtime_flags, manifest_sta
|
|
|
728
729
|
# Building verdaccio as a backend produced broken COPY paths and missing package.json.
|
|
729
730
|
app_type = manifest.get('appType', 'backend')
|
|
730
731
|
if app_type in ['library', 'sdk', 'infra']:
|
|
731
|
-
|
|
732
|
+
debug_log("COMPOSE: Skipping '{}' appType='{}' (not an app container)".format(res.get('name', ''), app_type))
|
|
732
733
|
continue
|
|
733
734
|
|
|
734
735
|
if res.get('frontend', False):
|
|
@@ -780,10 +781,10 @@ def register_compose_resources(resource_config, ctx, runtime_flags, manifest_sta
|
|
|
780
781
|
built_config['res_deps'] = [dep for dep in built_config['res_deps'] if dep != 'postgres']
|
|
781
782
|
resource_configs.append(built_config)
|
|
782
783
|
|
|
783
|
-
|
|
784
|
+
debug_log("COMPOSE: Calling Docker.app_compose for '{}' with write_fn={}".format(resource_name, write_file))
|
|
784
785
|
Docker.app_compose(resource_path, resource_entries, write_file)
|
|
785
786
|
|
|
786
|
-
|
|
787
|
+
debug_log("COMPOSE: {} resource_entries count = {}".format(resource_name, len(resource_entries)))
|
|
787
788
|
|
|
788
789
|
# Prepend project root to make path absolute from project root
|
|
789
790
|
project_root = ctx.get('project_root', '')
|
|
@@ -794,15 +795,15 @@ def register_compose_resources(resource_config, ctx, runtime_flags, manifest_sta
|
|
|
794
795
|
compose_file = project_root + '/' + compose_file_rel if project_root else compose_file_rel
|
|
795
796
|
# Load env file from project root for docker-compose variables (DB_PASSWORD, etc.)
|
|
796
797
|
env_file = project_root + '/.env' if project_root else '.env'
|
|
797
|
-
|
|
798
|
+
debug_log("COMPOSE: Calling docker_compose for '{}' with {} env_file={}".format(resource_name, compose_file, env_file))
|
|
798
799
|
_docker_compose_app(compose_file, compose_project_name, env_file)
|
|
799
800
|
port_override_rel = resource_path + '/' + OUTPUT.AUTOGENERATED_FOLDER + '/docker-compose.port-override.yml'
|
|
800
801
|
port_override = project_root + '/' + port_override_rel if project_root else port_override_rel
|
|
801
802
|
if str(local("test -f '" + port_override + "' && echo yes || echo no", quiet=True, echo_off=True)).strip() == 'yes':
|
|
802
|
-
|
|
803
|
+
debug_log("COMPOSE: Applying port override {}".format(port_override))
|
|
803
804
|
_docker_compose_app(port_override, compose_project_name, env_file)
|
|
804
805
|
else:
|
|
805
|
-
|
|
806
|
+
debug_log("COMPOSE: SKIPPING docker_compose for '{}' - no resource_entries".format(resource_name))
|
|
806
807
|
|
|
807
808
|
for compose_file in resource_config.get('compose_files', []):
|
|
808
809
|
if compose_file != '.autogenerated/docker-compose.app.autogenerated.yml':
|
|
@@ -810,7 +811,7 @@ def register_compose_resources(resource_config, ctx, runtime_flags, manifest_sta
|
|
|
810
811
|
env_file = project_root + '/.env' if project_root else '.env'
|
|
811
812
|
_docker_compose_app(compose_file_full, compose_project_name, env_file)
|
|
812
813
|
|
|
813
|
-
|
|
814
|
+
debug_log("COMPOSE: Calling _register_dc_resources for '{}' with {} configs, auto_init={}".format(resource_name, len(resource_configs), runtime_flags['auto_init_apps']))
|
|
814
815
|
_register_dc_resources(resource_configs, resource_path, compose_project_name, runtime_flags['auto_init_apps'])
|
|
815
816
|
|
|
816
817
|
return {'compose_project_name': compose_project_name}
|