@teambit/snapping 1.0.613 → 1.0.615

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.
@@ -47,8 +47,7 @@ function _lodash() {
47
47
  return data;
48
48
  }
49
49
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
50
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
51
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
50
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
52
51
  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; }
53
52
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
54
53
  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); }
@@ -1 +1 @@
1
- {"version":3,"names":["_graphlib","data","_interopRequireWildcard","require","_pMapSeries","_interopRequireDefault","_bitError","_componentId","_legacy","_lodash","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_defineProperty","_toPropertyKey","value","enumerable","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","FlattenedDependenciesGetter","constructor","scope","components","lane","populateFlattenedDependencies","logger","debug","length","dependenciesGraph","buildComponentsGraphCombined","importExternalDependenciesInBulk","mapSeries","component","flattenedDependencies","getFlattened","componentId","allDependencies","map","getEdges","id","toString","idsStr","compact","uniq","flat","bitIds","idStr","node","filter","bitId","find","c","isEqual","scopeComponentsImporter","scopeImporter","versionDependencies","importMany","ids","ComponentIdList","fromArray","preferDependencyGraph","cache","throwForDependencyNotFound","reason","dependencies","getFlattenedFromCurrentComponents","forEach","dep","throwWhenDepNotIncluded","dependenciesDeps","getFlattenedFromVersion","dependenciesDepsFlattened","dependenciesDepsUniq","uniqFromArray","push","allDeps","dependentId","versionDeps","toComponentId","objects","existing","hasVersion","Error","fromModel","getVersionInstance","exports","dependencyId","hasScope","BitError","graph","hasNode","edges","graphlib","alg","preorder","tail","GraphLib","_setGraphEdges","devDependencies","extensionDependencies","label","dependency","depId","setNode","setEdge"],"sources":["get-flattened-dependencies.ts"],"sourcesContent":["import graphlib, { Graph as GraphLib } from 'graphlib';\nimport mapSeries from 'p-map-series';\nimport { BitError } from '@teambit/bit-error';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport { BitIdStr } from '@teambit/legacy-bit-id';\nimport { VersionDependencies, Scope } from '@teambit/legacy.scope';\nimport { ConsumerComponent as Component, Dependencies } from '@teambit/legacy.consumer-component';\nimport { logger } from '@teambit/legacy.logger';\nimport { Lane } from '@teambit/objects';\nimport { compact, tail, uniq } from 'lodash';\n\nexport class FlattenedDependenciesGetter {\n private dependenciesGraph: GraphLib;\n private versionDependencies: VersionDependencies[];\n private cache: { [idStr: string]: ComponentIdList } = {};\n constructor(\n private scope: Scope,\n private components: Component[],\n private lane?: Lane\n ) {}\n\n /**\n * to get the flattened dependencies of a component, we iterate over the direct dependencies and\n * figure out what should be the flattened of each one of the dependencies.\n * a dependency can be one of the two scenarios and should be handled accordingly.\n * 1. a dependency can be tagged/snapped along with the current component.\n * 2. a dependency can be a component that was already tagged before.\n * there is no option #3 of a component that exists on the workspace but wasn't tagged and is not\n * part of the current tag. In such case, we throw an error, see throwWhenDepNotIncluded below.\n *\n * the flattened dependencies process handles the two cases above differently.\n * 1. first, it builds a graph with all current components, this way it's easier to get the\n * flattened dependencies by graph algorithm. (without graph, it becomes difficult when there are\n * circular dependencies).\n * 2. for other components, it loads them from the model and gets the flattened from the objects.\n */\n async populateFlattenedDependencies() {\n logger.debug(`populateFlattenedDependencies starts with ${this.components.length} components`);\n this.dependenciesGraph = buildComponentsGraphCombined(this.components);\n // console.log(\"this.dependenciesGraph\", this.dependenciesGraph.toString())\n await this.importExternalDependenciesInBulk();\n await mapSeries(this.components, async (component) => {\n component.flattenedDependencies = await this.getFlattened(component.componentId);\n });\n }\n\n private async importExternalDependenciesInBulk() {\n const allDependencies = this.components.map((component) => {\n return getEdges(this.dependenciesGraph, component.id.toString());\n });\n const idsStr: string[] = compact(uniq(allDependencies.flat()));\n const bitIds = idsStr\n .map((idStr) => this.dependenciesGraph.node(idStr))\n .filter((bitId) => !this.components.find((c) => c.id.isEqual(bitId)));\n const scopeComponentsImporter = this.scope.scopeImporter;\n this.versionDependencies = await scopeComponentsImporter.importMany({\n ids: ComponentIdList.fromArray(bitIds),\n preferDependencyGraph: false,\n cache: true,\n throwForDependencyNotFound: true,\n lane: this.lane,\n reason: 'for fetching all dependencies',\n });\n }\n\n private async getFlattened(bitId: ComponentID): Promise<ComponentIdList> {\n const dependencies = this.getFlattenedFromCurrentComponents(bitId);\n dependencies.forEach((dep) => throwWhenDepNotIncluded(bitId, dep));\n const dependenciesDeps = await mapSeries(dependencies, (dep) => this.getFlattenedFromVersion(dep, bitId));\n const dependenciesDepsFlattened = dependenciesDeps.flat();\n // this dependenciesDepsFlattened can be huge, don't use spread operator (...) here. otherwise, it throws\n // `Maximum call stack size exceeded`. it's important to first make them uniq\n // (from a real example, before uniq: 133,068. after uniq: 2,126)\n const dependenciesDepsUniq = ComponentIdList.uniqFromArray(dependenciesDepsFlattened);\n dependencies.push(...dependenciesDepsUniq);\n return ComponentIdList.uniqFromArray(dependencies);\n }\n\n private getFlattenedFromCurrentComponents(bitId: ComponentID): ComponentID[] {\n const allDeps = getEdges(this.dependenciesGraph, bitId.toString()) || [];\n const dependencies = allDeps.map((idStr) => this.dependenciesGraph.node(idStr));\n return dependencies;\n }\n\n private async getFlattenedFromVersion(id: ComponentID, dependentId: ComponentID): Promise<ComponentIdList> {\n if (!this.cache[id.toString()]) {\n const versionDeps = this.versionDependencies.find(({ component }) => component.toComponentId().isEqual(id));\n if (versionDeps) {\n const dependencies = await versionDeps.component.flattenedDependencies(this.scope.objects);\n this.cache[id.toString()] = dependencies;\n } else {\n const existing = this.components.find((c) => c.id.isEqual(id));\n if (existing) {\n this.cache[id.toString()] = new ComponentIdList();\n } else {\n if (!id.hasVersion()) {\n throw new Error(`error found while getting the dependencies of \"${dependentId.toString()}\". A dependency \"${id.toString()}\" doesn't have a version\nif this is an external env/extension/aspect configured in workspace.jsonc, make sure it is set with a version`);\n }\n const fromModel = await this.scope.getVersionInstance(id);\n this.cache[id.toString()] = fromModel.flattenedDependencies;\n }\n }\n }\n return this.cache[id.toString()];\n }\n}\n\nfunction throwWhenDepNotIncluded(componentId: ComponentID, dependencyId: ComponentID) {\n if (!dependencyId.hasScope() && !dependencyId.hasVersion()) {\n throw new BitError(`fatal: \"${componentId.toString()}\" has a dependency \"${dependencyId.toString()}\".\nthis dependency was not included in the tag command.`);\n }\n}\n\n/**\n * get all successors edges recursively (flatten)\n */\nfunction getEdges(graph: GraphLib, id: BitIdStr): BitIdStr[] | null {\n if (!graph.hasNode(id)) return null;\n // @ts-ignore\n const edges = graphlib.alg.preorder(graph, id);\n return tail(edges); // the first item is the component itself\n}\n\n/**\n * one graph of the given components. it doesn't fetch/load anything. it builds the graph with the\n * given data. the node is a ComponentID and the edge has the label of the dependency type. it can be\n * either \"dependencies\" or \"devDependencies\".\n */\nfunction buildComponentsGraphCombined(components: Component[]): GraphLib {\n const graph = new GraphLib();\n components.forEach((component) => {\n _setGraphEdges(component.id, component.dependencies, graph);\n _setGraphEdges(component.id, component.devDependencies, graph, 'devDependencies');\n _setGraphEdges(component.id, component.extensionDependencies, graph, 'devDependencies');\n });\n return graph;\n}\n\nfunction _setGraphEdges(bitId: ComponentID, dependencies: Dependencies, graph: GraphLib, label = 'dependencies') {\n const id = bitId.toString();\n dependencies.get().forEach((dependency) => {\n const depId = dependency.id.toString();\n // save the full ComponentID of a string id to be able to retrieve it later with no confusion\n if (!graph.hasNode(id)) graph.setNode(id, bitId);\n if (!graph.hasNode(depId)) graph.setNode(depId, dependency.id);\n graph.setEdge(id, depId, label);\n });\n}\n"],"mappings":";;;;;;AAAA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,uBAAA,CAAAC,OAAA;EAAAH,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,YAAA;EAAA,MAAAH,IAAA,GAAAI,sBAAA,CAAAF,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,UAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,SAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM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AAOA,KAAK;AACd;AAEA,SAASQ,cAAcA,CAAChD,KAAkB,EAAEe,YAA0B,EAAEyB,KAAe,EAAEW,KAAK,GAAG,cAAc,EAAE;EAC/G,MAAM7D,EAAE,GAAGU,KAAK,CAACT,QAAQ,CAAC,CAAC;EAC3BwB,YAAY,CAACrE,GAAG,CAAC,CAAC,CAACuE,OAAO,CAAEmC,UAAU,IAAK;IACzC,MAAMC,KAAK,GAAGD,UAAU,CAAC9D,EAAE,CAACC,QAAQ,CAAC,CAAC;IACtC;IACA,IAAI,CAACiD,KAAK,CAACC,OAAO,CAACnD,EAAE,CAAC,EAAEkD,KAAK,CAACc,OAAO,CAAChE,EAAE,EAAEU,KAAK,CAAC;IAChD,IAAI,CAACwC,KAAK,CAACC,OAAO,CAACY,KAAK,CAAC,EAAEb,KAAK,CAACc,OAAO,CAACD,KAAK,EAAED,UAAU,CAAC9D,EAAE,CAAC;IAC9DkD,KAAK,CAACe,OAAO,CAACjE,EAAE,EAAE+D,KAAK,EAAEF,KAAK,CAAC;EACjC,CAAC,CAAC;AACJ","ignoreList":[]}
1
+ {"version":3,"names":["_graphlib","data","_interopRequireWildcard","require","_pMapSeries","_interopRequireDefault","_bitError","_componentId","_legacy","_lodash","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_defineProperty","_toPropertyKey","value","enumerable","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","FlattenedDependenciesGetter","constructor","scope","components","lane","populateFlattenedDependencies","logger","debug","length","dependenciesGraph","buildComponentsGraphCombined","importExternalDependenciesInBulk","mapSeries","component","flattenedDependencies","getFlattened","componentId","allDependencies","map","getEdges","id","toString","idsStr","compact","uniq","flat","bitIds","idStr","node","filter","bitId","find","c","isEqual","scopeComponentsImporter","scopeImporter","versionDependencies","importMany","ids","ComponentIdList","fromArray","preferDependencyGraph","cache","throwForDependencyNotFound","reason","dependencies","getFlattenedFromCurrentComponents","forEach","dep","throwWhenDepNotIncluded","dependenciesDeps","getFlattenedFromVersion","dependenciesDepsFlattened","dependenciesDepsUniq","uniqFromArray","push","allDeps","dependentId","versionDeps","toComponentId","objects","existing","hasVersion","Error","fromModel","getVersionInstance","exports","dependencyId","hasScope","BitError","graph","hasNode","edges","graphlib","alg","preorder","tail","GraphLib","_setGraphEdges","devDependencies","extensionDependencies","label","dependency","depId","setNode","setEdge"],"sources":["get-flattened-dependencies.ts"],"sourcesContent":["import graphlib, { Graph as GraphLib } from 'graphlib';\nimport mapSeries from 'p-map-series';\nimport { BitError } from '@teambit/bit-error';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport { BitIdStr } from '@teambit/legacy-bit-id';\nimport { VersionDependencies, Scope } from '@teambit/legacy.scope';\nimport { ConsumerComponent as Component, Dependencies } from '@teambit/legacy.consumer-component';\nimport { logger } from '@teambit/legacy.logger';\nimport { Lane } from '@teambit/objects';\nimport { compact, tail, uniq } from 'lodash';\n\nexport class FlattenedDependenciesGetter {\n private dependenciesGraph: GraphLib;\n private versionDependencies: VersionDependencies[];\n private cache: { [idStr: string]: ComponentIdList } = {};\n constructor(\n private scope: Scope,\n private components: Component[],\n private lane?: Lane\n ) {}\n\n /**\n * to get the flattened dependencies of a component, we iterate over the direct dependencies and\n * figure out what should be the flattened of each one of the dependencies.\n * a dependency can be one of the two scenarios and should be handled accordingly.\n * 1. a dependency can be tagged/snapped along with the current component.\n * 2. a dependency can be a component that was already tagged before.\n * there is no option #3 of a component that exists on the workspace but wasn't tagged and is not\n * part of the current tag. In such case, we throw an error, see throwWhenDepNotIncluded below.\n *\n * the flattened dependencies process handles the two cases above differently.\n * 1. first, it builds a graph with all current components, this way it's easier to get the\n * flattened dependencies by graph algorithm. (without graph, it becomes difficult when there are\n * circular dependencies).\n * 2. for other components, it loads them from the model and gets the flattened from the objects.\n */\n async populateFlattenedDependencies() {\n logger.debug(`populateFlattenedDependencies starts with ${this.components.length} components`);\n this.dependenciesGraph = buildComponentsGraphCombined(this.components);\n // console.log(\"this.dependenciesGraph\", this.dependenciesGraph.toString())\n await this.importExternalDependenciesInBulk();\n await mapSeries(this.components, async (component) => {\n component.flattenedDependencies = await this.getFlattened(component.componentId);\n });\n }\n\n private async importExternalDependenciesInBulk() {\n const allDependencies = this.components.map((component) => {\n return getEdges(this.dependenciesGraph, component.id.toString());\n });\n const idsStr: string[] = compact(uniq(allDependencies.flat()));\n const bitIds = idsStr\n .map((idStr) => this.dependenciesGraph.node(idStr))\n .filter((bitId) => !this.components.find((c) => c.id.isEqual(bitId)));\n const scopeComponentsImporter = this.scope.scopeImporter;\n this.versionDependencies = await scopeComponentsImporter.importMany({\n ids: ComponentIdList.fromArray(bitIds),\n preferDependencyGraph: false,\n cache: true,\n throwForDependencyNotFound: true,\n lane: this.lane,\n reason: 'for fetching all dependencies',\n });\n }\n\n private async getFlattened(bitId: ComponentID): Promise<ComponentIdList> {\n const dependencies = this.getFlattenedFromCurrentComponents(bitId);\n dependencies.forEach((dep) => throwWhenDepNotIncluded(bitId, dep));\n const dependenciesDeps = await mapSeries(dependencies, (dep) => this.getFlattenedFromVersion(dep, bitId));\n const dependenciesDepsFlattened = dependenciesDeps.flat();\n // this dependenciesDepsFlattened can be huge, don't use spread operator (...) here. otherwise, it throws\n // `Maximum call stack size exceeded`. it's important to first make them uniq\n // (from a real example, before uniq: 133,068. after uniq: 2,126)\n const dependenciesDepsUniq = ComponentIdList.uniqFromArray(dependenciesDepsFlattened);\n dependencies.push(...dependenciesDepsUniq);\n return ComponentIdList.uniqFromArray(dependencies);\n }\n\n private getFlattenedFromCurrentComponents(bitId: ComponentID): ComponentID[] {\n const allDeps = getEdges(this.dependenciesGraph, bitId.toString()) || [];\n const dependencies = allDeps.map((idStr) => this.dependenciesGraph.node(idStr));\n return dependencies;\n }\n\n private async getFlattenedFromVersion(id: ComponentID, dependentId: ComponentID): Promise<ComponentIdList> {\n if (!this.cache[id.toString()]) {\n const versionDeps = this.versionDependencies.find(({ component }) => component.toComponentId().isEqual(id));\n if (versionDeps) {\n const dependencies = await versionDeps.component.flattenedDependencies(this.scope.objects);\n this.cache[id.toString()] = dependencies;\n } else {\n const existing = this.components.find((c) => c.id.isEqual(id));\n if (existing) {\n this.cache[id.toString()] = new ComponentIdList();\n } else {\n if (!id.hasVersion()) {\n throw new Error(`error found while getting the dependencies of \"${dependentId.toString()}\". A dependency \"${id.toString()}\" doesn't have a version\nif this is an external env/extension/aspect configured in workspace.jsonc, make sure it is set with a version`);\n }\n const fromModel = await this.scope.getVersionInstance(id);\n this.cache[id.toString()] = fromModel.flattenedDependencies;\n }\n }\n }\n return this.cache[id.toString()];\n }\n}\n\nfunction throwWhenDepNotIncluded(componentId: ComponentID, dependencyId: ComponentID) {\n if (!dependencyId.hasScope() && !dependencyId.hasVersion()) {\n throw new BitError(`fatal: \"${componentId.toString()}\" has a dependency \"${dependencyId.toString()}\".\nthis dependency was not included in the tag command.`);\n }\n}\n\n/**\n * get all successors edges recursively (flatten)\n */\nfunction getEdges(graph: GraphLib, id: BitIdStr): BitIdStr[] | null {\n if (!graph.hasNode(id)) return null;\n // @ts-ignore\n const edges = graphlib.alg.preorder(graph, id);\n return tail(edges); // the first item is the component itself\n}\n\n/**\n * one graph of the given components. it doesn't fetch/load anything. it builds the graph with the\n * given data. the node is a ComponentID and the edge has the label of the dependency type. it can be\n * either \"dependencies\" or \"devDependencies\".\n */\nfunction buildComponentsGraphCombined(components: Component[]): GraphLib {\n const graph = new GraphLib();\n components.forEach((component) => {\n _setGraphEdges(component.id, component.dependencies, graph);\n _setGraphEdges(component.id, component.devDependencies, graph, 'devDependencies');\n _setGraphEdges(component.id, component.extensionDependencies, graph, 'devDependencies');\n });\n return graph;\n}\n\nfunction _setGraphEdges(bitId: ComponentID, dependencies: Dependencies, graph: GraphLib, label = 'dependencies') {\n const id = bitId.toString();\n dependencies.get().forEach((dependency) => {\n const depId = dependency.id.toString();\n // save the full ComponentID of a string id to be able to retrieve it later with no confusion\n if (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AuB,EAAY;EACvE,MAAMmE,KAAK,GAAG,KAAIO,iBAAQ,EAAC,CAAC;EAC5B1E,UAAU,CAAC4C,OAAO,CAAElC,SAAS,IAAK;IAChCiE,cAAc,CAACjE,SAAS,CAACO,EAAE,EAAEP,SAAS,CAACgC,YAAY,EAAEyB,KAAK,CAAC;IAC3DQ,cAAc,CAACjE,SAAS,CAACO,EAAE,EAAEP,SAAS,CAACkE,eAAe,EAAET,KAAK,EAAE,iBAAiB,CAAC;IACjFQ,cAAc,CAACjE,SAAS,CAACO,EAAE,EAAEP,SAAS,CAACmE,qBAAqB,EAAEV,KAAK,EAAE,iBAAiB,CAAC;EACzF,CAAC,CAAC;EACF,OAAOA,KAAK;AACd;AAEA,SAASQ,cAAcA,CAAChD,KAAkB,EAAEe,YAA0B,EAAEyB,KAAe,EAAEW,KAAK,GAAG,cAAc,EAAE;EAC/G,MAAM7D,EAAE,GAAGU,KAAK,CAACT,QAAQ,CAAC,CAAC;EAC3BwB,YAAY,CAAChE,GAAG,CAAC,CAAC,CAACkE,OAAO,CAAEmC,UAAU,IAAK;IACzC,MAAMC,KAAK,GAAGD,UAAU,CAAC9D,EAAE,CAACC,QAAQ,CAAC,CAAC;IACtC;IACA,IAAI,CAACiD,KAAK,CAACC,OAAO,CAACnD,EAAE,CAAC,EAAEkD,KAAK,CAACc,OAAO,CAAChE,EAAE,EAAEU,KAAK,CAAC;IAChD,IAAI,CAACwC,KAAK,CAACC,OAAO,CAACY,KAAK,CAAC,EAAEb,KAAK,CAACc,OAAO,CAACD,KAAK,EAAED,UAAU,CAAC9D,EAAE,CAAC;IAC9DkD,KAAK,CAACe,OAAO,CAACjE,EAAE,EAAE+D,KAAK,EAAEF,KAAK,CAAC;EACjC,CAAC,CAAC;AACJ","ignoreList":[]}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/snapping",
3
- "version": "1.0.613",
3
+ "version": "1.0.615",
4
4
  "homepage": "https://bit.cloud/teambit/component/snapping",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.component",
8
8
  "name": "snapping",
9
- "version": "1.0.613"
9
+ "version": "1.0.615"
10
10
  },
11
11
  "dependencies": {
12
12
  "graphlib": "2.1.8",
@@ -25,35 +25,35 @@
25
25
  "@teambit/harmony": "0.4.7",
26
26
  "@teambit/component-version": "1.0.4",
27
27
  "@teambit/lane-id": "0.0.312",
28
- "@teambit/graph": "1.0.613",
28
+ "@teambit/graph": "1.0.615",
29
29
  "@teambit/legacy.consumer-component": "0.0.50",
30
- "@teambit/logger": "0.0.1283",
31
- "@teambit/objects": "0.0.120",
32
- "@teambit/scope": "1.0.613",
30
+ "@teambit/logger": "0.0.1285",
31
+ "@teambit/objects": "0.0.122",
32
+ "@teambit/scope": "1.0.615",
33
33
  "@teambit/toolbox.promise.map-pool": "0.0.6",
34
34
  "@teambit/component.sources": "0.0.101",
35
- "@teambit/component": "1.0.613",
36
- "@teambit/dependencies": "1.0.613",
37
- "@teambit/dependency-resolver": "1.0.613",
35
+ "@teambit/component": "1.0.615",
36
+ "@teambit/dependencies": "1.0.615",
37
+ "@teambit/dependency-resolver": "1.0.615",
38
38
  "@teambit/legacy.consumer-config": "0.0.49",
39
39
  "@teambit/legacy.extension-data": "0.0.51",
40
40
  "@teambit/legacy.logger": "0.0.19",
41
41
  "@teambit/legacy.scope": "0.0.49",
42
42
  "@teambit/legacy.loader": "0.0.7",
43
- "@teambit/cli": "0.0.1190",
43
+ "@teambit/cli": "0.0.1192",
44
44
  "@teambit/legacy.constants": "0.0.11",
45
45
  "@teambit/legacy.component-list": "0.0.103",
46
46
  "@teambit/legacy.consumer": "0.0.49",
47
47
  "@teambit/legacy.dependency-graph": "0.0.52",
48
- "@teambit/remove": "1.0.613",
49
- "@teambit/workspace": "1.0.613",
48
+ "@teambit/remove": "1.0.615",
49
+ "@teambit/workspace": "1.0.615",
50
50
  "@teambit/component-issues": "0.0.159",
51
- "@teambit/config-store": "0.0.70",
52
- "@teambit/application": "1.0.613",
53
- "@teambit/builder": "1.0.613",
54
- "@teambit/export": "1.0.613",
51
+ "@teambit/config-store": "0.0.72",
52
+ "@teambit/application": "1.0.615",
53
+ "@teambit/builder": "1.0.615",
54
+ "@teambit/export": "1.0.615",
55
55
  "@teambit/harmony.modules.concurrency": "0.0.12",
56
- "@teambit/importer": "1.0.613",
56
+ "@teambit/importer": "1.0.615",
57
57
  "@teambit/lanes.modules.create-lane": "0.0.83",
58
58
  "@teambit/legacy.scope-api": "0.0.104",
59
59
  "@teambit/pkg.modules.semver-helper": "0.0.10",
@@ -70,10 +70,10 @@
70
70
  "@types/uuid": "8.3.4",
71
71
  "@types/mocha": "9.1.0",
72
72
  "@teambit/harmony.envs.core-aspect-env": "0.0.69",
73
- "@teambit/compiler": "1.0.613",
73
+ "@teambit/compiler": "1.0.615",
74
74
  "@teambit/component.testing.mock-components": "0.0.310",
75
75
  "@teambit/harmony.testing.load-aspect": "0.0.305",
76
- "@teambit/issues": "1.0.613",
76
+ "@teambit/issues": "1.0.615",
77
77
  "@teambit/workspace.testing.mock-workspace": "0.0.87"
78
78
  },
79
79
  "peerDependencies": {