@travetto/cli 7.1.2 → 7.1.4

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.4",
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.4",
33
+ "@travetto/terminal": "^7.1.4"
34
34
  },
35
35
  "travetto": {
36
36
  "displayName": "Command Line Interface",
package/src/error.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { AppError, Runtime } from '@travetto/runtime';
2
- import { PackageUtil } from '@travetto/manifest';
3
2
 
4
3
  import { cliTpl } from './color.ts';
5
4
  import type { CliValidationError, CliCommandShape } from './types.ts';
@@ -24,7 +23,7 @@ export class CliUnknownCommandError extends Error {
24
23
  const matchedConfig = COMMAND_PACKAGE.find(([regex]) => regex.test(cmd));
25
24
  if (matchedConfig) {
26
25
  const [, pkg, production] = matchedConfig;
27
- const install = PackageUtil.getInstallCommand(Runtime, `@travetto/${pkg}`, production);
26
+ const install = Runtime.getInstallCommand(`@travetto/${pkg}`, production);
28
27
  return cliTpl`
29
28
  ${{ title: 'Missing Package' }}\n${'-'.repeat(20)}\nTo use ${{ input: cmd }} please run:\n
30
29
  ${{ identifier: install }}
package/src/scm.ts CHANGED
@@ -48,7 +48,6 @@ export class CliScmUtil {
48
48
  */
49
49
  static async findChangedFiles(fromHash: string, toHash: string = 'HEAD'): Promise<string[]> {
50
50
  const rootPath = Runtime.workspace.path;
51
- console.log(`Detecting changes between ${fromHash} and ${toHash}...`);
52
51
  const result = await ExecUtil.getResult(spawn('git', ['diff', '--name-only', `${fromHash}..${toHash}`, ':!**/DOC.*', ':!**/README.*'], { cwd: rootPath }), { catch: true });
53
52
  if (!result.valid) {
54
53
  throw new AppError('Unable to detect changes between', { category: 'data', details: { fromHash, toHash, output: (result.stderr || result.stdout) } });
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
  /**