@teambit/workspace 0.0.813 → 0.0.816

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.
@@ -3,7 +3,7 @@ import LegacyGraph from '@teambit/legacy/dist/scope/graph/graph';
3
3
  import { BitId } from '@teambit/legacy-bit-id';
4
4
  import { Logger } from '@teambit/logger';
5
5
  import { Workspace } from './workspace';
6
- export declare type ShouldIgnoreFunc = (bitId: BitId) => Promise<boolean>;
6
+ export declare type ShouldLoadFunc = (bitId: BitId) => Promise<boolean>;
7
7
  export declare class GraphFromFsBuilder {
8
8
  private workspace;
9
9
  private logger;
@@ -14,7 +14,7 @@ export declare class GraphFromFsBuilder {
14
14
  private depth;
15
15
  private shouldThrowOnMissingDep;
16
16
  private consumer;
17
- constructor(workspace: Workspace, logger: Logger, ignoreIds?: BitIds, shouldLoadItsDeps?: ShouldIgnoreFunc | undefined);
17
+ constructor(workspace: Workspace, logger: Logger, ignoreIds?: BitIds, shouldLoadItsDeps?: ShouldLoadFunc | undefined);
18
18
  /**
19
19
  * create a graph with all dependencies and flattened dependencies of the given components.
20
20
  * the nodes are components and the edges has a label of the dependency type.
@@ -1 +1 @@
1
- {"version":3,"names":["GraphFromFsBuilder","constructor","workspace","logger","ignoreIds","BitIds","shouldLoadItsDeps","LegacyGraph","consumer","buildGraph","ids","debug","length","start","Date","now","components","loadManyComponents","processManyComponents","graph","getAllDepsUnfiltered","component","getAllDependenciesIds","difference","getAllDepsFiltered","depsWithoutIgnore","shouldLoadFunc","deps","mapSeries","depId","shouldLoad","push","fromArray","compact","depth","importObjects","allDependencies","processOneComponent","allDependenciesFlattened","flatten","allDeps","map","c","flat","allDepsWithScope","filter","dep","hasScope","scopeComponentsImporter","ScopeComponentsImporter","scope","importMany","uniqFromArray","throwForDependencyNotFound","shouldThrowOnMissingDep","idStr","id","toString","completed","includes","allIds","Object","entries","depsIdsGroupedByType","forEach","depType","depsIds","has","hasNode","Error","setEdge","componentsIds","dependenciesOf","comp","fromGraph","node","loadComponent","setNode","err","ComponentNotFound","BitError","error","componentId","componentMap","bitMap","getComponentIfExist","isOnWorkspace","Boolean","loadComponentForCapsule","componentFromModel","loadComponentFromModel","clone"],"sources":["build-graph-from-fs.ts"],"sourcesContent":["import mapSeries from 'p-map-series';\nimport { flatten } from 'lodash';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport BitIds from '@teambit/legacy/dist/bit-id/bit-ids';\nimport Component from '@teambit/legacy/dist/consumer/component/consumer-component';\nimport LegacyGraph from '@teambit/legacy/dist/scope/graph/graph';\nimport ScopeComponentsImporter from '@teambit/legacy/dist/scope/component-ops/scope-components-importer';\nimport compact from 'lodash.compact';\nimport { BitId } from '@teambit/legacy-bit-id';\nimport { Logger } from '@teambit/logger';\nimport { ComponentNotFound } from '@teambit/scope';\nimport { BitError } from '@teambit/bit-error';\nimport { Workspace } from './workspace';\n\nexport type ShouldIgnoreFunc = (bitId: BitId) => Promise<boolean>;\n\nexport class GraphFromFsBuilder {\n private graph = new LegacyGraph();\n private completed: string[] = [];\n private depth = 1;\n private shouldThrowOnMissingDep = true;\n private consumer: Consumer;\n constructor(\n private workspace: Workspace,\n private logger: Logger,\n private ignoreIds = new BitIds(),\n private shouldLoadItsDeps?: ShouldIgnoreFunc\n ) {\n this.consumer = this.workspace.consumer;\n }\n\n /**\n * create a graph with all dependencies and flattened dependencies of the given components.\n * the nodes are components and the edges has a label of the dependency type.\n *\n * the way how it is done is iterations by depths. each depth we gather all the dependencies of\n * that depths, make sure all objects exist and then check their dependencies for the next depth.\n * once there is no dependency left, we're on the last depth level and the graph is ready.\n *\n * for example, imagine the following graph:\n * A1 -> A2 -> A3\n * B1 -> B2 -> B3\n * C1 -> C2 -> C3\n *\n * where the buildGraph is given [A1, B1, C1].\n * first, it saves all these components as nodes in the graph. then, it finds the dependencies of\n * the next level, in this case they're [A2, B2, C2]. it runs `importMany` in case some objects\n * are missing. then, it loads them all (some from FS, some from the model) and sets the edges\n * between the component and the dependencies.\n * once done, it finds all their dependencies, which are [A3, B3, C3] and repeat the process\n * above. since there are no more dependencies, the graph is completed.\n * in this case, the total depth levels are 3.\n *\n * even with a huge project, there are not many depth levels. by iterating through depth levels\n * we keep performance sane as the importMany doesn't run multiple time and therefore the round\n * trips to the remotes are minimal.\n *\n * normally, one importMany of the seeders is enough as importMany knows to fetch all flattened.\n * however, since this buildGraph is performed on the workspace, a dependency may be new or\n * modified and as such, we don't know its flattened yet.\n */\n async buildGraph(ids: BitId[]): Promise<LegacyGraph> {\n this.logger.debug(`GraphFromFsBuilder, buildGraph with ${ids.length} seeders`);\n const start = Date.now();\n const components = await this.loadManyComponents(ids, '<none>');\n await this.processManyComponents(components);\n this.logger.debug(\n `GraphFromFsBuilder, buildGraph with ${ids.length} seeders completed (${(Date.now() - start) / 1000} sec)`\n );\n return this.graph;\n }\n\n private getAllDepsUnfiltered(component: Component) {\n return component.getAllDependenciesIds().difference(this.ignoreIds);\n }\n\n private async getAllDepsFiltered(component: Component): Promise<BitIds> {\n const depsWithoutIgnore = this.getAllDepsUnfiltered(component);\n const shouldLoadFunc = this.shouldLoadItsDeps;\n if (!shouldLoadFunc) return depsWithoutIgnore;\n const deps = await mapSeries(depsWithoutIgnore, async (depId) => {\n const shouldLoad = await shouldLoadFunc(depId);\n if (!shouldLoad) this.ignoreIds.push(depId);\n return shouldLoad ? depId : null;\n });\n return BitIds.fromArray(compact(deps));\n }\n\n private async processManyComponents(components: Component[]) {\n this.logger.debug(`GraphFromFsBuilder.processManyComponents depth ${this.depth}, ${components.length} components`);\n this.depth += 1;\n await this.importObjects(components);\n const allDependencies = await mapSeries(components, (component) => this.processOneComponent(component));\n const allDependenciesFlattened = flatten(allDependencies);\n if (allDependenciesFlattened.length) await this.processManyComponents(allDependenciesFlattened);\n }\n\n private async importObjects(components: Component[]) {\n const allDeps = components.map((c) => this.getAllDepsUnfiltered(c)).flat();\n const allDepsWithScope = allDeps.filter((dep) => dep.hasScope());\n const scopeComponentsImporter = new ScopeComponentsImporter(this.consumer.scope);\n await scopeComponentsImporter.importMany({\n ids: BitIds.uniqFromArray(allDepsWithScope),\n throwForDependencyNotFound: this.shouldThrowOnMissingDep,\n });\n }\n\n private async processOneComponent(component: Component) {\n const idStr = component.id.toString();\n if (this.completed.includes(idStr)) return [];\n const allIds = await this.getAllDepsFiltered(component);\n\n const allDependencies = await this.loadManyComponents(allIds, idStr);\n Object.entries(component.depsIdsGroupedByType).forEach(([depType, depsIds]) => {\n depsIds.forEach((depId) => {\n if (this.ignoreIds.has(depId)) return;\n if (!this.graph.hasNode(depId.toString())) {\n throw new Error(`buildOneComponent: missing node of ${depId.toString()}`);\n }\n this.graph.setEdge(idStr, depId.toString(), depType);\n });\n });\n this.completed.push(idStr);\n return allDependencies;\n }\n\n private async loadManyComponents(componentsIds: BitId[], dependenciesOf: string): Promise<Component[]> {\n const components = await mapSeries(componentsIds, async (comp: BitId) => {\n const idStr = comp.toString();\n const fromGraph = this.graph.node(idStr);\n if (fromGraph) return fromGraph;\n try {\n const component = await this.loadComponent(comp);\n this.graph.setNode(idStr, component);\n return component;\n } catch (err: any) {\n if (err instanceof ComponentNotFound) {\n throw new BitError(\n `error: component \"${idStr}\" was not found.\\nthis component is a dependency of \"${dependenciesOf}\" and is needed as part of the graph generation`\n );\n }\n this.logger.error(`failed loading dependencies of ${dependenciesOf}`);\n throw err;\n }\n });\n return components;\n }\n private async loadComponent(componentId: BitId): Promise<Component> {\n const componentMap = this.consumer.bitMap.getComponentIfExist(componentId);\n const isOnWorkspace = Boolean(componentMap);\n if (isOnWorkspace) {\n return this.consumer.loadComponentForCapsule(componentId);\n }\n // a dependency might have been installed as a package in the workspace, and as such doesn't\n // have a componentMap.\n const componentFromModel = await this.consumer.loadComponentFromModel(componentId);\n return componentFromModel.clone();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;E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AAMI,aAAa,GAAGC,OAAO,CAACJ,YAAD,CAA7B;;IACA,IAAIG,aAAJ,EAAmB;MACjB,OAAO,KAAK9E,QAAL,CAAcgF,uBAAd,CAAsCN,WAAtC,CAAP;IACD,CALiE,CAMlE;IACA;;;IACA,MAAMO,kBAAkB,GAAG,MAAM,KAAKjF,QAAL,CAAckF,sBAAd,CAAqCR,WAArC,CAAjC;IACA,OAAOO,kBAAkB,CAACE,KAAnB,EAAP;EACD;;AA7I6B"}
1
+ {"version":3,"names":["GraphFromFsBuilder","constructor","workspace","logger","ignoreIds","BitIds","shouldLoadItsDeps","LegacyGraph","consumer","buildGraph","ids","debug","length","start","Date","now","components","loadManyComponents","processManyComponents","graph","getAllDepsUnfiltered","component","getAllDependenciesIds","difference","getAllDepsFiltered","depsWithoutIgnore","shouldLoadFunc","deps","mapSeries","depId","shouldLoad","push","fromArray","compact","depth","importObjects","allDependencies","processOneComponent","allDependenciesFlattened","flatten","allDeps","map","c","flat","allDepsWithScope","filter","dep","hasScope","scopeComponentsImporter","ScopeComponentsImporter","scope","importMany","uniqFromArray","throwForDependencyNotFound","shouldThrowOnMissingDep","idStr","id","toString","completed","includes","allIds","Object","entries","depsIdsGroupedByType","forEach","depType","depsIds","has","hasNode","Error","setEdge","componentsIds","dependenciesOf","comp","fromGraph","node","loadComponent","setNode","err","ComponentNotFound","BitError","error","componentId","componentMap","bitMap","getComponentIfExist","isOnWorkspace","Boolean","loadComponentForCapsule","componentFromModel","loadComponentFromModel","clone"],"sources":["build-graph-from-fs.ts"],"sourcesContent":["import mapSeries from 'p-map-series';\nimport { flatten } from 'lodash';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport BitIds from '@teambit/legacy/dist/bit-id/bit-ids';\nimport Component from '@teambit/legacy/dist/consumer/component/consumer-component';\nimport LegacyGraph from '@teambit/legacy/dist/scope/graph/graph';\nimport ScopeComponentsImporter from '@teambit/legacy/dist/scope/component-ops/scope-components-importer';\nimport compact from 'lodash.compact';\nimport { BitId } from '@teambit/legacy-bit-id';\nimport { Logger } from '@teambit/logger';\nimport { ComponentNotFound } from '@teambit/scope';\nimport { BitError } from '@teambit/bit-error';\nimport { Workspace } from './workspace';\n\nexport type ShouldLoadFunc = (bitId: BitId) => Promise<boolean>;\n\nexport class GraphFromFsBuilder {\n private graph = new LegacyGraph();\n private completed: string[] = [];\n private depth = 1;\n private shouldThrowOnMissingDep = true;\n private consumer: Consumer;\n constructor(\n private workspace: Workspace,\n private logger: Logger,\n private ignoreIds = new BitIds(),\n private shouldLoadItsDeps?: ShouldLoadFunc\n ) {\n this.consumer = this.workspace.consumer;\n }\n\n /**\n * create a graph with all dependencies and flattened dependencies of the given components.\n * the nodes are components and the edges has a label of the dependency type.\n *\n * the way how it is done is iterations by depths. each depth we gather all the dependencies of\n * that depths, make sure all objects exist and then check their dependencies for the next depth.\n * once there is no dependency left, we're on the last depth level and the graph is ready.\n *\n * for example, imagine the following graph:\n * A1 -> A2 -> A3\n * B1 -> B2 -> B3\n * C1 -> C2 -> C3\n *\n * where the buildGraph is given [A1, B1, C1].\n * first, it saves all these components as nodes in the graph. then, it finds the dependencies of\n * the next level, in this case they're [A2, B2, C2]. it runs `importMany` in case some objects\n * are missing. then, it loads them all (some from FS, some from the model) and sets the edges\n * between the component and the dependencies.\n * once done, it finds all their dependencies, which are [A3, B3, C3] and repeat the process\n * above. since there are no more dependencies, the graph is completed.\n * in this case, the total depth levels are 3.\n *\n * even with a huge project, there are not many depth levels. by iterating through depth levels\n * we keep performance sane as the importMany doesn't run multiple time and therefore the round\n * trips to the remotes are minimal.\n *\n * normally, one importMany of the seeders is enough as importMany knows to fetch all flattened.\n * however, since this buildGraph is performed on the workspace, a dependency may be new or\n * modified and as such, we don't know its flattened yet.\n */\n async buildGraph(ids: BitId[]): Promise<LegacyGraph> {\n this.logger.debug(`GraphFromFsBuilder, buildGraph with ${ids.length} seeders`);\n const start = Date.now();\n const components = await this.loadManyComponents(ids, '<none>');\n await this.processManyComponents(components);\n this.logger.debug(\n `GraphFromFsBuilder, buildGraph with ${ids.length} seeders completed (${(Date.now() - start) / 1000} sec)`\n );\n return this.graph;\n }\n\n private getAllDepsUnfiltered(component: Component) {\n return component.getAllDependenciesIds().difference(this.ignoreIds);\n }\n\n private async getAllDepsFiltered(component: Component): Promise<BitIds> {\n const depsWithoutIgnore = this.getAllDepsUnfiltered(component);\n const shouldLoadFunc = this.shouldLoadItsDeps;\n if (!shouldLoadFunc) return depsWithoutIgnore;\n const deps = await mapSeries(depsWithoutIgnore, async (depId) => {\n const shouldLoad = await shouldLoadFunc(depId);\n if (!shouldLoad) this.ignoreIds.push(depId);\n return shouldLoad ? depId : null;\n });\n return BitIds.fromArray(compact(deps));\n }\n\n private async processManyComponents(components: Component[]) {\n this.logger.debug(`GraphFromFsBuilder.processManyComponents depth ${this.depth}, ${components.length} components`);\n this.depth += 1;\n await this.importObjects(components);\n const allDependencies = await mapSeries(components, (component) => this.processOneComponent(component));\n const allDependenciesFlattened = flatten(allDependencies);\n if (allDependenciesFlattened.length) await this.processManyComponents(allDependenciesFlattened);\n }\n\n private async importObjects(components: Component[]) {\n const allDeps = components.map((c) => this.getAllDepsUnfiltered(c)).flat();\n const allDepsWithScope = allDeps.filter((dep) => dep.hasScope());\n const scopeComponentsImporter = new ScopeComponentsImporter(this.consumer.scope);\n await scopeComponentsImporter.importMany({\n ids: BitIds.uniqFromArray(allDepsWithScope),\n throwForDependencyNotFound: this.shouldThrowOnMissingDep,\n });\n }\n\n private async processOneComponent(component: Component) {\n const idStr = component.id.toString();\n if (this.completed.includes(idStr)) return [];\n const allIds = await this.getAllDepsFiltered(component);\n\n const allDependencies = await this.loadManyComponents(allIds, idStr);\n Object.entries(component.depsIdsGroupedByType).forEach(([depType, depsIds]) => {\n depsIds.forEach((depId) => {\n if (this.ignoreIds.has(depId)) return;\n if (!this.graph.hasNode(depId.toString())) {\n throw new Error(`buildOneComponent: missing node of ${depId.toString()}`);\n }\n this.graph.setEdge(idStr, depId.toString(), depType);\n });\n });\n this.completed.push(idStr);\n return allDependencies;\n }\n\n private async loadManyComponents(componentsIds: BitId[], dependenciesOf: string): Promise<Component[]> {\n const components = await mapSeries(componentsIds, async (comp: BitId) => {\n const idStr = comp.toString();\n const fromGraph = this.graph.node(idStr);\n if (fromGraph) return fromGraph;\n try {\n const component = await this.loadComponent(comp);\n this.graph.setNode(idStr, component);\n return component;\n } catch (err: any) {\n if (err instanceof ComponentNotFound) {\n throw new BitError(\n `error: component \"${idStr}\" was not found.\\nthis component is a dependency of \"${dependenciesOf}\" and is needed as part of the graph generation`\n );\n }\n this.logger.error(`failed loading dependencies of ${dependenciesOf}`);\n throw err;\n }\n });\n return components;\n }\n private async loadComponent(componentId: BitId): Promise<Component> {\n const componentMap = this.consumer.bitMap.getComponentIfExist(componentId);\n const isOnWorkspace = Boolean(componentMap);\n if (isOnWorkspace) {\n return this.consumer.loadComponentForCapsule(componentId);\n }\n // a dependency might have been installed as a package in the workspace, and as such doesn't\n // have a componentMap.\n const componentFromModel = await this.consumer.loadComponentFromModel(componentId);\n return componentFromModel.clone();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAKO,MAAMA,kBAAN,CAAyB;EAM9BC,WAAW,CACDC,SADC,EAEDC,MAFC,EAGDC,SAAS,GAAG,KAAIC,iBAAJ,GAHX,EAIDC,iBAJC,EAKT;IAAA,KAJQJ,SAIR,GAJQ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P,IAAuB;MACvE,MAAMlB,KAAK,GAAGkB,IAAI,CAAChB,QAAL,EAAd;MACA,MAAMiB,SAAS,GAAG,KAAKvD,KAAL,CAAWwD,IAAX,CAAgBpB,KAAhB,CAAlB;MACA,IAAImB,SAAJ,EAAe,OAAOA,SAAP;;MACf,IAAI;QACF,MAAMrD,SAAS,GAAG,MAAM,KAAKuD,aAAL,CAAmBH,IAAnB,CAAxB;QACA,KAAKtD,KAAL,CAAW0D,OAAX,CAAmBtB,KAAnB,EAA0BlC,SAA1B;QACA,OAAOA,SAAP;MACD,CAJD,CAIE,OAAOyD,GAAP,EAAiB;QACjB,IAAIA,GAAG,YAAYC,0BAAnB,EAAsC;UACpC,MAAM,KAAIC,oBAAJ,EACH,qBAAoBzB,KAAM,wDAAuDiB,cAAe,iDAD7F,CAAN;QAGD;;QACD,KAAKrE,MAAL,CAAY8E,KAAZ,CAAmB,kCAAiCT,cAAe,EAAnE;QACA,MAAMM,GAAN;MACD;IACF,CAjBwB,CAAzB;IAkBA,OAAO9D,UAAP;EACD;;EAC0B,MAAb4D,aAAa,CAACM,WAAD,EAAyC;IAClE,MAAMC,YAAY,GAAG,KAAK3E,QAAL,CAAc4E,MAAd,CAAqBC,mBAArB,CAAyCH,WAAzC,CAArB;IACA,MAAMI,aAAa,GAAGC,OAAO,CAACJ,YAAD,CAA7B;;IACA,IAAIG,aAAJ,EAAmB;MACjB,OAAO,KAAK9E,QAAL,CAAcgF,uBAAd,CAAsCN,WAAtC,CAAP;IACD,CALiE,CAMlE;IACA;;;IACA,MAAMO,kBAAkB,GAAG,MAAM,KAAKjF,QAAL,CAAckF,sBAAd,CAAqCR,WAArC,CAAjC;IACA,OAAOO,kBAAkB,CAACE,KAAnB,EAAP;EACD;;AA7I6B"}
@@ -82,6 +82,9 @@ function WorkspaceOverview() {
82
82
  return /*#__PURE__*/_react().default.createElement("div", {
83
83
  className: _workspaceOverviewModule().default.container
84
84
  }, /*#__PURE__*/_react().default.createElement(_explorerUiGallery().ComponentGrid, null, components.map((component, index) => {
85
+ var _component$deprecatio;
86
+
87
+ if ((_component$deprecatio = component.deprecation) !== null && _component$deprecatio !== void 0 && _component$deprecatio.isDeprecate) return null;
85
88
  return /*#__PURE__*/_react().default.createElement(_workspaceUi2().WorkspaceComponentCard, {
86
89
  key: index,
87
90
  component: component
@@ -1 +1 @@
1
- {"version":3,"names":["WorkspaceOverview","workspace","useContext","WorkspaceContext","components","length","name","styles","container","map","component","index"],"sources":["workspace-overview.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport { ComponentGrid } from '@teambit/explorer.ui.gallery.component-grid';\nimport { EmptyWorkspace } from '@teambit/workspace.ui.empty-workspace';\nimport { WorkspaceComponentCard } from '@teambit/workspace.ui.workspace-component-card';\nimport { WorkspaceContext } from '../workspace-context';\nimport styles from './workspace-overview.module.scss';\n\nexport function WorkspaceOverview() {\n const workspace = useContext(WorkspaceContext);\n const { components } = workspace;\n if (!components || components.length === 0) return <EmptyWorkspace name={workspace.name} />;\n return (\n <div className={styles.container}>\n <ComponentGrid>\n {components.map((component, index) => {\n return <WorkspaceComponentCard key={index} component={component} />;\n })}\n </ComponentGrid>\n </div>\n );\n}\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;;;;;;AAEO,SAASA,iBAAT,GAA6B;EAClC,MAAMC,SAAS,GAAG,IAAAC,mBAAA,EAAWC,oCAAX,CAAlB;EACA,MAAM;IAAEC;EAAF,IAAiBH,SAAvB;EACA,IAAI,CAACG,UAAD,IAAeA,UAAU,CAACC,MAAX,KAAsB,CAAzC,EAA4C,oBAAO,+BAAC,6BAAD;IAAgB,IAAI,EAAEJ,SAAS,CAACK;EAAhC,EAAP;EAC5C,oBACE;IAAK,SAAS,EAAEC,kCAAA,CAAOC;EAAvB,gBACE,+BAAC,kCAAD,QACGJ,UAAU,CAACK,GAAX,CAAe,CAACC,SAAD,EAAYC,KAAZ,KAAsB;IACpC,oBAAO,+BAAC,sCAAD;MAAwB,GAAG,EAAEA,KAA7B;MAAoC,SAAS,EAAED;IAA/C,EAAP;EACD,CAFA,CADH,CADF,CADF;AASD"}
1
+ {"version":3,"names":["WorkspaceOverview","workspace","useContext","WorkspaceContext","components","length","name","styles","container","map","component","index","deprecation","isDeprecate"],"sources":["workspace-overview.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport { ComponentGrid } from '@teambit/explorer.ui.gallery.component-grid';\nimport { EmptyWorkspace } from '@teambit/workspace.ui.empty-workspace';\nimport { WorkspaceComponentCard } from '@teambit/workspace.ui.workspace-component-card';\nimport { WorkspaceContext } from '../workspace-context';\nimport styles from './workspace-overview.module.scss';\n\nexport function WorkspaceOverview() {\n const workspace = useContext(WorkspaceContext);\n const { components } = workspace;\n if (!components || components.length === 0) return <EmptyWorkspace name={workspace.name} />;\n return (\n <div className={styles.container}>\n <ComponentGrid>\n {components.map((component, index) => {\n if (component.deprecation?.isDeprecate) return null;\n return <WorkspaceComponentCard key={index} component={component} />;\n })}\n </ComponentGrid>\n </div>\n );\n}\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;;;;;;AAEO,SAASA,iBAAT,GAA6B;EAClC,MAAMC,SAAS,GAAG,IAAAC,mBAAA,EAAWC,oCAAX,CAAlB;EACA,MAAM;IAAEC;EAAF,IAAiBH,SAAvB;EACA,IAAI,CAACG,UAAD,IAAeA,UAAU,CAACC,MAAX,KAAsB,CAAzC,EAA4C,oBAAO,+BAAC,6BAAD;IAAgB,IAAI,EAAEJ,SAAS,CAACK;EAAhC,EAAP;EAC5C,oBACE;IAAK,SAAS,EAAEC,kCAAA,CAAOC;EAAvB,gBACE,+BAAC,kCAAD,QACGJ,UAAU,CAACK,GAAX,CAAe,CAACC,SAAD,EAAYC,KAAZ,KAAsB;IAAA;;IACpC,6BAAID,SAAS,CAACE,WAAd,kDAAI,sBAAuBC,WAA3B,EAAwC,OAAO,IAAP;IACxC,oBAAO,+BAAC,sCAAD;MAAwB,GAAG,EAAEF,KAA7B;MAAoC,SAAS,EAAED;IAA/C,EAAP;EACD,CAHA,CADH,CADF,CADF;AAUD"}
@@ -33,7 +33,7 @@ import { Watcher, WatchOptions } from './watch/watcher';
33
33
  import { ComponentStatus } from './workspace-component/component-status';
34
34
  import { OnComponentAddSlot, OnComponentChangeSlot, OnComponentLoadSlot, OnComponentRemoveSlot, OnPreWatch, OnPreWatchSlot } from './workspace.provider';
35
35
  import { WorkspaceComponentLoader } from './workspace-component/workspace-component-loader';
36
- import { ShouldIgnoreFunc } from './build-graph-from-fs';
36
+ import { ShouldLoadFunc } from './build-graph-from-fs';
37
37
  import { BitMap } from './bit-map';
38
38
  export declare type EjectConfResult = {
39
39
  configPath: string;
@@ -68,7 +68,7 @@ export declare type TrackData = {
68
68
  [aspectName: string]: any;
69
69
  };
70
70
  };
71
- export declare type ExtensionsOrigin = 'BitmapFile' | 'ModelSpecific' | 'ModelNonSpecific' | 'WorkspaceVariants' | 'ComponentJsonFile' | 'WorkspaceDefault' | 'FinalAfterMerge';
71
+ export declare type ExtensionsOrigin = 'BitmapFile' | 'ModelSpecific' | 'ModelNonSpecific' | 'UnmergedSpecific' | 'UnmergedNonSpecific' | 'WorkspaceVariants' | 'ComponentJsonFile' | 'WorkspaceDefault' | 'FinalAfterMerge';
72
72
  export declare type TrackResult = {
73
73
  componentName: string;
74
74
  files: string[];
@@ -380,6 +380,7 @@ export declare class Workspace implements ComponentFactory {
380
380
  extraData: any;
381
381
  }>;
382
382
  }>;
383
+ private getUnmergedHead;
383
384
  private warnAboutMisconfiguredEnv;
384
385
  isModified(component: Component): Promise<boolean>;
385
386
  private filterEnvsFromExtensionsIfNeeded;
@@ -407,7 +408,7 @@ export declare class Workspace implements ComponentFactory {
407
408
  */
408
409
  private componentConfigFile;
409
410
  private componentConfigFileFromComponentDirAndName;
410
- getAspectsGraphWithoutCore(components: Component[], isAspect?: ShouldIgnoreFunc): Promise<LegacyGraph>;
411
+ getAspectsGraphWithoutCore(components: Component[], isAspect?: ShouldLoadFunc): Promise<LegacyGraph>;
411
412
  /**
412
413
  * load aspects from the workspace and if not exists in the workspace, load from the scope.
413
414
  * keep in mind that the graph may have circles.
@@ -418,7 +419,7 @@ export declare class Workspace implements ComponentFactory {
418
419
  * returns one graph that includes all dependencies types. each edge has a label of the dependency
419
420
  * type. the nodes content is the Component object.
420
421
  */
421
- buildOneGraphForComponents(ids: BitId[], ignoreIds?: BitIds, shouldIgnoreFunc?: ShouldIgnoreFunc): Promise<LegacyGraph>;
422
+ buildOneGraphForComponents(ids: BitId[], ignoreIds?: BitIds, shouldLoadFunc?: ShouldLoadFunc): Promise<LegacyGraph>;
422
423
  resolveAspects(runtimeName?: string, componentIds?: ComponentID[], opts?: ResolveAspectsOptions): Promise<AspectDefinition[]>;
423
424
  private groupIdsByWorkspaceAndScope;
424
425
  private groupComponentsByWorkspaceAndScope;
package/dist/workspace.js CHANGED
@@ -1442,6 +1442,7 @@ the following envs are used in this workspace: ${availableEnvs.join(', ')}`);
1442
1442
  * defaults extensions from workspace config
1443
1443
  * extensions from the model.
1444
1444
  */
1445
+ // eslint-disable-next-line complexity
1445
1446
 
1446
1447
 
1447
1448
  async componentExtensions(componentId, componentFromScope, excludeOrigins = []) {
@@ -1454,6 +1455,19 @@ the following envs are used in this workspace: ${availableEnvs.join(', ')}`);
1454
1455
  const mergeFromScope = true;
1455
1456
  const bitMapEntry = this.consumer.bitMap.getComponentIfExist(componentId._legacy);
1456
1457
  const bitMapExtensions = bitMapEntry === null || bitMapEntry === void 0 ? void 0 : bitMapEntry.config;
1458
+ const unmergedHead = this.getUnmergedHead(componentId);
1459
+ let unmergedExtensions;
1460
+ let unmergedExtensionsSpecific;
1461
+ let unmergedExtensionsNonSpecific;
1462
+
1463
+ if (unmergedHead) {
1464
+ const versionInstance = await this.scope.legacyScope.getVersionInstance(componentId._legacy.changeVersion(unmergedHead.toString()));
1465
+ unmergedExtensions = versionInstance.extensions;
1466
+ const [specific, nonSpecific] = (0, _lodash().partition)(unmergedExtensions, entry => entry.config[AspectSpecificField] === true);
1467
+ unmergedExtensionsSpecific = new (_extensionData().ExtensionDataList)(...specific);
1468
+ unmergedExtensionsNonSpecific = new (_extensionData().ExtensionDataList)(...nonSpecific);
1469
+ }
1470
+
1457
1471
  const scopeExtensions = (componentFromScope === null || componentFromScope === void 0 ? void 0 : (_componentFromScope$c = componentFromScope.config) === null || _componentFromScope$c === void 0 ? void 0 : _componentFromScope$c.extensions) || new (_extensionData().ExtensionDataList)();
1458
1472
  const [specific, nonSpecific] = (0, _lodash().partition)(scopeExtensions, entry => entry.config[AspectSpecificField] === true);
1459
1473
  const scopeExtensionsNonSpecific = new (_extensionData().ExtensionDataList)(...nonSpecific);
@@ -1546,6 +1560,10 @@ the following envs are used in this workspace: ${availableEnvs.join(', ')}`);
1546
1560
  await addAndLoadExtensions(configFileExtensions, 'ComponentJsonFile');
1547
1561
  }
1548
1562
 
1563
+ if (unmergedExtensionsSpecific && !excludeOrigins.includes('UnmergedSpecific')) {
1564
+ await addAndLoadExtensions(_extensionData().ExtensionDataList.fromArray(unmergedExtensionsSpecific), 'UnmergedSpecific');
1565
+ }
1566
+
1549
1567
  if (!excludeOrigins.includes('ModelSpecific')) {
1550
1568
  await addAndLoadExtensions(_extensionData().ExtensionDataList.fromArray(scopeExtensionsSpecific), 'ModelSpecific');
1551
1569
  }
@@ -1573,6 +1591,10 @@ the following envs are used in this workspace: ${availableEnvs.join(', ')}`);
1573
1591
  await addAndLoadExtensions(wsDefaultExtensions, 'WorkspaceDefault');
1574
1592
  }
1575
1593
 
1594
+ if (unmergedExtensionsNonSpecific && mergeFromScope && continuePropagating && !excludeOrigins.includes('UnmergedNonSpecific')) {
1595
+ await addAndLoadExtensions(unmergedExtensionsNonSpecific, 'UnmergedNonSpecific');
1596
+ }
1597
+
1576
1598
  if (mergeFromScope && continuePropagating && !excludeOrigins.includes('ModelNonSpecific')) {
1577
1599
  await addAndLoadExtensions(scopeExtensionsNonSpecific, 'ModelNonSpecific');
1578
1600
  } // It's important to do this resolution before the merge, otherwise we have issues with extensions
@@ -1593,6 +1615,11 @@ the following envs are used in this workspace: ${availableEnvs.join(', ')}`);
1593
1615
  };
1594
1616
  }
1595
1617
 
1618
+ getUnmergedHead(componentId) {
1619
+ const unmerged = this.scope.legacyScope.objects.unmergedComponents.getEntry(componentId._legacy.name);
1620
+ return unmerged === null || unmerged === void 0 ? void 0 : unmerged.head;
1621
+ }
1622
+
1596
1623
  async warnAboutMisconfiguredEnv(componentId, extensionDataList) {
1597
1624
  if (!(await this.hasId(componentId))) {
1598
1625
  // if this is a dependency and not belong to the workspace, don't show the warning
@@ -1852,7 +1879,10 @@ the following envs are used in this workspace: ${availableEnvs.join(', ')}`);
1852
1879
 
1853
1880
 
1854
1881
  async loadAspects(ids = [], throwOnError = false, neededFor) {
1855
- this.logger.info(`loadAspects, loading ${ids.length} aspects.
1882
+ // generate a random callId to be able to identify the call from the logs
1883
+ const callId = Math.floor(Math.random() * 1000);
1884
+ const loggerPrefix = `[${callId}] loadAspects,`;
1885
+ this.logger.info(`${loggerPrefix} loading ${ids.length} aspects.
1856
1886
  ids: ${ids.join(', ')}
1857
1887
  needed-for: ${neededFor || '<unknown>'}`);
1858
1888
  const notLoadedIds = ids.filter(id => !this.aspectLoader.isAspectLoaded(id));
@@ -1888,12 +1918,15 @@ needed-for: ${neededFor || '<unknown>'}`);
1888
1918
 
1889
1919
  const graph = await this.getAspectsGraphWithoutCore(components, isAspect);
1890
1920
  const idsStr = graph.nodes();
1921
+ this.logger.debug(`${loggerPrefix} found ${idsStr.length} aspects in the aspects-graph`);
1891
1922
  const compIds = await this.resolveMultipleComponentIds(idsStr);
1892
1923
  const aspects = await this.getMany(compIds);
1893
1924
  const {
1894
1925
  workspaceComps,
1895
1926
  scopeComps
1896
1927
  } = await this.groupComponentsByWorkspaceAndScope(aspects);
1928
+ this.logger.debug(`${loggerPrefix} found ${workspaceComps.length} components in the workspace:\n${workspaceComps.map(c => c.id.toString()).join('\n')}`);
1929
+ this.logger.debug(`${loggerPrefix} ${scopeComps.length} components are not in the workspace and are loaded from the scope:\n${scopeComps.map(c => c.id.toString()).join('\n')}`);
1897
1930
  const scopeIds = scopeComps.map(aspect => aspect.id.toString());
1898
1931
  const workspaceAspects = await this.requireComponents(workspaceComps);
1899
1932
  const workspaceManifests = await this.aspectLoader.getManifestsFromRequireableExtensions(workspaceAspects, throwOnError);
@@ -1920,6 +1953,7 @@ needed-for: ${neededFor || '<unknown>'}`);
1920
1953
  const pluginsWorkspaceAspects = await this.requireComponents(pluginsWorkspaceComps);
1921
1954
  const pluginsWorkspaceManifests = await this.aspectLoader.getManifestsFromRequireableExtensions(pluginsWorkspaceAspects, throwOnError);
1922
1955
  await this.aspectLoader.loadExtensionsByManifests(pluginsWorkspaceManifests, throwOnError);
1956
+ this.logger.debug(`${loggerPrefix} finish loading aspects`);
1923
1957
  return (0, _lodash().compact)(scopeEnvsManifestsIds.concat(scopeOtherManifestsIds).concat(workspaceManifestsIds));
1924
1958
  }
1925
1959
  /**
@@ -1929,8 +1963,8 @@ needed-for: ${neededFor || '<unknown>'}`);
1929
1963
  */
1930
1964
 
1931
1965
 
1932
- async buildOneGraphForComponents(ids, ignoreIds, shouldIgnoreFunc) {
1933
- const graphFromFsBuilder = new (_buildGraphFromFs().GraphFromFsBuilder)(this, this.logger, ignoreIds, shouldIgnoreFunc);
1966
+ async buildOneGraphForComponents(ids, ignoreIds, shouldLoadFunc) {
1967
+ const graphFromFsBuilder = new (_buildGraphFromFs().GraphFromFsBuilder)(this, this.logger, ignoreIds, shouldLoadFunc);
1934
1968
  return graphFromFsBuilder.buildGraph(ids);
1935
1969
  }
1936
1970
 
@@ -2043,8 +2077,6 @@ needed-for: ${neededFor || '<unknown>'}`);
2043
2077
  const existOnWorkspace = await this.hasId(component.id);
2044
2078
  existOnWorkspace ? workspaceComps.push(component) : scopeComps.push(component);
2045
2079
  }));
2046
- this.logger.debug(`loadAspects, found ${workspaceComps.length} components in the workspace:\n${workspaceComps.map(c => c.id.toString()).join('\n')}`);
2047
- this.logger.debug(`loadAspects, ${scopeComps.length} components are not in the workspace and are loaded from the scope:\n${scopeComps.map(c => c.id.toString()).join('\n')}`);
2048
2080
  return {
2049
2081
  workspaceComps,
2050
2082
  scopeComps