@teambit/graph 0.0.583 → 0.0.587
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/component-graph/component-graph.ts +30 -2
- package/dist/component-graph/component-graph.d.ts +8 -1
- package/dist/component-graph/component-graph.js +35 -1
- package/dist/component-graph/component-graph.js.map +1 -1
- package/dist/graph-builder.d.ts +5 -0
- package/dist/graph-builder.js +6 -0
- package/dist/graph-builder.js.map +1 -1
- package/package-tar/teambit-graph-0.0.587.tgz +0 -0
- package/package.json +14 -14
- package/package-tar/teambit-graph-0.0.583.tgz +0 -0
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Component } from '@teambit/component';
|
1
|
+
import { Component, ComponentID } from '@teambit/component';
|
2
2
|
import { Graph } from 'cleargraph';
|
3
3
|
|
4
4
|
import { Dependency } from '../model/dependency';
|
@@ -11,6 +11,7 @@ type Edge = { sourceId: string; targetId: string; edge: Dependency };
|
|
11
11
|
|
12
12
|
export class ComponentGraph extends Graph<Component, Dependency> {
|
13
13
|
versionMap: Map<string, { allVersionNodes: string[]; latestVersionNode: string }>;
|
14
|
+
seederIds: ComponentID[] = []; // component IDs that started the graph. (if from workspace, the .bitmap ids normally)
|
14
15
|
constructor(nodes: Node[] = [], edges: Edge[] = []) {
|
15
16
|
super(nodes, edges);
|
16
17
|
this.versionMap = new Map();
|
@@ -20,7 +21,24 @@ export class ComponentGraph extends Graph<Component, Dependency> {
|
|
20
21
|
return new ComponentGraph(nodes, edges) as this;
|
21
22
|
}
|
22
23
|
|
24
|
+
/**
|
25
|
+
* overrides the super class to eliminate non-seeders components
|
26
|
+
*/
|
27
|
+
findCycles(graph?: this): string[][] {
|
28
|
+
const cycles = super.findCycles(graph);
|
29
|
+
if (!this.shouldLimitToSeedersOnly()) {
|
30
|
+
return cycles;
|
31
|
+
}
|
32
|
+
const seederIdsStr = this.getSeederIdsStr();
|
33
|
+
const cyclesWithSeeders = cycles.filter((cycle) => {
|
34
|
+
const cycleNoVersions = cycle.map((id) => id.split('@')[0]);
|
35
|
+
return cycleNoVersions.some((cycleIdStr) => seederIdsStr.includes(cycleIdStr));
|
36
|
+
});
|
37
|
+
return cyclesWithSeeders;
|
38
|
+
}
|
39
|
+
|
23
40
|
findDuplicateDependencies(): Map<string, DuplicateDependency> {
|
41
|
+
const seederIdsNoVersions = this.getSeederIdsStr();
|
24
42
|
const duplicateDependencies: Map<string, DuplicateDependency> = new Map();
|
25
43
|
for (const [compFullName, versions] of this.versionMap) {
|
26
44
|
if (versions.allVersionNodes.length > 1) {
|
@@ -38,7 +56,9 @@ export class ComponentGraph extends Graph<Component, Dependency> {
|
|
38
56
|
};
|
39
57
|
versionSubgraphs.push(versionSubgraph);
|
40
58
|
});
|
41
|
-
|
59
|
+
const isSeeder = seederIdsNoVersions.includes(compFullName);
|
60
|
+
const shouldDisplayDueToBeingSeeder = !this.shouldLimitToSeedersOnly() || isSeeder;
|
61
|
+
if (shouldDisplayDueToBeingSeeder && versionSubgraphs.length > 0) {
|
42
62
|
const duplicateDep = new DuplicateDependency(versions.latestVersionNode, versionSubgraphs);
|
43
63
|
duplicateDependencies.set(compFullName, duplicateDep);
|
44
64
|
}
|
@@ -75,6 +95,14 @@ export class ComponentGraph extends Graph<Component, Dependency> {
|
|
75
95
|
return this.successorsSubgraph(componentIds, (edge) => edge.attr.type === 'runtime');
|
76
96
|
}
|
77
97
|
|
98
|
+
private shouldLimitToSeedersOnly() {
|
99
|
+
return this.seederIds.length;
|
100
|
+
}
|
101
|
+
|
102
|
+
private getSeederIdsStr() {
|
103
|
+
return this.seederIds.map((id) => id.toStringWithoutVersion());
|
104
|
+
}
|
105
|
+
|
78
106
|
_calculateVersionMap() {
|
79
107
|
const versionMap: Map<string, { allVersionNodes: string[]; latestVersionNode: string }> = new Map();
|
80
108
|
for (const node of this.nodes) {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Component } from '@teambit/component';
|
1
|
+
import { Component, ComponentID } from '@teambit/component';
|
2
2
|
import { Graph } from 'cleargraph';
|
3
3
|
import { Dependency } from '../model/dependency';
|
4
4
|
import { DuplicateDependency } from '../duplicate-dependency';
|
@@ -17,11 +17,18 @@ export declare class ComponentGraph extends Graph<Component, Dependency> {
|
|
17
17
|
allVersionNodes: string[];
|
18
18
|
latestVersionNode: string;
|
19
19
|
}>;
|
20
|
+
seederIds: ComponentID[];
|
20
21
|
constructor(nodes?: Node[], edges?: Edge[]);
|
21
22
|
protected create(nodes?: Node[], edges?: Edge[]): this;
|
23
|
+
/**
|
24
|
+
* overrides the super class to eliminate non-seeders components
|
25
|
+
*/
|
26
|
+
findCycles(graph?: this): string[][];
|
22
27
|
findDuplicateDependencies(): Map<string, DuplicateDependency>;
|
23
28
|
buildFromCleargraph(graph: Graph<Component, Dependency>): ComponentGraph;
|
24
29
|
runtimeOnly(componentIds: string[]): this;
|
30
|
+
private shouldLimitToSeedersOnly;
|
31
|
+
private getSeederIdsStr;
|
25
32
|
_calculateVersionMap(): Map<string, {
|
26
33
|
allVersionNodes: string[];
|
27
34
|
latestVersionNode: string;
|
@@ -4,6 +4,8 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
4
4
|
|
5
5
|
require("core-js/modules/es.array.iterator.js");
|
6
6
|
|
7
|
+
require("core-js/modules/es.regexp.exec.js");
|
8
|
+
|
7
9
|
Object.defineProperty(exports, "__esModule", {
|
8
10
|
value: true
|
9
11
|
});
|
@@ -43,17 +45,39 @@ const DEPENDENCIES_TYPES = ['dependencies', 'devDependencies'];
|
|
43
45
|
exports.DEPENDENCIES_TYPES = DEPENDENCIES_TYPES;
|
44
46
|
|
45
47
|
class ComponentGraph extends _cleargraph().Graph {
|
48
|
+
// component IDs that started the graph. (if from workspace, the .bitmap ids normally)
|
46
49
|
constructor(nodes = [], edges = []) {
|
47
50
|
super(nodes, edges);
|
48
51
|
(0, _defineProperty2().default)(this, "versionMap", void 0);
|
52
|
+
(0, _defineProperty2().default)(this, "seederIds", []);
|
49
53
|
this.versionMap = new Map();
|
50
54
|
}
|
51
55
|
|
52
56
|
create(nodes = [], edges = []) {
|
53
57
|
return new ComponentGraph(nodes, edges);
|
54
58
|
}
|
59
|
+
/**
|
60
|
+
* overrides the super class to eliminate non-seeders components
|
61
|
+
*/
|
62
|
+
|
63
|
+
|
64
|
+
findCycles(graph) {
|
65
|
+
const cycles = super.findCycles(graph);
|
66
|
+
|
67
|
+
if (!this.shouldLimitToSeedersOnly()) {
|
68
|
+
return cycles;
|
69
|
+
}
|
70
|
+
|
71
|
+
const seederIdsStr = this.getSeederIdsStr();
|
72
|
+
const cyclesWithSeeders = cycles.filter(cycle => {
|
73
|
+
const cycleNoVersions = cycle.map(id => id.split('@')[0]);
|
74
|
+
return cycleNoVersions.some(cycleIdStr => seederIdsStr.includes(cycleIdStr));
|
75
|
+
});
|
76
|
+
return cyclesWithSeeders;
|
77
|
+
}
|
55
78
|
|
56
79
|
findDuplicateDependencies() {
|
80
|
+
const seederIdsNoVersions = this.getSeederIdsStr();
|
57
81
|
const duplicateDependencies = new Map();
|
58
82
|
|
59
83
|
for (const [compFullName, versions] of this.versionMap) {
|
@@ -72,8 +96,10 @@ class ComponentGraph extends _cleargraph().Graph {
|
|
72
96
|
};
|
73
97
|
versionSubgraphs.push(versionSubgraph);
|
74
98
|
});
|
99
|
+
const isSeeder = seederIdsNoVersions.includes(compFullName);
|
100
|
+
const shouldDisplayDueToBeingSeeder = !this.shouldLimitToSeedersOnly() || isSeeder;
|
75
101
|
|
76
|
-
if (versionSubgraphs.length > 0) {
|
102
|
+
if (shouldDisplayDueToBeingSeeder && versionSubgraphs.length > 0) {
|
77
103
|
const duplicateDep = new (_duplicateDependency().DuplicateDependency)(versions.latestVersionNode, versionSubgraphs);
|
78
104
|
duplicateDependencies.set(compFullName, duplicateDep);
|
79
105
|
}
|
@@ -109,6 +135,14 @@ class ComponentGraph extends _cleargraph().Graph {
|
|
109
135
|
return this.successorsSubgraph(componentIds, edge => edge.attr.type === 'runtime');
|
110
136
|
}
|
111
137
|
|
138
|
+
shouldLimitToSeedersOnly() {
|
139
|
+
return this.seederIds.length;
|
140
|
+
}
|
141
|
+
|
142
|
+
getSeederIdsStr() {
|
143
|
+
return this.seederIds.map(id => id.toStringWithoutVersion());
|
144
|
+
}
|
145
|
+
|
112
146
|
_calculateVersionMap() {
|
113
147
|
const versionMap = new Map();
|
114
148
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["component-graph.ts"],"names":["DEPENDENCIES_TYPES","ComponentGraph","Graph","constructor","nodes","edges","versionMap","Map","create","findDuplicateDependencies","duplicateDependencies","compFullName","versions","allVersionNodes","length","versionSubgraphs","notLatestVersions","filter","version","latestVersionNode","forEach","predecessors","predecessorsSubgraph","immediatePredecessors","map","predecessor","id","subGraph","buildFromCleargraph","versionSubgraph","versionId","immediateDependents","push","duplicateDep","DuplicateDependency","set","graph","newGraph","newGraphNodes","node","attr","newGraphEdges","edge","sourceId","targetId","setNodes","setEdges","runtimeOnly","componentIds","successorsSubgraph","type","_calculateVersionMap","comp","compKey","_legacy","toStringWithoutVersion","has","value","get","Object","prototype","hasOwnProperty","call","currentCompVersion","getVersion","latestCompVersion","isLaterThan"],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEO,MAAMA,kBAAkB,GAAG,CAAC,cAAD,EAAiB,iBAAjB,CAA3B;;;AAKA,MAAMC,cAAN,SAA6BC,mBAA7B,CAA0D;AAE/DC,EAAAA,WAAW,CAACC,KAAa,GAAG,EAAjB,EAAqBC,KAAa,GAAG,EAArC,EAAyC;AAClD,UAAMD,KAAN,EAAaC,KAAb;AADkD;AAElD,SAAKC,UAAL,GAAkB,IAAIC,GAAJ,EAAlB;AACD;;AAESC,EAAAA,MAAM,CAACJ,KAAa,GAAG,EAAjB,EAAqBC,KAAa,GAAG,EAArC,EAA+C;AAC7D,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;AACjCL,QAAAA,UAAU,CAAC6B,GAAX,CAAexB,YAAf,EAA6B;AAC3BE,UAAAA,eAAe,EAAE,CAACwC,OAAD,CADU;AAE3BlC,UAAAA,iBAAiB,EAAEkC;AAFQ,SAA7B;AAID,OALD,MAKO;AACL,cAAMI,KAAK,GAAGnD,UAAU,CAACoD,GAAX,CAAe/C,YAAf,CAAd;;AACA,YAAI8C,KAAJ,EAAW;AAAA;;AACT,cAAIE,MAAM,CAACC,SAAP,CAAiBC,cAAjB,CAAgCC,IAAhC,CAAqCL,KAArC,EAA4C,iBAA5C,CAAJ,EAAoE;AAClEA,YAAAA,KAAK,CAAC5C,eAAN,CAAsBmB,IAAtB,CAA2BqB,OAA3B;AACD;;AACD,gBAAMU,kBAAkB,iBAAG,KAAKxB,IAAL,CAAUc,OAAV,CAAH,+CAAG,WAAoBb,IAApB,CAAyBd,EAAzB,CAA4B4B,OAA5B,CAAoCU,UAApC,EAA3B;AACA,gBAAMC,iBAAiB,kBAAG,KAAK1B,IAAL,CAAUkB,KAAK,CAACtC,iBAAhB,CAAH,gDAAG,YAAoCqB,IAApC,CAAyCd,EAAzC,CAA4C4B,OAA5C,CAAoDU,UAApD,EAA1B;;AACA,cAAI,CAAC,CAACD,kBAAF,IAAwB,CAAC,CAACE,iBAA1B,IAA+CF,kBAAkB,CAACG,WAAnB,CAA+BD,iBAA/B,CAAnD,EAAsG;AACpGR,YAAAA,KAAK,CAACtC,iBAAN,GAA0BkC,OAA1B;AACD;AACF;AACF;AACF;;AACD,WAAO/C,UAAP;AACD;;AA5F8D","sourcesContent":["import { Component } from '@teambit/component';\nimport { Graph } from 'cleargraph';\n\nimport { Dependency } from '../model/dependency';\nimport { DuplicateDependency, VersionSubgraph } from '../duplicate-dependency';\n\nexport const DEPENDENCIES_TYPES = ['dependencies', 'devDependencies'];\n\ntype Node = { id: string; node: Component };\ntype Edge = { sourceId: string; targetId: string; edge: Dependency };\n\nexport class ComponentGraph extends Graph<Component, Dependency> {\n versionMap: Map<string, { allVersionNodes: string[]; latestVersionNode: string }>;\n constructor(nodes: Node[] = [], edges: Edge[] = []) {\n super(nodes, edges);\n this.versionMap = new Map();\n }\n\n protected create(nodes: Node[] = [], edges: Edge[] = []): this {\n return new ComponentGraph(nodes, edges) as this;\n }\n\n findDuplicateDependencies(): Map<string, DuplicateDependency> {\n const duplicateDependencies: Map<string, DuplicateDependency> = new Map();\n for (const [compFullName, versions] of this.versionMap) {\n if (versions.allVersionNodes.length > 1) {\n const versionSubgraphs: VersionSubgraph[] = [];\n const notLatestVersions = versions.allVersionNodes.filter((version) => version !== versions.latestVersionNode);\n notLatestVersions.forEach((version) => {\n const predecessors = this.predecessorsSubgraph(version);\n const immediatePredecessors = this.predecessors(version).map((predecessor) => predecessor.id);\n const subGraph = this.buildFromCleargraph(predecessors);\n const versionSubgraph: VersionSubgraph = {\n versionId: version,\n subGraph,\n // TODO: validate that this is working correctly\n immediateDependents: immediatePredecessors,\n };\n versionSubgraphs.push(versionSubgraph);\n });\n if (versionSubgraphs.length > 0) {\n const duplicateDep = new DuplicateDependency(versions.latestVersionNode, versionSubgraphs);\n duplicateDependencies.set(compFullName, duplicateDep);\n }\n }\n }\n return duplicateDependencies;\n }\n\n buildFromCleargraph(graph: Graph<Component, Dependency>): ComponentGraph {\n // TODO: once cleargraph constructor and graph.nodes are consistent we should just use this line\n // this.create(graph.nodes, graph.edges)\n\n const newGraph = new ComponentGraph();\n const newGraphNodes: Node[] = graph.nodes.map((node) => {\n return {\n id: node.id,\n node: node.attr,\n };\n });\n const newGraphEdges: Edge[] = graph.edges.map((edge) => {\n return {\n sourceId: edge.sourceId,\n targetId: edge.targetId,\n edge: edge.attr,\n };\n });\n newGraph.setNodes(newGraphNodes);\n newGraph.setEdges(newGraphEdges);\n\n return newGraph;\n }\n\n runtimeOnly(componentIds: string[]) {\n return this.successorsSubgraph(componentIds, (edge) => edge.attr.type === 'runtime');\n }\n\n _calculateVersionMap() {\n const versionMap: Map<string, { allVersionNodes: string[]; latestVersionNode: string }> = new Map();\n for (const node of this.nodes) {\n const comp = node.attr;\n const compKey = node.id;\n const compFullName = comp.id._legacy.toStringWithoutVersion();\n if (!versionMap.has(compFullName)) {\n versionMap.set(compFullName, {\n allVersionNodes: [compKey],\n latestVersionNode: compKey,\n });\n } else {\n const value = versionMap.get(compFullName);\n if (value) {\n if (Object.prototype.hasOwnProperty.call(value, 'allVersionNodes')) {\n value.allVersionNodes.push(compKey);\n }\n const currentCompVersion = this.node(compKey)?.attr.id._legacy.getVersion();\n const latestCompVersion = this.node(value.latestVersionNode)?.attr.id._legacy.getVersion();\n if (!!currentCompVersion && !!latestCompVersion && currentCompVersion.isLaterThan(latestCompVersion)) {\n value.latestVersionNode = compKey;\n }\n }\n }\n }\n return versionMap;\n }\n}\n"]}
|
1
|
+
{"version":3,"sources":["component-graph.ts"],"names":["DEPENDENCIES_TYPES","ComponentGraph","Graph","constructor","nodes","edges","versionMap","Map","create","findCycles","graph","cycles","shouldLimitToSeedersOnly","seederIdsStr","getSeederIdsStr","cyclesWithSeeders","filter","cycle","cycleNoVersions","map","id","split","some","cycleIdStr","includes","findDuplicateDependencies","seederIdsNoVersions","duplicateDependencies","compFullName","versions","allVersionNodes","length","versionSubgraphs","notLatestVersions","version","latestVersionNode","forEach","predecessors","predecessorsSubgraph","immediatePredecessors","predecessor","subGraph","buildFromCleargraph","versionSubgraph","versionId","immediateDependents","push","isSeeder","shouldDisplayDueToBeingSeeder","duplicateDep","DuplicateDependency","set","newGraph","newGraphNodes","node","attr","newGraphEdges","edge","sourceId","targetId","setNodes","setEdges","runtimeOnly","componentIds","successorsSubgraph","type","seederIds","toStringWithoutVersion","_calculateVersionMap","comp","compKey","_legacy","has","value","get","Object","prototype","hasOwnProperty","call","currentCompVersion","getVersion","latestCompVersion","isLaterThan"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA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,EAArB;;AACA,YAAMQ,YAAY,GAAGyC,IAAI,CAACjD,EAAL,CAAQmD,OAAR,CAAgBJ,sBAAhB,EAArB;;AACA,UAAI,CAAC7D,UAAU,CAACkE,GAAX,CAAe5C,YAAf,CAAL,EAAmC;AACjCtB,QAAAA,UAAU,CAAC6C,GAAX,CAAevB,YAAf,EAA6B;AAC3BE,UAAAA,eAAe,EAAE,CAACwC,OAAD,CADU;AAE3BnC,UAAAA,iBAAiB,EAAEmC;AAFQ,SAA7B;AAID,OALD,MAKO;AACL,cAAMG,KAAK,GAAGnE,UAAU,CAACoE,GAAX,CAAe9C,YAAf,CAAd;;AACA,YAAI6C,KAAJ,EAAW;AAAA;;AACT,cAAIE,MAAM,CAACC,SAAP,CAAiBC,cAAjB,CAAgCC,IAAhC,CAAqCL,KAArC,EAA4C,iBAA5C,CAAJ,EAAoE;AAClEA,YAAAA,KAAK,CAAC3C,eAAN,CAAsBgB,IAAtB,CAA2BwB,OAA3B;AACD;;AACD,gBAAMS,kBAAkB,iBAAG,KAAKzB,IAAL,CAAUgB,OAAV,CAAH,+CAAG,WAAoBf,IAApB,CAAyBnC,EAAzB,CAA4BmD,OAA5B,CAAoCS,UAApC,EAA3B;AACA,gBAAMC,iBAAiB,kBAAG,KAAK3B,IAAL,CAAUmB,KAAK,CAACtC,iBAAhB,CAAH,gDAAG,YAAoCoB,IAApC,CAAyCnC,EAAzC,CAA4CmD,OAA5C,CAAoDS,UAApD,EAA1B;;AACA,cAAI,CAAC,CAACD,kBAAF,IAAwB,CAAC,CAACE,iBAA1B,IAA+CF,kBAAkB,CAACG,WAAnB,CAA+BD,iBAA/B,CAAnD,EAAsG;AACpGR,YAAAA,KAAK,CAACtC,iBAAN,GAA0BmC,OAA1B;AACD;AACF;AACF;AACF;;AACD,WAAOhE,UAAP;AACD;;AAxH8D","sourcesContent":["import { Component, ComponentID } from '@teambit/component';\nimport { Graph } from 'cleargraph';\n\nimport { Dependency } from '../model/dependency';\nimport { DuplicateDependency, VersionSubgraph } from '../duplicate-dependency';\n\nexport const DEPENDENCIES_TYPES = ['dependencies', 'devDependencies'];\n\ntype Node = { id: string; node: Component };\ntype Edge = { sourceId: string; targetId: string; edge: Dependency };\n\nexport class ComponentGraph extends Graph<Component, Dependency> {\n versionMap: Map<string, { allVersionNodes: string[]; latestVersionNode: string }>;\n seederIds: ComponentID[] = []; // component IDs that started the graph. (if from workspace, the .bitmap ids normally)\n constructor(nodes: Node[] = [], edges: Edge[] = []) {\n super(nodes, edges);\n this.versionMap = new Map();\n }\n\n protected create(nodes: Node[] = [], edges: Edge[] = []): this {\n return new ComponentGraph(nodes, edges) as this;\n }\n\n /**\n * overrides the super class to eliminate non-seeders components\n */\n findCycles(graph?: this): string[][] {\n const cycles = super.findCycles(graph);\n if (!this.shouldLimitToSeedersOnly()) {\n return cycles;\n }\n const seederIdsStr = this.getSeederIdsStr();\n const cyclesWithSeeders = cycles.filter((cycle) => {\n const cycleNoVersions = cycle.map((id) => id.split('@')[0]);\n return cycleNoVersions.some((cycleIdStr) => seederIdsStr.includes(cycleIdStr));\n });\n return cyclesWithSeeders;\n }\n\n findDuplicateDependencies(): Map<string, DuplicateDependency> {\n const seederIdsNoVersions = this.getSeederIdsStr();\n const duplicateDependencies: Map<string, DuplicateDependency> = new Map();\n for (const [compFullName, versions] of this.versionMap) {\n if (versions.allVersionNodes.length > 1) {\n const versionSubgraphs: VersionSubgraph[] = [];\n const notLatestVersions = versions.allVersionNodes.filter((version) => version !== versions.latestVersionNode);\n notLatestVersions.forEach((version) => {\n const predecessors = this.predecessorsSubgraph(version);\n const immediatePredecessors = this.predecessors(version).map((predecessor) => predecessor.id);\n const subGraph = this.buildFromCleargraph(predecessors);\n const versionSubgraph: VersionSubgraph = {\n versionId: version,\n subGraph,\n // TODO: validate that this is working correctly\n immediateDependents: immediatePredecessors,\n };\n versionSubgraphs.push(versionSubgraph);\n });\n const isSeeder = seederIdsNoVersions.includes(compFullName);\n const shouldDisplayDueToBeingSeeder = !this.shouldLimitToSeedersOnly() || isSeeder;\n if (shouldDisplayDueToBeingSeeder && versionSubgraphs.length > 0) {\n const duplicateDep = new DuplicateDependency(versions.latestVersionNode, versionSubgraphs);\n duplicateDependencies.set(compFullName, duplicateDep);\n }\n }\n }\n return duplicateDependencies;\n }\n\n buildFromCleargraph(graph: Graph<Component, Dependency>): ComponentGraph {\n // TODO: once cleargraph constructor and graph.nodes are consistent we should just use this line\n // this.create(graph.nodes, graph.edges)\n\n const newGraph = new ComponentGraph();\n const newGraphNodes: Node[] = graph.nodes.map((node) => {\n return {\n id: node.id,\n node: node.attr,\n };\n });\n const newGraphEdges: Edge[] = graph.edges.map((edge) => {\n return {\n sourceId: edge.sourceId,\n targetId: edge.targetId,\n edge: edge.attr,\n };\n });\n newGraph.setNodes(newGraphNodes);\n newGraph.setEdges(newGraphEdges);\n\n return newGraph;\n }\n\n runtimeOnly(componentIds: string[]) {\n return this.successorsSubgraph(componentIds, (edge) => edge.attr.type === 'runtime');\n }\n\n private shouldLimitToSeedersOnly() {\n return this.seederIds.length;\n }\n\n private getSeederIdsStr() {\n return this.seederIds.map((id) => id.toStringWithoutVersion());\n }\n\n _calculateVersionMap() {\n const versionMap: Map<string, { allVersionNodes: string[]; latestVersionNode: string }> = new Map();\n for (const node of this.nodes) {\n const comp = node.attr;\n const compKey = node.id;\n const compFullName = comp.id._legacy.toStringWithoutVersion();\n if (!versionMap.has(compFullName)) {\n versionMap.set(compFullName, {\n allVersionNodes: [compKey],\n latestVersionNode: compKey,\n });\n } else {\n const value = versionMap.get(compFullName);\n if (value) {\n if (Object.prototype.hasOwnProperty.call(value, 'allVersionNodes')) {\n value.allVersionNodes.push(compKey);\n }\n const currentCompVersion = this.node(compKey)?.attr.id._legacy.getVersion();\n const latestCompVersion = this.node(value.latestVersionNode)?.attr.id._legacy.getVersion();\n if (!!currentCompVersion && !!latestCompVersion && currentCompVersion.isLaterThan(latestCompVersion)) {\n value.latestVersionNode = compKey;\n }\n }\n }\n }\n return versionMap;\n }\n}\n"]}
|
package/dist/graph-builder.d.ts
CHANGED
@@ -3,6 +3,11 @@ import { ComponentGraph } from './component-graph';
|
|
3
3
|
declare type GetGraphOpts = {
|
4
4
|
host?: ComponentFactory;
|
5
5
|
};
|
6
|
+
/**
|
7
|
+
* @todo: potential issues with the current way the class is built.
|
8
|
+
* it's possible to call `getGraph` multiple times and at the same time (Promise.all).
|
9
|
+
* which makes the _graph prop and other props unpredictable.
|
10
|
+
*/
|
6
11
|
export declare class GraphBuilder {
|
7
12
|
private componentAspect;
|
8
13
|
_graph?: ComponentGraph;
|
package/dist/graph-builder.js
CHANGED
@@ -41,6 +41,11 @@ function _dependency() {
|
|
41
41
|
return data;
|
42
42
|
}
|
43
43
|
|
44
|
+
/**
|
45
|
+
* @todo: potential issues with the current way the class is built.
|
46
|
+
* it's possible to call `getGraph` multiple times and at the same time (Promise.all).
|
47
|
+
* which makes the _graph prop and other props unpredictable.
|
48
|
+
*/
|
44
49
|
class GraphBuilder {
|
45
50
|
constructor(componentAspect) {
|
46
51
|
this.componentAspect = componentAspect;
|
@@ -56,6 +61,7 @@ class GraphBuilder {
|
|
56
61
|
});
|
57
62
|
this._graph = graph;
|
58
63
|
this._initialized = true;
|
64
|
+
graph.seederIds = ids || (await componentHost.listIds());
|
59
65
|
return this._graph;
|
60
66
|
}
|
61
67
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["graph-builder.ts"],"names":["GraphBuilder","constructor","componentAspect","getGraph","ids","opts","componentHost","host","getHost","legacyGraph","getLegacyGraph","graph","buildFromLegacy","_graph","_initialized","newGraph","ComponentGraph","setNodeP","nodes","map","nodeId","componentId","resolveComponentId","component","get","setNode","toString","Promise","all","setEdgePromise","edges","edgeId","source","v","target","w","edgeObj","edge","Dependency","setEdge","versionMap","_calculateVersionMap"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;
|
1
|
+
{"version":3,"sources":["graph-builder.ts"],"names":["GraphBuilder","constructor","componentAspect","getGraph","ids","opts","componentHost","host","getHost","legacyGraph","getLegacyGraph","graph","buildFromLegacy","_graph","_initialized","seederIds","listIds","newGraph","ComponentGraph","setNodeP","nodes","map","nodeId","componentId","resolveComponentId","component","get","setNode","toString","Promise","all","setEdgePromise","edges","edgeId","source","v","target","w","edgeObj","edge","Dependency","setEdge","versionMap","_calculateVersionMap"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAUA;AACA;AACA;AACA;AACA;AACO,MAAMA,YAAN,CAAmB;AAGxBC,EAAAA,WAAW,CAASC,eAAT,EAAyC;AAAA,SAAhCA,eAAgC,GAAhCA,eAAgC;AAAA;AAAA,0DADrC,KACqC;AAAE;;AAExC,QAARC,QAAQ,CAACC,GAAD,EAAsBC,IAAkB,GAAG,EAA3C,EAAwE;AACpF,UAAMC,aAAa,GAAGD,IAAI,CAACE,IAAL,IAAa,KAAKL,eAAL,CAAqBM,OAArB,EAAnC;AAEA,UAAMC,WAAW,GAAG,MAAMH,aAAa,CAACI,cAAd,CAA6BN,GAA7B,CAA1B;AACA,UAAMO,KAAK,GAAG,MAAM,KAAKC,eAAL,CAAqBH,WAArB,EAAkC;AAAEF,MAAAA,IAAI,EAAEF,IAAI,CAACE;AAAb,KAAlC,CAApB;AACA,SAAKM,MAAL,GAAcF,KAAd;AACA,SAAKG,YAAL,GAAoB,IAApB;AACAH,IAAAA,KAAK,CAACI,SAAN,GAAkBX,GAAG,KAAK,MAAME,aAAa,CAACU,OAAd,EAAX,CAArB;AACA,WAAO,KAAKH,MAAZ;AACD;;AAE4B,QAAfD,eAAe,CAC3BH,WAD2B,EAE3BJ,IAA8B,GAAG,EAFN,EAGF;AACzB,UAAMY,QAAQ,GAAG,KAAIC,gCAAJ,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,oBAAT,EAAtB;AACA,WAAO1B,QAAP;AACD;;AA3CuB","sourcesContent":["import { ComponentFactory, ComponentID, ComponentMain } from '@teambit/component';\nimport type LegacyGraph from '@teambit/legacy/dist/scope/graph/graph';\nimport { ComponentGraph } from './component-graph';\nimport { Dependency } from './model/dependency';\n\ntype GetGraphOpts = {\n host?: ComponentFactory;\n};\n\ntype BuildFromLegacyGraphOpts = {\n host?: ComponentFactory;\n};\n\n/**\n * @todo: potential issues with the current way the class is built.\n * it's possible to call `getGraph` multiple times and at the same time (Promise.all).\n * which makes the _graph prop and other props unpredictable.\n */\nexport class GraphBuilder {\n _graph?: ComponentGraph;\n _initialized = false;\n constructor(private componentAspect: ComponentMain) {}\n\n async getGraph(ids?: ComponentID[], opts: GetGraphOpts = {}): Promise<ComponentGraph> {\n const componentHost = opts.host || this.componentAspect.getHost();\n\n const legacyGraph = await componentHost.getLegacyGraph(ids);\n const graph = await this.buildFromLegacy(legacyGraph, { host: opts.host });\n this._graph = graph;\n this._initialized = true;\n graph.seederIds = ids || (await componentHost.listIds());\n return this._graph;\n }\n\n private async buildFromLegacy(\n legacyGraph: LegacyGraph,\n opts: BuildFromLegacyGraphOpts = {}\n ): Promise<ComponentGraph> {\n const newGraph = new ComponentGraph();\n const componentHost = opts.host || this.componentAspect.getHost();\n\n const setNodeP = legacyGraph.nodes().map(async (nodeId) => {\n const componentId = await componentHost.resolveComponentId(nodeId);\n const component = await componentHost.get(componentId);\n if (component) {\n newGraph.setNode(componentId.toString(), component);\n }\n });\n await Promise.all(setNodeP);\n\n const setEdgePromise = legacyGraph.edges().map(async (edgeId) => {\n const source = await componentHost.resolveComponentId(edgeId.v);\n const target = await componentHost.resolveComponentId(edgeId.w);\n const edgeObj =\n legacyGraph.edge(edgeId.v, edgeId.w) === 'dependencies' ? new Dependency('runtime') : new Dependency('dev');\n newGraph.setEdge(source.toString(), target.toString(), edgeObj);\n });\n await Promise.all(setEdgePromise);\n\n newGraph.versionMap = newGraph._calculateVersionMap();\n return newGraph;\n }\n}\n"]}
|
Binary file
|
package/package.json
CHANGED
@@ -1,21 +1,21 @@
|
|
1
1
|
{
|
2
2
|
"name": "@teambit/graph",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.587",
|
4
4
|
"homepage": "https://bit.dev/teambit/component/graph",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"componentId": {
|
7
7
|
"scope": "teambit.component",
|
8
8
|
"name": "graph",
|
9
|
-
"version": "0.0.
|
9
|
+
"version": "0.0.587"
|
10
10
|
},
|
11
11
|
"dependencies": {
|
12
12
|
"@teambit/harmony": "0.2.11",
|
13
13
|
"graphql-tag": "2.12.1",
|
14
14
|
"cleargraph": "7.0.0",
|
15
15
|
"lodash": "4.17.21",
|
16
|
-
"classnames": "2.2.6",
|
17
16
|
"react-flow-renderer": "8.3.7",
|
18
17
|
"dagre": "0.8.5",
|
18
|
+
"classnames": "2.2.6",
|
19
19
|
"react-router-dom": "5.2.0",
|
20
20
|
"@babel/runtime": "7.12.18",
|
21
21
|
"core-js": "^3.0.0",
|
@@ -23,23 +23,23 @@
|
|
23
23
|
"@teambit/base-ui.text.muted-text": "1.0.1",
|
24
24
|
"@teambit/evangelist.input.checkbox.label": "1.0.3",
|
25
25
|
"@teambit/documenter.ui.heading": "4.1.1",
|
26
|
-
"@teambit/component": "0.0.
|
27
|
-
"@teambit/graphql": "0.0.
|
28
|
-
"@teambit/cli": "0.0.
|
29
|
-
"@teambit/ui": "0.0.
|
30
|
-
"@teambit/legacy-bit-id": "0.0.
|
31
|
-
"@teambit/component.ui.deprecation-icon": "0.0.
|
26
|
+
"@teambit/component": "0.0.587",
|
27
|
+
"@teambit/graphql": "0.0.587",
|
28
|
+
"@teambit/cli": "0.0.403",
|
29
|
+
"@teambit/ui": "0.0.587",
|
30
|
+
"@teambit/legacy-bit-id": "0.0.392",
|
31
|
+
"@teambit/component.ui.deprecation-icon": "0.0.486",
|
32
32
|
"@teambit/design.ui.styles.ellipsis": "0.0.346",
|
33
|
-
"@teambit/envs.ui.env-icon": "0.0.
|
33
|
+
"@teambit/envs.ui.env-icon": "0.0.480",
|
34
34
|
"@teambit/design.ui.pages.not-found": "0.0.352",
|
35
35
|
"@teambit/design.ui.pages.server-error": "0.0.352",
|
36
|
-
"@teambit/ui-foundation.ui.hooks.use-data-query": "0.0.
|
36
|
+
"@teambit/ui-foundation.ui.hooks.use-data-query": "0.0.481"
|
37
37
|
},
|
38
38
|
"devDependencies": {
|
39
39
|
"@types/react": "^17.0.8",
|
40
40
|
"@types/lodash": "4.14.165",
|
41
|
-
"@types/classnames": "2.2.11",
|
42
41
|
"@types/dagre": "0.7.44",
|
42
|
+
"@types/classnames": "2.2.11",
|
43
43
|
"@types/react-router-dom": "5.1.7",
|
44
44
|
"@types/mocha": "5.2.7",
|
45
45
|
"@types/testing-library__jest-dom": "5.9.5",
|
@@ -49,7 +49,7 @@
|
|
49
49
|
},
|
50
50
|
"peerDependencies": {
|
51
51
|
"@apollo/client": "^3.0.0",
|
52
|
-
"@teambit/legacy": "1.0.
|
52
|
+
"@teambit/legacy": "1.0.189",
|
53
53
|
"react-dom": "^16.8.0 || ^17.0.0",
|
54
54
|
"react": "^16.8.0 || ^17.0.0"
|
55
55
|
},
|
@@ -77,7 +77,7 @@
|
|
77
77
|
"react": "-"
|
78
78
|
},
|
79
79
|
"peerDependencies": {
|
80
|
-
"@teambit/legacy": "1.0.
|
80
|
+
"@teambit/legacy": "1.0.189",
|
81
81
|
"react-dom": "^16.8.0 || ^17.0.0",
|
82
82
|
"react": "^16.8.0 || ^17.0.0"
|
83
83
|
}
|
Binary file
|