@fougere/cli 0.12.0-alpha.0 → 0.12.1-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.
|
@@ -19,12 +19,12 @@ export default class GraphCommand {
|
|
|
19
19
|
|
|
20
20
|
if (machineWanted(raw)) return printMachine(result);
|
|
21
21
|
|
|
22
|
-
if (result.
|
|
22
|
+
if (result.totalFronds === 0) {
|
|
23
23
|
this.ui.warn('No fronds found. Run this from a Fougere project root.');
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
this.ui.step(`${pc.bold(String(result.totalEntities))} entities, ${pc.bold(String(result.totalRefs))} refs, ${pc.bold(String(result.
|
|
27
|
+
this.ui.step(`${pc.bold(String(result.totalEntities))} entities, ${pc.bold(String(result.totalRefs))} refs, ${pc.bold(String(result.totalFronds))} frond(s)`);
|
|
28
28
|
this.ui.note(renderFronds(result.declared), 'Fronds');
|
|
29
29
|
this.ui.note(renderGraph(result.nodes), 'Entity Graph');
|
|
30
30
|
|
|
@@ -33,7 +33,7 @@ export default class GraphCommand {
|
|
|
33
33
|
this.ui.note(renderClusters(result.clusters), 'Suggested Domains');
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
if (result.
|
|
36
|
+
if (result.totalFronds === 1 && result.clusters.length > 1 && result.totalEntities >= min) {
|
|
37
37
|
this.ui.info(`${pc.dim('Tip:')} ${result.clusters.length} natural domains detected. Consider splitting into separate fronds.`);
|
|
38
38
|
}
|
|
39
39
|
|
|
@@ -63,8 +63,8 @@ function renderFronds(declared: DeclaredTopology): string {
|
|
|
63
63
|
}).join('\n');
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
function renderGraph(nodes:
|
|
67
|
-
return
|
|
66
|
+
function renderGraph(nodes: Record<string, EntityNode>): string {
|
|
67
|
+
return Object.entries(nodes).map(([name, node]) => {
|
|
68
68
|
const refs = node.refs.length > 0
|
|
69
69
|
? ` ${pc.dim('→')} ${node.refs.map((r) => pc.cyan(r)).join(', ')}`
|
|
70
70
|
: '';
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildGraph, declaredTopologyOf, suggestSplit,
|
|
3
|
-
type DeclaredTopology, type EntityNode, type DomainCluster,
|
|
3
|
+
type DeclaredTopology, type EntityNode, type DomainCluster,
|
|
4
4
|
} from '@fougere/core';
|
|
5
5
|
import ProjectScan from '../services/ProjectScan.js';
|
|
6
6
|
import { remotesOf } from '@fougere/core/node';
|
|
7
7
|
|
|
8
8
|
export interface GraphResult {
|
|
9
|
-
fronds
|
|
9
|
+
/** How many fronds the scan found — the descriptors themselves hold classes, which no
|
|
10
|
+
* operation answers: a reader outside this process would receive the husk JSON makes of them. */
|
|
11
|
+
totalFronds: number;
|
|
10
12
|
/** Where the fronds run and which reaches which — the same picture, one altitude up. */
|
|
11
13
|
declared: DeclaredTopology;
|
|
12
|
-
nodes:
|
|
14
|
+
nodes: Record<string, EntityNode>;
|
|
13
15
|
clusters: DomainCluster[];
|
|
14
16
|
totalEntities: number;
|
|
15
17
|
totalRefs: number;
|
|
@@ -25,9 +27,9 @@ export default class GraphHandler {
|
|
|
25
27
|
const clusters = suggestSplit(nodes);
|
|
26
28
|
|
|
27
29
|
return {
|
|
28
|
-
fronds,
|
|
30
|
+
totalFronds: fronds.length,
|
|
29
31
|
declared: declaredTopologyOf({ fronds, remotes: remotesOf(config) }),
|
|
30
|
-
nodes,
|
|
32
|
+
nodes: Object.fromEntries(nodes),
|
|
31
33
|
clusters,
|
|
32
34
|
totalEntities: nodes.size,
|
|
33
35
|
totalRefs: [...nodes.values()].reduce((sum, n) => sum + n.refs.length, 0),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fougere/cli",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.1-alpha.0",
|
|
4
4
|
"description": "The Fougere CLI — compose a workspace, serve a frond, call an operation.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fougere",
|
|
@@ -42,20 +42,20 @@
|
|
|
42
42
|
"jiti": "^2.4.2",
|
|
43
43
|
"picocolors": "^1.1.1",
|
|
44
44
|
"safe-regex": "^2.1.1",
|
|
45
|
-
"@fougere/
|
|
46
|
-
"@fougere/
|
|
47
|
-
"@fougere/
|
|
48
|
-
"@fougere/
|
|
49
|
-
"@fougere/
|
|
50
|
-
"@fougere/
|
|
51
|
-
"@fougere/
|
|
52
|
-
"@fougere/
|
|
53
|
-
"@fougere/
|
|
54
|
-
"@fougere/
|
|
55
|
-
"@fougere/svelte": "0.12.
|
|
56
|
-
"@fougere/transport-http": "0.12.
|
|
57
|
-
"@fougere/
|
|
58
|
-
"@fougere/
|
|
45
|
+
"@fougere/compiler": "0.12.1-alpha.0",
|
|
46
|
+
"@fougere/defaults": "0.12.1-alpha.0",
|
|
47
|
+
"@fougere/adapter-sql": "0.12.1-alpha.0",
|
|
48
|
+
"@fougere/next": "0.12.1-alpha.0",
|
|
49
|
+
"@fougere/react": "0.12.1-alpha.0",
|
|
50
|
+
"@fougere/core": "0.12.1-alpha.0",
|
|
51
|
+
"@fougere/schema": "0.12.1-alpha.0",
|
|
52
|
+
"@fougere/container": "0.12.1-alpha.0",
|
|
53
|
+
"@fougere/testing": "0.12.1-alpha.0",
|
|
54
|
+
"@fougere/nuxt": "0.12.1-alpha.0",
|
|
55
|
+
"@fougere/svelte": "0.12.1-alpha.0",
|
|
56
|
+
"@fougere/transport-http": "0.12.1-alpha.0",
|
|
57
|
+
"@fougere/admin": "0.12.1-alpha.0",
|
|
58
|
+
"@fougere/oclif": "0.12.1-alpha.0"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"vitest": "^4.1.0"
|