@tdk-landscape/tdk-cli-core 1.3.90 ā 1.3.91
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 +9 -0
- package/cli/dist/backend-frameworks/h3.js +38 -0
- package/cli/dist/backend-frameworks/koa.js +48 -0
- package/cli/dist/backend-frameworks/registry.js +4 -0
- package/cli/dist/commands/resource.js +1 -1
- package/cli/package.json +1 -1
- package/engine/schemas/service-schema.json +3 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -70,6 +70,15 @@ curl -fsSL https://tdk-landscape.github.io/install.sh | sh
|
|
|
70
70
|
- [Architecture and repository map](docs/project-overview.md)
|
|
71
71
|
- [Scale fixture measurements and caveats](docs/benchmarks/scale-bench.md)
|
|
72
72
|
|
|
73
|
+
## History
|
|
74
|
+
|
|
75
|
+
TDK is older than this repository and its npm package suggest. Development started on 21 April 2026 in
|
|
76
|
+
[tdk-landscape/tdk](https://github.com/tdk-landscape/tdk), now archived and kept as read-only history; its first commit is
|
|
77
|
+
[`1714637`](https://github.com/tdk-landscape/tdk/commit/1714637637196ed54cbfa18534230a782c05ab36) ("Initial commit: TDK specs,
|
|
78
|
+
generators, CLI, and standards"). This repository, `tdk-cli-core`, was created on 19 September 2026 and is where development
|
|
79
|
+
continues; the `@tdk-landscape/tdk-cli-core` package on npm was first published on 21 September 2026. So the code lineage is about
|
|
80
|
+
five months older than the repository and package dates that you will see on GitHub and npm.
|
|
81
|
+
|
|
73
82
|
## Requirements and support
|
|
74
83
|
|
|
75
84
|
For the local runtime, install Docker (Desktop, OrbStack, or Colima; Engine 25+, Compose 2.20+) and [Tilt](https://docs.tilt.dev/install.html). Bun 1.2+ is used by the default generated services. TDK selects host ports from bounded fallback ranges for HTTP, HTTPS, and Postgres; set `TDK_HTTP_PORT`, `TDK_HTTPS_PORT`, or `TDK_POSTGRES_PORT` to override them. TDK supports macOS, Linux, and Windows through WSL2 Ubuntu; native Windows supports CLI inspection only. Run `tdk doctor` to check local readiness. See [WSL2 setup](docs/wsl2.md).
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export function getH3IndexTemplate(name) {
|
|
2
|
+
return `import { createServer } from 'node:http';
|
|
3
|
+
import { createApp, createRouter, defineEventHandler, toNodeListener } from 'h3';
|
|
4
|
+
|
|
5
|
+
const app = createApp();
|
|
6
|
+
const router = createRouter();
|
|
7
|
+
|
|
8
|
+
// Health check endpoint (required by TILT_RESOURCE_DEFAULTS.star)
|
|
9
|
+
router.get('/health', defineEventHandler(() => ({ status: 'ok', service: '${name}' })));
|
|
10
|
+
|
|
11
|
+
router.get('/health/live', defineEventHandler(() => ({ status: 'alive', timestamp: Date.now() })));
|
|
12
|
+
|
|
13
|
+
router.get('/', defineEventHandler(() => ({
|
|
14
|
+
service: '${name}',
|
|
15
|
+
version: '1.0.0',
|
|
16
|
+
endpoints: ['/health', '/health/live']
|
|
17
|
+
})));
|
|
18
|
+
|
|
19
|
+
app.use(router);
|
|
20
|
+
|
|
21
|
+
const port = Number(process.env.PORT || 3000);
|
|
22
|
+
|
|
23
|
+
// node:http works on Bun. Bind beyond loopback: Traefik reaches the container over the Docker network.
|
|
24
|
+
createServer(toNodeListener(app)).listen(port, '0.0.0.0', () => {
|
|
25
|
+
console.log('\\nš ${name} running on http://localhost:' + port);
|
|
26
|
+
console.log('š Health check: http://localhost:' + port + '/health\\n');
|
|
27
|
+
});
|
|
28
|
+
`;
|
|
29
|
+
}
|
|
30
|
+
export const h3BackendProvider = {
|
|
31
|
+
id: "h3",
|
|
32
|
+
label: "Bun + h3",
|
|
33
|
+
// h3's npm "latest" tag is a 2.0 release candidate; the scaffold stays on the stable 1.x line.
|
|
34
|
+
dependencies: { h3: "^1.15.0" },
|
|
35
|
+
devDependencies: {},
|
|
36
|
+
createIndex: getH3IndexTemplate,
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=h3.js.map
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export function getKoaIndexTemplate(name) {
|
|
2
|
+
return `import Koa from 'koa';
|
|
3
|
+
|
|
4
|
+
const app = new Koa();
|
|
5
|
+
|
|
6
|
+
// Plain Koa middleware, so the scaffold needs no router dependency.
|
|
7
|
+
app.use(async (ctx) => {
|
|
8
|
+
// Health check endpoint (required by TILT_RESOURCE_DEFAULTS.star)
|
|
9
|
+
if (ctx.path === '/health') {
|
|
10
|
+
ctx.body = { status: 'ok', service: '${name}' };
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if (ctx.path === '/health/live') {
|
|
15
|
+
ctx.body = { status: 'alive', timestamp: Date.now() };
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if (ctx.path === '/') {
|
|
20
|
+
ctx.body = {
|
|
21
|
+
service: '${name}',
|
|
22
|
+
version: '1.0.0',
|
|
23
|
+
endpoints: ['/health', '/health/live']
|
|
24
|
+
};
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
ctx.status = 404;
|
|
29
|
+
ctx.body = { error: 'not_found' };
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
const port = Number(process.env.PORT || 3000);
|
|
33
|
+
|
|
34
|
+
// Bind beyond loopback: Traefik reaches the container over the Docker network.
|
|
35
|
+
app.listen(port, '0.0.0.0', () => {
|
|
36
|
+
console.log('\\nš ${name} running on http://localhost:' + port);
|
|
37
|
+
console.log('š Health check: http://localhost:' + port + '/health\\n');
|
|
38
|
+
});
|
|
39
|
+
`;
|
|
40
|
+
}
|
|
41
|
+
export const koaBackendProvider = {
|
|
42
|
+
id: "koa",
|
|
43
|
+
label: "Bun + Koa",
|
|
44
|
+
dependencies: { koa: "^3.0.0" },
|
|
45
|
+
devDependencies: { "@types/koa": "^3.0.0" },
|
|
46
|
+
createIndex: getKoaIndexTemplate,
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=koa.js.map
|
|
@@ -3,6 +3,8 @@ import { TdkError } from "../utils/errors.js";
|
|
|
3
3
|
import { elysiaBackendProvider } from "./elysia.js";
|
|
4
4
|
import { expressBackendProvider } from "./express.js";
|
|
5
5
|
import { fastifyBackendProvider } from "./fastify.js";
|
|
6
|
+
import { h3BackendProvider } from "./h3.js";
|
|
7
|
+
import { koaBackendProvider } from "./koa.js";
|
|
6
8
|
import { nestBackendProvider } from "./nestjs.js";
|
|
7
9
|
/** Hono is the historical default; omitting --framework keeps the exact historical output. */
|
|
8
10
|
export const DEFAULT_BACKEND_FRAMEWORK = "hono";
|
|
@@ -18,6 +20,8 @@ export const BACKEND_FRAMEWORKS = {
|
|
|
18
20
|
express: expressBackendProvider,
|
|
19
21
|
elysia: elysiaBackendProvider,
|
|
20
22
|
fastify: fastifyBackendProvider,
|
|
23
|
+
h3: h3BackendProvider,
|
|
24
|
+
koa: koaBackendProvider,
|
|
21
25
|
nestjs: nestBackendProvider,
|
|
22
26
|
};
|
|
23
27
|
export function getBackendFramework(frameworkId) {
|
|
@@ -297,7 +297,7 @@ export const resourceCommand = new Command("resource")
|
|
|
297
297
|
.description("Create a new resource (service) from scratch, or register an existing one")
|
|
298
298
|
.argument("[name]", "Resource name (kebab-case)")
|
|
299
299
|
.option("-t, --type <type>", "Resource type: backend, frontend, worker, bring-your-own, sdk", "backend")
|
|
300
|
-
.option("--framework <id>", "Framework: frontend react (default), vue, svelte, preact, lit, solid, qwik, vanilla; backend hono (default), express, elysia, fastify, nestjs")
|
|
300
|
+
.option("--framework <id>", "Framework: frontend react (default), vue, svelte, preact, lit, solid, qwik, vanilla; backend hono (default), express, elysia, fastify, nestjs, koa, h3")
|
|
301
301
|
.option("--language <id>", "Backend language: bun (default), python, go, rust")
|
|
302
302
|
.option("-s, --stack <stack>", "Stack to assign resource to", "default")
|
|
303
303
|
.option("-p, --path <path>", "Custom path for resource directory")
|
package/cli/package.json
CHANGED