@teambit/workspace 0.0.1050 → 0.0.1052

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/workspace.js CHANGED
@@ -178,6 +178,13 @@ function _path2() {
178
178
  };
179
179
  return data;
180
180
  }
181
+ function _component2() {
182
+ const data = _interopRequireDefault(require("@teambit/legacy/dist/consumer/component"));
183
+ _component2 = function () {
184
+ return data;
185
+ };
186
+ return data;
187
+ }
181
188
  function _scopeComponentsImporter() {
182
189
  const data = _interopRequireDefault(require("@teambit/legacy/dist/scope/component-ops/scope-components-importer"));
183
190
  _scopeComponentsImporter = function () {
@@ -676,6 +683,23 @@ class Workspace {
676
683
  return new (_component().AspectEntry)(await this.resolveComponentId(dataEntry.id), dataEntry);
677
684
  }
678
685
 
686
+ /**
687
+ * this is not the complete legacy component (ConsumerComponent), it's missing dependencies and hooks from Harmony
688
+ * are skipped. do not trust the data you get from this method unless you know what you're doing.
689
+ */
690
+ async getLegacyMinimal(id) {
691
+ try {
692
+ const componentMap = this.consumer.bitMap.getComponent(id._legacy);
693
+ return await _component2().default.loadFromFileSystem({
694
+ componentMap,
695
+ id: id._legacy,
696
+ consumer: this.consumer
697
+ });
698
+ } catch (err) {
699
+ return undefined;
700
+ }
701
+ }
702
+
679
703
  /**
680
704
  * get a component from workspace
681
705
  * @param id component ID