@teambit/workspace 1.0.114 → 1.0.116
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/artifacts/preview/static/css/teambit.workspace/{workspace-preview.02f9235c.css → workspace-preview.10745253.css} +2 -2
- package/artifacts/preview/teambit_workspace_workspace-preview.js +1 -1
- package/dist/component-tree.widget.d.ts +1 -0
- package/dist/{preview-1703992959524.js → preview-1704113440840.js} +2 -2
- package/dist/ui/workspace/use-workspace.js +11 -0
- package/dist/ui/workspace/use-workspace.js.map +1 -1
- package/dist/ui/workspace/workspace-model.d.ts +3 -1
- package/dist/ui/workspace/workspace-model.js +15 -3
- package/dist/ui/workspace/workspace-model.js.map +1 -1
- package/dist/ui/workspace/workspace-overview/link-plugin.d.ts +3 -0
- package/dist/ui/workspace/workspace-overview/link-plugin.js +14 -0
- package/dist/ui/workspace/workspace-overview/link-plugin.js.map +1 -0
- package/dist/ui/workspace/workspace-overview/workspace-overview.d.ts +6 -0
- package/dist/ui/workspace/workspace-overview/workspace-overview.js +107 -8
- package/dist/ui/workspace/workspace-overview/workspace-overview.js.map +1 -1
- package/dist/ui/workspace/workspace-overview/workspace-overview.module.scss +31 -0
- package/dist/ui/workspace/workspace.d.ts +1 -0
- package/dist/workspace-component/workspace-component-loader.js +25 -1
- package/dist/workspace-component/workspace-component-loader.js.map +1 -1
- package/dist/workspace.composition.d.ts +1 -0
- package/dist/workspace.js +1 -3
- package/dist/workspace.js.map +1 -1
- package/dist/workspace.ui.runtime.d.ts +7 -3
- package/dist/workspace.ui.runtime.js +10 -5
- package/dist/workspace.ui.runtime.js.map +1 -1
- package/package.json +26 -22
- package/ui/workspace/use-workspace.ts +11 -0
- package/ui/workspace/workspace-model.ts +11 -2
- package/ui/workspace/workspace-overview/link-plugin.ts +5 -0
- package/ui/workspace/workspace-overview/workspace-overview.module.scss +31 -0
- package/ui/workspace/workspace-overview/workspace-overview.tsx +71 -4
- package/workspace-component/workspace-component-loader.ts +24 -1
- package/workspace.ui.runtime.tsx +24 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","data","_interopRequireWildcard","require","_explorerUiGallery","_workspaceUi","_workspaceUi2","_workspaceContext","_workspaceOverviewModule","_interopRequireDefault","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","WorkspaceOverview","workspace","useContext","WorkspaceContext","components","length","createElement","EmptyWorkspace","name","className","styles","container","ComponentGrid","map","component","index","deprecation","isDeprecate","WorkspaceComponentCard","key"],"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,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,uBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,mBAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,kBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,aAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,YAAA,YAAAA,CAAA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1
|
+
{"version":3,"names":["_react","data","_interopRequireWildcard","require","_explorerUiGallery","_workspaceUi","_previewUi","_designUi","_componentId","_cloudHooks","_scopes","_explorerUi","_workspaceContext","_workspaceOverviewModule","_interopRequireDefault","_linkPlugin","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","WorkspaceOverview","workspace","useContext","WorkspaceContext","compModelsById","Map","components","map","comp","id","toString","componentDescriptors","uniqueScopes","Set","c","scope","uniqueScopesArr","Array","from","cloudScopes","useCloudScopes","cloudScopesById","plugins","useCardPlugins","length","createElement","EmptyWorkspace","name","compDescriptorById","className","styles","container","ComponentGrid","component","deprecation","isDeprecate","compDescriptor","cloudScope","ScopeID","isValid","fromString","undefined","ComponentCard","key","displayOwnerDetails","React","useMemo","preview","Preview","compModel","PreviewPlaceholder","componentDescriptor","previewBottomRight","PreviewBottomRight","env","envComponentId","ComponentID","rightPreviewPlugins","badge","Tooltip","delay","content","src","icon","envIcon","LinkPlugin","size"],"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 { PreviewPlaceholder } from '@teambit/preview.ui.preview-placeholder';\nimport { Tooltip } from '@teambit/design.ui.tooltip';\nimport { ComponentID } from '@teambit/component-id';\nimport { ComponentModel } from '@teambit/component';\nimport { useCloudScopes } from '@teambit/cloud.hooks.use-cloud-scopes';\nimport { ScopeID } from '@teambit/scopes.scope-id';\nimport { ComponentCard, ComponentCardPluginType, PluginProps } from '@teambit/explorer.ui.component-card';\nimport { WorkspaceContext } from '../workspace-context';\nimport styles from './workspace-overview.module.scss';\nimport { LinkPlugin } from './link-plugin';\n\nexport function WorkspaceOverview() {\n const workspace = useContext(WorkspaceContext);\n const compModelsById = new Map(workspace.components.map((comp) => [comp.id.toString(), comp]));\n const { components, componentDescriptors } = workspace;\n const uniqueScopes = new Set(components.map((c) => c.id.scope));\n const uniqueScopesArr = Array.from(uniqueScopes);\n const { cloudScopes = [] } = useCloudScopes(uniqueScopesArr);\n const cloudScopesById = new Map(cloudScopes.map((scope) => [scope.id.toString(), scope]));\n const plugins = useCardPlugins({ compModelsById });\n if (!components || components.length === 0) return <EmptyWorkspace name={workspace.name} />;\n const compDescriptorById = new Map(componentDescriptors.map((comp) => [comp.id.toString(), comp]));\n return (\n <div className={styles.container}>\n <ComponentGrid>\n {components.map((component) => {\n if (component.deprecation?.isDeprecate) return null;\n const compDescriptor = compDescriptorById.get(component.id.toString());\n if (!compDescriptor) return null;\n const cloudScope = cloudScopesById.get(component.id.scope);\n const scope =\n cloudScope ||\n (ScopeID.isValid(component.id.scope) && { id: ScopeID.fromString(component.id.scope) }) ||\n undefined;\n return (\n <ComponentCard\n key={component.id.toString()}\n component={compDescriptor}\n plugins={plugins}\n displayOwnerDetails=\"all\"\n scope={scope}\n />\n );\n })}\n </ComponentGrid>\n </div>\n );\n}\n\nexport function useCardPlugins({\n compModelsById,\n}: {\n compModelsById: Map<string, ComponentModel>;\n}): ComponentCardPluginType<PluginProps>[] {\n const plugins = React.useMemo(\n () => [\n {\n preview: function Preview({ component }) {\n const compModel = compModelsById.get(component.id.toString());\n if (!compModel) return null;\n return <PreviewPlaceholder componentDescriptor={component} component={compModel} />;\n },\n },\n {\n previewBottomRight: function PreviewBottomRight({ component }) {\n const env = component.get('teambit.envs/envs');\n const envComponentId = env?.id ? ComponentID.fromString(env?.id) : undefined;\n\n return (\n <div className={styles.rightPreviewPlugins}>\n <div className={styles.badge}>\n <Tooltip delay={300} content={envComponentId?.name}>\n <img src={env?.icon} className={styles.envIcon} />\n </Tooltip>\n </div>\n </div>\n );\n },\n },\n new LinkPlugin(),\n ],\n [compModelsById.size]\n );\n\n return plugins;\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,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,SAAS,EAAEC,kCAAM,CAACkC;MAAQ,CAAE,CAC1C,CACN,CACF,CAAC;IAEV;EACF,CAAC,EACD,KAAIC,wBAAU,EAAC,CAAC,CACjB,EACD,CAAC7D,cAAc,CAAC8D,IAAI,CACtB,CAAC;EAED,OAAO5C,OAAO;AAChB"}
|
|
@@ -4,3 +4,34 @@
|
|
|
4
4
|
height: 100%;
|
|
5
5
|
box-sizing: border-box;
|
|
6
6
|
}
|
|
7
|
+
|
|
8
|
+
.rightPreviewPlugins {
|
|
9
|
+
// background-color: var(--surface-color);
|
|
10
|
+
display: flex;
|
|
11
|
+
// box-shadow: 0px 2px 48px rgb(0 0 0 / 89%);
|
|
12
|
+
// box-shadow: 0px 2px 160px rgb(0 0 0 / 52%);
|
|
13
|
+
// border-radius: 8px;
|
|
14
|
+
// padding: 4px;
|
|
15
|
+
align-items: flex-end;
|
|
16
|
+
justify-content: flex-end;
|
|
17
|
+
width: 100%;
|
|
18
|
+
height: 100%;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.envIcon {
|
|
22
|
+
// padding-right: 4px;
|
|
23
|
+
// height: 24px;
|
|
24
|
+
height: 14px;
|
|
25
|
+
// padding-top: 2px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.badge {
|
|
29
|
+
background-color: var(--surface-color);
|
|
30
|
+
padding: 4px;
|
|
31
|
+
height: 15px;
|
|
32
|
+
margin-right: 4px;
|
|
33
|
+
z-index: 100;
|
|
34
|
+
border-radius: 8px;
|
|
35
|
+
margin-bottom: 4px;
|
|
36
|
+
box-shadow: 0px 2px 18px rgb(0 0 0 / 10%);
|
|
37
|
+
}
|
|
@@ -223,6 +223,10 @@ class WorkspaceComponentLoader {
|
|
|
223
223
|
};
|
|
224
224
|
const workspaceScopeIdsMap = await this.groupAndUpdateIds(ids);
|
|
225
225
|
const groupsToHandle = await this.buildLoadGroups(workspaceScopeIdsMap);
|
|
226
|
+
// prefix your command with "BIT_LOG=*" to see the detailed groups
|
|
227
|
+
if (process.env.BIT_LOG) {
|
|
228
|
+
printGroupsToHandle(groupsToHandle, this.logger);
|
|
229
|
+
}
|
|
226
230
|
const groupsRes = (0, _lodash().compact)(await (0, _pMapSeries().default)(groupsToHandle, async group => {
|
|
227
231
|
const {
|
|
228
232
|
scopeIds,
|
|
@@ -414,7 +418,9 @@ class WorkspaceComponentLoader {
|
|
|
414
418
|
});
|
|
415
419
|
if (!aspectIds.length) return;
|
|
416
420
|
try {
|
|
417
|
-
await this.workspace.loadAspects(aspectIds, true, 'self loading aspects', {
|
|
421
|
+
await this.workspace.loadAspects(aspectIds, true, 'self loading aspects', {
|
|
422
|
+
useScopeAspectsCapsule: true
|
|
423
|
+
});
|
|
418
424
|
} catch (err) {
|
|
419
425
|
this.logger.warn(`failed loading components as aspects for components ${aspectIds.join(', ')}`, err);
|
|
420
426
|
// we ignore that errors at the moment
|
|
@@ -824,5 +830,23 @@ function createComponentCacheKey(id, loadOpts) {
|
|
|
824
830
|
function sortKeys(obj) {
|
|
825
831
|
return (0, _lodash().fromPairs)(Object.entries(obj).sort(([k1], [k2]) => k1.localeCompare(k2)));
|
|
826
832
|
}
|
|
833
|
+
function printGroupsToHandle(groupsToHandle, logger) {
|
|
834
|
+
groupsToHandle.forEach(group => {
|
|
835
|
+
const {
|
|
836
|
+
scopeIds,
|
|
837
|
+
workspaceIds,
|
|
838
|
+
aspects,
|
|
839
|
+
core,
|
|
840
|
+
seeders
|
|
841
|
+
} = group;
|
|
842
|
+
logger.console(`workspace-component-loader ~ groupsToHandle ${JSON.stringify({
|
|
843
|
+
scopeIds: scopeIds.map(id => id.toString()),
|
|
844
|
+
workspaceIds: workspaceIds.map(id => id.toString()),
|
|
845
|
+
aspects,
|
|
846
|
+
core,
|
|
847
|
+
seeders
|
|
848
|
+
}, null, 2)}`);
|
|
849
|
+
});
|
|
850
|
+
}
|
|
827
851
|
|
|
828
852
|
//# sourceMappingURL=workspace-component-loader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_pMap","data","_interopRequireDefault","require","_concurrency","_component","_componentId","_pMapSeries","_lodash","_component2","_exceptions","_utils","_componentIssues","_exceptions2","_dependencyResolver","_envs","_config","_inMemoryCache","_cacheFactory","_componentNotFoundInPath","_workspaceComponent","_mergeConfigConflict","obj","__esModule","default","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","key","value","_toPropertyKey","configurable","writable","i","_toPrimitive","String","Symbol","toPrimitive","call","TypeError","Number","WorkspaceComponentLoader","constructor","workspace","logger","dependencyResolver","envs","aspectLoader","componentsCache","createInMemoryCache","maxSize","getMaxSizeForComponents","scopeComponentsCache","componentsExtensionsCache","componentLoadedSelfAsAspects","getMany","ids","loadOpts","throwOnFailure","idsWithoutEmpty","compact","setStatusLine","loadOptsWithDefaults","assign","loadExtensions","executeLoadSlot","loadSeedersAsAspects","resolveExtensionsVersions","loadOrCached","idsToLoad","fromCache","id","componentFromCache","getFromCache","components","loadedComponents","invalidComponents","getAndLoadSlotOrdered","workspaceScopeIdsMap","groupAndUpdateIds","groupsToHandle","buildLoadGroups","groupsRes","mapSeries","group","scopeIds","workspaceIds","aspects","core","seeders","undefined","res","getAndLoadSlot","finalRes","reduce","acc","curr","allIds","values","groupedByIsCoreEnvs","groupBy","isCoreEnv","toStringWithoutVersion","nonCoreEnvs","false","populateScopeAndExtensionsCache","allExtIds","Map","idStr","toString","get","extensions","ext","has","stringId","newExtensionId","set","allExtCompIds","Array","from","allExtIdsStr","map","groupedByIsExtOfAnother","includes","extIdsFromTheList","true","extsNotFromTheList","entries","layerdExtFromTheList","regroupExtIdsFromTheList","layerdExtGroups","groupsByWsScope","groupedByWsScope","workspaceComponents","scopeComponents","getComponentsWithoutLoadExtensions","concat","allExtensions","component","state","_consumer","mergedExtensions","ExtensionDataList","mergeConfigs","loadComponentsExtensions","wsComponentsWithAspects","pMap","concurrency","concurrentComponentsLimit","warnAboutMisconfiguredEnvs","withAspects","loadCompsAsAspects","loadApps","loadEnvs","loadAspects","idsToNotLoadAsAspects","opts","aspectIds","firstTimeToLoad","excluded","isCore","isCoreAspect","alreadyLoaded","isAspectLoaded","skipLoading","appData","appName","envsData","EnvsAspect","services","self","type","err","warn","join","componentFromScope","scope","wsAspectLoader","getWorkspaceAspectsLoader","throwWsJsoncAspectNotFoundError","errors","componentExtensions","uniq","getEnvId","Promise","all","envId","warnAboutMisconfiguredEnv","existingGroups","result","componentId","inWs","isInWsIncludeDeleted","resolvedVersions","resolveVersion","nonDeletedWsIds","listIds","deletedWsIds","locallyDeletedIds","allWsIds","find","isEqual","ignoreVersion","hasVersion","idsIndex","legacyComponents","legacyInvalidComponents","removedComponents","consumer","loadComponents","ComponentIdList","fromArray","allLegacyComponents","invalidComponent","entry","error","ConsumerComponent","isComponentInvalidByErrorType","isComponentNotExistsError","ComponentNotFoundInPath","getWithCatch","legacyComponent","catch","componentsP","withoutVersion","changeVersion","version","console","loadMany","getInvalid","longProcessLogger","createLongProcessLogger","logProgress","loadComponent","useCache","storeInCache","getOpts","resolveIdVersion","consumerComponent","getConsumerComponent","updatedId","loadOne","addMultipleEnvsIssueIfNeeded","saveInCache","getIfExist","bitIdWithVersion","getLatestVersionNumber","bitmapIdsFromCurrentLaneIncludeRemoved","getAllEnvsConfiguredOnComponent","envIds","env","issues","getOrCreate","IssuesClasses","MultipleEnvs","clearCache","deleteAll","clearComponentCache","cachesToClear","cache","cacheKey","startsWith","delete","MissingBitMapComponent","extErrorsFromCache","some","MergeConfigConflict","MergeConfigHasConflict","State","Config","createAspectList","ComponentFS","fromVinyls","files","dependencies","workspaceComponent","WorkspaceComponent","head","tags","newComponent","newComponentFromState","createComponentCacheKey","cacheKeyWithTrueLoadOpts","originatedFromHarmony","debug","name","message","ComponentNotFound","removed","calcDescriptor","skipWarnings","inInstallContext","policy","mergeVariantPolicies","config","dependenciesList","extractDepsFromLegacy","depResolverData","packageName","calcPackageName","serialize","upsertExtensionData","DependencyResolverAspect","aspectListWithEnvsAndDeps","onComponentLoadSlot","toArray","extension","onLoad","upsertEntry","resolveComponentId","TagMap","existingExtension","findExtension","getDataEntry","ExtensionDataEntry","exports","relevantOpts","pick","JSON","stringify","sortKeys","fromPairs","sort","k1","k2","localeCompare"],"sources":["workspace-component-loader.ts"],"sourcesContent":["import pMap from 'p-map';\nimport { concurrentComponentsLimit } from '@teambit/legacy/dist/utils/concurrency';\nimport { Component, ComponentFS, Config, InvalidComponent, State, TagMap } from '@teambit/component';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport mapSeries from 'p-map-series';\nimport { compact, fromPairs, groupBy, pick, uniq } from 'lodash';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component';\nimport { MissingBitMapComponent } from '@teambit/legacy/dist/consumer/bit-map/exceptions';\nimport { getLatestVersionNumber } from '@teambit/legacy/dist/utils';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport { ComponentNotFound } from '@teambit/legacy/dist/scope/exceptions';\nimport { DependencyResolverAspect, DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { Logger } from '@teambit/logger';\nimport { EnvsAspect, EnvsMain } from '@teambit/envs';\nimport { ExtensionDataEntry, ExtensionDataList } from '@teambit/legacy/dist/consumer/config';\nimport { getMaxSizeForComponents, InMemoryCache } from '@teambit/legacy/dist/cache/in-memory-cache';\nimport { AspectLoaderMain } from '@teambit/aspect-loader';\nimport { createInMemoryCache } from '@teambit/legacy/dist/cache/cache-factory';\nimport ComponentNotFoundInPath from '@teambit/legacy/dist/consumer/component/exceptions/component-not-found-in-path';\nimport { ComponentLoadOptions as LegacyComponentLoadOptions } from '@teambit/legacy/dist/consumer/component/component-loader';\nimport { Workspace } from '../workspace';\nimport { WorkspaceComponent } from './workspace-component';\nimport { MergeConfigConflict } from '../exceptions/merge-config-conflict';\n\ntype GetManyRes = {\n components: Component[];\n invalidComponents: InvalidComponent[];\n};\n\nexport type ComponentLoadOptions = LegacyComponentLoadOptions & {\n loadExtensions?: boolean;\n executeLoadSlot?: boolean;\n idsToNotLoadAsAspects?: string[];\n loadSeedersAsAspects?: boolean;\n resolveExtensionsVersions?: boolean;\n};\n\ntype LoadGroup = { workspaceIds: ComponentID[]; scopeIds: ComponentID[] } & LoadGroupMetadata;\ntype LoadGroupMetadata = {\n core?: boolean;\n aspects?: boolean;\n seeders?: boolean;\n};\n\ntype GetAndLoadSlotOpts = ComponentLoadOptions & LoadGroupMetadata;\n\ntype ComponentGetOneOptions = {\n resolveIdVersion?: boolean;\n};\n\ntype WorkspaceScopeIdsMap = {\n scopeIds: Map<string, ComponentID>;\n workspaceIds: Map<string, ComponentID>;\n};\n\nexport type LoadCompAsAspectsOptions = {\n /**\n * In case the component we are loading is app, whether to load it as app (in a scope aspects capsule)\n */\n loadApps?: boolean;\n /**\n * In case the component we are loading is env, whether to load it as env (in a scope aspects capsule)\n */\n loadEnvs?: boolean;\n\n /**\n * In case the component we are loading is a regular aspect, whether to load it as aspect (in a scope aspects capsule)\n */\n loadAspects?: boolean;\n\n idsToNotLoadAsAspects?: string[];\n\n /**\n * Are this core aspects\n */\n core?: boolean;\n\n /**\n * Are this aspects seeders of the load many operation\n */\n seeders?: boolean;\n};\n\nexport class WorkspaceComponentLoader {\n private componentsCache: InMemoryCache<Component>; // cache loaded components\n /**\n * Cache components that loaded from scope (especially for get many for perf improvements)\n */\n private scopeComponentsCache: InMemoryCache<Component>;\n /**\n * Cache extension list for components. used by get many for perf improvements.\n * And to make sure we load extensions first.\n */\n private componentsExtensionsCache: InMemoryCache<{ extensions: ExtensionDataList; errors: Error[] | undefined }>;\n\n private componentLoadedSelfAsAspects: InMemoryCache<boolean>; // cache loaded components\n constructor(\n private workspace: Workspace,\n private logger: Logger,\n private dependencyResolver: DependencyResolverMain,\n private envs: EnvsMain,\n private aspectLoader: AspectLoaderMain\n ) {\n this.componentsCache = createInMemoryCache({ maxSize: getMaxSizeForComponents() });\n this.scopeComponentsCache = createInMemoryCache({ maxSize: getMaxSizeForComponents() });\n this.componentsExtensionsCache = createInMemoryCache({ maxSize: getMaxSizeForComponents() });\n this.componentLoadedSelfAsAspects = createInMemoryCache({ maxSize: getMaxSizeForComponents() });\n }\n\n async getMany(ids: Array<ComponentID>, loadOpts?: ComponentLoadOptions, throwOnFailure = true): Promise<GetManyRes> {\n const idsWithoutEmpty = compact(ids);\n this.logger.setStatusLine(`loading ${ids.length} component(s)`);\n const loadOptsWithDefaults: ComponentLoadOptions = Object.assign(\n // We don't want to load extension or execute the load slot at this step\n // we will do it later\n // this important for better performance\n // We don't want to resolveExtensionsVersions as with get many we call aspect merger merge before update dependencies\n // so we will have the correct versions for extensions already and update them after will resolve wrong versions\n // in some cases\n { loadExtensions: false, executeLoadSlot: false, loadSeedersAsAspects: true, resolveExtensionsVersions: false },\n loadOpts || {}\n );\n\n const loadOrCached: { idsToLoad: ComponentID[]; fromCache: Component[] } = { idsToLoad: [], fromCache: [] };\n idsWithoutEmpty.forEach((id) => {\n const componentFromCache = this.getFromCache(id, loadOptsWithDefaults);\n if (componentFromCache) {\n loadOrCached.fromCache.push(componentFromCache);\n } else {\n loadOrCached.idsToLoad.push(id);\n }\n }, loadOrCached);\n\n const { components: loadedComponents, invalidComponents } = await this.getAndLoadSlotOrdered(\n loadOrCached.idsToLoad || [],\n loadOptsWithDefaults,\n throwOnFailure\n );\n\n const components = [...loadedComponents, ...loadOrCached.fromCache];\n\n // this.logger.clearStatusLine();\n return { components, invalidComponents };\n }\n\n private async getAndLoadSlotOrdered(\n ids: ComponentID[],\n loadOpts: ComponentLoadOptions,\n throwOnFailure = true\n ): Promise<GetManyRes> {\n if (!ids?.length) return { components: [], invalidComponents: [] };\n\n const workspaceScopeIdsMap: WorkspaceScopeIdsMap = await this.groupAndUpdateIds(ids);\n\n const groupsToHandle = await this.buildLoadGroups(workspaceScopeIdsMap);\n const groupsRes = compact(\n await mapSeries(groupsToHandle, async (group) => {\n const { scopeIds, workspaceIds, aspects, core, seeders } = group;\n if (!workspaceIds.length && !scopeIds.length) return undefined;\n const res = await this.getAndLoadSlot(\n workspaceIds,\n scopeIds,\n { ...loadOpts, core, seeders, aspects },\n throwOnFailure\n );\n // We don't want to return components that were not asked originally (we do want to load them)\n if (!group.seeders) return undefined;\n return res;\n })\n );\n const finalRes = groupsRes.reduce(\n (acc, curr) => {\n return {\n components: [...acc.components, ...curr.components],\n invalidComponents: [...acc.invalidComponents, ...curr.invalidComponents],\n };\n },\n { components: [], invalidComponents: [] }\n );\n return finalRes;\n }\n\n private async buildLoadGroups(workspaceScopeIdsMap: WorkspaceScopeIdsMap): Promise<Array<LoadGroup>> {\n const allIds = [...workspaceScopeIdsMap.workspaceIds.values(), ...workspaceScopeIdsMap.scopeIds.values()];\n const groupedByIsCoreEnvs = groupBy(allIds, (id) => {\n return this.envs.isCoreEnv(id.toStringWithoutVersion());\n });\n const nonCoreEnvs = groupedByIsCoreEnvs.false || [];\n await this.populateScopeAndExtensionsCache(nonCoreEnvs, workspaceScopeIdsMap);\n const allExtIds: Map<string, ComponentID> = new Map();\n nonCoreEnvs.forEach((id) => {\n const idStr = id.toString();\n const fromCache = this.componentsExtensionsCache.get(idStr);\n if (!fromCache || !fromCache.extensions) {\n return;\n }\n fromCache.extensions.forEach((ext) => {\n if (!allExtIds.has(ext.stringId) && ext.newExtensionId) {\n allExtIds.set(ext.stringId, ext.newExtensionId);\n }\n });\n });\n const allExtCompIds = Array.from(allExtIds.values());\n await this.populateScopeAndExtensionsCache(allExtCompIds || [], workspaceScopeIdsMap);\n\n const allExtIdsStr = allExtCompIds.map((id) => id.toString());\n const groupedByIsExtOfAnother = groupBy(nonCoreEnvs, (id) => {\n return allExtIdsStr.includes(id.toString());\n });\n const extIdsFromTheList = (groupedByIsExtOfAnother.true || []).map((id) => id.toString());\n const extsNotFromTheList: ComponentID[] = [];\n for (const [, id] of allExtIds.entries()) {\n if (!extIdsFromTheList.includes(id.toString())) {\n extsNotFromTheList.push(id);\n }\n }\n\n await this.groupAndUpdateIds(extsNotFromTheList, workspaceScopeIdsMap);\n\n const layerdExtFromTheList = this.regroupExtIdsFromTheList(groupedByIsExtOfAnother.true);\n const layerdExtGroups = layerdExtFromTheList.map((ids) => {\n return {\n ids,\n core: false,\n aspects: true,\n seeders: true,\n };\n });\n\n const groupsToHandle = [\n // Always load first core envs\n { ids: groupedByIsCoreEnvs.true || [], core: true, aspects: true, seeders: true },\n { ids: extsNotFromTheList || [], core: false, aspects: true, seeders: false },\n ...layerdExtGroups,\n { ids: groupedByIsExtOfAnother.false || [], core: false, aspects: false, seeders: true },\n ];\n const groupsByWsScope = groupsToHandle.map((group) => {\n const groupedByWsScope = groupBy(group.ids, (id) => {\n return workspaceScopeIdsMap.workspaceIds.has(id.toString());\n });\n return {\n workspaceIds: groupedByWsScope.true || [],\n scopeIds: groupedByWsScope.false || [],\n core: group.core,\n aspects: group.aspects,\n seeders: group.seeders,\n };\n });\n return groupsByWsScope;\n }\n\n private regroupExtIdsFromTheList(ids: ComponentID[]): Array<ComponentID[]> {\n // TODO: implement this function\n // this should handle a case when you have:\n // compA that has extA and that extA has extB\n // in that case we now get the following group:\n // ids: [extA, extB]\n // while we need extB to be in a different group before extA\n return [ids];\n }\n\n private async getAndLoadSlot(\n workspaceIds: ComponentID[],\n scopeIds: ComponentID[],\n loadOpts: GetAndLoadSlotOpts,\n throwOnFailure = true\n ): Promise<GetManyRes> {\n const { workspaceComponents, scopeComponents, invalidComponents } = await this.getComponentsWithoutLoadExtensions(\n workspaceIds,\n scopeIds,\n loadOpts,\n throwOnFailure\n );\n\n const components = workspaceComponents.concat(scopeComponents);\n\n const allExtensions: ExtensionDataList[] = components.map((component) => {\n return component.state._consumer.extensions;\n });\n\n // Ensure we won't load the same extension many times\n // We don't want to ignore version here, as we do want to load different extensions with same id but different versions here\n const mergedExtensions = ExtensionDataList.mergeConfigs(allExtensions, false);\n await this.workspace.loadComponentsExtensions(mergedExtensions);\n let wsComponentsWithAspects = workspaceComponents;\n // if (loadOpts.seeders) {\n wsComponentsWithAspects = await pMap(workspaceComponents, (component) => this.executeLoadSlot(component), {\n concurrency: concurrentComponentsLimit(),\n });\n await this.warnAboutMisconfiguredEnvs(wsComponentsWithAspects);\n // }\n\n const withAspects = wsComponentsWithAspects.concat(scopeComponents);\n\n // It's important to load the workspace components as aspects here\n // otherwise the envs from the workspace won't be loaded at time\n // so we will get wrong dependencies from component who uses envs from the workspace\n if (loadOpts.loadSeedersAsAspects || (loadOpts.core && loadOpts.aspects)) {\n await this.loadCompsAsAspects(workspaceComponents.concat(scopeComponents), {\n loadApps: true,\n loadEnvs: true,\n loadAspects: loadOpts.aspects,\n core: loadOpts.core,\n seeders: loadOpts.seeders,\n idsToNotLoadAsAspects: loadOpts.idsToNotLoadAsAspects,\n });\n }\n\n return { components: withAspects, invalidComponents };\n }\n\n // TODO: this is similar to scope.main.runtime loadCompAspects func, we should merge them.\n async loadCompsAsAspects(\n components: Component[],\n opts: LoadCompAsAspectsOptions = { loadApps: true, loadEnvs: true, loadAspects: true }\n ): Promise<void> {\n const aspectIds: string[] = [];\n components.forEach((component) => {\n const firstTimeToLoad = this.componentLoadedSelfAsAspects.get(component.id.toString()) === undefined;\n const excluded = opts.idsToNotLoadAsAspects?.includes(component.id.toString());\n const isCore = this.aspectLoader.isCoreAspect(component.id.toStringWithoutVersion());\n const alreadyLoaded = this.aspectLoader.isAspectLoaded(component.id.toString());\n const skipLoading = excluded || isCore || alreadyLoaded || !firstTimeToLoad;\n\n if (skipLoading) {\n return;\n }\n const idStr = component.id.toString();\n const appData = component.state.aspects.get('teambit.harmony/application');\n if (opts.loadApps && appData?.data?.appName) {\n aspectIds.push(idStr);\n this.componentLoadedSelfAsAspects.set(idStr, true);\n }\n const envsData = component.state.aspects.get(EnvsAspect.id);\n if (opts.loadEnvs && (envsData?.data?.services || envsData?.data?.self || envsData?.data?.type === 'env')) {\n aspectIds.push(idStr);\n this.componentLoadedSelfAsAspects.set(idStr, true);\n }\n if (opts.loadAspects && envsData?.data?.type === 'aspect') {\n aspectIds.push(idStr);\n this.componentLoadedSelfAsAspects.set(idStr, true);\n }\n });\n if (!aspectIds.length) return;\n\n try {\n await this.workspace.loadAspects(aspectIds, true, 'self loading aspects', {});\n } catch (err: any) {\n this.logger.warn(`failed loading components as aspects for components ${aspectIds.join(', ')}`, err);\n // we ignore that errors at the moment\n }\n }\n\n private async populateScopeAndExtensionsCache(ids: ComponentID[], workspaceScopeIdsMap: WorkspaceScopeIdsMap) {\n return mapSeries(ids, async (id) => {\n const idStr = id.toString();\n let componentFromScope;\n if (!this.scopeComponentsCache.has(idStr)) {\n try {\n // Do not import automatically if it's missing, it will throw an error later\n componentFromScope = await this.workspace.scope.get(id, undefined, false);\n if (componentFromScope) {\n this.scopeComponentsCache.set(idStr, componentFromScope);\n }\n // This is fine here, as it will be handled later in the process\n } catch (err: any) {\n const wsAspectLoader = this.workspace.getWorkspaceAspectsLoader();\n wsAspectLoader.throwWsJsoncAspectNotFoundError(err);\n this.logger.warn(`populateScopeAndExtensionsCache - failed loading component ${idStr} from scope`, err);\n }\n }\n if (!this.componentsExtensionsCache.has(idStr) && workspaceScopeIdsMap.workspaceIds.has(idStr)) {\n componentFromScope = componentFromScope || this.scopeComponentsCache.get(idStr);\n const { extensions, errors } = await this.workspace.componentExtensions(id, componentFromScope, undefined, {\n loadExtensions: false,\n });\n this.componentsExtensionsCache.set(idStr, { extensions, errors });\n }\n });\n }\n\n private async warnAboutMisconfiguredEnvs(components: Component[]) {\n const allIds = uniq(components.map((component) => this.envs.getEnvId(component)));\n return Promise.all(allIds.map((envId) => this.workspace.warnAboutMisconfiguredEnv(envId)));\n }\n\n private async groupAndUpdateIds(\n ids: ComponentID[],\n existingGroups?: WorkspaceScopeIdsMap\n ): Promise<WorkspaceScopeIdsMap> {\n const result: WorkspaceScopeIdsMap = existingGroups || {\n scopeIds: new Map(),\n workspaceIds: new Map(),\n };\n\n await Promise.all(\n ids.map(async (componentId) => {\n const inWs = await this.isInWsIncludeDeleted(componentId);\n\n if (!inWs) {\n result.scopeIds.set(componentId.toString(), componentId);\n return undefined;\n }\n const resolvedVersions = this.resolveVersion(componentId);\n result.workspaceIds.set(resolvedVersions.toString(), resolvedVersions);\n return undefined;\n })\n );\n return result;\n }\n\n private async isInWsIncludeDeleted(componentId: ComponentID): Promise<boolean> {\n const nonDeletedWsIds = await this.workspace.listIds();\n const deletedWsIds = await this.workspace.locallyDeletedIds();\n const allWsIds = nonDeletedWsIds.concat(deletedWsIds);\n const inWs = allWsIds.find((id) => id.isEqual(componentId, { ignoreVersion: !componentId.hasVersion() }));\n return !!inWs;\n }\n\n private async getComponentsWithoutLoadExtensions(\n workspaceIds: ComponentID[],\n scopeIds: ComponentID[],\n loadOpts: GetAndLoadSlotOpts,\n throwOnFailure = true\n ) {\n const invalidComponents: InvalidComponent[] = [];\n const errors: { id: ComponentID; err: Error }[] = [];\n const loadOptsWithDefaults: ComponentLoadOptions = Object.assign(\n // We don't want to load extension or execute the load slot at this step\n // we will do it later\n // this important for better performance\n // We don't want to store deps in fs cache, as at this point extensions are not loaded yet\n // so it might save a wrong deps into the cache\n { loadExtensions: false, executeLoadSlot: false },\n loadOpts || {}\n );\n\n const idsIndex = {};\n\n workspaceIds.forEach((id) => {\n idsIndex[id.toString()] = id;\n });\n\n const {\n components: legacyComponents,\n invalidComponents: legacyInvalidComponents,\n removedComponents,\n } = await this.workspace.consumer.loadComponents(\n ComponentIdList.fromArray(workspaceIds),\n false,\n loadOptsWithDefaults\n );\n const allLegacyComponents = legacyComponents.concat(removedComponents);\n legacyInvalidComponents.forEach((invalidComponent) => {\n const entry = { id: idsIndex[invalidComponent.id.toString()], err: invalidComponent.error };\n if (ConsumerComponent.isComponentInvalidByErrorType(invalidComponent.error)) {\n if (throwOnFailure) throw invalidComponent.error;\n invalidComponents.push(entry);\n }\n if (\n this.isComponentNotExistsError(invalidComponent.error) ||\n invalidComponent.error instanceof ComponentNotFoundInPath\n ) {\n errors.push(entry);\n }\n });\n\n const getWithCatch = (id, legacyComponent) => {\n return this.get(id, legacyComponent, undefined, undefined, loadOptsWithDefaults).catch((err) => {\n if (ConsumerComponent.isComponentInvalidByErrorType(err) && !throwOnFailure) {\n invalidComponents.push({\n id,\n err,\n });\n return undefined;\n }\n if (this.isComponentNotExistsError(err) || err instanceof ComponentNotFoundInPath) {\n errors.push({\n id,\n err,\n });\n return undefined;\n }\n throw err;\n });\n };\n\n // await this.getConsumerComponent(id, loadOpts)\n const componentsP = pMap(\n allLegacyComponents,\n (legacyComponent) => {\n // const componentsP = Promise.all(\n // allLegacyComponents.map(async (legacyComponent) => {\n let id = idsIndex[legacyComponent.id.toString()];\n if (!id) {\n const withoutVersion = idsIndex[legacyComponent.id.toStringWithoutVersion()] || legacyComponent.id;\n if (withoutVersion) {\n id = withoutVersion.changeVersion(legacyComponent.id.version);\n idsIndex[legacyComponent.id.toString()] = id;\n }\n }\n return getWithCatch(id, legacyComponent);\n },\n {\n concurrency: concurrentComponentsLimit(),\n }\n );\n\n errors.forEach((err) => {\n this.logger.console(`failed loading component ${err.id.toString()}, see full error in debug.log file`);\n this.logger.warn(`failed loading component ${err.id.toString()}`, err.err);\n });\n const components: Component[] = compact(await componentsP);\n\n // Here we need to load many, otherwise we will get wrong overrides dependencies data\n // as when loading the next batch of components (next group) we won't have the envs loaded\n\n try {\n // We don't want to load envs as part of this step, they will be loaded later\n const scopeComponents = await this.workspace.scope.loadMany(scopeIds, undefined, {\n loadApps: false,\n loadEnvs: false,\n });\n return {\n workspaceComponents: components,\n scopeComponents,\n invalidComponents,\n };\n } catch (err) {\n const wsAspectLoader = this.workspace.getWorkspaceAspectsLoader();\n wsAspectLoader.throwWsJsoncAspectNotFoundError(err);\n throw err;\n }\n }\n\n async getInvalid(ids: Array<ComponentID>): Promise<InvalidComponent[]> {\n const idsWithoutEmpty = compact(ids);\n const errors: InvalidComponent[] = [];\n const longProcessLogger = this.logger.createLongProcessLogger('loading components', ids.length);\n await mapSeries(idsWithoutEmpty, async (id: ComponentID) => {\n longProcessLogger.logProgress(id.toString());\n try {\n await this.workspace.consumer.loadComponent(id);\n } catch (err: any) {\n if (ConsumerComponent.isComponentInvalidByErrorType(err)) {\n errors.push({\n id,\n err,\n });\n return;\n }\n throw err;\n }\n });\n return errors;\n }\n\n async get(\n componentId: ComponentID,\n legacyComponent?: ConsumerComponent,\n useCache = true,\n storeInCache = true,\n loadOpts?: ComponentLoadOptions,\n getOpts: ComponentGetOneOptions = { resolveIdVersion: true }\n ): Promise<Component> {\n const loadOptsWithDefaults: ComponentLoadOptions = Object.assign(\n { loadExtensions: true, executeLoadSlot: true },\n loadOpts || {}\n );\n const id = getOpts?.resolveIdVersion ? this.resolveVersion(componentId) : componentId;\n const fromCache = this.getFromCache(componentId, loadOptsWithDefaults);\n if (fromCache && useCache) {\n return fromCache;\n }\n let consumerComponent = legacyComponent;\n const inWs = await this.isInWsIncludeDeleted(componentId);\n if (inWs && !consumerComponent) {\n consumerComponent = await this.getConsumerComponent(id, loadOptsWithDefaults);\n }\n\n // in case of out-of-sync, the id may changed during the load process\n const updatedId = consumerComponent ? consumerComponent.id : id;\n const component = await this.loadOne(updatedId, consumerComponent, loadOptsWithDefaults);\n if (storeInCache) {\n this.addMultipleEnvsIssueIfNeeded(component); // it's in storeInCache block, otherwise, it wasn't fully loaded\n this.saveInCache(component, loadOptsWithDefaults);\n }\n return component;\n }\n\n async getIfExist(componentId: ComponentID) {\n try {\n return await this.get(componentId);\n } catch (err: any) {\n if (this.isComponentNotExistsError(err)) {\n return undefined;\n }\n throw err;\n }\n }\n\n private resolveVersion(componentId: ComponentID): ComponentID {\n const bitIdWithVersion: ComponentID = getLatestVersionNumber(\n this.workspace.consumer.bitmapIdsFromCurrentLaneIncludeRemoved,\n componentId\n );\n const id = bitIdWithVersion.version ? componentId.changeVersion(bitIdWithVersion.version) : componentId;\n return id;\n }\n\n private addMultipleEnvsIssueIfNeeded(component: Component) {\n const envs = this.envs.getAllEnvsConfiguredOnComponent(component);\n const envIds = uniq(envs.map((env) => env.id));\n if (envIds.length < 2) {\n return;\n }\n component.state.issues.getOrCreate(IssuesClasses.MultipleEnvs).data = envIds;\n }\n\n clearCache() {\n this.componentsCache.deleteAll();\n this.scopeComponentsCache.deleteAll();\n this.componentsExtensionsCache.deleteAll();\n this.componentLoadedSelfAsAspects.deleteAll();\n }\n\n clearComponentCache(id: ComponentID) {\n const idStr = id.toString();\n const cachesToClear = [\n this.componentsCache,\n this.scopeComponentsCache,\n this.componentsExtensionsCache,\n this.componentLoadedSelfAsAspects,\n ];\n cachesToClear.forEach((cache) => {\n for (const cacheKey of cache.keys()) {\n if (cacheKey === idStr || cacheKey.startsWith(`${idStr}:`)) {\n cache.delete(cacheKey);\n }\n }\n });\n }\n\n private async loadOne(id: ComponentID, consumerComponent?: ConsumerComponent, loadOpts?: ComponentLoadOptions) {\n const idStr = id.toString();\n const componentFromScope = this.scopeComponentsCache.has(idStr)\n ? this.scopeComponentsCache.get(idStr)\n : await this.workspace.scope.get(id);\n if (!consumerComponent) {\n if (!componentFromScope) throw new MissingBitMapComponent(id.toString());\n return componentFromScope;\n }\n const extErrorsFromCache = this.componentsExtensionsCache.has(idStr)\n ? this.componentsExtensionsCache.get(idStr)\n : undefined;\n const { extensions, errors } =\n extErrorsFromCache ||\n (await this.workspace.componentExtensions(id, componentFromScope, undefined, {\n loadExtensions: loadOpts?.loadExtensions,\n }));\n if (errors?.some((err) => err instanceof MergeConfigConflict)) {\n consumerComponent.issues.getOrCreate(IssuesClasses.MergeConfigHasConflict).data = true;\n }\n\n // temporarily mutate consumer component extensions until we remove all direct access from legacy to extensions data\n // TODO: remove this once we remove all direct access from legacy code to extensions data\n consumerComponent.extensions = extensions;\n\n const state = new State(\n new Config(consumerComponent),\n await this.workspace.createAspectList(extensions),\n ComponentFS.fromVinyls(consumerComponent.files),\n consumerComponent.dependencies,\n consumerComponent\n );\n if (componentFromScope) {\n // Removed by @gilad. do not mutate the component from the scope\n // componentFromScope.state = state;\n // const workspaceComponent = WorkspaceComponent.fromComponent(componentFromScope, this.workspace);\n const workspaceComponent = new WorkspaceComponent(\n componentFromScope.id,\n componentFromScope.head,\n state,\n componentFromScope.tags,\n this.workspace\n );\n if (loadOpts?.executeLoadSlot) {\n return this.executeLoadSlot(workspaceComponent, loadOpts);\n }\n // const updatedComp = await this.executeLoadSlot(workspaceComponent, loadOpts);\n return workspaceComponent;\n }\n const newComponent = this.newComponentFromState(id, state);\n if (!loadOpts?.executeLoadSlot) {\n return newComponent;\n }\n return this.executeLoadSlot(newComponent, loadOpts);\n }\n\n private saveInCache(component: Component, loadOpts?: ComponentLoadOptions): void {\n const cacheKey = createComponentCacheKey(component.id, loadOpts);\n this.componentsCache.set(cacheKey, component);\n }\n\n /**\n * make sure that not only the id-str match, but also the legacy-id.\n * this is needed because the ComponentID.toString() is the same whether or not the legacy-id has\n * scope-name, as it includes the defaultScope if the scope is empty.\n * as a result, when out-of-sync is happening and the id is changed to include scope-name in the\n * legacy-id, the component is the cache has the old id.\n */\n private getFromCache(componentId: ComponentID, loadOpts?: ComponentLoadOptions): Component | undefined {\n const bitIdWithVersion: ComponentID = this.resolveVersion(componentId);\n const id = bitIdWithVersion.version ? componentId.changeVersion(bitIdWithVersion.version) : componentId;\n const cacheKey = createComponentCacheKey(id, loadOpts);\n // If we try to look for the cache without load extensions/ without execute load slot\n // but there is an entry after the load, we want to use it as well.\n // as we want the component, so if we already loaded it with everything, it's fine.\n // this sometime relevant for cases with tiny cache size (during tag)\n const cacheKeyWithTrueLoadOpts = createComponentCacheKey(id, { loadExtensions: true, executeLoadSlot: true });\n const fromCache = this.componentsCache.get(cacheKey) || this.componentsCache.get(cacheKeyWithTrueLoadOpts);\n if (fromCache && fromCache.id.isEqual(id)) {\n return fromCache;\n }\n return undefined;\n }\n\n private async getConsumerComponent(\n id: ComponentID,\n loadOpts: ComponentLoadOptions = {}\n ): Promise<ConsumerComponent | undefined> {\n loadOpts.originatedFromHarmony = true;\n try {\n const { components, removedComponents } = await this.workspace.consumer.loadComponents(\n ComponentIdList.fromArray([id]),\n true,\n loadOpts\n );\n return components?.[0] || removedComponents?.[0];\n } catch (err: any) {\n // don't return undefined for any error. otherwise, if the component is invalid (e.g. main\n // file is missing) it returns the model component later unexpectedly, or if it's new, it\n // shows MissingBitMapComponent error incorrectly.\n if (this.isComponentNotExistsError(err)) {\n this.logger.debug(\n `failed loading component \"${id.toString()}\" from the workspace due to \"${err.name}\" error\\n${err.message}`\n );\n return undefined;\n }\n throw err;\n }\n }\n\n private isComponentNotExistsError(err: Error): boolean {\n return err instanceof ComponentNotFound || err instanceof MissingBitMapComponent;\n }\n\n private async executeLoadSlot(component: Component, loadOpts?: ComponentLoadOptions) {\n if (component.state._consumer.removed) {\n // if it was soft-removed now, the component is not in the FS. loading aspects such as composition ends up with\n // errors as they try to read component files from the filesystem.\n return component;\n }\n\n // Special load events which runs from the workspace but should run from the correct aspect\n // TODO: remove this once those extensions dependent on workspace\n const envsData = await this.envs.calcDescriptor(component, { skipWarnings: !!this.workspace.inInstallContext });\n\n // Move to deps resolver main runtime once we switch ws<> deps resolver direction\n const policy = await this.dependencyResolver.mergeVariantPolicies(\n component.config.extensions,\n component.id,\n component.state._consumer.files\n );\n const dependenciesList = await this.dependencyResolver.extractDepsFromLegacy(component, policy);\n\n const depResolverData = {\n packageName: this.dependencyResolver.calcPackageName(component),\n dependencies: dependenciesList.serialize(),\n policy: policy.serialize(),\n };\n\n // Make sure we are adding the envs / deps data first because other on load events might depend on it\n await Promise.all([\n this.upsertExtensionData(component, EnvsAspect.id, envsData),\n this.upsertExtensionData(component, DependencyResolverAspect.id, depResolverData),\n ]);\n\n // We are updating the component state with the envs and deps data here, so in case we have other slots that depend on this data\n // they will be able to get it, as it's very common use case that during on load someone want to access to the component env for example\n const aspectListWithEnvsAndDeps = await this.workspace.createAspectList(component.state.config.extensions);\n component.state.aspects = aspectListWithEnvsAndDeps;\n\n const entries = this.workspace.onComponentLoadSlot.toArray();\n await mapSeries(entries, async ([extension, onLoad]) => {\n const data = await onLoad(component, loadOpts);\n await this.upsertExtensionData(component, extension, data);\n // Update the aspect list to have changes happened during the on load slot (new data added above)\n component.state.aspects.upsertEntry(await this.workspace.resolveComponentId(extension), data);\n });\n\n return component;\n }\n\n private newComponentFromState(id: ComponentID, state: State): Component {\n return new WorkspaceComponent(id, null, state, new TagMap(), this.workspace);\n }\n\n private async upsertExtensionData(component: Component, extension: string, data: any) {\n if (!data) return;\n const existingExtension = component.state.config.extensions.findExtension(extension);\n if (existingExtension) {\n // Only merge top level of extension data\n Object.assign(existingExtension.data, data);\n return;\n }\n component.state.config.extensions.push(await this.getDataEntry(extension, data));\n }\n\n private async getDataEntry(extension: string, data: { [key: string]: any }): Promise<ExtensionDataEntry> {\n // TODO: @gilad we need to refactor the extension data entry api.\n return new ExtensionDataEntry(undefined, undefined, extension, undefined, data);\n }\n}\n\nfunction createComponentCacheKey(id: ComponentID, loadOpts?: ComponentLoadOptions): string {\n const relevantOpts = pick(loadOpts, ['loadExtensions', 'executeLoadSlot']);\n return `${id.toString()}:${JSON.stringify(sortKeys(relevantOpts ?? {}))}`;\n}\n\nfunction sortKeys(obj: Object) {\n return fromPairs(Object.entries(obj).sort(([k1], [k2]) => k1.localeCompare(k2)));\n}\n"],"mappings":";;;;;;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,aAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,YAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,WAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,UAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,aAA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_componentId","_pMapSeries","_lodash","_component2","_exceptions","_utils","_componentIssues","_exceptions2","_dependencyResolver","_envs","_config","_inMemoryCache","_cacheFactory","_componentNotFoundInPath","_workspaceComponent","_mergeConfigConflict","obj","__esModule","default","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","key","value","_toPropertyKey","configurable","writable","i","_toPrimitive","String","Symbol","toPrimitive","call","TypeError","Number","WorkspaceComponentLoader","constructor","workspace","logger","dependencyResolver","envs","aspectLoader","componentsCache","createInMemoryCache","maxSize","getMaxSizeForComponents","scopeComponentsCache","componentsExtensionsCache","componentLoadedSelfAsAspects","getMany","ids","loadOpts","throwOnFailure","idsWithoutEmpty","compact","setStatusLine","loadOptsWithDefaults","assign","loadExtensions","executeLoadSlot","loadSeedersAsAspects","resolveExtensionsVersions","loadOrCached","idsToLoad","fromCache","id","componentFromCache","getFromCache","components","loadedComponents","invalidComponents","getAndLoadSlotOrdered","workspaceScopeIdsMap","groupAndUpdateIds","groupsToHandle","buildLoadGroups","process","env","BIT_LOG","printGroupsToHandle","groupsRes","mapSeries","group","scopeIds","workspaceIds","aspects","core","seeders","undefined","res","getAndLoadSlot","finalRes","reduce","acc","curr","allIds","values","groupedByIsCoreEnvs","groupBy","isCoreEnv","toStringWithoutVersion","nonCoreEnvs","false","populateScopeAndExtensionsCache","allExtIds","Map","idStr","toString","get","extensions","ext","has","stringId","newExtensionId","set","allExtCompIds","Array","from","allExtIdsStr","map","groupedByIsExtOfAnother","includes","extIdsFromTheList","true","extsNotFromTheList","entries","layerdExtFromTheList","regroupExtIdsFromTheList","layerdExtGroups","groupsByWsScope","groupedByWsScope","workspaceComponents","scopeComponents","getComponentsWithoutLoadExtensions","concat","allExtensions","component","state","_consumer","mergedExtensions","ExtensionDataList","mergeConfigs","loadComponentsExtensions","wsComponentsWithAspects","pMap","concurrency","concurrentComponentsLimit","warnAboutMisconfiguredEnvs","withAspects","loadCompsAsAspects","loadApps","loadEnvs","loadAspects","idsToNotLoadAsAspects","opts","aspectIds","firstTimeToLoad","excluded","isCore","isCoreAspect","alreadyLoaded","isAspectLoaded","skipLoading","appData","appName","envsData","EnvsAspect","services","self","type","useScopeAspectsCapsule","err","warn","join","componentFromScope","scope","wsAspectLoader","getWorkspaceAspectsLoader","throwWsJsoncAspectNotFoundError","errors","componentExtensions","uniq","getEnvId","Promise","all","envId","warnAboutMisconfiguredEnv","existingGroups","result","componentId","inWs","isInWsIncludeDeleted","resolvedVersions","resolveVersion","nonDeletedWsIds","listIds","deletedWsIds","locallyDeletedIds","allWsIds","find","isEqual","ignoreVersion","hasVersion","idsIndex","legacyComponents","legacyInvalidComponents","removedComponents","consumer","loadComponents","ComponentIdList","fromArray","allLegacyComponents","invalidComponent","entry","error","ConsumerComponent","isComponentInvalidByErrorType","isComponentNotExistsError","ComponentNotFoundInPath","getWithCatch","legacyComponent","catch","componentsP","withoutVersion","changeVersion","version","console","loadMany","getInvalid","longProcessLogger","createLongProcessLogger","logProgress","loadComponent","useCache","storeInCache","getOpts","resolveIdVersion","consumerComponent","getConsumerComponent","updatedId","loadOne","addMultipleEnvsIssueIfNeeded","saveInCache","getIfExist","bitIdWithVersion","getLatestVersionNumber","bitmapIdsFromCurrentLaneIncludeRemoved","getAllEnvsConfiguredOnComponent","envIds","issues","getOrCreate","IssuesClasses","MultipleEnvs","clearCache","deleteAll","clearComponentCache","cachesToClear","cache","cacheKey","startsWith","delete","MissingBitMapComponent","extErrorsFromCache","some","MergeConfigConflict","MergeConfigHasConflict","State","Config","createAspectList","ComponentFS","fromVinyls","files","dependencies","workspaceComponent","WorkspaceComponent","head","tags","newComponent","newComponentFromState","createComponentCacheKey","cacheKeyWithTrueLoadOpts","originatedFromHarmony","debug","name","message","ComponentNotFound","removed","calcDescriptor","skipWarnings","inInstallContext","policy","mergeVariantPolicies","config","dependenciesList","extractDepsFromLegacy","depResolverData","packageName","calcPackageName","serialize","upsertExtensionData","DependencyResolverAspect","aspectListWithEnvsAndDeps","onComponentLoadSlot","toArray","extension","onLoad","upsertEntry","resolveComponentId","TagMap","existingExtension","findExtension","getDataEntry","ExtensionDataEntry","exports","relevantOpts","pick","JSON","stringify","sortKeys","fromPairs","sort","k1","k2","localeCompare"],"sources":["workspace-component-loader.ts"],"sourcesContent":["import pMap from 'p-map';\nimport { concurrentComponentsLimit } from '@teambit/legacy/dist/utils/concurrency';\nimport { Component, ComponentFS, Config, InvalidComponent, State, TagMap } from '@teambit/component';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport mapSeries from 'p-map-series';\nimport { compact, fromPairs, groupBy, pick, uniq } from 'lodash';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component';\nimport { MissingBitMapComponent } from '@teambit/legacy/dist/consumer/bit-map/exceptions';\nimport { getLatestVersionNumber } from '@teambit/legacy/dist/utils';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport { ComponentNotFound } from '@teambit/legacy/dist/scope/exceptions';\nimport { DependencyResolverAspect, DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { Logger } from '@teambit/logger';\nimport { EnvsAspect, EnvsMain } from '@teambit/envs';\nimport { ExtensionDataEntry, ExtensionDataList } from '@teambit/legacy/dist/consumer/config';\nimport { getMaxSizeForComponents, InMemoryCache } from '@teambit/legacy/dist/cache/in-memory-cache';\nimport { AspectLoaderMain } from '@teambit/aspect-loader';\nimport { createInMemoryCache } from '@teambit/legacy/dist/cache/cache-factory';\nimport ComponentNotFoundInPath from '@teambit/legacy/dist/consumer/component/exceptions/component-not-found-in-path';\nimport { ComponentLoadOptions as LegacyComponentLoadOptions } from '@teambit/legacy/dist/consumer/component/component-loader';\nimport { Workspace } from '../workspace';\nimport { WorkspaceComponent } from './workspace-component';\nimport { MergeConfigConflict } from '../exceptions/merge-config-conflict';\n\ntype GetManyRes = {\n components: Component[];\n invalidComponents: InvalidComponent[];\n};\n\nexport type ComponentLoadOptions = LegacyComponentLoadOptions & {\n loadExtensions?: boolean;\n executeLoadSlot?: boolean;\n idsToNotLoadAsAspects?: string[];\n loadSeedersAsAspects?: boolean;\n resolveExtensionsVersions?: boolean;\n};\n\ntype LoadGroup = { workspaceIds: ComponentID[]; scopeIds: ComponentID[] } & LoadGroupMetadata;\ntype LoadGroupMetadata = {\n core?: boolean;\n aspects?: boolean;\n seeders?: boolean;\n};\n\ntype GetAndLoadSlotOpts = ComponentLoadOptions & LoadGroupMetadata;\n\ntype ComponentGetOneOptions = {\n resolveIdVersion?: boolean;\n};\n\ntype WorkspaceScopeIdsMap = {\n scopeIds: Map<string, ComponentID>;\n workspaceIds: Map<string, ComponentID>;\n};\n\nexport type LoadCompAsAspectsOptions = {\n /**\n * In case the component we are loading is app, whether to load it as app (in a scope aspects capsule)\n */\n loadApps?: boolean;\n /**\n * In case the component we are loading is env, whether to load it as env (in a scope aspects capsule)\n */\n loadEnvs?: boolean;\n\n /**\n * In case the component we are loading is a regular aspect, whether to load it as aspect (in a scope aspects capsule)\n */\n loadAspects?: boolean;\n\n idsToNotLoadAsAspects?: string[];\n\n /**\n * Are this core aspects\n */\n core?: boolean;\n\n /**\n * Are this aspects seeders of the load many operation\n */\n seeders?: boolean;\n};\n\nexport class WorkspaceComponentLoader {\n private componentsCache: InMemoryCache<Component>; // cache loaded components\n /**\n * Cache components that loaded from scope (especially for get many for perf improvements)\n */\n private scopeComponentsCache: InMemoryCache<Component>;\n /**\n * Cache extension list for components. used by get many for perf improvements.\n * And to make sure we load extensions first.\n */\n private componentsExtensionsCache: InMemoryCache<{ extensions: ExtensionDataList; errors: Error[] | undefined }>;\n\n private componentLoadedSelfAsAspects: InMemoryCache<boolean>; // cache loaded components\n constructor(\n private workspace: Workspace,\n private logger: Logger,\n private dependencyResolver: DependencyResolverMain,\n private envs: EnvsMain,\n private aspectLoader: AspectLoaderMain\n ) {\n this.componentsCache = createInMemoryCache({ maxSize: getMaxSizeForComponents() });\n this.scopeComponentsCache = createInMemoryCache({ maxSize: getMaxSizeForComponents() });\n this.componentsExtensionsCache = createInMemoryCache({ maxSize: getMaxSizeForComponents() });\n this.componentLoadedSelfAsAspects = createInMemoryCache({ maxSize: getMaxSizeForComponents() });\n }\n\n async getMany(ids: Array<ComponentID>, loadOpts?: ComponentLoadOptions, throwOnFailure = true): Promise<GetManyRes> {\n const idsWithoutEmpty = compact(ids);\n this.logger.setStatusLine(`loading ${ids.length} component(s)`);\n const loadOptsWithDefaults: ComponentLoadOptions = Object.assign(\n // We don't want to load extension or execute the load slot at this step\n // we will do it later\n // this important for better performance\n // We don't want to resolveExtensionsVersions as with get many we call aspect merger merge before update dependencies\n // so we will have the correct versions for extensions already and update them after will resolve wrong versions\n // in some cases\n { loadExtensions: false, executeLoadSlot: false, loadSeedersAsAspects: true, resolveExtensionsVersions: false },\n loadOpts || {}\n );\n\n const loadOrCached: { idsToLoad: ComponentID[]; fromCache: Component[] } = { idsToLoad: [], fromCache: [] };\n idsWithoutEmpty.forEach((id) => {\n const componentFromCache = this.getFromCache(id, loadOptsWithDefaults);\n if (componentFromCache) {\n loadOrCached.fromCache.push(componentFromCache);\n } else {\n loadOrCached.idsToLoad.push(id);\n }\n }, loadOrCached);\n\n const { components: loadedComponents, invalidComponents } = await this.getAndLoadSlotOrdered(\n loadOrCached.idsToLoad || [],\n loadOptsWithDefaults,\n throwOnFailure\n );\n\n const components = [...loadedComponents, ...loadOrCached.fromCache];\n\n // this.logger.clearStatusLine();\n return { components, invalidComponents };\n }\n\n private async getAndLoadSlotOrdered(\n ids: ComponentID[],\n loadOpts: ComponentLoadOptions,\n throwOnFailure = true\n ): Promise<GetManyRes> {\n if (!ids?.length) return { components: [], invalidComponents: [] };\n\n const workspaceScopeIdsMap: WorkspaceScopeIdsMap = await this.groupAndUpdateIds(ids);\n\n const groupsToHandle = await this.buildLoadGroups(workspaceScopeIdsMap);\n // prefix your command with \"BIT_LOG=*\" to see the detailed groups\n if (process.env.BIT_LOG) {\n printGroupsToHandle(groupsToHandle, this.logger);\n }\n const groupsRes = compact(\n await mapSeries(groupsToHandle, async (group) => {\n const { scopeIds, workspaceIds, aspects, core, seeders } = group;\n if (!workspaceIds.length && !scopeIds.length) return undefined;\n const res = await this.getAndLoadSlot(\n workspaceIds,\n scopeIds,\n { ...loadOpts, core, seeders, aspects },\n throwOnFailure\n );\n // We don't want to return components that were not asked originally (we do want to load them)\n if (!group.seeders) return undefined;\n return res;\n })\n );\n const finalRes = groupsRes.reduce(\n (acc, curr) => {\n return {\n components: [...acc.components, ...curr.components],\n invalidComponents: [...acc.invalidComponents, ...curr.invalidComponents],\n };\n },\n { components: [], invalidComponents: [] }\n );\n return finalRes;\n }\n\n private async buildLoadGroups(workspaceScopeIdsMap: WorkspaceScopeIdsMap): Promise<Array<LoadGroup>> {\n const allIds = [...workspaceScopeIdsMap.workspaceIds.values(), ...workspaceScopeIdsMap.scopeIds.values()];\n const groupedByIsCoreEnvs = groupBy(allIds, (id) => {\n return this.envs.isCoreEnv(id.toStringWithoutVersion());\n });\n const nonCoreEnvs = groupedByIsCoreEnvs.false || [];\n await this.populateScopeAndExtensionsCache(nonCoreEnvs, workspaceScopeIdsMap);\n const allExtIds: Map<string, ComponentID> = new Map();\n nonCoreEnvs.forEach((id) => {\n const idStr = id.toString();\n const fromCache = this.componentsExtensionsCache.get(idStr);\n if (!fromCache || !fromCache.extensions) {\n return;\n }\n fromCache.extensions.forEach((ext) => {\n if (!allExtIds.has(ext.stringId) && ext.newExtensionId) {\n allExtIds.set(ext.stringId, ext.newExtensionId);\n }\n });\n });\n const allExtCompIds = Array.from(allExtIds.values());\n await this.populateScopeAndExtensionsCache(allExtCompIds || [], workspaceScopeIdsMap);\n\n const allExtIdsStr = allExtCompIds.map((id) => id.toString());\n const groupedByIsExtOfAnother = groupBy(nonCoreEnvs, (id) => {\n return allExtIdsStr.includes(id.toString());\n });\n const extIdsFromTheList = (groupedByIsExtOfAnother.true || []).map((id) => id.toString());\n const extsNotFromTheList: ComponentID[] = [];\n for (const [, id] of allExtIds.entries()) {\n if (!extIdsFromTheList.includes(id.toString())) {\n extsNotFromTheList.push(id);\n }\n }\n\n await this.groupAndUpdateIds(extsNotFromTheList, workspaceScopeIdsMap);\n\n const layerdExtFromTheList = this.regroupExtIdsFromTheList(groupedByIsExtOfAnother.true);\n const layerdExtGroups = layerdExtFromTheList.map((ids) => {\n return {\n ids,\n core: false,\n aspects: true,\n seeders: true,\n };\n });\n\n const groupsToHandle = [\n // Always load first core envs\n { ids: groupedByIsCoreEnvs.true || [], core: true, aspects: true, seeders: true },\n { ids: extsNotFromTheList || [], core: false, aspects: true, seeders: false },\n ...layerdExtGroups,\n { ids: groupedByIsExtOfAnother.false || [], core: false, aspects: false, seeders: true },\n ];\n const groupsByWsScope = groupsToHandle.map((group) => {\n const groupedByWsScope = groupBy(group.ids, (id) => {\n return workspaceScopeIdsMap.workspaceIds.has(id.toString());\n });\n return {\n workspaceIds: groupedByWsScope.true || [],\n scopeIds: groupedByWsScope.false || [],\n core: group.core,\n aspects: group.aspects,\n seeders: group.seeders,\n };\n });\n return groupsByWsScope;\n }\n\n private regroupExtIdsFromTheList(ids: ComponentID[]): Array<ComponentID[]> {\n // TODO: implement this function\n // this should handle a case when you have:\n // compA that has extA and that extA has extB\n // in that case we now get the following group:\n // ids: [extA, extB]\n // while we need extB to be in a different group before extA\n return [ids];\n }\n\n private async getAndLoadSlot(\n workspaceIds: ComponentID[],\n scopeIds: ComponentID[],\n loadOpts: GetAndLoadSlotOpts,\n throwOnFailure = true\n ): Promise<GetManyRes> {\n const { workspaceComponents, scopeComponents, invalidComponents } = await this.getComponentsWithoutLoadExtensions(\n workspaceIds,\n scopeIds,\n loadOpts,\n throwOnFailure\n );\n\n const components = workspaceComponents.concat(scopeComponents);\n\n const allExtensions: ExtensionDataList[] = components.map((component) => {\n return component.state._consumer.extensions;\n });\n\n // Ensure we won't load the same extension many times\n // We don't want to ignore version here, as we do want to load different extensions with same id but different versions here\n const mergedExtensions = ExtensionDataList.mergeConfigs(allExtensions, false);\n await this.workspace.loadComponentsExtensions(mergedExtensions);\n let wsComponentsWithAspects = workspaceComponents;\n // if (loadOpts.seeders) {\n wsComponentsWithAspects = await pMap(workspaceComponents, (component) => this.executeLoadSlot(component), {\n concurrency: concurrentComponentsLimit(),\n });\n await this.warnAboutMisconfiguredEnvs(wsComponentsWithAspects);\n // }\n\n const withAspects = wsComponentsWithAspects.concat(scopeComponents);\n\n // It's important to load the workspace components as aspects here\n // otherwise the envs from the workspace won't be loaded at time\n // so we will get wrong dependencies from component who uses envs from the workspace\n if (loadOpts.loadSeedersAsAspects || (loadOpts.core && loadOpts.aspects)) {\n await this.loadCompsAsAspects(workspaceComponents.concat(scopeComponents), {\n loadApps: true,\n loadEnvs: true,\n loadAspects: loadOpts.aspects,\n core: loadOpts.core,\n seeders: loadOpts.seeders,\n idsToNotLoadAsAspects: loadOpts.idsToNotLoadAsAspects,\n });\n }\n\n return { components: withAspects, invalidComponents };\n }\n\n // TODO: this is similar to scope.main.runtime loadCompAspects func, we should merge them.\n async loadCompsAsAspects(\n components: Component[],\n opts: LoadCompAsAspectsOptions = { loadApps: true, loadEnvs: true, loadAspects: true }\n ): Promise<void> {\n const aspectIds: string[] = [];\n components.forEach((component) => {\n const firstTimeToLoad = this.componentLoadedSelfAsAspects.get(component.id.toString()) === undefined;\n const excluded = opts.idsToNotLoadAsAspects?.includes(component.id.toString());\n const isCore = this.aspectLoader.isCoreAspect(component.id.toStringWithoutVersion());\n const alreadyLoaded = this.aspectLoader.isAspectLoaded(component.id.toString());\n const skipLoading = excluded || isCore || alreadyLoaded || !firstTimeToLoad;\n\n if (skipLoading) {\n return;\n }\n const idStr = component.id.toString();\n const appData = component.state.aspects.get('teambit.harmony/application');\n if (opts.loadApps && appData?.data?.appName) {\n aspectIds.push(idStr);\n this.componentLoadedSelfAsAspects.set(idStr, true);\n }\n const envsData = component.state.aspects.get(EnvsAspect.id);\n if (opts.loadEnvs && (envsData?.data?.services || envsData?.data?.self || envsData?.data?.type === 'env')) {\n aspectIds.push(idStr);\n this.componentLoadedSelfAsAspects.set(idStr, true);\n }\n if (opts.loadAspects && envsData?.data?.type === 'aspect') {\n aspectIds.push(idStr);\n this.componentLoadedSelfAsAspects.set(idStr, true);\n }\n });\n if (!aspectIds.length) return;\n\n try {\n await this.workspace.loadAspects(aspectIds, true, 'self loading aspects', { useScopeAspectsCapsule: true });\n } catch (err: any) {\n this.logger.warn(`failed loading components as aspects for components ${aspectIds.join(', ')}`, err);\n // we ignore that errors at the moment\n }\n }\n\n private async populateScopeAndExtensionsCache(ids: ComponentID[], workspaceScopeIdsMap: WorkspaceScopeIdsMap) {\n return mapSeries(ids, async (id) => {\n const idStr = id.toString();\n let componentFromScope;\n if (!this.scopeComponentsCache.has(idStr)) {\n try {\n // Do not import automatically if it's missing, it will throw an error later\n componentFromScope = await this.workspace.scope.get(id, undefined, false);\n if (componentFromScope) {\n this.scopeComponentsCache.set(idStr, componentFromScope);\n }\n // This is fine here, as it will be handled later in the process\n } catch (err: any) {\n const wsAspectLoader = this.workspace.getWorkspaceAspectsLoader();\n wsAspectLoader.throwWsJsoncAspectNotFoundError(err);\n this.logger.warn(`populateScopeAndExtensionsCache - failed loading component ${idStr} from scope`, err);\n }\n }\n if (!this.componentsExtensionsCache.has(idStr) && workspaceScopeIdsMap.workspaceIds.has(idStr)) {\n componentFromScope = componentFromScope || this.scopeComponentsCache.get(idStr);\n const { extensions, errors } = await this.workspace.componentExtensions(id, componentFromScope, undefined, {\n loadExtensions: false,\n });\n this.componentsExtensionsCache.set(idStr, { extensions, errors });\n }\n });\n }\n\n private async warnAboutMisconfiguredEnvs(components: Component[]) {\n const allIds = uniq(components.map((component) => this.envs.getEnvId(component)));\n return Promise.all(allIds.map((envId) => this.workspace.warnAboutMisconfiguredEnv(envId)));\n }\n\n private async groupAndUpdateIds(\n ids: ComponentID[],\n existingGroups?: WorkspaceScopeIdsMap\n ): Promise<WorkspaceScopeIdsMap> {\n const result: WorkspaceScopeIdsMap = existingGroups || {\n scopeIds: new Map(),\n workspaceIds: new Map(),\n };\n\n await Promise.all(\n ids.map(async (componentId) => {\n const inWs = await this.isInWsIncludeDeleted(componentId);\n\n if (!inWs) {\n result.scopeIds.set(componentId.toString(), componentId);\n return undefined;\n }\n const resolvedVersions = this.resolveVersion(componentId);\n result.workspaceIds.set(resolvedVersions.toString(), resolvedVersions);\n return undefined;\n })\n );\n return result;\n }\n\n private async isInWsIncludeDeleted(componentId: ComponentID): Promise<boolean> {\n const nonDeletedWsIds = await this.workspace.listIds();\n const deletedWsIds = await this.workspace.locallyDeletedIds();\n const allWsIds = nonDeletedWsIds.concat(deletedWsIds);\n const inWs = allWsIds.find((id) => id.isEqual(componentId, { ignoreVersion: !componentId.hasVersion() }));\n return !!inWs;\n }\n\n private async getComponentsWithoutLoadExtensions(\n workspaceIds: ComponentID[],\n scopeIds: ComponentID[],\n loadOpts: GetAndLoadSlotOpts,\n throwOnFailure = true\n ) {\n const invalidComponents: InvalidComponent[] = [];\n const errors: { id: ComponentID; err: Error }[] = [];\n const loadOptsWithDefaults: ComponentLoadOptions = Object.assign(\n // We don't want to load extension or execute the load slot at this step\n // we will do it later\n // this important for better performance\n // We don't want to store deps in fs cache, as at this point extensions are not loaded yet\n // so it might save a wrong deps into the cache\n { loadExtensions: false, executeLoadSlot: false },\n loadOpts || {}\n );\n\n const idsIndex = {};\n\n workspaceIds.forEach((id) => {\n idsIndex[id.toString()] = id;\n });\n\n const {\n components: legacyComponents,\n invalidComponents: legacyInvalidComponents,\n removedComponents,\n } = await this.workspace.consumer.loadComponents(\n ComponentIdList.fromArray(workspaceIds),\n false,\n loadOptsWithDefaults\n );\n const allLegacyComponents = legacyComponents.concat(removedComponents);\n legacyInvalidComponents.forEach((invalidComponent) => {\n const entry = { id: idsIndex[invalidComponent.id.toString()], err: invalidComponent.error };\n if (ConsumerComponent.isComponentInvalidByErrorType(invalidComponent.error)) {\n if (throwOnFailure) throw invalidComponent.error;\n invalidComponents.push(entry);\n }\n if (\n this.isComponentNotExistsError(invalidComponent.error) ||\n invalidComponent.error instanceof ComponentNotFoundInPath\n ) {\n errors.push(entry);\n }\n });\n\n const getWithCatch = (id, legacyComponent) => {\n return this.get(id, legacyComponent, undefined, undefined, loadOptsWithDefaults).catch((err) => {\n if (ConsumerComponent.isComponentInvalidByErrorType(err) && !throwOnFailure) {\n invalidComponents.push({\n id,\n err,\n });\n return undefined;\n }\n if (this.isComponentNotExistsError(err) || err instanceof ComponentNotFoundInPath) {\n errors.push({\n id,\n err,\n });\n return undefined;\n }\n throw err;\n });\n };\n\n // await this.getConsumerComponent(id, loadOpts)\n const componentsP = pMap(\n allLegacyComponents,\n (legacyComponent) => {\n // const componentsP = Promise.all(\n // allLegacyComponents.map(async (legacyComponent) => {\n let id = idsIndex[legacyComponent.id.toString()];\n if (!id) {\n const withoutVersion = idsIndex[legacyComponent.id.toStringWithoutVersion()] || legacyComponent.id;\n if (withoutVersion) {\n id = withoutVersion.changeVersion(legacyComponent.id.version);\n idsIndex[legacyComponent.id.toString()] = id;\n }\n }\n return getWithCatch(id, legacyComponent);\n },\n {\n concurrency: concurrentComponentsLimit(),\n }\n );\n\n errors.forEach((err) => {\n this.logger.console(`failed loading component ${err.id.toString()}, see full error in debug.log file`);\n this.logger.warn(`failed loading component ${err.id.toString()}`, err.err);\n });\n const components: Component[] = compact(await componentsP);\n\n // Here we need to load many, otherwise we will get wrong overrides dependencies data\n // as when loading the next batch of components (next group) we won't have the envs loaded\n\n try {\n // We don't want to load envs as part of this step, they will be loaded later\n const scopeComponents = await this.workspace.scope.loadMany(scopeIds, undefined, {\n loadApps: false,\n loadEnvs: false,\n });\n return {\n workspaceComponents: components,\n scopeComponents,\n invalidComponents,\n };\n } catch (err) {\n const wsAspectLoader = this.workspace.getWorkspaceAspectsLoader();\n wsAspectLoader.throwWsJsoncAspectNotFoundError(err);\n throw err;\n }\n }\n\n async getInvalid(ids: Array<ComponentID>): Promise<InvalidComponent[]> {\n const idsWithoutEmpty = compact(ids);\n const errors: InvalidComponent[] = [];\n const longProcessLogger = this.logger.createLongProcessLogger('loading components', ids.length);\n await mapSeries(idsWithoutEmpty, async (id: ComponentID) => {\n longProcessLogger.logProgress(id.toString());\n try {\n await this.workspace.consumer.loadComponent(id);\n } catch (err: any) {\n if (ConsumerComponent.isComponentInvalidByErrorType(err)) {\n errors.push({\n id,\n err,\n });\n return;\n }\n throw err;\n }\n });\n return errors;\n }\n\n async get(\n componentId: ComponentID,\n legacyComponent?: ConsumerComponent,\n useCache = true,\n storeInCache = true,\n loadOpts?: ComponentLoadOptions,\n getOpts: ComponentGetOneOptions = { resolveIdVersion: true }\n ): Promise<Component> {\n const loadOptsWithDefaults: ComponentLoadOptions = Object.assign(\n { loadExtensions: true, executeLoadSlot: true },\n loadOpts || {}\n );\n const id = getOpts?.resolveIdVersion ? this.resolveVersion(componentId) : componentId;\n const fromCache = this.getFromCache(componentId, loadOptsWithDefaults);\n if (fromCache && useCache) {\n return fromCache;\n }\n let consumerComponent = legacyComponent;\n const inWs = await this.isInWsIncludeDeleted(componentId);\n if (inWs && !consumerComponent) {\n consumerComponent = await this.getConsumerComponent(id, loadOptsWithDefaults);\n }\n\n // in case of out-of-sync, the id may changed during the load process\n const updatedId = consumerComponent ? consumerComponent.id : id;\n const component = await this.loadOne(updatedId, consumerComponent, loadOptsWithDefaults);\n if (storeInCache) {\n this.addMultipleEnvsIssueIfNeeded(component); // it's in storeInCache block, otherwise, it wasn't fully loaded\n this.saveInCache(component, loadOptsWithDefaults);\n }\n return component;\n }\n\n async getIfExist(componentId: ComponentID) {\n try {\n return await this.get(componentId);\n } catch (err: any) {\n if (this.isComponentNotExistsError(err)) {\n return undefined;\n }\n throw err;\n }\n }\n\n private resolveVersion(componentId: ComponentID): ComponentID {\n const bitIdWithVersion: ComponentID = getLatestVersionNumber(\n this.workspace.consumer.bitmapIdsFromCurrentLaneIncludeRemoved,\n componentId\n );\n const id = bitIdWithVersion.version ? componentId.changeVersion(bitIdWithVersion.version) : componentId;\n return id;\n }\n\n private addMultipleEnvsIssueIfNeeded(component: Component) {\n const envs = this.envs.getAllEnvsConfiguredOnComponent(component);\n const envIds = uniq(envs.map((env) => env.id));\n if (envIds.length < 2) {\n return;\n }\n component.state.issues.getOrCreate(IssuesClasses.MultipleEnvs).data = envIds;\n }\n\n clearCache() {\n this.componentsCache.deleteAll();\n this.scopeComponentsCache.deleteAll();\n this.componentsExtensionsCache.deleteAll();\n this.componentLoadedSelfAsAspects.deleteAll();\n }\n\n clearComponentCache(id: ComponentID) {\n const idStr = id.toString();\n const cachesToClear = [\n this.componentsCache,\n this.scopeComponentsCache,\n this.componentsExtensionsCache,\n this.componentLoadedSelfAsAspects,\n ];\n cachesToClear.forEach((cache) => {\n for (const cacheKey of cache.keys()) {\n if (cacheKey === idStr || cacheKey.startsWith(`${idStr}:`)) {\n cache.delete(cacheKey);\n }\n }\n });\n }\n\n private async loadOne(id: ComponentID, consumerComponent?: ConsumerComponent, loadOpts?: ComponentLoadOptions) {\n const idStr = id.toString();\n const componentFromScope = this.scopeComponentsCache.has(idStr)\n ? this.scopeComponentsCache.get(idStr)\n : await this.workspace.scope.get(id);\n if (!consumerComponent) {\n if (!componentFromScope) throw new MissingBitMapComponent(id.toString());\n return componentFromScope;\n }\n const extErrorsFromCache = this.componentsExtensionsCache.has(idStr)\n ? this.componentsExtensionsCache.get(idStr)\n : undefined;\n const { extensions, errors } =\n extErrorsFromCache ||\n (await this.workspace.componentExtensions(id, componentFromScope, undefined, {\n loadExtensions: loadOpts?.loadExtensions,\n }));\n if (errors?.some((err) => err instanceof MergeConfigConflict)) {\n consumerComponent.issues.getOrCreate(IssuesClasses.MergeConfigHasConflict).data = true;\n }\n\n // temporarily mutate consumer component extensions until we remove all direct access from legacy to extensions data\n // TODO: remove this once we remove all direct access from legacy code to extensions data\n consumerComponent.extensions = extensions;\n\n const state = new State(\n new Config(consumerComponent),\n await this.workspace.createAspectList(extensions),\n ComponentFS.fromVinyls(consumerComponent.files),\n consumerComponent.dependencies,\n consumerComponent\n );\n if (componentFromScope) {\n // Removed by @gilad. do not mutate the component from the scope\n // componentFromScope.state = state;\n // const workspaceComponent = WorkspaceComponent.fromComponent(componentFromScope, this.workspace);\n const workspaceComponent = new WorkspaceComponent(\n componentFromScope.id,\n componentFromScope.head,\n state,\n componentFromScope.tags,\n this.workspace\n );\n if (loadOpts?.executeLoadSlot) {\n return this.executeLoadSlot(workspaceComponent, loadOpts);\n }\n // const updatedComp = await this.executeLoadSlot(workspaceComponent, loadOpts);\n return workspaceComponent;\n }\n const newComponent = this.newComponentFromState(id, state);\n if (!loadOpts?.executeLoadSlot) {\n return newComponent;\n }\n return this.executeLoadSlot(newComponent, loadOpts);\n }\n\n private saveInCache(component: Component, loadOpts?: ComponentLoadOptions): void {\n const cacheKey = createComponentCacheKey(component.id, loadOpts);\n this.componentsCache.set(cacheKey, component);\n }\n\n /**\n * make sure that not only the id-str match, but also the legacy-id.\n * this is needed because the ComponentID.toString() is the same whether or not the legacy-id has\n * scope-name, as it includes the defaultScope if the scope is empty.\n * as a result, when out-of-sync is happening and the id is changed to include scope-name in the\n * legacy-id, the component is the cache has the old id.\n */\n private getFromCache(componentId: ComponentID, loadOpts?: ComponentLoadOptions): Component | undefined {\n const bitIdWithVersion: ComponentID = this.resolveVersion(componentId);\n const id = bitIdWithVersion.version ? componentId.changeVersion(bitIdWithVersion.version) : componentId;\n const cacheKey = createComponentCacheKey(id, loadOpts);\n // If we try to look for the cache without load extensions/ without execute load slot\n // but there is an entry after the load, we want to use it as well.\n // as we want the component, so if we already loaded it with everything, it's fine.\n // this sometime relevant for cases with tiny cache size (during tag)\n const cacheKeyWithTrueLoadOpts = createComponentCacheKey(id, { loadExtensions: true, executeLoadSlot: true });\n const fromCache = this.componentsCache.get(cacheKey) || this.componentsCache.get(cacheKeyWithTrueLoadOpts);\n if (fromCache && fromCache.id.isEqual(id)) {\n return fromCache;\n }\n return undefined;\n }\n\n private async getConsumerComponent(\n id: ComponentID,\n loadOpts: ComponentLoadOptions = {}\n ): Promise<ConsumerComponent | undefined> {\n loadOpts.originatedFromHarmony = true;\n try {\n const { components, removedComponents } = await this.workspace.consumer.loadComponents(\n ComponentIdList.fromArray([id]),\n true,\n loadOpts\n );\n return components?.[0] || removedComponents?.[0];\n } catch (err: any) {\n // don't return undefined for any error. otherwise, if the component is invalid (e.g. main\n // file is missing) it returns the model component later unexpectedly, or if it's new, it\n // shows MissingBitMapComponent error incorrectly.\n if (this.isComponentNotExistsError(err)) {\n this.logger.debug(\n `failed loading component \"${id.toString()}\" from the workspace due to \"${err.name}\" error\\n${err.message}`\n );\n return undefined;\n }\n throw err;\n }\n }\n\n private isComponentNotExistsError(err: Error): boolean {\n return err instanceof ComponentNotFound || err instanceof MissingBitMapComponent;\n }\n\n private async executeLoadSlot(component: Component, loadOpts?: ComponentLoadOptions) {\n if (component.state._consumer.removed) {\n // if it was soft-removed now, the component is not in the FS. loading aspects such as composition ends up with\n // errors as they try to read component files from the filesystem.\n return component;\n }\n\n // Special load events which runs from the workspace but should run from the correct aspect\n // TODO: remove this once those extensions dependent on workspace\n const envsData = await this.envs.calcDescriptor(component, { skipWarnings: !!this.workspace.inInstallContext });\n\n // Move to deps resolver main runtime once we switch ws<> deps resolver direction\n const policy = await this.dependencyResolver.mergeVariantPolicies(\n component.config.extensions,\n component.id,\n component.state._consumer.files\n );\n const dependenciesList = await this.dependencyResolver.extractDepsFromLegacy(component, policy);\n\n const depResolverData = {\n packageName: this.dependencyResolver.calcPackageName(component),\n dependencies: dependenciesList.serialize(),\n policy: policy.serialize(),\n };\n\n // Make sure we are adding the envs / deps data first because other on load events might depend on it\n await Promise.all([\n this.upsertExtensionData(component, EnvsAspect.id, envsData),\n this.upsertExtensionData(component, DependencyResolverAspect.id, depResolverData),\n ]);\n\n // We are updating the component state with the envs and deps data here, so in case we have other slots that depend on this data\n // they will be able to get it, as it's very common use case that during on load someone want to access to the component env for example\n const aspectListWithEnvsAndDeps = await this.workspace.createAspectList(component.state.config.extensions);\n component.state.aspects = aspectListWithEnvsAndDeps;\n\n const entries = this.workspace.onComponentLoadSlot.toArray();\n await mapSeries(entries, async ([extension, onLoad]) => {\n const data = await onLoad(component, loadOpts);\n await this.upsertExtensionData(component, extension, data);\n // Update the aspect list to have changes happened during the on load slot (new data added above)\n component.state.aspects.upsertEntry(await this.workspace.resolveComponentId(extension), data);\n });\n\n return component;\n }\n\n private newComponentFromState(id: ComponentID, state: State): Component {\n return new WorkspaceComponent(id, null, state, new TagMap(), this.workspace);\n }\n\n private async upsertExtensionData(component: Component, extension: string, data: any) {\n if (!data) return;\n const existingExtension = component.state.config.extensions.findExtension(extension);\n if (existingExtension) {\n // Only merge top level of extension data\n Object.assign(existingExtension.data, data);\n return;\n }\n component.state.config.extensions.push(await this.getDataEntry(extension, data));\n }\n\n private async getDataEntry(extension: string, data: { [key: string]: any }): Promise<ExtensionDataEntry> {\n // TODO: @gilad we need to refactor the extension data entry api.\n return new ExtensionDataEntry(undefined, undefined, extension, undefined, data);\n }\n}\n\nfunction createComponentCacheKey(id: ComponentID, loadOpts?: ComponentLoadOptions): string {\n const relevantOpts = pick(loadOpts, ['loadExtensions', 'executeLoadSlot']);\n return `${id.toString()}:${JSON.stringify(sortKeys(relevantOpts ?? {}))}`;\n}\n\nfunction sortKeys(obj: Object) {\n return fromPairs(Object.entries(obj).sort(([k1], [k2]) => k1.localeCompare(k2)));\n}\n\nfunction printGroupsToHandle(groupsToHandle: Array<LoadGroup>, logger: Logger): void {\n groupsToHandle.forEach((group) => {\n const { scopeIds, workspaceIds, aspects, core, seeders } = group;\n logger.console(\n `workspace-component-loader ~ groupsToHandle ${JSON.stringify(\n {\n scopeIds: scopeIds.map((id) => id.toString()),\n workspaceIds: workspaceIds.map((id) => id.toString()),\n aspects,\n core,\n seeders,\n },\n null,\n 2\n )}`\n );\n });\n}\n"],"mappings":";;;;;;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,sB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,IAAAC,cAAI,EAACxQ,QAAQ,EAAE,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;EAC1E,OAAQ,GAAEc,EAAE,CAAC0C,QAAQ,CAAC,CAAE,IAAGiN,IAAI,CAACC,SAAS,CAACC,QAAQ,CAACJ,YAAY,IAAI,CAAC,CAAC,CAAC,CAAE,EAAC;AAC3E;AAEA,SAASI,QAAQA,CAAChU,GAAW,EAAE;EAC7B,OAAO,IAAAiU,mBAAS,EAAC1T,MAAM,CAACwH,OAAO,CAAC/H,GAAG,CAAC,CAACkU,IAAI,CAAC,CAAC,CAACC,EAAE,CAAC,EAAE,CAACC,EAAE,CAAC,KAAKD,EAAE,CAACE,aAAa,CAACD,EAAE,CAAC,CAAC,CAAC;AAClF;AAEA,SAASnP,mBAAmBA,CAACL,cAAgC,EAAEpC,MAAc,EAAQ;EACnFoC,cAAc,CAACzD,OAAO,CAAEiE,KAAK,IAAK;IAChC,MAAM;MAAEC,QAAQ;MAAEC,YAAY;MAAEC,OAAO;MAAEC,IAAI;MAAEC;IAAQ,CAAC,GAAGL,KAAK;IAChE5C,MAAM,CAAC4L,OAAO,CACX,+CAA8C0F,IAAI,CAACC,SAAS,CAC3D;MACE1O,QAAQ,EAAEA,QAAQ,CAACoC,GAAG,CAAEtD,EAAE,IAAKA,EAAE,CAAC0C,QAAQ,CAAC,CAAC,CAAC;MAC7CvB,YAAY,EAAEA,YAAY,CAACmC,GAAG,CAAEtD,EAAE,IAAKA,EAAE,CAAC0C,QAAQ,CAAC,CAAC,CAAC;MACrDtB,OAAO;MACPC,IAAI;MACJC;IACF,CAAC,EACD,IAAI,EACJ,CACF,CAAE,EACJ,CAAC;EACH,CAAC,CAAC;AACJ"}
|
package/dist/workspace.js
CHANGED
|
@@ -519,9 +519,7 @@ class Workspace {
|
|
|
519
519
|
* list all workspace components.
|
|
520
520
|
*/
|
|
521
521
|
async list(filter, loadOpts) {
|
|
522
|
-
const loadOptsWithDefaults = Object.assign({
|
|
523
|
-
loadSeedersAsAspects: false
|
|
524
|
-
}, loadOpts || {});
|
|
522
|
+
const loadOptsWithDefaults = Object.assign(loadOpts || {});
|
|
525
523
|
const legacyIds = this.consumer.bitMap.getAllIdsAvailableOnLane();
|
|
526
524
|
const ids = await this.resolveMultipleComponentIds(legacyIds);
|
|
527
525
|
const idsToGet = filter && filter.limit ? (0, _lodash().slice)(ids, filter.offset, filter.offset + filter.limit) : ids;
|