@travetto/cli 4.1.2 → 5.0.0-rc.0

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2020 ArcSine Technologies
3
+ Copyright (c) 2023 ArcSine Technologies
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -508,7 +508,7 @@ export class RunRestCommand implements CliCommandShape {
508
508
  }
509
509
  ```
510
510
 
511
- As noted in the example above, `fields` is specified in this execution, with support for `module`, and `env`. These env flag is directly tied to the [Runtime](https://github.com/travetto/travetto/tree/main/module/base/src/env.ts#L105) `name` defined in the [Base](https://github.com/travetto/travetto/tree/main/module/base#readme "Environment config and common utilities for travetto applications.") module.
511
+ As noted in the example above, `fields` is specified in this execution, with support for `module`, and `env`. These env flag is directly tied to the [Runtime](https://github.com/travetto/travetto/tree/main/module/base/src/env.ts#L116) `name` defined in the [Base](https://github.com/travetto/travetto/tree/main/module/base#readme "Environment config and common utilities for travetto applications.") module.
512
512
 
513
513
  The `module` field is slightly more complex, but is geared towards supporting commands within a monorepo context. This flag ensures that a module is specified if running from the root of the monorepo, and that the module provided is real, and can run the desired command. When running from an explicit module folder in the monorepo, the module flag is ignored.
514
514
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/cli",
3
- "version": "4.1.2",
3
+ "version": "5.0.0-rc.0",
4
4
  "description": "CLI infrastructure for Travetto framework",
5
5
  "keywords": [
6
6
  "cli",
@@ -29,8 +29,8 @@
29
29
  "directory": "module/cli"
30
30
  },
31
31
  "dependencies": {
32
- "@travetto/schema": "^4.1.1",
33
- "@travetto/terminal": "^4.1.1"
32
+ "@travetto/schema": "^5.0.0-rc.0",
33
+ "@travetto/terminal": "^5.0.0-rc.0"
34
34
  },
35
35
  "travetto": {
36
36
  "displayName": "Command Line Interface",
package/src/help.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import util from 'node:util';
2
2
 
3
- import { Primitive } from '@travetto/base';
3
+ import { Primitive } from '@travetto/schema';
4
4
 
5
5
  import { cliTpl } from './color';
6
6
  import { CliCommandShape } from './types';
package/src/parse.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import fs from 'node:fs/promises';
2
+ import path from 'node:path';
2
3
 
3
- import { RuntimeIndex, RuntimeContext, path } from '@travetto/manifest';
4
+ import { RuntimeIndex, RuntimeContext } from '@travetto/manifest';
4
5
  import { CliCommandInput, CliCommandSchema, ParsedState } from './types';
5
6
 
6
7
  type ParsedInput = ParsedState['all'][number];
package/src/scm.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  import { spawn } from 'node:child_process';
2
2
  import fs from 'node:fs/promises';
3
+ import path from 'node:path';
3
4
 
4
5
  import { ExecUtil } from '@travetto/base';
5
- import { IndexedModule, RuntimeIndex, RuntimeContext, path } from '@travetto/manifest';
6
+ import { IndexedModule, RuntimeIndex, RuntimeContext } from '@travetto/manifest';
6
7
 
7
8
  export class CliScmUtil {
8
9
  /**
package/src/util.ts CHANGED
@@ -30,7 +30,7 @@ export class CliUtil {
30
30
  */
31
31
  static runWithRestart<T extends CliCommandShapeFields & CliCommandShape>(cmd: T, ipc?: boolean): Promise<unknown> | undefined {
32
32
  if (ipc && process.connected) {
33
- ExecUtil.exitOnDisconnect();
33
+ process.once('disconnect', () => process.exit());
34
34
  }
35
35
  if (Env.TRV_CAN_RESTART.isFalse || !(cmd.canRestart ?? !Env.production)) {
36
36
  Env.TRV_CAN_RESTART.clear();
@@ -1,7 +1,8 @@
1
1
  import fs from 'node:fs/promises';
2
+ import path from 'node:path';
2
3
 
3
4
  import { CliCommandShape, CliCommand, CliValidationError, ParsedState } from '@travetto/cli';
4
- import { path, RuntimeIndex, RuntimeContext } from '@travetto/manifest';
5
+ import { RuntimeIndex, RuntimeContext } from '@travetto/manifest';
5
6
  import { Ignore } from '@travetto/schema';
6
7
 
7
8
  /**
@@ -38,7 +39,7 @@ export class MainCommand implements CliCommandShape {
38
39
  res = await mod.main(...args, ...this._parsed.unknown);
39
40
  } catch (err) {
40
41
  res = err;
41
- process.exitCode = Math.max(process.exitCode ?? 1, 1);
42
+ process.exitCode = Math.max(process.exitCode ? +process.exitCode : 1, 1);
42
43
  }
43
44
 
44
45
  if (res !== undefined) {