@travetto/cli 7.1.2 → 7.1.3

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/bin/trv.js CHANGED
@@ -2,4 +2,4 @@
2
2
  // @ts-check
3
3
  import '@travetto/compiler/bin/hook.js';
4
4
  const { invoke } = await import('@travetto/compiler/support/invoke.ts');
5
- await invoke('exec', ['@travetto/cli/support/entry.trv.js', ...process.argv.slice(2)]);
5
+ await invoke('exec', ['@travetto/cli/support/entry.trv.ts', ...process.argv.slice(2)]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/cli",
3
- "version": "7.1.2",
3
+ "version": "7.1.3",
4
4
  "type": "module",
5
5
  "description": "CLI infrastructure for Travetto framework",
6
6
  "keywords": [
@@ -29,8 +29,8 @@
29
29
  "directory": "module/cli"
30
30
  },
31
31
  "dependencies": {
32
- "@travetto/schema": "^7.1.2",
33
- "@travetto/terminal": "^7.1.2"
32
+ "@travetto/schema": "^7.1.3",
33
+ "@travetto/terminal": "^7.1.3"
34
34
  },
35
35
  "travetto": {
36
36
  "displayName": "Command Line Interface",
package/src/util.ts CHANGED
@@ -40,15 +40,17 @@ export class CliUtil {
40
40
  ShutdownManager.disableInterrupt();
41
41
 
42
42
  let child: ChildProcess | undefined;
43
- void WatchUtil.watchCompilerEvents('file', () => ShutdownManager.shutdownChild(child!, { signal: 'SIGTERM', reason: 'restart', exit: true }));
44
- process.on('SIGINT', () => ShutdownManager.shutdownChild(child!, { signal: 'SIGTERM', reason: 'quit', exit: true }));
43
+ void WatchUtil.watchCompilerEvents('file', () => ShutdownManager.shutdownChild(child!, { reason: 'restart', mode: 'exit' }));
44
+ process
45
+ .on('SIGINT', () => ShutdownManager.shutdownChild(child!, { mode: 'exit' }))
46
+ .on('message', msg => child?.send?.(msg!));
45
47
 
46
48
  const env = { ...process.env, ...Env.TRV_RESTART_TARGET.export(true) };
47
49
 
48
50
  await WatchUtil.runWithRetry(
49
51
  async () => {
50
52
  child = spawn(process.argv0, process.argv.slice(1), { env, stdio: ['pipe', 1, 2, 'ipc'] });
51
- const { code } = await ExecUtil.deferToSubprocess(child);
53
+ const { code } = await ExecUtil.getResult(child, { catch: true });
52
54
  return ShutdownManager.reasonForExitCode(code);
53
55
  },
54
56
  {
@@ -64,7 +66,7 @@ export class CliUtil {
64
66
  }
65
67
  );
66
68
 
67
- await ShutdownManager.shutdown({ reason: 'quit', exit: true });
69
+ await ShutdownManager.shutdown({ mode: 'exit' });
68
70
  }
69
71
 
70
72
  /**