@teambit/graph 1.0.541 → 1.0.542
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/dist/graph-cmd.d.ts +8 -7
- package/dist/graph-cmd.js +42 -72
- package/dist/graph-cmd.js.map +1 -1
- package/dist/graph.main.runtime.d.ts +8 -0
- package/dist/graph.main.runtime.js +61 -1
- package/dist/graph.main.runtime.js.map +1 -1
- package/dist/{preview-1739244007270.js → preview-1739330417900.js} +2 -2
- package/package.json +11 -11
package/dist/graph-cmd.d.ts
CHANGED
@@ -1,15 +1,17 @@
|
|
1
1
|
import { Command, CommandOptions } from '@teambit/cli';
|
2
2
|
import { ComponentMain } from '@teambit/component';
|
3
|
-
|
3
|
+
import { GraphMain } from './graph.main.runtime';
|
4
|
+
export type GraphOpt = {
|
4
5
|
remote?: string;
|
5
|
-
allVersions?: boolean;
|
6
6
|
layout?: string;
|
7
7
|
cycles?: boolean;
|
8
8
|
png?: boolean;
|
9
9
|
json?: boolean;
|
10
|
+
includeLocalOnly?: boolean;
|
10
11
|
};
|
11
12
|
export declare class GraphCmd implements Command {
|
12
13
|
private componentAspect;
|
14
|
+
private graph;
|
13
15
|
name: string;
|
14
16
|
description: string;
|
15
17
|
extendedDescription: 'black arrow is a runtime dependency. red arrow is either dev or peer';
|
@@ -17,10 +19,9 @@ export declare class GraphCmd implements Command {
|
|
17
19
|
alias: string;
|
18
20
|
options: CommandOptions;
|
19
21
|
remoteOp: boolean;
|
20
|
-
constructor(componentAspect: ComponentMain);
|
21
|
-
report([id]: [string],
|
22
|
-
private generateGraphFromWorkspace;
|
23
|
-
private generateGraphFromRemote;
|
22
|
+
constructor(componentAspect: ComponentMain, graph: GraphMain);
|
23
|
+
report([id]: [string], graphOpts: GraphOpt): Promise<string>;
|
24
24
|
json([id]: [string], { remote }: GraphOpt): Promise<any>;
|
25
|
+
private getWorkspaceIfExist;
|
26
|
+
private generateGraphFromRemote;
|
25
27
|
}
|
26
|
-
export {};
|
package/dist/graph-cmd.js
CHANGED
@@ -18,13 +18,6 @@ function _graphlib() {
|
|
18
18
|
};
|
19
19
|
return data;
|
20
20
|
}
|
21
|
-
function _lodash() {
|
22
|
-
const data = require("lodash");
|
23
|
-
_lodash = function () {
|
24
|
-
return data;
|
25
|
-
};
|
26
|
-
return data;
|
27
|
-
}
|
28
21
|
function _componentId() {
|
29
22
|
const data = require("@teambit/component-id");
|
30
23
|
_componentId = function () {
|
@@ -46,80 +39,69 @@ function _scope() {
|
|
46
39
|
};
|
47
40
|
return data;
|
48
41
|
}
|
49
|
-
function _workspace() {
|
50
|
-
const data = require("@teambit/workspace");
|
51
|
-
_workspace = function () {
|
52
|
-
return data;
|
53
|
-
};
|
54
|
-
return data;
|
55
|
-
}
|
56
42
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
57
43
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
58
44
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
59
45
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
60
46
|
class GraphCmd {
|
61
|
-
constructor(componentAspect) {
|
47
|
+
constructor(componentAspect, graph) {
|
62
48
|
this.componentAspect = componentAspect;
|
49
|
+
this.graph = graph;
|
63
50
|
_defineProperty(this, "name", 'graph [id]');
|
64
|
-
_defineProperty(this, "description", "generate an SVG image file with the
|
51
|
+
_defineProperty(this, "description", "generate an SVG image file with the components' dependencies graph");
|
65
52
|
_defineProperty(this, "extendedDescription", void 0);
|
66
53
|
_defineProperty(this, "group", 'discover');
|
67
54
|
_defineProperty(this, "alias", '');
|
68
|
-
_defineProperty(this, "options", [['r', 'remote [remoteName]', 'remote name (name is optional, leave empty when id is specified)'], ['', 'layout <name>', 'GraphVis layout. default to "dot". options are [circo, dot, fdp, neato, osage, patchwork, sfdp, twopi]'], ['', 'png', 'save the graph as a png file instead of svg. requires "graphviz" to be installed'], ['', 'cycles', '
|
55
|
+
_defineProperty(this, "options", [['r', 'remote [remoteName]', 'remote name (name is optional, leave empty when id is specified)'], ['', 'layout <name>', 'GraphVis layout. default to "dot". options are [circo, dot, fdp, neato, osage, patchwork, sfdp, twopi]'], ['', 'png', 'save the graph as a png file instead of svg. requires "graphviz" to be installed'], ['', 'cycles', 'generate a graph of cycles only'], ['', 'include-local-only', 'include only the components in the workspace (or local scope)'], ['j', 'json', 'json format']]);
|
69
56
|
_defineProperty(this, "remoteOp", true);
|
70
57
|
}
|
71
|
-
async report([id], {
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
const
|
78
|
-
if (!workspace && !remote) throw new (_workspace().OutsideWorkspaceError)();
|
79
|
-
const config = {};
|
80
|
-
if (layout) config.layout = layout;
|
58
|
+
async report([id], graphOpts) {
|
59
|
+
const {
|
60
|
+
remote,
|
61
|
+
layout,
|
62
|
+
png
|
63
|
+
} = graphOpts;
|
64
|
+
const host = this.componentAspect.getHost();
|
81
65
|
const getVisualGraph = async () => {
|
82
|
-
if (
|
83
|
-
const
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
return workspace.getIdIfExist(compId);
|
88
|
-
};
|
89
|
-
const idWithVersion = await getIdWithVersion();
|
90
|
-
const markIds = idWithVersion ? [idWithVersion.toString()] : undefined;
|
91
|
-
if (!cycles) {
|
92
|
-
return _legacy().VisualDependencyGraph.loadFromClearGraph(graph, config, markIds);
|
93
|
-
}
|
94
|
-
const cyclesGraph = graph.findCycles();
|
95
|
-
const multipleCycles = cyclesGraph.map(cycle => {
|
96
|
-
if (idWithVersion && !cycle.includes(idWithVersion.toString())) return undefined;
|
97
|
-
return graph.subgraph(cycle, {
|
98
|
-
nodeFilter: node => cycle.includes(node.id),
|
99
|
-
edgeFilter: edge => cycle.includes(edge.targetId)
|
100
|
-
});
|
101
|
-
});
|
102
|
-
return _legacy().VisualDependencyGraph.loadFromMultipleClearGraphs((0, _lodash().compact)(multipleCycles), config, markIds);
|
66
|
+
if (remote) {
|
67
|
+
const config = {};
|
68
|
+
if (layout) config.layout = layout;
|
69
|
+
const graph = await this.generateGraphFromRemote(remote, id);
|
70
|
+
return _legacy().VisualDependencyGraph.loadFromGraphlib(graph, config);
|
103
71
|
}
|
104
|
-
const
|
105
|
-
|
72
|
+
const compId = id ? await host.resolveComponentId(id) : undefined;
|
73
|
+
const compIds = compId ? [compId] : undefined;
|
74
|
+
return this.graph.getVisualGraphIds(compIds, graphOpts);
|
106
75
|
};
|
107
76
|
const visualDependencyGraph = await getVisualGraph();
|
108
77
|
const result = await visualDependencyGraph.render(png ? 'png' : 'svg');
|
109
78
|
return _chalk().default.green(`image created at ${result}`);
|
110
79
|
}
|
111
|
-
async
|
112
|
-
|
113
|
-
|
114
|
-
|
80
|
+
async json([id], {
|
81
|
+
remote
|
82
|
+
}) {
|
83
|
+
const host = this.componentAspect.getHost();
|
84
|
+
if (!remote) {
|
85
|
+
const graph = await this.graph.getGraphIds(id ? [await host.resolveComponentId(id)] : undefined);
|
86
|
+
return graph.toJson();
|
87
|
+
}
|
88
|
+
const graph = await this.generateGraphFromRemote(remote, id);
|
89
|
+
return _graphlib().default.json.write(graph);
|
90
|
+
}
|
91
|
+
getWorkspaceIfExist() {
|
92
|
+
try {
|
93
|
+
return this.componentAspect.getHost('teambit.workspace/workspace');
|
94
|
+
} catch {
|
95
|
+
return undefined;
|
96
|
+
}
|
115
97
|
}
|
116
|
-
async generateGraphFromRemote(remote, id
|
117
|
-
const
|
118
|
-
|
119
|
-
|
120
|
-
const scopeName = typeof remote === 'string' ? remote :
|
98
|
+
async generateGraphFromRemote(remote, id) {
|
99
|
+
const workspace = this.getWorkspaceIfExist();
|
100
|
+
const compId = id ? _componentId().ComponentID.fromString(id) : undefined;
|
101
|
+
if (compId) {
|
102
|
+
const scopeName = typeof remote === 'string' ? remote : compId.scope;
|
121
103
|
const remoteScope = await (0, _scope().getRemoteByName)(scopeName, workspace?.consumer);
|
122
|
-
const componentDepGraph = await remoteScope.graph(
|
104
|
+
const componentDepGraph = await remoteScope.graph(compId);
|
123
105
|
return componentDepGraph.graph;
|
124
106
|
}
|
125
107
|
if (typeof remote !== 'string') {
|
@@ -129,18 +111,6 @@ class GraphCmd {
|
|
129
111
|
const componentDepGraph = await remoteScope.graph();
|
130
112
|
return componentDepGraph.graph;
|
131
113
|
}
|
132
|
-
async json([id], {
|
133
|
-
remote
|
134
|
-
}) {
|
135
|
-
const workspace = this.componentAspect.getHost('teambit.workspace/workspace');
|
136
|
-
if (!workspace && !remote) throw new (_workspace().OutsideWorkspaceError)();
|
137
|
-
if (workspace && !remote) {
|
138
|
-
const graph = await this.generateGraphFromWorkspace(workspace, id);
|
139
|
-
return graph.toJson();
|
140
|
-
}
|
141
|
-
const graph = await this.generateGraphFromRemote(remote, id, workspace);
|
142
|
-
return _graphlib().default.json.write(graph);
|
143
|
-
}
|
144
114
|
}
|
145
115
|
exports.GraphCmd = GraphCmd;
|
146
116
|
|
package/dist/graph-cmd.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_graphlib","_lodash","_componentId","_legacy","_scope","_workspace","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","GraphCmd","constructor","componentAspect","report","id","remote","layout","png","cycles","workspace","getHost","OutsideWorkspaceError","config","getVisualGraph","graph","generateGraphFromWorkspace","getIdWithVersion","undefined","compId","resolveComponentId","getIdIfExist","idWithVersion","markIds","toString","VisualDependencyGraph","loadFromClearGraph","cyclesGraph","findCycles","multipleCycles","map","cycle","includes","subgraph","nodeFilter","node","edgeFilter","edge","targetId","loadFromMultipleClearGraphs","compact","generateGraphFromRemote","loadFromGraphlib","visualDependencyGraph","result","render","chalk","green","compIds","getGraphIds","bitId","ComponentID","fromString","scopeName","scope","remoteScope","getRemoteByName","consumer","componentDepGraph","Error","json","toJson","GraphLib","write","exports"],"sources":["graph-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport GraphLib from 'graphlib';\nimport { compact } from 'lodash';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { ComponentID } from '@teambit/component-id';\nimport { GraphConfig, VisualDependencyGraph } from '@teambit/legacy.dependency-graph';\nimport { getRemoteByName } from '@teambit/scope.remotes';\nimport { ComponentMain } from '@teambit/component';\nimport { OutsideWorkspaceError, Workspace } from '@teambit/workspace';\n\ntype GraphOpt = {\n remote?: string;\n allVersions?: boolean;\n layout?: string;\n cycles?: boolean;\n png?: boolean;\n json?: boolean;\n};\n\nexport class GraphCmd implements Command {\n name = 'graph [id]';\n description = \"generate an SVG image file with the workspace components' dependencies graph\";\n extendedDescription: 'black arrow is a runtime dependency. red arrow is either dev or peer';\n group = 'discover';\n alias = '';\n options = [\n ['r', 'remote [remoteName]', 'remote name (name is optional, leave empty when id is specified)'],\n [\n '',\n 'layout <name>',\n 'GraphVis layout. default to \"dot\". options are [circo, dot, fdp, neato, osage, patchwork, sfdp, twopi]',\n ],\n ['', 'png', 'save the graph as a png file instead of svg. requires \"graphviz\" to be installed'],\n ['', 'cycles', 'show cycles in the graph'],\n ['j', 'json', 'json format'],\n ] as CommandOptions;\n remoteOp = true;\n\n constructor(private componentAspect: ComponentMain) {}\n\n async report([id]: [string], { remote, layout, png, cycles }: GraphOpt): Promise<string> {\n const workspace = this.componentAspect.getHost('teambit.workspace/workspace') as Workspace;\n if (!workspace && !remote) throw new OutsideWorkspaceError();\n\n const config: GraphConfig = {};\n if (layout) config.layout = layout;\n\n const getVisualGraph = async (): Promise<VisualDependencyGraph> => {\n if (workspace && !remote) {\n const graph = await this.generateGraphFromWorkspace(workspace, id);\n const getIdWithVersion = async () => {\n if (!id) return undefined;\n const compId = await workspace.resolveComponentId(id);\n return workspace.getIdIfExist(compId);\n }\n const idWithVersion = await getIdWithVersion();\n const markIds = idWithVersion ? [idWithVersion.toString()] : undefined;\n if (!cycles) {\n return VisualDependencyGraph.loadFromClearGraph(graph, config, markIds);\n }\n const cyclesGraph = graph.findCycles();\n\n const multipleCycles = cyclesGraph.map((cycle) => {\n if (idWithVersion && !cycle.includes(idWithVersion.toString())) return undefined;\n return graph.subgraph(cycle,\n {\n nodeFilter: (node) => cycle.includes(node.id),\n edgeFilter: (edge) => cycle.includes(edge.targetId)\n },\n );\n });\n return VisualDependencyGraph.loadFromMultipleClearGraphs(compact(multipleCycles), config, markIds);\n }\n const graph = await this.generateGraphFromRemote(remote!, id, workspace);\n return VisualDependencyGraph.loadFromGraphlib(graph, config);\n }\n\n const visualDependencyGraph = await getVisualGraph();\n const result = await visualDependencyGraph.render(png ? 'png' : 'svg');\n\n return chalk.green(`image created at ${result}`);\n }\n\n private async generateGraphFromWorkspace(workspace: Workspace, id?: string) {\n const compIds = id ? [await workspace.resolveComponentId(id)] : undefined;\n const graph = await workspace.getGraphIds(compIds);\n return graph;\n }\n\n private async generateGraphFromRemote(\n remote: string | boolean,\n id?: string,\n workspace?: Workspace,\n ): Promise<GraphLib.Graph> {\n const bitId = id ? ComponentID.fromString(id) : undefined;\n if (id) {\n // @ts-ignore scope must be set as it came from a remote\n const scopeName: string = typeof remote === 'string' ? remote : bitId.scope;\n const remoteScope = await getRemoteByName(scopeName, workspace?.consumer);\n const componentDepGraph = await remoteScope.graph(bitId);\n return componentDepGraph.graph;\n }\n if (typeof remote !== 'string') {\n throw new Error('please specify remote scope name or enter an id');\n }\n const remoteScope = await getRemoteByName(remote, workspace?.consumer);\n const componentDepGraph = await remoteScope.graph();\n return componentDepGraph.graph;\n }\n\n async json([id]: [string], { remote }: GraphOpt) {\n const workspace = this.componentAspect.getHost('teambit.workspace/workspace') as Workspace;\n if (!workspace && !remote) throw new OutsideWorkspaceError();\n\n if (workspace && !remote) {\n const graph = await this.generateGraphFromWorkspace(workspace, id);\n return graph.toJson();\n }\n const graph = await this.generateGraphFromRemote(remote!, id, workspace);\n return GraphLib.json.write(graph);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,UAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,SAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,aAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,YAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,QAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,OAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,OAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,MAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAQ,WAAA;EAAA,MAAAR,IAAA,GAAAE,OAAA;EAAAM,UAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAsE,SAAAC,uBAAAQ,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,C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CAAChD,KAAK,CAAC;EACnC;AACF;AAACiD,OAAA,CAAA/D,QAAA,GAAAA,QAAA","ignoreList":[]}
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_graphlib","_componentId","_legacy","_scope","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","GraphCmd","constructor","componentAspect","graph","report","id","graphOpts","remote","layout","png","host","getHost","getVisualGraph","config","generateGraphFromRemote","VisualDependencyGraph","loadFromGraphlib","compId","resolveComponentId","undefined","compIds","getVisualGraphIds","visualDependencyGraph","result","render","chalk","green","json","getGraphIds","toJson","GraphLib","write","getWorkspaceIfExist","workspace","ComponentID","fromString","scopeName","scope","remoteScope","getRemoteByName","consumer","componentDepGraph","Error","exports"],"sources":["graph-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport GraphLib from 'graphlib';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { ComponentID } from '@teambit/component-id';\nimport { GraphConfig, VisualDependencyGraph } from '@teambit/legacy.dependency-graph';\nimport { getRemoteByName } from '@teambit/scope.remotes';\nimport { ComponentMain } from '@teambit/component';\nimport type { Workspace } from '@teambit/workspace';\nimport { GraphMain } from './graph.main.runtime';\n\nexport type GraphOpt = {\n remote?: string;\n layout?: string;\n cycles?: boolean;\n png?: boolean;\n json?: boolean;\n includeLocalOnly?: boolean;\n};\n\nexport class GraphCmd implements Command {\n name = 'graph [id]';\n description = \"generate an SVG image file with the components' dependencies graph\";\n extendedDescription: 'black arrow is a runtime dependency. red arrow is either dev or peer';\n group = 'discover';\n alias = '';\n options = [\n ['r', 'remote [remoteName]', 'remote name (name is optional, leave empty when id is specified)'],\n [\n '',\n 'layout <name>',\n 'GraphVis layout. default to \"dot\". options are [circo, dot, fdp, neato, osage, patchwork, sfdp, twopi]',\n ],\n ['', 'png', 'save the graph as a png file instead of svg. requires \"graphviz\" to be installed'],\n ['', 'cycles', 'generate a graph of cycles only'],\n ['', 'include-local-only', 'include only the components in the workspace (or local scope)'],\n ['j', 'json', 'json format'],\n ] as CommandOptions;\n remoteOp = true;\n\n constructor(private componentAspect: ComponentMain, private graph: GraphMain) {}\n\n async report([id]: [string], graphOpts: GraphOpt): Promise<string> {\n const { remote, layout, png } = graphOpts;\n const host = this.componentAspect.getHost();\n\n const getVisualGraph = async (): Promise<VisualDependencyGraph> => {\n if (remote) {\n const config: GraphConfig = {};\n if (layout) config.layout = layout;\n const graph = await this.generateGraphFromRemote(remote, id);\n return VisualDependencyGraph.loadFromGraphlib(graph, config);\n }\n const compId = id ? await host.resolveComponentId(id) : undefined;\n const compIds = compId ? [compId] : undefined\n return this.graph.getVisualGraphIds(compIds, graphOpts);\n }\n\n const visualDependencyGraph = await getVisualGraph();\n const result = await visualDependencyGraph.render(png ? 'png' : 'svg');\n\n return chalk.green(`image created at ${result}`);\n }\n\n async json([id]: [string], { remote }: GraphOpt) {\n const host = this.componentAspect.getHost();\n if (!remote) {\n const graph = await this.graph.getGraphIds(id ? [await host.resolveComponentId(id)] : undefined);\n return graph.toJson();\n }\n const graph = await this.generateGraphFromRemote(remote!, id);\n return GraphLib.json.write(graph);\n }\n\n private getWorkspaceIfExist(): Workspace | undefined {\n try {\n return this.componentAspect.getHost('teambit.workspace/workspace') as Workspace | undefined;\n } catch {\n return undefined;\n }\n }\n\n private async generateGraphFromRemote(\n remote: string | boolean,\n id?: string,\n ): Promise<GraphLib.Graph> {\n const workspace = this.getWorkspaceIfExist();\n const compId = id ? ComponentID.fromString(id) : undefined;\n if (compId) {\n const scopeName: string = typeof remote === 'string' ? remote : compId.scope;\n const remoteScope = await getRemoteByName(scopeName, workspace?.consumer);\n const componentDepGraph = await remoteScope.graph(compId);\n return componentDepGraph.graph;\n }\n if (typeof remote !== 'string') {\n throw new Error('please specify remote scope name or enter an id');\n }\n const remoteScope = await getRemoteByName(remote, workspace?.consumer);\n const componentDepGraph = await remoteScope.graph();\n return componentDep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AC5B,KAAK,CAAC;EACnC;EAEQ6B,mBAAmBA,CAAA,EAA0B;IACnD,IAAI;MACF,OAAO,IAAI,CAAC9B,eAAe,CAACS,OAAO,CAAC,6BAA6B,CAAC;IACpE,CAAC,CAAC,MAAM;MACN,OAAOQ,SAAS;IAClB;EACF;EAEA,MAAcL,uBAAuBA,CACnCP,MAAwB,EACxBF,EAAW,EACc;IACzB,MAAM4B,SAAS,GAAG,IAAI,CAACD,mBAAmB,CAAC,CAAC;IAC5C,MAAMf,MAAM,GAAGZ,EAAE,GAAG6B,0BAAW,CAACC,UAAU,CAAC9B,EAAE,CAAC,GAAGc,SAAS;IAC1D,IAAIF,MAAM,EAAE;MACV,MAAMmB,SAAiB,GAAG,OAAO7B,MAAM,KAAK,QAAQ,GAAGA,MAAM,GAAGU,MAAM,CAACoB,KAAK;MAC5E,MAAMC,WAAW,GAAG,MAAM,IAAAC,wBAAe,EAACH,SAAS,EAAEH,SAAS,EAAEO,QAAQ,CAAC;MACzE,MAAMC,iBAAiB,GAAG,MAAMH,WAAW,CAACnC,KAAK,CAACc,MAAM,CAAC;MACzD,OAAOwB,iBAAiB,CAACtC,KAAK;IAChC;IACA,IAAI,OAAOI,MAAM,KAAK,QAAQ,EAAE;MAC9B,MAAM,IAAImC,KAAK,CAAC,iDAAiD,CAAC;IACpE;IACA,MAAMJ,WAAW,GAAG,MAAM,IAAAC,wBAAe,EAAChC,MAAM,EAAE0B,SAAS,EAAEO,QAAQ,CAAC;IACtE,MAAMC,iBAAiB,GAAG,MAAMH,WAAW,CAACnC,KAAK,CAAC,CAAC;IACnD,OAAOsC,iBAAiB,CAACtC,KAAK;EAChC;AACF;AAACwC,OAAA,CAAA3C,QAAA,GAAAA,QAAA","ignoreList":[]}
|
@@ -3,8 +3,10 @@ import { ComponentMain, ComponentID } from '@teambit/component';
|
|
3
3
|
import { GraphqlMain } from '@teambit/graphql';
|
4
4
|
import { Logger, LoggerMain } from '@teambit/logger';
|
5
5
|
import { GetGraphOpts } from './graph-builder';
|
6
|
+
import { GraphOpt } from './graph-cmd';
|
6
7
|
import { ComponentGraph } from './component-graph';
|
7
8
|
import { ComponentIdGraph } from './component-id-graph';
|
9
|
+
import { VisualDependencyGraph } from '@teambit/legacy.dependency-graph';
|
8
10
|
export declare class GraphMain {
|
9
11
|
private componentAspect;
|
10
12
|
private logger;
|
@@ -14,6 +16,12 @@ export declare class GraphMain {
|
|
14
16
|
*/
|
15
17
|
getGraph(ids?: ComponentID[], opts?: GetGraphOpts): Promise<ComponentGraph>;
|
16
18
|
getGraphIds(ids?: ComponentID[], opts?: GetGraphOpts): Promise<ComponentIdGraph>;
|
19
|
+
/**
|
20
|
+
* this visual graph-ids can render the graph as a SVG/png and other formats.
|
21
|
+
*/
|
22
|
+
getVisualGraphIds(ids?: ComponentID[], opts?: GraphOpt): Promise<VisualDependencyGraph>;
|
23
|
+
private getVisualCyclesFromGraph;
|
24
|
+
private getIdsWithVersions;
|
17
25
|
static slots: never[];
|
18
26
|
static dependencies: import("@teambit/harmony").Aspect[];
|
19
27
|
static runtime: import("@teambit/harmony").RuntimeDefinition;
|
@@ -32,6 +32,13 @@ function _logger() {
|
|
32
32
|
};
|
33
33
|
return data;
|
34
34
|
}
|
35
|
+
function _lodash() {
|
36
|
+
const data = require("lodash");
|
37
|
+
_lodash = function () {
|
38
|
+
return data;
|
39
|
+
};
|
40
|
+
return data;
|
41
|
+
}
|
35
42
|
function _graphBuilder() {
|
36
43
|
const data = require("./graph-builder");
|
37
44
|
_graphBuilder = function () {
|
@@ -60,6 +67,13 @@ function _graphCmd() {
|
|
60
67
|
};
|
61
68
|
return data;
|
62
69
|
}
|
70
|
+
function _legacy() {
|
71
|
+
const data = require("@teambit/legacy.dependency-graph");
|
72
|
+
_legacy = function () {
|
73
|
+
return data;
|
74
|
+
};
|
75
|
+
return data;
|
76
|
+
}
|
63
77
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
64
78
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
65
79
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
@@ -80,12 +94,58 @@ class GraphMain {
|
|
80
94
|
const graphBuilder = new (_graphBuilder().GraphBuilder)(this.componentAspect);
|
81
95
|
return graphBuilder.getGraphIds(ids, opts);
|
82
96
|
}
|
97
|
+
|
98
|
+
/**
|
99
|
+
* this visual graph-ids can render the graph as a SVG/png and other formats.
|
100
|
+
*/
|
101
|
+
async getVisualGraphIds(ids, opts = {}) {
|
102
|
+
this.logger.setStatusLine('loading graph');
|
103
|
+
const {
|
104
|
+
layout,
|
105
|
+
includeLocalOnly,
|
106
|
+
cycles
|
107
|
+
} = opts;
|
108
|
+
const graphVizOpts = {};
|
109
|
+
if (layout) graphVizOpts.layout = layout;
|
110
|
+
const graphIdsAll = await this.getGraphIds(ids);
|
111
|
+
const host = this.componentAspect.getHost();
|
112
|
+
const list = await host.listIds();
|
113
|
+
const idsWithVersion = await this.getIdsWithVersions(ids);
|
114
|
+
const listStr = list.map(id => id.toString());
|
115
|
+
const graphIds = includeLocalOnly ? graphIdsAll.successorsSubgraph(idsWithVersion || listStr, {
|
116
|
+
nodeFilter: node => listStr.includes(node.id),
|
117
|
+
edgeFilter: edge => listStr.includes(edge.targetId) && listStr.includes(edge.sourceId)
|
118
|
+
}) : graphIdsAll;
|
119
|
+
this.logger.setStatusLine('rendering graph');
|
120
|
+
if (cycles) {
|
121
|
+
return this.getVisualCyclesFromGraph(graphIds, idsWithVersion, graphVizOpts);
|
122
|
+
}
|
123
|
+
return _legacy().VisualDependencyGraph.loadFromClearGraph(graphIds, graphVizOpts, idsWithVersion);
|
124
|
+
}
|
125
|
+
async getVisualCyclesFromGraph(graphIds, idsWithVersion, graphVizOpts = {}) {
|
126
|
+
const cyclesGraph = graphIds.findCycles();
|
127
|
+
const multipleCycles = cyclesGraph.map(cycle => {
|
128
|
+
if (idsWithVersion && (0, _lodash().intersection)(idsWithVersion, cycle).length < 1) return undefined;
|
129
|
+
return graphIds.subgraph(cycle, {
|
130
|
+
nodeFilter: node => cycle.includes(node.id),
|
131
|
+
edgeFilter: edge => cycle.includes(edge.targetId)
|
132
|
+
});
|
133
|
+
});
|
134
|
+
return _legacy().VisualDependencyGraph.loadFromMultipleClearGraphs((0, _lodash().compact)(multipleCycles), graphVizOpts, idsWithVersion);
|
135
|
+
}
|
136
|
+
async getIdsWithVersions(ids) {
|
137
|
+
const host = this.componentAspect.getHost();
|
138
|
+
if (!ids) return undefined;
|
139
|
+
const comps = await host.getMany(ids);
|
140
|
+
if (comps.length) return comps.map(comp => comp.id.toString());
|
141
|
+
return undefined;
|
142
|
+
}
|
83
143
|
static async provider([graphql, componentAspect, cli, loggerMain]) {
|
84
144
|
const logger = loggerMain.createLogger(_graph2().GraphAspect.id);
|
85
145
|
const graphBuilder = new (_graphBuilder().GraphBuilder)(componentAspect);
|
86
146
|
graphql.register((0, _graph().graphSchema)(graphBuilder, componentAspect));
|
87
147
|
const graphMain = new GraphMain(componentAspect, logger);
|
88
|
-
cli.register(new (_graphCmd().GraphCmd)(componentAspect));
|
148
|
+
cli.register(new (_graphCmd().GraphCmd)(componentAspect, graphMain));
|
89
149
|
return graphMain;
|
90
150
|
}
|
91
151
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_cli","data","require","_component","_graphql","_logger","_graphBuilder","_graph","_graph2","_graphCmd","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","GraphMain","constructor","componentAspect","logger","getGraph","ids","opts","graphBuilder","GraphBuilder","getGraphIds","provider","graphql","cli","loggerMain","createLogger","GraphAspect","id","register","graphSchema","graphMain","GraphCmd","exports","GraphqlAspect","ComponentAspect","CLIAspect","LoggerAspect","MainRuntime","addRuntime"],"sources":["graph.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { ComponentMain, ComponentAspect, ComponentID } from '@teambit/component';\nimport { GraphqlAspect, GraphqlMain } from '@teambit/graphql';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { GetGraphOpts, GraphBuilder } from './graph-builder';\nimport { graphSchema } from './graph.graphql';\nimport { GraphAspect } from './graph.aspect';\nimport { GraphCmd } from './graph-cmd';\nimport { ComponentGraph } from './component-graph';\nimport { ComponentIdGraph } from './component-id-graph';\n\nexport class GraphMain {\n constructor(\n private componentAspect: ComponentMain,\n private logger: Logger\n ) {}\n\n /**\n * important - prefer using `getGraphIds()` it's way better in terms of performance.\n */\n async getGraph(ids?: ComponentID[], opts: GetGraphOpts = {}): Promise<ComponentGraph> {\n const graphBuilder = new GraphBuilder(this.componentAspect);\n return graphBuilder.getGraph(ids, opts);\n }\n\n async getGraphIds(ids?: ComponentID[], opts: GetGraphOpts = {}): Promise<ComponentIdGraph> {\n const graphBuilder = new GraphBuilder(this.componentAspect);\n return graphBuilder.getGraphIds(ids, opts);\n }\n\n static slots = [];\n static dependencies = [GraphqlAspect, ComponentAspect, CLIAspect, LoggerAspect];\n static runtime = MainRuntime;\n static async provider([graphql, componentAspect, cli, loggerMain]: [\n GraphqlMain,\n ComponentMain,\n CLIMain,\n LoggerMain,\n ]) {\n const logger = loggerMain.createLogger(GraphAspect.id);\n\n const graphBuilder = new GraphBuilder(componentAspect);\n graphql.register(graphSchema(graphBuilder, componentAspect));\n\n const graphMain = new GraphMain(componentAspect, logger);\n cli.register(new GraphCmd(componentAspect));\n\n return graphMain;\n }\n}\n\nGraphAspect.addRuntime(GraphMain);\n"],"mappings":";;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,I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AAMT,YAAY,GAAG,KAAIC,4BAAY,EAACN,eAAe,CAAC;IACtDS,OAAO,CAACM,QAAQ,CAAC,IAAAC,oBAAW,EAACX,YAAY,EAAEL,eAAe,CAAC,CAAC;IAE5D,MAAMiB,SAAS,GAAG,IAAInB,SAAS,CAACE,eAAe,EAAEC,MAAM,CAAC;IACxDS,GAAG,CAACK,QAAQ,CAAC,KAAIG,oBAAQ,EAAClB,eAAe,CAAC,CAAC;IAE3C,OAAOiB,SAAS;EAClB;AACF;AAACE,OAAA,CAAArB,SAAA,GAAAA,SAAA;AAAAnB,eAAA,CAtCYmB,SAAS,WAmBL,EAAE;AAAAnB,eAAA,CAnBNmB,SAAS,kBAoBE,CAACsB,wBAAa,EAAEC,4BAAe,EAAEC,gBAAS,EAAEC,sBAAY,CAAC;AAAA5C,eAAA,CApBpEmB,SAAS,aAqBH0B,kBAAW;AAmB9BX,qBAAW,CAACY,UAAU,CAAC3B,SAAS,CAAC","ignoreList":[]}
|
1
|
+
{"version":3,"names":["_cli","data","require","_component","_graphql","_logger","_lodash","_graphBuilder","_graph","_graph2","_graphCmd","_legacy","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","GraphMain","constructor","componentAspect","logger","getGraph","ids","opts","graphBuilder","GraphBuilder","getGraphIds","getVisualGraphIds","setStatusLine","layout","includeLocalOnly","cycles","graphVizOpts","graphIdsAll","host","getHost","list","listIds","idsWithVersion","getIdsWithVersions","listStr","map","id","toString","graphIds","successorsSubgraph","nodeFilter","node","includes","edgeFilter","edge","targetId","sourceId","getVisualCyclesFromGraph","VisualDependencyGraph","loadFromClearGraph","cyclesGraph","findCycles","multipleCycles","cycle","intersection","length","undefined","subgraph","loadFromMultipleClearGraphs","compact","comps","getMany","comp","provider","graphql","cli","loggerMain","createLogger","GraphAspect","register","graphSchema","graphMain","GraphCmd","exports","GraphqlAspect","ComponentAspect","CLIAspect","LoggerAspect","MainRuntime","addRuntime"],"sources":["graph.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { ComponentMain, ComponentAspect, ComponentID } from '@teambit/component';\nimport { GraphqlAspect, GraphqlMain } from '@teambit/graphql';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { compact, intersection } from \"lodash\";\nimport { GetGraphOpts, GraphBuilder } from './graph-builder';\nimport { graphSchema } from './graph.graphql';\nimport { GraphAspect } from './graph.aspect';\nimport { GraphCmd, GraphOpt } from './graph-cmd';\nimport { ComponentGraph } from './component-graph';\nimport { ComponentIdGraph } from './component-id-graph';\nimport { GraphConfig, VisualDependencyGraph } from '@teambit/legacy.dependency-graph';\n\nexport class GraphMain {\n constructor(\n private componentAspect: ComponentMain,\n private logger: Logger\n ) {}\n\n /**\n * important - prefer using `getGraphIds()` it's way better in terms of performance.\n */\n async getGraph(ids?: ComponentID[], opts: GetGraphOpts = {}): Promise<ComponentGraph> {\n const graphBuilder = new GraphBuilder(this.componentAspect);\n return graphBuilder.getGraph(ids, opts);\n }\n\n async getGraphIds(ids?: ComponentID[], opts: GetGraphOpts = {}): Promise<ComponentIdGraph> {\n const graphBuilder = new GraphBuilder(this.componentAspect);\n return graphBuilder.getGraphIds(ids, opts);\n }\n\n /**\n * this visual graph-ids can render the graph as a SVG/png and other formats.\n */\n async getVisualGraphIds(ids?: ComponentID[], opts: GraphOpt = {}): Promise<VisualDependencyGraph> {\n this.logger.setStatusLine('loading graph');\n const { layout, includeLocalOnly, cycles } = opts;\n const graphVizOpts: GraphConfig = {}\n if (layout) graphVizOpts.layout = layout;\n const graphIdsAll = await this.getGraphIds(ids);\n\n const host = this.componentAspect.getHost();\n const list = await host.listIds();\n const idsWithVersion = await this.getIdsWithVersions(ids);\n const listStr = list.map((id) => id.toString());\n const graphIds = includeLocalOnly ? graphIdsAll.successorsSubgraph(idsWithVersion || listStr, {\n nodeFilter: (node) => listStr.includes(node.id),\n edgeFilter: (edge) => listStr.includes(edge.targetId) && listStr.includes(edge.sourceId)\n }) : graphIdsAll;\n this.logger.setStatusLine('rendering graph');\n if (cycles) {\n return this.getVisualCyclesFromGraph(graphIds, idsWithVersion, graphVizOpts);\n }\n return VisualDependencyGraph.loadFromClearGraph(graphIds, graphVizOpts, idsWithVersion);\n }\n\n private async getVisualCyclesFromGraph(graphIds: ComponentIdGraph, idsWithVersion?: string[],\n graphVizOpts: GraphConfig = {}\n ): Promise<VisualDependencyGraph> {\n const cyclesGraph = graphIds.findCycles();\n const multipleCycles = cyclesGraph.map((cycle) => {\n\n if (idsWithVersion && intersection(idsWithVersion, cycle).length < 1) return undefined;\n return graphIds.subgraph(cycle,\n {\n nodeFilter: (node) => cycle.includes(node.id),\n edgeFilter: (edge) => cycle.includes(edge.targetId)\n },\n );\n });\n return VisualDependencyGraph.loadFromMultipleClearGraphs(compact(multipleCycles), graphVizOpts, idsWithVersion);\n }\n\n private async getIdsWithVersions(ids?: ComponentID[]): Promise<string[] | undefined> {\n const host = this.componentAspect.getHost();\n if (!ids) return undefined;\n const comps = await host.getMany(ids);\n if (comps.length) return comps.map(comp => comp.id.toString());\n return undefined;\n }\n\n static slots = [];\n static dependencies = [GraphqlAspect, ComponentAspect, CLIAspect, LoggerAspect];\n static runtime = MainRuntime;\n static async provider([graphql, componentAspect, cli, loggerMain]: [\n GraphqlMain,\n ComponentMain,\n CLIMain,\n LoggerMain,\n ]) {\n const logger = loggerMain.createLogger(GraphAspect.id);\n\n const graphBuilder = new GraphBuilder(componentAspect);\n graphql.register(graphSchema(graphBuilder, componentAspect));\n\n const graphMain = new GraphMain(componentAspect, logger);\n cli.register(new GraphCmd(componentAspect, graphMain));\n\n return graphMain;\n }\n}\n\nGraphAspect.addRuntime(GraphMain);\n"],"mappings":";;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAA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EoD,GAAG,EAAEC,UAAU,CAK/D,EAAE;IACD,MAAMpD,MAAM,GAAGoD,UAAU,CAACC,YAAY,CAACC,qBAAW,CAAChC,EAAE,CAAC;IAEtD,MAAMlB,YAAY,GAAG,KAAIC,4BAAY,EAACN,eAAe,CAAC;IACtDmD,OAAO,CAACK,QAAQ,CAAC,IAAAC,oBAAW,EAACpD,YAAY,EAAEL,eAAe,CAAC,CAAC;IAE5D,MAAM0D,SAAS,GAAG,IAAI5D,SAAS,CAACE,eAAe,EAAEC,MAAM,CAAC;IACxDmD,GAAG,CAACI,QAAQ,CAAC,KAAIG,oBAAQ,EAAC3D,eAAe,EAAE0D,SAAS,CAAC,CAAC;IAEtD,OAAOA,SAAS;EAClB;AACF;AAACE,OAAA,CAAA9D,SAAA,GAAAA,SAAA;AAAAnB,eAAA,CAxFYmB,SAAS,WAqEL,EAAE;AAAAnB,eAAA,CArENmB,SAAS,kBAsEE,CAAC+D,wBAAa,EAAEC,4BAAe,EAAEC,gBAAS,EAAEC,sBAAY,CAAC;AAAArF,eAAA,CAtEpEmB,SAAS,aAuEHmE,kBAAW;AAmB9BV,qBAAW,CAACW,UAAU,CAACpE,SAAS,CAAC","ignoreList":[]}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_graph@1.0.
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_graph@1.0.
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_graph@1.0.542/dist/graph.composition.js';
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_graph@1.0.542/dist/graph.docs.md';
|
3
3
|
|
4
4
|
export const compositions = [compositions_0];
|
5
5
|
export const overview = [overview_0];
|
package/package.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "@teambit/graph",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.542",
|
4
4
|
"homepage": "https://bit.cloud/teambit/component/graph",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"componentId": {
|
7
7
|
"scope": "teambit.component",
|
8
8
|
"name": "graph",
|
9
|
-
"version": "1.0.
|
9
|
+
"version": "1.0.542"
|
10
10
|
},
|
11
11
|
"dependencies": {
|
12
12
|
"graphlib": "2.1.8",
|
@@ -33,16 +33,16 @@
|
|
33
33
|
"@teambit/design.ui.pages.not-found": "0.0.371",
|
34
34
|
"@teambit/design.ui.pages.server-error": "0.0.368",
|
35
35
|
"@teambit/ui-foundation.ui.react-router.use-query": "0.0.505",
|
36
|
-
"@teambit/legacy.dependency-graph": "0.0.
|
37
|
-
"@teambit/component": "1.0.
|
38
|
-
"@teambit/cli": "0.0.
|
39
|
-
"@teambit/scope.remotes": "0.0.
|
40
|
-
"@teambit/workspace": "1.0.
|
36
|
+
"@teambit/legacy.dependency-graph": "0.0.34",
|
37
|
+
"@teambit/component": "1.0.542",
|
38
|
+
"@teambit/cli": "0.0.1119",
|
39
|
+
"@teambit/scope.remotes": "0.0.31",
|
40
|
+
"@teambit/workspace": "1.0.542",
|
41
41
|
"@teambit/component.ui.component-compare.models.component-compare-props": "0.0.119",
|
42
|
-
"@teambit/graphql": "1.0.
|
43
|
-
"@teambit/logger": "0.0.
|
44
|
-
"@teambit/component-compare": "1.0.
|
45
|
-
"@teambit/ui": "1.0.
|
42
|
+
"@teambit/graphql": "1.0.542",
|
43
|
+
"@teambit/logger": "0.0.1212",
|
44
|
+
"@teambit/component-compare": "1.0.542",
|
45
|
+
"@teambit/ui": "1.0.542",
|
46
46
|
"@teambit/component.modules.component-url": "0.0.173",
|
47
47
|
"@teambit/envs.ui.env-icon": "0.0.506",
|
48
48
|
"@teambit/component.ui.component-compare.context": "0.0.122"
|