@tdk-landscape/tdk-cli-core 1.3.92 → 1.3.93
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.
|
@@ -114,6 +114,20 @@ export function createServiceJson(name, type, stack, port, extraFeatures = [], f
|
|
|
114
114
|
...(language ? { language: language.id } : {}),
|
|
115
115
|
};
|
|
116
116
|
}
|
|
117
|
+
export function createByoServiceJson(name, stack, port, options) {
|
|
118
|
+
return {
|
|
119
|
+
$schema: SERVICE_MANIFEST_SCHEMA_URL,
|
|
120
|
+
schemaVersion: SERVICE_MANIFEST_SCHEMA_VERSION,
|
|
121
|
+
appName: name,
|
|
122
|
+
appType: "bring-your-own",
|
|
123
|
+
stack,
|
|
124
|
+
port,
|
|
125
|
+
healthCheckPath: options.healthCheckPath,
|
|
126
|
+
...(options.image ? { image: options.image } : { dockerfile: options.dockerfile }),
|
|
127
|
+
...(options.exposeViaProxy === false ? { exposeViaProxy: false } : {}),
|
|
128
|
+
...(options.restart ? { restart: options.restart } : {}),
|
|
129
|
+
};
|
|
130
|
+
}
|
|
117
131
|
export function createPackageJson(name, type, frameworkId) {
|
|
118
132
|
const isFrontend = type === "frontend";
|
|
119
133
|
const framework = resolveFrontendFramework(type, frameworkId);
|
|
@@ -534,18 +548,13 @@ export const resourceCommand = new Command("resource")
|
|
|
534
548
|
}
|
|
535
549
|
mkdirSync(fullPath, { recursive: true });
|
|
536
550
|
// Create service.json
|
|
537
|
-
const byoServiceJson = {
|
|
538
|
-
$schema: SERVICE_MANIFEST_SCHEMA_URL,
|
|
539
|
-
schemaVersion: SERVICE_MANIFEST_SCHEMA_VERSION,
|
|
540
|
-
appName: resourceName,
|
|
541
|
-
appType: "bring-your-own",
|
|
542
|
-
stack: stackName,
|
|
543
|
-
port,
|
|
551
|
+
const byoServiceJson = createByoServiceJson(resourceName, stackName, port, {
|
|
544
552
|
healthCheckPath: options.healthPath || "/health",
|
|
545
|
-
|
|
553
|
+
dockerfile,
|
|
554
|
+
...(options.image ? { image: options.image } : {}),
|
|
546
555
|
...(options.proxy === false ? { exposeViaProxy: false } : {}),
|
|
547
556
|
...(options.restart ? { restart: options.restart } : {}),
|
|
548
|
-
};
|
|
557
|
+
});
|
|
549
558
|
const { writeFileSync } = await import("node:fs");
|
|
550
559
|
writeFileSync(resolve(fullPath, "service.json"), JSON.stringify(byoServiceJson, null, 2));
|
|
551
560
|
// Create Dockerfile stub if no image provided and dockerfile doesn't exist
|
package/cli/dist/types/index.js
CHANGED
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.
|
|
4
|
+
"version": "1.3.93",
|
|
5
5
|
"description": "TDK CLI — start services on your laptop.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"tdk",
|
|
@@ -61,6 +61,7 @@
|
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@biomejs/biome": "^2.5.13",
|
|
64
|
+
"ajv": "^8.17.1",
|
|
64
65
|
"@types/react": "^19.3.0",
|
|
65
66
|
"@types/node": "^22.0.0",
|
|
66
67
|
"knip": "^6.38.0",
|
|
@@ -9,7 +9,10 @@
|
|
|
9
9
|
"appType": {
|
|
10
10
|
"const": "backend"
|
|
11
11
|
}
|
|
12
|
-
}
|
|
12
|
+
},
|
|
13
|
+
"required": [
|
|
14
|
+
"appType"
|
|
15
|
+
]
|
|
13
16
|
},
|
|
14
17
|
"then": {
|
|
15
18
|
"properties": {
|
|
@@ -29,7 +32,10 @@
|
|
|
29
32
|
"appType": {
|
|
30
33
|
"const": "frontend"
|
|
31
34
|
}
|
|
32
|
-
}
|
|
35
|
+
},
|
|
36
|
+
"required": [
|
|
37
|
+
"appType"
|
|
38
|
+
]
|
|
33
39
|
},
|
|
34
40
|
"then": {
|
|
35
41
|
"properties": {
|
|
@@ -46,7 +52,10 @@
|
|
|
46
52
|
"appType": {
|
|
47
53
|
"const": "worker"
|
|
48
54
|
}
|
|
49
|
-
}
|
|
55
|
+
},
|
|
56
|
+
"required": [
|
|
57
|
+
"appType"
|
|
58
|
+
]
|
|
50
59
|
},
|
|
51
60
|
"then": {
|
|
52
61
|
"properties": {
|
|
@@ -67,7 +76,10 @@
|
|
|
67
76
|
"appType": {
|
|
68
77
|
"const": "bring-your-own"
|
|
69
78
|
}
|
|
70
|
-
}
|
|
79
|
+
},
|
|
80
|
+
"required": [
|
|
81
|
+
"appType"
|
|
82
|
+
]
|
|
71
83
|
},
|
|
72
84
|
"then": {
|
|
73
85
|
"properties": {
|
|
@@ -207,7 +219,7 @@
|
|
|
207
219
|
"type": "object"
|
|
208
220
|
},
|
|
209
221
|
"featuresEnabled": {
|
|
210
|
-
"description": "Platform features:\n• nats - NATS JetStream eventing\n• prisma - DB ORM & migrations\n• redis - Caching layer\n• infisical - Secrets management\n• vitest - Test framework\n• traefik - Reverse proxy routing\n• websocket - WS support\n• graphql - GraphQL server\n• grpc - gRPC protocol",
|
|
222
|
+
"description": "Platform features:\n• nats - NATS JetStream eventing\n• prisma - DB ORM & migrations\n• redis - Caching layer\n• infisical - Secrets management\n• vitest - Test framework\n• traefik - Reverse proxy routing\n• websocket - WS support\n• graphql - GraphQL server\n• grpc - gRPC protocol\n• vite, tsconfig, dockerfile, nginx, ... - generator features that `tdk resource` writes into new files",
|
|
211
223
|
"items": {
|
|
212
224
|
"enum": [
|
|
213
225
|
"nats",
|
|
@@ -218,7 +230,21 @@
|
|
|
218
230
|
"traefik",
|
|
219
231
|
"websocket",
|
|
220
232
|
"graphql",
|
|
221
|
-
"grpc"
|
|
233
|
+
"grpc",
|
|
234
|
+
"api-client",
|
|
235
|
+
"env-config",
|
|
236
|
+
"api-index",
|
|
237
|
+
"vite",
|
|
238
|
+
"tsconfig",
|
|
239
|
+
"dockerfile",
|
|
240
|
+
"npmrc",
|
|
241
|
+
"bunfig",
|
|
242
|
+
"nginx",
|
|
243
|
+
"env",
|
|
244
|
+
"playwright",
|
|
245
|
+
"agents-md",
|
|
246
|
+
"ddd",
|
|
247
|
+
"sablier"
|
|
222
248
|
],
|
|
223
249
|
"type": "string"
|
|
224
250
|
},
|
|
@@ -227,13 +253,21 @@
|
|
|
227
253
|
},
|
|
228
254
|
"framework": {
|
|
229
255
|
"description": "Framework provider id. For frontend resources it selects the Vite and TypeScript config (omitted means react, legacy manifests). For backend resources it selects the HTTP framework on the Bun runtime (omitted means hono; not used with a language that owns its runtime, such as python). Valid ids come from the CLI provider registries, which reject unknown ids before writing a resource.",
|
|
230
|
-
"examples": [
|
|
256
|
+
"examples": [
|
|
257
|
+
"react",
|
|
258
|
+
"vue",
|
|
259
|
+
"solid"
|
|
260
|
+
],
|
|
231
261
|
"pattern": "^[a-z][a-z0-9-]*$",
|
|
232
262
|
"type": "string"
|
|
233
263
|
},
|
|
234
264
|
"language": {
|
|
235
265
|
"description": "Backend language provider id used to scaffold and run the service. Only meaningful for backend resources; omitted means bun (legacy manifests). Valid ids come from the CLI provider registry.",
|
|
236
|
-
"examples": [
|
|
266
|
+
"examples": [
|
|
267
|
+
"bun",
|
|
268
|
+
"python",
|
|
269
|
+
"go"
|
|
270
|
+
],
|
|
237
271
|
"pattern": "^[a-z][a-z0-9-]*$",
|
|
238
272
|
"type": "string"
|
|
239
273
|
},
|
|
@@ -370,11 +404,13 @@
|
|
|
370
404
|
"additionalProperties": false,
|
|
371
405
|
"properties": {
|
|
372
406
|
"name": {
|
|
373
|
-
"type": "string"
|
|
407
|
+
"type": "string",
|
|
408
|
+
"description": "Optional display name for this check."
|
|
374
409
|
},
|
|
375
410
|
"method": {
|
|
376
411
|
"type": "string",
|
|
377
|
-
"default": "GET"
|
|
412
|
+
"default": "GET",
|
|
413
|
+
"description": "HTTP method. Defaults to GET."
|
|
378
414
|
},
|
|
379
415
|
"path": {
|
|
380
416
|
"type": "string",
|
|
@@ -388,10 +424,12 @@
|
|
|
388
424
|
"type": "integer",
|
|
389
425
|
"minimum": 100,
|
|
390
426
|
"maximum": 599,
|
|
391
|
-
"default": 200
|
|
427
|
+
"default": 200,
|
|
428
|
+
"description": "Expected HTTP status code, from 100 through 599."
|
|
392
429
|
},
|
|
393
430
|
"bodyContains": {
|
|
394
|
-
"type": "string"
|
|
431
|
+
"type": "string",
|
|
432
|
+
"description": "Optional text that must occur in the response body."
|
|
395
433
|
},
|
|
396
434
|
"save": {
|
|
397
435
|
"type": "object",
|
|
@@ -402,7 +440,8 @@
|
|
|
402
440
|
"description": "Saves response fields for later steps, for example {\"id\": \"$.id\"}."
|
|
403
441
|
}
|
|
404
442
|
}
|
|
405
|
-
}
|
|
443
|
+
},
|
|
444
|
+
"description": "Non-empty ordered list of HTTP checks to run after the resource starts."
|
|
406
445
|
}
|
|
407
446
|
}
|
|
408
447
|
},
|
|
@@ -423,14 +462,47 @@
|
|
|
423
462
|
}
|
|
424
463
|
},
|
|
425
464
|
"type": "object"
|
|
465
|
+
},
|
|
466
|
+
"type": {
|
|
467
|
+
"description": "Legacy alias for appType, still read from older service.json files. Use appType in new files.",
|
|
468
|
+
"enum": [
|
|
469
|
+
"backend",
|
|
470
|
+
"frontend",
|
|
471
|
+
"sdk",
|
|
472
|
+
"worker",
|
|
473
|
+
"migrator",
|
|
474
|
+
"library",
|
|
475
|
+
"mcp",
|
|
476
|
+
"bring-your-own"
|
|
477
|
+
],
|
|
478
|
+
"type": "string"
|
|
479
|
+
},
|
|
480
|
+
"enabled": {
|
|
481
|
+
"description": "Whether this resource is enabled in its project configuration.",
|
|
482
|
+
"type": "boolean"
|
|
483
|
+
},
|
|
484
|
+
"apiPath": {
|
|
485
|
+
"description": "API path exposed by this resource, when applicable.",
|
|
486
|
+
"type": "string"
|
|
426
487
|
}
|
|
427
488
|
},
|
|
428
489
|
"required": [
|
|
429
490
|
"appName",
|
|
430
|
-
"appType",
|
|
431
491
|
"stack",
|
|
432
492
|
"schemaVersion"
|
|
433
493
|
],
|
|
434
494
|
"title": "TDK Landscape Resource Configuration",
|
|
435
|
-
"type": "object"
|
|
495
|
+
"type": "object",
|
|
496
|
+
"anyOf": [
|
|
497
|
+
{
|
|
498
|
+
"required": [
|
|
499
|
+
"appType"
|
|
500
|
+
]
|
|
501
|
+
},
|
|
502
|
+
{
|
|
503
|
+
"required": [
|
|
504
|
+
"type"
|
|
505
|
+
]
|
|
506
|
+
}
|
|
507
|
+
]
|
|
436
508
|
}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import sys
|
|
4
4
|
import json
|
|
5
5
|
import yaml
|
|
6
|
-
import datetime
|
|
7
6
|
import uuid
|
|
8
7
|
|
|
9
8
|
if len(sys.argv) < 2:
|
|
@@ -19,8 +18,10 @@ try:
|
|
|
19
18
|
# not be copied into it (the JWT secret belongs in the project .env; `tdk doctor` warns about it).
|
|
20
19
|
data = {key: value for key, value in data.items() if key not in ("jwtSecret",)}
|
|
21
20
|
|
|
22
|
-
|
|
23
|
-
uid
|
|
21
|
+
# Deterministic: the mirror is regenerated on every run, so a wall-clock time or random uid would change the file each time.
|
|
22
|
+
# The uid is derived from the content, and the timestamp is a fixed epoch (nothing reads it).
|
|
23
|
+
now = "1970-01-01T00:00:00Z"
|
|
24
|
+
uid = str(uuid.uuid5(uuid.NAMESPACE_URL, json.dumps(data, sort_keys=True)))
|
|
24
25
|
|
|
25
26
|
# Match exact Tilt get uiresources format
|
|
26
27
|
tilt_resource = {
|