@mesh-tech/mesh-cli 0.40.13 → 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.
@@ -1,4 +1,4 @@
1
1
  {
2
- "commit": "0d0f3b5db",
3
- "builtAt": "2026-10-26T13:36:56.845Z"
2
+ "commit": "e6b9e3bce",
3
+ "builtAt": "2026-10-27T06:37:07.474Z"
4
4
  }
@@ -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
- serve({ fetch: app.fetch, port: PORT, hostname: "0.0.0.0" }, (info) => {
93
- log.info({ port: info.port }, "{{titleCase name}} API listening");
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.13",
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.51.0",
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
- serve({ fetch: app.fetch, port: PORT }, () => {
113
- log.info({ port: PORT, issuer: ZITADEL_ISSUER }, "{{name}} api listening");
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(serve({ fetch: createApp().fetch, port }));
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
- serve({ fetch: app.fetch, port }, () => {
92
- log.info({ port }, "{{titleCase name}} API listening");
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
- serve({ fetch: app.fetch, port: PORT, hostname: "0.0.0.0" }, () => {
136
- log.info({ port: PORT }, "{{titleCase name}} API listening");
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");