@teambit/workspace 1.0.173 → 1.0.175

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/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/workspace",
3
- "version": "1.0.173",
3
+ "version": "1.0.175",
4
4
  "homepage": "https://bit.cloud/teambit/workspace/workspace",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.workspace",
8
8
  "name": "workspace",
9
- "version": "1.0.173"
9
+ "version": "1.0.175"
10
10
  },
11
11
  "dependencies": {
12
12
  "lodash": "4.17.21",
@@ -55,42 +55,42 @@
55
55
  "@teambit/explorer.ui.gallery.component-grid": "0.0.496",
56
56
  "@teambit/scopes.scope-id": "0.0.7",
57
57
  "@teambit/workspace.ui.empty-workspace": "0.0.508",
58
- "@teambit/component": "1.0.173",
59
- "@teambit/dependency-resolver": "1.0.173",
60
- "@teambit/envs": "1.0.173",
58
+ "@teambit/component": "1.0.175",
59
+ "@teambit/dependency-resolver": "1.0.175",
60
+ "@teambit/envs": "1.0.175",
61
61
  "@teambit/logger": "0.0.944",
62
- "@teambit/scope": "1.0.173",
63
- "@teambit/graph": "1.0.173",
62
+ "@teambit/scope": "1.0.175",
63
+ "@teambit/graph": "1.0.175",
64
64
  "@teambit/cli": "0.0.851",
65
- "@teambit/isolator": "1.0.173",
66
- "@teambit/component-tree": "1.0.173",
65
+ "@teambit/isolator": "1.0.175",
66
+ "@teambit/component-tree": "1.0.175",
67
67
  "@teambit/harmony.modules.resolved-component": "0.0.497",
68
- "@teambit/watcher": "1.0.173",
69
- "@teambit/aspect-loader": "1.0.173",
70
- "@teambit/config": "0.0.924",
68
+ "@teambit/watcher": "1.0.175",
69
+ "@teambit/aspect-loader": "1.0.175",
70
+ "@teambit/config": "0.0.926",
71
71
  "@teambit/global-config": "0.0.854",
72
72
  "@teambit/harmony.modules.requireable-component": "0.0.497",
73
73
  "@teambit/toolbox.modules.module-resolver": "0.0.7",
74
- "@teambit/workspace.modules.node-modules-linker": "0.0.164",
75
- "@teambit/graphql": "1.0.173",
76
- "@teambit/bundler": "1.0.173",
77
- "@teambit/pubsub": "1.0.173",
78
- "@teambit/ui": "1.0.173",
79
- "@teambit/variants": "0.0.1017",
74
+ "@teambit/workspace.modules.node-modules-linker": "0.0.165",
75
+ "@teambit/graphql": "1.0.175",
76
+ "@teambit/bundler": "1.0.175",
77
+ "@teambit/pubsub": "1.0.175",
78
+ "@teambit/ui": "1.0.175",
79
+ "@teambit/variants": "0.0.1019",
80
80
  "@teambit/component-issues": "0.0.141",
81
81
  "@teambit/workspace.modules.match-pattern": "0.0.505",
82
- "@teambit/component.ui.component-drawer": "0.0.392",
82
+ "@teambit/component.ui.component-drawer": "0.0.393",
83
83
  "@teambit/lanes.hooks.use-lane-components": "0.0.258",
84
- "@teambit/lanes.hooks.use-lanes": "0.0.259",
84
+ "@teambit/lanes.hooks.use-lanes": "0.0.260",
85
85
  "@teambit/lanes.ui.models.lanes-model": "0.0.212",
86
- "@teambit/command-bar": "1.0.173",
86
+ "@teambit/command-bar": "1.0.175",
87
87
  "@teambit/component.ui.component-filters.component-filter-context": "0.0.218",
88
88
  "@teambit/component.ui.component-filters.deprecate-filter": "0.0.216",
89
- "@teambit/component.ui.component-filters.env-filter": "0.0.222",
89
+ "@teambit/component.ui.component-filters.env-filter": "0.0.223",
90
90
  "@teambit/component.ui.component-filters.show-main-filter": "0.0.209",
91
- "@teambit/sidebar": "1.0.173",
91
+ "@teambit/sidebar": "1.0.175",
92
92
  "@teambit/component-descriptor": "0.0.415",
93
- "@teambit/deprecation": "1.0.173",
93
+ "@teambit/deprecation": "1.0.175",
94
94
  "@teambit/ui-foundation.ui.buttons.collapser": "0.0.217",
95
95
  "@teambit/cloud.hooks.use-cloud-scopes": "0.0.3",
96
96
  "@teambit/preview.ui.preview-placeholder": "0.0.514",
@@ -13,14 +13,14 @@ export class CompFiles {
13
13
  private repository: Repository,
14
14
  private currentFiles: SourceFile[],
15
15
  readonly compDir: PathLinux,
16
- private headFiles: SourceFileModel[] = []
16
+ private modelFiles: SourceFileModel[] = []
17
17
  ) {}
18
18
 
19
19
  isModified(): boolean {
20
- if (!this.headFiles.length) return false;
21
- if (this.currentFiles.length !== this.headFiles.length) return true;
20
+ if (!this.modelFiles.length) return false;
21
+ if (this.currentFiles.length !== this.modelFiles.length) return true;
22
22
  return this.currentFiles.some((file) => {
23
- const headFile = this.headFiles.find((h) => h.relativePath === file.relative);
23
+ const headFile = this.modelFiles.find((h) => h.relativePath === file.relative);
24
24
  if (!headFile) return true;
25
25
  return !headFile.file.isEqual(file.toSourceAsLinuxEOL().hash());
26
26
  });
@@ -31,12 +31,12 @@ export class CompFiles {
31
31
  }
32
32
 
33
33
  async getHeadFiles(): Promise<SourceFile[]> {
34
- return Promise.all(this.headFiles.map((file) => SourceFile.loadFromSourceFileModel(file, this.repository)));
34
+ return Promise.all(this.modelFiles.map((file) => SourceFile.loadFromSourceFileModel(file, this.repository)));
35
35
  }
36
36
 
37
37
  getFilesStatus(): FilesStatus {
38
38
  const result = this.currentFiles.reduce((acc, file) => {
39
- const headFile = this.headFiles.find((h) => h.relativePath === file.relative);
39
+ const headFile = this.modelFiles.find((h) => h.relativePath === file.relative);
40
40
  const getType = (): FILE_STATUS => {
41
41
  if (!headFile) return 'new';
42
42
  if (headFile.file.isEqual(file.toSourceAsLinuxEOL().hash())) return 'unchanged';
@@ -45,7 +45,7 @@ export class CompFiles {
45
45
  acc[file.relative] = getType();
46
46
  return acc;
47
47
  }, {});
48
- this.headFiles.forEach((headFile) => {
48
+ this.modelFiles.forEach((headFile) => {
49
49
  const currentFile = this.currentFiles.find((c) => c.relative === headFile.relativePath);
50
50
  if (!currentFile) {
51
51
  result[headFile.relativePath] = 'deleted';
@@ -54,7 +54,11 @@ export class ComponentStatusLoader {
54
54
  */
55
55
  async getComponentStatusById(id: ComponentID): Promise<ComponentStatusLegacy> {
56
56
  if (!this._componentsStatusCache[id.toString()]) {
57
- this._componentsStatusCache[id.toString()] = await this.getStatus(id);
57
+ // don't do this: `this._componentsStatusCache[id.toString()] = await this.getStatus(id);`
58
+ // yes, it doesn't make sense right? turns out that "getStatus" can call `linkIfMissingWorkspaceAspects` which
59
+ // calls `linkToNodeModulesByIds` which deletes this cache. and makes this: `this._componentsStatusCache[id.toString()]` undefined.
60
+ const result = await this.getStatus(id);
61
+ this._componentsStatusCache[id.toString()] = result;
58
62
  }
59
63
  return this._componentsStatusCache[id.toString()];
60
64
  }