@teambit/status 0.0.5 → 0.0.6
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/status.main.runtime.d.ts +11 -9
- package/dist/status.main.runtime.js +23 -6
- package/dist/status.main.runtime.js.map +1 -1
- package/package-tar/teambit-status-0.0.6.tgz +0 -0
- package/package.json +9 -8
- /package/{preview-1648524148272.js → preview-1648659683881.js} +0 -0
- package/package-tar/teambit-status-0.0.5.tgz +0 -0
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import { CLIMain } from '@teambit/cli';
|
|
2
2
|
import { Workspace } from '@teambit/workspace';
|
|
3
3
|
import { BitId, BitIds } from '@teambit/legacy/dist/bit-id';
|
|
4
|
-
import
|
|
4
|
+
import ConsumerComponent from '@teambit/legacy/dist/consumer/component';
|
|
5
5
|
import { DivergedComponent } from '@teambit/legacy/dist/consumer/component/components-list';
|
|
6
6
|
import { InvalidComponent } from '@teambit/legacy/dist/consumer/component/consumer-component';
|
|
7
7
|
import { ModelComponent } from '@teambit/legacy/dist/scope/models';
|
|
8
|
+
import { InsightsMain } from '@teambit/insights';
|
|
8
9
|
import { IssuesMain } from '@teambit/issues';
|
|
9
10
|
export declare type StatusResult = {
|
|
10
|
-
newComponents:
|
|
11
|
-
modifiedComponent:
|
|
11
|
+
newComponents: ConsumerComponent[];
|
|
12
|
+
modifiedComponent: ConsumerComponent[];
|
|
12
13
|
stagedComponents: ModelComponent[];
|
|
13
|
-
componentsWithIssues:
|
|
14
|
+
componentsWithIssues: ConsumerComponent[];
|
|
14
15
|
importPendingComponents: BitId[];
|
|
15
16
|
autoTagPendingComponents: BitId[];
|
|
16
17
|
invalidComponents: InvalidComponent[];
|
|
17
|
-
outdatedComponents:
|
|
18
|
+
outdatedComponents: ConsumerComponent[];
|
|
18
19
|
mergePendingComponents: DivergedComponent[];
|
|
19
20
|
componentsDuringMergeState: BitIds;
|
|
20
|
-
componentsWithIndividualFiles:
|
|
21
|
-
componentsWithTrackDirs:
|
|
21
|
+
componentsWithIndividualFiles: ConsumerComponent[];
|
|
22
|
+
componentsWithTrackDirs: ConsumerComponent[];
|
|
22
23
|
softTaggedComponents: BitId[];
|
|
23
24
|
snappedComponents: BitId[];
|
|
24
25
|
laneName: string | null;
|
|
@@ -26,10 +27,11 @@ export declare type StatusResult = {
|
|
|
26
27
|
export declare class StatusMain {
|
|
27
28
|
private workspace;
|
|
28
29
|
private issues;
|
|
29
|
-
|
|
30
|
+
private insights;
|
|
31
|
+
constructor(workspace: Workspace, issues: IssuesMain, insights: InsightsMain);
|
|
30
32
|
status(): Promise<StatusResult>;
|
|
31
33
|
static slots: never[];
|
|
32
34
|
static dependencies: import("@teambit/harmony").Aspect[];
|
|
33
35
|
static runtime: import("@teambit/harmony").RuntimeDefinition;
|
|
34
|
-
static provider([cli, workspace, issues]: [CLIMain, Workspace, IssuesMain]): Promise<StatusMain>;
|
|
36
|
+
static provider([cli, workspace, insights, issues]: [CLIMain, Workspace, InsightsMain, IssuesMain]): Promise<StatusMain>;
|
|
35
37
|
}
|
|
@@ -111,6 +111,16 @@ function _exceptions() {
|
|
|
111
111
|
return data;
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
+
function _insights() {
|
|
115
|
+
const data = require("@teambit/insights");
|
|
116
|
+
|
|
117
|
+
_insights = function () {
|
|
118
|
+
return data;
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
return data;
|
|
122
|
+
}
|
|
123
|
+
|
|
114
124
|
function _issues() {
|
|
115
125
|
const data = _interopRequireDefault(require("@teambit/issues"));
|
|
116
126
|
|
|
@@ -142,9 +152,10 @@ function _status() {
|
|
|
142
152
|
}
|
|
143
153
|
|
|
144
154
|
class StatusMain {
|
|
145
|
-
constructor(workspace, issues) {
|
|
155
|
+
constructor(workspace, issues, insights) {
|
|
146
156
|
this.workspace = workspace;
|
|
147
157
|
this.issues = issues;
|
|
158
|
+
this.insights = insights;
|
|
148
159
|
}
|
|
149
160
|
|
|
150
161
|
async status() {
|
|
@@ -168,9 +179,15 @@ class StatusMain {
|
|
|
168
179
|
const invalidComponents = allInvalidComponents.filter(c => !(c.error instanceof _componentsPendingImport().default));
|
|
169
180
|
const outdatedComponents = await componentsList.listOutdatedComponents();
|
|
170
181
|
const mergePendingComponents = await componentsList.listMergePendingComponents();
|
|
171
|
-
const
|
|
182
|
+
const newAndModifiedLegacy = newComponents.concat(modifiedComponent);
|
|
172
183
|
const issuesToIgnore = this.issues.getIssuesToIgnore();
|
|
173
|
-
|
|
184
|
+
|
|
185
|
+
if (!this.workspace.isLegacy && newAndModifiedLegacy.length && !issuesToIgnore.includes(_componentIssues().IssuesClasses.CircularDependencies.name)) {
|
|
186
|
+
const newAndModified = await this.workspace.getManyByLegacy(newAndModifiedLegacy);
|
|
187
|
+
await this.insights.addInsightsAsComponentIssues(newAndModified);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
const componentsWithIssues = newAndModifiedLegacy.filter(component => {
|
|
174
191
|
issuesToIgnore.forEach(issueToIgnore => component.issues.delete(_componentIssues().IssuesClasses[issueToIgnore]));
|
|
175
192
|
|
|
176
193
|
if (consumer.isLegacy && component.issues) {
|
|
@@ -219,8 +236,8 @@ class StatusMain {
|
|
|
219
236
|
};
|
|
220
237
|
}
|
|
221
238
|
|
|
222
|
-
static async provider([cli, workspace, issues]) {
|
|
223
|
-
const statusMain = new StatusMain(workspace, issues);
|
|
239
|
+
static async provider([cli, workspace, insights, issues]) {
|
|
240
|
+
const statusMain = new StatusMain(workspace, issues, insights);
|
|
224
241
|
cli.register(new (_statusCmd().StatusCmd)(statusMain));
|
|
225
242
|
return statusMain;
|
|
226
243
|
}
|
|
@@ -229,7 +246,7 @@ class StatusMain {
|
|
|
229
246
|
|
|
230
247
|
exports.StatusMain = StatusMain;
|
|
231
248
|
(0, _defineProperty2().default)(StatusMain, "slots", []);
|
|
232
|
-
(0, _defineProperty2().default)(StatusMain, "dependencies", [_cli().CLIAspect, _workspace().default, _issues().default]);
|
|
249
|
+
(0, _defineProperty2().default)(StatusMain, "dependencies", [_cli().CLIAspect, _workspace().default, _insights().InsightsAspect, _issues().default]);
|
|
233
250
|
(0, _defineProperty2().default)(StatusMain, "runtime", _cli().MainRuntime);
|
|
234
251
|
|
|
235
252
|
_status().StatusAspect.addRuntime(StatusMain);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["status.main.runtime.ts"],"names":["StatusMain","constructor","workspace","issues","status","ConsumerNotFound","loader","start","BEFORE_STATUS","consumer","laneObj","getCurrentLaneObject","componentsList","ComponentsList","newComponents","listNewComponents","modifiedComponent","listModifiedComponents","stagedComponents","listExportPendingComponents","autoTagPendingComponents","listAutoTagPendingComponents","autoTagPendingComponentsIds","map","component","id","allInvalidComponents","listInvalidComponents","importPendingComponents","filter","c","error","ComponentsPendingImport","i","invalidComponents","outdatedComponents","listOutdatedComponents","mergePendingComponents","listMergePendingComponents","newAndModified","concat","issuesToIgnore","getIssuesToIgnore","componentsWithIssues","forEach","issueToIgnore","delete","IssuesClasses","isLegacy","RelativeComponentsAuthored","isEmpty","componentsDuringMergeState","listDuringMergeStateComponents","softTaggedComponents","listSoftTaggedComponents","snappedComponents","listSnappedComponentsOnMain","toBitId","currentLane","getCurrentLaneId","laneName","isDefault","name","Analytics","setExtraData","length","onDestroy","sortComponentsByName","componentsWithIndividualFiles","listComponentsWithIndividualFiles","componentsWithTrackDirs","listComponentsWithTrackDir","provider","cli","statusMain","register","StatusCmd","CLIAspect","WorkspaceAspect","IssuesAspect","MainRuntime","StatusAspect","addRuntime"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA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AAA;AAjBK,KAAP;AAmBD;;AAKoB,eAARY,QAAQ,CAAC,CAACC,GAAD,EAAMvE,SAAN,EAAiBC,MAAjB,CAAD,EAA6D;AAChF,UAAMuE,UAAU,GAAG,IAAI1E,UAAJ,CAAeE,SAAf,EAA0BC,MAA1B,CAAnB;AACAsE,IAAAA,GAAG,CAACE,QAAJ,CAAa,KAAIC,sBAAJ,EAAcF,UAAd,CAAb;AACA,WAAOA,UAAP;AACD;;AAxEqB;;;gCAAX1E,U,WAiEI,E;gCAjEJA,U,kBAkEW,CAAC6E,gBAAD,EAAYC,oBAAZ,EAA6BC,iBAA7B,C;gCAlEX/E,U,aAmEMgF,kB;;AAQnBC,uBAAaC,UAAb,CAAwBlF,UAAxB","sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport WorkspaceAspect, { Workspace } from '@teambit/workspace';\nimport { Analytics } from '@teambit/legacy/dist/analytics/analytics';\nimport { BitId, BitIds } from '@teambit/legacy/dist/bit-id';\nimport loader from '@teambit/legacy/dist/cli/loader';\nimport { BEFORE_STATUS } from '@teambit/legacy/dist/cli/loader/loader-messages';\nimport Component from '@teambit/legacy/dist/consumer/component';\nimport ComponentsPendingImport from '@teambit/legacy/dist/consumer/component-ops/exceptions/components-pending-import';\nimport ComponentsList, { DivergedComponent } from '@teambit/legacy/dist/consumer/component/components-list';\nimport { InvalidComponent } from '@teambit/legacy/dist/consumer/component/consumer-component';\nimport { ModelComponent } from '@teambit/legacy/dist/scope/models';\nimport { ConsumerNotFound } from '@teambit/legacy/dist/consumer/exceptions';\nimport IssuesAspect, { IssuesMain } from '@teambit/issues';\nimport { StatusCmd } from './status-cmd';\nimport { StatusAspect } from './status.aspect';\n\nexport type StatusResult = {\n newComponents: Component[];\n modifiedComponent: Component[];\n stagedComponents: ModelComponent[];\n componentsWithIssues: Component[];\n importPendingComponents: BitId[];\n autoTagPendingComponents: BitId[];\n invalidComponents: InvalidComponent[];\n outdatedComponents: Component[];\n mergePendingComponents: DivergedComponent[];\n componentsDuringMergeState: BitIds;\n componentsWithIndividualFiles: Component[];\n componentsWithTrackDirs: Component[];\n softTaggedComponents: BitId[];\n snappedComponents: BitId[];\n laneName: string | null; // null if default\n};\n\nexport class StatusMain {\n constructor(private workspace: Workspace, private issues: IssuesMain) {}\n\n async status(): Promise<StatusResult> {\n if (!this.workspace) throw new ConsumerNotFound();\n loader.start(BEFORE_STATUS);\n const consumer = this.workspace.consumer;\n const laneObj = await consumer.getCurrentLaneObject();\n const componentsList = new ComponentsList(consumer);\n const newComponents: Component[] = (await componentsList.listNewComponents(true)) as Component[];\n const modifiedComponent = (await componentsList.listModifiedComponents(true)) as Component[];\n const stagedComponents: ModelComponent[] = await componentsList.listExportPendingComponents(laneObj);\n const autoTagPendingComponents = await componentsList.listAutoTagPendingComponents();\n const autoTagPendingComponentsIds = autoTagPendingComponents.map((component) => component.id);\n const allInvalidComponents = await componentsList.listInvalidComponents();\n const importPendingComponents = allInvalidComponents\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n .filter((c) => c.error instanceof ComponentsPendingImport)\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n .map((i) => i.id);\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n const invalidComponents = allInvalidComponents.filter((c) => !(c.error instanceof ComponentsPendingImport));\n const outdatedComponents = await componentsList.listOutdatedComponents();\n const mergePendingComponents = await componentsList.listMergePendingComponents();\n const newAndModified: Component[] = newComponents.concat(modifiedComponent);\n const issuesToIgnore = this.issues.getIssuesToIgnore();\n const componentsWithIssues = newAndModified.filter((component: Component) => {\n issuesToIgnore.forEach((issueToIgnore) => component.issues.delete(IssuesClasses[issueToIgnore]));\n if (consumer.isLegacy && component.issues) {\n component.issues.delete(IssuesClasses.RelativeComponentsAuthored);\n }\n return component.issues && !component.issues.isEmpty();\n });\n const componentsDuringMergeState = componentsList.listDuringMergeStateComponents();\n const softTaggedComponents = componentsList.listSoftTaggedComponents();\n const snappedComponents = (await componentsList.listSnappedComponentsOnMain()).map((c) => c.toBitId());\n const currentLane = consumer.getCurrentLaneId();\n const laneName = currentLane.isDefault() ? null : currentLane.name;\n Analytics.setExtraData('new_components', newComponents.length);\n Analytics.setExtraData('staged_components', stagedComponents.length);\n Analytics.setExtraData('num_components_with_missing_dependencies', componentsWithIssues.length);\n Analytics.setExtraData('autoTagPendingComponents', autoTagPendingComponents.length);\n Analytics.setExtraData('deleted', invalidComponents.length);\n await consumer.onDestroy();\n return {\n newComponents: ComponentsList.sortComponentsByName(newComponents),\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n modifiedComponent: ComponentsList.sortComponentsByName(modifiedComponent),\n stagedComponents: ComponentsList.sortComponentsByName(stagedComponents),\n componentsWithIssues, // no need to sort, we don't print it as is\n importPendingComponents, // no need to sort, we use only its length\n autoTagPendingComponents: ComponentsList.sortComponentsByName(autoTagPendingComponentsIds),\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n invalidComponents,\n outdatedComponents,\n mergePendingComponents,\n componentsDuringMergeState,\n componentsWithIndividualFiles: await componentsList.listComponentsWithIndividualFiles(),\n componentsWithTrackDirs: await componentsList.listComponentsWithTrackDir(),\n softTaggedComponents,\n snappedComponents,\n laneName,\n };\n }\n\n static slots = [];\n static dependencies = [CLIAspect, WorkspaceAspect, IssuesAspect];\n static runtime = MainRuntime;\n static async provider([cli, workspace, issues]: [CLIMain, Workspace, IssuesMain]) {\n const statusMain = new StatusMain(workspace, issues);\n cli.register(new StatusCmd(statusMain));\n return statusMain;\n }\n}\n\nStatusAspect.addRuntime(StatusMain);\n"]}
|
|
1
|
+
{"version":3,"sources":["status.main.runtime.ts"],"names":["StatusMain","constructor","workspace","issues","insights","status","ConsumerNotFound","loader","start","BEFORE_STATUS","consumer","laneObj","getCurrentLaneObject","componentsList","ComponentsList","newComponents","listNewComponents","modifiedComponent","listModifiedComponents","stagedComponents","listExportPendingComponents","autoTagPendingComponents","listAutoTagPendingComponents","autoTagPendingComponentsIds","map","component","id","allInvalidComponents","listInvalidComponents","importPendingComponents","filter","c","error","ComponentsPendingImport","i","invalidComponents","outdatedComponents","listOutdatedComponents","mergePendingComponents","listMergePendingComponents","newAndModifiedLegacy","concat","issuesToIgnore","getIssuesToIgnore","isLegacy","length","includes","IssuesClasses","CircularDependencies","name","newAndModified","getManyByLegacy","addInsightsAsComponentIssues","componentsWithIssues","forEach","issueToIgnore","delete","RelativeComponentsAuthored","isEmpty","componentsDuringMergeState","listDuringMergeStateComponents","softTaggedComponents","listSoftTaggedComponents","snappedComponents","listSnappedComponentsOnMain","toBitId","currentLane","getCurrentLaneId","laneName","isDefault","Analytics","setExtraData","onDestroy","sortComponentsByName","componentsWithIndividualFiles","listComponentsWithIndividualFiles","componentsWithTrackDirs","listComponentsWithTrackDir","provider","cli","statusMain","register","StatusCmd","CLIAspect","WorkspaceAspect","InsightsAspect","IssuesAspect","MainRuntime","StatusAspect","addRuntime"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;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AAAA,uBAAuB,EAAE,MAAM/D,cAAc,CAACgE,0BAAf,EAd1B;AAeLhB,MAAAA,oBAfK;AAgBLE,MAAAA,iBAhBK;AAiBLK,MAAAA;AAjBK,KAAP;AAmBD;;AAKoB,eAARU,QAAQ,CAAC,CAACC,GAAD,EAAM7E,SAAN,EAAiBE,QAAjB,EAA2BD,MAA3B,CAAD,EAAqF;AACxG,UAAM6E,UAAU,GAAG,IAAIhF,UAAJ,CAAeE,SAAf,EAA0BC,MAA1B,EAAkCC,QAAlC,CAAnB;AACA2E,IAAAA,GAAG,CAACE,QAAJ,CAAa,KAAIC,sBAAJ,EAAcF,UAAd,CAAb;AACA,WAAOA,UAAP;AACD;;AAhFqB;;;gCAAXhF,U,WAyEI,E;gCAzEJA,U,kBA0EW,CAACmF,gBAAD,EAAYC,oBAAZ,EAA6BC,0BAA7B,EAA6CC,iBAA7C,C;gCA1EXtF,U,aA2EMuF,kB;;AAQnBC,uBAAaC,UAAb,CAAwBzF,UAAxB","sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport WorkspaceAspect, { Workspace } from '@teambit/workspace';\nimport { Analytics } from '@teambit/legacy/dist/analytics/analytics';\nimport { BitId, BitIds } from '@teambit/legacy/dist/bit-id';\nimport loader from '@teambit/legacy/dist/cli/loader';\nimport { BEFORE_STATUS } from '@teambit/legacy/dist/cli/loader/loader-messages';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component';\nimport ComponentsPendingImport from '@teambit/legacy/dist/consumer/component-ops/exceptions/components-pending-import';\nimport ComponentsList, { DivergedComponent } from '@teambit/legacy/dist/consumer/component/components-list';\nimport { InvalidComponent } from '@teambit/legacy/dist/consumer/component/consumer-component';\nimport { ModelComponent } from '@teambit/legacy/dist/scope/models';\nimport { ConsumerNotFound } from '@teambit/legacy/dist/consumer/exceptions';\nimport { InsightsAspect, InsightsMain } from '@teambit/insights';\nimport IssuesAspect, { IssuesMain } from '@teambit/issues';\nimport { StatusCmd } from './status-cmd';\nimport { StatusAspect } from './status.aspect';\n\nexport type StatusResult = {\n newComponents: ConsumerComponent[];\n modifiedComponent: ConsumerComponent[];\n stagedComponents: ModelComponent[];\n componentsWithIssues: ConsumerComponent[];\n importPendingComponents: BitId[];\n autoTagPendingComponents: BitId[];\n invalidComponents: InvalidComponent[];\n outdatedComponents: ConsumerComponent[];\n mergePendingComponents: DivergedComponent[];\n componentsDuringMergeState: BitIds;\n componentsWithIndividualFiles: ConsumerComponent[];\n componentsWithTrackDirs: ConsumerComponent[];\n softTaggedComponents: BitId[];\n snappedComponents: BitId[];\n laneName: string | null; // null if default\n};\n\nexport class StatusMain {\n constructor(private workspace: Workspace, private issues: IssuesMain, private insights: InsightsMain) {}\n\n async status(): Promise<StatusResult> {\n if (!this.workspace) throw new ConsumerNotFound();\n loader.start(BEFORE_STATUS);\n const consumer = this.workspace.consumer;\n const laneObj = await consumer.getCurrentLaneObject();\n const componentsList = new ComponentsList(consumer);\n const newComponents: ConsumerComponent[] = (await componentsList.listNewComponents(true)) as ConsumerComponent[];\n const modifiedComponent = (await componentsList.listModifiedComponents(true)) as ConsumerComponent[];\n const stagedComponents: ModelComponent[] = await componentsList.listExportPendingComponents(laneObj);\n const autoTagPendingComponents = await componentsList.listAutoTagPendingComponents();\n const autoTagPendingComponentsIds = autoTagPendingComponents.map((component) => component.id);\n const allInvalidComponents = await componentsList.listInvalidComponents();\n const importPendingComponents = allInvalidComponents\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n .filter((c) => c.error instanceof ComponentsPendingImport)\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n .map((i) => i.id);\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n const invalidComponents = allInvalidComponents.filter((c) => !(c.error instanceof ComponentsPendingImport));\n const outdatedComponents = await componentsList.listOutdatedComponents();\n const mergePendingComponents = await componentsList.listMergePendingComponents();\n const newAndModifiedLegacy: ConsumerComponent[] = newComponents.concat(modifiedComponent);\n const issuesToIgnore = this.issues.getIssuesToIgnore();\n if (\n !this.workspace.isLegacy &&\n newAndModifiedLegacy.length &&\n !issuesToIgnore.includes(IssuesClasses.CircularDependencies.name)\n ) {\n const newAndModified = await this.workspace.getManyByLegacy(newAndModifiedLegacy);\n await this.insights.addInsightsAsComponentIssues(newAndModified);\n }\n const componentsWithIssues = newAndModifiedLegacy.filter((component: ConsumerComponent) => {\n issuesToIgnore.forEach((issueToIgnore) => component.issues.delete(IssuesClasses[issueToIgnore]));\n if (consumer.isLegacy && component.issues) {\n component.issues.delete(IssuesClasses.RelativeComponentsAuthored);\n }\n return component.issues && !component.issues.isEmpty();\n });\n const componentsDuringMergeState = componentsList.listDuringMergeStateComponents();\n const softTaggedComponents = componentsList.listSoftTaggedComponents();\n const snappedComponents = (await componentsList.listSnappedComponentsOnMain()).map((c) => c.toBitId());\n const currentLane = consumer.getCurrentLaneId();\n const laneName = currentLane.isDefault() ? null : currentLane.name;\n Analytics.setExtraData('new_components', newComponents.length);\n Analytics.setExtraData('staged_components', stagedComponents.length);\n Analytics.setExtraData('num_components_with_missing_dependencies', componentsWithIssues.length);\n Analytics.setExtraData('autoTagPendingComponents', autoTagPendingComponents.length);\n Analytics.setExtraData('deleted', invalidComponents.length);\n await consumer.onDestroy();\n return {\n newComponents: ComponentsList.sortComponentsByName(newComponents),\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n modifiedComponent: ComponentsList.sortComponentsByName(modifiedComponent),\n stagedComponents: ComponentsList.sortComponentsByName(stagedComponents),\n componentsWithIssues, // no need to sort, we don't print it as is\n importPendingComponents, // no need to sort, we use only its length\n autoTagPendingComponents: ComponentsList.sortComponentsByName(autoTagPendingComponentsIds),\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n invalidComponents,\n outdatedComponents,\n mergePendingComponents,\n componentsDuringMergeState,\n componentsWithIndividualFiles: await componentsList.listComponentsWithIndividualFiles(),\n componentsWithTrackDirs: await componentsList.listComponentsWithTrackDir(),\n softTaggedComponents,\n snappedComponents,\n laneName,\n };\n }\n\n static slots = [];\n static dependencies = [CLIAspect, WorkspaceAspect, InsightsAspect, IssuesAspect];\n static runtime = MainRuntime;\n static async provider([cli, workspace, insights, issues]: [CLIMain, Workspace, InsightsMain, IssuesMain]) {\n const statusMain = new StatusMain(workspace, issues, insights);\n cli.register(new StatusCmd(statusMain));\n return statusMain;\n }\n}\n\nStatusAspect.addRuntime(StatusMain);\n"]}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/status",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"homepage": "https://bit.dev/teambit/component/status",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.component",
|
|
8
8
|
"name": "status",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.6"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "2.4.2",
|
|
@@ -14,11 +14,12 @@
|
|
|
14
14
|
"@teambit/harmony": "0.2.11",
|
|
15
15
|
"@babel/runtime": "7.12.18",
|
|
16
16
|
"core-js": "^3.0.0",
|
|
17
|
-
"@teambit/cli": "0.0.
|
|
17
|
+
"@teambit/cli": "0.0.464",
|
|
18
18
|
"@teambit/legacy-bit-id": "0.0.399",
|
|
19
|
-
"@teambit/component-issues": "0.0.
|
|
20
|
-
"@teambit/
|
|
21
|
-
"@teambit/
|
|
19
|
+
"@teambit/component-issues": "0.0.49",
|
|
20
|
+
"@teambit/insights": "0.0.694",
|
|
21
|
+
"@teambit/issues": "0.0.3",
|
|
22
|
+
"@teambit/workspace": "0.0.694"
|
|
22
23
|
},
|
|
23
24
|
"devDependencies": {
|
|
24
25
|
"@types/mocha": "9.1.0",
|
|
@@ -29,7 +30,7 @@
|
|
|
29
30
|
"@types/node": "12.20.4"
|
|
30
31
|
},
|
|
31
32
|
"peerDependencies": {
|
|
32
|
-
"@teambit/legacy": "1.0.
|
|
33
|
+
"@teambit/legacy": "1.0.242",
|
|
33
34
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
34
35
|
"react": "^16.8.0 || ^17.0.0"
|
|
35
36
|
},
|
|
@@ -57,7 +58,7 @@
|
|
|
57
58
|
"react": "-"
|
|
58
59
|
},
|
|
59
60
|
"peerDependencies": {
|
|
60
|
-
"@teambit/legacy": "1.0.
|
|
61
|
+
"@teambit/legacy": "1.0.242",
|
|
61
62
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
62
63
|
"react": "^16.8.0 || ^17.0.0"
|
|
63
64
|
}
|
|
File without changes
|
|
Binary file
|