@teambit/status 0.0.1 → 0.0.4
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 +4 -2
- package/dist/status.main.runtime.js +18 -4
- package/dist/status.main.runtime.js.map +1 -1
- package/package-tar/teambit-status-0.0.4.tgz +0 -0
- package/package.json +8 -6
- /package/{preview-1648178582015.js → preview-1648437892896.js} +0 -0
- package/package-tar/teambit-status-0.0.1.tgz +0 -0
|
@@ -5,6 +5,7 @@ import Component 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 { IssuesMain } from '@teambit/issues';
|
|
8
9
|
export declare type StatusResult = {
|
|
9
10
|
newComponents: Component[];
|
|
10
11
|
modifiedComponent: Component[];
|
|
@@ -24,10 +25,11 @@ export declare type StatusResult = {
|
|
|
24
25
|
};
|
|
25
26
|
export declare class StatusMain {
|
|
26
27
|
private workspace;
|
|
27
|
-
|
|
28
|
+
private issues;
|
|
29
|
+
constructor(workspace: Workspace, issues: IssuesMain);
|
|
28
30
|
status(): Promise<StatusResult>;
|
|
29
31
|
static slots: never[];
|
|
30
32
|
static dependencies: import("@teambit/harmony").Aspect[];
|
|
31
33
|
static runtime: import("@teambit/harmony").RuntimeDefinition;
|
|
32
|
-
static provider([cli, workspace]: [CLIMain, Workspace]): Promise<StatusMain>;
|
|
34
|
+
static provider([cli, workspace, issues]: [CLIMain, Workspace, IssuesMain]): Promise<StatusMain>;
|
|
33
35
|
}
|
|
@@ -111,6 +111,16 @@ function _exceptions() {
|
|
|
111
111
|
return data;
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
+
function _issues() {
|
|
115
|
+
const data = _interopRequireDefault(require("@teambit/issues"));
|
|
116
|
+
|
|
117
|
+
_issues = function () {
|
|
118
|
+
return data;
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
return data;
|
|
122
|
+
}
|
|
123
|
+
|
|
114
124
|
function _statusCmd() {
|
|
115
125
|
const data = require("./status-cmd");
|
|
116
126
|
|
|
@@ -132,8 +142,9 @@ function _status() {
|
|
|
132
142
|
}
|
|
133
143
|
|
|
134
144
|
class StatusMain {
|
|
135
|
-
constructor(workspace) {
|
|
145
|
+
constructor(workspace, issues) {
|
|
136
146
|
this.workspace = workspace;
|
|
147
|
+
this.issues = issues;
|
|
137
148
|
}
|
|
138
149
|
|
|
139
150
|
async status() {
|
|
@@ -158,7 +169,10 @@ class StatusMain {
|
|
|
158
169
|
const outdatedComponents = await componentsList.listOutdatedComponents();
|
|
159
170
|
const mergePendingComponents = await componentsList.listMergePendingComponents();
|
|
160
171
|
const newAndModified = newComponents.concat(modifiedComponent);
|
|
172
|
+
const issuesToIgnore = this.issues.getIssuesToIgnore();
|
|
161
173
|
const componentsWithIssues = newAndModified.filter(component => {
|
|
174
|
+
issuesToIgnore.forEach(issueToIgnore => component.issues.delete(_componentIssues().IssuesClasses[issueToIgnore]));
|
|
175
|
+
|
|
162
176
|
if (consumer.isLegacy && component.issues) {
|
|
163
177
|
component.issues.delete(_componentIssues().IssuesClasses.RelativeComponentsAuthored);
|
|
164
178
|
}
|
|
@@ -205,8 +219,8 @@ class StatusMain {
|
|
|
205
219
|
};
|
|
206
220
|
}
|
|
207
221
|
|
|
208
|
-
static async provider([cli, workspace]) {
|
|
209
|
-
const statusMain = new StatusMain(workspace);
|
|
222
|
+
static async provider([cli, workspace, issues]) {
|
|
223
|
+
const statusMain = new StatusMain(workspace, issues);
|
|
210
224
|
cli.register(new (_statusCmd().StatusCmd)(statusMain));
|
|
211
225
|
return statusMain;
|
|
212
226
|
}
|
|
@@ -215,7 +229,7 @@ class StatusMain {
|
|
|
215
229
|
|
|
216
230
|
exports.StatusMain = StatusMain;
|
|
217
231
|
(0, _defineProperty2().default)(StatusMain, "slots", []);
|
|
218
|
-
(0, _defineProperty2().default)(StatusMain, "dependencies", [_cli().CLIAspect, _workspace().default]);
|
|
232
|
+
(0, _defineProperty2().default)(StatusMain, "dependencies", [_cli().CLIAspect, _workspace().default, _issues().default]);
|
|
219
233
|
(0, _defineProperty2().default)(StatusMain, "runtime", _cli().MainRuntime);
|
|
220
234
|
|
|
221
235
|
_status().StatusAspect.addRuntime(StatusMain);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["status.main.runtime.ts"],"names":["StatusMain","constructor","workspace","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","componentsWithIssues","isLegacy","issues","delete","IssuesClasses","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","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;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qB;;;gCAAXtE,U,WA+DI,E;gCA/DJA,U,kBAgEW,CAACyE,gBAAD,EAAYC,oBAAZ,C;gCAhEX1E,U,aAiEM2E,kB;;AAQnBC,uBAAaC,UAAb,CAAwB7E,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';\n\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) {}\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 componentsWithIssues = newAndModified.filter((component: Component) => {\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];\n static runtime = MainRuntime;\n static async provider([cli, workspace]: [CLIMain, Workspace]) {\n const statusMain = new StatusMain(workspace);\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","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;;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;;AAAA;AAAA;;AAoBO,MAAMA,UAAN,CAAiB;AACtBC,EAAAA,WAAW,CAASC,SAAT,EAAuCC,MAAvC,EAA2D;AAAA,SAAlDD,SAAkD,GAAlDA,SAAkD;AAAA,SAApBC,MAAoB,GAApBA,MAAoB;AAAE;;AAE5D,QAANC,MAAM,GAA0B;AACpC,QAAI,CAAC,KAAKF,SAAV,EAAqB,MAAM,KAAIG,8BAAJ,GAAN;;AACrBC,sBAAOC,KAAP,CAAaC,+BAAb;;AACA,UAAMC,QAAQ,GAAG,KAAKP,SAAL,CAAeO,QAAhC;AACA,UAAMC,OAAO,GAAG,MAAMD,QAAQ,CAACE,oBAAT,EAAtB;AACA,UAAMC,cAAc,GAAG,KAAIC,yBAAJ,EAAmBJ,QAAnB,CAAvB;AACA,UAAMK,aAA0B,GAAI,MAAMF,cAAc,CAACG,iBAAf,CAAiC,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ALK;AAKiB;AACtBf,MAAAA,uBANK;AAMoB;AACzBR,MAAAA,wBAAwB,EAAEP,0BAAesD,oBAAf,CAAoC7C,2BAApC,CAPrB;AAQL;AACAY,MAAAA,iBATK;AAULC,MAAAA,kBAVK;AAWLE,MAAAA,sBAXK;AAYLc,MAAAA,0BAZK;AAaLiB,MAAAA,6BAA6B,EAAE,MAAMxD,cAAc,CAACyD,iCAAf,EAbhC;AAcLC,MAAAA,uBAAuB,EAAE,MAAM1D,cAAc,CAAC2D,0BAAf,EAd1B;AAeLlB,MAAAA,oBAfK;AAgBLE,MAAAA,iBAhBK;AAiBLK,MAAAA;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"]}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/status",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
|
+
"homepage": "https://bit.dev/teambit/component/status",
|
|
4
5
|
"main": "dist/index.js",
|
|
5
6
|
"componentId": {
|
|
6
7
|
"scope": "teambit.component",
|
|
7
8
|
"name": "status",
|
|
8
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.4"
|
|
9
10
|
},
|
|
10
11
|
"dependencies": {
|
|
11
12
|
"chalk": "2.4.2",
|
|
@@ -13,10 +14,11 @@
|
|
|
13
14
|
"@teambit/harmony": "0.2.11",
|
|
14
15
|
"@babel/runtime": "7.12.18",
|
|
15
16
|
"core-js": "^3.0.0",
|
|
16
|
-
"@teambit/cli": "0.0.
|
|
17
|
+
"@teambit/cli": "0.0.463",
|
|
17
18
|
"@teambit/legacy-bit-id": "0.0.399",
|
|
18
19
|
"@teambit/component-issues": "0.0.48",
|
|
19
|
-
"@teambit/
|
|
20
|
+
"@teambit/issues": "0.0.2",
|
|
21
|
+
"@teambit/workspace": "0.0.692"
|
|
20
22
|
},
|
|
21
23
|
"devDependencies": {
|
|
22
24
|
"@types/mocha": "9.1.0",
|
|
@@ -27,7 +29,7 @@
|
|
|
27
29
|
"@types/node": "12.20.4"
|
|
28
30
|
},
|
|
29
31
|
"peerDependencies": {
|
|
30
|
-
"@teambit/legacy": "1.0.
|
|
32
|
+
"@teambit/legacy": "1.0.241",
|
|
31
33
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
32
34
|
"react": "^16.8.0 || ^17.0.0"
|
|
33
35
|
},
|
|
@@ -55,7 +57,7 @@
|
|
|
55
57
|
"react": "-"
|
|
56
58
|
},
|
|
57
59
|
"peerDependencies": {
|
|
58
|
-
"@teambit/legacy": "1.0.
|
|
60
|
+
"@teambit/legacy": "1.0.241",
|
|
59
61
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
60
62
|
"react": "^16.8.0 || ^17.0.0"
|
|
61
63
|
}
|
|
File without changes
|
|
Binary file
|