@teambit/workspace 1.0.506 → 1.0.507

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/8891be5ad/teambit.workspace_workspace@1.0.506/dist/workspace.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.workspace_workspace@1.0.506/dist/workspace.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.workspace_workspace@1.0.507/dist/workspace.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.workspace_workspace@1.0.507/dist/workspace.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
@@ -1,5 +1,4 @@
1
1
  import { Graph } from '@teambit/graph.cleargraph';
2
- import type { PubsubMain } from '@teambit/pubsub';
3
2
  import { IssuesList } from '@teambit/component-issues';
4
3
  import type { AspectLoaderMain, AspectDefinition } from '@teambit/aspect-loader';
5
4
  import { ComponentMain, Component, ComponentFactory, InvalidComponent, ResolveAspectsOptions, AspectList } from '@teambit/component';
@@ -72,10 +71,6 @@ export type ExtensionsOrigin = 'BitmapFile' | 'ModelSpecific' | 'ModelNonSpecifi
72
71
  * API of the Bit Workspace
73
72
  */
74
73
  export declare class Workspace implements ComponentFactory {
75
- /**
76
- * private pubsub.
77
- */
78
- private pubsub;
79
74
  private config;
80
75
  /**
81
76
  * private access to the legacy consumer instance.
@@ -93,7 +88,6 @@ export declare class Workspace implements ComponentFactory {
93
88
  readonly variants: VariantsMain;
94
89
  private aspectLoader;
95
90
  readonly logger: Logger;
96
- private componentList;
97
91
  /**
98
92
  * private reference to the instance of Harmony.
99
93
  */
@@ -143,13 +137,10 @@ export declare class Workspace implements ComponentFactory {
143
137
  * They are used in webpack configuration to only track changes from these paths inside `node_modules`
144
138
  */
145
139
  private componentPathsRegExps;
140
+ private _componentList;
146
141
  localAspects: Record<string, string>;
147
142
  filter: Filter;
148
- constructor(
149
- /**
150
- * private pubsub.
151
- */
152
- pubsub: PubsubMain, config: WorkspaceExtConfig,
143
+ constructor(config: WorkspaceExtConfig,
153
144
  /**
154
145
  * private access to the legacy consumer instance.
155
146
  */
@@ -161,7 +152,7 @@ export declare class Workspace implements ComponentFactory {
161
152
  /**
162
153
  * access to the `ComponentProvider` instance
163
154
  */
164
- componentAspect: ComponentMain, dependencyResolver: DependencyResolverMain, variants: VariantsMain, aspectLoader: AspectLoaderMain, logger: Logger, componentList: ComponentsList,
155
+ componentAspect: ComponentMain, dependencyResolver: DependencyResolverMain, variants: VariantsMain, aspectLoader: AspectLoaderMain, logger: Logger,
165
156
  /**
166
157
  * private reference to the instance of Harmony.
167
158
  */
@@ -179,6 +170,7 @@ export declare class Workspace implements ComponentFactory {
179
170
  */
180
171
  onComponentAddSlot: OnComponentAddSlot, onComponentRemoveSlot: OnComponentRemoveSlot, onAspectsResolveSlot: OnAspectsResolveSlot, onRootAspectAddedSlot: OnRootAspectAddedSlot, graphql: GraphqlMain, onBitmapChangeSlot: OnBitmapChangeSlot, onWorkspaceConfigChangeSlot: OnWorkspaceConfigChangeSlot);
181
172
  private validateConfig;
173
+ get componentList(): ComponentsList;
182
174
  /**
183
175
  * root path of the Workspace.
184
176
  */
package/dist/workspace.js CHANGED
@@ -328,11 +328,7 @@ const DEFAULT_VENDOR_DIR = 'vendor';
328
328
  * API of the Bit Workspace
329
329
  */
330
330
  class Workspace {
331
- constructor(
332
- /**
333
- * private pubsub.
334
- */
335
- pubsub, config,
331
+ constructor(config,
336
332
  /**
337
333
  * private access to the legacy consumer instance.
338
334
  */
@@ -344,7 +340,7 @@ class Workspace {
344
340
  /**
345
341
  * access to the `ComponentProvider` instance
346
342
  */
347
- componentAspect, dependencyResolver, variants, aspectLoader, logger, componentList = new (_legacy3().ComponentsList)(consumer),
343
+ componentAspect, dependencyResolver, variants, aspectLoader, logger,
348
344
  /**
349
345
  * private reference to the instance of Harmony.
350
346
  */
@@ -361,7 +357,6 @@ class Workspace {
361
357
  * on component add slot.
362
358
  */
363
359
  onComponentAddSlot, onComponentRemoveSlot, onAspectsResolveSlot, onRootAspectAddedSlot, graphql, onBitmapChangeSlot, onWorkspaceConfigChangeSlot) {
364
- this.pubsub = pubsub;
365
360
  this.config = config;
366
361
  this.consumer = consumer;
367
362
  this.scope = scope;
@@ -370,7 +365,6 @@ class Workspace {
370
365
  this.variants = variants;
371
366
  this.aspectLoader = aspectLoader;
372
367
  this.logger = logger;
373
- this.componentList = componentList;
374
368
  this.harmony = harmony;
375
369
  this.onComponentLoadSlot = onComponentLoadSlot;
376
370
  this.onComponentChangeSlot = onComponentChangeSlot;
@@ -410,6 +404,7 @@ class Workspace {
410
404
  * They are used in webpack configuration to only track changes from these paths inside `node_modules`
411
405
  */
412
406
  _defineProperty(this, "componentPathsRegExps", []);
407
+ _defineProperty(this, "_componentList", void 0);
413
408
  _defineProperty(this, "localAspects", {});
414
409
  _defineProperty(this, "filter", void 0);
415
410
  this.componentLoadedSelfAsAspects = (0, _harmonyModules().createInMemoryCache)({
@@ -435,6 +430,12 @@ class Workspace {
435
430
  if (!defaultScope) throw new (_bitError().BitError)('defaultScope is missing');
436
431
  if (!(0, _legacyBitId().isValidScopeName)(defaultScope)) throw new (_legacyBitId().InvalidScopeName)(defaultScope);
437
432
  }
433
+ get componentList() {
434
+ if (!this._componentList) {
435
+ this._componentList = new (_legacy3().ComponentsList)(this);
436
+ }
437
+ return this._componentList;
438
+ }
438
439
 
439
440
  /**
440
441
  * root path of the Workspace.
@@ -506,7 +507,7 @@ class Workspace {
506
507
  return (0, _autoTag().getAutoTagInfo)(this.consumer, changedComponents);
507
508
  }
508
509
  async listAutoTagPendingComponentIds() {
509
- const componentsList = new (_legacy3().ComponentsList)(this.consumer);
510
+ const componentsList = new (_legacy3().ComponentsList)(this);
510
511
  const modifiedComponents = (await this.modified()).map(c => c.id);
511
512
  const newComponents = await componentsList.listNewComponents();
512
513
  if (!modifiedComponents || !modifiedComponents.length) return [];
@@ -878,13 +879,13 @@ it's possible that the version ${component.id.version} belong to ${idStr.split('
878
879
  this.componentLoader.clearCache();
879
880
  this.consumer.componentLoader.clearComponentsCache();
880
881
  this.componentStatusLoader.clearCache();
881
- this.componentList = new (_legacy3().ComponentsList)(this.consumer);
882
+ this._componentList = new (_legacy3().ComponentsList)(this);
882
883
  }
883
884
  clearComponentCache(id) {
884
885
  this.componentLoader.clearComponentCache(id);
885
886
  this.componentStatusLoader.clearOneComponentCache(id);
886
887
  this.consumer.clearOneComponentCache(id);
887
- this.componentList = new (_legacy3().ComponentsList)(this.consumer);
888
+ this._componentList = new (_legacy3().ComponentsList)(this);
888
889
  }
889
890
  clearComponentsCache(ids) {
890
891
  ids.forEach(id => this.clearComponentCache(id));