@decohere/cli 0.0.1-dev.95 → 0.0.1-dev.97

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.
@@ -52,7 +52,7 @@ class RootModule {
52
52
  from: "user"
53
53
  } : undefined);
54
54
  if (this.isBlocking(this.#lastResponse)) {
55
- await new Promise((resolve)=>process.once("SIGINT", resolve));
55
+ await untilStopSignal();
56
56
  }
57
57
  return this.#lastResponse;
58
58
  } catch (error) {
@@ -98,3 +98,17 @@ RootModule = _ts_decorate([
98
98
  typeof Record === "undefined" ? Object : Record
99
99
  ])
100
100
  ], RootModule);
101
+ /**
102
+ * Resolves on Ctrl+C (SIGINT) or SIGTERM (Docker, CI, process managers), so long-running
103
+ * commands like `flux serve` shut down cleanly either way (#520).
104
+ */ function untilStopSignal() {
105
+ return new Promise((resolve)=>{
106
+ const stop = ()=>{
107
+ process.off("SIGINT", stop);
108
+ process.off("SIGTERM", stop);
109
+ resolve();
110
+ };
111
+ process.once("SIGINT", stop);
112
+ process.once("SIGTERM", stop);
113
+ });
114
+ }
@@ -42,7 +42,7 @@ export class RootModule {
42
42
  from: "user"
43
43
  } : undefined);
44
44
  if (this.isBlocking(this.#lastResponse)) {
45
- await new Promise((resolve)=>process.once("SIGINT", resolve));
45
+ await untilStopSignal();
46
46
  }
47
47
  return this.#lastResponse;
48
48
  } catch (error) {
@@ -88,3 +88,17 @@ RootModule = _ts_decorate([
88
88
  typeof Record === "undefined" ? Object : Record
89
89
  ])
90
90
  ], RootModule);
91
+ /**
92
+ * Resolves on Ctrl+C (SIGINT) or SIGTERM (Docker, CI, process managers), so long-running
93
+ * commands like `flux serve` shut down cleanly either way (#520).
94
+ */ function untilStopSignal() {
95
+ return new Promise((resolve)=>{
96
+ const stop = ()=>{
97
+ process.off("SIGINT", stop);
98
+ process.off("SIGTERM", stop);
99
+ resolve();
100
+ };
101
+ process.once("SIGINT", stop);
102
+ process.once("SIGTERM", stop);
103
+ });
104
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decohere/cli",
3
- "version": "0.0.1-dev.95",
3
+ "version": "0.0.1-dev.97",
4
4
  "description": "CLI for the Decohere toolchain — build, serve, publish, and manage TypeScript monorepos",
5
5
  "keywords": [
6
6
  "typescript",
@@ -28,15 +28,15 @@
28
28
  "test": "echo \"Error: no test specified\" && exit 1"
29
29
  },
30
30
  "dependencies": {
31
- "@decohere/create": "0.0.1-dev.95",
32
- "@decohere/crucible": "0.0.1-dev.95",
33
- "@decohere/flux": "0.0.1-dev.95",
34
- "@decohere/forge": "0.0.1-dev.95",
35
- "@decohere/mesh": "0.0.1-dev.95",
36
- "@decohere/nexus": "0.0.1-dev.95",
37
- "@decohere/scaffold": "0.0.1-dev.95",
38
- "@decohere/scribe": "0.0.1-dev.95",
39
- "@decohere/scribe-pino": "0.0.1-dev.95",
31
+ "@decohere/create": "0.0.1-dev.97",
32
+ "@decohere/crucible": "0.0.1-dev.97",
33
+ "@decohere/flux": "0.0.1-dev.97",
34
+ "@decohere/forge": "0.0.1-dev.97",
35
+ "@decohere/mesh": "0.0.1-dev.97",
36
+ "@decohere/nexus": "0.0.1-dev.97",
37
+ "@decohere/scaffold": "0.0.1-dev.97",
38
+ "@decohere/scribe": "0.0.1-dev.97",
39
+ "@decohere/scribe-pino": "0.0.1-dev.97",
40
40
  "commander": "^13.1.0",
41
41
  "pino-pretty": "^13.1.3"
42
42
  },