@tdk-landscape/tdk-cli-core 1.3.103 → 1.3.104

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/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/@tdk-landscape/tdk-cli-core.svg?style=flat&color=blue)](https://www.npmjs.com/package/@tdk-landscape/tdk-cli-core)
4
4
  [![unpacked size](https://img.shields.io/npm/unpacked-size/@tdk-landscape/tdk-cli-core)](https://packagephobia.com/result?p=@tdk-landscape/tdk-cli-core)
5
- [![install size](https://packagephobia.com/badge?p=@tdk-landscape/tdk-cli-core@1.3.81)](https://packagephobia.com/result?p=@tdk-landscape/tdk-cli-core@1.3.81)
5
+ [![install size](https://packagephobia.com/badge?p=@tdk-landscape/tdk-cli-core)](https://packagephobia.com/result?p=@tdk-landscape/tdk-cli-core)
6
6
  [![CI](https://github.com/tdk-landscape/tdk-cli-core/actions/workflows/ci.yml/badge.svg)](https://github.com/tdk-landscape/tdk-cli-core/actions/workflows/ci.yml)
7
7
  [![Quickstart E2E](https://github.com/tdk-landscape/tdk-cli-core/actions/workflows/quickstart-e2e.yml/badge.svg)](https://github.com/tdk-landscape/tdk-cli-core/actions/workflows/quickstart-e2e.yml)
8
8
  [![ERP fixture scale E2E](https://github.com/tdk-landscape/tdk-cli-core/actions/workflows/erp-scale-e2e.yml/badge.svg)](https://github.com/tdk-landscape/tdk-cli-core/actions/workflows/erp-scale-e2e.yml)
@@ -19,6 +19,7 @@ const KNOWN_SERVICE_FIELDS = new Set([
19
19
  "backendName",
20
20
  "basePath",
21
21
  "build",
22
+ "buildContext",
22
23
  "databaseName",
23
24
  "dependencies",
24
25
  "dev",
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.103",
4
+ "version": "1.3.104",
5
5
  "description": "TDK CLI — start services on your laptop.",
6
6
  "keywords": [
7
7
  "tdk",
@@ -233,7 +233,12 @@ def _apply_manifest_defaults(manifest, resource_path):
233
233
  # Validate custom dockerfile exists if specified
234
234
  if 'dockerfile' in result:
235
235
  custom_dockerfile = result['dockerfile']
236
- dockerfile_path = resource_path + '/' + custom_dockerfile
236
+ # With a bring-your-own buildContext the dockerfile is relative to that context.
237
+ build_context = result.get('buildContext')
238
+ if build_context and build_context != '.':
239
+ dockerfile_path = resource_path + '/' + build_context + '/' + custom_dockerfile
240
+ else:
241
+ dockerfile_path = resource_path + '/' + custom_dockerfile
237
242
  # BUG FIX: Run check from project root since Tilt may run from .tdk/.tdk-out/
238
243
  project_root = os.environ.get('TDK_PROJECT_ROOT', '')
239
244
  if project_root:
@@ -162,6 +162,10 @@
162
162
  "description": "Custom Dockerfile path relative to resource directory. Optional for bring-your-own type.",
163
163
  "type": "string"
164
164
  },
165
+ "buildContext": {
166
+ "description": "Docker build context for a bring-your-own resource, relative to the resource directory. Defaults to the resource directory. When set, dockerfile is relative to this context.",
167
+ "type": "string"
168
+ },
165
169
  "exposeViaProxy": {
166
170
  "description": "Whether this bring-your-own resource receives a Traefik route. Defaults to true.",
167
171
  "type": "boolean"
@@ -207,6 +207,12 @@ def _generate_single_backend_entry(resource_path, resource_name, res, manifest,
207
207
  # context instead of the project root used by generated TDK apps.
208
208
  context_prefix = '/'.join(['..'] * (len(resource_path.split('/')) + 1))
209
209
  build_context = context_prefix + '/' + full_resource_path
210
+ # `buildContext` (relative to the service directory) moves the context
211
+ # to the source tree an imported Dockerfile lives in; `dockerfile` is then
212
+ # relative to that context, as in Compose.
213
+ custom_context = manifest.get('buildContext')
214
+ if custom_context and custom_context != '.':
215
+ build_context = build_context + '/' + custom_context
210
216
  dockerfile = manifest.get('dockerfile', 'Dockerfile')
211
217
  if dockerfile.startswith('./'):
212
218
  dockerfile = dockerfile[2:]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tdk-landscape/tdk-cli-core",
3
- "version": "1.3.103",
3
+ "version": "1.3.104",
4
4
  "description": "TDK CLI — start services on your laptop.",
5
5
  "homepage": "https://tdk-landscape.github.io/tdk-website",
6
6
  "repository": {