@travetto/cli 8.0.0-alpha.5 → 8.0.0-alpha.7

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/cli",
3
- "version": "8.0.0-alpha.5",
3
+ "version": "8.0.0-alpha.7",
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": "^8.0.0-alpha.3",
33
- "@travetto/terminal": "^8.0.0-alpha.3"
32
+ "@travetto/schema": "^8.0.0-alpha.4",
33
+ "@travetto/terminal": "^8.0.0-alpha.4"
34
34
  },
35
35
  "travetto": {
36
36
  "displayName": "Command Line Interface",
package/src/help.ts CHANGED
@@ -175,13 +175,13 @@ ${{ identifier: install }}
175
175
  process.exitCode ??= 1;
176
176
  if (error instanceof ValidationResultError) {
177
177
  console.error!(this.renderValidationError(error));
178
+ } else if (Error.isError(error)) {
179
+ console.error!(cliTpl`${{ failure: error.stack }}\n`);
178
180
  }
179
181
  if (command) {
180
182
  console.error!(await this.renderCommandHelp(command));
181
183
  } else if (error === UNKNOWN_COMMAND) {
182
184
  console.error!(this.renderUnknownCommandMessage(cmd));
183
- } else {
184
- console.error!(error);
185
185
  }
186
186
  console.error!();
187
187
  }
@@ -132,7 +132,12 @@ export function CliRestartOnChangeFlag(config: CliFlagOptions = {}) {
132
132
  description: 'Should the invocation automatically restart on source changes'
133
133
  });
134
134
 
135
- runBeforeMain(cls, (cmd: typeof instance) => CliUtil.runWithRestartOnChange(cmd[property]), true);
135
+ runBeforeMain(cls,
136
+ (cmd: typeof instance) => {
137
+ if (Runtime.production) { return; }
138
+ return CliUtil.runWithRestartOnChange(cmd[property]);
139
+ }, true
140
+ );
136
141
  };
137
142
  }
138
143
 
@@ -151,6 +156,7 @@ export function CliDebugIpcFlag(config: CliFlagOptions = {}) {
151
156
 
152
157
  runBeforeMain(cls,
153
158
  (cmd: typeof instance & CliCommandShape) => {
159
+ if (Runtime.production) { return; }
154
160
  const cliConfig = CliCommandRegistryIndex.get(cls);
155
161
  return cmd[property] && CliUtil.runWithDebugIpc(cliConfig.name);
156
162
  },
package/src/util.ts CHANGED
@@ -33,7 +33,8 @@ export class CliUtil {
33
33
  ShutdownManager.disableInterrupt();
34
34
 
35
35
  let child: ChildProcess | undefined;
36
- void WatchUtil.watchCompilerEvents('file', () => ShutdownManager.shutdownChild(child!, { reason: 'restart', mode: 'exit' }));
36
+ await WatchUtil.watchCompilerEvents('file', () => ShutdownManager.shutdownChild(child!, { reason: 'restart', mode: 'exit' }));
37
+
37
38
  process
38
39
  .on('SIGINT', () => ShutdownManager.shutdownChild(child!, { mode: 'exit' }))
39
40
  .on('message', msg => child?.send?.(msg!));