@travetto/repo 5.0.0-rc.8 → 5.0.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/README.md +10 -8
- package/package.json +3 -3
- package/support/bin/exec.ts +6 -7
package/README.md
CHANGED
|
@@ -104,20 +104,18 @@ Options:
|
|
|
104
104
|
```bash
|
|
105
105
|
$ trv repo:list
|
|
106
106
|
|
|
107
|
-
global-test/asset-rest-upload
|
|
108
107
|
global-test/auth-rest
|
|
109
108
|
global-test/auth-rest-jwt
|
|
110
|
-
global-test/model_asset
|
|
111
109
|
global-test/model_auth-model
|
|
112
110
|
global-test/model_cache
|
|
113
111
|
global-test/model_rest-session
|
|
112
|
+
global-test/model_rest-upload
|
|
114
113
|
global-test/openapi
|
|
115
114
|
global-test/pack_app
|
|
116
115
|
global-test/rest-client
|
|
117
116
|
global-test/rest-session
|
|
118
117
|
global-test/rest-upload
|
|
119
118
|
global-test/transformer-test
|
|
120
|
-
module/asset
|
|
121
119
|
module/auth
|
|
122
120
|
module/auth-model
|
|
123
121
|
module/auth-rest
|
|
@@ -144,11 +142,14 @@ module/manifest
|
|
|
144
142
|
module/model
|
|
145
143
|
module/model-dynamodb
|
|
146
144
|
module/model-elasticsearch
|
|
145
|
+
module/model-file
|
|
147
146
|
module/model-firestore
|
|
147
|
+
module/model-memory
|
|
148
148
|
module/model-mongo
|
|
149
149
|
module/model-mysql
|
|
150
150
|
module/model-postgres
|
|
151
151
|
module/model-query
|
|
152
|
+
module/model-query-language
|
|
152
153
|
module/model-redis
|
|
153
154
|
module/model-s3
|
|
154
155
|
module/model-sql
|
|
@@ -202,22 +203,20 @@ The standard format includes prefixed output to help identify which module produ
|
|
|
202
203
|
|
|
203
204
|
**Terminal: List execution of Monorepo**
|
|
204
205
|
```bash
|
|
205
|
-
$ trv repo:exec pwd
|
|
206
|
+
$ trv repo:exec -w 1 pwd
|
|
206
207
|
|
|
207
|
-
global-test/
|
|
208
|
-
global-test/auth-rest <workspace-root>/global-test/auth-rest
|
|
208
|
+
global-test/auth-rest <workspace-root>/global-test/auth-rest
|
|
209
209
|
global-test/auth-rest-jwt <workspace-root>/global-test/auth-rest-jwt
|
|
210
|
-
global-test/model_asset <workspace-root>/global-test/model_asset
|
|
211
210
|
global-test/model_auth-model <workspace-root>/global-test/model_auth-model
|
|
212
211
|
global-test/model_cache <workspace-root>/global-test/model_cache
|
|
213
212
|
global-test/model_rest-session <workspace-root>/global-test/model_rest-session
|
|
213
|
+
global-test/model_rest-upload <workspace-root>/global-test/model_rest-upload
|
|
214
214
|
global-test/openapi <workspace-root>/global-test/openapi
|
|
215
215
|
global-test/pack_app <workspace-root>/global-test/pack_app
|
|
216
216
|
global-test/rest-client <workspace-root>/global-test/rest-client
|
|
217
217
|
global-test/rest-session <workspace-root>/global-test/rest-session
|
|
218
218
|
global-test/rest-upload <workspace-root>/global-test/rest-upload
|
|
219
219
|
global-test/transformer-test <workspace-root>/global-test/transformer-test
|
|
220
|
-
module/asset <workspace-root>/module/asset
|
|
221
220
|
module/auth <workspace-root>/module/auth
|
|
222
221
|
module/auth-model <workspace-root>/module/auth-model
|
|
223
222
|
module/auth-rest <workspace-root>/module/auth-rest
|
|
@@ -244,11 +243,14 @@ global-test/model_rest-session <workspace-root>/global-test/model_rest-session
|
|
|
244
243
|
module/model <workspace-root>/module/model
|
|
245
244
|
module/model-dynamodb <workspace-root>/module/model-dynamodb
|
|
246
245
|
module/model-elasticsearch <workspace-root>/module/model-elasticsearch
|
|
246
|
+
module/model-file <workspace-root>/module/model-file
|
|
247
247
|
module/model-firestore <workspace-root>/module/model-firestore
|
|
248
|
+
module/model-memory <workspace-root>/module/model-memory
|
|
248
249
|
module/model-mongo <workspace-root>/module/model-mongo
|
|
249
250
|
module/model-mysql <workspace-root>/module/model-mysql
|
|
250
251
|
module/model-postgres <workspace-root>/module/model-postgres
|
|
251
252
|
module/model-query <workspace-root>/module/model-query
|
|
253
|
+
module/model-query-language <workspace-root>/module/model-query-language
|
|
252
254
|
module/model-redis <workspace-root>/module/model-redis
|
|
253
255
|
module/model-s3 <workspace-root>/module/model-s3
|
|
254
256
|
module/model-sql <workspace-root>/module/model-sql
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/repo",
|
|
3
|
-
"version": "5.0.0
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "Monorepo utilities",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"travetto",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"directory": "module/repo"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@travetto/cli": "^5.0.0
|
|
26
|
-
"@travetto/worker": "^5.0.0
|
|
25
|
+
"@travetto/cli": "^5.0.0",
|
|
26
|
+
"@travetto/worker": "^5.0.0"
|
|
27
27
|
},
|
|
28
28
|
"peerDependenciesMeta": {
|
|
29
29
|
"@travetto/cli": {
|
package/support/bin/exec.ts
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import { ChildProcess } from 'node:child_process';
|
|
2
2
|
|
|
3
|
-
import { ExecutionResult, Env, Util, ExecUtil } from '@travetto/runtime';
|
|
3
|
+
import { ExecutionResult, Env, Util, ExecUtil, castTo } from '@travetto/runtime';
|
|
4
4
|
import { CliModuleUtil } from '@travetto/cli';
|
|
5
5
|
import type { IndexedModule } from '@travetto/manifest';
|
|
6
6
|
import { StyleUtil, Terminal, TerminalUtil } from '@travetto/terminal';
|
|
7
7
|
import { WorkPool } from '@travetto/worker';
|
|
8
8
|
|
|
9
|
-
const COLORS = ([
|
|
9
|
+
const COLORS = ([...[
|
|
10
10
|
'#8787ff', '#87afff', '#87d7ff', '#87ff87', '#87ffaf', '#87ffd7', '#87ffff', '#af87ff', '#afafd7', '#afafff', '#afd7af', '#afd7d7', '#afd7ff', '#afff87', '#afffaf',
|
|
11
11
|
'#afffd7', '#afffff', '#d787ff', '#d7afaf', '#d7afd7', '#d7afff', '#d7d7af', '#d7d7d7', '#d7d7ff', '#d7ff87', '#d7ffaf', '#d7ffd7', '#d7ffff', '#ff8787', '#ff87af',
|
|
12
12
|
'#ff87d7', '#ff87ff', '#ffaf87', '#ffafaf', '#ffafd7', '#ffafff', '#ffd787', '#ffd7af', '#ffd7d7', '#ffd7ff', '#ffff87', '#ffffaf', '#ffffd7', '#ffffff', '#bcbcbc',
|
|
13
13
|
'#c6c6c6', '#d0d0d0', '#dadada', '#e4e4e4', '#eeeeee'
|
|
14
|
-
|
|
15
|
-
]).sort((a, b) => Math.random() < .5 ? -1 : 1).map(x => StyleUtil.getStyle(x as `#${string}`));
|
|
14
|
+
] as const]).sort((a, b) => Math.random() < .5 ? -1 : 1).map(x => StyleUtil.getStyle(x));
|
|
16
15
|
|
|
17
16
|
type ModuleRunConfig<T = ExecutionResult<string>> = {
|
|
18
17
|
progressMessage?: (mod: IndexedModule | undefined) => string;
|
|
@@ -22,6 +21,7 @@ type ModuleRunConfig<T = ExecutionResult<string>> = {
|
|
|
22
21
|
prefixOutput?: boolean;
|
|
23
22
|
showStdout?: boolean;
|
|
24
23
|
showStderr?: boolean;
|
|
24
|
+
stableOutput?: boolean;
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
const colorize = (val: string, idx: number): string => COLORS[idx % COLORS.length](val);
|
|
@@ -53,6 +53,7 @@ export class RepoExecUtil {
|
|
|
53
53
|
|
|
54
54
|
config.showStdout = config.showStdout ?? (Env.DEBUG.isSet && !Env.DEBUG.isFalse);
|
|
55
55
|
config.showStderr = config.showStderr ?? true;
|
|
56
|
+
const transform = config.transformResult ?? ((mod, result): T => castTo(result));
|
|
56
57
|
|
|
57
58
|
const workerCount = config.workerCount ?? WorkPool.DEFAULT_SIZE;
|
|
58
59
|
|
|
@@ -83,9 +84,7 @@ export class RepoExecUtil {
|
|
|
83
84
|
}
|
|
84
85
|
|
|
85
86
|
const result = await ExecUtil.getResult(proc, { catch: true });
|
|
86
|
-
|
|
87
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
88
|
-
const output = (config.transformResult ? config.transformResult(mod, result) : result) as T;
|
|
87
|
+
const output = transform(mod, result);
|
|
89
88
|
results.set(mod, output);
|
|
90
89
|
}
|
|
91
90
|
return config.progressMessage?.(mod) ?? mod.name;
|