@teambit/component 0.0.881 → 0.0.882

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.
Files changed (136) hide show
  1. package/dist/aspect-entry.js +3 -16
  2. package/dist/aspect-entry.js.map +1 -1
  3. package/dist/aspect-list.js +6 -35
  4. package/dist/aspect-list.js.map +1 -1
  5. package/dist/aspect.section.js +0 -16
  6. package/dist/aspect.section.js.map +1 -1
  7. package/dist/component-fs.js +2 -25
  8. package/dist/component-fs.js.map +1 -1
  9. package/dist/component-map/component-map.js +10 -26
  10. package/dist/component-map/component-map.js.map +1 -1
  11. package/dist/component-map/index.js +0 -3
  12. package/dist/component-map/index.js.map +1 -1
  13. package/dist/component-meta.js +1 -14
  14. package/dist/component-meta.js.map +1 -1
  15. package/dist/component.aspect.js +0 -5
  16. package/dist/component.aspect.js.map +1 -1
  17. package/dist/component.composition.js +0 -6
  18. package/dist/component.composition.js.map +1 -1
  19. package/dist/component.graphql.js +2 -26
  20. package/dist/component.graphql.js.map +1 -1
  21. package/dist/component.js +19 -90
  22. package/dist/component.js.map +1 -1
  23. package/dist/component.main.runtime.js +6 -64
  24. package/dist/component.main.runtime.js.map +1 -1
  25. package/dist/component.route.js +2 -14
  26. package/dist/component.route.js.map +1 -1
  27. package/dist/component.ui.runtime.js +3 -83
  28. package/dist/component.ui.runtime.js.map +1 -1
  29. package/dist/config.js +0 -3
  30. package/dist/config.js.map +1 -1
  31. package/dist/dependencies/dependencies.js +7 -32
  32. package/dist/dependencies/dependencies.js.map +1 -1
  33. package/dist/dependencies/index.js +0 -3
  34. package/dist/dependencies/index.js.map +1 -1
  35. package/dist/exceptions/could-not-find-latest.js +0 -4
  36. package/dist/exceptions/could-not-find-latest.js.map +1 -1
  37. package/dist/exceptions/host-not-found.js +0 -4
  38. package/dist/exceptions/host-not-found.js.map +1 -1
  39. package/dist/exceptions/index.js +0 -13
  40. package/dist/exceptions/index.js.map +1 -1
  41. package/dist/exceptions/main-file-not-found.js +0 -4
  42. package/dist/exceptions/main-file-not-found.js.map +1 -1
  43. package/dist/exceptions/nothing-to-snap.js +0 -2
  44. package/dist/exceptions/nothing-to-snap.js.map +1 -1
  45. package/dist/history-graph.js +0 -2
  46. package/dist/history-graph.js.map +1 -1
  47. package/dist/host/component-host-model.js +0 -7
  48. package/dist/host/component-host-model.js.map +1 -1
  49. package/dist/host/index.js +0 -5
  50. package/dist/host/index.js.map +1 -1
  51. package/dist/host/use-component-host.js +0 -14
  52. package/dist/host/use-component-host.js.map +1 -1
  53. package/dist/index.js +0 -63
  54. package/dist/index.js.map +1 -1
  55. package/dist/section/index.js +0 -3
  56. package/dist/section/index.js.map +1 -1
  57. package/dist/show/extensions.fragment.js +0 -8
  58. package/dist/show/extensions.fragment.js.map +1 -1
  59. package/dist/show/files.fragment.js +0 -11
  60. package/dist/show/files.fragment.js.map +1 -1
  61. package/dist/show/id.fragment.js +0 -10
  62. package/dist/show/id.fragment.js.map +1 -1
  63. package/dist/show/index.js +0 -24
  64. package/dist/show/index.js.map +1 -1
  65. package/dist/show/main-file.fragment.js +0 -9
  66. package/dist/show/main-file.fragment.js.map +1 -1
  67. package/dist/show/name.fragment.js +0 -9
  68. package/dist/show/name.fragment.js.map +1 -1
  69. package/dist/show/scope.fragment.js +0 -10
  70. package/dist/show/scope.fragment.js.map +1 -1
  71. package/dist/show/show.cmd.js +1 -33
  72. package/dist/show/show.cmd.js.map +1 -1
  73. package/dist/snap/index.js +0 -6
  74. package/dist/snap/index.js.map +1 -1
  75. package/dist/snap/snap.js +0 -5
  76. package/dist/snap/snap.js.map +1 -1
  77. package/dist/state.js +6 -24
  78. package/dist/state.js.map +1 -1
  79. package/dist/store.js +0 -5
  80. package/dist/store.js.map +1 -1
  81. package/dist/tag/index.js +0 -3
  82. package/dist/tag/index.js.map +1 -1
  83. package/dist/tag/tag.js +1 -9
  84. package/dist/tag/tag.js.map +1 -1
  85. package/dist/tag-map.js +4 -28
  86. package/dist/tag-map.js.map +1 -1
  87. package/dist/ui/aspect-page/aspect-page.js +2 -35
  88. package/dist/ui/aspect-page/aspect-page.js.map +1 -1
  89. package/dist/ui/aspect-page/index.js +0 -3
  90. package/dist/ui/aspect-page/index.js.map +1 -1
  91. package/dist/ui/component-error/component-error.js +0 -14
  92. package/dist/ui/component-error/component-error.js.map +1 -1
  93. package/dist/ui/component-error/index.js +0 -3
  94. package/dist/ui/component-error/index.js.map +1 -1
  95. package/dist/ui/component-model/component-model.js +2 -21
  96. package/dist/ui/component-model/component-model.js.map +1 -1
  97. package/dist/ui/component-model/index.js +0 -3
  98. package/dist/ui/component-model/index.js.map +1 -1
  99. package/dist/ui/component-searcher/component-result.js +0 -20
  100. package/dist/ui/component-searcher/component-result.js.map +1 -1
  101. package/dist/ui/component-searcher/component-searcher.js +0 -22
  102. package/dist/ui/component-searcher/component-searcher.js.map +1 -1
  103. package/dist/ui/component-searcher/index.js +0 -3
  104. package/dist/ui/component-searcher/index.js.map +1 -1
  105. package/dist/ui/component.js +5 -40
  106. package/dist/ui/component.js.map +1 -1
  107. package/dist/ui/context/component-context.js +0 -9
  108. package/dist/ui/context/component-context.js.map +1 -1
  109. package/dist/ui/context/component-provider.js +0 -9
  110. package/dist/ui/context/component-provider.js.map +1 -1
  111. package/dist/ui/context/index.js +0 -6
  112. package/dist/ui/context/index.js.map +1 -1
  113. package/dist/ui/index.js +0 -21
  114. package/dist/ui/index.js.map +1 -1
  115. package/dist/ui/menu/index.js +0 -3
  116. package/dist/ui/menu/index.js.map +1 -1
  117. package/dist/ui/menu/menu-nav.js +4 -23
  118. package/dist/ui/menu/menu-nav.js.map +1 -1
  119. package/dist/ui/menu/menu.js +0 -70
  120. package/dist/ui/menu/menu.js.map +1 -1
  121. package/dist/ui/menu/mobile-menu-nav.js +6 -49
  122. package/dist/ui/menu/mobile-menu-nav.js.map +1 -1
  123. package/dist/ui/top-bar-nav/index.js +0 -2
  124. package/dist/ui/top-bar-nav/index.js.map +1 -1
  125. package/dist/ui/top-bar-nav/top-bar-nav.js +8 -32
  126. package/dist/ui/top-bar-nav/top-bar-nav.js.map +1 -1
  127. package/dist/ui/use-component-from-location.js +0 -9
  128. package/dist/ui/use-component-from-location.js.map +1 -1
  129. package/dist/ui/use-component-query.js +12 -60
  130. package/dist/ui/use-component-query.js.map +1 -1
  131. package/dist/ui/use-component.js +0 -11
  132. package/dist/ui/use-component.js.map +1 -1
  133. package/package-tar/teambit-component-0.0.882.tgz +0 -0
  134. package/package.json +12 -12
  135. package/{preview-1666409808293.js → preview-1666496165706.js} +2 -2
  136. package/package-tar/teambit-component-0.0.881.tgz +0 -0
@@ -1,45 +1,35 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  require("core-js/modules/es.promise.js");
6
-
7
5
  Object.defineProperty(exports, "__esModule", {
8
6
  value: true
9
7
  });
10
8
  exports.IDFragment = void 0;
11
-
12
9
  function _defineProperty2() {
13
10
  const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
14
-
15
11
  _defineProperty2 = function () {
16
12
  return data;
17
13
  };
18
-
19
14
  return data;
20
15
  }
21
-
22
16
  class IDFragment {
23
17
  constructor() {
24
18
  (0, _defineProperty2().default)(this, "weight", 0);
25
19
  }
26
-
27
20
  async renderRow(component) {
28
21
  return {
29
22
  title: 'id',
30
23
  content: component.id.toString()
31
24
  };
32
25
  }
33
-
34
26
  async json(component) {
35
27
  return {
36
28
  title: 'id',
37
29
  json: component.id.toString()
38
30
  };
39
31
  }
40
-
41
32
  }
42
-
43
33
  exports.IDFragment = IDFragment;
44
34
 
45
35
  //# sourceMappingURL=id.fragment.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["IDFragment","renderRow","component","title","content","id","toString","json"],"sources":["id.fragment.ts"],"sourcesContent":["import { ShowFragment } from './show-fragment';\nimport { Component } from '../component';\n\nexport class IDFragment implements ShowFragment {\n async renderRow(component: Component) {\n return {\n title: 'id',\n content: component.id.toString(),\n };\n }\n\n async json(component: Component) {\n return {\n title: 'id',\n json: component.id.toString(),\n };\n }\n\n weight = 0;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAGO,MAAMA,UAAN,CAAyC;EAAA;IAAA,gDAerC,CAfqC;EAAA;;EAC/B,MAATC,SAAS,CAACC,SAAD,EAAuB;IACpC,OAAO;MACLC,KAAK,EAAE,IADF;MAELC,OAAO,EAAEF,SAAS,CAACG,EAAV,CAAaC,QAAb;IAFJ,CAAP;EAID;;EAES,MAAJC,IAAI,CAACL,SAAD,EAAuB;IAC/B,OAAO;MACLC,KAAK,EAAE,IADF;MAELI,IAAI,EAAEL,SAAS,CAACG,EAAV,CAAaC,QAAb;IAFD,CAAP;EAID;;AAb6C"}
1
+ {"version":3,"names":["IDFragment","renderRow","component","title","content","id","toString","json"],"sources":["id.fragment.ts"],"sourcesContent":["import { ShowFragment } from './show-fragment';\nimport { Component } from '../component';\n\nexport class IDFragment implements ShowFragment {\n async renderRow(component: Component) {\n return {\n title: 'id',\n content: component.id.toString(),\n };\n }\n\n async json(component: Component) {\n return {\n title: 'id',\n json: component.id.toString(),\n };\n }\n\n weight = 0;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAGO,MAAMA,UAAU,CAAyB;EAAA;IAAA,gDAerC,CAAC;EAAA;EAdV,MAAMC,SAAS,CAACC,SAAoB,EAAE;IACpC,OAAO;MACLC,KAAK,EAAE,IAAI;MACXC,OAAO,EAAEF,SAAS,CAACG,EAAE,CAACC,QAAQ;IAChC,CAAC;EACH;EAEA,MAAMC,IAAI,CAACL,SAAoB,EAAE;IAC/B,OAAO;MACLC,KAAK,EAAE,IAAI;MACXI,IAAI,EAAEL,SAAS,CAACG,EAAE,CAACC,QAAQ;IAC7B,CAAC;EACH;AAGF;AAAC"}
@@ -63,84 +63,60 @@ Object.defineProperty(exports, "ShowRow", {
63
63
  return _showFragment().ShowRow;
64
64
  }
65
65
  });
66
-
67
66
  function _showFragment() {
68
67
  const data = require("./show-fragment");
69
-
70
68
  _showFragment = function () {
71
69
  return data;
72
70
  };
73
-
74
71
  return data;
75
72
  }
76
-
77
73
  function _show() {
78
74
  const data = require("./show.cmd");
79
-
80
75
  _show = function () {
81
76
  return data;
82
77
  };
83
-
84
78
  return data;
85
79
  }
86
-
87
80
  function _mainFile() {
88
81
  const data = require("./main-file.fragment");
89
-
90
82
  _mainFile = function () {
91
83
  return data;
92
84
  };
93
-
94
85
  return data;
95
86
  }
96
-
97
87
  function _name() {
98
88
  const data = require("./name.fragment");
99
-
100
89
  _name = function () {
101
90
  return data;
102
91
  };
103
-
104
92
  return data;
105
93
  }
106
-
107
94
  function _id() {
108
95
  const data = require("./id.fragment");
109
-
110
96
  _id = function () {
111
97
  return data;
112
98
  };
113
-
114
99
  return data;
115
100
  }
116
-
117
101
  function _scope() {
118
102
  const data = require("./scope.fragment");
119
-
120
103
  _scope = function () {
121
104
  return data;
122
105
  };
123
-
124
106
  return data;
125
107
  }
126
-
127
108
  function _files() {
128
109
  const data = require("./files.fragment");
129
-
130
110
  _files = function () {
131
111
  return data;
132
112
  };
133
-
134
113
  return data;
135
114
  }
136
-
137
115
  function _extensions() {
138
116
  const data = require("./extensions.fragment");
139
-
140
117
  _extensions = function () {
141
118
  return data;
142
119
  };
143
-
144
120
  return data;
145
121
  }
146
122
 
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { ShowFragment, ShowRow, JSONRow as ShowJSONRow } from './show-fragment';\nexport { ShowCmd } from './show.cmd';\nexport { MainFileFragment } from './main-file.fragment';\nexport { NameFragment } from './name.fragment';\nexport { IDFragment } from './id.fragment';\nexport { ScopeFragment } from './scope.fragment';\nexport { FilesFragment } from './files.fragment';\nexport { ExtensionsFragment } from './extensions.fragment';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA"}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { ShowFragment, ShowRow, JSONRow as ShowJSONRow } from './show-fragment';\nexport { ShowCmd } from './show.cmd';\nexport { MainFileFragment } from './main-file.fragment';\nexport { NameFragment } from './name.fragment';\nexport { IDFragment } from './id.fragment';\nexport { ScopeFragment } from './scope.fragment';\nexport { FilesFragment } from './files.fragment';\nexport { ExtensionsFragment } from './extensions.fragment';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA"}
@@ -1,38 +1,29 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  require("core-js/modules/es.promise.js");
6
-
7
5
  Object.defineProperty(exports, "__esModule", {
8
6
  value: true
9
7
  });
10
8
  exports.MainFileFragment = void 0;
11
-
12
9
  function _defineProperty2() {
13
10
  const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
14
-
15
11
  _defineProperty2 = function () {
16
12
  return data;
17
13
  };
18
-
19
14
  return data;
20
15
  }
21
-
22
16
  class MainFileFragment {
23
17
  constructor() {
24
18
  (0, _defineProperty2().default)(this, "weight", 4);
25
19
  }
26
-
27
20
  async renderRow(component) {
28
21
  return {
29
22
  title: 'main file',
30
23
  content: component.state._consumer.mainFile
31
24
  };
32
25
  }
33
-
34
26
  }
35
-
36
27
  exports.MainFileFragment = MainFileFragment;
37
28
 
38
29
  //# sourceMappingURL=main-file.fragment.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["MainFileFragment","renderRow","component","title","content","state","_consumer","mainFile"],"sources":["main-file.fragment.ts"],"sourcesContent":["import { ShowFragment } from './show-fragment';\nimport { Component } from '../component';\n\nexport class MainFileFragment implements ShowFragment {\n async renderRow(component: Component) {\n return {\n title: 'main file',\n content: component.state._consumer.mainFile,\n };\n }\n\n weight = 4;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAGO,MAAMA,gBAAN,CAA+C;EAAA;IAAA,gDAQ3C,CAR2C;EAAA;;EACrC,MAATC,SAAS,CAACC,SAAD,EAAuB;IACpC,OAAO;MACLC,KAAK,EAAE,WADF;MAELC,OAAO,EAAEF,SAAS,CAACG,KAAV,CAAgBC,SAAhB,CAA0BC;IAF9B,CAAP;EAID;;AANmD"}
1
+ {"version":3,"names":["MainFileFragment","renderRow","component","title","content","state","_consumer","mainFile"],"sources":["main-file.fragment.ts"],"sourcesContent":["import { ShowFragment } from './show-fragment';\nimport { Component } from '../component';\n\nexport class MainFileFragment implements ShowFragment {\n async renderRow(component: Component) {\n return {\n title: 'main file',\n content: component.state._consumer.mainFile,\n };\n }\n\n weight = 4;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAGO,MAAMA,gBAAgB,CAAyB;EAAA;IAAA,gDAQ3C,CAAC;EAAA;EAPV,MAAMC,SAAS,CAACC,SAAoB,EAAE;IACpC,OAAO;MACLC,KAAK,EAAE,WAAW;MAClBC,OAAO,EAAEF,SAAS,CAACG,KAAK,CAACC,SAAS,CAACC;IACrC,CAAC;EACH;AAGF;AAAC"}
@@ -1,38 +1,29 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  require("core-js/modules/es.promise.js");
6
-
7
5
  Object.defineProperty(exports, "__esModule", {
8
6
  value: true
9
7
  });
10
8
  exports.NameFragment = void 0;
11
-
12
9
  function _defineProperty2() {
13
10
  const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
14
-
15
11
  _defineProperty2 = function () {
16
12
  return data;
17
13
  };
18
-
19
14
  return data;
20
15
  }
21
-
22
16
  class NameFragment {
23
17
  constructor() {
24
18
  (0, _defineProperty2().default)(this, "weight", 2);
25
19
  }
26
-
27
20
  async renderRow(component) {
28
21
  return {
29
22
  title: 'name',
30
23
  content: component.id.fullName
31
24
  };
32
25
  }
33
-
34
26
  }
35
-
36
27
  exports.NameFragment = NameFragment;
37
28
 
38
29
  //# sourceMappingURL=name.fragment.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["NameFragment","renderRow","component","title","content","id","fullName"],"sources":["name.fragment.ts"],"sourcesContent":["import { ShowFragment } from './show-fragment';\nimport { Component } from '../component';\n\nexport class NameFragment implements ShowFragment {\n async renderRow(component: Component) {\n return {\n title: 'name',\n content: component.id.fullName,\n };\n }\n\n weight = 2;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAGO,MAAMA,YAAN,CAA2C;EAAA;IAAA,gDAQvC,CARuC;EAAA;;EACjC,MAATC,SAAS,CAACC,SAAD,EAAuB;IACpC,OAAO;MACLC,KAAK,EAAE,MADF;MAELC,OAAO,EAAEF,SAAS,CAACG,EAAV,CAAaC;IAFjB,CAAP;EAID;;AAN+C"}
1
+ {"version":3,"names":["NameFragment","renderRow","component","title","content","id","fullName"],"sources":["name.fragment.ts"],"sourcesContent":["import { ShowFragment } from './show-fragment';\nimport { Component } from '../component';\n\nexport class NameFragment implements ShowFragment {\n async renderRow(component: Component) {\n return {\n title: 'name',\n content: component.id.fullName,\n };\n }\n\n weight = 2;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAGO,MAAMA,YAAY,CAAyB;EAAA;IAAA,gDAQvC,CAAC;EAAA;EAPV,MAAMC,SAAS,CAACC,SAAoB,EAAE;IACpC,OAAO;MACLC,KAAK,EAAE,MAAM;MACbC,OAAO,EAAEF,SAAS,CAACG,EAAE,CAACC;IACxB,CAAC;EACH;AAGF;AAAC"}
@@ -1,40 +1,30 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  require("core-js/modules/es.promise.js");
6
-
7
5
  Object.defineProperty(exports, "__esModule", {
8
6
  value: true
9
7
  });
10
8
  exports.ScopeFragment = void 0;
11
-
12
9
  function _defineProperty2() {
13
10
  const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
14
-
15
11
  _defineProperty2 = function () {
16
12
  return data;
17
13
  };
18
-
19
14
  return data;
20
15
  }
21
-
22
16
  class ScopeFragment {
23
17
  constructor() {
24
18
  (0, _defineProperty2().default)(this, "weight", 1);
25
19
  }
26
-
27
20
  async renderRow(component) {
28
21
  return {
29
22
  title: 'scope',
30
23
  content: component.id.scope || ''
31
24
  };
32
25
  }
33
-
34
26
  getRow() {}
35
-
36
27
  }
37
-
38
28
  exports.ScopeFragment = ScopeFragment;
39
29
 
40
30
  //# sourceMappingURL=scope.fragment.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["ScopeFragment","renderRow","component","title","content","id","scope","getRow"],"sources":["scope.fragment.ts"],"sourcesContent":["import { ShowFragment } from './show-fragment';\nimport { Component } from '../component';\n\nexport class ScopeFragment implements ShowFragment {\n async renderRow(component: Component) {\n return {\n title: 'scope',\n content: component.id.scope || '',\n };\n }\n\n getRow() {}\n\n weight = 1;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAGO,MAAMA,aAAN,CAA4C;EAAA;IAAA,gDAUxC,CAVwC;EAAA;;EAClC,MAATC,SAAS,CAACC,SAAD,EAAuB;IACpC,OAAO;MACLC,KAAK,EAAE,OADF;MAELC,OAAO,EAAEF,SAAS,CAACG,EAAV,CAAaC,KAAb,IAAsB;IAF1B,CAAP;EAID;;EAEDC,MAAM,GAAG,CAAE;;AARsC"}
1
+ {"version":3,"names":["ScopeFragment","renderRow","component","title","content","id","scope","getRow"],"sources":["scope.fragment.ts"],"sourcesContent":["import { ShowFragment } from './show-fragment';\nimport { Component } from '../component';\n\nexport class ScopeFragment implements ShowFragment {\n async renderRow(component: Component) {\n return {\n title: 'scope',\n content: component.id.scope || '',\n };\n }\n\n getRow() {}\n\n weight = 1;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAGO,MAAMA,aAAa,CAAyB;EAAA;IAAA,gDAUxC,CAAC;EAAA;EATV,MAAMC,SAAS,CAACC,SAAoB,EAAE;IACpC,OAAO;MACLC,KAAK,EAAE,OAAO;MACdC,OAAO,EAAEF,SAAS,CAACG,EAAE,CAACC,KAAK,IAAI;IACjC,CAAC;EACH;EAEAC,MAAM,GAAG,CAAC;AAGZ;AAAC"}
@@ -1,78 +1,57 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  require("core-js/modules/es.array.iterator.js");
6
-
7
5
  require("core-js/modules/es.promise.js");
8
-
9
6
  Object.defineProperty(exports, "__esModule", {
10
7
  value: true
11
8
  });
12
9
  exports.ShowCmd = void 0;
13
-
14
10
  function _defineProperty2() {
15
11
  const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
16
-
17
12
  _defineProperty2 = function () {
18
13
  return data;
19
14
  };
20
-
21
15
  return data;
22
16
  }
23
-
24
17
  function _lodash() {
25
18
  const data = require("lodash");
26
-
27
19
  _lodash = function () {
28
20
  return data;
29
21
  };
30
-
31
22
  return data;
32
23
  }
33
-
34
24
  function _cliTable() {
35
25
  const data = require("@teambit/cli-table");
36
-
37
26
  _cliTable = function () {
38
27
  return data;
39
28
  };
40
-
41
29
  return data;
42
30
  }
43
-
44
31
  function _exceptions() {
45
32
  const data = require("@teambit/legacy/dist/consumer/bit-map/exceptions");
46
-
47
33
  _exceptions = function () {
48
34
  return data;
49
35
  };
50
-
51
36
  return data;
52
37
  }
53
-
54
38
  function _legacyBitId() {
55
39
  const data = require("@teambit/legacy-bit-id");
56
-
57
40
  _legacyBitId = function () {
58
41
  return data;
59
42
  };
60
-
61
43
  return data;
62
44
  }
63
-
64
45
  function _showCmd() {
65
46
  const data = _interopRequireDefault(require("@teambit/legacy/dist/cli/commands/public-cmds/show-cmd"));
66
-
67
47
  _showCmd = function () {
68
48
  return data;
69
49
  };
70
-
71
50
  return data;
72
51
  }
73
-
74
52
  // import { Logger } from '@teambit/logger';
75
53
  // import chalk from 'chalk';
54
+
76
55
  class ShowCmd {
77
56
  constructor(component) {
78
57
  this.component = component;
@@ -86,30 +65,23 @@ class ShowCmd {
86
65
  }]);
87
66
  (0, _defineProperty2().default)(this, "options", [['j', 'json', 'return the component data in a json format'], ['l', 'legacy', 'use the legacy bit show.'], ['r', 'remote', 'show a remote component'], ['c', 'compare', 'compare current file system component to the latest tagged component [default=latest]. only works in legacy.']]);
88
67
  }
89
-
90
68
  async getComponent(idStr, remote) {
91
69
  if (remote) {
92
70
  const bitId = _legacyBitId().BitId.parse(idStr, true); // user used --remote so we know it has a scope
93
-
94
-
95
71
  const host = this.component.getHost('teambit.scope/scope');
96
72
  const id = await host.resolveComponentId(bitId);
97
-
98
73
  if (!host.getRemoteComponent) {
99
74
  throw new Error('Component Host does not implement getRemoteComponent()');
100
75
  }
101
-
102
76
  const component = await host.getRemoteComponent(id);
103
77
  return component;
104
78
  }
105
-
106
79
  const host = this.component.getHost();
107
80
  const id = await host.resolveComponentId(idStr);
108
81
  const component = await host.get(id);
109
82
  if (!component) throw new (_exceptions().MissingBitMapComponent)(idStr);
110
83
  return component;
111
84
  }
112
-
113
85
  async useLegacy(id, json = false, remote = false, compare = false) {
114
86
  const legacyShow = new (_showCmd().default)();
115
87
  const showData = await legacyShow.action([id], {
@@ -120,7 +92,6 @@ class ShowCmd {
120
92
  });
121
93
  return legacyShow.report(showData);
122
94
  }
123
-
124
95
  async report([idStr], {
125
96
  legacy,
126
97
  remote,
@@ -137,7 +108,6 @@ class ShowCmd {
137
108
  const table = new (_cliTable().CLITable)([], (0, _lodash().compact)(rows));
138
109
  return table.render();
139
110
  }
140
-
141
111
  async json([idStr], {
142
112
  remote,
143
113
  legacy
@@ -150,9 +120,7 @@ class ShowCmd {
150
120
  }));
151
121
  return rows.filter(row => !!row);
152
122
  }
153
-
154
123
  }
155
-
156
124
  exports.ShowCmd = ShowCmd;
157
125
 
158
126
  //# sourceMappingURL=show.cmd.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["ShowCmd","constructor","component","name","description","getComponent","idStr","remote","bitId","BitId","parse","host","getHost","id","resolveComponentId","getRemoteComponent","Error","get","MissingBitMapComponent","useLegacy","json","compare","legacyShow","LegacyShow","showData","action","versions","undefined","report","legacy","fragments","getShowFragments","rows","Promise","all","map","fragment","row","renderRow","content","title","table","CLITable","compact","render","JSON","filter"],"sources":["show.cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport { compact } from 'lodash';\n// import { Logger } from '@teambit/logger';\n// import chalk from 'chalk';\nimport { CLITable } from '@teambit/cli-table';\nimport { MissingBitMapComponent } from '@teambit/legacy/dist/consumer/bit-map/exceptions';\nimport { BitId } from '@teambit/legacy-bit-id';\nimport LegacyShow from '@teambit/legacy/dist/cli/commands/public-cmds/show-cmd';\nimport { ComponentMain } from '../component.main.runtime';\n\nexport class ShowCmd implements Command {\n name = 'show <component-name>';\n description = \"display the component's essential information\";\n alias = '';\n group = 'info';\n arguments = [{ name: 'component-name', description: 'component name or component id' }];\n options = [\n ['j', 'json', 'return the component data in a json format'],\n ['l', 'legacy', 'use the legacy bit show.'],\n ['r', 'remote', 'show a remote component'],\n [\n 'c',\n 'compare',\n 'compare current file system component to the latest tagged component [default=latest]. only works in legacy.',\n ],\n ] as CommandOptions;\n\n constructor(private component: ComponentMain) {}\n\n private async getComponent(idStr: string, remote: boolean) {\n if (remote) {\n const bitId: BitId = BitId.parse(idStr, true); // user used --remote so we know it has a scope\n const host = this.component.getHost('teambit.scope/scope');\n const id = await host.resolveComponentId(bitId);\n if (!host.getRemoteComponent) {\n throw new Error('Component Host does not implement getRemoteComponent()');\n }\n const component = await host.getRemoteComponent(id);\n return component;\n }\n const host = this.component.getHost();\n const id = await host.resolveComponentId(idStr);\n const component = await host.get(id);\n if (!component) throw new MissingBitMapComponent(idStr);\n return component;\n }\n\n async useLegacy(id: string, json = false, remote = false, compare = false) {\n const legacyShow = new LegacyShow();\n const showData = await legacyShow.action([id], {\n json,\n versions: undefined,\n remote,\n compare,\n });\n\n return legacyShow.report(showData);\n }\n\n async report([idStr]: [string], { legacy, remote, compare }: { legacy: boolean; remote: boolean; compare: boolean }) {\n if (legacy) return this.useLegacy(idStr, false, remote, compare);\n const component = await this.getComponent(idStr, remote);\n const fragments = this.component.getShowFragments();\n const rows = await Promise.all(\n fragments.map(async (fragment) => {\n const row = await fragment.renderRow(component);\n if (!row.content) return null;\n return [row.title, row.content];\n })\n );\n\n const table = new CLITable([], compact(rows));\n return table.render();\n }\n\n async json([idStr]: [string], { remote, legacy }: { remote: boolean; legacy: boolean }) {\n if (legacy) return JSON.parse(await this.useLegacy(idStr, true, remote));\n const component = await this.getComponent(idStr, remote);\n const fragments = this.component.getShowFragments();\n const rows = await Promise.all(\n fragments.map(async (fragment) => {\n return fragment.json ? fragment.json(component) : undefined;\n })\n );\n\n return rows.filter((row) => !!row);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAA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CAACE,OAAT,EAAkB,OAAO,IAAP;MAClB,OAAO,CAACF,GAAG,CAACG,KAAL,EAAYH,GAAG,CAACE,OAAhB,CAAP;IACD,CAJD,CADiB,CAAnB;IAQA,MAAME,KAAK,GAAG,KAAIC,oBAAJ,EAAa,EAAb,EAAiB,IAAAC,iBAAA,EAAQX,IAAR,CAAjB,CAAd;IACA,OAAOS,KAAK,CAACG,MAAN,EAAP;EACD;;EAES,MAAJxB,IAAI,CAAC,CAACd,KAAD,CAAD,EAAoB;IAAEC,MAAF;IAAUsB;EAAV,CAApB,EAA8E;IACtF,IAAIA,MAAJ,EAAY,OAAOgB,IAAI,CAACnC,KAAL,CAAW,MAAM,KAAKS,SAAL,CAAeb,KAAf,EAAsB,IAAtB,EAA4BC,MAA5B,CAAjB,CAAP;IACZ,MAAML,SAAS,GAAG,MAAM,KAAKG,YAAL,CAAkBC,KAAlB,EAAyBC,MAAzB,CAAxB;IACA,MAAMuB,SAAS,GAAG,KAAK5B,SAAL,CAAe6B,gBAAf,EAAlB;IACA,MAAMC,IAAI,GAAG,MAAMC,OAAO,CAACC,GAAR,CACjBJ,SAAS,CAACK,GAAV,CAAc,MAAOC,QAAP,IAAoB;MAChC,OAAOA,QAAQ,CAAChB,IAAT,GAAgBgB,QAAQ,CAAChB,IAAT,CAAclB,SAAd,CAAhB,GAA2CyB,SAAlD;IACD,CAFD,CADiB,CAAnB;IAMA,OAAOK,IAAI,CAACc,MAAL,CAAaT,GAAD,IAAS,CAAC,CAACA,GAAvB,CAAP;EACD;;AA5EqC"}
1
+ {"version":3,"names":["ShowCmd","constructor","component","name","description","getComponent","idStr","remote","bitId","BitId","parse","host","getHost","id","resolveComponentId","getRemoteComponent","Error","get","MissingBitMapComponent","useLegacy","json","compare","legacyShow","LegacyShow","showData","action","versions","undefined","report","legacy","fragments","getShowFragments","rows","Promise","all","map","fragment","row","renderRow","content","title","table","CLITable","compact","render","JSON","filter"],"sources":["show.cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport { compact } from 'lodash';\n// import { Logger } from '@teambit/logger';\n// import chalk from 'chalk';\nimport { CLITable } from '@teambit/cli-table';\nimport { MissingBitMapComponent } from '@teambit/legacy/dist/consumer/bit-map/exceptions';\nimport { BitId } from '@teambit/legacy-bit-id';\nimport LegacyShow from '@teambit/legacy/dist/cli/commands/public-cmds/show-cmd';\nimport { ComponentMain } from '../component.main.runtime';\n\nexport class ShowCmd implements Command {\n name = 'show <component-name>';\n description = \"display the component's essential information\";\n alias = '';\n group = 'info';\n arguments = [{ name: 'component-name', description: 'component name or component id' }];\n options = [\n ['j', 'json', 'return the component data in a json format'],\n ['l', 'legacy', 'use the legacy bit show.'],\n ['r', 'remote', 'show a remote component'],\n [\n 'c',\n 'compare',\n 'compare current file system component to the latest tagged component [default=latest]. only works in legacy.',\n ],\n ] as CommandOptions;\n\n constructor(private component: ComponentMain) {}\n\n private async getComponent(idStr: string, remote: boolean) {\n if (remote) {\n const bitId: BitId = BitId.parse(idStr, true); // user used --remote so we know it has a scope\n const host = this.component.getHost('teambit.scope/scope');\n const id = await host.resolveComponentId(bitId);\n if (!host.getRemoteComponent) {\n throw new Error('Component Host does not implement getRemoteComponent()');\n }\n const component = await host.getRemoteComponent(id);\n return component;\n }\n const host = this.component.getHost();\n const id = await host.resolveComponentId(idStr);\n const component = await host.get(id);\n if (!component) throw new MissingBitMapComponent(idStr);\n return component;\n }\n\n async useLegacy(id: string, json = false, remote = false, compare = false) {\n const legacyShow = new LegacyShow();\n const showData = await legacyShow.action([id], {\n json,\n versions: undefined,\n remote,\n compare,\n });\n\n return legacyShow.report(showData);\n }\n\n async report([idStr]: [string], { legacy, remote, compare }: { legacy: boolean; remote: boolean; compare: boolean }) {\n if (legacy) return this.useLegacy(idStr, false, remote, compare);\n const component = await this.getComponent(idStr, remote);\n const fragments = this.component.getShowFragments();\n const rows = await Promise.all(\n fragments.map(async (fragment) => {\n const row = await fragment.renderRow(component);\n if (!row.content) return null;\n return [row.title, row.content];\n })\n );\n\n const table = new CLITable([], compact(rows));\n return table.render();\n }\n\n async json([idStr]: [string], { remote, legacy }: { remote: boolean; legacy: boolean }) {\n if (legacy) return JSON.parse(await this.useLegacy(idStr, true, remote));\n const component = await this.getComponent(idStr, remote);\n const fragments = this.component.getShowFragments();\n const rows = await Promise.all(\n fragments.map(async (fragment) => {\n return fragment.json ? fragment.json(component) : undefined;\n })\n );\n\n return rows.filter((row) => !!row);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AALA;AACA;;AAOO,MAAMA,OAAO,CAAoB;EAiBtCC,WAAW,CAASC,SAAwB,EAAE;IAAA,KAA1BA,SAAwB,GAAxBA,SAAwB;IAAA,8CAhBrC,uBAAuB;IAAA,qDAChB,+CAA+C;IAAA,+CACrD,EAAE;IAAA,+CACF,MAAM;IAAA,mDACF,CAAC;MAAEC,IAAI,EAAE,gBAAgB;MAAEC,WAAW,EAAE;IAAiC,CAAC,CAAC;IAAA,iDAC7E,CACR,CAAC,GAAG,EAAE,MAAM,EAAE,4CAA4C,CAAC,EAC3D,CAAC,GAAG,EAAE,QAAQ,EAAE,0BAA0B,CAAC,EAC3C,CAAC,GAAG,EAAE,QAAQ,EAAE,yBAAyB,CAAC,EAC1C,CACE,GAAG,EACH,SAAS,EACT,8GAA8G,CAC/G,CACF;EAE8C;EAE/C,MAAcC,YAAY,CAACC,KAAa,EAAEC,MAAe,EAAE;IACzD,IAAIA,MAAM,EAAE;MACV,MAAMC,KAAY,GAAGC,oBAAK,CAACC,KAAK,CAACJ,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;MAC/C,MAAMK,IAAI,GAAG,IAAI,CAACT,SA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CAACA,GAAG,CAAC;EACpC;AACF;AAAC"}
@@ -21,24 +21,18 @@ Object.defineProperty(exports, "SnapProps", {
21
21
  return _snap().SnapProps;
22
22
  }
23
23
  });
24
-
25
24
  function _author() {
26
25
  const data = require("./author");
27
-
28
26
  _author = function () {
29
27
  return data;
30
28
  };
31
-
32
29
  return data;
33
30
  }
34
-
35
31
  function _snap() {
36
32
  const data = require("./snap");
37
-
38
33
  _snap = function () {
39
34
  return data;
40
35
  };
41
-
42
36
  return data;
43
37
  }
44
38
 
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { Author } from './author';\nexport { Snap, SnapProps } from './snap';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA"}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { Author } from './author';\nexport { Snap, SnapProps } from './snap';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA"}
package/dist/snap/snap.js CHANGED
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.Snap = void 0;
7
-
8
7
  /**
9
8
  * `Snap` represents a sealed state of the component in the working tree.
10
9
  */
@@ -36,12 +35,10 @@ class Snap {
36
35
  this.author = author;
37
36
  this.message = message;
38
37
  }
39
-
40
38
  static fromObject(snapObject) {
41
39
  const parents = snapObject.parents || [];
42
40
  return new Snap(snapObject.hash, new Date(parseInt(snapObject.timestamp)), parents, snapObject.author, snapObject.message);
43
41
  }
44
-
45
42
  toObject() {
46
43
  return {
47
44
  timestamp: this.timestamp.getTime().toString(),
@@ -51,9 +48,7 @@ class Snap {
51
48
  parents: this.parents
52
49
  };
53
50
  }
54
-
55
51
  }
56
-
57
52
  exports.Snap = Snap;
58
53
 
59
54
  //# sourceMappingURL=snap.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Snap","constructor","hash","timestamp","parents","author","message","fromObject","snapObject","Date","parseInt","toObject","getTime","toString"],"sources":["snap.ts"],"sourcesContent":["import { Author } from './author';\n\nexport type SnapProps = {\n hash: string;\n timestamp: string;\n parents: string[];\n author: Author;\n message: string;\n};\n\n/**\n * `Snap` represents a sealed state of the component in the working tree.\n */\nexport class Snap {\n constructor(\n /**\n * hash of the snap.\n */\n readonly hash: string,\n\n /**\n * date time of the snap.\n */\n readonly timestamp: Date,\n\n /**\n * parent snap\n */\n readonly parents: string[],\n\n /**\n * author of the component `Snap`.\n */\n readonly author: Author,\n\n /**\n * message added by the `Snap` author.\n */\n readonly message: string\n ) {}\n\n static fromObject(snapObject: SnapProps) {\n const parents = snapObject.parents || [];\n\n return new Snap(\n snapObject.hash,\n new Date(parseInt(snapObject.timestamp)),\n parents,\n snapObject.author,\n snapObject.message\n );\n }\n\n toObject(): SnapProps {\n return {\n timestamp: this.timestamp.getTime().toString(),\n hash: this.hash,\n author: this.author,\n message: this.message,\n parents: this.parents,\n };\n }\n}\n"],"mappings":";;;;;;;AAUA;AACA;AACA;AACO,MAAMA,IAAN,CAAW;EAChBC,WAAW;EACT;AACJ;AACA;EACaC,IAJA;EAMT;AACJ;AACA;EACaC,SATA;EAWT;AACJ;AACA;EACaC,OAdA;EAgBT;AACJ;AACA;EACaC,MAnBA;EAqBT;AACJ;AACA;EACaC,OAxBA,EAyBT;IAAA,KArBSJ,IAqBT,GArBSA,IAqBT;IAAA,KAhBSC,SAgBT,GAhBSA,SAgBT;IAAA,KAXSC,OAWT,GAXSA,OAWT;IAAA,KANSC,MAMT,GANSA,MAMT;IAAA,KADSC,OACT,GADSA,OACT;EAAE;;EAEa,OAAVC,UAAU,CAACC,UAAD,EAAwB;IACvC,MAAMJ,OAAO,GAAGI,UAAU,CAACJ,OAAX,IAAsB,EAAtC;IAEA,OAAO,IAAIJ,IAAJ,CACLQ,UAAU,CAACN,IADN,EAEL,IAAIO,IAAJ,CAASC,QAAQ,CAACF,UAAU,CAACL,SAAZ,CAAjB,CAFK,EAGLC,OAHK,EAILI,UAAU,CAACH,MAJN,EAKLG,UAAU,CAACF,OALN,CAAP;EAOD;;EAEDK,QAAQ,GAAc;IACpB,OAAO;MACLR,SAAS,EAAE,KAAKA,SAAL,CAAeS,OAAf,GAAyBC,QAAzB,EADN;MAELX,IAAI,EAAE,KAAKA,IAFN;MAGLG,MAAM,EAAE,KAAKA,MAHR;MAILC,OAAO,EAAE,KAAKA,OAJT;MAKLF,OAAO,EAAE,KAAKA;IALT,CAAP;EAOD;;AAhDe"}
1
+ {"version":3,"names":["Snap","constructor","hash","timestamp","parents","author","message","fromObject","snapObject","Date","parseInt","toObject","getTime","toString"],"sources":["snap.ts"],"sourcesContent":["import { Author } from './author';\n\nexport type SnapProps = {\n hash: string;\n timestamp: string;\n parents: string[];\n author: Author;\n message: string;\n};\n\n/**\n * `Snap` represents a sealed state of the component in the working tree.\n */\nexport class Snap {\n constructor(\n /**\n * hash of the snap.\n */\n readonly hash: string,\n\n /**\n * date time of the snap.\n */\n readonly timestamp: Date,\n\n /**\n * parent snap\n */\n readonly parents: string[],\n\n /**\n * author of the component `Snap`.\n */\n readonly author: Author,\n\n /**\n * message added by the `Snap` author.\n */\n readonly message: string\n ) {}\n\n static fromObject(snapObject: SnapProps) {\n const parents = snapObject.parents || [];\n\n return new Snap(\n snapObject.hash,\n new Date(parseInt(snapObject.timestamp)),\n parents,\n snapObject.author,\n snapObject.message\n );\n }\n\n toObject(): SnapProps {\n return {\n timestamp: this.timestamp.getTime().toString(),\n hash: this.hash,\n author: this.author,\n message: this.message,\n parents: this.parents,\n };\n }\n}\n"],"mappings":";;;;;;AAUA;AACA;AACA;AACO,MAAMA,IAAI,CAAC;EAChBC,WAAW;EACT;AACJ;AACA;EACaC,IAAY;EAErB;AACJ;AACA;EACaC,SAAe;EAExB;AACJ;AACA;EACaC,OAAiB;EAE1B;AACJ;AACA;EACaC,MAAc;EAEvB;AACJ;AACA;EACaC,OAAe,EACxB;IAAA,KArBSJ,IAAY,GAAZA,IAAY;IAAA,KAKZC,SAAe,GAAfA,SAAe;IAAA,KAKfC,OAAiB,GAAjBA,OAAiB;IAAA,KAKjBC,MAAc,GAAdA,MAAc;IAAA,KAKdC,OAAe,GAAfA,OAAe;EACvB;EAEH,OAAOC,UAAU,CAACC,UAAqB,EAAE;IACvC,MAAMJ,OAAO,GAAGI,UAAU,CAACJ,OAAO,IAAI,EAAE;IAExC,OAAO,IAAIJ,IAAI,CACbQ,UAAU,CAACN,IAAI,EACf,IAAIO,IAAI,CAACC,QAAQ,CAACF,UAAU,CAACL,SAAS,CAAC,CAAC,EACxCC,OAAO,EACPI,UAAU,CAACH,MAAM,EACjBG,UAAU,CAACF,OAAO,CACnB;EACH;EAEAK,QAAQ,GAAc;IACpB,OAAO;MACLR,SAAS,EAAE,IAAI,CAACA,SAAS,CAACS,OAAO,EAAE,CAACC,QAAQ,EAAE;MAC9CX,IAAI,EAAE,IAAI,CAACA,IAAI;MACfG,MAAM,EAAE,IAAI,CAACA,MAAM;MACnBC,OAAO,EAAE,IAAI,CAACA,OAAO;MACrBF,OAAO,EAAE,IAAI,CAACA;IAChB,CAAC;EACH;AACF;AAAC"}
package/dist/state.js CHANGED
@@ -4,37 +4,27 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.State = void 0;
7
-
8
7
  function _componentIssues() {
9
8
  const data = require("@teambit/component-issues");
10
-
11
9
  _componentIssues = function () {
12
10
  return data;
13
11
  };
14
-
15
12
  return data;
16
13
  }
17
-
18
14
  function _componentId() {
19
15
  const data = require("@teambit/component-id");
20
-
21
16
  _componentId = function () {
22
17
  return data;
23
18
  };
24
-
25
19
  return data;
26
20
  }
27
-
28
21
  function _exceptions() {
29
22
  const data = require("./exceptions");
30
-
31
23
  _exceptions = function () {
32
24
  return data;
33
25
  };
34
-
35
26
  return data;
36
27
  }
37
-
38
28
  class State {
39
29
  constructor(
40
30
  /**
@@ -65,11 +55,10 @@ class State {
65
55
  this.dependencies = dependencies;
66
56
  this._consumer = _consumer;
67
57
  }
58
+
68
59
  /**
69
60
  * get the main file of the component.
70
61
  */
71
-
72
-
73
62
  get mainFile() {
74
63
  const file = this.filesystem.files.find(componentFile => {
75
64
  return componentFile.relative === this._consumer.mainFile;
@@ -77,37 +66,33 @@ class State {
77
66
  if (!file) throw new (_exceptions().MainFileNotFound)(_componentId().ComponentID.fromLegacy(this._consumer.id), this._consumer.mainFile);
78
67
  return file;
79
68
  }
69
+
80
70
  /**
81
71
  * calculate the hash of this state
82
72
  */
83
-
84
-
85
73
  get hash() {
86
74
  return '';
87
75
  }
88
-
89
76
  get issues() {
90
77
  var _this$_consumer;
91
-
92
78
  return (_this$_consumer = this._consumer).issues || (_this$_consumer.issues = new (_componentIssues().IssuesList)());
93
79
  }
80
+
94
81
  /**
95
82
  * @deprecated please use `component.isModified`.
96
83
  * the way it's implemented here is unreliable and will only work if in the legacy the "isModified" was calculated.
97
84
  */
98
-
99
-
100
85
  get isModified() {
101
86
  return this._consumer._isModified;
102
87
  }
103
-
104
88
  get aspects() {
105
89
  return this._aspects;
106
90
  }
107
-
108
91
  set aspects(aspects) {
109
92
  this._aspects = aspects;
110
- } // static fromLegacy(consumerComponent: ConsumerComponent) {
93
+ }
94
+
95
+ // static fromLegacy(consumerComponent: ConsumerComponent) {
111
96
  // return new State(
112
97
  // new Config(consumerComponent.mainFile, consumerComponent.extensions),
113
98
  // consumerComponent.version || 'new',
@@ -117,10 +102,7 @@ class State {
117
102
  // consumerComponent
118
103
  // );
119
104
  // }
120
-
121
-
122
105
  }
123
-
124
106
  exports.State = State;
125
107
 
126
108
  //# sourceMappingURL=state.js.map