@travetto/compiler 3.4.0-rc.3 → 3.4.0-rc.5
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/package.json +2 -2
- package/support/server/server.ts +12 -8
- package/support/types.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/compiler",
|
|
3
|
-
"version": "3.4.0-rc.
|
|
3
|
+
"version": "3.4.0-rc.5",
|
|
4
4
|
"description": "The compiler infrastructure for the Travetto framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"compiler",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@types/node": "^20.8.10"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@travetto/cli": "^3.4.0-rc.
|
|
40
|
+
"@travetto/cli": "^3.4.0-rc.7"
|
|
41
41
|
},
|
|
42
42
|
"peerDependenciesMeta": {
|
|
43
43
|
"@travetto/cli": {
|
package/support/server/server.ts
CHANGED
|
@@ -22,7 +22,7 @@ export class CompilerServer {
|
|
|
22
22
|
req.on('data', (chunk) => body.push(typeof chunk === 'string' ? Buffer.from(chunk) : chunk));
|
|
23
23
|
req.on('end', () => {
|
|
24
24
|
try {
|
|
25
|
-
res(JSON.parse(Buffer.concat(body).toString('utf8')))
|
|
25
|
+
res(JSON.parse(Buffer.concat(body).toString('utf8')));
|
|
26
26
|
} catch (err) {
|
|
27
27
|
rej(err);
|
|
28
28
|
}
|
|
@@ -180,23 +180,27 @@ export class CompilerServer {
|
|
|
180
180
|
}
|
|
181
181
|
|
|
182
182
|
// Terminate, after letting all remaining events emit
|
|
183
|
-
|
|
183
|
+
await this.close();
|
|
184
184
|
}
|
|
185
185
|
|
|
186
186
|
/**
|
|
187
187
|
* Close server
|
|
188
188
|
*/
|
|
189
189
|
async close(): Promise<unknown> {
|
|
190
|
+
if (this.signal.aborted) {
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
|
|
190
194
|
log('info', 'Closing down server');
|
|
191
|
-
|
|
192
|
-
this.#
|
|
195
|
+
await new Promise(r => {
|
|
196
|
+
this.#server.close(r);
|
|
193
197
|
this.#emitEvent({ type: 'state', payload: { state: 'close' } });
|
|
194
198
|
this.#server.unref();
|
|
195
|
-
|
|
196
|
-
this.#server.
|
|
197
|
-
|
|
199
|
+
setImmediate(() => {
|
|
200
|
+
this.#server.closeAllConnections();
|
|
201
|
+
this.#shutdown.abort();
|
|
198
202
|
});
|
|
199
|
-
}
|
|
203
|
+
});
|
|
200
204
|
return { closing: true };
|
|
201
205
|
}
|
|
202
206
|
|