@travetto/cli 7.0.0-rc.3 → 7.0.0-rc.5
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/README.md +19 -19
- package/bin/trv.js +2 -5
- package/package.json +4 -3
- package/src/registry/decorator.ts +2 -2
- package/src/registry/registry-index.ts +0 -1
- package/src/util.ts +0 -1
- package/support/cli.cli_schema.ts +0 -1
package/README.md
CHANGED
|
@@ -213,9 +213,9 @@ export class BasicCommand {
|
|
|
213
213
|
|
|
214
214
|
**Terminal: Basic Command**
|
|
215
215
|
```bash
|
|
216
|
-
$ trv basic:
|
|
216
|
+
$ trv basic:arg-list -h
|
|
217
217
|
|
|
218
|
-
Usage: basic:
|
|
218
|
+
Usage: basic:arg-list [options] <volumes...:number>
|
|
219
219
|
|
|
220
220
|
Options:
|
|
221
221
|
-r, --reverse
|
|
@@ -224,19 +224,19 @@ Options:
|
|
|
224
224
|
|
|
225
225
|
**Terminal: Basic Arg List**
|
|
226
226
|
```bash
|
|
227
|
-
$ trv basic:
|
|
227
|
+
$ trv basic:arg-list 10 5 3 9 8 1
|
|
228
228
|
|
|
229
229
|
1 3 5 8 9 10
|
|
230
230
|
```
|
|
231
231
|
|
|
232
232
|
**Terminal: Basic Arg List with Invalid Number**
|
|
233
233
|
```bash
|
|
234
|
-
$ trv basic:
|
|
234
|
+
$ trv basic:arg-list 10 5 3 9 20 1
|
|
235
235
|
|
|
236
236
|
Execution failed:
|
|
237
237
|
* Argument volumes[4] is greater than (10)
|
|
238
238
|
|
|
239
|
-
Usage: basic:
|
|
239
|
+
Usage: basic:arg-list [options] <volumes...:number>
|
|
240
240
|
|
|
241
241
|
Options:
|
|
242
242
|
-r, --reverse
|
|
@@ -245,7 +245,7 @@ Options:
|
|
|
245
245
|
|
|
246
246
|
**Terminal: Basic Arg List with Reverse**
|
|
247
247
|
```bash
|
|
248
|
-
$ trv basic:
|
|
248
|
+
$ trv basic:arg-list -r 10 5 3 9 8 1
|
|
249
249
|
|
|
250
250
|
10 9 8 5 3 1
|
|
251
251
|
```
|
|
@@ -479,7 +479,7 @@ export class WebHttpCommand implements CliCommandShape {
|
|
|
479
479
|
port?: number;
|
|
480
480
|
|
|
481
481
|
/** Kill conflicting port owner */
|
|
482
|
-
killConflict?: boolean;
|
|
482
|
+
killConflict?: boolean = Runtime.envType === 'development';
|
|
483
483
|
|
|
484
484
|
preMain(): void {
|
|
485
485
|
if (this.port) {
|
|
@@ -491,18 +491,18 @@ export class WebHttpCommand implements CliCommandShape {
|
|
|
491
491
|
await Registry.init();
|
|
492
492
|
const instance = await DependencyRegistryIndex.getInstance(toConcrete<WebHttpServer>());
|
|
493
493
|
|
|
494
|
-
|
|
495
|
-
() => instance.serve(),
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
494
|
+
if (this.killConflict) {
|
|
495
|
+
const handle = await Util.acquireWithRetry(() => instance.serve(), NetUtil.freePortOnConflict, 5);
|
|
496
|
+
return handle.complete;
|
|
497
|
+
} else {
|
|
498
|
+
const handle = await instance.serve();
|
|
499
|
+
return handle.complete;
|
|
500
|
+
}
|
|
501
501
|
}
|
|
502
502
|
}
|
|
503
503
|
```
|
|
504
504
|
|
|
505
|
-
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/runtime/src/context.ts#
|
|
505
|
+
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/runtime/src/context.ts#L12) `name` defined in the [Runtime](https://github.com/travetto/travetto/tree/main/module/runtime#readme "Runtime for travetto applications.") module.
|
|
506
506
|
|
|
507
507
|
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.
|
|
508
508
|
|
|
@@ -550,13 +550,13 @@ Options:
|
|
|
550
550
|
Available Services
|
|
551
551
|
--------------------
|
|
552
552
|
* dynamodb@3.1.0
|
|
553
|
-
* elasticsearch@9.2.
|
|
553
|
+
* elasticsearch@9.2.3
|
|
554
554
|
* firestore@latest
|
|
555
555
|
* mongodb@8.2
|
|
556
556
|
* mysql@9.5
|
|
557
557
|
* postgresql@18.1
|
|
558
558
|
* redis@8.4
|
|
559
|
-
* s3@4.
|
|
559
|
+
* s3@4.11.0
|
|
560
560
|
```
|
|
561
561
|
|
|
562
562
|
A sample of all services available to the entire framework:
|
|
@@ -568,13 +568,13 @@ $ trv service status
|
|
|
568
568
|
Service Version Status
|
|
569
569
|
-------------------------------------------------
|
|
570
570
|
dynamodb 3.1.0 Running 93af422e793a
|
|
571
|
-
elasticsearch 9.2.
|
|
571
|
+
elasticsearch 9.2.3 Running ed76ee063d13
|
|
572
572
|
firestore latest Running feec2e5e95b4
|
|
573
573
|
mongodb 8.2 Running 5513eba6734e
|
|
574
574
|
mysql 9.5 Running 307bc66d442a
|
|
575
575
|
postgresql 18.1 Running e78291e71040
|
|
576
576
|
redis 8.4 Running 77ba279b4e30
|
|
577
|
-
s3 4.
|
|
577
|
+
s3 4.11.0 Running fdacfc55b9e3
|
|
578
578
|
```
|
|
579
579
|
|
|
580
580
|
### Defining new Services
|
package/bin/trv.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
globalThis.__entry_point__ = __filename;
|
|
4
|
-
|
|
5
2
|
// @ts-check
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
import { load } from '@travetto/compiler/bin/entry.common.js';
|
|
4
|
+
load(operations => operations.exec('@travetto/cli/support/entry.trv.js'));
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/cli",
|
|
3
|
-
"version": "7.0.0-rc.
|
|
3
|
+
"version": "7.0.0-rc.5",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"description": "CLI infrastructure for Travetto framework",
|
|
5
6
|
"keywords": [
|
|
6
7
|
"cli",
|
|
@@ -28,8 +29,8 @@
|
|
|
28
29
|
"directory": "module/cli"
|
|
29
30
|
},
|
|
30
31
|
"dependencies": {
|
|
31
|
-
"@travetto/schema": "^7.0.0-rc.
|
|
32
|
-
"@travetto/terminal": "^7.0.0-rc.
|
|
32
|
+
"@travetto/schema": "^7.0.0-rc.5",
|
|
33
|
+
"@travetto/terminal": "^7.0.0-rc.5"
|
|
33
34
|
},
|
|
34
35
|
"travetto": {
|
|
35
36
|
"displayName": "Command Line Interface",
|
|
@@ -69,7 +69,7 @@ const FIELD_CONFIG: {
|
|
|
69
69
|
type: Boolean,
|
|
70
70
|
aliases: ['-cr'],
|
|
71
71
|
description: 'Should the invocation automatically restart on source changes',
|
|
72
|
-
default: Runtime.
|
|
72
|
+
default: Runtime.envType === 'development',
|
|
73
73
|
required: { active: false },
|
|
74
74
|
},
|
|
75
75
|
}
|
|
@@ -79,7 +79,7 @@ const FIELD_CONFIG: {
|
|
|
79
79
|
* Decorator to register a CLI command
|
|
80
80
|
*
|
|
81
81
|
* @augments `@travetto/schema:Schema`
|
|
82
|
-
* @example main
|
|
82
|
+
* @example method:main
|
|
83
83
|
* @kind decorator
|
|
84
84
|
*/
|
|
85
85
|
export function CliCommand(config: CliCommandConfigOptions = {}) {
|
package/src/util.ts
CHANGED