@teambit/workspace 1.0.667 → 1.0.669

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.
Files changed (98) hide show
  1. package/commands/local-only-cmd.ts +2 -2
  2. package/component-config-file/component-config-file.ts +3 -2
  3. package/component-tree.widget.tsx +1 -1
  4. package/dist/aspects-merger.d.ts +5 -5
  5. package/dist/aspects-merger.js.map +1 -1
  6. package/dist/auto-tag.d.ts +2 -2
  7. package/dist/auto-tag.js.map +1 -1
  8. package/dist/bit-map.d.ts +6 -5
  9. package/dist/bit-map.js.map +1 -1
  10. package/dist/build-graph-from-fs.d.ts +4 -4
  11. package/dist/build-graph-from-fs.js.map +1 -1
  12. package/dist/build-graph-ids-from-fs.d.ts +5 -5
  13. package/dist/build-graph-ids-from-fs.js.map +1 -1
  14. package/dist/capsule.cmd.d.ts +3 -3
  15. package/dist/capsule.cmd.js.map +1 -1
  16. package/dist/commands/local-only-cmd.d.ts +2 -2
  17. package/dist/commands/local-only-cmd.js.map +1 -1
  18. package/dist/component-config-file/component-config-file.d.ts +3 -2
  19. package/dist/component-config-file/component-config-file.js.map +1 -1
  20. package/dist/component-tree.widget.d.ts +1 -1
  21. package/dist/component-tree.widget.js.map +1 -1
  22. package/dist/eject-conf.cmd.d.ts +2 -2
  23. package/dist/eject-conf.cmd.js.map +1 -1
  24. package/dist/envs-subcommands/envs-replace.cmd.d.ts +2 -2
  25. package/dist/envs-subcommands/envs-replace.cmd.js.map +1 -1
  26. package/dist/envs-subcommands/envs-set.cmd.d.ts +2 -2
  27. package/dist/envs-subcommands/envs-set.cmd.js.map +1 -1
  28. package/dist/envs-subcommands/envs-unset.cmd.d.ts +2 -2
  29. package/dist/envs-subcommands/envs-unset.cmd.js.map +1 -1
  30. package/dist/envs-subcommands/envs-update.cmd.d.ts +2 -2
  31. package/dist/envs-subcommands/envs-update.cmd.js.map +1 -1
  32. package/dist/filter.d.ts +1 -1
  33. package/dist/filter.js.map +1 -1
  34. package/dist/on-component-events.d.ts +3 -3
  35. package/dist/on-component-events.js.map +1 -1
  36. package/dist/pattern.cmd.d.ts +2 -2
  37. package/dist/pattern.cmd.js.map +1 -1
  38. package/dist/{preview-1753809186996.js → preview-1753848836384.js} +2 -2
  39. package/dist/scope-subcommands/scope-set.cmd.d.ts +2 -2
  40. package/dist/scope-subcommands/scope-set.cmd.js.map +1 -1
  41. package/dist/ui/workspace/use-workspace.js.map +1 -1
  42. package/dist/ui/workspace/workspace-menu.d.ts +1 -1
  43. package/dist/ui/workspace/workspace-menu.js.map +1 -1
  44. package/dist/ui/workspace/workspace-model.d.ts +5 -4
  45. package/dist/ui/workspace/workspace-model.js.map +1 -1
  46. package/dist/ui/workspace/workspace-overview/workspace-overview.d.ts +1 -1
  47. package/dist/ui/workspace/workspace-overview/workspace-overview.js.map +1 -1
  48. package/dist/ui/workspace/workspace-provider.d.ts +2 -2
  49. package/dist/ui/workspace/workspace-provider.js.map +1 -1
  50. package/dist/ui/workspace/workspace.d.ts +1 -1
  51. package/dist/ui/workspace/workspace.js.map +1 -1
  52. package/dist/unuse.cmd.d.ts +2 -2
  53. package/dist/unuse.cmd.js.map +1 -1
  54. package/dist/use.cmd.d.ts +2 -2
  55. package/dist/use.cmd.js.map +1 -1
  56. package/dist/workspace-aspects-loader.d.ts +10 -10
  57. package/dist/workspace-aspects-loader.js.map +1 -1
  58. package/dist/workspace-component/comp-files.d.ts +2 -2
  59. package/dist/workspace-component/comp-files.js.map +1 -1
  60. package/dist/workspace-component/component-status-loader.d.ts +3 -3
  61. package/dist/workspace-component/component-status-loader.js.map +1 -1
  62. package/dist/workspace-component/component-status.d.ts +1 -1
  63. package/dist/workspace-component/component-status.js.map +1 -1
  64. package/dist/workspace-component/workspace-component-loader.d.ts +9 -8
  65. package/dist/workspace-component/workspace-component-loader.js.map +1 -1
  66. package/dist/workspace-component/workspace-component.d.ts +5 -4
  67. package/dist/workspace-component/workspace-component.js.map +1 -1
  68. package/dist/workspace.d.ts +31 -28
  69. package/dist/workspace.graphql.d.ts +3 -3
  70. package/dist/workspace.graphql.js.map +1 -1
  71. package/dist/workspace.js.map +1 -1
  72. package/dist/workspace.main.runtime.d.ts +15 -15
  73. package/dist/workspace.main.runtime.js.map +1 -1
  74. package/dist/workspace.ui-root.d.ts +6 -6
  75. package/dist/workspace.ui-root.js.map +1 -1
  76. package/dist/workspace.ui.drawer.d.ts +4 -3
  77. package/dist/workspace.ui.drawer.js.map +1 -1
  78. package/dist/workspace.ui.runtime.d.ts +14 -13
  79. package/dist/workspace.ui.runtime.js.map +1 -1
  80. package/envs-subcommands/envs-replace.cmd.ts +2 -2
  81. package/envs-subcommands/envs-set.cmd.ts +2 -2
  82. package/envs-subcommands/envs-unset.cmd.ts +2 -2
  83. package/envs-subcommands/envs-update.cmd.ts +2 -2
  84. package/package.json +47 -47
  85. package/scope-subcommands/scope-set.cmd.ts +2 -2
  86. package/ui/workspace/use-workspace.ts +2 -1
  87. package/ui/workspace/workspace-menu.tsx +2 -1
  88. package/ui/workspace/workspace-model.ts +5 -4
  89. package/ui/workspace/workspace-overview/workspace-overview.tsx +1 -1
  90. package/ui/workspace/workspace-provider.tsx +3 -2
  91. package/ui/workspace/workspace.tsx +1 -1
  92. package/workspace-component/comp-files.ts +2 -2
  93. package/workspace-component/component-status-loader.ts +9 -5
  94. package/workspace-component/component-status.ts +1 -1
  95. package/workspace-component/workspace-component-loader.ts +15 -14
  96. package/workspace-component/workspace-component.ts +5 -4
  97. package/workspace.ui.drawer.tsx +6 -5
  98. package/workspace.ui.runtime.tsx +22 -18
@@ -1,15 +1,15 @@
1
- import { ExtensionDataList } from '@teambit/legacy.extension-data';
2
- import { Harmony } from '@teambit/harmony';
3
- import { AspectDefinition, AspectLoaderMain } from '@teambit/aspect-loader';
1
+ import type { ExtensionDataList } from '@teambit/legacy.extension-data';
2
+ import type { Harmony } from '@teambit/harmony';
3
+ import type { AspectDefinition, AspectLoaderMain } from '@teambit/aspect-loader';
4
4
  import { ComponentID } from '@teambit/component-id';
5
- import { LoadAspectsOptions, ResolveAspectsOptions } from '@teambit/component';
6
- import { ScopeMain } from '@teambit/scope';
7
- import { Logger } from '@teambit/logger';
8
- import { EnvsMain } from '@teambit/envs';
9
- import { DependencyResolverMain } from '@teambit/dependency-resolver';
5
+ import type { LoadAspectsOptions, ResolveAspectsOptions } from '@teambit/component';
6
+ import type { ScopeMain } from '@teambit/scope';
7
+ import type { Logger } from '@teambit/logger';
8
+ import type { EnvsMain } from '@teambit/envs';
9
+ import type { DependencyResolverMain } from '@teambit/dependency-resolver';
10
10
  import type { Workspace } from './workspace';
11
- import { OnAspectsResolveSlot, OnRootAspectAddedSlot } from './workspace.main.runtime';
12
- import { ConfigStoreMain } from '@teambit/config-store';
11
+ import type { OnAspectsResolveSlot, OnRootAspectAddedSlot } from './workspace.main.runtime';
12
+ import type { ConfigStoreMain } from '@teambit/config-store';
13
13
  export type GetConfiguredUserAspectsPackagesOptions = {
14
14
  externalsOnly?: boolean;
15
15
  };
@@ -1 +1 @@
1
- {"version":3,"names":["_legacy","data","require","_findRoot","_interopRequireDefault","_toolboxModules","_aspectLoader","_cli","_fsExtra","_harmonyModules","_workspaceModules","_componentId","_legacy2","_pMapSeries","_lodash","_bitError","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","WorkspaceAspectsLoader","constructor","workspace","scope","aspectLoader","envs","dependencyResolver","logger","configStore","harmony","onAspectsResolveSlot","onRootAspectAddedSlot","resolveAspectsFromNodeModules","resolveEnvsFromRoots","consumer","resolvedInstalledAspects","Map","hasRootComponents","loadAspects","ids","throwOnError","neededFor","opts","calculatedThrowOnError","defaultOpts","useScopeAspectsCapsule","runSubscribers","skipDeps","hideMissingModuleError","inInstallContext","ignoreErrorFunc","ignoreAspectLoadingError","ignoreErrors","forceLoad","mergedOpts","callId","Math","floor","random","loggerPrefix","profileTrace","info","join","JSON","stringify","localAspects","nonLocalAspects","partition","id","startsWith","localAspectsMap","loadAspectFromPath","notLoadedIds","isAspectLoaded","coreAspectsStringIds","getCoreAspectIds","idsWithoutCore","difference","componentIds","resolveMultipleComponentIds","workspaceIds","nonWorkspaceIds","groupIdsByWorkspaceExistence","logFoundWorkspaceVsScope","idsToLoadFromWs","scopeAspectIds","loadFromScopeAspectsCapsule","aspectsDefs","resolveAspects","undefined","excludeCore","requestedOnly","manifests","requireableComponents","loadAspectDefsByOrder","potentialPluginsIndexes","compact","map","manifest","index","isValidAspect","pluginsRequireableComponents","pluginsManifests","getManifestsFromRequireableExtensions","loadExtensionsByManifests","manifestIds","debug","concat","currentLane","getCurrentLaneObject","nonWorkspaceIdsString","toString","packageManagerConfigRootDir","path","workspaceName","name","err","throwWsJsoncAspectNotFoundError","ComponentNotFound","config","get","configStr","workspaceConfig","raw","includes","BitError","seeders","nonWorkspaceDefs","groupAspectDefsByWorkspaceExistence","scopeAspectsLoader","getScopeAspectsLoader","scopeIds","aspectDef","getId","scopeIdsGrouped","groupAspectIdsByEnvOfTheList","aspectDefsToRequireableComponents","runtimeName","filterByRuntime","idsToResolve","extensionsIds","workspaceLocalAspectsIds","localAspectsIds","nonLocalAspectsIds","localDefs","resolveLocalAspects","coreAspectsIds","configuredAspects","getConfiguredAspects","userAspectsIds","split","rootAspectsIds","componentIdsToResolve","components","importAndGetAspects","runOnAspectsResolveFunctions","wsAspectDefs","getWorkspaceAspectResolver","coreAspectDefs","Promise","all","coreId","rawDef","getAspectDef","loadDefinition","idsToFilter","idStr","ComponentID","fromString","targetDefs","finalDefs","filterAspectDefs","groupedByIsPlugin","groupBy","component","hasPluginFiles","graph","getAspectsGraphWithoutCore","false","isAspect","bind","aspectsComponents","nodes","node","attr","true","workspaceComps","nonWorkspaceComps","groupComponentsByWorkspaceExistence","workspaceCompsIds","c","nonWorkspaceCompsIds","stringIds","linkIfMissingWorkspaceAspects","componentsToResolveFromScope","componentsToResolveFromInstalled","nonWorkspaceCompsGroups","isEnv","scopeAspectsDefs","installedAspectsDefs","getInstalledAspectResolver","coreAspect","runtimePath","localResolved","allDefsExceptLocal","withoutLocalAspects","aspectId","find","localAspect","toStringWithoutVersion","allDefs","filteredDefs","shouldUseHashForCapsules","getConfig","CFG_CAPSULES_BUILD_COMPONENTS_BASE_DIR","getCapsulePath","defaultPath","workspaceIdsStr","nonWorkspaceIdsStr","use","aspectIdStr","resolveComponentId","inWs","hasId","aspectIdToAdd","aspectsComponent","Error","setExtension","overrideExisting","ignoreVersion","write","reasonForChange","addInMemoryConfiguredAspect","runOnRootAspectAddedFunctions","getConfiguredUserAspectsPackages","options","rawConfiguredAspects","getWorkspaceConfig","componentsToGetPackages","externalsOnly","packages","aspectComponent","packageName","getPackageName","version","aspectDefs","localPath","aspectPath","requireFunc","plugins","getPlugins","has","load","MainRuntime","isModule","isEsmModule","aspect","loadEsm","getRuntimePath","RequireableComponent","aspects","idsToLink","isInWs","exist","fs","pathExists","idsToLinkWithoutNull","linkToNodeModulesByIds","workspaceAspectResolver","compStringId","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","harmonyExtensions","loadedExtensions","extId","loaded","extensionsToLoad","isUsingAspectEnv","isUsingEnvEnv","loadOpts","idsToNotLoadAsAspects","importAndGetMany","existOnWorkspace","rootComps","nonRootComps","groupComponentsByLoadFromRootComps","shouldLoadFromRootComps","rootDir","rootDirExist","aspectFilePathExist","pluginFiles","getPluginFiles","hasEnvManifest","workspaceDefs","scopeComponents","exports"],"sources":["workspace-aspects-loader.ts"],"sourcesContent":["import { CFG_CAPSULES_BUILD_COMPONENTS_BASE_DIR } from '@teambit/legacy.constants';\nimport findRoot from 'find-root';\nimport { resolveFrom } from '@teambit/toolbox.modules.module-resolver';\nimport { Graph } from '@teambit/graph.cleargraph';\nimport { ExtensionDataList } from '@teambit/legacy.extension-data';\nimport { ExtensionManifest, Harmony, Aspect } 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 { ComponentID } from '@teambit/component-id';\nimport { ComponentNotFound } from '@teambit/legacy.scope';\nimport pMapSeries from 'p-map-series';\nimport { difference, compact, groupBy, partition } from 'lodash';\nimport { Consumer } from '@teambit/legacy.consumer';\nimport { Component, LoadAspectsOptions, 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 {\n OnAspectsResolve,\n OnAspectsResolveSlot,\n OnRootAspectAdded,\n OnRootAspectAddedSlot,\n} from './workspace.main.runtime';\nimport { ComponentLoadOptions } from './workspace-component/workspace-component-loader';\nimport { ConfigStoreMain } from '@teambit/config-store';\n\nexport type GetConfiguredUserAspectsPackagesOptions = {\n externalsOnly?: boolean;\n};\n\nexport type WorkspaceLoadAspectsOptions = LoadAspectsOptions & {\n useScopeAspectsCapsule?: boolean;\n runSubscribers?: boolean;\n skipDeps?: boolean;\n resolveEnvsFromRoots?: 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 configStore: ConfigStoreMain,\n private harmony: Harmony,\n private onAspectsResolveSlot: OnAspectsResolveSlot,\n private onRootAspectAddedSlot: OnRootAspectAddedSlot,\n private resolveAspectsFromNodeModules = false,\n private resolveEnvsFromRoots = false\n ) {\n this.consumer = this.workspace.consumer;\n this.resolvedInstalledAspects = new Map();\n // Only enable this when root components is enabled as well\n this.resolveEnvsFromRoots = this.resolveEnvsFromRoots && this.dependencyResolver.hasRootComponents();\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?: boolean,\n neededFor?: string,\n opts: WorkspaceLoadAspectsOptions = {}\n ): Promise<string[]> {\n const calculatedThrowOnError: boolean = throwOnError ?? false;\n const defaultOpts: Required<WorkspaceLoadAspectsOptions> = {\n useScopeAspectsCapsule: false,\n throwOnError: calculatedThrowOnError,\n runSubscribers: true,\n skipDeps: false,\n hideMissingModuleError: !!this.workspace.inInstallContext,\n ignoreErrorFunc: this.workspace.inInstallContext ? ignoreAspectLoadingError : () => false,\n ignoreErrors: false,\n resolveEnvsFromRoots: this.resolveEnvsFromRoots,\n forceLoad: false,\n };\n const mergedOpts: Required<WorkspaceLoadAspectsOptions> = { ...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.profileTrace(`[${callId}] workspace.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 [localAspects, nonLocalAspects] = partition(ids, (id) => id.startsWith('file:'));\n const localAspectsMap = await this.aspectLoader.loadAspectFromPath(localAspects);\n this.workspace.localAspects = { ...this.workspace.localAspects, ...localAspectsMap };\n\n let notLoadedIds = nonLocalAspects;\n if (!mergedOpts.forceLoad) {\n notLoadedIds = nonLocalAspects.filter((id) => !this.aspectLoader.isAspectLoaded(id));\n }\n if (!notLoadedIds.length) {\n this.logger.profileTrace(`[${callId}] workspace.loadAspects`);\n return [];\n }\n const coreAspectsStringIds = this.aspectLoader.getCoreAspectIds();\n const idsWithoutCore: string[] = difference(notLoadedIds, coreAspectsStringIds);\n\n const componentIds = await this.workspace.resolveMultipleComponentIds(idsWithoutCore);\n\n const { workspaceIds, nonWorkspaceIds } = await this.groupIdsByWorkspaceExistence(\n componentIds,\n mergedOpts.resolveEnvsFromRoots\n );\n\n this.logFoundWorkspaceVsScope(loggerPrefix, workspaceIds, nonWorkspaceIds);\n let idsToLoadFromWs = componentIds;\n let scopeAspectIds: string[] = [];\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 if (!this.resolveAspectsFromNodeModules) {\n mergedOpts.useScopeAspectsCapsule = true;\n }\n\n if (mergedOpts.useScopeAspectsCapsule) {\n idsToLoadFromWs = workspaceIds;\n scopeAspectIds = await this.loadFromScopeAspectsCapsule(nonWorkspaceIds, throwOnError, neededFor);\n }\n\n const aspectsDefs = await this.resolveAspects(undefined, idsToLoadFromWs, {\n excludeCore: true,\n requestedOnly: false,\n ...mergedOpts,\n });\n\n const { manifests, requireableComponents } = await this.loadAspectDefsByOrder(\n aspectsDefs,\n idsWithoutCore,\n mergedOpts.throwOnError,\n mergedOpts.hideMissingModuleError,\n mergedOpts.ignoreErrorFunc,\n neededFor,\n mergedOpts.runSubscribers\n );\n\n const potentialPluginsIndexes = compact(\n manifests.map((manifest, index) => {\n if (this.aspectLoader.isValidAspect(manifest)) return undefined;\n return index;\n })\n );\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 opts.runSubscribers\n );\n await this.aspectLoader.loadExtensionsByManifests(pluginsManifests, undefined, { throwOnError });\n const manifestIds = manifests.map((manifest) => manifest.id);\n this.logger.debug(`${loggerPrefix} finish loading aspects`);\n this.logger.profileTrace(`[${callId}] workspace.loadAspects`);\n return compact(manifestIds.concat(scopeAspectIds));\n }\n\n private async loadFromScopeAspectsCapsule(ids: ComponentID[], throwOnError?: boolean, neededFor?: string) {\n let scopeAspectIds: string[] = [];\n const currentLane = await this.consumer.getCurrentLaneObject();\n\n if (!ids.length) return [];\n\n const nonWorkspaceIdsString = ids.map((id) => id.toString());\n try {\n scopeAspectIds = await this.scope.loadAspects(nonWorkspaceIdsString, throwOnError, neededFor, currentLane, {\n packageManagerConfigRootDir: this.workspace.path,\n workspaceName: this.workspace.name,\n });\n return scopeAspectIds;\n } catch (err: any) {\n this.throwWsJsoncAspectNotFoundError(err);\n return scopeAspectIds;\n\n throw err;\n }\n }\n\n throwWsJsoncAspectNotFoundError(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\n private async loadAspectDefsByOrder(\n aspectsDefs: AspectDefinition[],\n seeders: string[],\n throwOnError: boolean,\n hideMissingModuleError: boolean,\n ignoreErrorFunc?: (err: Error) => boolean,\n neededFor?: string,\n runSubscribers = true\n ): Promise<{ manifests: Array<Aspect | ExtensionManifest>; requireableComponents: RequireableComponent[] }> {\n const { nonWorkspaceDefs } = await this.groupAspectDefsByWorkspaceExistence(aspectsDefs);\n const scopeAspectsLoader = this.scope.getScopeAspectsLoader();\n const scopeIds: string[] = compact(nonWorkspaceDefs.map((aspectDef) => aspectDef.getId));\n const scopeIdsGrouped = await scopeAspectsLoader.groupAspectIdsByEnvOfTheList(scopeIds);\n\n // Make sure to first load envs from the list otherwise it will fail when trying to load other aspects\n // as their envs might not be loaded yet\n if (scopeIdsGrouped.envs && scopeIdsGrouped.envs.length && !runSubscribers) {\n await this.scope.loadAspects(scopeIdsGrouped.envs, throwOnError, 'workspace.loadAspects loading scope aspects');\n }\n const requireableComponents = this.aspectDefsToRequireableComponents(aspectsDefs);\n const manifests = await this.aspectLoader.getManifestsFromRequireableExtensions(\n requireableComponents,\n throwOnError,\n runSubscribers\n );\n await this.aspectLoader.loadExtensionsByManifests(\n manifests,\n { seeders, neededFor },\n { throwOnError, hideMissingModuleError, ignoreErrorFunc }\n );\n return { manifests, requireableComponents };\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 workspaceName: this.workspace.name,\n resolveEnvsFromRoots: this.resolveEnvsFromRoots,\n packageManagerConfigRootDir: this.workspace.path,\n };\n const mergedOpts = { ...defaultOpts, ...opts };\n const idsToResolve = componentIds ? componentIds.map((id) => id.toString()) : this.harmony.extensionsIds;\n const workspaceLocalAspectsIds = Object.keys(this.workspace.localAspects);\n const [localAspectsIds, nonLocalAspectsIds] = partition(idsToResolve, (id) =>\n workspaceLocalAspectsIds.includes(id)\n );\n\n const localDefs = await this.aspectLoader.resolveLocalAspects(\n localAspectsIds.map((id) => this.workspace.localAspects[id]),\n runtimeName\n );\n const coreAspectsIds = this.aspectLoader.getCoreAspectIds();\n const configuredAspects = this.aspectLoader.getConfiguredAspects();\n // it's possible that componentIds are core-aspects that got version for some reason, remove the version to\n // correctly filter them out later.\n const userAspectsIds: string[] = nonLocalAspectsIds\n ? nonLocalAspectsIds.filter((id) => !coreAspectsIds.includes(id.split('@')[0])).map((id) => id.toString())\n : difference(this.harmony.extensionsIds, coreAspectsIds);\n const rootAspectsIds: string[] = difference(configuredAspects, coreAspectsIds);\n const componentIdsToResolve = await this.workspace.resolveMultipleComponentIds(userAspectsIds);\n const components = await this.importAndGetAspects(componentIdsToResolve, opts?.throwOnError);\n // Run the on load slot\n await this.runOnAspectsResolveFunctions(components);\n\n if (opts?.skipDeps) {\n const wsAspectDefs = await this.aspectLoader.resolveAspects(\n components,\n this.getWorkspaceAspectResolver([], runtimeName)\n );\n\n const 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 const idsToFilter = idsToResolve.map((idStr) => ComponentID.fromString(idStr));\n const targetDefs = wsAspectDefs.concat(coreAspectDefs).concat(localDefs);\n const finalDefs = this.aspectLoader.filterAspectDefs(targetDefs, idsToFilter, runtimeName, mergedOpts);\n\n return finalDefs;\n }\n\n const groupedByIsPlugin = groupBy(components, (component) => {\n return this.aspectLoader.hasPluginFiles(component);\n });\n const graph = await this.getAspectsGraphWithoutCore(groupedByIsPlugin.false, this.isAspect.bind(this));\n const aspectsComponents = graph.nodes.map((node) => node.attr).concat(groupedByIsPlugin.true || []);\n this.logger.debug(`${loggerPrefix} found ${aspectsComponents.length} aspects in the aspects-graph`);\n const { workspaceComps, nonWorkspaceComps } = await this.groupComponentsByWorkspaceExistence(\n aspectsComponents,\n mergedOpts.resolveEnvsFromRoots\n );\n\n const workspaceCompsIds = workspaceComps.map((c) => c.id);\n const nonWorkspaceCompsIds = nonWorkspaceComps.map((c) => c.id);\n this.logFoundWorkspaceVsScope(loggerPrefix, workspaceCompsIds, nonWorkspaceCompsIds);\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);\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 if (!this.resolveAspectsFromNodeModules) {\n mergedOpts.useScopeAspectsCapsule = true;\n }\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 localResolved = await this.aspectLoader.resolveLocalAspects(\n Object.keys(this.workspace.localAspects),\n runtimeName\n );\n const allDefsExceptLocal = [...wsAspectDefs, ...coreAspectDefs, ...scopeAspectsDefs, ...installedAspectsDefs];\n const withoutLocalAspects = allDefsExceptLocal.filter((aspectId) => {\n return !localResolved.find((localAspect) => {\n return localAspect.id === aspectId.component?.id?.toStringWithoutVersion();\n });\n });\n const allDefs = [...withoutLocalAspects, ...localResolved];\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 shouldUseHashForCapsules(): boolean {\n return !this.configStore.getConfig(CFG_CAPSULES_BUILD_COMPONENTS_BASE_DIR);\n }\n\n getCapsulePath() {\n const defaultPath = this.workspace.path;\n return this.configStore.getConfig(CFG_CAPSULES_BUILD_COMPONENTS_BASE_DIR) || defaultPath;\n }\n\n private logFoundWorkspaceVsScope(loggerPrefix: string, workspaceIds: ComponentID[], nonWorkspaceIds: ComponentID[]) {\n const workspaceIdsStr = workspaceIds.length ? workspaceIds.map((id) => id.toString()).join('\\n') : '';\n const nonWorkspaceIdsStr = nonWorkspaceIds.length ? nonWorkspaceIds.map((id) => id.toString()).join('\\n') : '';\n this.logger.debug(\n `${loggerPrefix} found ${workspaceIds.length} components in the workspace, ${nonWorkspaceIds.length} not in the workspace`\n );\n if (workspaceIdsStr) this.logger.debug(`${loggerPrefix} workspace components:\\n${workspaceIdsStr}`);\n if (nonWorkspaceIdsStr)\n this.logger.debug(\n `${loggerPrefix} non workspace components (loaded from the scope capsules or from the node_modules):\\n${nonWorkspaceIdsStr}`\n );\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({ reasonForChange: `use (${aspectIdStr})` });\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 rawConfiguredAspects = this.workspace.getWorkspaceConfig()?.extensionsIds;\n const coreAspectsIds = this.aspectLoader.getCoreAspectIds();\n const userAspectsIds: string[] = difference(rawConfiguredAspects, coreAspectsIds);\n const componentIdsToResolve = await this.workspace.resolveMultipleComponentIds(\n userAspectsIds.filter((id) => !id.startsWith('file:'))\n );\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 const isModule = await this.aspectLoader.isEsmModule(localPath);\n\n const aspect = !isModule\n ? // eslint-disable-next-line global-require, import/no-dynamic-require\n require(localPath)\n : // : await this.aspectLoader.loadEsm(join(localPath, 'dist', 'index.js'));\n await this.aspectLoader.loadEsm(localPath);\n\n // require aspect runtimes\n const runtimePath = await this.aspectLoader.getRuntimePath(component, localPath, MainRuntime.name);\n if (runtimePath) {\n if (isModule) await this.aspectLoader.loadEsm(runtimePath);\n // eslint-disable-next-line global-require, import/no-dynamic-require\n require(runtimePath);\n }\n return aspect;\n };\n return new RequireableComponent(component, requireFunc);\n });\n return compact(requireableComponents);\n }\n\n private async linkIfMissingWorkspaceAspects(aspects: AspectDefinition[]) {\n const idsToLink = await Promise.all(\n aspects.map(async (aspect) => {\n if (!aspect.component)\n throw new Error(`linkIfMissingWorkspaceAspects, aspect.component is missing for ${aspect.aspectPath}`);\n const isInWs = await this.workspace.hasId(aspect.component.id);\n if (!isInWs) return null;\n const exist = await fs.pathExists(aspect.aspectPath);\n if (!exist) return aspect.component.id;\n return null;\n })\n );\n const idsToLinkWithoutNull = compact(idsToLink);\n if (!idsToLinkWithoutNull.length) return;\n await linkToNodeModulesByIds(this.workspace, idsToLinkWithoutNull);\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.toString();\n stringIds.push(compStringId);\n const localPath = await 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.toString();\n // stringIds.push(compStringId);\n const localPath = await 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 async resolveInstalledAspectRecursively(\n aspectComponent: Component,\n rootIds: string[],\n graph: Graph<Component, string>,\n opts: { throwOnError: boolean } = { throwOnError: false }\n ): Promise<string | null | undefined> {\n const aspectStringId = aspectComponent.id.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 = await this.workspace.getComponentPackagePath(aspectComponent);\n this.resolvedInstalledAspects.set(aspectStringId, localPath);\n return localPath;\n }\n const parent = graph.predecessors(aspectStringId)[0];\n if (!parent) return undefined;\n const parentPath = await 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) => ComponentID.fromString(id));\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 because 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 opts: WorkspaceLoadAspectsOptions = {}\n ): Promise<void> {\n const defaultOpts: WorkspaceLoadAspectsOptions = {\n useScopeAspectsCapsule: true,\n throwOnError: false,\n hideMissingModuleError: !!this.workspace.inInstallContext,\n ignoreErrorFunc: this.workspace.inInstallContext ? ignoreAspectLoadingError : undefined,\n resolveEnvsFromRoots: this.resolveEnvsFromRoots,\n };\n const mergedOpts = { ...defaultOpts, ...opts };\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 harmonyExtensions = this.harmony.extensionsIds;\n const loadedExtensions = harmonyExtensions.filter((extId) => {\n return this.harmony.extensions.get(extId)?.loaded;\n });\n const extensionsToLoad = difference(extensionsIds, loadedExtensions);\n if (!extensionsToLoad.length) return;\n await this.loadAspects(extensionsToLoad, undefined, originatedFrom?.toString(), mergedOpts);\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[], throwOnError = true): Promise<Component[]> {\n try {\n // We don't want to load the seeders as aspects as it will cause an infinite loop\n // once you try to load the seeder it will try to load the workspace component\n // that will arrive here again and again\n const loadOpts: ComponentLoadOptions = {\n idsToNotLoadAsAspects: componentIds.map((id) => id.toString()),\n };\n return await this.workspace.importAndGetMany(\n componentIds,\n 'to load aspects from the workspace',\n loadOpts,\n throwOnError\n );\n } catch (err: any) {\n this.throwWsJsoncAspectNotFoundError(err);\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 resolveEnvsFromRoots?: boolean\n ): Promise<{ workspaceComps: Component[]; nonWorkspaceComps: Component[] }> {\n let workspaceComps: Component[] = [];\n let 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 if (resolveEnvsFromRoots) {\n const { rootComps, nonRootComps } = await this.groupComponentsByLoadFromRootComps(nonWorkspaceComps);\n workspaceComps = workspaceComps.concat(rootComps);\n nonWorkspaceComps = nonRootComps;\n }\n return { workspaceComps, nonWorkspaceComps };\n }\n\n private async groupComponentsByLoadFromRootComps(\n components: Component[]\n ): Promise<{ rootComps: Component[]; nonRootComps: Component[] }> {\n const rootComps: Component[] = [];\n const nonRootComps: Component[] = [];\n await Promise.all(\n components.map(async (component) => {\n const shouldLoadFromRootComps = await this.shouldLoadFromRootComps(component);\n if (shouldLoadFromRootComps) {\n rootComps.push(component);\n return;\n }\n nonRootComps.push(component);\n })\n );\n return { rootComps, nonRootComps };\n }\n\n private async shouldLoadFromRootComps(component: Component): Promise<boolean> {\n const rootDir = await this.workspace.getComponentPackagePath(component);\n const rootDirExist = await fs.pathExists(rootDir);\n const aspectFilePath = await this.aspectLoader.getAspectFilePath(component, rootDir);\n const aspectFilePathExist = aspectFilePath ? await fs.pathExists(aspectFilePath) : false;\n const pluginFiles = await this.aspectLoader.getPluginFiles(component, rootDir);\n\n // checking that we have the root dir (this means it's an aspect that needs to be loaded from there)\n // and validate that localPathExist so we can\n // really load the component from that path (if it's there it means that it's an env)\n if (rootDirExist && (aspectFilePathExist || pluginFiles.length)) {\n return true;\n }\n // If the component has env.jsonc we want to list it to be loaded from the root folder\n // even if it's not there yet\n // in that case we will fail to load it, and the user will need to run bit install\n if (this.envs.hasEnvManifest(component)) {\n return true;\n }\n return false;\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 groupAspectDefsByWorkspaceExistence(\n aspectDefs: AspectDefinition[]\n ): Promise<{ workspaceDefs: AspectDefinition[]; nonWorkspaceDefs: AspectDefinition[] }> {\n const workspaceDefs: AspectDefinition[] = [];\n const nonWorkspaceDefs: AspectDefinition[] = [];\n await Promise.all(\n aspectDefs.map(async (aspectDef) => {\n const id = aspectDef.component?.id;\n const existOnWorkspace = id ? await this.workspace.hasId(id) : true;\n if (existOnWorkspace) {\n workspaceDefs.push(aspectDef);\n return;\n }\n const shouldLoadFromRootComps = aspectDef.component\n ? await this.shouldLoadFromRootComps(aspectDef.component)\n : undefined;\n if (shouldLoadFromRootComps) {\n workspaceDefs.push(aspectDef);\n return;\n }\n nonWorkspaceDefs.push(aspectDef);\n })\n );\n return { workspaceDefs, nonWorkspaceDefs };\n }\n\n private async groupIdsByWorkspaceExistence(\n ids: ComponentID[],\n resolveEnvsFromRoots?: boolean\n ): Promise<{ workspaceIds: ComponentID[]; nonWorkspaceIds: ComponentID[] }> {\n let workspaceIds: ComponentID[] = [];\n let 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 // We need to bring the components in order to really group them with taking the root comps into account\n const scopeComponents = await this.importAndGetAspects(nonWorkspaceIds);\n const { nonWorkspaceComps, workspaceComps } = await this.groupComponentsByWorkspaceExistence(\n scopeComponents,\n resolveEnvsFromRoots\n );\n workspaceIds = workspaceIds.concat(workspaceComps.map((c) => c.id));\n nonWorkspaceIds = nonWorkspaceComps.map((c) => c.id);\n return { workspaceIds, nonWorkspaceIds };\n }\n}\n\nfunction ignoreAspectLoadingError(err: Error) {\n // Ignoring that error as probably we are in the middle of the installation process\n // so we didn't yet compile the aspect to esm correctly\n if (err.message.includes(`Cannot use 'import.meta' outside a module`)) {\n return true;\n }\n return false;\n}\n"],"mappings":";;;;;;AAAA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,UAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC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AG,MAAM,IAAI,CAACpS,SAAS,CAACyM,KAAK,CAAC3J,EAAE,CAAC;MACvDsP,gBAAgB,GAAG1O,YAAY,CAAClF,IAAI,CAACsE,EAAE,CAAC,GAAGa,eAAe,CAACnF,IAAI,CAACsE,EAAE,CAAC;IACrE,CAAC,CACH,CAAC;IACD;IACA,MAAMkQ,eAAe,GAAG,MAAM,IAAI,CAAC5K,mBAAmB,CAACzE,eAAe,CAAC;IACvE,MAAM;MAAE0G,iBAAiB;MAAED;IAAe,CAAC,GAAG,MAAM,IAAI,CAACE,mCAAmC,CAC1F0I,eAAe,EACfrS,oBACF,CAAC;IACD+C,YAAY,GAAGA,YAAY,CAAC2B,MAAM,CAAC+E,cAAc,CAACzF,GAAG,CAAE6F,CAAC,IAAKA,CAAC,CAAC1H,EAAE,CAAC,CAAC;IACnEa,eAAe,GAAG0G,iBAAiB,CAAC1F,GAAG,CAAE6F,CAAC,IAAKA,CAAC,CAAC1H,EAAE,CAAC;IACpD,OAAO;MAAEY,YAAY;MAAEC;IAAgB,CAAC;EAC1C;AACF;AAACsP,OAAA,CAAAnT,sBAAA,GAAAA,sBAAA;AAED,SAAS+B,wBAAwBA,CAACiE,GAAU,EAAE;EAC5C;EACA;EACA,IAAIA,GAAG,CAACmL,OAAO,CAAC3K,QAAQ,CAAC,2CAA2C,CAAC,EAAE;IACrE,OAAO,IAAI;EACb;EACA,OAAO,KAAK;AACd","ignoreList":[]}
1
+ {"version":3,"names":["_legacy","data","require","_findRoot","_interopRequireDefault","_toolboxModules","_aspectLoader","_cli","_fsExtra","_harmonyModules","_workspaceModules","_componentId","_legacy2","_pMapSeries","_lodash","_bitError","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","WorkspaceAspectsLoader","constructor","workspace","scope","aspectLoader","envs","dependencyResolver","logger","configStore","harmony","onAspectsResolveSlot","onRootAspectAddedSlot","resolveAspectsFromNodeModules","resolveEnvsFromRoots","consumer","resolvedInstalledAspects","Map","hasRootComponents","loadAspects","ids","throwOnError","neededFor","opts","calculatedThrowOnError","defaultOpts","useScopeAspectsCapsule","runSubscribers","skipDeps","hideMissingModuleError","inInstallContext","ignoreErrorFunc","ignoreAspectLoadingError","ignoreErrors","forceLoad","mergedOpts","callId","Math","floor","random","loggerPrefix","profileTrace","info","join","JSON","stringify","localAspects","nonLocalAspects","partition","id","startsWith","localAspectsMap","loadAspectFromPath","notLoadedIds","isAspectLoaded","coreAspectsStringIds","getCoreAspectIds","idsWithoutCore","difference","componentIds","resolveMultipleComponentIds","workspaceIds","nonWorkspaceIds","groupIdsByWorkspaceExistence","logFoundWorkspaceVsScope","idsToLoadFromWs","scopeAspectIds","loadFromScopeAspectsCapsule","aspectsDefs","resolveAspects","undefined","excludeCore","requestedOnly","manifests","requireableComponents","loadAspectDefsByOrder","potentialPluginsIndexes","compact","map","manifest","index","isValidAspect","pluginsRequireableComponents","pluginsManifests","getManifestsFromRequireableExtensions","loadExtensionsByManifests","manifestIds","debug","concat","currentLane","getCurrentLaneObject","nonWorkspaceIdsString","toString","packageManagerConfigRootDir","path","workspaceName","name","err","throwWsJsoncAspectNotFoundError","ComponentNotFound","config","get","configStr","workspaceConfig","raw","includes","BitError","seeders","nonWorkspaceDefs","groupAspectDefsByWorkspaceExistence","scopeAspectsLoader","getScopeAspectsLoader","scopeIds","aspectDef","getId","scopeIdsGrouped","groupAspectIdsByEnvOfTheList","aspectDefsToRequireableComponents","runtimeName","filterByRuntime","idsToResolve","extensionsIds","workspaceLocalAspectsIds","localAspectsIds","nonLocalAspectsIds","localDefs","resolveLocalAspects","coreAspectsIds","configuredAspects","getConfiguredAspects","userAspectsIds","split","rootAspectsIds","componentIdsToResolve","components","importAndGetAspects","runOnAspectsResolveFunctions","wsAspectDefs","getWorkspaceAspectResolver","coreAspectDefs","Promise","all","coreId","rawDef","getAspectDef","loadDefinition","idsToFilter","idStr","ComponentID","fromString","targetDefs","finalDefs","filterAspectDefs","groupedByIsPlugin","groupBy","component","hasPluginFiles","graph","getAspectsGraphWithoutCore","false","isAspect","bind","aspectsComponents","nodes","node","attr","true","workspaceComps","nonWorkspaceComps","groupComponentsByWorkspaceExistence","workspaceCompsIds","c","nonWorkspaceCompsIds","stringIds","linkIfMissingWorkspaceAspects","componentsToResolveFromScope","componentsToResolveFromInstalled","nonWorkspaceCompsGroups","isEnv","scopeAspectsDefs","installedAspectsDefs","getInstalledAspectResolver","coreAspect","runtimePath","localResolved","allDefsExceptLocal","withoutLocalAspects","aspectId","find","localAspect","toStringWithoutVersion","allDefs","filteredDefs","shouldUseHashForCapsules","getConfig","CFG_CAPSULES_BUILD_COMPONENTS_BASE_DIR","getCapsulePath","defaultPath","workspaceIdsStr","nonWorkspaceIdsStr","use","aspectIdStr","resolveComponentId","inWs","hasId","aspectIdToAdd","aspectsComponent","Error","setExtension","overrideExisting","ignoreVersion","write","reasonForChange","addInMemoryConfiguredAspect","runOnRootAspectAddedFunctions","getConfiguredUserAspectsPackages","options","rawConfiguredAspects","getWorkspaceConfig","componentsToGetPackages","externalsOnly","packages","aspectComponent","packageName","getPackageName","version","aspectDefs","localPath","aspectPath","requireFunc","plugins","getPlugins","has","load","MainRuntime","isModule","isEsmModule","aspect","loadEsm","getRuntimePath","RequireableComponent","aspects","idsToLink","isInWs","exist","fs","pathExists","idsToLinkWithoutNull","linkToNodeModulesByIds","workspaceAspectResolver","compStringId","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","harmonyExtensions","loadedExtensions","extId","loaded","extensionsToLoad","isUsingAspectEnv","isUsingEnvEnv","loadOpts","idsToNotLoadAsAspects","importAndGetMany","existOnWorkspace","rootComps","nonRootComps","groupComponentsByLoadFromRootComps","shouldLoadFromRootComps","rootDir","rootDirExist","aspectFilePathExist","pluginFiles","getPluginFiles","hasEnvManifest","workspaceDefs","scopeComponents","exports"],"sources":["workspace-aspects-loader.ts"],"sourcesContent":["import { CFG_CAPSULES_BUILD_COMPONENTS_BASE_DIR } from '@teambit/legacy.constants';\nimport findRoot from 'find-root';\nimport { resolveFrom } from '@teambit/toolbox.modules.module-resolver';\nimport type { Graph } from '@teambit/graph.cleargraph';\nimport type { ExtensionDataList } from '@teambit/legacy.extension-data';\nimport type { ExtensionManifest, Harmony, Aspect } from '@teambit/harmony';\nimport type { AspectDefinition, AspectLoaderMain, AspectResolver, ResolvedAspect } from '@teambit/aspect-loader';\nimport { getAspectDef } 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 { ComponentID } from '@teambit/component-id';\nimport { ComponentNotFound } from '@teambit/legacy.scope';\nimport pMapSeries from 'p-map-series';\nimport { difference, compact, groupBy, partition } from 'lodash';\nimport type { Consumer } from '@teambit/legacy.consumer';\nimport type { Component, LoadAspectsOptions, ResolveAspectsOptions } from '@teambit/component';\nimport type { ScopeMain } from '@teambit/scope';\nimport type { Logger } from '@teambit/logger';\nimport { BitError } from '@teambit/bit-error';\nimport type { EnvsMain } from '@teambit/envs';\nimport type { ConfigMain } from '@teambit/config';\nimport type { DependencyResolverMain } from '@teambit/dependency-resolver';\nimport type { ShouldLoadFunc } from './build-graph-from-fs';\nimport type { Workspace } from './workspace';\nimport type {\n OnAspectsResolve,\n OnAspectsResolveSlot,\n OnRootAspectAdded,\n OnRootAspectAddedSlot,\n} from './workspace.main.runtime';\nimport type { ComponentLoadOptions } from './workspace-component/workspace-component-loader';\nimport type { ConfigStoreMain } from '@teambit/config-store';\n\nexport type GetConfiguredUserAspectsPackagesOptions = {\n externalsOnly?: boolean;\n};\n\nexport type WorkspaceLoadAspectsOptions = LoadAspectsOptions & {\n useScopeAspectsCapsule?: boolean;\n runSubscribers?: boolean;\n skipDeps?: boolean;\n resolveEnvsFromRoots?: 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 configStore: ConfigStoreMain,\n private harmony: Harmony,\n private onAspectsResolveSlot: OnAspectsResolveSlot,\n private onRootAspectAddedSlot: OnRootAspectAddedSlot,\n private resolveAspectsFromNodeModules = false,\n private resolveEnvsFromRoots = false\n ) {\n this.consumer = this.workspace.consumer;\n this.resolvedInstalledAspects = new Map();\n // Only enable this when root components is enabled as well\n this.resolveEnvsFromRoots = this.resolveEnvsFromRoots && this.dependencyResolver.hasRootComponents();\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?: boolean,\n neededFor?: string,\n opts: WorkspaceLoadAspectsOptions = {}\n ): Promise<string[]> {\n const calculatedThrowOnError: boolean = throwOnError ?? false;\n const defaultOpts: Required<WorkspaceLoadAspectsOptions> = {\n useScopeAspectsCapsule: false,\n throwOnError: calculatedThrowOnError,\n runSubscribers: true,\n skipDeps: false,\n hideMissingModuleError: !!this.workspace.inInstallContext,\n ignoreErrorFunc: this.workspace.inInstallContext ? ignoreAspectLoadingError : () => false,\n ignoreErrors: false,\n resolveEnvsFromRoots: this.resolveEnvsFromRoots,\n forceLoad: false,\n };\n const mergedOpts: Required<WorkspaceLoadAspectsOptions> = { ...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.profileTrace(`[${callId}] workspace.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 [localAspects, nonLocalAspects] = partition(ids, (id) => id.startsWith('file:'));\n const localAspectsMap = await this.aspectLoader.loadAspectFromPath(localAspects);\n this.workspace.localAspects = { ...this.workspace.localAspects, ...localAspectsMap };\n\n let notLoadedIds = nonLocalAspects;\n if (!mergedOpts.forceLoad) {\n notLoadedIds = nonLocalAspects.filter((id) => !this.aspectLoader.isAspectLoaded(id));\n }\n if (!notLoadedIds.length) {\n this.logger.profileTrace(`[${callId}] workspace.loadAspects`);\n return [];\n }\n const coreAspectsStringIds = this.aspectLoader.getCoreAspectIds();\n const idsWithoutCore: string[] = difference(notLoadedIds, coreAspectsStringIds);\n\n const componentIds = await this.workspace.resolveMultipleComponentIds(idsWithoutCore);\n\n const { workspaceIds, nonWorkspaceIds } = await this.groupIdsByWorkspaceExistence(\n componentIds,\n mergedOpts.resolveEnvsFromRoots\n );\n\n this.logFoundWorkspaceVsScope(loggerPrefix, workspaceIds, nonWorkspaceIds);\n let idsToLoadFromWs = componentIds;\n let scopeAspectIds: string[] = [];\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 if (!this.resolveAspectsFromNodeModules) {\n mergedOpts.useScopeAspectsCapsule = true;\n }\n\n if (mergedOpts.useScopeAspectsCapsule) {\n idsToLoadFromWs = workspaceIds;\n scopeAspectIds = await this.loadFromScopeAspectsCapsule(nonWorkspaceIds, throwOnError, neededFor);\n }\n\n const aspectsDefs = await this.resolveAspects(undefined, idsToLoadFromWs, {\n excludeCore: true,\n requestedOnly: false,\n ...mergedOpts,\n });\n\n const { manifests, requireableComponents } = await this.loadAspectDefsByOrder(\n aspectsDefs,\n idsWithoutCore,\n mergedOpts.throwOnError,\n mergedOpts.hideMissingModuleError,\n mergedOpts.ignoreErrorFunc,\n neededFor,\n mergedOpts.runSubscribers\n );\n\n const potentialPluginsIndexes = compact(\n manifests.map((manifest, index) => {\n if (this.aspectLoader.isValidAspect(manifest)) return undefined;\n return index;\n })\n );\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 opts.runSubscribers\n );\n await this.aspectLoader.loadExtensionsByManifests(pluginsManifests, undefined, { throwOnError });\n const manifestIds = manifests.map((manifest) => manifest.id);\n this.logger.debug(`${loggerPrefix} finish loading aspects`);\n this.logger.profileTrace(`[${callId}] workspace.loadAspects`);\n return compact(manifestIds.concat(scopeAspectIds));\n }\n\n private async loadFromScopeAspectsCapsule(ids: ComponentID[], throwOnError?: boolean, neededFor?: string) {\n let scopeAspectIds: string[] = [];\n const currentLane = await this.consumer.getCurrentLaneObject();\n\n if (!ids.length) return [];\n\n const nonWorkspaceIdsString = ids.map((id) => id.toString());\n try {\n scopeAspectIds = await this.scope.loadAspects(nonWorkspaceIdsString, throwOnError, neededFor, currentLane, {\n packageManagerConfigRootDir: this.workspace.path,\n workspaceName: this.workspace.name,\n });\n return scopeAspectIds;\n } catch (err: any) {\n this.throwWsJsoncAspectNotFoundError(err);\n return scopeAspectIds;\n\n throw err;\n }\n }\n\n throwWsJsoncAspectNotFoundError(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\n private async loadAspectDefsByOrder(\n aspectsDefs: AspectDefinition[],\n seeders: string[],\n throwOnError: boolean,\n hideMissingModuleError: boolean,\n ignoreErrorFunc?: (err: Error) => boolean,\n neededFor?: string,\n runSubscribers = true\n ): Promise<{ manifests: Array<Aspect | ExtensionManifest>; requireableComponents: RequireableComponent[] }> {\n const { nonWorkspaceDefs } = await this.groupAspectDefsByWorkspaceExistence(aspectsDefs);\n const scopeAspectsLoader = this.scope.getScopeAspectsLoader();\n const scopeIds: string[] = compact(nonWorkspaceDefs.map((aspectDef) => aspectDef.getId));\n const scopeIdsGrouped = await scopeAspectsLoader.groupAspectIdsByEnvOfTheList(scopeIds);\n\n // Make sure to first load envs from the list otherwise it will fail when trying to load other aspects\n // as their envs might not be loaded yet\n if (scopeIdsGrouped.envs && scopeIdsGrouped.envs.length && !runSubscribers) {\n await this.scope.loadAspects(scopeIdsGrouped.envs, throwOnError, 'workspace.loadAspects loading scope aspects');\n }\n const requireableComponents = this.aspectDefsToRequireableComponents(aspectsDefs);\n const manifests = await this.aspectLoader.getManifestsFromRequireableExtensions(\n requireableComponents,\n throwOnError,\n runSubscribers\n );\n await this.aspectLoader.loadExtensionsByManifests(\n manifests,\n { seeders, neededFor },\n { throwOnError, hideMissingModuleError, ignoreErrorFunc }\n );\n return { manifests, requireableComponents };\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 workspaceName: this.workspace.name,\n resolveEnvsFromRoots: this.resolveEnvsFromRoots,\n packageManagerConfigRootDir: this.workspace.path,\n };\n const mergedOpts = { ...defaultOpts, ...opts };\n const idsToResolve = componentIds ? componentIds.map((id) => id.toString()) : this.harmony.extensionsIds;\n const workspaceLocalAspectsIds = Object.keys(this.workspace.localAspects);\n const [localAspectsIds, nonLocalAspectsIds] = partition(idsToResolve, (id) =>\n workspaceLocalAspectsIds.includes(id)\n );\n\n const localDefs = await this.aspectLoader.resolveLocalAspects(\n localAspectsIds.map((id) => this.workspace.localAspects[id]),\n runtimeName\n );\n const coreAspectsIds = this.aspectLoader.getCoreAspectIds();\n const configuredAspects = this.aspectLoader.getConfiguredAspects();\n // it's possible that componentIds are core-aspects that got version for some reason, remove the version to\n // correctly filter them out later.\n const userAspectsIds: string[] = nonLocalAspectsIds\n ? nonLocalAspectsIds.filter((id) => !coreAspectsIds.includes(id.split('@')[0])).map((id) => id.toString())\n : difference(this.harmony.extensionsIds, coreAspectsIds);\n const rootAspectsIds: string[] = difference(configuredAspects, coreAspectsIds);\n const componentIdsToResolve = await this.workspace.resolveMultipleComponentIds(userAspectsIds);\n const components = await this.importAndGetAspects(componentIdsToResolve, opts?.throwOnError);\n // Run the on load slot\n await this.runOnAspectsResolveFunctions(components);\n\n if (opts?.skipDeps) {\n const wsAspectDefs = await this.aspectLoader.resolveAspects(\n components,\n this.getWorkspaceAspectResolver([], runtimeName)\n );\n\n const 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 const idsToFilter = idsToResolve.map((idStr) => ComponentID.fromString(idStr));\n const targetDefs = wsAspectDefs.concat(coreAspectDefs).concat(localDefs);\n const finalDefs = this.aspectLoader.filterAspectDefs(targetDefs, idsToFilter, runtimeName, mergedOpts);\n\n return finalDefs;\n }\n\n const groupedByIsPlugin = groupBy(components, (component) => {\n return this.aspectLoader.hasPluginFiles(component);\n });\n const graph = await this.getAspectsGraphWithoutCore(groupedByIsPlugin.false, this.isAspect.bind(this));\n const aspectsComponents = graph.nodes.map((node) => node.attr).concat(groupedByIsPlugin.true || []);\n this.logger.debug(`${loggerPrefix} found ${aspectsComponents.length} aspects in the aspects-graph`);\n const { workspaceComps, nonWorkspaceComps } = await this.groupComponentsByWorkspaceExistence(\n aspectsComponents,\n mergedOpts.resolveEnvsFromRoots\n );\n\n const workspaceCompsIds = workspaceComps.map((c) => c.id);\n const nonWorkspaceCompsIds = nonWorkspaceComps.map((c) => c.id);\n this.logFoundWorkspaceVsScope(loggerPrefix, workspaceCompsIds, nonWorkspaceCompsIds);\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);\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 if (!this.resolveAspectsFromNodeModules) {\n mergedOpts.useScopeAspectsCapsule = true;\n }\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 localResolved = await this.aspectLoader.resolveLocalAspects(\n Object.keys(this.workspace.localAspects),\n runtimeName\n );\n const allDefsExceptLocal = [...wsAspectDefs, ...coreAspectDefs, ...scopeAspectsDefs, ...installedAspectsDefs];\n const withoutLocalAspects = allDefsExceptLocal.filter((aspectId) => {\n return !localResolved.find((localAspect) => {\n return localAspect.id === aspectId.component?.id?.toStringWithoutVersion();\n });\n });\n const allDefs = [...withoutLocalAspects, ...localResolved];\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 shouldUseHashForCapsules(): boolean {\n return !this.configStore.getConfig(CFG_CAPSULES_BUILD_COMPONENTS_BASE_DIR);\n }\n\n getCapsulePath() {\n const defaultPath = this.workspace.path;\n return this.configStore.getConfig(CFG_CAPSULES_BUILD_COMPONENTS_BASE_DIR) || defaultPath;\n }\n\n private logFoundWorkspaceVsScope(loggerPrefix: string, workspaceIds: ComponentID[], nonWorkspaceIds: ComponentID[]) {\n const workspaceIdsStr = workspaceIds.length ? workspaceIds.map((id) => id.toString()).join('\\n') : '';\n const nonWorkspaceIdsStr = nonWorkspaceIds.length ? nonWorkspaceIds.map((id) => id.toString()).join('\\n') : '';\n this.logger.debug(\n `${loggerPrefix} found ${workspaceIds.length} components in the workspace, ${nonWorkspaceIds.length} not in the workspace`\n );\n if (workspaceIdsStr) this.logger.debug(`${loggerPrefix} workspace components:\\n${workspaceIdsStr}`);\n if (nonWorkspaceIdsStr)\n this.logger.debug(\n `${loggerPrefix} non workspace components (loaded from the scope capsules or from the node_modules):\\n${nonWorkspaceIdsStr}`\n );\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({ reasonForChange: `use (${aspectIdStr})` });\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 rawConfiguredAspects = this.workspace.getWorkspaceConfig()?.extensionsIds;\n const coreAspectsIds = this.aspectLoader.getCoreAspectIds();\n const userAspectsIds: string[] = difference(rawConfiguredAspects, coreAspectsIds);\n const componentIdsToResolve = await this.workspace.resolveMultipleComponentIds(\n userAspectsIds.filter((id) => !id.startsWith('file:'))\n );\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 const isModule = await this.aspectLoader.isEsmModule(localPath);\n\n const aspect = !isModule\n ? // eslint-disable-next-line global-require, import/no-dynamic-require\n require(localPath)\n : // : await this.aspectLoader.loadEsm(join(localPath, 'dist', 'index.js'));\n await this.aspectLoader.loadEsm(localPath);\n\n // require aspect runtimes\n const runtimePath = await this.aspectLoader.getRuntimePath(component, localPath, MainRuntime.name);\n if (runtimePath) {\n if (isModule) await this.aspectLoader.loadEsm(runtimePath);\n // eslint-disable-next-line global-require, import/no-dynamic-require\n require(runtimePath);\n }\n return aspect;\n };\n return new RequireableComponent(component, requireFunc);\n });\n return compact(requireableComponents);\n }\n\n private async linkIfMissingWorkspaceAspects(aspects: AspectDefinition[]) {\n const idsToLink = await Promise.all(\n aspects.map(async (aspect) => {\n if (!aspect.component)\n throw new Error(`linkIfMissingWorkspaceAspects, aspect.component is missing for ${aspect.aspectPath}`);\n const isInWs = await this.workspace.hasId(aspect.component.id);\n if (!isInWs) return null;\n const exist = await fs.pathExists(aspect.aspectPath);\n if (!exist) return aspect.component.id;\n return null;\n })\n );\n const idsToLinkWithoutNull = compact(idsToLink);\n if (!idsToLinkWithoutNull.length) return;\n await linkToNodeModulesByIds(this.workspace, idsToLinkWithoutNull);\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.toString();\n stringIds.push(compStringId);\n const localPath = await 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.toString();\n // stringIds.push(compStringId);\n const localPath = await 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 async resolveInstalledAspectRecursively(\n aspectComponent: Component,\n rootIds: string[],\n graph: Graph<Component, string>,\n opts: { throwOnError: boolean } = { throwOnError: false }\n ): Promise<string | null | undefined> {\n const aspectStringId = aspectComponent.id.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 = await this.workspace.getComponentPackagePath(aspectComponent);\n this.resolvedInstalledAspects.set(aspectStringId, localPath);\n return localPath;\n }\n const parent = graph.predecessors(aspectStringId)[0];\n if (!parent) return undefined;\n const parentPath = await 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) => ComponentID.fromString(id));\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 because 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 opts: WorkspaceLoadAspectsOptions = {}\n ): Promise<void> {\n const defaultOpts: WorkspaceLoadAspectsOptions = {\n useScopeAspectsCapsule: true,\n throwOnError: false,\n hideMissingModuleError: !!this.workspace.inInstallContext,\n ignoreErrorFunc: this.workspace.inInstallContext ? ignoreAspectLoadingError : undefined,\n resolveEnvsFromRoots: this.resolveEnvsFromRoots,\n };\n const mergedOpts = { ...defaultOpts, ...opts };\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 harmonyExtensions = this.harmony.extensionsIds;\n const loadedExtensions = harmonyExtensions.filter((extId) => {\n return this.harmony.extensions.get(extId)?.loaded;\n });\n const extensionsToLoad = difference(extensionsIds, loadedExtensions);\n if (!extensionsToLoad.length) return;\n await this.loadAspects(extensionsToLoad, undefined, originatedFrom?.toString(), mergedOpts);\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[], throwOnError = true): Promise<Component[]> {\n try {\n // We don't want to load the seeders as aspects as it will cause an infinite loop\n // once you try to load the seeder it will try to load the workspace component\n // that will arrive here again and again\n const loadOpts: ComponentLoadOptions = {\n idsToNotLoadAsAspects: componentIds.map((id) => id.toString()),\n };\n return await this.workspace.importAndGetMany(\n componentIds,\n 'to load aspects from the workspace',\n loadOpts,\n throwOnError\n );\n } catch (err: any) {\n this.throwWsJsoncAspectNotFoundError(err);\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 resolveEnvsFromRoots?: boolean\n ): Promise<{ workspaceComps: Component[]; nonWorkspaceComps: Component[] }> {\n let workspaceComps: Component[] = [];\n let 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 if (resolveEnvsFromRoots) {\n const { rootComps, nonRootComps } = await this.groupComponentsByLoadFromRootComps(nonWorkspaceComps);\n workspaceComps = workspaceComps.concat(rootComps);\n nonWorkspaceComps = nonRootComps;\n }\n return { workspaceComps, nonWorkspaceComps };\n }\n\n private async groupComponentsByLoadFromRootComps(\n components: Component[]\n ): Promise<{ rootComps: Component[]; nonRootComps: Component[] }> {\n const rootComps: Component[] = [];\n const nonRootComps: Component[] = [];\n await Promise.all(\n components.map(async (component) => {\n const shouldLoadFromRootComps = await this.shouldLoadFromRootComps(component);\n if (shouldLoadFromRootComps) {\n rootComps.push(component);\n return;\n }\n nonRootComps.push(component);\n })\n );\n return { rootComps, nonRootComps };\n }\n\n private async shouldLoadFromRootComps(component: Component): Promise<boolean> {\n const rootDir = await this.workspace.getComponentPackagePath(component);\n const rootDirExist = await fs.pathExists(rootDir);\n const aspectFilePath = await this.aspectLoader.getAspectFilePath(component, rootDir);\n const aspectFilePathExist = aspectFilePath ? await fs.pathExists(aspectFilePath) : false;\n const pluginFiles = await this.aspectLoader.getPluginFiles(component, rootDir);\n\n // checking that we have the root dir (this means it's an aspect that needs to be loaded from there)\n // and validate that localPathExist so we can\n // really load the component from that path (if it's there it means that it's an env)\n if (rootDirExist && (aspectFilePathExist || pluginFiles.length)) {\n return true;\n }\n // If the component has env.jsonc we want to list it to be loaded from the root folder\n // even if it's not there yet\n // in that case we will fail to load it, and the user will need to run bit install\n if (this.envs.hasEnvManifest(component)) {\n return true;\n }\n return false;\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 groupAspectDefsByWorkspaceExistence(\n aspectDefs: AspectDefinition[]\n ): Promise<{ workspaceDefs: AspectDefinition[]; nonWorkspaceDefs: AspectDefinition[] }> {\n const workspaceDefs: AspectDefinition[] = [];\n const nonWorkspaceDefs: AspectDefinition[] = [];\n await Promise.all(\n aspectDefs.map(async (aspectDef) => {\n const id = aspectDef.component?.id;\n const existOnWorkspace = id ? await this.workspace.hasId(id) : true;\n if (existOnWorkspace) {\n workspaceDefs.push(aspectDef);\n return;\n }\n const shouldLoadFromRootComps = aspectDef.component\n ? await this.shouldLoadFromRootComps(aspectDef.component)\n : undefined;\n if (shouldLoadFromRootComps) {\n workspaceDefs.push(aspectDef);\n return;\n }\n nonWorkspaceDefs.push(aspectDef);\n })\n );\n return { workspaceDefs, nonWorkspaceDefs };\n }\n\n private async groupIdsByWorkspaceExistence(\n ids: ComponentID[],\n resolveEnvsFromRoots?: boolean\n ): Promise<{ workspaceIds: ComponentID[]; nonWorkspaceIds: ComponentID[] }> {\n let workspaceIds: ComponentID[] = [];\n let 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 // We need to bring the components in order to really group them with taking the root comps into account\n const scopeComponents = await this.importAndGetAspects(nonWorkspaceIds);\n const { nonWorkspaceComps, workspaceComps } = await this.groupComponentsByWorkspaceExistence(\n scopeComponents,\n resolveEnvsFromRoots\n );\n workspaceIds = workspaceIds.concat(workspaceComps.map((c) => c.id));\n nonWorkspaceIds = nonWorkspaceComps.map((c) => c.id);\n return { workspaceIds, nonWorkspaceIds };\n }\n}\n\nfunction ignoreAspectLoadingError(err: Error) {\n // Ignoring that error as probably we are in the middle of the installation process\n // so we didn't yet compile the aspect to esm corre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teambit/component-id';
2
2
  import { SourceFile } from '@teambit/component.sources';
3
- import { Repository, SourceFileModel } from '@teambit/objects';
3
+ import type { Repository, SourceFileModel } from '@teambit/objects';
4
4
  type FILE_STATUS = 'new' | 'modified' | 'deleted' | 'unchanged';
5
5
  type PathLinux = string;
6
6
  export type FilesStatus = {
@@ -1 +1 @@
1
- {"version":3,"names":["_component","data","require","CompFiles","constructor","id","repository","currentFiles","compDir","modelFiles","isModified","length","some","file","headFile","find","h","relativePath","relative","isEqual","toSourceAsLinuxEOL","hash","getCurrentFiles","getHeadFiles","Promise","all","map","SourceFile","loadFromSourceFileModel","getFilesStatus","result","reduce","acc","getType","forEach","currentFile","c","exports"],"sources":["comp-files.ts"],"sourcesContent":["import { ComponentID } from '@teambit/component-id';\nimport { SourceFile } from '@teambit/component.sources';\nimport { Repository, SourceFileModel } from '@teambit/objects';\n\ntype FILE_STATUS = 'new' | 'modified' | 'deleted' | 'unchanged';\ntype PathLinux = string; // ts fails when importing it from @teambit/legacy/dist/utils/path.\nexport type FilesStatus = { [pathRelativeToCompDir: PathLinux]: FILE_STATUS };\n\nexport class CompFiles {\n constructor(\n readonly id: ComponentID,\n private repository: Repository,\n private currentFiles: SourceFile[],\n readonly compDir: PathLinux,\n private modelFiles: SourceFileModel[] = []\n ) {}\n\n isModified(): boolean {\n if (!this.modelFiles.length) return false;\n if (this.currentFiles.length !== this.modelFiles.length) return true;\n return this.currentFiles.some((file) => {\n const headFile = this.modelFiles.find((h) => h.relativePath === file.relative);\n if (!headFile) return true;\n return !headFile.file.isEqual(file.toSourceAsLinuxEOL().hash());\n });\n }\n\n getCurrentFiles(): SourceFile[] {\n return this.currentFiles;\n }\n\n async getHeadFiles(): Promise<SourceFile[]> {\n return Promise.all(this.modelFiles.map((file) => SourceFile.loadFromSourceFileModel(file, this.repository)));\n }\n\n getFilesStatus(): FilesStatus {\n const result = this.currentFiles.reduce((acc, file) => {\n const headFile = this.modelFiles.find((h) => h.relativePath === file.relative);\n const getType = (): FILE_STATUS => {\n if (!headFile) return 'new';\n if (headFile.file.isEqual(file.toSourceAsLinuxEOL().hash())) return 'unchanged';\n return 'modified';\n };\n acc[file.relative] = getType();\n return acc;\n }, {});\n this.modelFiles.forEach((headFile) => {\n const currentFile = this.currentFiles.find((c) => c.relative === headFile.relativePath);\n if (!currentFile) {\n result[headFile.relativePath] = 'deleted';\n }\n });\n return result;\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,WAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,UAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIyB;;AAGlB,MAAME,SAAS,CAAC;EACrBC,WAAWA,CACAC,EAAe,EAChBC,UAAsB,EACtBC,YAA0B,EACzBC,OAAkB,EACnBC,UAA6B,GAAG,EAAE,EAC1C;IAAA,KALSJ,EAAe,GAAfA,EAAe;IAAA,KAChBC,UAAsB,GAAtBA,UAAsB;IAAA,KACtBC,YAA0B,GAA1BA,YAA0B;IAAA,KACzBC,OAAkB,GAAlBA,OAAkB;IAAA,KACnBC,UAA6B,GAA7BA,UAA6B;EACpC;EAEHC,UAAUA,CAAA,EAAY;IACpB,IAAI,CAAC,IAAI,CAACD,UAAU,CAACE,MAAM,EAAE,OAAO,KAAK;IACzC,IAAI,IAAI,CAACJ,YAAY,CAACI,MAAM,KAAK,IAAI,CAACF,UAAU,CAACE,MAAM,EAAE,OAAO,IAAI;IACpE,OAAO,IAAI,CAACJ,YAAY,CAACK,IAAI,CAAEC,IAAI,IAAK;MACtC,MAAMC,QAAQ,GAAG,IAAI,CAACL,UAAU,CAACM,IAAI,CAAEC,CAAC,IAAKA,CAAC,CAACC,YAAY,KAAKJ,IAAI,CAACK,QAAQ,CAAC;MAC9E,IAAI,CAACJ,QAAQ,EAAE,OAAO,IAAI;MAC1B,OAAO,CAACA,QAAQ,CAACD,IAAI,CAACM,OAAO,CAACN,IAAI,CAACO,kBAAkB,CAAC,CAAC,C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AAG,SAAS;MAC3C;IACF,CAAC,CAAC;IACF,OAAOa,MAAM;EACf;AACF;AAACO,OAAA,CAAAlC,SAAA,GAAAA,SAAA","ignoreList":[]}
1
+ {"version":3,"names":["_component","data","require","CompFiles","constructor","id","repository","currentFiles","compDir","modelFiles","isModified","length","some","file","headFile","find","h","relativePath","relative","isEqual","toSourceAsLinuxEOL","hash","getCurrentFiles","getHeadFiles","Promise","all","map","SourceFile","loadFromSourceFileModel","getFilesStatus","result","reduce","acc","getType","forEach","currentFile","c","exports"],"sources":["comp-files.ts"],"sourcesContent":["import type { ComponentID } from '@teambit/component-id';\nimport { SourceFile } from '@teambit/component.sources';\nimport type { Repository, SourceFileModel } from '@teambit/objects';\n\ntype FILE_STATUS = 'new' | 'modified' | 'deleted' | 'unchanged';\ntype PathLinux = string; // ts fails when importing it from @teambit/legacy/dist/utils/path.\nexport type FilesStatus = { [pathRelativeToCompDir: PathLinux]: FILE_STATUS };\n\nexport class CompFiles {\n constructor(\n readonly id: ComponentID,\n private repository: Repository,\n private currentFiles: SourceFile[],\n readonly compDir: PathLinux,\n private modelFiles: SourceFileModel[] = []\n ) {}\n\n isModified(): boolean {\n if (!this.modelFiles.length) return false;\n if (this.currentFiles.length !== this.modelFiles.length) return true;\n return this.currentFiles.some((file) => {\n const headFile = this.modelFiles.find((h) => h.relativePath === file.relative);\n if (!headFile) return true;\n return !headFile.file.isEqual(file.toSourceAsLinuxEOL().hash());\n });\n }\n\n getCurrentFiles(): SourceFile[] {\n return this.currentFiles;\n }\n\n async getHeadFiles(): Promise<SourceFile[]> {\n return Promise.all(this.modelFiles.map((file) => SourceFile.loadFromSourceFileModel(file, this.repository)));\n }\n\n getFilesStatus(): FilesStatus {\n const result = this.currentFiles.reduce((acc, file) => {\n const headFile = this.modelFiles.find((h) => h.relativePath === file.relative);\n const getType = (): FILE_STATUS => {\n if (!headFile) return 'new';\n if (headFile.file.isEqual(file.toSourceAsLinuxEOL().hash())) return 'unchanged';\n return 'modified';\n };\n acc[file.relative] = getType();\n return acc;\n }, {});\n this.modelFiles.forEach((headFile) => {\n const currentFile = this.currentFiles.find((c) => c.relative === headFile.relativePath);\n if (!currentFile) {\n result[headFile.relativePath] = 'deleted';\n }\n });\n return result;\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,WAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,UAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIyB;;AAGlB,MAAME,SAAS,CAAC;EACrBC,WAAWA,CACAC,EAAe,EAChBC,UAAsB,EACtBC,YAA0B,EACzBC,OAAkB,EACnBC,UAA6B,GAAG,EAAE,EAC1C;IAAA,KALSJ,EAAe,GAAfA,EAAe;IAAA,KAChBC,UAAsB,GAAtBA,UAAsB;IAAA,KACtBC,YAA0B,GAA1BA,YAA0B;IAAA,KACzBC,OAAkB,GAAlBA,OAAkB;IAAA,KACnBC,UAA6B,GAA7BA,UAA6B;EACpC;EAEHC,UAAUA,CAAA,EAAY;IACpB,IAAI,CAAC,IAAI,CAACD,UAAU,CAACE,MAAM,EAAE,OAAO,KAAK;IACzC,IAAI,IAAI,CAACJ,YAAY,CAACI,MAAM,KAAK,IAAI,CAACF,UAAU,CAACE,MAAM,EAAE,OAAO,IAAI;IACpE,OAAO,IAAI,CAACJ,YAAY,CAACK,IAAI,CAAEC,IAAI,IAAK;MACtC,MAAMC,QAAQ,GAAG,IAAI,CAACL,UAAU,CAACM,IAAI,CAAEC,CAAC,IAAKA,CAAC,CAACC,YAAY,KAAKJ,IAAI,CAACK,QAAQ,CAAC;MAC9E,IAAI,CAACJ,QAAQ,EAAE,OAAO,IAAI;MAC1B,OAAO,CAACA,QAAQ,CAACD,IAAI,CAACM,OAAO,CAACN,IAAI,CAACO,kBAAkB,CAAC,CAAC,CAACC,IAAI,CAAC,CAAC,CAAC;IACjE,CAAC,CAAC;EACJ;EAEAC,eAAeA,CAAA,EAAiB;IAC9B,OAAO,I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,SAAA","ignoreList":[]}
@@ -1,6 +1,6 @@
1
- import { ComponentID } from '@teambit/component-id';
2
- import { Consumer } from '@teambit/legacy.consumer';
3
- import { Workspace } from '..';
1
+ import type { ComponentID } from '@teambit/component-id';
2
+ import type { Consumer } from '@teambit/legacy.consumer';
3
+ import type { Workspace } from '..';
4
4
  export type ComponentStatusLegacy = {
5
5
  modified: boolean;
6
6
  newlyCreated: boolean;
@@ -1 +1 @@
1
- {"version":3,"names":["_pMapSeries","data","_interopRequireDefault","require","_componentId","_bitError","_objects","_legacy","_legacy2","_legacy3","_legacy4","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","ComponentStatusLoader","constructor","workspace","consumer","getManyComponentsStatuses","ids","results","mapSeries","id","status","getComponentStatusById","push","_componentsStatusCache","toString","result","getStatus","componentFromModel","scope","getModelComponentIfExist","componentFromFileSystem","components","removedComponents","loadComponents","ComponentIdList","changeVersion","LATEST","length","deleted","err","ComponentNotFoundInPath","MissingBitMapComponent","notExist","ComponentsPendingImport","missingFromScope","newlyCreated","getHeadRegardlessOfLaneAsTagOrHash","VERSION_ZERO","lane","getCurrentLaneObject","versionFromFs","version","staged","isLocallyChanged","objects","idStr","hasVersion","ComponentOutOfSync","versionRef","getRef","BitError","versionFromModel","getObject","hash","modified","isComponentModified","clearOneComponentCache","clearCache","exports"],"sources":["component-status-loader.ts"],"sourcesContent":["import mapSeries from 'p-map-series';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport { BitError } from '@teambit/bit-error';\nimport { ModelComponent, VERSION_ZERO } from '@teambit/objects';\nimport { Consumer, ComponentsPendingImport, ComponentOutOfSync } from '@teambit/legacy.consumer';\nimport { LATEST } from '@teambit/legacy.constants';\nimport { MissingBitMapComponent } from '@teambit/legacy.bit-map';\nimport { ComponentNotFoundInPath, ConsumerComponent } from '@teambit/legacy.consumer-component';\nimport { Workspace } from '..';\n\nexport type ComponentStatusLegacy = {\n modified: boolean;\n newlyCreated: boolean;\n deleted: boolean;\n staged: boolean;\n notExist: boolean;\n missingFromScope: boolean;\n};\n\nexport type ComponentStatusResult = { id: ComponentID; status: ComponentStatusLegacy };\n\nexport class ComponentStatusLoader {\n private _componentsStatusCache: Record<string, any> = {}; // cache loaded components\n constructor(private workspace: Workspace) {}\n\n get consumer(): Consumer {\n return this.workspace.consumer;\n }\n\n async getManyComponentsStatuses(ids: ComponentID[]): Promise<ComponentStatusResult[]> {\n const results: ComponentStatusResult[] = [];\n await mapSeries(ids, async (id) => {\n const status = await this.getComponentStatusById(id);\n results.push({ id, status });\n });\n return results;\n }\n\n /**\n * Get a component status by ID. Return a ComponentStatus object.\n * Keep in mind that a result can be a partial object of ComponentStatus, e.g. { notExist: true }.\n * Each one of the ComponentStatus properties can be undefined, true or false.\n * As a result, in order to check whether a component is not modified use (status.modified === false).\n * Don't use (!status.modified) because a component may not exist and the status.modified will be undefined.\n *\n * The status may have 'true' for several properties. For example, a component can be staged and modified at the\n * same time.\n *\n * The result is cached per ID and can be called several times with no penalties.\n */\n async getComponentStatusById(id: ComponentID): Promise<ComponentStatusLegacy> {\n if (!this._componentsStatusCache[id.toString()]) {\n // don't do this: `this._componentsStatusCache[id.toString()] = await this.getStatus(id);`\n // yes, it doesn't make sense right? turns out that \"getStatus\" can call `linkIfMissingWorkspaceAspects` which\n // calls `linkToNodeModulesByIds` which deletes this cache. and makes this: `this._componentsStatusCache[id.toString()]` undefined.\n const result = await this.getStatus(id);\n this._componentsStatusCache[id.toString()] = result;\n }\n return this._componentsStatusCache[id.toString()];\n }\n\n private async getStatus(id: ComponentID) {\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n const status: ComponentStatusLegacy = {};\n const componentFromModel: ModelComponent | undefined = await this.consumer.scope.getModelComponentIfExist(id);\n let componentFromFileSystem: ConsumerComponent | undefined;\n try {\n // change to 'latest' before loading from FS. don't change to null, otherwise, it'll cause\n // loadOne to not find model component as it assumes there is no version\n // also, don't leave the id as is, otherwise, it'll cause issues with import --merge, when\n // imported version is bigger than .bitmap, it won't find it and will consider as deleted\n const { components, removedComponents } = await this.consumer.loadComponents(\n new ComponentIdList(id.changeVersion(LATEST))\n );\n if (removedComponents.length) {\n status.deleted = true;\n return status;\n }\n componentFromFileSystem = components[0];\n } catch (err: any) {\n if (err instanceof ComponentNotFoundInPath || err instanceof MissingBitMapComponent) {\n // the file/s have been deleted or the component doesn't exist in bit.map file\n if (componentFromModel) status.deleted = true;\n else status.notExist = true;\n return status;\n }\n if (err instanceof ComponentsPendingImport) {\n status.missingFromScope;\n return status;\n }\n throw err;\n }\n if (!componentFromModel) {\n status.newlyCreated = true;\n return status;\n }\n if (componentFromModel.getHeadRegardlessOfLaneAsTagOrHash(true) === VERSION_ZERO) {\n status.newlyCreated = true;\n return status;\n }\n\n const lane = await this.consumer.getCurrentLaneObject();\n const versionFromFs = componentFromFileSystem.id.version;\n status.staged = await componentFromModel.isLocallyChanged(\n this.consumer.scope.objects,\n lane,\n componentFromFileSystem.id\n );\n\n const idStr = id.toString();\n if (!componentFromFileSystem.id.hasVersion()) {\n throw new ComponentOutOfSync(idStr);\n }\n // TODO: instead of doing that like this we should use:\n // const versionFromModel = await componentFromModel.loadVersion(versionFromFs, this.consumer.scope.objects);\n // it looks like it's exactly the same code but it's not working from some reason\n const versionRef = componentFromModel.getRef(versionFromFs);\n if (!versionRef) throw new BitError(`version ${versionFromFs} was not found in ${idStr}`);\n const versionFromModel = await this.consumer.scope.getObject(versionRef.hash);\n if (!versionFromModel) {\n throw new BitError(`failed loading version ${versionFromFs} of ${idStr} from the scope`);\n }\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n status.modified = await this.consumer.isComponentModified(versionFromModel, componentFromFileSystem);\n return status;\n }\n\n clearOneComponentCache(id: ComponentID) {\n delete this._componentsStatusCache[id.toString()];\n }\n\n clearCache() {\n this._componentsStatusCache = {};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;IAC1F;IACA;IACAnC,MAAM,CAAC4C,QAAQ,GAAG,MAAM,IAAI,CAAClD,QAAQ,CAACmD,mBAAmB,CAACJ,gBAAgB,EAAE/B,uBAAuB,CAAC;IACpG,OAAOV,MAAM;EACf;EAEA8C,sBAAsBA,CAAC/C,EAAe,EAAE;IACtC,OAAO,IAAI,CAACI,sBAAsB,CAACJ,EAAE,CAACK,QAAQ,CAAC,CAAC,CAAC;EACnD;EAEA2C,UAAUA,CAAA,EAAG;IACX,IAAI,CAAC5C,sBAAsB,GAAG,CAAC,CAAC;EAClC;AACF;AAAC6C,OAAA,CAAAzD,qBAAA,GAAAA,qBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_pMapSeries","data","_interopRequireDefault","require","_componentId","_bitError","_objects","_legacy","_legacy2","_legacy3","_legacy4","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","ComponentStatusLoader","constructor","workspace","consumer","getManyComponentsStatuses","ids","results","mapSeries","id","status","getComponentStatusById","push","_componentsStatusCache","toString","result","getStatus","componentFromModel","scope","getModelComponentIfExist","componentFromFileSystem","components","removedComponents","loadComponents","ComponentIdList","changeVersion","LATEST","length","deleted","err","ComponentNotFoundInPath","MissingBitMapComponent","notExist","ComponentsPendingImport","missingFromScope","newlyCreated","getHeadRegardlessOfLaneAsTagOrHash","VERSION_ZERO","lane","getCurrentLaneObject","versionFromFs","version","staged","isLocallyChanged","objects","idStr","hasVersion","ComponentOutOfSync","versionRef","getRef","BitError","versionFromModel","getObject","hash","modified","isComponentModified","clearOneComponentCache","clearCache","exports"],"sources":["component-status-loader.ts"],"sourcesContent":["import mapSeries from 'p-map-series';\nimport type { ComponentID } from '@teambit/component-id';\nimport { ComponentIdList } from '@teambit/component-id';\nimport { BitError } from '@teambit/bit-error';\nimport type { ModelComponent } from '@teambit/objects';\nimport { VERSION_ZERO } from '@teambit/objects';\nimport type { Consumer } from '@teambit/legacy.consumer';\nimport { ComponentsPendingImport, ComponentOutOfSync } from '@teambit/legacy.consumer';\nimport { LATEST } from '@teambit/legacy.constants';\nimport { MissingBitMapComponent } from '@teambit/legacy.bit-map';\nimport type { ConsumerComponent } from '@teambit/legacy.consumer-component';\nimport { ComponentNotFoundInPath } from '@teambit/legacy.consumer-component';\nimport type { Workspace } from '..';\n\nexport type ComponentStatusLegacy = {\n modified: boolean;\n newlyCreated: boolean;\n deleted: boolean;\n staged: boolean;\n notExist: boolean;\n missingFromScope: boolean;\n};\n\nexport type ComponentStatusResult = { id: ComponentID; status: ComponentStatusLegacy };\n\nexport class ComponentStatusLoader {\n private _componentsStatusCache: Record<string, any> = {}; // cache loaded components\n constructor(private workspace: Workspace) {}\n\n get consumer(): Consumer {\n return this.workspace.consumer;\n }\n\n async getManyComponentsStatuses(ids: ComponentID[]): Promise<ComponentStatusResult[]> {\n const results: ComponentStatusResult[] = [];\n await mapSeries(ids, async (id) => {\n const status = await this.getComponentStatusById(id);\n results.push({ id, status });\n });\n return results;\n }\n\n /**\n * Get a component status by ID. Return a ComponentStatus object.\n * Keep in mind that a result can be a partial object of ComponentStatus, e.g. { notExist: true }.\n * Each one of the ComponentStatus properties can be undefined, true or false.\n * As a result, in order to check whether a component is not modified use (status.modified === false).\n * Don't use (!status.modified) because a component may not exist and the status.modified will be undefined.\n *\n * The status may have 'true' for several properties. For example, a component can be staged and modified at the\n * same time.\n *\n * The result is cached per ID and can be called several times with no penalties.\n */\n async getComponentStatusById(id: ComponentID): Promise<ComponentStatusLegacy> {\n if (!this._componentsStatusCache[id.toString()]) {\n // don't do this: `this._componentsStatusCache[id.toString()] = await this.getStatus(id);`\n // yes, it doesn't make sense right? turns out that \"getStatus\" can call `linkIfMissingWorkspaceAspects` which\n // calls `linkToNodeModulesByIds` which deletes this cache. and makes this: `this._componentsStatusCache[id.toString()]` undefined.\n const result = await this.getStatus(id);\n this._componentsStatusCache[id.toString()] = result;\n }\n return this._componentsStatusCache[id.toString()];\n }\n\n private async getStatus(id: ComponentID) {\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n const status: ComponentStatusLegacy = {};\n const componentFromModel: ModelComponent | undefined = await this.consumer.scope.getModelComponentIfExist(id);\n let componentFromFileSystem: ConsumerComponent | undefined;\n try {\n // change to 'latest' before loading from FS. don't change to null, otherwise, it'll cause\n // loadOne to not find model component as it assumes there is no version\n // also, don't leave the id as is, otherwise, it'll cause issues with import --merge, when\n // imported version is bigger than .bitmap, it won't find it and will consider as deleted\n const { components, removedComponents } = await this.consumer.loadComponents(\n new ComponentIdList(id.changeVersion(LATEST))\n );\n if (removedComponents.length) {\n status.deleted = true;\n return status;\n }\n componentFromFileSystem = components[0];\n } catch (err: any) {\n if (err instanceof ComponentNotFoundInPath || err instanceof MissingBitMapComponent) {\n // the file/s have been deleted or the component doesn't exist in bit.map file\n if (componentFromModel) status.deleted = true;\n else status.notExist = true;\n return status;\n }\n if (err instanceof ComponentsPendingImport) {\n status.missingFromScope;\n return status;\n }\n throw err;\n }\n if (!componentFromModel) {\n status.newlyCreated = true;\n return status;\n }\n if (componentFromModel.getHeadRegardlessOfLaneAsTagOrHash(true) === VERSION_ZERO) {\n status.newlyCreated = true;\n return status;\n }\n\n const lane = await this.consumer.getCurrentLaneObject();\n const versionFromFs = componentFromFileSystem.id.version;\n status.staged = await componentFromModel.isLocallyChanged(\n this.consumer.scope.objects,\n lane,\n componentFromFileSystem.id\n );\n\n const idStr = id.toString();\n if (!componentFromFileSystem.id.hasVersion()) {\n throw new ComponentOutOfSync(idStr);\n }\n // TODO: instead of doing that like this we should use:\n // const versionFromModel = await componentFromModel.loadVersion(versionFromFs, this.consumer.scope.objects);\n // it looks like it's exactly the same code but it's not working from some reason\n const versionRef = componentFromModel.getRef(versionFromFs);\n if (!versionRef) throw new BitError(`version ${versionFromFs} was not found in ${idStr}`);\n const versionFromModel = await this.consumer.scope.getObject(versionRef.hash);\n if (!versionFromModel) {\n throw new BitError(`failed loading version ${versionFromFs} of ${idStr} from the scope`);\n }\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n status.modified = await this.consumer.isComponentModified(versionFromModel, componentFromFileSystem);\n return status;\n }\n\n clearOneComponentCache(id: ComponentID) {\n delete this._componentsStatusCache[id.toString()];\n }\n\n clearCache() {\n this._componentsStatusCache = {};\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,aAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,YAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,UAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,SAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,SAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,QAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,QAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,OAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,SAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,QAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,SAAA;EAAA,MAAAR,IAAA,GAAAE,OAAA;EAAAM,QAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAS,SAAA;EAAA,MAAAT,IAAA,GAAAE,OAAA;EAAA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KAAK,EAAE,CAAC;IACzF,MAAMM,gBAAgB,GAAG,MAAM,IAAI,CAAC/C,QAAQ,CAACc,KAAK,CAACkC,SAAS,CAACJ,UAAU,CAACK,IAAI,CAAC;IAC7E,IAAI,CAACF,gBAAgB,EAAE;MACrB,MAAM,KAAID,oBAAQ,EAAC,0BAA0BV,aAAa,OAAOK,KAAK,iBAAiB,CAAC;IAC1F;IACA;IACAnC,MAAM,CAAC4C,QAAQ,GAAG,MAAM,IAAI,CAAClD,QAAQ,CAACmD,mBAAmB,CAACJ,gBAAgB,EAAE/B,uBAAuB,CAAC;IACpG,OAAOV,MAAM;EACf;EAEA8C,sBAAsBA,CAAC/C,EAAe,EAAE;IACtC,OAAO,IAAI,CAACI,sBAAsB,CAACJ,EAAE,CAACK,QAAQ,CAAC,CAAC,CAAC;EACnD;EAEA2C,UAAUA,CAAA,EAAG;IACX,IAAI,CAAC5C,sBAAsB,GAAG,CAAC,CAAC;EAClC;AACF;AAAC6C,OAAA,CAAAzD,qBAAA,GAAAA,qBAAA","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import { ComponentStatusLegacy } from './component-status-loader';
1
+ import type { ComponentStatusLegacy } from './component-status-loader';
2
2
  export type ModifyInfo = {
3
3
  hasModifiedFiles: boolean;
4
4
  hasModifiedDependencies: boolean;
@@ -1 +1 @@
1
- {"version":3,"names":["ComponentStatus","constructor","modifyInfo","isNew","isDeleted","isStaged","isInWorkspace","isInScope","isOutdated","nested","fromLegacy","status","hasModifiedDependencies","modify","hasModifiedFiles","modified","newlyCreated","deleted","staged","notExist","missingFromScope","exports"],"sources":["component-status.ts"],"sourcesContent":["import { ComponentStatusLegacy } from './component-status-loader';\n\nexport type ModifyInfo = {\n hasModifiedFiles: boolean;\n hasModifiedDependencies: boolean;\n};\n\nexport class ComponentStatus {\n constructor(\n /**\n * is the component modified.\n */\n readonly modifyInfo: ModifyInfo,\n\n /**\n * is the new component new.\n */\n readonly isNew: boolean,\n\n /**\n * is the component deleted from the workspace.\n */\n readonly isDeleted: boolean,\n\n /**\n * is the component staged.\n */\n readonly isStaged: boolean,\n\n /**\n * does the component exists in the workspace.\n */\n readonly isInWorkspace: boolean,\n\n /**\n * does the component exists in the scope.\n */\n readonly isInScope: boolean,\n\n /**\n * does the component is outdated (pending for update).\n */\n readonly isOutdated: boolean,\n\n /**\n * @deprecated this was relevant for legacy only. can be deleted if it's not used elsewhere\n * the component is not authored and not imported.\n */\n readonly nested?: boolean\n ) {}\n\n static fromLegacy(status: ComponentStatusLegacy, hasModifiedDependencies: boolean, isOutdated: boolean) {\n const modify: ModifyInfo = {\n hasModifiedFiles: !!status.modified,\n hasModifiedDependencies,\n };\n return new ComponentStatus(\n modify,\n !!status.newlyCreated,\n !!status.deleted,\n !!status.staged,\n !status.notExist,\n !status.missingFromScope,\n isOutdated\n );\n }\n}\n"],"mappings":";;;;;;AAOO,MAAMA,eAAe,CAAC;EAC3BC,WAAWA;EACT;AACJ;AACA;EACaC,UAAsB;EAE/B;AACJ;AACA;EACaC,KAAc;EAEvB;AACJ;AACA;EACaC,SAAkB;EAE3B;AACJ;AACA;EACaC,QAAiB;EAE1B;AACJ;AACA;EACaC,aAAsB;EAE/B;AACJ;AACA;EACaC,SAAkB;EAE3B;AACJ;AACA;EACaC,UAAmB;EAE5B;AACJ;AACA;AACA;EACaC,MAAgB,EACzB;IAAA,KArCSP,UAAsB,GAAtBA,UAAsB;IAAA,KAKtBC,KAAc,GAAdA,KAAc;IAAA,KAKdC,SAAkB,GAAlBA,SAAkB;IAAA,KAKlBC,QAAiB,GAAjBA,QAAiB;IAAA,KAKjBC,aAAsB,GAAtBA,aAAsB;IAAA,KAKtBC,SAAkB,GAAlBA,SAAkB;IAAA,KAKlBC,UAAmB,GAAnBA,UAAmB;IAAA,KAMnBC,MAAgB,GAAhBA,MAAgB;EACxB;EAEH,OAAOC,UAAUA,CAACC,MAA6B,EAAEC,uBAAgC,EAAEJ,UAAmB,EAAE;IACtG,MAAMK,MAAkB,GAAG;MACzBC,gBAAgB,EAAE,CAAC,CAACH,MAAM,CAACI,QAAQ;MACnCH;IACF,CAAC;IACD,OAAO,IAAIZ,eAAe,CACxBa,MAAM,EACN,CAAC,CAACF,MAAM,CAACK,YAAY,EACrB,CAAC,CAACL,MAAM,CAACM,OAAO,EAChB,CAAC,CAACN,MAAM,CAACO,MAAM,EACf,CAACP,MAAM,CAACQ,QAAQ,EAChB,CAACR,MAAM,CAACS,gBAAgB,EACxBZ,UACF,CAAC;EACH;AACF;AAACa,OAAA,CAAArB,eAAA,GAAAA,eAAA","ignoreList":[]}
1
+ {"version":3,"names":["ComponentStatus","constructor","modifyInfo","isNew","isDeleted","isStaged","isInWorkspace","isInScope","isOutdated","nested","fromLegacy","status","hasModifiedDependencies","modify","hasModifiedFiles","modified","newlyCreated","deleted","staged","notExist","missingFromScope","exports"],"sources":["component-status.ts"],"sourcesContent":["import type { ComponentStatusLegacy } from './component-status-loader';\n\nexport type ModifyInfo = {\n hasModifiedFiles: boolean;\n hasModifiedDependencies: boolean;\n};\n\nexport class ComponentStatus {\n constructor(\n /**\n * is the component modified.\n */\n readonly modifyInfo: ModifyInfo,\n\n /**\n * is the new component new.\n */\n readonly isNew: boolean,\n\n /**\n * is the component deleted from the workspace.\n */\n readonly isDeleted: boolean,\n\n /**\n * is the component staged.\n */\n readonly isStaged: boolean,\n\n /**\n * does the component exists in the workspace.\n */\n readonly isInWorkspace: boolean,\n\n /**\n * does the component exists in the scope.\n */\n readonly isInScope: boolean,\n\n /**\n * does the component is outdated (pending for update).\n */\n readonly isOutdated: boolean,\n\n /**\n * @deprecated this was relevant for legacy only. can be deleted if it's not used elsewhere\n * the component is not authored and not imported.\n */\n readonly nested?: boolean\n ) {}\n\n static fromLegacy(status: ComponentStatusLegacy, hasModifiedDependencies: boolean, isOutdated: boolean) {\n const modify: ModifyInfo = {\n hasModifiedFiles: !!status.modified,\n hasModifiedDependencies,\n };\n return new ComponentStatus(\n modify,\n !!status.newlyCreated,\n !!status.deleted,\n !!status.staged,\n !status.notExist,\n !status.missingFromScope,\n isOutdated\n );\n }\n}\n"],"mappings":";;;;;;AAOO,MAAMA,eAAe,CAAC;EAC3BC,WAAWA;EACT;AACJ;AACA;EACaC,UAAsB;EAE/B;AACJ;AACA;EACaC,KAAc;EAEvB;AACJ;AACA;EACaC,SAAkB;EAE3B;AACJ;AACA;EACaC,QAAiB;EAE1B;AACJ;AACA;EACaC,aAAsB;EAE/B;AACJ;AACA;EACaC,SAAkB;EAE3B;AACJ;AACA;EACaC,UAAmB;EAE5B;AACJ;AACA;AACA;EACaC,MAAgB,EACzB;IAAA,KArCSP,UAAsB,GAAtBA,UAAsB;IAAA,KAKtBC,KAAc,GAAdA,KAAc;IAAA,KAKdC,SAAkB,GAAlBA,SAAkB;IAAA,KAKlBC,QAAiB,GAAjBA,QAAiB;IAAA,KAKjBC,aAAsB,GAAtBA,aAAsB;IAAA,KAKtBC,SAAkB,GAAlBA,SAAkB;IAAA,KAKlBC,UAAmB,GAAnBA,UAAmB;IAAA,KAMnBC,MAAgB,GAAhBA,MAAgB;EACxB;EAEH,OAAOC,UAAUA,CAACC,MAA6B,EAAEC,uBAAgC,EAAEJ,UAAmB,EAAE;IACtG,MAAMK,MAAkB,GAAG;MACzBC,gBAAgB,EAAE,CAAC,CAACH,MAAM,CAACI,QAAQ;MACnCH;IACF,CAAC;IACD,OAAO,IAAIZ,eAAe,CACxBa,MAAM,EACN,CAAC,CAACF,MAAM,CAACK,YAAY,EACrB,CAAC,CAACL,MAAM,CAACM,OAAO,EAChB,CAAC,CAACN,MAAM,CAACO,MAAM,EACf,CAACP,MAAM,CAACQ,QAAQ,EAChB,CAACR,MAAM,CAACS,gBAAgB,EACxBZ,UACF,CAAC;EACH;AACF;AAACa,OAAA,CAAArB,eAAA,GAAAA,eAAA","ignoreList":[]}
@@ -1,11 +1,12 @@
1
- import { Component, InvalidComponent } from '@teambit/component';
2
- import { ComponentID } from '@teambit/component-id';
3
- import { ConsumerComponent, ComponentLoadOptions as LegacyComponentLoadOptions } from '@teambit/legacy.consumer-component';
4
- import { DependencyResolverMain } from '@teambit/dependency-resolver';
5
- import { Logger } from '@teambit/logger';
6
- import { EnvsMain } from '@teambit/envs';
7
- import { AspectLoaderMain } from '@teambit/aspect-loader';
8
- import { Workspace } from '../workspace';
1
+ import type { Component, InvalidComponent } from '@teambit/component';
2
+ import type { ComponentID } from '@teambit/component-id';
3
+ import type { ComponentLoadOptions as LegacyComponentLoadOptions } from '@teambit/legacy.consumer-component';
4
+ import { ConsumerComponent } from '@teambit/legacy.consumer-component';
5
+ import type { DependencyResolverMain } from '@teambit/dependency-resolver';
6
+ import type { Logger } from '@teambit/logger';
7
+ import type { EnvsMain } from '@teambit/envs';
8
+ import type { AspectLoaderMain } from '@teambit/aspect-loader';
9
+ import type { Workspace } from '../workspace';
9
10
  type GetManyRes = {
10
11
  components: Component[];
11
12
  invalidComponents: InvalidComponent[];