@teambit/workspace 0.0.1036 → 0.0.1038

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
@@ -306,6 +306,11 @@ const DEFAULT_VENDOR_DIR = 'vendor';
306
306
  * API of the Bit Workspace
307
307
  */
308
308
  class Workspace {
309
+ /**
310
+ * Indicate that we are now running installaion process
311
+ * This is important to know to ignore missing modules across different places
312
+ */
313
+
309
314
  // cache loaded components
310
315
 
311
316
  constructor(
@@ -366,6 +371,7 @@ class Workspace {
366
371
  (0, _defineProperty2().default)(this, "componentsScopeDirsMap", void 0);
367
372
  (0, _defineProperty2().default)(this, "componentLoader", void 0);
368
373
  (0, _defineProperty2().default)(this, "bitMap", void 0);
374
+ (0, _defineProperty2().default)(this, "inInstallContext", false);
369
375
  (0, _defineProperty2().default)(this, "_cachedListIds", void 0);
370
376
  (0, _defineProperty2().default)(this, "componentLoadedSelfAsAspects", void 0);
371
377
  (0, _defineProperty2().default)(this, "aspectsMerger", void 0);
@@ -691,7 +697,10 @@ class Workspace {
691
697
  try {
692
698
  this.componentLoadedSelfAsAspects.set(component.id.toString(), true);
693
699
  this.logger.debug(`trying to load self as aspect with id ${component.id.toString()}`);
694
- await this.loadAspects([component.id.toString()], undefined, component.id.toString());
700
+ // ignore missing modules when loading self
701
+ await this.loadAspects([component.id.toString()], undefined, component.id.toString(), {
702
+ hideMissingModuleError: true
703
+ });
695
704
  // In most cases if the load self as aspect failed we don't care about it.
696
705
  // we only need it in specific cases to work, but this workspace.get runs on different
697
706
  // cases where it might fail (like when importing aspect, after the import objects
@@ -985,7 +994,8 @@ the following envs are used in this workspace: ${availableEnvs.join(', ')}`);
985
994
  async importAndGetMany(ids) {
986
995
  await this.importCurrentLaneIfMissing();
987
996
  await this.scope.import(ids, {
988
- reFetchUnBuiltVersion: shouldReFetchUnBuiltVersion()
997
+ reFetchUnBuiltVersion: shouldReFetchUnBuiltVersion(),
998
+ preferDependencyGraph: true
989
999
  });
990
1000
  return this.componentLoader.getMany(ids);
991
1001
  }