@teambit/workspace 0.0.1002 → 0.0.1004

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.
@@ -0,0 +1 @@
1
+ {"version":3,"names":["WorkspaceAspectsLoader","constructor","workspace","scope","aspectLoader","envs","dependencyResolver","logger","harmony","onAspectsResolveSlot","onRootAspectAddedSlot","consumer","resolvedInstalledAspects","Map","loadAspects","ids","throwOnError","neededFor","opts","defaultOpts","useScopeAspectsCapsule","mergedOpts","callId","Math","floor","random","loggerPrefix","info","length","join","JSON","stringify","notLoadedIds","filter","id","isAspectLoaded","coreAspectsStringIds","getCoreAspectIds","idsWithoutCore","difference","componentIds","resolveMultipleComponentIds","workspaceIds","nonWorkspaceIds","groupIdsByWorkspaceExistence","idsToLoadFromWs","scopeAspectIds","currentLane","getCurrentLaneObject","nonWorkspaceIdsString","map","toString","undefined","packageManagerConfigRootDir","path","err","ComponentNotFound","config","get","configStr","workspaceConfig","raw","includes","BitError","aspectsDefs","resolveAspects","excludeCore","requestedOnly","requireableComponents","aspectDefsToRequireableComponents","manifests","getManifestsFromRequireableExtensions","potentialPluginsIndexes","compact","manifest","index","isValidAspect","loadExtensionsByManifests","pluginsRequireableComponents","pluginsManifests","debug","manifestIds","concat","runtimeName","filterByRuntime","idsToResolve","extensionsIds","coreAspectsIds","configuredAspects","getConfiguredAspects","userAspectsIds","rootAspectsIds","componentIdsToResolve","components","importAndGetAspects","runOnAspectsResolveFunctions","graph","getAspectsGraphWithoutCore","isAspect","bind","aspects","nodes","node","attr","workspaceComps","nonWorkspaceComps","groupComponentsByWorkspaceExistence","workspaceCompsIds","c","stringIds","wsAspectDefs","getWorkspaceAspectResolver","linkIfMissingWorkspaceAspects","componentsToResolveFromScope","componentsToResolveFromInstalled","nonWorkspaceCompsGroups","groupBy","component","isEnv","true","false","scopeIds","scopeAspectsDefs","installedAspectsDefs","getInstalledAspectResolver","coreAspectDefs","Promise","all","coreId","rawDef","getAspectDef","loadDefinition","coreAspect","runtimePath","allDefs","idsToFilter","idStr","ComponentID","fromString","filteredDefs","filterAspectDefs","use","aspectIdStr","aspectId","resolveComponentId","inWs","hasId","aspectIdToAdd","toStringWithoutVersion","aspectsComponent","aspectsComponents","Error","setExtension","overrideExisting","ignoreVersion","write","addInMemoryConfiguredAspect","runOnRootAspectAddedFunctions","getConfiguredUserAspectsPackages","options","componentsToGetPackages","externalsOnly","packages","aspectComponent","packageName","getPackageName","version","aspectDefs","aspectDef","localPath","aspectPath","requireFunc","plugins","getPlugins","has","load","MainRuntime","name","aspect","require","getRuntimePath","RequireableComponent","missingPaths","existsP","exist","fs","pathExists","bitIds","_legacy","linkToNodeModulesByIds","resolve","workspaceAspectResolver","compStringId","push","getComponentPackagePath","aspectFilePath","getAspectFilePath","funcs","getOnAspectsResolveFunctions","pMapSeries","func","error","aspectsResolveFunctions","values","aspectsId","getOnRootAspectAddedFunctions","RootAspectAddedFunctions","rootIds","installedAspectsResolver","resolveInstalledAspectRecursively","aspectStringId","resolvedPath","set","parent","predecessors","parentPath","resolveFrom","findRoot","consoleWarning","message","buildOneGraphForComponents","loadComponentsExtensions","extensions","originatedFrom","extensionsIdsP","extensionEntry","extensionId","stringId","loadedExtensions","extensionsToLoad","isUsingAspectEnv","isUsingEnvEnv","importAndGetMany","existOnWorkspace"],"sources":["workspace-aspects-loader.ts"],"sourcesContent":["import findRoot from 'find-root';\nimport { resolveFrom } from '@teambit/toolbox.modules.module-resolver';\nimport { Graph } from '@teambit/graph.cleargraph';\nimport { ExtensionDataList } from '@teambit/legacy/dist/consumer/config/extension-data';\nimport { Harmony } from '@teambit/harmony';\nimport {\n AspectDefinition,\n AspectLoaderMain,\n AspectResolver,\n getAspectDef,\n ResolvedAspect,\n} from '@teambit/aspect-loader';\nimport { MainRuntime } from '@teambit/cli';\nimport fs from 'fs-extra';\nimport { RequireableComponent } from '@teambit/harmony.modules.requireable-component';\nimport { linkToNodeModulesByIds } from '@teambit/workspace.modules.node-modules-linker';\nimport { BitId } from '@teambit/legacy-bit-id';\nimport { ComponentNotFound } from '@teambit/legacy/dist/scope/exceptions';\nimport pMapSeries from 'p-map-series';\nimport { difference, compact, groupBy } from 'lodash';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport { Component, ComponentID, ResolveAspectsOptions } from '@teambit/component';\nimport { ScopeMain } from '@teambit/scope';\nimport { Logger } from '@teambit/logger';\nimport { BitError } from '@teambit/bit-error';\nimport { EnvsMain } from '@teambit/envs';\nimport { ConfigMain } from '@teambit/config';\nimport { DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { ShouldLoadFunc } from './build-graph-from-fs';\nimport type { Workspace } from './workspace';\nimport { OnAspectsResolve, OnAspectsResolveSlot, OnRootAspectAdded, OnRootAspectAddedSlot } from './workspace.provider';\n\nexport type GetConfiguredUserAspectsPackagesOptions = {\n externalsOnly?: boolean;\n};\n\nexport type WorkspaceLoadAspectsOptions = {\n useScopeAspectsCapsule?: boolean;\n};\n\nexport type AspectPackage = { packageName: string; version: string };\n\nexport class WorkspaceAspectsLoader {\n private consumer: Consumer;\n private resolvedInstalledAspects: Map<string, string | null>;\n\n constructor(\n private workspace: Workspace,\n private scope: ScopeMain,\n private aspectLoader: AspectLoaderMain,\n private envs: EnvsMain,\n private dependencyResolver: DependencyResolverMain,\n private logger: Logger,\n private harmony: Harmony,\n private onAspectsResolveSlot: OnAspectsResolveSlot,\n private onRootAspectAddedSlot: OnRootAspectAddedSlot\n ) {\n this.consumer = this.workspace.consumer;\n this.resolvedInstalledAspects = new Map();\n }\n\n /**\n * load aspects from the workspace and if not exists in the workspace, load from the node_modules.\n * keep in mind that the graph may have circles.\n */\n async loadAspects(\n ids: string[] = [],\n throwOnError = false,\n neededFor?: string,\n opts: WorkspaceLoadAspectsOptions = {}\n ): Promise<string[]> {\n const defaultOpts: WorkspaceLoadAspectsOptions = {\n useScopeAspectsCapsule: false,\n };\n const mergedOpts = { ...defaultOpts, ...opts };\n\n // generate a random callId to be able to identify the call from the logs\n const callId = Math.floor(Math.random() * 1000);\n const loggerPrefix = `[${callId}] loadAspects,`;\n this.logger.info(`${loggerPrefix} loading ${ids.length} aspects.\nids: ${ids.join(', ')}\nneeded-for: ${neededFor || '<unknown>'}. using opts: ${JSON.stringify(mergedOpts, null, 2)}`);\n const notLoadedIds = ids.filter((id) => !this.aspectLoader.isAspectLoaded(id));\n if (!notLoadedIds.length) return [];\n const coreAspectsStringIds = this.aspectLoader.getCoreAspectIds();\n const idsWithoutCore: string[] = difference(notLoadedIds, coreAspectsStringIds);\n\n const componentIds = await this.workspace.resolveMultipleComponentIds(idsWithoutCore);\n const { workspaceIds, nonWorkspaceIds } = await this.groupIdsByWorkspaceExistence(componentIds);\n let idsToLoadFromWs = componentIds;\n let scopeAspectIds: string[] = [];\n\n if (mergedOpts.useScopeAspectsCapsule) {\n idsToLoadFromWs = workspaceIds;\n const currentLane = await this.consumer.getCurrentLaneObject();\n\n const nonWorkspaceIdsString = nonWorkspaceIds.map((id) => id.toString());\n try {\n scopeAspectIds = await this.scope.loadAspects(\n nonWorkspaceIdsString,\n throwOnError,\n neededFor,\n currentLane || undefined,\n {\n packageManagerConfigRootDir: this.workspace.path,\n }\n );\n } catch (err: any) {\n if (err instanceof ComponentNotFound) {\n const config = this.harmony.get<ConfigMain>('teambit.harmony/config');\n const configStr = JSON.stringify(config.workspaceConfig?.raw || {});\n if (configStr.includes(err.id)) {\n throw new BitError(`error: a component \"${err.id}\" was not found\n your workspace.jsonc has this component-id set. you might want to remove/change it.`);\n }\n }\n\n throw err;\n }\n }\n\n const aspectsDefs = await this.resolveAspects(undefined, idsToLoadFromWs, {\n excludeCore: true,\n requestedOnly: false,\n throwOnError,\n ...mergedOpts,\n });\n const requireableComponents = this.aspectDefsToRequireableComponents(aspectsDefs);\n const manifests = await this.aspectLoader.getManifestsFromRequireableExtensions(\n requireableComponents,\n throwOnError\n );\n const potentialPluginsIndexes = compact(\n manifests.map((manifest, index) => {\n if (this.aspectLoader.isValidAspect(manifest)) return undefined;\n return index;\n })\n );\n await this.aspectLoader.loadExtensionsByManifests(manifests, throwOnError, idsWithoutCore);\n\n // Try require components for potential plugins\n const pluginsRequireableComponents = potentialPluginsIndexes.map((index) => {\n return requireableComponents[index];\n });\n // Do the require again now that the plugins defs already registered\n const pluginsManifests = await this.aspectLoader.getManifestsFromRequireableExtensions(\n pluginsRequireableComponents,\n throwOnError\n );\n await this.aspectLoader.loadExtensionsByManifests(pluginsManifests, throwOnError);\n this.logger.debug(`${loggerPrefix} finish loading aspects`);\n const manifestIds = manifests.map((manifest) => manifest.id);\n return compact(manifestIds.concat(scopeAspectIds));\n }\n\n async resolveAspects(\n runtimeName?: string,\n componentIds?: ComponentID[],\n opts?: ResolveAspectsOptions\n ): Promise<AspectDefinition[]> {\n const callId = Math.floor(Math.random() * 1000);\n const loggerPrefix = `[${callId}] workspace resolveAspects,`;\n\n this.logger.debug(\n `${loggerPrefix}, resolving aspects for - runtimeName: ${runtimeName}, componentIds: ${componentIds}`\n );\n const defaultOpts: ResolveAspectsOptions = {\n excludeCore: false,\n requestedOnly: false,\n filterByRuntime: true,\n useScopeAspectsCapsule: false,\n };\n const mergedOpts = { ...defaultOpts, ...opts };\n const idsToResolve = componentIds ? componentIds.map((id) => id.toString()) : this.harmony.extensionsIds;\n const coreAspectsIds = this.aspectLoader.getCoreAspectIds();\n const configuredAspects = this.aspectLoader.getConfiguredAspects();\n const userAspectsIds: string[] = difference(idsToResolve, coreAspectsIds);\n const rootAspectsIds: string[] = difference(configuredAspects, coreAspectsIds);\n const componentIdsToResolve = await this.workspace.resolveMultipleComponentIds(userAspectsIds);\n const components = await this.importAndGetAspects(componentIdsToResolve);\n\n // Run the on load slot\n await this.runOnAspectsResolveFunctions(components);\n\n const graph = await this.getAspectsGraphWithoutCore(components, this.isAspect.bind(this));\n const aspects = graph.nodes.map((node) => node.attr);\n this.logger.debug(`${loggerPrefix} found ${aspects.length} aspects in the aspects-graph`);\n const { workspaceComps, nonWorkspaceComps } = await this.groupComponentsByWorkspaceExistence(aspects);\n const workspaceCompsIds = workspaceComps.map((c) => c.id);\n this.logger.debug(\n `${loggerPrefix} found ${workspaceComps.length} components in the workspace:\\n${workspaceComps\n .map((c) => c.id.toString())\n .join('\\n')}`\n );\n this.logger.debug(\n `${loggerPrefix} ${\n nonWorkspaceComps.length\n } components are not in the workspace and are loaded from the scope capsules or from the node_modules:\\n${nonWorkspaceComps\n .map((c) => c.id.toString())\n .join('\\n')}`\n );\n\n const stringIds: string[] = [];\n const wsAspectDefs = await this.aspectLoader.resolveAspects(\n workspaceComps,\n this.getWorkspaceAspectResolver(stringIds, runtimeName)\n );\n\n await this.linkIfMissingWorkspaceAspects(wsAspectDefs, workspaceCompsIds);\n\n // TODO: hard coded use the old approach and loading from the scope capsules\n // This is because right now loading from the ws node_modules causes issues in some cases\n // like for the cloud app\n // it should be removed once we fix the issues\n mergedOpts.useScopeAspectsCapsule = true;\n\n let componentsToResolveFromScope = nonWorkspaceComps;\n let componentsToResolveFromInstalled: Component[] = [];\n if (!mergedOpts.useScopeAspectsCapsule) {\n const nonWorkspaceCompsGroups = groupBy(nonWorkspaceComps, (component) => this.envs.isEnv(component));\n componentsToResolveFromScope = nonWorkspaceCompsGroups.true || [];\n componentsToResolveFromInstalled = nonWorkspaceCompsGroups.false || [];\n }\n\n const scopeIds = componentsToResolveFromScope.map((c) => c.id);\n this.logger.debug(\n `${loggerPrefix} ${\n scopeIds.length\n } components are not in the workspace and are loaded from the scope capsules:\\n${scopeIds\n .map((id) => id.toString())\n .join('\\n')}`\n );\n const scopeAspectsDefs: AspectDefinition[] = scopeIds.length\n ? await this.scope.resolveAspects(runtimeName, scopeIds, mergedOpts)\n : [];\n \n this.logger.debug(\n `${loggerPrefix} ${\n componentsToResolveFromInstalled.length\n } components are not in the workspace and are loaded from the node_modules:\\n${componentsToResolveFromInstalled\n .map((c) => c.id.toString())\n .join('\\n')}`\n );\n const installedAspectsDefs: AspectDefinition[] = componentsToResolveFromInstalled.length\n ? await this.aspectLoader.resolveAspects(\n componentsToResolveFromInstalled,\n this.getInstalledAspectResolver(graph, rootAspectsIds, runtimeName, {\n throwOnError: opts?.throwOnError ?? false,\n })\n )\n : [];\n\n let coreAspectDefs = await Promise.all(\n coreAspectsIds.map(async (coreId) => {\n const rawDef = await getAspectDef(coreId, runtimeName);\n return this.aspectLoader.loadDefinition(rawDef);\n })\n );\n\n // due to lack of workspace and scope runtimes. TODO: fix after adding them.\n if (runtimeName && mergedOpts.filterByRuntime) {\n coreAspectDefs = coreAspectDefs.filter((coreAspect) => {\n return coreAspect.runtimePath;\n });\n }\n const allDefs = wsAspectDefs.concat(coreAspectDefs).concat(scopeAspectsDefs).concat(installedAspectsDefs);\n const idsToFilter = idsToResolve.map((idStr) => ComponentID.fromString(idStr));\n const filteredDefs = this.aspectLoader.filterAspectDefs(allDefs, idsToFilter, runtimeName, mergedOpts);\n return filteredDefs;\n }\n\n async use(aspectIdStr: string): Promise<string> {\n let aspectId = await this.workspace.resolveComponentId(aspectIdStr);\n const inWs = await this.workspace.hasId(aspectId);\n let aspectIdToAdd = aspectId.toStringWithoutVersion();\n\n let aspectsComponent;\n // let aspectPackage;\n if (!inWs) {\n const aspectsComponents = await this.importAndGetAspects([aspectId]);\n if (aspectsComponents[0]) {\n aspectsComponent = aspectsComponents[0];\n aspectId = aspectsComponent.id;\n aspectIdToAdd = aspectId.toString();\n }\n }\n\n const config = this.harmony.get<ConfigMain>('teambit.harmony/config').workspaceConfig;\n if (!config) {\n throw new Error(`use() unable to get the workspace config`);\n }\n config.setExtension(\n aspectIdToAdd,\n {},\n {\n overrideExisting: false,\n ignoreVersion: false,\n }\n );\n await config.write();\n this.aspectLoader.addInMemoryConfiguredAspect(aspectIdToAdd);\n await this.runOnRootAspectAddedFunctions(aspectId, inWs);\n return aspectIdToAdd;\n }\n\n async getConfiguredUserAspectsPackages(\n options: GetConfiguredUserAspectsPackagesOptions = {}\n ): Promise<AspectPackage[]> {\n const configuredAspects = this.aspectLoader.getConfiguredAspects();\n const coreAspectsIds = this.aspectLoader.getCoreAspectIds();\n const userAspectsIds: string[] = difference(configuredAspects, coreAspectsIds);\n const componentIdsToResolve = await this.workspace.resolveMultipleComponentIds(userAspectsIds);\n const aspectsComponents = await this.importAndGetAspects(componentIdsToResolve);\n let componentsToGetPackages = aspectsComponents;\n if (options.externalsOnly) {\n const { nonWorkspaceComps } = await this.groupComponentsByWorkspaceExistence(aspectsComponents);\n componentsToGetPackages = nonWorkspaceComps;\n }\n const packages = componentsToGetPackages.map((aspectComponent) => {\n const packageName = this.dependencyResolver.getPackageName(aspectComponent);\n const version = aspectComponent.id.version || '*';\n return { packageName, version };\n });\n return packages;\n }\n\n private aspectDefsToRequireableComponents(aspectDefs: AspectDefinition[]): RequireableComponent[] {\n const requireableComponents = aspectDefs.map((aspectDef) => {\n const localPath = aspectDef.aspectPath;\n const component = aspectDef.component;\n if (!component) return undefined;\n const requireFunc = async () => {\n const plugins = this.aspectLoader.getPlugins(component, localPath);\n if (plugins.has()) {\n return plugins.load(MainRuntime.name);\n }\n\n // eslint-disable-next-line global-require, import/no-dynamic-require\n const aspect = require(localPath);\n // require aspect runtimes\n const runtimePath = await this.aspectLoader.getRuntimePath(component, localPath, MainRuntime.name);\n // eslint-disable-next-line global-require, import/no-dynamic-require\n if (runtimePath) require(runtimePath);\n return aspect;\n };\n return new RequireableComponent(component, requireFunc);\n });\n return compact(requireableComponents);\n }\n\n private async linkIfMissingWorkspaceAspects(aspects: AspectDefinition[], ids: ComponentID[]) {\n let missingPaths = false;\n const existsP = aspects.map(async (aspect) => {\n const exist = await fs.pathExists(aspect.aspectPath);\n if (!exist) {\n missingPaths = true;\n }\n });\n await Promise.all(existsP);\n // TODO: this should be done properly by the install aspect by slot\n if (missingPaths) {\n const bitIds: BitId[] = ids.map((id) => id._legacy);\n return linkToNodeModulesByIds(this.workspace, bitIds);\n }\n return Promise.resolve();\n }\n\n /**\n * This will return a resolver that knows to resolve aspects which are part of the workspace.\n * means aspects exist in the bitmap file\n * @param stringIds\n * @param runtimeName\n * @returns\n */\n private getWorkspaceAspectResolver(stringIds: string[], runtimeName?: string): AspectResolver {\n const workspaceAspectResolver = async (component: Component): Promise<ResolvedAspect> => {\n const compStringId = component.id._legacy.toString();\n stringIds.push(compStringId);\n const localPath = this.workspace.getComponentPackagePath(component);\n\n const runtimePath = runtimeName\n ? await this.aspectLoader.getRuntimePath(component, localPath, runtimeName)\n : null;\n\n const aspectFilePath = await this.aspectLoader.getAspectFilePath(component, localPath);\n\n this.logger.debug(\n `workspace resolveAspects, resolving id: ${compStringId}, localPath: ${localPath}, runtimePath: ${runtimePath}`\n );\n return {\n aspectPath: localPath,\n aspectFilePath,\n runtimePath,\n };\n };\n return workspaceAspectResolver;\n }\n\n private async runOnAspectsResolveFunctions(aspectsComponents: Component[]): Promise<void> {\n const funcs = this.getOnAspectsResolveFunctions();\n await pMapSeries(funcs, async (func) => {\n try {\n await func(aspectsComponents);\n } catch (err) {\n this.logger.error('failed running onAspectsResolve function', err);\n }\n });\n }\n\n private getOnAspectsResolveFunctions(): OnAspectsResolve[] {\n const aspectsResolveFunctions = this.onAspectsResolveSlot.values();\n return aspectsResolveFunctions;\n }\n\n private async runOnRootAspectAddedFunctions(aspectsId: ComponentID, inWs: boolean): Promise<void> {\n const funcs = this.getOnRootAspectAddedFunctions();\n await pMapSeries(funcs, async (func) => {\n try {\n await func(aspectsId, inWs);\n } catch (err) {\n this.logger.error('failed running onRootAspectAdded function', err);\n }\n });\n }\n\n private getOnRootAspectAddedFunctions(): OnRootAspectAdded[] {\n const RootAspectAddedFunctions = this.onRootAspectAddedSlot.values();\n return RootAspectAddedFunctions;\n }\n\n /**\n * This will return a resolver that knows to resolve aspects which are not part of the workspace.\n * means aspects that does not exist in the bitmap file\n * instead it will resolve them from the node_modules recursively\n * @param graph\n * @param rootIds\n * @param runtimeName\n * @returns\n */\n private getInstalledAspectResolver(\n graph: Graph<Component, string>,\n rootIds: string[],\n runtimeName?: string,\n opts: { throwOnError: boolean } = { throwOnError: false }\n ): AspectResolver {\n const installedAspectsResolver = async (component: Component): Promise<ResolvedAspect | undefined> => {\n const compStringId = component.id._legacy.toString();\n // stringIds.push(compStringId);\n const localPath = this.resolveInstalledAspectRecursively(component, rootIds, graph, opts);\n if (!localPath) return undefined;\n\n const runtimePath = runtimeName\n ? await this.aspectLoader.getRuntimePath(component, localPath, runtimeName)\n : null;\n\n const aspectFilePath = await this.aspectLoader.getAspectFilePath(component, localPath);\n\n this.logger.debug(\n `workspace resolveInstalledAspects, resolving id: ${compStringId}, localPath: ${localPath}, runtimePath: ${runtimePath}`\n );\n return {\n aspectPath: localPath,\n aspectFilePath,\n runtimePath,\n };\n };\n return installedAspectsResolver;\n }\n\n private resolveInstalledAspectRecursively(\n aspectComponent: Component,\n rootIds: string[],\n graph: Graph<Component, string>,\n opts: { throwOnError: boolean } = { throwOnError: false }\n ): string | null | undefined {\n const aspectStringId = aspectComponent.id._legacy.toString();\n if (this.resolvedInstalledAspects.has(aspectStringId)) {\n const resolvedPath = this.resolvedInstalledAspects.get(aspectStringId);\n return resolvedPath;\n }\n if (rootIds.includes(aspectStringId)) {\n const localPath = this.workspace.getComponentPackagePath(aspectComponent);\n this.resolvedInstalledAspects.set(aspectStringId, localPath);\n return localPath;\n }\n const parent = graph.predecessors(aspectStringId)[0];\n const parentPath = this.resolveInstalledAspectRecursively(parent.attr, rootIds, graph);\n if (!parentPath) {\n this.resolvedInstalledAspects.set(aspectStringId, null);\n return undefined;\n }\n const packageName = this.dependencyResolver.getPackageName(aspectComponent);\n try {\n const resolvedPath = resolveFrom(parentPath, [packageName]);\n const localPath = findRoot(resolvedPath);\n this.resolvedInstalledAspects.set(aspectStringId, localPath);\n return localPath;\n } catch (error: any) {\n this.resolvedInstalledAspects.set(aspectStringId, null);\n if (opts.throwOnError) {\n throw error;\n }\n this.logger.consoleWarning(\n `failed resolving aspect ${aspectStringId} from ${parentPath}, error: ${error.message}`\n );\n return undefined;\n }\n }\n\n /**\n * Create a graph of aspects without the core aspects.\n * @param components\n * @param isAspect\n * @returns\n */\n private async getAspectsGraphWithoutCore(\n components: Component[],\n isAspect?: ShouldLoadFunc\n ): Promise<Graph<Component, string>> {\n const ids = components.map((component) => component.id);\n const coreAspectsStringIds = this.aspectLoader.getCoreAspectIds();\n // TODO: @gilad it causes many issues we need to find a better solution. removed for now.\n // const coreAspectsComponentIds = coreAspectsStringIds.map((id) => BitId.parse(id, true));\n // const aspectsIds = components.reduce((acc, curr) => {\n // const currIds = curr.state.aspects.ids;\n // acc = acc.concat(currIds);\n // return acc;\n // }, [] as any);\n // const otherDependenciesMap = components.reduce((acc, curr) => {\n // // const currIds = curr.state.dependencies.dependencies.map(dep => dep.id.toString());\n // const currMap = curr.state.dependencies.getIdsMap();\n // Object.assign(acc, currMap);\n // return acc;\n // }, {});\n\n // const depsWhichAreNotAspects = difference(Object.keys(otherDependenciesMap), aspectsIds);\n // const depsWhichAreNotAspectsBitIds = depsWhichAreNotAspects.map((strId) => otherDependenciesMap[strId]);\n // We only want to load into the graph components which are aspects and not regular dependencies\n // This come to solve a circular loop when an env aspect use an aspect (as regular dep) and the aspect use the env aspect as its env\n return this.workspace.buildOneGraphForComponents(ids, coreAspectsStringIds, isAspect);\n }\n\n /**\n * Load all unloaded extensions from an extension list\n * this will resolve the extensions from the scope aspects capsules if they are not in the ws\n * Only use it for component extensions\n * for workspace/scope root aspect use the load aspects directly\n *\n * The reason we are loading component extensions with \"scope aspects capsules\" is becasuse for component extensions\n * we might have the same extension in multiple versions\n * (for example I might have 2 components using different versions of the same env)\n * in such case, I can't install both version into the root of the node_modules so I need to place it somewhere else (capsules)\n * @param extensions list of extensions with config to load\n */\n async loadComponentsExtensions(\n extensions: ExtensionDataList,\n originatedFrom?: ComponentID,\n throwOnError = false\n ): Promise<void> {\n const extensionsIdsP = extensions.map(async (extensionEntry) => {\n // Core extension\n if (!extensionEntry.extensionId) {\n return extensionEntry.stringId as string;\n }\n\n const id = await this.workspace.resolveComponentId(extensionEntry.extensionId);\n // return this.resolveComponentId(extensionEntry.extensionId);\n return id.toString();\n });\n const extensionsIds: string[] = await Promise.all(extensionsIdsP);\n const loadedExtensions = this.harmony.extensionsIds;\n const extensionsToLoad = difference(extensionsIds, loadedExtensions);\n if (!extensionsToLoad.length) return;\n await this.loadAspects(extensionsToLoad, throwOnError, originatedFrom?.toString(), {\n useScopeAspectsCapsule: true,\n });\n }\n\n private async isAspect(id: ComponentID) {\n const component = await this.workspace.get(id);\n const isUsingAspectEnv = this.envs.isUsingAspectEnv(component);\n const isUsingEnvEnv = this.envs.isUsingEnvEnv(component);\n const isValidAspect = isUsingAspectEnv || isUsingEnvEnv;\n return isValidAspect;\n }\n\n /**\n * same as `this.importAndGetMany()` with a specific error handling of ComponentNotFound\n */\n private async importAndGetAspects(componentIds: ComponentID[]): Promise<Component[]> {\n try {\n return await this.workspace.importAndGetMany(componentIds);\n } catch (err: any) {\n if (err instanceof ComponentNotFound) {\n const config = this.harmony.get<ConfigMain>('teambit.harmony/config');\n const configStr = JSON.stringify(config.workspaceConfig?.raw || {});\n if (configStr.includes(err.id)) {\n throw new BitError(`error: a component \"${err.id}\" was not found\nyour workspace.jsonc has this component-id set. you might want to remove/change it.`);\n }\n }\n\n throw err;\n }\n }\n\n /**\n * split the provided components into 2 groups, one which are workspace components and the other which are not.\n * @param components\n * @returns\n */\n private async groupComponentsByWorkspaceExistence(\n components: Component[]\n ): Promise<{ workspaceComps: Component[]; nonWorkspaceComps: Component[] }> {\n const workspaceComps: Component[] = [];\n const nonWorkspaceComps: Component[] = [];\n await Promise.all(\n components.map(async (component) => {\n const existOnWorkspace = await this.workspace.hasId(component.id);\n existOnWorkspace ? workspaceComps.push(component) : nonWorkspaceComps.push(component);\n })\n );\n return { workspaceComps, nonWorkspaceComps };\n }\n\n private async groupIdsByWorkspaceExistence(\n ids: ComponentID[]\n ): Promise<{ workspaceIds: ComponentID[]; nonWorkspaceIds: ComponentID[] }> {\n const workspaceIds: ComponentID[] = [];\n const nonWorkspaceIds: ComponentID[] = [];\n await Promise.all(\n ids.map(async (id) => {\n const existOnWorkspace = await this.workspace.hasId(id);\n existOnWorkspace ? workspaceIds.push(id) : nonWorkspaceIds.push(id);\n })\n );\n return { workspaceIds, nonWorkspaceIds };\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAIA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAOA;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;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAA8C;AAAA;AAkBvC,MAAMA,sBAAsB,CAAC;EAIlCC,WAAW,CACDC,SAAoB,EACpBC,KAAgB,EAChBC,YAA8B,EAC9BC,IAAc,EACdC,kBAA0C,EAC1CC,MAAc,EACdC,OAAgB,EAChBC,oBAA0C,EAC1CC,qBAA4C,EACpD;IAAA,KATQR,SAAoB,GAApBA,SAAoB;IAAA,KACpBC,KAAgB,GAAhBA,KAAgB;IAAA,KAChBC,YAA8B,GAA9BA,YAA8B;IAAA,KAC9BC,IAAc,GAAdA,IAAc;IAAA,KACdC,kBAA0C,GAA1CA,kBAA0C;IAAA,KAC1CC,MAAc,GAAdA,MAAc;IAAA,KACdC,OAAgB,GAAhBA,OAAgB;IAAA,KAChBC,oBAA0C,GAA1CA,oBAA0C;IAAA,KAC1CC,qBAA4C,GAA5CA,qBAA4C;IAAA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AAC;QAC7E;MACF;MAEA,MAAMqB,GAAG;IACX;EACF;;EAEA;AACF;AACA;AACA;AACA;EACE,MAAcmD,mCAAmC,CAC/Cb,UAAuB,EACmD;IAC1E,MAAMW,cAA2B,GAAG,EAAE;IACtC,MAAMC,iBAA8B,GAAG,EAAE;IACzC,MAAMqB,OAAO,CAACC,GAAG,CACflC,UAAU,CAAC3C,GAAG,CAAC,MAAOmE,SAAS,IAAK;MAClC,MAAMoH,gBAAgB,GAAG,MAAM,IAAI,CAACvO,SAAS,CAACgJ,KAAK,CAAC7B,SAAS,CAACnF,EAAE,CAAC;MACjEuM,gBAAgB,GAAGjI,cAAc,CAACyF,IAAI,CAAC5E,SAAS,CAAC,GAAGZ,iBAAiB,CAACwF,IAAI,CAAC5E,SAAS,CAAC;IACvF,CAAC,CAAC,CACH;IACD,OAAO;MAAEb,cAAc;MAAEC;IAAkB,CAAC;EAC9C;EAEA,MAAc7D,4BAA4B,CACxC7B,GAAkB,EACwD;IAC1E,MAAM2B,YAA2B,GAAG,EAAE;IACtC,MAAMC,eAA8B,GAAG,EAAE;IACzC,MAAMmF,OAAO,CAACC,GAAG,CACfhH,GAAG,CAACmC,GAAG,CAAC,MAAOhB,EAAE,IAAK;MACpB,MAAMuM,gBAAgB,GAAG,MAAM,IAAI,CAACvO,SAAS,CAACgJ,KAAK,CAAChH,EAAE,CAAC;MACvDuM,gBAAgB,GAAG/L,YAAY,CAACuJ,IAAI,CAAC/J,EAAE,CAAC,GAAGS,eAAe,CAACsJ,IAAI,CAAC/J,EAAE,CAAC;IACrE,CAAC,CAAC,CACH;IACD,OAAO;MAAEQ,YAAY;MAAEC;IAAgB,CAAC;EAC1C;AACF;AAAC"}
@@ -10,7 +10,6 @@ import { GraphqlMain } from '@teambit/graphql';
10
10
  import { Harmony } from '@teambit/harmony';
11
11
  import { Logger } from '@teambit/logger';
12
12
  import type { ScopeMain } from '@teambit/scope';
13
- import { RequireableComponent } from '@teambit/harmony.modules.requireable-component';
14
13
  import type { VariantsMain } from '@teambit/variants';
15
14
  import { BitId } from '@teambit/legacy-bit-id';
16
15
  import { LaneId } from '@teambit/lane-id';
@@ -29,10 +28,11 @@ import { ComponentConfigFile } from './component-config-file';
29
28
  import { OnComponentAdd, OnComponentChange, OnComponentEventResult, OnComponentLoad, OnComponentRemove } from './on-component-events';
30
29
  import { WorkspaceExtConfig } from './types';
31
30
  import { ComponentStatus } from './workspace-component/component-status';
32
- import { OnComponentAddSlot, OnComponentChangeSlot, OnComponentLoadSlot, OnComponentRemoveSlot } from './workspace.provider';
31
+ import { OnAspectsResolve, OnAspectsResolveSlot, OnComponentAddSlot, OnComponentChangeSlot, OnComponentLoadSlot, OnComponentRemoveSlot, OnRootAspectAdded, OnRootAspectAddedSlot } from './workspace.provider';
33
32
  import { WorkspaceComponentLoader } from './workspace-component/workspace-component-loader';
34
33
  import { ShouldLoadFunc } from './build-graph-from-fs';
35
34
  import { BitMap } from './bit-map';
35
+ import { AspectPackage, GetConfiguredUserAspectsPackagesOptions, WorkspaceAspectsLoader } from './workspace-aspects-loader';
36
36
  import { MergeConflictFile } from './merge-conflict-file';
37
37
  export declare type EjectConfResult = {
38
38
  configPath: string;
@@ -90,6 +90,8 @@ export declare class Workspace implements ComponentFactory {
90
90
  */
91
91
  private onComponentAddSlot;
92
92
  private onComponentRemoveSlot;
93
+ private onAspectsResolveSlot;
94
+ private onRootAspectAddedSlot;
93
95
  private graphql;
94
96
  priority: boolean;
95
97
  owner?: string;
@@ -131,7 +133,7 @@ export declare class Workspace implements ComponentFactory {
131
133
  /**
132
134
  * on component add slot.
133
135
  */
134
- onComponentAddSlot: OnComponentAddSlot, onComponentRemoveSlot: OnComponentRemoveSlot, graphql: GraphqlMain);
136
+ onComponentAddSlot: OnComponentAddSlot, onComponentRemoveSlot: OnComponentRemoveSlot, onAspectsResolveSlot: OnAspectsResolveSlot, onRootAspectAddedSlot: OnRootAspectAddedSlot, graphql: GraphqlMain);
135
137
  private validateConfig;
136
138
  /**
137
139
  * root path of the Workspace.
@@ -144,6 +146,8 @@ export declare class Workspace implements ComponentFactory {
144
146
  registerOnComponentChange(onComponentChangeFunc: OnComponentChange): this;
145
147
  registerOnComponentAdd(onComponentAddFunc: OnComponentAdd): this;
146
148
  registerOnComponentRemove(onComponentRemoveFunc: OnComponentRemove): this;
149
+ registerOnAspectsResolve(onAspectsResolveFunc: OnAspectsResolve): this;
150
+ registerOnRootAspectAdded(onRootAspectAddedFunc: OnRootAspectAdded): this;
147
151
  /**
148
152
  * name of the workspace as configured in either `workspace.json`.
149
153
  * defaults to workspace root directory name.
@@ -220,6 +224,7 @@ export declare class Workspace implements ComponentFactory {
220
224
  * @param id component ID
221
225
  */
222
226
  get(componentId: ComponentID, legacyComponent?: ConsumerComponent, useCache?: boolean, storeInCache?: boolean, loadOpts?: ComponentLoadOptions): Promise<Component>;
227
+ getConfiguredUserAspectsPackages(options: GetConfiguredUserAspectsPackagesOptions): Promise<AspectPackage[]>;
223
228
  getEnvSystemDescriptor(component: Component): Promise<AspectData>;
224
229
  clearCache(): void;
225
230
  clearComponentCache(id: ComponentID): void;
@@ -229,6 +234,7 @@ export declare class Workspace implements ComponentFactory {
229
234
  getState(id: ComponentID, hash: string): Promise<import("@teambit/component").State>;
230
235
  getSnap(id: ComponentID, hash: string): Promise<import("@teambit/component").Snap>;
231
236
  getCurrentLaneId(): LaneId;
237
+ getCurrentLaneObject(): Promise<Lane | null>;
232
238
  isOnMain(): boolean;
233
239
  /**
234
240
  * if checked out to a lane and the lane exists in the remote,
@@ -358,7 +364,6 @@ export declare class Workspace implements ComponentFactory {
358
364
  */
359
365
  getComponentIdByPath(componentPath: PathOsBased): Promise<ComponentID | undefined>;
360
366
  private componentConfigFileFromComponentDirAndName;
361
- getAspectsGraphWithoutCore(components: Component[], isAspect?: ShouldLoadFunc): Promise<Graph<Component, string>>;
362
367
  /**
363
368
  * load aspects from the workspace and if not exists in the workspace, load from the scope.
364
369
  * keep in mind that the graph may have circles.
@@ -370,18 +375,15 @@ export declare class Workspace implements ComponentFactory {
370
375
  */
371
376
  buildOneGraphForComponents(ids: ComponentID[], ignoreIds?: string[], shouldLoadFunc?: ShouldLoadFunc, shouldThrowOnMissingDep?: boolean): Promise<Graph<Component, string>>;
372
377
  resolveAspects(runtimeName?: string, componentIds?: ComponentID[], opts?: ResolveAspectsOptions): Promise<AspectDefinition[]>;
373
- private groupIdsByWorkspaceAndScope;
374
- private groupComponentsByWorkspaceAndScope;
375
378
  /**
376
379
  * Provides a cache folder, unique per key.
377
380
  * Return value may be undefined, if workspace folder is unconventional (bare-scope, no node_modules, etc)
378
381
  */
379
382
  getTempDir(id: string): string;
380
- requireComponents(components: Component[]): Promise<RequireableComponent[]>;
383
+ getWorkspaceAspectsLoader(): WorkspaceAspectsLoader;
381
384
  /**
382
- * same as `this.importAndGetMany()` with a specific error handling of ComponentNotFound
383
- */
384
- private importAndGetAspects;
385
+ }
386
+
385
387
  /**
386
388
  * this should be rarely in-use.
387
389
  * it's currently used by watch extension as a quick workaround to load .bitmap and the components