@tdk-landscape/tdk-cli-core 1.3.124 → 1.3.126
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 +289 -18
- package/README.md +20 -1
- package/cli/dist/commands/doctor.js +3 -127
- 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/upgrade.js +39 -52
- package/cli/dist/components/TabBar.js +2 -7
- package/cli/dist/generator/resource-templates.js +127 -0
- package/cli/dist/generator/template-engine.js +7 -1
- package/cli/dist/utils/doctor-runtime.js +6 -3
- package/cli/dist/utils/doctor-starlark.js +131 -0
- package/cli/dist/utils/env-validator.js +61 -19
- package/cli/dist/utils/service-manifest.js +145 -0
- package/cli/dist/utils/service-runtime-state.js +2 -2
- package/cli/dist/utils/services.js +8 -1
- package/cli/dist/utils/startup-report.js +10 -6
- package/cli/dist/utils/tilt-resource-state.js +19 -0
- package/cli/dist/utils/tilt.js +2 -1
- package/cli/dist/utils/ui-keymap.js +118 -0
- package/cli/package.json +1 -1
- package/discovery/manifest/loading.star +5 -0
- package/discovery/manifest/normalize.star +6 -0
- 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/manifest/loader.star +7 -0
- package/engine/topologies/tilt/manifest/parser.star +86 -3
- package/engine/topologies/tilt/manifest/tests/test_loader_parser.star +63 -1
- 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
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}
|