@mesh-tech/mesh-cli 0.40.12 → 0.40.14
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/dist/build-info.json +2 -2
- package/fragments/base/index.ts.hbs +2 -0
- package/fragments/service/api/src/index.ts.hbs +8 -5
- package/package.json +2 -2
- package/templates/api-auth/api/src/index.ts.hbs +8 -5
- package/templates/api-role-gating/api/src/main.ts.hbs +6 -1
- package/templates/external-service/api/src/index.ts.hbs +8 -5
- package/templates/workflow/api/src/index.ts.hbs +8 -5
package/dist/build-info.json
CHANGED
|
@@ -95,6 +95,8 @@ const env = new mesh.apps.AppEnvironment("env", {
|
|
|
95
95
|
// =============================================================================
|
|
96
96
|
{{#if database}}
|
|
97
97
|
|
|
98
|
+
// Its password reaches the pods through the namespace's own secret store
|
|
99
|
+
// (`mesh-secrets`), which can read this app's secrets and no other app's.
|
|
98
100
|
const db = new mesh.apps.Database("db", { env });
|
|
99
101
|
{{/if}}
|
|
100
102
|
{{#if bucket}}
|
|
@@ -83,13 +83,16 @@ app.post("/things", async (c) => {
|
|
|
83
83
|
|
|
84
84
|
{{/if}}
|
|
85
85
|
// Start server
|
|
86
|
+
const server = serve({ fetch: app.fetch, port: PORT, hostname: "0.0.0.0" }, (info) => {
|
|
87
|
+
log.info({ port: info.port }, "{{titleCase name}} API listening");
|
|
88
|
+
});
|
|
86
89
|
// Hold idle keep-alive sockets for 75s rather than Node's 5s default. The
|
|
87
90
|
// proxy in front of this service pools connections to it and keeps them idle
|
|
88
91
|
// longer than 5s (the Istio gateway's Envoy, through ztunnel, or an ALB for
|
|
89
92
|
// 60s), so at the default the server keeps closing sockets the pool may be
|
|
90
93
|
// about to reuse.
|
|
91
|
-
configureServerKeepAlive(
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
);
|
|
94
|
+
configureServerKeepAlive(server);
|
|
95
|
+
// The deployed image runs node as PID 1, where SIGTERM has no default action:
|
|
96
|
+
// without this listener a pod Kubernetes stops runs on until SIGKILL. Stop
|
|
97
|
+
// taking connections, let in-flight requests finish, then exit.
|
|
98
|
+
process.on("SIGTERM", () => server.close(() => process.exit(0)));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mesh-tech/mesh-cli",
|
|
3
|
-
"version": "0.40.
|
|
3
|
+
"version": "0.40.14",
|
|
4
4
|
"description": "CLI for Mesh platform development utilities",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@mesh-tech/agent-contracts": "0.7.0",
|
|
45
|
-
"@mesh-tech/tsconfig": "2.
|
|
45
|
+
"@mesh-tech/tsconfig": "2.51.3",
|
|
46
46
|
"@mesh-tech/workflow-viz": "0.3.2",
|
|
47
47
|
"@tanstack/intent": "^0.3.6",
|
|
48
48
|
"@types/node": "^20.0.0",
|
|
@@ -103,13 +103,16 @@ app.get("/api/report", m.require("report", "view", { id: () => "quarterly" }), (
|
|
|
103
103
|
c.json({ id: "quarterly", title: "Quarterly Report", classification: "internal" }),
|
|
104
104
|
);
|
|
105
105
|
|
|
106
|
+
const server = serve({ fetch: app.fetch, port: PORT }, () => {
|
|
107
|
+
log.info({ port: PORT, issuer: ZITADEL_ISSUER }, "{{name}} api listening");
|
|
108
|
+
});
|
|
106
109
|
// Hold idle keep-alive sockets for 75s rather than Node's 5s default. The
|
|
107
110
|
// proxy in front of this service pools connections to it and keeps them idle
|
|
108
111
|
// longer than 5s (the Istio gateway's Envoy, through ztunnel, or an ALB for
|
|
109
112
|
// 60s), so at the default the server keeps closing sockets the pool may be
|
|
110
113
|
// about to reuse.
|
|
111
|
-
configureServerKeepAlive(
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
);
|
|
114
|
+
configureServerKeepAlive(server);
|
|
115
|
+
// The deployed image runs node as PID 1, where SIGTERM has no default action:
|
|
116
|
+
// without this listener a pod Kubernetes stops runs on until SIGKILL. Stop
|
|
117
|
+
// taking connections, let in-flight requests finish, then exit.
|
|
118
|
+
process.on("SIGTERM", () => server.close(() => process.exit(0)));
|
|
@@ -59,11 +59,16 @@ export const createApp = (deps: { testAuth?: TestAuth } = {}) => {
|
|
|
59
59
|
|
|
60
60
|
if (process.env.NODE_ENV !== "test" && process.argv[1]?.endsWith("main.js")) {
|
|
61
61
|
const port = Number(process.env.PORT ?? 3000);
|
|
62
|
+
const server = serve({ fetch: createApp().fetch, port });
|
|
62
63
|
// Hold idle keep-alive sockets for 75s rather than Node's 5s default. The
|
|
63
64
|
// proxy in front of this service pools connections to it and keeps them idle
|
|
64
65
|
// longer than 5s (the Istio gateway's Envoy, through ztunnel, or an ALB for
|
|
65
66
|
// 60s), so at the default the server keeps closing sockets the pool may be
|
|
66
67
|
// about to reuse.
|
|
67
|
-
configureServerKeepAlive(
|
|
68
|
+
configureServerKeepAlive(server);
|
|
69
|
+
// The deployed image runs node as PID 1, where SIGTERM has no default action:
|
|
70
|
+
// without this listener a pod Kubernetes stops runs on until SIGKILL. Stop
|
|
71
|
+
// taking connections, let in-flight requests finish, then exit.
|
|
72
|
+
process.on("SIGTERM", () => server.close(() => process.exit(0)));
|
|
68
73
|
log.info({ port, mode: "role-gating" }, "{{name}} api listening");
|
|
69
74
|
}
|
|
@@ -82,13 +82,16 @@ app.post("/payments/quote", async (c) => {
|
|
|
82
82
|
});
|
|
83
83
|
|
|
84
84
|
const port = Number(process.env.PORT ?? 3000);
|
|
85
|
+
const server = serve({ fetch: app.fetch, port }, () => {
|
|
86
|
+
log.info({ port }, "{{titleCase name}} API listening");
|
|
87
|
+
});
|
|
85
88
|
// Hold idle keep-alive sockets for 75s rather than Node's 5s default. The
|
|
86
89
|
// proxy in front of this service pools connections to it and keeps them idle
|
|
87
90
|
// longer than 5s (the Istio gateway's Envoy, through ztunnel, or an ALB for
|
|
88
91
|
// 60s), so at the default the server keeps closing sockets the pool may be
|
|
89
92
|
// about to reuse.
|
|
90
|
-
configureServerKeepAlive(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
);
|
|
93
|
+
configureServerKeepAlive(server);
|
|
94
|
+
// The deployed image runs node as PID 1, where SIGTERM has no default action:
|
|
95
|
+
// without this listener a pod Kubernetes stops runs on until SIGKILL. Stop
|
|
96
|
+
// taking connections, let in-flight requests finish, then exit.
|
|
97
|
+
process.on("SIGTERM", () => server.close(() => process.exit(0)));
|
|
@@ -126,16 +126,19 @@ app.get("/workflows/:id", async (c) => {
|
|
|
126
126
|
// Start server
|
|
127
127
|
initClient()
|
|
128
128
|
.then(() => {
|
|
129
|
+
const server = serve({ fetch: app.fetch, port: PORT, hostname: "0.0.0.0" }, () => {
|
|
130
|
+
log.info({ port: PORT }, "{{titleCase name}} API listening");
|
|
131
|
+
});
|
|
129
132
|
// Hold idle keep-alive sockets for 75s rather than Node's 5s default. The
|
|
130
133
|
// proxy in front of this service pools connections to it and keeps them idle
|
|
131
134
|
// longer than 5s (the Istio gateway's Envoy, through ztunnel, or an ALB for
|
|
132
135
|
// 60s), so at the default the server keeps closing sockets the pool may be
|
|
133
136
|
// about to reuse.
|
|
134
|
-
configureServerKeepAlive(
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
);
|
|
137
|
+
configureServerKeepAlive(server);
|
|
138
|
+
// The deployed image runs node as PID 1, where SIGTERM has no default action:
|
|
139
|
+
// without this listener a pod Kubernetes stops runs on until SIGKILL. Stop
|
|
140
|
+
// taking connections, let in-flight requests finish, then exit.
|
|
141
|
+
process.on("SIGTERM", () => server.close(() => process.exit(0)));
|
|
139
142
|
})
|
|
140
143
|
.catch((err) => {
|
|
141
144
|
log.error({ err }, "Failed to initialize");
|