@teambit/graph 1.0.8 → 1.0.9
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_graph@1.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_graph@1.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_graph@1.0.9/dist/graph.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_graph@1.0.9/dist/graph.docs.md';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
|
@@ -11,8 +11,8 @@ function _compareGraphModel() {
|
|
|
11
11
|
};
|
|
12
12
|
return data;
|
|
13
13
|
}
|
|
14
|
-
function ownKeys(
|
|
15
|
-
function _objectSpread(
|
|
14
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
15
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
16
16
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
17
17
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
18
18
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_compareGraphModel","data","require","ownKeys","
|
|
1
|
+
{"version":3,"names":["_compareGraphModel","data","require","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","obj","key","value","_toPropertyKey","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","toShortId","node","component","id","toStringWithoutVersion","toShortIdFromNodeId","nodeId","split","delim","getEdgeId","_e","sourceId","targetId","diffGraph","baseGraph","compareGraph","baseId","baseNodes","nodes","compareNodes","baseNodesMap","Map","map","n","compareNodesMap","allNodes","baseNode","compareNode","get","compareVersion","version","status","isEqual","newNodes","has","allNodesMap","baseEdgesMap","edges","baseEdge","edgesOnlyInCompare","compareEdge","_allNodesMap$get","_allNodesMap$get2","toString","allEdges","CompareGraphModel"],"sources":["diff-graph.ts"],"sourcesContent":["import { ComponentID } from '@teambit/component';\nimport { EdgeModel, GraphModel, NodeModel } from '@teambit/graph';\nimport { CompareGraphModel } from './compare-graph-model';\nimport { CompareNodeModel } from './compare-node-model';\n\nconst toShortId = (node: NodeModel) => node.component.id.toStringWithoutVersion();\n\n// this is to get a key with versions ignored so that we'll have a unique set of component nodes\nconst toShortIdFromNodeId = (nodeId: string) => nodeId.split('@')[0];\n\nconst delim = '::';\n\nconst getEdgeId = (_e: EdgeModel) => {\n return `${toShortIdFromNodeId(_e.sourceId)}${delim}${toShortIdFromNodeId(_e.targetId)}`;\n};\n\nexport function diffGraph(\n baseGraph?: GraphModel<NodeModel, EdgeModel>,\n compareGraph?: GraphModel<NodeModel, EdgeModel>,\n baseId?: ComponentID\n) {\n if (!baseGraph || !compareGraph || !baseId) return null;\n\n const baseNodes = baseGraph.nodes;\n const compareNodes = compareGraph.nodes;\n\n const baseNodesMap = new Map<string, NodeModel>(baseNodes.map((n) => [toShortId(n), n]));\n const compareNodesMap = new Map<string, NodeModel>(compareNodes.map((n) => [toShortId(n), n]));\n\n const allNodes: Array<CompareNodeModel> = [];\n for (const baseNode of baseNodes) {\n const compareNode = compareNodesMap.get(toShortId(baseNode));\n if (compareNode) {\n allNodes.push({\n ...baseNode,\n compareVersion: compareNode.component.version,\n status: compareNode.component.id.isEqual(baseNode.component.id) ? undefined : 'modified',\n });\n } else {\n allNodes.push({\n ...baseNode,\n compareVersion: baseNode.component.version,\n status: 'deleted',\n });\n }\n }\n\n const newNodes = compareNodes.filter((n) => !baseNodesMap.has(toShortId(n)));\n\n for (const node of newNodes) {\n allNodes.push({\n ...node,\n compareVersion: '',\n status: 'new',\n });\n }\n const allNodesMap = new Map<string, CompareNodeModel>(allNodes.map((n) => [toShortId(n), n]));\n\n const baseEdgesMap = new Map<string, EdgeModel>(baseGraph.edges.map((baseEdge) => [getEdgeId(baseEdge), baseEdge]));\n const edgesOnlyInCompare = compareGraph.edges\n .filter((compareEdge) => !baseEdgesMap.has(getEdgeId(compareEdge)))\n .map((compareEdge) => ({\n ...compareEdge,\n sourceId: allNodesMap.get(toShortIdFromNodeId(compareEdge.sourceId))?.id.toString() || baseId.toString(),\n targetId: allNodesMap.get(toShortIdFromNodeId(compareEdge.targetId))?.id.toString() || baseId.toString(),\n }));\n const allEdges = [...baseGraph.edges, ...edgesOnlyInCompare];\n return new Comp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,GAAG,CAAC,GAAG9B,SAAS,CAACuB,KAAK,EAAE,GAAGE,kBAAkB,CAAC;EAC5D,OAAO,KAAIM,sCAAiB,EAACpB,QAAQ,EAAEmB,QAAQ,CAAC;AAClD"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/graph",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
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.9"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"lodash": "4.17.21",
|
|
@@ -31,22 +31,22 @@
|
|
|
31
31
|
"@teambit/design.ui.pages.not-found": "0.0.366",
|
|
32
32
|
"@teambit/design.ui.pages.server-error": "0.0.366",
|
|
33
33
|
"@teambit/documenter.ui.heading": "4.1.1",
|
|
34
|
-
"@teambit/component": "1.0.
|
|
35
|
-
"@teambit/cli": "0.0.
|
|
34
|
+
"@teambit/component": "1.0.9",
|
|
35
|
+
"@teambit/cli": "0.0.791",
|
|
36
36
|
"@teambit/component.ui.component-compare.models.component-compare-change-type": "0.0.7",
|
|
37
|
-
"@teambit/component.ui.component-compare.models.component-compare-props": "0.0.
|
|
38
|
-
"@teambit/graphql": "1.0.
|
|
39
|
-
"@teambit/logger": "0.0.
|
|
40
|
-
"@teambit/component-compare": "1.0.
|
|
41
|
-
"@teambit/ui": "1.0.
|
|
37
|
+
"@teambit/component.ui.component-compare.models.component-compare-props": "0.0.100",
|
|
38
|
+
"@teambit/graphql": "1.0.9",
|
|
39
|
+
"@teambit/logger": "0.0.884",
|
|
40
|
+
"@teambit/component-compare": "1.0.9",
|
|
41
|
+
"@teambit/ui": "1.0.9",
|
|
42
42
|
"@teambit/component.modules.component-url": "0.0.153",
|
|
43
43
|
"@teambit/component.ui.deprecation-icon": "0.0.509",
|
|
44
44
|
"@teambit/envs.ui.env-icon": "0.0.500",
|
|
45
|
-
"@teambit/component.ui.component-compare.context": "0.0.
|
|
45
|
+
"@teambit/component.ui.component-compare.context": "0.0.115",
|
|
46
46
|
"@teambit/component.ui.component-compare.status-resolver": "0.0.9",
|
|
47
|
+
"@teambit/ui-foundation.ui.full-loader": "0.0.500",
|
|
47
48
|
"@teambit/ui-foundation.ui.hooks.use-data-query": "0.0.505",
|
|
48
|
-
"@teambit/ui-foundation.ui.react-router.use-query": "0.0.501"
|
|
49
|
-
"@teambit/ui-foundation.ui.full-loader": "0.0.500"
|
|
49
|
+
"@teambit/ui-foundation.ui.react-router.use-query": "0.0.501"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@types/lodash": "4.14.165",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
65
65
|
"@apollo/client": "^3.6.0",
|
|
66
|
-
"@teambit/legacy": "1.0.
|
|
66
|
+
"@teambit/legacy": "1.0.571",
|
|
67
67
|
"react": "^16.8.0 || ^17.0.0",
|
|
68
68
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
69
69
|
},
|