@travetto/repo 5.0.0-rc.7 → 5.0.0-rc.9

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 CHANGED
@@ -149,6 +149,7 @@ 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,7 +203,7 @@ 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
208
  global-test/asset-rest-upload <workspace-root>/global-test/asset-rest-upload
208
209
  global-test/auth-rest <workspace-root>/global-test/auth-rest
@@ -249,6 +250,7 @@ global-test/model_rest-session <workspace-root>/global-test/model_rest-session
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-rc.7",
3
+ "version": "5.0.0-rc.9",
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-rc.7",
26
- "@travetto/worker": "^5.0.0-rc.7"
25
+ "@travetto/cli": "^5.0.0-rc.9",
26
+ "@travetto/worker": "^5.0.0-rc.9"
27
27
  },
28
28
  "peerDependenciesMeta": {
29
29
  "@travetto/cli": {
@@ -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
- // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
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;