@tdk-landscape/tdk-cli-core 1.3.157 → 1.3.159

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.
@@ -1,2 +1,2 @@
1
1
  import{createRequire as __tdkRequire}from'node:module';const require=__tdkRequire(import.meta.url);
2
- import{Ib as a,Jb as b,Kb as c,Lb as d,Mb as e}from"./chunk-O2SVXNG5.js";import"./chunk-42IVF3YT.js";import"./chunk-6EA4DGCY.js";export{e as assertMachineReadyOrExit,d as formatColdPreflight,a as nodeTooOld,b as requireVerifiedDockerVersions,c as runColdPreflight};
2
+ import{Mb as a,Nb as b,Ob as c,Pb as d,Qb as e}from"./chunk-NYJ4DFC2.js";import"./chunk-42IVF3YT.js";import"./chunk-6EA4DGCY.js";export{e as assertMachineReadyOrExit,d as formatColdPreflight,a as nodeTooOld,b as requireVerifiedDockerVersions,c as runColdPreflight};
package/cli/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tdk-cli-internal",
3
3
  "private": true,
4
- "version": "1.3.157",
4
+ "version": "1.3.159",
5
5
  "description": "TDK CLI — start services on your machine.",
6
6
  "keywords": [
7
7
  "tdk",
@@ -11,7 +11,7 @@ load('../databases.star', 'Database')
11
11
  load('./apply_runtime_flags.star', 'RuntimeFlags')
12
12
  load('./apply_resource_validation.star', 'ResourceValidation')
13
13
  load('./apply_manifest_orchestration.star', 'ManifestOrchestration')
14
- load('./apply_compose_resource_registration.star', 'ComposeResourceRegistration')
14
+ load('./apply_compose_resource_registration.star', 'ComposeResourceRegistration', 'resource_needs_database')
15
15
  load('./apply_migrator_orchestration.star', 'MigratorOrchestration')
16
16
 
17
17
 
@@ -53,11 +53,10 @@ def apply_app_service(resource_config, ctx):
53
53
 
54
54
  ResourceValidation.validate(resource_config)
55
55
 
56
- # Only provision database if service has a backend resource (not just frontend)
56
+ # Provision the database when a resource receives DATABASE_URL (backend or bring-your-own), not for frontends only.
57
57
  has_backend = False
58
58
  for resource in resource_config.get('resources', []):
59
- manifest = resource.get('_manifest', {})
60
- if manifest.get('appType') == 'backend':
59
+ if resource_needs_database(resource.get('_manifest', {})):
61
60
  has_backend = True
62
61
  break
63
62
 
@@ -562,11 +562,21 @@ def _register_dc_resources(resource_configs, resource_path, compose_project_name
562
562
  _register_single_resource(config, resource_path, compose_project_name, auto_init_apps)
563
563
 
564
564
 
565
+ # appTypes whose containers get DATABASE_URL and therefore need their logical database provisioned. Bring-your-own
566
+ # containers receive DATABASE_URL too (docs/byo.md), so without provisioning they point at a database that never exists.
567
+ DATABASE_APP_TYPES = ['backend', 'bring-your-own']
568
+
569
+
570
+ def resource_needs_database(manifest):
571
+ """True when a resource of this manifest receives DATABASE_URL and needs its database provisioned."""
572
+ return (manifest or {}).get('appType') in DATABASE_APP_TYPES
573
+
574
+
565
575
  def _has_backend_resource(resource_config, resource_manifests):
566
- """Check if service has a backend resource."""
576
+ """Check if service has a resource that needs the provisioned database (backend or bring-your-own)."""
567
577
  for resource in resource_config.get('resources', []):
568
578
  manifest = resource_manifests.get(resource['name'], {})
569
- if manifest.get('appType') == 'backend':
579
+ if resource_needs_database(manifest):
570
580
  return True
571
581
  return False
572
582
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tdk-landscape/tdk-cli-core",
3
- "version": "1.3.157",
3
+ "version": "1.3.159",
4
4
  "description": "TDK CLI — start services on your machine.",
5
5
  "homepage": "https://tdk-landscape.github.io/tdk-website",
6
6
  "repository": {