@travetto/repo 7.1.4 → 8.0.0-alpha.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/repo",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0-alpha.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Monorepo utilities",
|
|
6
6
|
"keywords": [
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
"directory": "module/repo"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@travetto/worker": "^
|
|
26
|
+
"@travetto/worker": "^8.0.0-alpha.0"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@travetto/cli": "^
|
|
29
|
+
"@travetto/cli": "^8.0.0-alpha.0"
|
|
30
30
|
},
|
|
31
31
|
"peerDependenciesMeta": {
|
|
32
32
|
"@travetto/cli": {
|
package/support/bin/exec.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ChildProcess } from 'node:child_process';
|
|
2
2
|
|
|
3
|
-
import { type ExecutionResult, Env, Util, ExecUtil, castTo } from '@travetto/runtime';
|
|
3
|
+
import { type ExecutionResult, Env, Util, ExecUtil, castTo, CodecUtil } 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';
|
|
@@ -73,12 +73,12 @@ export class RepoExecUtil {
|
|
|
73
73
|
processes.set(module, subProcess);
|
|
74
74
|
|
|
75
75
|
if (config.showStdout && subProcess.stdout) {
|
|
76
|
-
|
|
76
|
+
CodecUtil.readLines(subProcess.stdout, line =>
|
|
77
77
|
stdoutTerm.writer.writeLine(`${prefix}${line.trimEnd()}`).commit()
|
|
78
78
|
);
|
|
79
79
|
}
|
|
80
80
|
if (config.showStderr && subProcess.stderr) {
|
|
81
|
-
|
|
81
|
+
CodecUtil.readLines(subProcess.stderr, line =>
|
|
82
82
|
stderrTerm.writer.writeLine(`${prefix}${line.trimEnd()}`).commit()
|
|
83
83
|
);
|
|
84
84
|
}
|
|
@@ -2,7 +2,7 @@ import path from 'node:path';
|
|
|
2
2
|
import { spawn, type ChildProcess } from 'node:child_process';
|
|
3
3
|
import fs from 'node:fs/promises';
|
|
4
4
|
|
|
5
|
-
import { type ExecutionResult,
|
|
5
|
+
import { JSONUtil, type ExecutionResult, Runtime } from '@travetto/runtime';
|
|
6
6
|
import { type IndexedModule, type Package, PackageUtil } from '@travetto/manifest';
|
|
7
7
|
import { CliModuleUtil } from '@travetto/cli';
|
|
8
8
|
|
|
@@ -34,7 +34,7 @@ export class PackageManager {
|
|
|
34
34
|
throw new Error(result.stderr);
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
const parsed = JSONUtil.
|
|
37
|
+
const parsed = JSONUtil.fromUTF8<{ data: { dist?: { integrity?: string } } }>(result.stdout || '{}');
|
|
38
38
|
return parsed.data?.dist?.integrity !== undefined;
|
|
39
39
|
}
|
|
40
40
|
|
|
@@ -87,7 +87,7 @@ export class PackageManager {
|
|
|
87
87
|
* Write package
|
|
88
88
|
*/
|
|
89
89
|
static async writePackageIfChanged(modulePath: string, pkg: Package): Promise<void> {
|
|
90
|
-
const final =
|
|
90
|
+
const final = JSONUtil.toUTF8Pretty(pkg);
|
|
91
91
|
const target = path.resolve(modulePath, 'package.json');
|
|
92
92
|
const current = (await fs.readFile(target, 'utf8').catch(() => '')).trim();
|
|
93
93
|
if (final !== current) {
|
package/support/cli.repo_list.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type CliCommandShape, CliCommand, CliModuleUtil } from '@travetto/cli';
|
|
2
|
-
import { Runtime, RuntimeIndex } from '@travetto/runtime';
|
|
2
|
+
import { JSONUtil, Runtime, RuntimeIndex } from '@travetto/runtime';
|
|
3
3
|
|
|
4
4
|
const write = (line: string): Promise<void> => new Promise(resolve => process.stdout.write(`${line}\n`, () => resolve()));
|
|
5
5
|
|
|
@@ -39,8 +39,11 @@ export class ListModuleCommand implements CliCommandShape {
|
|
|
39
39
|
}
|
|
40
40
|
case 'json': {
|
|
41
41
|
const outputMap = CliModuleUtil.getDependencyGraph(modules);
|
|
42
|
-
await write(
|
|
43
|
-
.
|
|
42
|
+
await write(JSONUtil.toUTF8(
|
|
43
|
+
Object.entries(outputMap)
|
|
44
|
+
.map(([name, children]) => ({ name, children, workspace: RuntimeIndex.getModule(name)?.workspace })),
|
|
45
|
+
{ indent: 2 }
|
|
46
|
+
));
|
|
44
47
|
break;
|
|
45
48
|
}
|
|
46
49
|
case 'graph': {
|