@travetto/compiler 4.0.1 → 4.0.2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/compiler",
3
- "version": "4.0.1",
3
+ "version": "4.0.2",
4
4
  "description": "The compiler infrastructure for the Travetto framework",
5
5
  "keywords": [
6
6
  "compiler",
@@ -36,7 +36,7 @@
36
36
  "@types/node": "^20.11.16"
37
37
  },
38
38
  "peerDependencies": {
39
- "@travetto/cli": "^4.0.1"
39
+ "@travetto/cli": "^4.0.3"
40
40
  },
41
41
  "peerDependenciesMeta": {
42
42
  "@travetto/cli": {
@@ -1,6 +1,6 @@
1
1
  import rl from 'node:readline/promises';
2
2
  import timers from 'node:timers/promises';
3
- import { Readable } from 'node:stream';
3
+ import http, { Agent } from 'node:http';
4
4
 
5
5
  import { ManifestContext } from '@travetto/manifest';
6
6
 
@@ -110,9 +110,18 @@ export class CompilerClient {
110
110
  const quit = (): void => ctrl.abort();
111
111
  try {
112
112
  signal.addEventListener('abort', quit);
113
- const stream = await this.#fetch(`/event/${type}`, { signal: ctrl.signal, keepalive: true });
114
-
115
- for await (const line of rl.createInterface(Readable.fromWeb(stream.body!))) {
113
+ const res = await new Promise<http.IncomingMessage>(resolve => {
114
+ http.get(`${this.#url}/event/${type}`, {
115
+ agent: new Agent({
116
+ keepAlive: true,
117
+ keepAliveMsecs: 10000,
118
+ timeout: 1000 * 60 * 60 * 24
119
+ }),
120
+ signal: ctrl.signal
121
+ }, res => resolve(res))
122
+ });
123
+
124
+ for await (const line of rl.createInterface(res)) {
116
125
  if (line.trim().charAt(0) === '{') {
117
126
  const val = JSON.parse(line);
118
127
  if (cfg.until?.(val)) {