@teambit/status 0.0.6 → 0.0.9
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.
|
@@ -180,16 +180,19 @@ class StatusMain {
|
|
|
180
180
|
const outdatedComponents = await componentsList.listOutdatedComponents();
|
|
181
181
|
const mergePendingComponents = await componentsList.listMergePendingComponents();
|
|
182
182
|
const newAndModifiedLegacy = newComponents.concat(modifiedComponent);
|
|
183
|
-
const issuesToIgnore = this.issues.
|
|
183
|
+
const issuesToIgnore = this.issues.getIssuesToIgnoreGlobally();
|
|
184
184
|
|
|
185
|
-
if (!this.workspace.isLegacy && newAndModifiedLegacy.length
|
|
185
|
+
if (!this.workspace.isLegacy && newAndModifiedLegacy.length) {
|
|
186
186
|
const newAndModified = await this.workspace.getManyByLegacy(newAndModifiedLegacy);
|
|
187
|
-
|
|
187
|
+
|
|
188
|
+
if (!issuesToIgnore.includes(_componentIssues().IssuesClasses.CircularDependencies.name)) {
|
|
189
|
+
await this.insights.addInsightsAsComponentIssues(newAndModified);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
this.issues.removeIgnoredIssuesFromComponents(newAndModified);
|
|
188
193
|
}
|
|
189
194
|
|
|
190
195
|
const componentsWithIssues = newAndModifiedLegacy.filter(component => {
|
|
191
|
-
issuesToIgnore.forEach(issueToIgnore => component.issues.delete(_componentIssues().IssuesClasses[issueToIgnore]));
|
|
192
|
-
|
|
193
196
|
if (consumer.isLegacy && component.issues) {
|
|
194
197
|
component.issues.delete(_componentIssues().IssuesClasses.RelativeComponentsAuthored);
|
|
195
198
|
}
|
|
@@ -1 +1 @@
|
|
|
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;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAoBO,M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AAAA,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"]}
|
|
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","getIssuesToIgnoreGlobally","isLegacy","length","newAndModified","getManyByLegacy","includes","IssuesClasses","CircularDependencies","name","addInsightsAsComponentIssues","removeIgnoredIssuesFromComponents","componentsWithIssues","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;A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,0BAAe0D,oBAAf,CAAoCvD,iBAApC,CAHd;AAILE,MAAAA,gBAAgB,EAAEL,0BAAe0D,oBAAf,CAAoCrD,gBAApC,CAJb;AAKLmC,MAAAA,oBALK;AAKiB;AACtBzB,MAAAA,uBANK;AAMoB;AACzBR,MAAAA,wBAAwB,EAAEP,0BAAe0D,oBAAf,CAAoCjD,2BAApC,CAPrB;AAQL;AACAY,MAAAA,iBATK;AAULC,MAAAA,kBAVK;AAWLE,MAAAA,sBAXK;AAYLoB,MAAAA,0BAZK;AAaLe,MAAAA,6BAA6B,EAAE,MAAM5D,cAAc,CAAC6D,iCAAf,EAbhC;AAcLC,MAAAA,uBAAuB,EAAE,MAAM9D,cAAc,CAAC+D,0BAAf,EAd1B;AAeLhB,MAAAA,oBAfK;AAgBLE,MAAAA,iBAhBK;AAiBLK,MAAAA;AAjBK,KAAP;AAmBD;;AAKoB,eAARU,QAAQ,CAAC,CAACC,GAAD,EAAM5E,SAAN,EAAiBE,QAAjB,EAA2BD,MAA3B,CAAD,EAAqF;AACxG,UAAM4E,UAAU,GAAG,IAAI/E,UAAJ,CAAeE,SAAf,EAA0BC,MAA1B,EAAkCC,QAAlC,CAAnB;AACA0E,IAAAA,GAAG,CAACE,QAAJ,CAAa,KAAIC,sBAAJ,EAAcF,UAAd,CAAb;AACA,WAAOA,UAAP;AACD;;AA9EqB;;;gCAAX/E,U,WAuEI,E;gCAvEJA,U,kBAwEW,CAACkF,gBAAD,EAAYC,oBAAZ,EAA6BC,0BAA7B,EAA6CC,iBAA7C,C;gCAxEXrF,U,aAyEMsF,kB;;AAQnBC,uBAAaC,UAAb,CAAwBxF,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.getIssuesToIgnoreGlobally();\n if (!this.workspace.isLegacy && newAndModifiedLegacy.length) {\n const newAndModified = await this.workspace.getManyByLegacy(newAndModifiedLegacy);\n if (!issuesToIgnore.includes(IssuesClasses.CircularDependencies.name)) {\n await this.insights.addInsightsAsComponentIssues(newAndModified);\n }\n this.issues.removeIgnoredIssuesFromComponents(newAndModified);\n }\n const componentsWithIssues = newAndModifiedLegacy.filter((component: ConsumerComponent) => {\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.9",
|
|
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.9"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "2.4.2",
|
|
@@ -14,12 +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.465",
|
|
18
18
|
"@teambit/legacy-bit-id": "0.0.399",
|
|
19
19
|
"@teambit/component-issues": "0.0.49",
|
|
20
|
-
"@teambit/insights": "0.0.
|
|
21
|
-
"@teambit/issues": "0.0.
|
|
22
|
-
"@teambit/workspace": "0.0.
|
|
20
|
+
"@teambit/insights": "0.0.697",
|
|
21
|
+
"@teambit/issues": "0.0.5",
|
|
22
|
+
"@teambit/workspace": "0.0.697"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/mocha": "9.1.0",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@types/node": "12.20.4"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@teambit/legacy": "1.0.
|
|
33
|
+
"@teambit/legacy": "1.0.243",
|
|
34
34
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
35
35
|
"react": "^16.8.0 || ^17.0.0"
|
|
36
36
|
},
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"react": "-"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
|
-
"@teambit/legacy": "1.0.
|
|
61
|
+
"@teambit/legacy": "1.0.243",
|
|
62
62
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
63
63
|
"react": "^16.8.0 || ^17.0.0"
|
|
64
64
|
}
|
|
File without changes
|
|
Binary file
|