@teambit/graph 0.0.886 → 0.0.887
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 -1
- package/dist/graph-builder.js +10 -22
- package/dist/graph-builder.js.map +1 -1
- package/package-tar/teambit-graph-0.0.887.tgz +0 -0
- package/package.json +24 -24
- package/{preview-1666842256282.js → preview-1667014802517.js} +2 -2
- package/package-tar/teambit-graph-0.0.886.tgz +0 -0
package/dist/graph-builder.d.ts
CHANGED
package/dist/graph-builder.js
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
require("core-js/modules/es.array.iterator.js");
|
4
3
|
require("core-js/modules/es.promise.js");
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
6
5
|
value: true
|
@@ -33,31 +32,20 @@ class GraphBuilder {
|
|
33
32
|
}
|
34
33
|
async getGraph(ids, opts = {}) {
|
35
34
|
const componentHost = opts.host || this.componentAspect.getHost();
|
36
|
-
const
|
37
|
-
const
|
38
|
-
|
39
|
-
|
40
|
-
graph.seederIds = ids || (await componentHost.listIds());
|
41
|
-
return graph;
|
35
|
+
const graph = await componentHost.getGraph(ids, false);
|
36
|
+
const componentGraph = await this.toComponentGraph(graph);
|
37
|
+
componentGraph.seederIds = ids || (await componentHost.listIds());
|
38
|
+
return componentGraph;
|
42
39
|
}
|
43
|
-
async
|
40
|
+
async toComponentGraph(graph) {
|
44
41
|
const newGraph = new (_componentGraph().ComponentGraph)();
|
45
|
-
|
46
|
-
|
47
|
-
const componentId = await componentHost.resolveComponentId(nodeId);
|
48
|
-
const component = await componentHost.get(componentId);
|
49
|
-
if (component) {
|
50
|
-
newGraph.setNode(new (_graph().Node)(componentId.toString(), component));
|
51
|
-
}
|
42
|
+
graph.nodes.forEach(node => {
|
43
|
+
newGraph.setNode(node);
|
52
44
|
});
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
const target = await componentHost.resolveComponentId(edgeId.w);
|
57
|
-
const edgeObj = legacyGraph.edge(edgeId.v, edgeId.w) === 'dependencies' ? new (_dependency().Dependency)('runtime') : new (_dependency().Dependency)('dev');
|
58
|
-
newGraph.setEdge(new (_graph().Edge)(source.toString(), target.toString(), edgeObj));
|
45
|
+
graph.edges.forEach(edge => {
|
46
|
+
const edgeObj = edge.attr === 'dependencies' ? new (_dependency().Dependency)('runtime') : new (_dependency().Dependency)('dev');
|
47
|
+
newGraph.setEdge(new (_graph().Edge)(edge.sourceId, edge.targetId, edgeObj));
|
59
48
|
});
|
60
|
-
await Promise.all(setEdgePromise);
|
61
49
|
return newGraph;
|
62
50
|
}
|
63
51
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["GraphBuilder","constructor","componentAspect","getGraph","ids","opts","componentHost","host","getHost","
|
1
|
+
{"version":3,"names":["GraphBuilder","constructor","componentAspect","getGraph","ids","opts","componentHost","host","getHost","graph","componentGraph","toComponentGraph","seederIds","listIds","newGraph","ComponentGraph","nodes","forEach","node","setNode","edges","edge","edgeObj","attr","Dependency","setEdge","Edge","sourceId","targetId"],"sources":["graph-builder.ts"],"sourcesContent":["import { Component, ComponentFactory, ComponentID, ComponentMain } from '@teambit/component';\nimport { Edge, Graph } from '@teambit/graph.cleargraph';\nimport { ComponentGraph } from './component-graph';\nimport { Dependency } from './model/dependency';\n\nexport type GetGraphOpts = {\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 graph = await componentHost.getGraph(ids, false);\n const componentGraph = await this.toComponentGraph(graph);\n componentGraph.seederIds = ids || (await componentHost.listIds());\n return componentGraph;\n }\n\n private async toComponentGraph(graph: Graph<Component, string>): Promise<ComponentGraph> {\n const newGraph = new ComponentGraph();\n graph.nodes.forEach((node) => {\n newGraph.setNode(node);\n });\n graph.edges.forEach((edge) => {\n const edgeObj = edge.attr === 'dependencies' ? new Dependency('runtime') : new Dependency('dev');\n newGraph.setEdge(new Edge(edge.sourceId, edge.targetId, edgeObj));\n });\n return newGraph;\n }\n}\n"],"mappings":";;;;;;;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAMO,MAAMA,YAAY,CAAC;EACxBC,WAAW,CAASC,eAA8B,EAAE;IAAA,KAAhCA,eAA8B,GAA9BA,eAA8B;EAAG;EAErD,MAAMC,QAAQ,CAACC,GAAmB,EAAEC,IAAkB,GAAG,CAAC,CAAC,EAA2B;IACpF,MAAMC,aAAa,GAAGD,IAAI,CAACE,IAAI,IAAI,IAAI,CAACL,eAAe,CAACM,OAAO,EAAE;IAEjE,MAAMC,KAAK,GAAG,MAAMH,aAAa,CAACH,QAAQ,CAACC,GAAG,EAAE,KAAK,CAAC;IACtD,MAAMM,cAAc,GAAG,MAAM,IAAI,CAACC,gBAAgB,CAACF,KAAK,CAAC;IACzDC,cAAc,CAACE,SAAS,GAAGR,GAAG,KAAK,MAAME,aAAa,CAACO,OAAO,EAAE,CAAC;IACjE,OAAOH,cAAc;EACvB;EAEA,MAAcC,gBAAgB,CAACF,KAA+B,EAA2B;IACvF,MAAMK,QAAQ,GAAG,KAAIC,gCAAc,GAAE;IACrCN,KAAK,CAACO,KAAK,CAACC,OAAO,CAAEC,IAAI,IAAK;MAC5BJ,QAAQ,CAACK,OAAO,CAACD,IAAI,CAAC;IACxB,CAAC,CAAC;IACFT,KAAK,CAACW,KAAK,CAACH,OAAO,CAAEI,IAAI,IAAK;MAC5B,MAAMC,OAAO,GAAGD,IAAI,CAACE,IAAI,KAAK,cAAc,GAAG,KAAIC,wBAAU,EAAC,SAAS,CAAC,GAAG,KAAIA,wBAAU,EAAC,KAAK,CAAC;MAChGV,QAAQ,CAACW,OAAO,CAAC,KAAIC,aAAI,EAACL,IAAI,CAACM,QAAQ,EAAEN,IAAI,CAACO,QAAQ,EAAEN,OAAO,CAAC,CAAC;IACnE,CAAC,CAAC;IACF,OAAOR,QAAQ;EACjB;AACF;AAAC"}
|
Binary file
|
package/package.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "@teambit/graph",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.887",
|
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.887"
|
10
10
|
},
|
11
11
|
"dependencies": {
|
12
12
|
"chalk": "2.4.2",
|
@@ -15,9 +15,9 @@
|
|
15
15
|
"lodash": "4.17.21",
|
16
16
|
"classnames": "2.2.6",
|
17
17
|
"react-flow-renderer": "8.3.7",
|
18
|
-
"semver": "7.3.4",
|
19
18
|
"dagre": "0.8.5",
|
20
|
-
"
|
19
|
+
"semver": "7.3.4",
|
20
|
+
"@babel/runtime": "7.20.0",
|
21
21
|
"core-js": "^3.0.0",
|
22
22
|
"@teambit/graph.cleargraph": "0.0.1",
|
23
23
|
"@teambit/harmony": "0.3.3",
|
@@ -26,32 +26,32 @@
|
|
26
26
|
"@teambit/base-ui.text.muted-text": "1.0.1",
|
27
27
|
"@teambit/evangelist.input.checkbox.label": "1.0.3",
|
28
28
|
"@teambit/documenter.ui.heading": "4.1.1",
|
29
|
-
"@teambit/component": "0.0.
|
30
|
-
"@teambit/cli": "0.0.
|
31
|
-
"@teambit/legacy-bit-id": "0.0.
|
32
|
-
"@teambit/graphql": "0.0.
|
33
|
-
"@teambit/logger": "0.0.
|
34
|
-
"@teambit/component-compare": "0.0.
|
35
|
-
"@teambit/ui": "0.0.
|
36
|
-
"@teambit/component.modules.component-url": "0.0.
|
37
|
-
"@teambit/component.ui.deprecation-icon": "0.0.
|
38
|
-
"@teambit/design.ui.styles.ellipsis": "0.0.
|
39
|
-
"@teambit/envs.ui.env-icon": "0.0.
|
40
|
-
"@teambit/component.ui.compare": "0.0.
|
41
|
-
"@teambit/design.ui.round-loader": "0.0.
|
42
|
-
"@teambit/design.ui.pages.not-found": "0.0.
|
43
|
-
"@teambit/design.ui.pages.server-error": "0.0.
|
44
|
-
"@teambit/ui-foundation.ui.full-loader": "0.0.
|
45
|
-
"@teambit/ui-foundation.ui.hooks.use-data-query": "0.0.
|
46
|
-
"@teambit/ui-foundation.ui.react-router.use-query": "0.0.
|
29
|
+
"@teambit/component": "0.0.887",
|
30
|
+
"@teambit/cli": "0.0.595",
|
31
|
+
"@teambit/legacy-bit-id": "0.0.415",
|
32
|
+
"@teambit/graphql": "0.0.887",
|
33
|
+
"@teambit/logger": "0.0.688",
|
34
|
+
"@teambit/component-compare": "0.0.135",
|
35
|
+
"@teambit/ui": "0.0.887",
|
36
|
+
"@teambit/component.modules.component-url": "0.0.142",
|
37
|
+
"@teambit/component.ui.deprecation-icon": "0.0.501",
|
38
|
+
"@teambit/design.ui.styles.ellipsis": "0.0.354",
|
39
|
+
"@teambit/envs.ui.env-icon": "0.0.493",
|
40
|
+
"@teambit/component.ui.compare": "0.0.109",
|
41
|
+
"@teambit/design.ui.round-loader": "0.0.353",
|
42
|
+
"@teambit/design.ui.pages.not-found": "0.0.364",
|
43
|
+
"@teambit/design.ui.pages.server-error": "0.0.364",
|
44
|
+
"@teambit/ui-foundation.ui.full-loader": "0.0.493",
|
45
|
+
"@teambit/ui-foundation.ui.hooks.use-data-query": "0.0.497",
|
46
|
+
"@teambit/ui-foundation.ui.react-router.use-query": "0.0.494"
|
47
47
|
},
|
48
48
|
"devDependencies": {
|
49
49
|
"@types/graphlib": "2.1.7",
|
50
50
|
"@types/react": "^17.0.8",
|
51
51
|
"@types/lodash": "4.14.165",
|
52
52
|
"@types/classnames": "2.2.11",
|
53
|
-
"@types/semver": "7.3.4",
|
54
53
|
"@types/dagre": "0.7.44",
|
54
|
+
"@types/semver": "7.3.4",
|
55
55
|
"@types/mocha": "9.1.0",
|
56
56
|
"@types/testing-library__jest-dom": "5.9.5",
|
57
57
|
"@types/jest": "^26.0.0",
|
@@ -60,7 +60,7 @@
|
|
60
60
|
},
|
61
61
|
"peerDependencies": {
|
62
62
|
"@apollo/client": "^3.6.0",
|
63
|
-
"@teambit/legacy": "1.0.
|
63
|
+
"@teambit/legacy": "1.0.379",
|
64
64
|
"react-dom": "^16.8.0 || ^17.0.0",
|
65
65
|
"react": "^16.8.0 || ^17.0.0"
|
66
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.887/dist/graph.composition.js';
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_graph@0.0.887/dist/graph.docs.md';
|
3
3
|
|
4
4
|
export const compositions = [compositions_0];
|
5
5
|
export const overview = [overview_0];
|
Binary file
|