@teambit/workspace 1.0.166 → 1.0.167

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.workspace_workspace@1.0.166/dist/workspace.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.workspace_workspace@1.0.166/dist/workspace.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.workspace_workspace@1.0.167/dist/workspace.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.workspace_workspace@1.0.167/dist/workspace.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
package/dist/workspace.js CHANGED
@@ -713,13 +713,10 @@ class Workspace {
713
713
  return compsWithHead;
714
714
  }
715
715
  async getSavedGraphOfComponentIfExist(component) {
716
- let versionObj;
717
- try {
718
- versionObj = await this.scope.legacyScope.getVersionInstance(component.id);
719
- } catch (err) {
720
- return null;
721
- }
722
- const flattenedEdges = await versionObj.getFlattenedEdges(this.scope.legacyScope.objects);
716
+ if (!component.id.hasVersion()) return null;
717
+ const flattenedEdges = await this.scope.getFlattenedEdges(component.id);
718
+ const versionObj = await this.scope.getBitObjectVersionById(component.id);
719
+ if (!flattenedEdges || !versionObj) return null;
723
720
  if (!flattenedEdges.length && versionObj.flattenedDependencies.length) {
724
721
  // there are flattenedDependencies, so must be edges, if they're empty, it's because the component was tagged
725
722
  // with a version < ~0.0.901, so this flattenedEdges wasn't exist.