@teambit/graph 0.0.870 → 0.0.872
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-builder.d.ts +1 -7
- package/dist/graph-builder.js +0 -5
- package/dist/graph-builder.js.map +1 -1
- package/dist/graph-cmd.d.ts +20 -0
- package/dist/graph-cmd.js +240 -0
- package/dist/graph-cmd.js.map +1 -0
- package/dist/graph.main.runtime.d.ts +21 -7
- package/dist/graph.main.runtime.js +76 -13
- package/dist/graph.main.runtime.js.map +1 -1
- package/package-tar/teambit-graph-0.0.872.tgz +0 -0
- package/package.json +15 -11
- package/{preview-1664854758941.js → preview-1665027346119.js} +2 -2
- package/dist/graph.provider.d.ts +0 -5
- package/dist/graph.provider.js +0 -39
- package/dist/graph.provider.js.map +0 -1
- package/package-tar/teambit-graph-0.0.870.tgz +0 -0
package/dist/graph-builder.d.ts
CHANGED
@@ -1,17 +1,11 @@
|
|
1
1
|
import { ComponentFactory, ComponentID, ComponentMain } from '@teambit/component';
|
2
2
|
import { ComponentGraph } from './component-graph';
|
3
|
-
declare type GetGraphOpts = {
|
3
|
+
export 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
|
-
*/
|
11
6
|
export declare class GraphBuilder {
|
12
7
|
private componentAspect;
|
13
8
|
constructor(componentAspect: ComponentMain);
|
14
9
|
getGraph(ids?: ComponentID[], opts?: GetGraphOpts): Promise<ComponentGraph>;
|
15
10
|
private buildFromLegacy;
|
16
11
|
}
|
17
|
-
export {};
|
package/dist/graph-builder.js
CHANGED
@@ -39,11 +39,6 @@ function _dependency() {
|
|
39
39
|
return data;
|
40
40
|
}
|
41
41
|
|
42
|
-
/**
|
43
|
-
* @todo: potential issues with the current way the class is built.
|
44
|
-
* it's possible to call `getGraph` multiple times and at the same time (Promise.all).
|
45
|
-
* which makes the _graph prop and other props unpredictable.
|
46
|
-
*/
|
47
42
|
class GraphBuilder {
|
48
43
|
constructor(componentAspect) {
|
49
44
|
this.componentAspect = componentAspect;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["GraphBuilder","constructor","componentAspect","getGraph","ids","opts","componentHost","host","getHost","legacyGraph","getLegacyGraph","graph","buildFromLegacy","seederIds","listIds","newGraph","ComponentGraph","setNodeP","nodes","map","nodeId","componentId","resolveComponentId","component","get","setNode","Node","toString","Promise","all","setEdgePromise","edges","edgeId","source","v","target","w","edgeObj","edge","Dependency","setEdge","Edge"],"sources":["graph-builder.ts"],"sourcesContent":["import { ComponentFactory, ComponentID, ComponentMain } from '@teambit/component';\nimport { Node, Edge } from '@teambit/graph.cleargraph';\nimport type LegacyGraph from '@teambit/legacy/dist/scope/graph/graph';\nimport { ComponentGraph } from './component-graph';\nimport { Dependency } from './model/dependency';\n\
|
1
|
+
{"version":3,"names":["GraphBuilder","constructor","componentAspect","getGraph","ids","opts","componentHost","host","getHost","legacyGraph","getLegacyGraph","graph","buildFromLegacy","seederIds","listIds","newGraph","ComponentGraph","setNodeP","nodes","map","nodeId","componentId","resolveComponentId","component","get","setNode","Node","toString","Promise","all","setEdgePromise","edges","edgeId","source","v","target","w","edgeObj","edge","Dependency","setEdge","Edge"],"sources":["graph-builder.ts"],"sourcesContent":["import { ComponentFactory, ComponentID, ComponentMain } from '@teambit/component';\nimport { Node, Edge } from '@teambit/graph.cleargraph';\nimport type LegacyGraph from '@teambit/legacy/dist/scope/graph/graph';\nimport { ComponentGraph } from './component-graph';\nimport { Dependency } from './model/dependency';\n\nexport type GetGraphOpts = {\n host?: ComponentFactory;\n};\n\ntype BuildFromLegacyGraphOpts = {\n host?: ComponentFactory;\n};\n\nexport class GraphBuilder {\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, false);\n const graph = await this.buildFromLegacy(legacyGraph, { host: opts.host });\n graph.seederIds = ids || (await componentHost.listIds());\n return 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(new Node(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(new Edge(source.toString(), target.toString(), edgeObj));\n });\n await Promise.all(setEdgePromise);\n\n return newGraph;\n }\n}\n"],"mappings":";;;;;;;;;;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAUO,MAAMA,YAAN,CAAmB;EACxBC,WAAW,CAASC,eAAT,EAAyC;IAAA,KAAhCA,eAAgC,GAAhCA,eAAgC;EAAE;;EAExC,MAARC,QAAQ,CAACC,GAAD,EAAsBC,IAAkB,GAAG,EAA3C,EAAwE;IACpF,MAAMC,aAAa,GAAGD,IAAI,CAACE,IAAL,IAAa,KAAKL,eAAL,CAAqBM,OAArB,EAAnC;IAEA,MAAMC,WAAW,GAAG,MAAMH,aAAa,CAACI,cAAd,CAA6BN,GAA7B,EAAkC,KAAlC,CAA1B;IACA,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lC,MAAyC,cAAzC,GAA0D,KAAIG,wBAAJ,EAAe,SAAf,CAA1D,GAAsF,KAAIA,wBAAJ,EAAe,KAAf,CADxF;MAEAxB,QAAQ,CAACyB,OAAT,CAAiB,KAAIC,aAAJ,EAASR,MAAM,CAACN,QAAP,EAAT,EAA4BQ,MAAM,CAACR,QAAP,EAA5B,EAA+CU,OAA/C,CAAjB;IACD,CANsB,CAAvB;IAOA,MAAMT,OAAO,CAACC,GAAR,CAAYC,cAAZ,CAAN;IAEA,OAAOf,QAAP;EACD;;AAtCuB"}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { Command, CommandOptions } from '@teambit/cli';
|
2
|
+
declare type GraphOpt = {
|
3
|
+
image?: string;
|
4
|
+
remote?: string;
|
5
|
+
allVersions?: boolean;
|
6
|
+
layout?: string;
|
7
|
+
json?: boolean;
|
8
|
+
};
|
9
|
+
export declare class GraphCmd implements Command {
|
10
|
+
name: string;
|
11
|
+
description: string;
|
12
|
+
group: string;
|
13
|
+
alias: string;
|
14
|
+
options: CommandOptions;
|
15
|
+
remoteOp: boolean;
|
16
|
+
report([id]: [string], { remote, allVersions, layout, image }: GraphOpt): Promise<string>;
|
17
|
+
private generateGraph;
|
18
|
+
json([id]: [string], { remote, allVersions }: GraphOpt): Promise<Object>;
|
19
|
+
}
|
20
|
+
export {};
|
@@ -0,0 +1,240 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
5
|
+
require("core-js/modules/es.array.iterator.js");
|
6
|
+
|
7
|
+
require("core-js/modules/es.promise.js");
|
8
|
+
|
9
|
+
Object.defineProperty(exports, "__esModule", {
|
10
|
+
value: true
|
11
|
+
});
|
12
|
+
exports.GraphCmd = void 0;
|
13
|
+
|
14
|
+
function _defineProperty2() {
|
15
|
+
const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
16
|
+
|
17
|
+
_defineProperty2 = function () {
|
18
|
+
return data;
|
19
|
+
};
|
20
|
+
|
21
|
+
return data;
|
22
|
+
}
|
23
|
+
|
24
|
+
function _chalk() {
|
25
|
+
const data = _interopRequireDefault(require("chalk"));
|
26
|
+
|
27
|
+
_chalk = function () {
|
28
|
+
return data;
|
29
|
+
};
|
30
|
+
|
31
|
+
return data;
|
32
|
+
}
|
33
|
+
|
34
|
+
function _os() {
|
35
|
+
const data = _interopRequireDefault(require("os"));
|
36
|
+
|
37
|
+
_os = function () {
|
38
|
+
return data;
|
39
|
+
};
|
40
|
+
|
41
|
+
return data;
|
42
|
+
}
|
43
|
+
|
44
|
+
function path() {
|
45
|
+
const data = _interopRequireWildcard(require("path"));
|
46
|
+
|
47
|
+
path = function () {
|
48
|
+
return data;
|
49
|
+
};
|
50
|
+
|
51
|
+
return data;
|
52
|
+
}
|
53
|
+
|
54
|
+
function _graphlib() {
|
55
|
+
const data = _interopRequireDefault(require("graphlib"));
|
56
|
+
|
57
|
+
_graphlib = function () {
|
58
|
+
return data;
|
59
|
+
};
|
60
|
+
|
61
|
+
return data;
|
62
|
+
}
|
63
|
+
|
64
|
+
function _legacyBitId() {
|
65
|
+
const data = require("@teambit/legacy-bit-id");
|
66
|
+
|
67
|
+
_legacyBitId = function () {
|
68
|
+
return data;
|
69
|
+
};
|
70
|
+
|
71
|
+
return data;
|
72
|
+
}
|
73
|
+
|
74
|
+
function _utils() {
|
75
|
+
const data = require("@teambit/legacy/dist/utils");
|
76
|
+
|
77
|
+
_utils = function () {
|
78
|
+
return data;
|
79
|
+
};
|
80
|
+
|
81
|
+
return data;
|
82
|
+
}
|
83
|
+
|
84
|
+
function _vizgraph() {
|
85
|
+
const data = _interopRequireDefault(require("@teambit/legacy/dist/scope/graph/vizgraph"));
|
86
|
+
|
87
|
+
_vizgraph = function () {
|
88
|
+
return data;
|
89
|
+
};
|
90
|
+
|
91
|
+
return data;
|
92
|
+
}
|
93
|
+
|
94
|
+
function _consumer() {
|
95
|
+
const data = require("@teambit/legacy/dist/consumer");
|
96
|
+
|
97
|
+
_consumer = function () {
|
98
|
+
return data;
|
99
|
+
};
|
100
|
+
|
101
|
+
return data;
|
102
|
+
}
|
103
|
+
|
104
|
+
function _scopeGraph() {
|
105
|
+
const data = _interopRequireDefault(require("@teambit/legacy/dist/scope/graph/scope-graph"));
|
106
|
+
|
107
|
+
_scopeGraph = function () {
|
108
|
+
return data;
|
109
|
+
};
|
110
|
+
|
111
|
+
return data;
|
112
|
+
}
|
113
|
+
|
114
|
+
function _exceptions() {
|
115
|
+
const data = require("@teambit/legacy/dist/consumer/exceptions");
|
116
|
+
|
117
|
+
_exceptions = function () {
|
118
|
+
return data;
|
119
|
+
};
|
120
|
+
|
121
|
+
return data;
|
122
|
+
}
|
123
|
+
|
124
|
+
function _getRemoteByName() {
|
125
|
+
const data = _interopRequireDefault(require("@teambit/legacy/dist/remotes/get-remote-by-name"));
|
126
|
+
|
127
|
+
_getRemoteByName = function () {
|
128
|
+
return data;
|
129
|
+
};
|
130
|
+
|
131
|
+
return data;
|
132
|
+
}
|
133
|
+
|
134
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
135
|
+
|
136
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
137
|
+
|
138
|
+
class GraphCmd {
|
139
|
+
constructor() {
|
140
|
+
(0, _defineProperty2().default)(this, "name", 'graph [id]');
|
141
|
+
(0, _defineProperty2().default)(this, "description", 'EXPERIMENTAL. generate an image file with the dependencies graph');
|
142
|
+
(0, _defineProperty2().default)(this, "group", 'discover');
|
143
|
+
(0, _defineProperty2().default)(this, "alias", '');
|
144
|
+
(0, _defineProperty2().default)(this, "options", [['i', 'image <image>', 'image path. use one of the following extensions: [gif, png, svg, pdf]'], ['r', 'remote [remoteName]', 'remote name (name is optional, leave empty when id is specified)'], ['', 'all-versions', 'enter all components versions into the graph, not only latest'], ['', 'layout <name>', 'GraphVis layout. default to "dot". options are [circo, dot, fdp, neato, osage, patchwork, sfdp, twopi]'], ['j', 'json', 'json format']]);
|
145
|
+
(0, _defineProperty2().default)(this, "remoteOp", true);
|
146
|
+
}
|
147
|
+
|
148
|
+
async report([id], {
|
149
|
+
remote,
|
150
|
+
allVersions,
|
151
|
+
layout,
|
152
|
+
image
|
153
|
+
}) {
|
154
|
+
const consumer = await (0, _consumer().loadConsumerIfExist)();
|
155
|
+
if (!consumer && !remote) throw new (_exceptions().ConsumerNotFound)();
|
156
|
+
const graph = await this.generateGraph(consumer, id, remote, allVersions);
|
157
|
+
const config = {}; // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
|
158
|
+
|
159
|
+
if (layout) config.layout = layout;
|
160
|
+
const visualDependencyGraph = await _vizgraph().default.loadFromGraphlib(graph, config);
|
161
|
+
|
162
|
+
const getBitId = () => {
|
163
|
+
if (!id) return undefined;
|
164
|
+
if (remote) return _legacyBitId().BitId.parse(id, true); // user used --remote so we know it has a scope
|
165
|
+
|
166
|
+
return consumer === null || consumer === void 0 ? void 0 : consumer.getParsedId(id);
|
167
|
+
};
|
168
|
+
|
169
|
+
const bitId = getBitId();
|
170
|
+
|
171
|
+
if (bitId) {
|
172
|
+
visualDependencyGraph.highlightId(bitId);
|
173
|
+
}
|
174
|
+
|
175
|
+
image = image || path().join(_os().default.tmpdir(), `${(0, _utils().generateRandomStr)()}.png`);
|
176
|
+
const result = await visualDependencyGraph.image(image);
|
177
|
+
return _chalk().default.green(`image created at ${result}`);
|
178
|
+
}
|
179
|
+
|
180
|
+
async generateGraph(consumer, id, remote, allVersions) {
|
181
|
+
if (!consumer && !remote) throw new (_exceptions().ConsumerNotFound)();
|
182
|
+
|
183
|
+
const getBitId = () => {
|
184
|
+
if (!id) return undefined;
|
185
|
+
if (remote) return _legacyBitId().BitId.parse(id, true); // user used --remote so we know it has a scope
|
186
|
+
// @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
|
187
|
+
|
188
|
+
return consumer.getParsedId(id);
|
189
|
+
};
|
190
|
+
|
191
|
+
const bitId = getBitId();
|
192
|
+
|
193
|
+
if (remote) {
|
194
|
+
if (id) {
|
195
|
+
// @ts-ignore scope must be set as it came from a remote
|
196
|
+
const scopeName = typeof remote === 'string' ? remote : bitId.scope;
|
197
|
+
const remoteScope = await (0, _getRemoteByName().default)(scopeName, consumer);
|
198
|
+
const componentDepGraph = await remoteScope.graph(bitId);
|
199
|
+
return componentDepGraph.graph;
|
200
|
+
}
|
201
|
+
|
202
|
+
if (typeof remote !== 'string') {
|
203
|
+
throw new Error('please specify remote scope name or enter an id');
|
204
|
+
}
|
205
|
+
|
206
|
+
const remoteScope = await (0, _getRemoteByName().default)(remote, consumer);
|
207
|
+
const componentDepGraph = await remoteScope.graph();
|
208
|
+
return componentDepGraph.graph;
|
209
|
+
}
|
210
|
+
|
211
|
+
const onlyLatest = !allVersions; // @ts-ignore consumer must be set here
|
212
|
+
|
213
|
+
const workspaceGraph = await _scopeGraph().default.buildGraphFromWorkspace(consumer, onlyLatest);
|
214
|
+
const dependencyGraph = new (_scopeGraph().default)(workspaceGraph);
|
215
|
+
|
216
|
+
if (id) {
|
217
|
+
// @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
|
218
|
+
const componentGraph = dependencyGraph.getSubGraphOfConnectedComponents(bitId);
|
219
|
+
const componentDepGraph = new (_scopeGraph().default)(componentGraph);
|
220
|
+
return componentDepGraph.graph;
|
221
|
+
}
|
222
|
+
|
223
|
+
return dependencyGraph.graph;
|
224
|
+
}
|
225
|
+
|
226
|
+
async json([id], {
|
227
|
+
remote,
|
228
|
+
allVersions
|
229
|
+
}) {
|
230
|
+
const consumer = await (0, _consumer().loadConsumerIfExist)();
|
231
|
+
if (!consumer && !remote) throw new (_exceptions().ConsumerNotFound)();
|
232
|
+
const graph = await this.generateGraph(consumer, id, remote, allVersions);
|
233
|
+
return _graphlib().default.json.write(graph);
|
234
|
+
}
|
235
|
+
|
236
|
+
}
|
237
|
+
|
238
|
+
exports.GraphCmd = GraphCmd;
|
239
|
+
|
240
|
+
//# sourceMappingURL=graph-cmd.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["GraphCmd","report","id","remote","allVersions","layout","image","consumer","loadConsumerIfExist","ConsumerNotFound","graph","generateGraph","config","visualDependencyGraph","VisualDependencyGraph","loadFromGraphlib","getBitId","undefined","BitId","parse","getParsedId","bitId","highlightId","path","join","os","tmpdir","generateRandomStr","result","chalk","green","scopeName","scope","remoteScope","getRemoteByName","componentDepGraph","Error","onlyLatest","workspaceGraph","DependencyGraph","buildGraphFromWorkspace","dependencyGraph","componentGraph","getSubGraphOfConnectedComponents","json","GraphLib","write"],"sources":["graph-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport os from 'os';\nimport * as path from 'path';\nimport GraphLib from 'graphlib';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { BitId } from '@teambit/legacy-bit-id';\nimport { generateRandomStr } from '@teambit/legacy/dist/utils';\nimport VisualDependencyGraph from '@teambit/legacy/dist/scope/graph/vizgraph';\nimport { Consumer, loadConsumerIfExist } from '@teambit/legacy/dist/consumer';\nimport DependencyGraph from '@teambit/legacy/dist/scope/graph/scope-graph';\nimport { ConsumerNotFound } from '@teambit/legacy/dist/consumer/exceptions';\nimport getRemoteByName from '@teambit/legacy/dist/remotes/get-remote-by-name';\n\ntype GraphOpt = {\n image?: string;\n remote?: string;\n allVersions?: boolean;\n layout?: string;\n json?: boolean;\n};\n\nexport class GraphCmd implements Command {\n name = 'graph [id]';\n description = 'EXPERIMENTAL. generate an image file with the dependencies graph';\n group = 'discover';\n alias = '';\n options = [\n ['i', 'image <image>', 'image path. use one of the following extensions: [gif, png, svg, pdf]'],\n ['r', 'remote [remoteName]', 'remote name (name is optional, leave empty when id is specified)'],\n ['', 'all-versions', 'enter all components versions into the graph, not only latest'],\n [\n '',\n 'layout <name>',\n 'GraphVis layout. default to \"dot\". options are [circo, dot, fdp, neato, osage, patchwork, sfdp, twopi]',\n ],\n ['j', 'json', 'json format'],\n ] as CommandOptions;\n remoteOp = true;\n\n async report([id]: [string], { remote, allVersions, layout, image }: GraphOpt): Promise<string> {\n const consumer = await loadConsumerIfExist();\n if (!consumer && !remote) throw new ConsumerNotFound();\n\n const graph = await this.generateGraph(consumer, id, remote, allVersions);\n\n const config = {};\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n if (layout) config.layout = layout;\n const visualDependencyGraph = await VisualDependencyGraph.loadFromGraphlib(graph, config);\n\n const getBitId = (): BitId | undefined => {\n if (!id) return undefined;\n if (remote) return BitId.parse(id, true); // user used --remote so we know it has a scope\n return consumer?.getParsedId(id);\n };\n const bitId = getBitId();\n\n if (bitId) {\n visualDependencyGraph.highlightId(bitId);\n }\n image = image || path.join(os.tmpdir(), `${generateRandomStr()}.png`);\n const result = await visualDependencyGraph.image(image);\n\n return chalk.green(`image created at ${result}`);\n }\n\n private async generateGraph(\n consumer?: Consumer,\n id?: string,\n remote?: string,\n allVersions?: boolean\n ): Promise<GraphLib.Graph> {\n if (!consumer && !remote) throw new ConsumerNotFound();\n const getBitId = (): BitId | undefined => {\n if (!id) return undefined;\n if (remote) return BitId.parse(id, true); // user used --remote so we know it has a scope\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n return consumer.getParsedId(id);\n };\n const bitId = getBitId();\n if (remote) {\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, 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, consumer);\n const componentDepGraph = await remoteScope.graph();\n return componentDepGraph.graph;\n }\n\n const onlyLatest = !allVersions;\n // @ts-ignore consumer must be set here\n const workspaceGraph = await DependencyGraph.buildGraphFromWorkspace(consumer, onlyLatest);\n const dependencyGraph = new DependencyGraph(workspaceGraph);\n if (id) {\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n const componentGraph = dependencyGraph.getSubGraphOfConnectedComponents(bitId);\n const componentDepGraph = new DependencyGraph(componentGraph);\n return componentDepGraph.graph;\n }\n return dependencyGraph.graph;\n }\n\n async json([id]: [string], { remote, allVersions }: GraphOpt) {\n const consumer = await loadConsumerIfExist();\n if (!consumer && !remote) throw new ConsumerNotFound();\n\n const graph = await this.generateGraph(consumer, id, remote, allVersions);\n return GraphLib.json.write(graph);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAC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,KAAKC,aAAL,CAAmBJ,QAAnB,EAA6BL,EAA7B,EAAiCC,MAAjC,EAAyCC,WAAzC,CAApB;IACA,OAAOyC,mBAAA,CAASD,IAAT,CAAcE,KAAd,CAAoBpC,KAApB,CAAP;EACD;;AA9FsC"}
|
@@ -1,7 +1,21 @@
|
|
1
|
-
import {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
1
|
+
import { CLIMain } from '@teambit/cli';
|
2
|
+
import { ComponentMain, ComponentID } from '@teambit/component';
|
3
|
+
import { GraphqlMain } from '@teambit/graphql';
|
4
|
+
import { Logger, LoggerMain } from '@teambit/logger';
|
5
|
+
import { GetGraphOpts } from './graph-builder';
|
6
|
+
import { ComponentGraph } from './component-graph';
|
7
|
+
export declare class GraphMain {
|
8
|
+
private componentAspect;
|
9
|
+
private logger;
|
10
|
+
constructor(componentAspect: ComponentMain, logger: Logger);
|
11
|
+
getGraph(ids?: ComponentID[], opts?: GetGraphOpts): Promise<ComponentGraph>;
|
12
|
+
static slots: never[];
|
13
|
+
static dependencies: import("@teambit/harmony").Aspect[];
|
14
|
+
static runtime: import("@teambit/harmony").RuntimeDefinition;
|
15
|
+
static provider([graphql, componentAspect, cli, loggerMain]: [
|
16
|
+
GraphqlMain,
|
17
|
+
ComponentMain,
|
18
|
+
CLIMain,
|
19
|
+
LoggerMain
|
20
|
+
]): Promise<GraphMain>;
|
21
|
+
}
|
@@ -2,11 +2,25 @@
|
|
2
2
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
4
|
|
5
|
+
require("core-js/modules/es.array.iterator.js");
|
6
|
+
|
7
|
+
require("core-js/modules/es.promise.js");
|
8
|
+
|
5
9
|
Object.defineProperty(exports, "__esModule", {
|
6
10
|
value: true
|
7
11
|
});
|
8
12
|
exports.GraphMain = void 0;
|
9
13
|
|
14
|
+
function _defineProperty2() {
|
15
|
+
const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
16
|
+
|
17
|
+
_defineProperty2 = function () {
|
18
|
+
return data;
|
19
|
+
};
|
20
|
+
|
21
|
+
return data;
|
22
|
+
}
|
23
|
+
|
10
24
|
function _cli() {
|
11
25
|
const data = require("@teambit/cli");
|
12
26
|
|
@@ -17,8 +31,18 @@ function _cli() {
|
|
17
31
|
return data;
|
18
32
|
}
|
19
33
|
|
34
|
+
function _component() {
|
35
|
+
const data = require("@teambit/component");
|
36
|
+
|
37
|
+
_component = function () {
|
38
|
+
return data;
|
39
|
+
};
|
40
|
+
|
41
|
+
return data;
|
42
|
+
}
|
43
|
+
|
20
44
|
function _graphql() {
|
21
|
-
const data =
|
45
|
+
const data = require("@teambit/graphql");
|
22
46
|
|
23
47
|
_graphql = function () {
|
24
48
|
return data;
|
@@ -27,10 +51,20 @@ function _graphql() {
|
|
27
51
|
return data;
|
28
52
|
}
|
29
53
|
|
30
|
-
function
|
31
|
-
const data = require("@teambit/
|
54
|
+
function _logger() {
|
55
|
+
const data = require("@teambit/logger");
|
32
56
|
|
33
|
-
|
57
|
+
_logger = function () {
|
58
|
+
return data;
|
59
|
+
};
|
60
|
+
|
61
|
+
return data;
|
62
|
+
}
|
63
|
+
|
64
|
+
function _graphBuilder() {
|
65
|
+
const data = require("./graph-builder");
|
66
|
+
|
67
|
+
_graphBuilder = function () {
|
34
68
|
return data;
|
35
69
|
};
|
36
70
|
|
@@ -38,7 +72,7 @@ function _component() {
|
|
38
72
|
}
|
39
73
|
|
40
74
|
function _graph() {
|
41
|
-
const data = require("./graph.
|
75
|
+
const data = require("./graph.graphql");
|
42
76
|
|
43
77
|
_graph = function () {
|
44
78
|
return data;
|
@@ -48,7 +82,7 @@ function _graph() {
|
|
48
82
|
}
|
49
83
|
|
50
84
|
function _graph2() {
|
51
|
-
const data = require("./graph.
|
85
|
+
const data = require("./graph.aspect");
|
52
86
|
|
53
87
|
_graph2 = function () {
|
54
88
|
return data;
|
@@ -57,14 +91,43 @@ function _graph2() {
|
|
57
91
|
return data;
|
58
92
|
}
|
59
93
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
};
|
94
|
+
function _graphCmd() {
|
95
|
+
const data = require("./graph-cmd");
|
96
|
+
|
97
|
+
_graphCmd = function () {
|
98
|
+
return data;
|
99
|
+
};
|
100
|
+
|
101
|
+
return data;
|
102
|
+
}
|
103
|
+
|
104
|
+
class GraphMain {
|
105
|
+
constructor(componentAspect, logger) {
|
106
|
+
this.componentAspect = componentAspect;
|
107
|
+
this.logger = logger;
|
108
|
+
}
|
109
|
+
|
110
|
+
async getGraph(ids, opts = {}) {
|
111
|
+
const graphBuilder = new (_graphBuilder().GraphBuilder)(this.componentAspect);
|
112
|
+
return graphBuilder.getGraph(ids, opts);
|
113
|
+
}
|
114
|
+
|
115
|
+
static async provider([graphql, componentAspect, cli, loggerMain]) {
|
116
|
+
const logger = loggerMain.createLogger(_graph2().GraphAspect.id);
|
117
|
+
const graphBuilder = new (_graphBuilder().GraphBuilder)(componentAspect);
|
118
|
+
graphql.register((0, _graph().graphSchema)(graphBuilder, componentAspect));
|
119
|
+
const graphMain = new GraphMain(componentAspect, logger);
|
120
|
+
cli.register(new (_graphCmd().GraphCmd)());
|
121
|
+
return graphMain;
|
122
|
+
}
|
123
|
+
|
124
|
+
}
|
125
|
+
|
66
126
|
exports.GraphMain = GraphMain;
|
127
|
+
(0, _defineProperty2().default)(GraphMain, "slots", []);
|
128
|
+
(0, _defineProperty2().default)(GraphMain, "dependencies", [_graphql().GraphqlAspect, _component().ComponentAspect, _cli().CLIAspect, _logger().LoggerAspect]);
|
129
|
+
(0, _defineProperty2().default)(GraphMain, "runtime", _cli().MainRuntime);
|
67
130
|
|
68
|
-
|
131
|
+
_graph2().GraphAspect.addRuntime(GraphMain);
|
69
132
|
|
70
133
|
//# sourceMappingURL=graph.main.runtime.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["GraphMain","
|
1
|
+
{"version":3,"names":["GraphMain","constructor","componentAspect","logger","getGraph","ids","opts","graphBuilder","GraphBuilder","provider","graphql","cli","loggerMain","createLogger","GraphAspect","id","register","graphSchema","graphMain","GraphCmd","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';\n\nexport class GraphMain {\n constructor(private componentAspect: ComponentMain, private logger: Logger) {}\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 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());\n\n return graphMain;\n }\n}\n\nGraphAspect.addRuntime(GraphMain);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAA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json
CHANGED
@@ -1,20 +1,22 @@
|
|
1
1
|
{
|
2
2
|
"name": "@teambit/graph",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.872",
|
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.872"
|
10
10
|
},
|
11
11
|
"dependencies": {
|
12
|
+
"chalk": "2.4.2",
|
13
|
+
"graphlib": "2.1.8",
|
12
14
|
"graphql-tag": "2.12.1",
|
13
15
|
"lodash": "4.17.21",
|
14
16
|
"classnames": "2.2.6",
|
15
17
|
"react-flow-renderer": "8.3.7",
|
16
|
-
"dagre": "0.8.5",
|
17
18
|
"semver": "7.3.4",
|
19
|
+
"dagre": "0.8.5",
|
18
20
|
"@babel/runtime": "7.12.18",
|
19
21
|
"core-js": "^3.0.0",
|
20
22
|
"@teambit/graph.cleargraph": "0.0.1",
|
@@ -24,17 +26,18 @@
|
|
24
26
|
"@teambit/base-ui.text.muted-text": "1.0.1",
|
25
27
|
"@teambit/evangelist.input.checkbox.label": "1.0.3",
|
26
28
|
"@teambit/documenter.ui.heading": "4.1.1",
|
27
|
-
"@teambit/component": "0.0.
|
28
|
-
"@teambit/
|
29
|
-
"@teambit/cli": "0.0.581",
|
30
|
-
"@teambit/component-compare": "0.0.118",
|
31
|
-
"@teambit/ui": "0.0.870",
|
29
|
+
"@teambit/component": "0.0.872",
|
30
|
+
"@teambit/cli": "0.0.582",
|
32
31
|
"@teambit/legacy-bit-id": "0.0.414",
|
32
|
+
"@teambit/graphql": "0.0.872",
|
33
|
+
"@teambit/logger": "0.0.675",
|
34
|
+
"@teambit/component-compare": "0.0.120",
|
35
|
+
"@teambit/ui": "0.0.872",
|
33
36
|
"@teambit/component.modules.component-url": "0.0.140",
|
34
37
|
"@teambit/component.ui.deprecation-icon": "0.0.500",
|
35
38
|
"@teambit/design.ui.styles.ellipsis": "0.0.353",
|
36
39
|
"@teambit/envs.ui.env-icon": "0.0.492",
|
37
|
-
"@teambit/component.ui.compare": "0.0.
|
40
|
+
"@teambit/component.ui.compare": "0.0.96",
|
38
41
|
"@teambit/design.ui.round-loader": "0.0.352",
|
39
42
|
"@teambit/design.ui.pages.not-found": "0.0.363",
|
40
43
|
"@teambit/design.ui.pages.server-error": "0.0.363",
|
@@ -43,11 +46,12 @@
|
|
43
46
|
"@teambit/ui-foundation.ui.react-router.use-query": "0.0.493"
|
44
47
|
},
|
45
48
|
"devDependencies": {
|
49
|
+
"@types/graphlib": "2.1.7",
|
46
50
|
"@types/react": "^17.0.8",
|
47
51
|
"@types/lodash": "4.14.165",
|
48
52
|
"@types/classnames": "2.2.11",
|
49
|
-
"@types/dagre": "0.7.44",
|
50
53
|
"@types/semver": "7.3.4",
|
54
|
+
"@types/dagre": "0.7.44",
|
51
55
|
"@types/mocha": "9.1.0",
|
52
56
|
"@types/testing-library__jest-dom": "5.9.5",
|
53
57
|
"@types/jest": "^26.0.0",
|
@@ -56,7 +60,7 @@
|
|
56
60
|
},
|
57
61
|
"peerDependencies": {
|
58
62
|
"@apollo/client": "^3.6.0",
|
59
|
-
"@teambit/legacy": "1.0.
|
63
|
+
"@teambit/legacy": "1.0.363",
|
60
64
|
"react-dom": "^16.8.0 || ^17.0.0",
|
61
65
|
"react": "^16.8.0 || ^17.0.0"
|
62
66
|
},
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_graph@0.0.
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_graph@0.0.
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_graph@0.0.872/dist/graph.composition.js';
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_graph@0.0.872/dist/graph.docs.md';
|
3
3
|
|
4
4
|
export const compositions = [compositions_0];
|
5
5
|
export const overview = [overview_0];
|
package/dist/graph.provider.d.ts
DELETED
@@ -1,5 +0,0 @@
|
|
1
|
-
import { GraphqlMain } from '@teambit/graphql';
|
2
|
-
import { ComponentMain } from '@teambit/component';
|
3
|
-
import { GraphBuilder } from './graph-builder';
|
4
|
-
export declare type GraphDeps = [GraphqlMain, ComponentMain];
|
5
|
-
export declare function provide([graphql, componentAspect]: GraphDeps): Promise<GraphBuilder>;
|
package/dist/graph.provider.js
DELETED
@@ -1,39 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
require("core-js/modules/es.array.iterator.js");
|
4
|
-
|
5
|
-
require("core-js/modules/es.promise.js");
|
6
|
-
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
8
|
-
value: true
|
9
|
-
});
|
10
|
-
exports.provide = provide;
|
11
|
-
|
12
|
-
function _graphBuilder() {
|
13
|
-
const data = require("./graph-builder");
|
14
|
-
|
15
|
-
_graphBuilder = function () {
|
16
|
-
return data;
|
17
|
-
};
|
18
|
-
|
19
|
-
return data;
|
20
|
-
}
|
21
|
-
|
22
|
-
function _graph() {
|
23
|
-
const data = require("./graph.graphql");
|
24
|
-
|
25
|
-
_graph = function () {
|
26
|
-
return data;
|
27
|
-
};
|
28
|
-
|
29
|
-
return data;
|
30
|
-
}
|
31
|
-
|
32
|
-
async function provide([graphql, componentAspect]) {
|
33
|
-
const graphBuilder = new (_graphBuilder().GraphBuilder)(componentAspect); // TODO: make sure it's working (the host here might be undefined?)
|
34
|
-
|
35
|
-
graphql.register((0, _graph().graphSchema)(graphBuilder, componentAspect));
|
36
|
-
return graphBuilder;
|
37
|
-
}
|
38
|
-
|
39
|
-
//# sourceMappingURL=graph.provider.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["provide","graphql","componentAspect","graphBuilder","GraphBuilder","register","graphSchema"],"sources":["graph.provider.ts"],"sourcesContent":["import { GraphqlMain } from '@teambit/graphql';\nimport { ComponentMain } from '@teambit/component';\n\nimport { GraphBuilder } from './graph-builder';\nimport { graphSchema } from './graph.graphql';\n\nexport type GraphDeps = [GraphqlMain, ComponentMain];\n\nexport async function provide([graphql, componentAspect]: GraphDeps): Promise<GraphBuilder> {\n const graphBuilder = new GraphBuilder(componentAspect);\n // TODO: make sure it's working (the host here might be undefined?)\n graphql.register(graphSchema(graphBuilder, componentAspect));\n return graphBuilder;\n}\n"],"mappings":";;;;;;;;;;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAIO,eAAeA,OAAf,CAAuB,CAACC,OAAD,EAAUC,eAAV,CAAvB,EAAqF;EAC1F,MAAMC,YAAY,GAAG,KAAIC,4BAAJ,EAAiBF,eAAjB,CAArB,CAD0F,CAE1F;;EACAD,OAAO,CAACI,QAAR,CAAiB,IAAAC,oBAAA,EAAYH,YAAZ,EAA0BD,eAA1B,CAAjB;EACA,OAAOC,YAAP;AACD"}
|
Binary file
|