@teambit/install 1.0.451 → 1.0.453
Sign up to get free protection for your applications and to get access to all the features.
- package/artifacts/__bit_junit.xml +3 -3
- package/artifacts/schema.json +632 -190
- package/dist/install.main.runtime.d.ts +1 -0
- package/dist/install.main.runtime.js +7 -0
- package/dist/install.main.runtime.js.map +1 -1
- package/package.json +16 -16
- /package/dist/{preview-1730517501720.js → preview-1730863230957.js} +0 -0
@@ -214,6 +214,7 @@ export declare class InstallMain {
|
|
214
214
|
private getComponentsDirectory;
|
215
215
|
private onRootAspectAddedSubscriber;
|
216
216
|
private onAspectsResolveSubscriber;
|
217
|
+
onComponentChange(component: Component): Promise<void>;
|
217
218
|
static slots: (((registerFn: () => string) => SlotRegistry<PreLinkSlot>) | ((registerFn: () => string) => SlotRegistry<PreInstallSlot>))[];
|
218
219
|
static dependencies: import("@teambit/harmony").Aspect[];
|
219
220
|
static runtime: import("@teambit/harmony").RuntimeDefinition;
|
@@ -1226,6 +1226,12 @@ class InstallMain {
|
|
1226
1226
|
await this.link();
|
1227
1227
|
}
|
1228
1228
|
}
|
1229
|
+
async onComponentChange(component) {
|
1230
|
+
const isEnv = this.envs.isEnv(component);
|
1231
|
+
if (isEnv) {
|
1232
|
+
await this.reloadEnvs([component.id]);
|
1233
|
+
}
|
1234
|
+
}
|
1229
1235
|
static async provider([dependencyResolver, workspace, loggerExt, variants, cli, compiler, issues, envs, app, ipcEvents, generator, wsConfigFiles, aspectLoader], _, [preLinkSlot, preInstallSlot, postInstallSlot], harmony) {
|
1230
1236
|
const logger = loggerExt.createLogger(_install().InstallAspect.id);
|
1231
1237
|
ipcEvents.registerGotEventSlot(async eventName => {
|
@@ -1245,6 +1251,7 @@ class InstallMain {
|
|
1245
1251
|
// workspace.registerOnAspectsResolve(installExt.onAspectsResolveSubscriber.bind(installExt));
|
1246
1252
|
if (workspace) {
|
1247
1253
|
workspace.registerOnRootAspectAdded(installExt.onRootAspectAddedSubscriber.bind(installExt));
|
1254
|
+
workspace.registerOnComponentChange(installExt.onComponentChange.bind(installExt));
|
1248
1255
|
}
|
1249
1256
|
cli.register(...commands);
|
1250
1257
|
return installExt;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_pFilter","data","_interopRequireDefault","require","_fsExtra","_interopRequireWildcard","_path","_workspace","_compiler","_cli","_chalk","_workspace2","_lodash","_generator","_pkgModules","_application","_variants","_component","_dependenciesFs","_pMapSeries","_harmony","_workspaceModules","_envs","_ipcEvents","_componentIssues","_dependencyResolver","_workspaceConfigFiles","_logger","_issues","_componentPackageVersion","_aspectLoader","_objectHash","_exceptions","_install","_pickOutdatedPkgs","_link","_install2","_uninstall","_update","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ownKeys","keys","getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","_toPropertyKey","value","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","InstallMain","constructor","dependencyResolver","logger","workspace","variants","compiler","envs","wsConfigFiles","aspectLoader","app","generator","preLinkSlot","preInstallSlot","postInstallSlot","ipcEvents","harmony","Set","install","packages","options","inInstallContext","_addPackages","addMissingPeers","compDirMap","getComponentsDirectory","mergedRootPolicy","getWorkspacePolicy","depsFilterFn","generateFilterFnForDepsFromLocalRemote","pmInstallOptions","dedupe","copyPeerToRuntimeOnRoot","copyPeerToRuntimeOnComponents","dependencyFilterFn","overrides","config","hoistPatterns","packageImportMethod","missingPeers","getMissingPeerDependencies","path","missingPeerPackages","entries","map","peerName","range","console","pMapSeries","values","fn","res","_installModules","publishIpcEvent","registerPreLink","register","registerPreInstall","registerPostInstall","onComponentCreate","generateResults","installOptions","runInstall","installMissing","ids","generateResult","dependencies","concat","installMissingDependencies","isApp","isEnv","id","nonLoadedEnvs","clearComponentCache","component","envId","calculateEnvId","toString","isLoaded","isEnvRegistered","addMissingDeps","skipIfExisting","writeConfigFiles","lifecycleType","DependencyTypeNotSupportedInPolicy","debug","join","resolver","getVersionResolver","resolvedPackagesP","packageName","resolveRemoteVersion","rootDir","resolvedPackages","Promise","all","newWorkspacePolicyEntries","resolvedPackage","version","versionWithPrefix","getVersionWithSavePrefix","overridePrefix","savePrefix","wantedRange","dependencyId","addToRootPolicy","updateExisting","persistConfig","pm","getPackageManager","name","chalk","cyan","getPackageManagerName","hasRootComponents","installer","getInstaller","calcManifestsOpts","nodeLinker","linkOpts","linkTeambitBit","linkCoreAspects","linkDepsResolvedFromEnv","linkNestedDepsInNM","isLegacy","linkedRootDeps","calculateLinks","componentsAndManifests","current","_getComponentsManifestsAndRootPolicy","autoInstallPeers","includeOptionalDeps","neverBuiltDependencies","hoistInjectedDependencies","rootComponents","updateAll","optimizeReportForNonTerminal","lockfileOnly","prevManifests","linkedDependencies","installCycle","hasMissingLocalComponents","forceTeambitHarmonyLink","hasHarmonyInRootPolicy","hasComponentsFromWorkspaceInMissingDeps","dependenciesChanged","installComponents","manifests","componentDirectoryMap","installTeambitBit","cacheCleared","linkCodemods","oldNonLoadedEnvs","setOldNonLoadedEnvs","reloadMovedEnvs","reloadNonLoadedEnvs","shouldClearCacheOnInstall","compile","compileStartTime","process","hrtime","compileOutputMessage","setStatusLine","clearCache","compileOnWorkspace","initiator","CompilationInitiator","Install","consoleSuccess","tryWriteConfigFiles","recurringInstall","add","manifestsHash","skipClearFailedToLoadEnvs","_getComponentsManifests","skipPrune","pruneModules","getFailedToLoadEnvs","allEnvs","getAllRegisteredEnvs","movedEnvs","pFilter","env","__path","regularPathExists","pathExists","resolvedPathExists","__resolvedPath","idsToLoad","componentIdsToLoad","ComponentID","fromString","reloadEnvs","aspects","resolveAspects","undefined","requestedOnly","excludeCore","throwOnError","aspectDef","reloadAspects","groups","groupAspectsToLoad","group","reloadOneAspectsGroup","envOfAspect","loadedPlugins","compact","localPath","aspectPath","plugins","getPlugins","load","MainRuntime","plugin","runtime","getRuntime","provider","groupBy","hasId","workspaceSubGroups","regroupEnvsIdsFromTheList","comps","noComp","scope","otherAspects","envsOfAspects","idWithoutVersion","toStringWithoutVersion","addConfiguredAspectsToWorkspacePolicy","addConfiguredGeneratorEnvsToWorkspacePolicy","rootDeps","devDependencies","omit","manifest","addedNewPkgs","_addMissingPackagesToRootPolicy","mergedRootPolicyWithMissingDeps","shouldWrite","isWorkspaceConfigWriteEnabled","err","clean","silent","throw","consoleFailure","message","rootPolicy","aspectsPackages","getConfiguredUserAspectsPackages","externalsOnly","aspectsPackage","configuredEnvs","getConfiguredEnvs","resolvedEnvs","envIdStr","isCoreEnv","parsedId","resolveComponentId","inWs","importAndGetMany","idWithVersion","resolveEnvIdWithPotentialVersionForConfig","split","getPackageName","_getMissingPackagesWithoutRootDeps","_getAllMissingPackages","pkg","list","uniq","comp","state","issues","getIssue","IssuesClasses","MissingPackagesDependenciesOnFs","d","missingPackages","flat","dependencyInstaller","getComponentManifests","referenceLocalPackages","rootManifests","_getRootManifests","_updateRootDirs","envsWithoutManifest","Array","from","intersection","getOldNonLoadedEnvs","rootDirs","existingDirs","fs","readdir","rootComponentsPath","dirName","dirPath","includes","remove","code","mkdir","recursive","nonRootManifests","workspaceDeps","getWorkspaceDepsOfBitRoots","workspaceDepsMeta","reduce","acc","depName","injected","envManifests","_getEnvManifests","appManifests","_getAppManifests","_getAllUsedEnvIds","fromEntries","getRootComponentDirByRootId","_getEnvDependencies","_getEnvPackage","dependenciesMeta","installConfig","hoistingLimits","policy","getEnvPolicyFromEnvId","selfPolicy","force","envComponent","getEnvComponentByEnvId","finalVersion","snapToSemver","listAppsComponents","appPkgName","appManifest","find","Map","components","updateDependencies","componentPolicies","_getComponentsWithDependencyPolicies","variantPatterns","raw","variantPoliciesByPatterns","_variantPatternsToDepPolicesDict","outdatedPkgs","getOutdatedPkgsFromPolicies","patterns","forceVersionBump","outdatedPkgsToUpdate","off","pickOutdatedPkgs","on","updatedVariants","updatedComponents","applyUpdates","_updateVariantsPolicies","_updateComponentsConfig","_reloadConsumer","addDuplicateComponentAndPackageIssue","workspacePolicy","_consumer","removed","pkgName","componentIdToPackageName","found","getOrCreate","DuplicateComponentAndPackage","allComponentIds","listIds","componentId","componentConfigFile","index","depResolverConfig","DependencyResolverAspect","variantPattern","extensions","addSpecificComponentConfig","shouldMergeWithExisting","shouldMergeWithPrevious","bitMap","write","updateVariantPolicies","setExtension","overrideExisting","uninstallDependencies","removeFromRootPolicy","linker","getLinker","linkingOptions","linkResults","calculateLinkedDeps","workspaceRes","legacyResults","legacyLinkResults","linksResults","legacyLinkCodemodResults","codemodResults","linkToBitRoots","_linkAllComponentsToBitRoots","bitIds","toArray","linkToNodeModulesWithCodemod","rewire","link","createLinks","linkToDir","avoidHardLink","skipIfSymlinkValid","apps","dir","mkdirp","linkPkgsToRootComponents","workspacePath","rootComponentId","getRootComponentDir","remotes","_legacyRemotes","reg","getRegistries","packageScopes","scopes","dependencyList","filtered","dep","ComponentDependency","isHub","some","startsWith","getMany","loadSeedersAsAspects","ComponentMap","as","componentDir","onRootAspectAddedSubscriber","_aspectId","onAspectsResolveSubscriber","aspectComponents","needLink","needInstall","promises","aspectComponent","aspectIdStr","visitedAspects","packagePath","getComponentPackagePath","exists","loggerExt","cli","_","createLogger","InstallAspect","registerGotEventSlot","eventName","clearAllComponentsCache","installExt","registerAddComponentsIssues","bind","registerOnComponentCreate","commands","InstallCmd","UninstallCmd","UpdateCmd","LinkCommand","registerOnRootAspectAdded","exports","Slot","withType","WorkspaceAspect","LoggerAspect","VariantsAspect","CLIAspect","CompilerAspect","IssuesAspect","EnvsAspect","ApplicationAspect","IpcEventsAspect","GeneratorAspect","WorkspaceConfigFilesAspect","AspectLoaderAspect","missingDeps","issue","addRuntime","_default","depsByProjectPaths","mapValues","hash"],"sources":["install.main.runtime.ts"],"sourcesContent":["import pFilter from 'p-filter';\nimport fs, { pathExists } from 'fs-extra';\nimport path from 'path';\nimport { getRootComponentDir, linkPkgsToRootComponents } from '@teambit/workspace.root-components';\nimport { CompilerMain, CompilerAspect, CompilationInitiator } from '@teambit/compiler';\nimport { CLIMain, CommandList, CLIAspect, MainRuntime } from '@teambit/cli';\nimport chalk from 'chalk';\nimport { WorkspaceAspect, Workspace, ComponentConfigFile } from '@teambit/workspace';\nimport { compact, mapValues, omit, uniq, intersection, groupBy } from 'lodash';\nimport { ProjectManifest } from '@pnpm/types';\nimport { GenerateResult, GeneratorAspect, GeneratorMain } from '@teambit/generator';\nimport { componentIdToPackageName } from '@teambit/pkg.modules.component-package-name';\nimport { ApplicationMain, ApplicationAspect } from '@teambit/application';\nimport { VariantsMain, Patterns, VariantsAspect } from '@teambit/variants';\nimport { Component, ComponentID, ComponentMap } from '@teambit/component';\nimport { createLinks } from '@teambit/dependencies.fs.linked-dependencies';\nimport pMapSeries from 'p-map-series';\nimport { Harmony, Slot, SlotRegistry } from '@teambit/harmony';\nimport {\n CodemodResult,\n linkToNodeModulesWithCodemod,\n NodeModulesLinksResult,\n} from '@teambit/workspace.modules.node-modules-linker';\nimport { EnvsMain, EnvsAspect } from '@teambit/envs';\nimport { IpcEventsAspect, IpcEventsMain } from '@teambit/ipc-events';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport {\n GetComponentManifestsOptions,\n WorkspaceDependencyLifecycleType,\n DependencyResolverMain,\n DependencyInstaller,\n DependencyResolverAspect,\n PackageManagerInstallOptions,\n ComponentDependency,\n VariantPolicyConfigObject,\n WorkspacePolicyEntry,\n LinkingOptions,\n LinkResults,\n DependencyList,\n MergedOutdatedPkg,\n WorkspacePolicy,\n UpdatedComponent,\n} from '@teambit/dependency-resolver';\nimport { WorkspaceConfigFilesAspect, WorkspaceConfigFilesMain } from '@teambit/workspace-config-files';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { IssuesAspect, IssuesMain } from '@teambit/issues';\nimport { snapToSemver } from '@teambit/component-package-version';\nimport { AspectDefinition, AspectLoaderAspect, AspectLoaderMain } from '@teambit/aspect-loader';\nimport hash from 'object-hash';\nimport { DependencyTypeNotSupportedInPolicy } from './exceptions';\nimport { InstallAspect } from './install.aspect';\nimport { pickOutdatedPkgs } from './pick-outdated-pkgs';\nimport { LinkCommand } from './link';\nimport InstallCmd from './install.cmd';\nimport UninstallCmd from './uninstall.cmd';\nimport UpdateCmd from './update.cmd';\n\nexport type WorkspaceLinkOptions = LinkingOptions & {\n rootPolicy?: WorkspacePolicy;\n linkToBitRoots?: boolean;\n includePeers?: boolean;\n};\n\nexport type WorkspaceLinkResults = {\n legacyLinkResults?: NodeModulesLinksResult[];\n legacyLinkCodemodResults?: CodemodResult[];\n} & LinkResults;\n\nexport type WorkspaceInstallOptions = {\n addMissingDeps?: boolean;\n addMissingPeers?: boolean;\n lifecycleType?: WorkspaceDependencyLifecycleType;\n dedupe?: boolean;\n import?: boolean;\n copyPeerToRuntimeOnRoot?: boolean;\n copyPeerToRuntimeOnComponents?: boolean;\n updateExisting?: boolean;\n skipIfExisting?: boolean;\n savePrefix?: string;\n compile?: boolean;\n includeOptionalDeps?: boolean;\n updateAll?: boolean;\n recurringInstall?: boolean;\n optimizeReportForNonTerminal?: boolean;\n lockfileOnly?: boolean;\n writeConfigFiles?: boolean;\n skipPrune?: boolean;\n};\n\nexport type ModulesInstallOptions = Omit<WorkspaceInstallOptions, 'updateExisting' | 'lifecycleType' | 'import'>;\n\ntype PreLink = (linkOpts?: WorkspaceLinkOptions) => Promise<void>;\ntype PreInstall = (installOpts?: WorkspaceInstallOptions) => Promise<void>;\ntype PostInstall = () => Promise<void>;\n\ntype PreLinkSlot = SlotRegistry<PreLink>;\ntype PreInstallSlot = SlotRegistry<PreInstall>;\ntype PostInstallSlot = SlotRegistry<PostInstall>;\n\ntype GetComponentsAndManifestsOptions = Omit<\n GetComponentManifestsOptions,\n 'componentDirectoryMap' | 'rootPolicy' | 'rootDir'\n> &\n Pick<PackageManagerInstallOptions, 'nodeLinker'>;\n\ntype ReloadAspectGroup = { comps: boolean; workspace: boolean; envOfAspect?: boolean; aspects: AspectDefinition[] };\nexport class InstallMain {\n private visitedAspects: Set<string> = new Set();\n\n private oldNonLoadedEnvs: string[] = [];\n\n constructor(\n private dependencyResolver: DependencyResolverMain,\n\n private logger: Logger,\n\n private workspace: Workspace,\n\n private variants: VariantsMain,\n\n private compiler: CompilerMain,\n\n private envs: EnvsMain,\n\n private wsConfigFiles: WorkspaceConfigFilesMain,\n\n private aspectLoader: AspectLoaderMain,\n\n private app: ApplicationMain,\n\n private generator: GeneratorMain,\n\n private preLinkSlot: PreLinkSlot,\n\n private preInstallSlot: PreInstallSlot,\n\n private postInstallSlot: PostInstallSlot,\n\n private ipcEvents: IpcEventsMain,\n\n private harmony: Harmony\n ) {}\n /**\n * Install dependencies for all components in the workspace\n *\n * @returns\n * @memberof Workspace\n */\n async install(packages?: string[], options?: WorkspaceInstallOptions): Promise<ComponentMap<string>> {\n // set workspace in install context\n this.workspace.inInstallContext = true;\n if (packages && packages.length) {\n await this._addPackages(packages, options);\n }\n if (options?.addMissingPeers) {\n const compDirMap = await this.getComponentsDirectory([]);\n const mergedRootPolicy = this.dependencyResolver.getWorkspacePolicy();\n const depsFilterFn = await this.generateFilterFnForDepsFromLocalRemote();\n const pmInstallOptions: PackageManagerInstallOptions = {\n dedupe: options?.dedupe,\n copyPeerToRuntimeOnRoot: options?.copyPeerToRuntimeOnRoot ?? true,\n copyPeerToRuntimeOnComponents: options?.copyPeerToRuntimeOnComponents ?? false,\n dependencyFilterFn: depsFilterFn,\n overrides: this.dependencyResolver.config.overrides,\n hoistPatterns: this.dependencyResolver.config.hoistPatterns,\n packageImportMethod: this.dependencyResolver.config.packageImportMethod,\n };\n const missingPeers = await this.dependencyResolver.getMissingPeerDependencies(\n this.workspace.path,\n mergedRootPolicy,\n compDirMap,\n pmInstallOptions\n );\n if (missingPeers) {\n const missingPeerPackages = Object.entries(missingPeers).map(([peerName, range]) => `${peerName}@${range}`);\n await this._addPackages(missingPeerPackages, options);\n } else {\n this.logger.console('No missing peer dependencies found.');\n }\n }\n await pMapSeries(this.preInstallSlot.values(), (fn) => fn(options)); // import objects if not disabled in options\n const res = await this._installModules(options);\n this.workspace.inInstallContext = false;\n\n await this.ipcEvents.publishIpcEvent('onPostInstall');\n\n return res;\n }\n\n registerPreLink(fn: PreLink) {\n this.preLinkSlot.register(fn);\n }\n\n registerPreInstall(fn: PreInstall) {\n this.preInstallSlot.register(fn);\n }\n\n registerPostInstall(fn: PostInstall) {\n this.postInstallSlot.register(fn);\n }\n\n async onComponentCreate(generateResults: GenerateResult[], installOptions?: Partial<WorkspaceInstallOptions>) {\n this.workspace.inInstallContext = true;\n let runInstall = false;\n let packages: string[] = [];\n let installMissing = false;\n\n const ids = generateResults.map((generateResult) => {\n if (generateResult.dependencies && generateResult.dependencies.length) {\n packages = packages.concat(generateResult.dependencies);\n runInstall = true;\n }\n if (generateResult.installMissingDependencies) {\n installMissing = true;\n runInstall = true;\n }\n if (generateResult.isApp || generateResult.isEnv) {\n runInstall = true;\n }\n return generateResult.id;\n });\n const nonLoadedEnvs: string[] = [];\n\n ids.map((id) => this.workspace.clearComponentCache(id));\n await pMapSeries(ids, async (id) => {\n const component = await this.workspace.get(id);\n // const envId = await this.envs.getEnvId(component);\n const envId = (await this.envs.calculateEnvId(component)).toString();\n const isLoaded = this.envs.isEnvRegistered(envId);\n if (!isLoaded) {\n nonLoadedEnvs.push(envId);\n }\n return component;\n });\n if (nonLoadedEnvs.length) {\n runInstall = true;\n }\n if (!runInstall) {\n this.workspace.inInstallContext = false;\n return;\n }\n // this.logger.console(\n // `the following environments are not installed yet: ${nonLoadedEnvs.join(', ')}. installing them now...`\n // );\n await this.install(packages, {\n ...installOptions,\n addMissingDeps: installMissing,\n skipIfExisting: true,\n writeConfigFiles: false,\n // skipPrune: true,\n });\n }\n\n private async _addPackages(packages: string[], options?: WorkspaceInstallOptions) {\n if ((options?.lifecycleType as string) === 'dev') {\n throw new DependencyTypeNotSupportedInPolicy(options?.lifecycleType as string);\n }\n this.logger.debug(`installing the following packages: ${packages.join()}`);\n const resolver = await this.dependencyResolver.getVersionResolver();\n const resolvedPackagesP = packages.map((packageName) =>\n resolver.resolveRemoteVersion(packageName, {\n rootDir: this.workspace.path,\n })\n );\n const resolvedPackages = await Promise.all(resolvedPackagesP);\n const newWorkspacePolicyEntries: WorkspacePolicyEntry[] = [];\n resolvedPackages.forEach((resolvedPackage) => {\n if (resolvedPackage.version) {\n const versionWithPrefix = this.dependencyResolver.getVersionWithSavePrefix({\n version: resolvedPackage.version,\n overridePrefix: options?.savePrefix,\n wantedRange: resolvedPackage.wantedRange,\n });\n newWorkspacePolicyEntries.push({\n dependencyId: resolvedPackage.packageName,\n value: {\n version: versionWithPrefix,\n },\n lifecycleType: options?.lifecycleType || 'runtime',\n });\n }\n });\n this.dependencyResolver.addToRootPolicy(newWorkspacePolicyEntries, {\n updateExisting: options?.updateExisting ?? false,\n skipIfExisting: options?.skipIfExisting ?? false,\n });\n await this.dependencyResolver.persistConfig('install');\n }\n\n private async _installModules(options?: ModulesInstallOptions): Promise<ComponentMap<string>> {\n const pm = this.dependencyResolver.getPackageManager();\n this.logger.console(\n `installing dependencies in workspace using ${pm?.name} (${chalk.cyan(\n this.dependencyResolver.getPackageManagerName()\n )})`\n );\n this.logger.debug(`installing dependencies in workspace with options`, options);\n const depsFilterFn = await this.generateFilterFnForDepsFromLocalRemote();\n const hasRootComponents = this.dependencyResolver.hasRootComponents();\n // TODO: pass get install options\n const installer = this.dependencyResolver.getInstaller({});\n const calcManifestsOpts: GetComponentsAndManifestsOptions = {\n copyPeerToRuntimeOnComponents: options?.copyPeerToRuntimeOnComponents ?? false,\n copyPeerToRuntimeOnRoot: options?.copyPeerToRuntimeOnRoot ?? true,\n dedupe: !hasRootComponents && options?.dedupe,\n dependencyFilterFn: depsFilterFn,\n nodeLinker: this.dependencyResolver.nodeLinker(),\n };\n const linkOpts = {\n linkTeambitBit: true,\n linkCoreAspects: this.dependencyResolver.linkCoreAspects(),\n linkDepsResolvedFromEnv: !hasRootComponents,\n linkNestedDepsInNM: !this.workspace.isLegacy && !hasRootComponents,\n };\n const { linkedRootDeps } = await this.calculateLinks(linkOpts);\n // eslint-disable-next-line prefer-const\n let { mergedRootPolicy, componentsAndManifests: current } = await this._getComponentsManifestsAndRootPolicy(\n installer,\n {\n ...calcManifestsOpts,\n addMissingDeps: options?.addMissingDeps,\n linkedRootDeps,\n }\n );\n\n const pmInstallOptions: PackageManagerInstallOptions = {\n ...calcManifestsOpts,\n autoInstallPeers: this.dependencyResolver.config.autoInstallPeers,\n includeOptionalDeps: options?.includeOptionalDeps,\n neverBuiltDependencies: this.dependencyResolver.config.neverBuiltDependencies,\n overrides: this.dependencyResolver.config.overrides,\n hoistPatterns: this.dependencyResolver.config.hoistPatterns,\n hoistInjectedDependencies: this.dependencyResolver.config.hoistInjectedDependencies,\n packageImportMethod: this.dependencyResolver.config.packageImportMethod,\n rootComponents: hasRootComponents,\n updateAll: options?.updateAll,\n optimizeReportForNonTerminal: options?.optimizeReportForNonTerminal,\n lockfileOnly: options?.lockfileOnly,\n };\n const prevManifests = new Set<string>();\n // TODO: this make duplicate\n // this.logger.consoleSuccess();\n const linkedDependencies = {\n [this.workspace.path]: linkedRootDeps,\n };\n const compDirMap = await this.getComponentsDirectory([]);\n let installCycle = 0;\n let hasMissingLocalComponents = true;\n const forceTeambitHarmonyLink = !this.dependencyResolver.hasHarmonyInRootPolicy();\n /* eslint-disable no-await-in-loop */\n do {\n // In case there are missing local components,\n // we'll need to make another round of installation as on the first round the missing local components\n // are not added to the manifests.\n // This is an issue when installation is done using root components.\n hasMissingLocalComponents = hasRootComponents && hasComponentsFromWorkspaceInMissingDeps(current);\n const { dependenciesChanged } = await installer.installComponents(\n this.workspace.path,\n current.manifests,\n mergedRootPolicy,\n current.componentDirectoryMap,\n {\n linkedDependencies,\n installTeambitBit: false,\n forceTeambitHarmonyLink,\n },\n pmInstallOptions\n );\n let cacheCleared = false;\n await this.linkCodemods(compDirMap);\n const oldNonLoadedEnvs = this.setOldNonLoadedEnvs();\n await this.reloadMovedEnvs();\n await this.reloadNonLoadedEnvs();\n\n const shouldClearCacheOnInstall = this.shouldClearCacheOnInstall();\n if (options?.compile ?? true) {\n const compileStartTime = process.hrtime();\n const compileOutputMessage = `compiling components`;\n this.logger.setStatusLine(compileOutputMessage);\n if (shouldClearCacheOnInstall) {\n // We need to clear cache before compiling the components or it might compile them with the default env\n // incorrectly in case the env was not loaded correctly before the installation.\n // We don't want to clear the failed to load envs because we want to show the warning at the end\n // await this.workspace.clearCache({ skipClearFailedToLoadEnvs: true });\n await this.workspace.clearCache();\n cacheCleared = true;\n }\n await this.compiler.compileOnWorkspace([], { initiator: CompilationInitiator.Install });\n\n // Right now we don't need to load extensions/execute load slot at this point\n // await this.compiler.compileOnWorkspace([], { initiator: CompilationInitiator.Install }, undefined, {\n // executeLoadSlot: true,\n // loadExtensions: true,\n // });\n this.logger.consoleSuccess(compileOutputMessage, compileStartTime);\n }\n if (options?.writeConfigFiles ?? true) {\n await this.tryWriteConfigFiles(!cacheCleared && shouldClearCacheOnInstall);\n }\n if (!dependenciesChanged) break;\n if (!options?.recurringInstall) break;\n\n if (!oldNonLoadedEnvs.length) break;\n prevManifests.add(manifestsHash(current.manifests));\n // If we run compile we do the clear cache before the compilation so no need to clean it again (it's an expensive\n // operation)\n if (!cacheCleared && shouldClearCacheOnInstall) {\n // We need to clear cache before creating the new component manifests.\n // this.workspace.consumer.componentLoader.clearComponentsCache();\n // We don't want to clear the failed to load envs because we want to show the warning at the end\n await this.workspace.clearCache({ skipClearFailedToLoadEnvs: true });\n }\n current = await this._getComponentsManifests(installer, mergedRootPolicy, calcManifestsOpts);\n installCycle += 1;\n } while ((!prevManifests.has(manifestsHash(current.manifests)) || hasMissingLocalComponents) && installCycle < 5);\n if (!options?.lockfileOnly && !options?.skipPrune) {\n // We clean node_modules only after the last install.\n // Otherwise, we might load an env from a location that we later remove.\n await installer.pruneModules(this.workspace.path);\n }\n // this is now commented out because we assume we don't need it anymore.\n // even when the env was not loaded before and it is loaded now, it should be fine because the dependencies-data\n // is only about the auto-detect-deps. there are two more steps: version-resolution and apply-overrides that\n // disregard the dependencies-cache.\n // await this.workspace.consumer.componentFsCache.deleteAllDependenciesDataCache();\n /* eslint-enable no-await-in-loop */\n return current.componentDirectoryMap;\n }\n\n private shouldClearCacheOnInstall(): boolean {\n const nonLoadedEnvs = this.envs.getFailedToLoadEnvs();\n return nonLoadedEnvs.length > 0;\n }\n\n /**\n * This function is very important to fix some issues that might happen during the installation process.\n * The case is the following:\n * during/before the installation process we load some envs from their bit.env files\n * this contains code like:\n * protected tsconfigPath = require.resolve('./config/tsconfig.json');\n * protected eslintConfigPath = require.resolve('./config/eslintrc.cjs');\n * When we load that file, we calculated the resolved path, and it's stored in the env\n * object instance.\n * then later on during the install we move the env to another location (like bit roots)\n * which points to a .pnpm folder with some peers, that changed during the install\n * then when we take this env object and call write ws config for example\n * or compile\n * we use that resolved path to calculate the final tsconfig\n * however that file is no longer exists which result in an error\n * This function will check if an env folder doesn't exist anymore, and will re-load it\n * from its new location.\n * This usually happen when we have install running in the middle of the process followed\n * by other bit ops.\n * examples:\n * bit new - which might run few installs then other ops.\n * bit switch - which might run few installs then other ops, and potentially change the\n * peer deps during the install.\n * bit server (vscode plugin) - which keep the process always live, so any install ops\n * that change the location, will cause the vscode plugin/bit server to crash later.\n * @returns\n */\n private async reloadMovedEnvs() {\n const allEnvs = this.envs.getAllRegisteredEnvs();\n const movedEnvs = await pFilter(allEnvs, async (env) => {\n if (!env.__path) return false;\n const regularPathExists = await pathExists(env.__path);\n const resolvedPathExists = await pathExists(env.__resolvedPath);\n return !regularPathExists || !resolvedPathExists;\n });\n const idsToLoad = movedEnvs.map((env) => env.id);\n const componentIdsToLoad = idsToLoad.map((id) => ComponentID.fromString(id));\n await this.reloadEnvs(componentIdsToLoad);\n }\n\n private async reloadNonLoadedEnvs() {\n const nonLoadedEnvs = this.envs.getFailedToLoadEnvs();\n const componentIdsToLoad = nonLoadedEnvs.map((id) => ComponentID.fromString(id));\n await this.reloadEnvs(componentIdsToLoad);\n }\n\n private async reloadEnvs(componentIdsToLoad: ComponentID[]) {\n if (componentIdsToLoad.length && this.workspace) {\n const aspects = await this.workspace.resolveAspects(undefined, componentIdsToLoad, {\n requestedOnly: true,\n excludeCore: true,\n throwOnError: false,\n // Theoretically we should use skipDeps here, but according to implementation at the moment\n // it will lead to plugins not load, and we need them to be loaded.\n // This is a bug in the flow and should be fixed.\n // skipDeps: true,\n });\n\n await Promise.all(\n aspects.map(async (aspectDef) => {\n const id = aspectDef.component?.id;\n if (!id) return;\n await this.workspace.clearComponentCache(id);\n })\n );\n await this.reloadAspects(aspects || []);\n\n // Keeping this here for now, it was removed as part of #9138 as now that we load envs of envs\n // correctly first it seems to be not needed anymore.\n // But there might be cases where it will be needed. So keeping it here for now.\n\n // This is a very special case which we need to compile our envs before loading them correctly.\n // const grouped = groupBy(aspects, (aspectDef) => {\n // return aspectDef.component?.id.toStringWithoutVersion() === 'bitdev.general/envs/bit-env';\n // });\n // await this.reloadAspects(grouped.true || []);\n // const otherEnvs = grouped.false || [];\n // await Promise.all(\n // otherEnvs.map(async (aspectDef) => {\n // const id = aspectDef.component?.id;\n // if (!id) return;\n // await this.workspace.clearComponentCache(id);\n // })\n // );\n // await this.reloadAspects(grouped.false || []);\n }\n }\n\n private async reloadAspects(aspects: AspectDefinition[]) {\n const groups = await this.groupAspectsToLoad(aspects);\n // We need to make sure we load group by group and not in parallel\n await pMapSeries(groups, async (group) => {\n await this.reloadOneAspectsGroup(group);\n });\n }\n\n private async reloadOneAspectsGroup(group: ReloadAspectGroup) {\n const aspects = group.aspects || [];\n if (group.workspace && !group.envOfAspect) {\n aspects.forEach((aspectDef) => {\n if (aspectDef.component?.id) {\n this.workspace.clearComponentCache(aspectDef.component.id);\n }\n });\n }\n const loadedPlugins = compact(\n await Promise.all(\n aspects.map((aspectDef) => {\n const localPath = aspectDef.aspectPath;\n const component = aspectDef.component;\n if (!component) return undefined;\n const plugins = this.aspectLoader.getPlugins(component, localPath);\n if (plugins.has()) {\n return plugins.load(MainRuntime.name);\n }\n })\n )\n );\n await Promise.all(\n loadedPlugins.map((plugin) => {\n const runtime = plugin.getRuntime(MainRuntime);\n return runtime?.provider(undefined, undefined, undefined, this.harmony);\n })\n );\n }\n\n /**\n * This function groups the components to aspects to load into groups.\n * The order of the groups is important, the first group should be loaded first.\n * The order inside the group is not important.\n * The groups are:\n * 1. aspects definitions without components (this should be an empty group, if it's not, we should check why).\n * 2. aspects which are not in the workspace but in the scope / node modules.\n * 3. envs of aspects (which are also aspects)\n * 4. other aspects (the rest)\n * @param aspects\n * @returns\n */\n private async groupAspectsToLoad(aspects: AspectDefinition[]): Promise<Array<ReloadAspectGroup>> {\n const groups = groupBy(aspects, (aspectDef) => {\n if (!aspectDef.component) return 'no-comp';\n if (!this.workspace.hasId(aspectDef.component.id)) return 'scope';\n return 'workspace';\n });\n const workspaceSubGroups = await this.regroupEnvsIdsFromTheList(groups.workspace || []);\n return [\n { comps: false, workspace: false, aspects: groups.noComp || [] },\n { comps: true, workspace: false, aspects: groups.scope || [] },\n { comps: true, workspace: true, envOfAspect: true, aspects: workspaceSubGroups.envOfAspect },\n { comps: true, workspace: true, aspects: workspaceSubGroups.otherAspects },\n ];\n }\n\n private async regroupEnvsIdsFromTheList(aspects: AspectDefinition[]): Promise<Record<string, AspectDefinition[]>> {\n const envsOfAspects = new Set<string>();\n await Promise.all(\n aspects.map(async (aspectDef) => {\n if (!aspectDef.component) return;\n const envId = aspectDef.component ? await this.envs.calculateEnvId(aspectDef.component) : undefined;\n if (envId) {\n envsOfAspects.add(envId.toString());\n }\n })\n );\n const groups = groupBy(aspects, (aspectDef) => {\n const id = aspectDef.component?.id.toString();\n const idWithoutVersion = aspectDef.component?.id.toStringWithoutVersion();\n if ((id && envsOfAspects.has(id)) || (idWithoutVersion && envsOfAspects.has(idWithoutVersion))) {\n return 'envOfAspect';\n }\n return 'otherAspects';\n });\n\n return groups;\n }\n\n private async _getComponentsManifestsAndRootPolicy(\n installer: DependencyInstaller,\n options: GetComponentsAndManifestsOptions & {\n addMissingDeps?: boolean;\n linkedRootDeps: Record<string, string>;\n }\n ): Promise<{ componentsAndManifests: ComponentsAndManifests; mergedRootPolicy: WorkspacePolicy }> {\n const mergedRootPolicy = await this.addConfiguredAspectsToWorkspacePolicy();\n await this.addConfiguredGeneratorEnvsToWorkspacePolicy(mergedRootPolicy);\n const componentsAndManifests = await this._getComponentsManifests(installer, mergedRootPolicy, options);\n if (!options?.addMissingDeps) {\n return { componentsAndManifests, mergedRootPolicy };\n }\n const rootDeps = new Set(\n Object.keys({\n ...componentsAndManifests.manifests[this.workspace.path].devDependencies,\n ...componentsAndManifests.manifests[this.workspace.path].dependencies,\n ...options.linkedRootDeps,\n })\n );\n Object.values(omit(componentsAndManifests.manifests, [this.workspace.path])).forEach((manifest) => {\n if ((manifest as ProjectManifest).name) {\n rootDeps.add((manifest as ProjectManifest).name!); // eslint-disable-line @typescript-eslint/no-non-null-assertion\n }\n });\n const addedNewPkgs = await this._addMissingPackagesToRootPolicy(rootDeps);\n if (!addedNewPkgs) {\n return { componentsAndManifests, mergedRootPolicy };\n }\n const mergedRootPolicyWithMissingDeps = await this.addConfiguredAspectsToWorkspacePolicy();\n await this.addConfiguredGeneratorEnvsToWorkspacePolicy(mergedRootPolicyWithMissingDeps);\n return {\n mergedRootPolicy: mergedRootPolicyWithMissingDeps,\n componentsAndManifests: await this._getComponentsManifests(installer, mergedRootPolicyWithMissingDeps, options),\n };\n }\n\n /**\n * The function `tryWriteConfigFiles` attempts to write workspace config files, and if it fails, it logs an error\n * message.\n * @returns If the condition `!shouldWrite` is true, then nothing is being returned. Otherwise, if the `writeConfigFiles`\n * function is successfully executed, nothing is being returned. If an error occurs during the execution of\n * `writeConfigFiles`, an error message is being returned.\n */\n private async tryWriteConfigFiles(clearCache: boolean) {\n const shouldWrite = this.wsConfigFiles.isWorkspaceConfigWriteEnabled();\n if (!shouldWrite) return;\n if (clearCache) {\n await this.workspace.clearCache({ skipClearFailedToLoadEnvs: true });\n }\n const { err } = await this.wsConfigFiles.writeConfigFiles({\n clean: true,\n silent: true,\n dedupe: true,\n throw: false,\n });\n\n if (err) {\n this.logger.consoleFailure(\n `failed generating workspace config files, please run \"bit ws-config write\" manually. error: ${err.message}`\n );\n }\n }\n\n private async addConfiguredAspectsToWorkspacePolicy(): Promise<WorkspacePolicy> {\n const rootPolicy = this.dependencyResolver.getWorkspacePolicy();\n const aspectsPackages = await this.workspace.getConfiguredUserAspectsPackages({ externalsOnly: true });\n aspectsPackages.forEach((aspectsPackage) => {\n rootPolicy.add(\n {\n dependencyId: aspectsPackage.packageName,\n value: {\n version: aspectsPackage.version,\n },\n lifecycleType: 'runtime',\n },\n // If it's already exist from the root, take the version from the root policy\n { skipIfExisting: true }\n );\n });\n return rootPolicy;\n }\n\n private async addConfiguredGeneratorEnvsToWorkspacePolicy(rootPolicy: WorkspacePolicy): Promise<void> {\n const configuredEnvs = this.generator.getConfiguredEnvs();\n const resolvedEnvs = compact(\n await Promise.all(\n configuredEnvs.map(async (envIdStr) => {\n if (this.envs.isCoreEnv(envIdStr)) {\n return undefined;\n }\n const parsedId = await this.workspace.resolveComponentId(envIdStr);\n // If we have the env in the workspace, we don't want to install it\n const inWs = await this.workspace.hasId(parsedId);\n if (inWs) {\n return undefined;\n }\n const comps = await this.workspace.importAndGetMany(\n [parsedId],\n `to get the env ${parsedId.toString()} for installation`\n );\n const idWithVersion = await this.workspace.resolveEnvIdWithPotentialVersionForConfig(parsedId);\n const version = idWithVersion.split('@')[1] || '*';\n const packageName = this.dependencyResolver.getPackageName(comps[0]);\n return {\n packageName,\n version,\n };\n })\n )\n );\n\n resolvedEnvs.forEach((env) => {\n rootPolicy.add(\n {\n dependencyId: env.packageName,\n value: {\n version: env.version,\n },\n lifecycleType: 'runtime',\n },\n // If it's already exist from the root, take the version from the root policy\n { skipIfExisting: true }\n );\n });\n }\n\n private async _addMissingPackagesToRootPolicy(\n rootDeps: Set<string>,\n options?: WorkspaceInstallOptions\n ): Promise<boolean> {\n const packages = await this._getMissingPackagesWithoutRootDeps(rootDeps);\n if (packages && packages.length) {\n await this._addPackages(packages, options);\n }\n return packages.length > 0;\n }\n\n private async _getMissingPackagesWithoutRootDeps(rootDeps: Set<string>) {\n const packages = await this._getAllMissingPackages();\n return packages.filter((pkg) => !rootDeps.has(pkg));\n }\n\n private async _getAllMissingPackages(): Promise<string[]> {\n const comps = await this.workspace.list();\n return uniq(\n comps\n .map((comp) => {\n const data = comp.state.issues.getIssue(IssuesClasses.MissingPackagesDependenciesOnFs)?.data || [];\n return data.map((d) => d.missingPackages).flat();\n })\n .flat()\n );\n }\n\n private async _getComponentsManifests(\n dependencyInstaller: DependencyInstaller,\n rootPolicy: WorkspacePolicy,\n installOptions: GetComponentsAndManifestsOptions\n ): Promise<ComponentsAndManifests> {\n const componentDirectoryMap = await this.getComponentsDirectory([]);\n let manifests = await dependencyInstaller.getComponentManifests({\n ...installOptions,\n componentDirectoryMap,\n rootPolicy,\n rootDir: this.workspace.path,\n referenceLocalPackages: this.dependencyResolver.hasRootComponents() && installOptions.nodeLinker === 'isolated',\n });\n\n if (this.dependencyResolver.hasRootComponents()) {\n const rootManifests = await this._getRootManifests(manifests);\n await this._updateRootDirs(Object.keys(rootManifests));\n manifests = {\n ...manifests,\n ...rootManifests,\n };\n }\n return {\n componentDirectoryMap,\n manifests,\n };\n }\n\n public setOldNonLoadedEnvs() {\n const nonLoadedEnvs = this.envs.getFailedToLoadEnvs();\n const envsWithoutManifest = Array.from(this.dependencyResolver.envsWithoutManifest);\n const oldNonLoadedEnvs = intersection(nonLoadedEnvs, envsWithoutManifest);\n this.oldNonLoadedEnvs = oldNonLoadedEnvs;\n return oldNonLoadedEnvs;\n }\n\n /**\n * This function returns a list of old non-loaded environments names.\n * @returns an array of strings called `oldNonLoadedEnvs`. This array contains the names of environment variables that\n * failed to load as extensions and are also don't have an env.jsonc file.\n * If this list is not empty, then the user might need to run another install to make sure all dependencies resolved\n * correctly\n */\n public getOldNonLoadedEnvs() {\n return this.oldNonLoadedEnvs;\n }\n\n private async _updateRootDirs(rootDirs: string[]) {\n try {\n const existingDirs = await fs.readdir(this.workspace.rootComponentsPath);\n await Promise.all(\n existingDirs.map(async (dirName) => {\n const dirPath = path.join(this.workspace.rootComponentsPath, dirName);\n if (!rootDirs.includes(dirPath)) {\n await fs.remove(dirPath);\n }\n })\n );\n } catch (err: any) {\n if (err.code !== 'ENOENT') throw err;\n }\n await Promise.all(rootDirs.map((dirPath) => fs.mkdir(dirPath, { recursive: true })));\n }\n\n private async _getRootManifests(\n manifests: Record<string, ProjectManifest>\n ): Promise<Record<string, ProjectManifest>> {\n const nonRootManifests = Object.values(manifests).filter(({ name }) => name !== 'workspace');\n const workspaceDeps = this.dependencyResolver.getWorkspaceDepsOfBitRoots(nonRootManifests);\n const workspaceDepsMeta = Object.keys(workspaceDeps).reduce((acc, depName) => {\n acc[depName] = { injected: true };\n return acc;\n }, {});\n const envManifests = await this._getEnvManifests(workspaceDeps, workspaceDepsMeta);\n const appManifests = await this._getAppManifests(manifests, workspaceDeps, workspaceDepsMeta);\n return {\n ...envManifests,\n ...appManifests,\n };\n }\n\n private async _getEnvManifests(\n workspaceDeps: Record<string, string>,\n workspaceDepsMeta: Record<string, { injected: true }>\n ): Promise<Record<string, ProjectManifest>> {\n const envs = await this._getAllUsedEnvIds();\n return Object.fromEntries(\n await Promise.all(\n envs.map(async (envId) => {\n return [\n await this.getRootComponentDirByRootId(this.workspace.rootComponentsPath, envId),\n {\n dependencies: {\n ...(await this._getEnvDependencies(envId)),\n ...workspaceDeps,\n ...(await this._getEnvPackage(envId)),\n },\n dependenciesMeta: workspaceDepsMeta,\n installConfig: {\n hoistingLimits: 'workspaces',\n },\n },\n ];\n })\n )\n );\n }\n\n private async _getEnvDependencies(envId: ComponentID): Promise<Record<string, string>> {\n const policy = await this.dependencyResolver.getEnvPolicyFromEnvId(envId);\n if (!policy) return {};\n return Object.fromEntries(\n policy.selfPolicy.entries\n .filter(({ force, value }) => force && value.version !== '-')\n .map(({ dependencyId, value }) => [dependencyId, value.version])\n );\n }\n\n /**\n * Return the package name of the env with its version.\n * (only if the env is not a core env and is not in the workspace)\n * @param envId\n * @returns\n */\n private async _getEnvPackage(envId: ComponentID): Promise<Record<string, string> | undefined> {\n if (this.envs.isCoreEnv(envId.toStringWithoutVersion())) return undefined;\n const inWs = await this.workspace.hasId(envId);\n if (inWs) return undefined;\n const envComponent = await this.envs.getEnvComponentByEnvId(envId.toString(), envId.toString());\n if (!envComponent) return undefined;\n const packageName = this.dependencyResolver.getPackageName(envComponent);\n const version = envId.version;\n const finalVersion = snapToSemver(version as string);\n return { [packageName]: finalVersion };\n }\n\n private async _getAppManifests(\n manifests: Record<string, ProjectManifest>,\n workspaceDeps: Record<string, string>,\n workspaceDepsMeta: Record<string, { injected: true }>\n ): Promise<Record<string, ProjectManifest>> {\n return Object.fromEntries(\n compact(\n await Promise.all(\n (await this.app.listAppsComponents()).map(async (app) => {\n const appPkgName = this.dependencyResolver.getPackageName(app);\n const appManifest = Object.values(manifests).find(({ name }) => name === appPkgName);\n if (!appManifest) return null;\n const envId = await this.envs.calculateEnvId(app);\n return [\n await this.getRootComponentDirByRootId(this.workspace.rootComponentsPath, app.id),\n {\n ...omit(appManifest, ['name', 'version']),\n dependencies: {\n ...(await this._getEnvDependencies(envId)),\n ...appManifest.dependencies,\n ...workspaceDeps,\n },\n dependenciesMeta: {\n ...appManifest.dependenciesMeta,\n ...workspaceDepsMeta,\n },\n installConfig: {\n hoistingLimits: 'workspaces',\n },\n },\n ];\n })\n )\n )\n );\n }\n\n private async _getAllUsedEnvIds(): Promise<ComponentID[]> {\n const envs = new Map<string, ComponentID>();\n const components = await this.workspace.list();\n await pMapSeries(components, async (component) => {\n const envId = await this.envs.calculateEnvId(component);\n envs.set(envId.toString(), envId);\n });\n return Array.from(envs.values());\n }\n\n /**\n * Updates out-of-date dependencies in the workspace.\n *\n * @param options.all {Boolean} updates all outdated dependencies without showing a prompt.\n */\n async updateDependencies(options: {\n forceVersionBump?: 'major' | 'minor' | 'patch' | 'compatible';\n patterns?: string[];\n all: boolean;\n }): Promise<ComponentMap<string> | null> {\n const componentPolicies = await this._getComponentsWithDependencyPolicies();\n const variantPatterns = this.variants.raw();\n const variantPoliciesByPatterns = this._variantPatternsToDepPolicesDict(variantPatterns);\n const components = await this.workspace.list();\n const outdatedPkgs = await this.dependencyResolver.getOutdatedPkgsFromPolicies({\n rootDir: this.workspace.path,\n variantPoliciesByPatterns,\n componentPolicies,\n components,\n patterns: options.patterns,\n forceVersionBump: options.forceVersionBump,\n });\n if (outdatedPkgs == null) {\n this.logger.consoleFailure('No dependencies found that match the patterns');\n return null;\n }\n let outdatedPkgsToUpdate!: MergedOutdatedPkg[];\n if (options.all) {\n outdatedPkgsToUpdate = outdatedPkgs;\n } else {\n this.logger.off();\n outdatedPkgsToUpdate = await pickOutdatedPkgs(outdatedPkgs);\n this.logger.on();\n }\n if (outdatedPkgsToUpdate.length === 0) {\n this.logger.consoleSuccess('No outdated dependencies found');\n if (options.forceVersionBump === 'compatible') {\n this.logger.console(\n \"If you want to find new versions that don't match the current version ranges, retry with the --latest flag\"\n );\n }\n return null;\n }\n const { updatedVariants, updatedComponents } = this.dependencyResolver.applyUpdates(outdatedPkgsToUpdate, {\n variantPoliciesByPatterns,\n });\n await this._updateVariantsPolicies(variantPatterns, updatedVariants);\n await this._updateComponentsConfig(updatedComponents);\n await this.workspace._reloadConsumer();\n return this._installModules({ dedupe: true });\n }\n\n async addDuplicateComponentAndPackageIssue(components: Component[]) {\n const workspacePolicy = this.dependencyResolver.getWorkspacePolicy();\n components.forEach((component) => {\n if (component.state._consumer.removed) return;\n const pkgName = componentIdToPackageName(component.state._consumer);\n const found = workspacePolicy.find(pkgName);\n if (found) {\n component.state.issues.getOrCreate(IssuesClasses.DuplicateComponentAndPackage).data = found.dependencyId;\n }\n });\n }\n\n private async _getComponentsWithDependencyPolicies() {\n const allComponentIds = this.workspace.listIds();\n const componentPolicies = [] as Array<{ componentId: ComponentID; policy: any }>;\n (\n await Promise.all<ComponentConfigFile | undefined>(\n allComponentIds.map((componentId) => this.workspace.componentConfigFile(componentId))\n )\n ).forEach((componentConfigFile, index) => {\n if (!componentConfigFile) return;\n const depResolverConfig = componentConfigFile.aspects.get(DependencyResolverAspect.id);\n if (!depResolverConfig) return;\n const componentId = allComponentIds[index];\n componentPolicies.push({ componentId, policy: depResolverConfig.config.policy });\n });\n return componentPolicies;\n }\n\n private _variantPatternsToDepPolicesDict(variantPatterns: Patterns): Record<string, VariantPolicyConfigObject> {\n const variantPoliciesByPatterns: Record<string, VariantPolicyConfigObject> = {};\n for (const [variantPattern, extensions] of Object.entries(variantPatterns)) {\n if (extensions[DependencyResolverAspect.id]?.policy) {\n variantPoliciesByPatterns[variantPattern] = extensions[DependencyResolverAspect.id]?.policy;\n }\n }\n return variantPoliciesByPatterns;\n }\n\n private async _updateComponentsConfig(updatedComponents: UpdatedComponent[]) {\n if (updatedComponents.length === 0) return;\n await Promise.all(\n updatedComponents.map(({ componentId, config }) => {\n return this.workspace.addSpecificComponentConfig(componentId, DependencyResolverAspect.id, config, {\n shouldMergeWithExisting: true,\n shouldMergeWithPrevious: true,\n });\n })\n );\n await this.workspace.bitMap.write('update (dependencies)');\n }\n\n private async _updateVariantsPolicies(variantPatterns: Record<string, any>, updateVariantPolicies: string[]) {\n for (const variantPattern of updateVariantPolicies) {\n this.variants.setExtension(\n variantPattern,\n DependencyResolverAspect.id,\n variantPatterns[variantPattern][DependencyResolverAspect.id],\n { overrideExisting: true }\n );\n }\n await this.dependencyResolver.persistConfig('update dependencies');\n }\n\n /**\n * Uninstall the specified packages from dependencies.\n *\n * @param {string[]} the list of packages that should be removed from dependencies.\n */\n async uninstallDependencies(packages: string[]) {\n this.dependencyResolver.removeFromRootPolicy(packages);\n await this.dependencyResolver.persistConfig('uninstall dependencies');\n return this._installModules({ dedupe: true });\n }\n\n /**\n * This function returns all the locations of the external links that should be created inside node_modules.\n * This information may then be passed to the package manager, which will create the links on its own.\n */\n async calculateLinks(\n options: WorkspaceLinkOptions = {}\n ): Promise<{ linkResults: WorkspaceLinkResults; linkedRootDeps: Record<string, string> }> {\n await pMapSeries(this.preLinkSlot.values(), (fn) => fn(options)); // import objects if not disabled in options\n const compDirMap = await this.getComponentsDirectory([]);\n const linker = this.dependencyResolver.getLinker({\n rootDir: this.workspace.path,\n linkingOptions: options,\n });\n const { linkResults: res, linkedRootDeps } = await linker.calculateLinkedDeps(\n this.workspace.path,\n compDirMap,\n options\n );\n const workspaceRes = res as WorkspaceLinkResults;\n\n const legacyResults = await this.linkCodemods(compDirMap, options);\n workspaceRes.legacyLinkResults = legacyResults.linksResults;\n workspaceRes.legacyLinkCodemodResults = legacyResults.codemodResults;\n\n if (this.dependencyResolver.hasRootComponents() && options.linkToBitRoots) {\n await this._linkAllComponentsToBitRoots(compDirMap);\n }\n return { linkResults: res, linkedRootDeps };\n }\n\n async linkCodemods(compDirMap: ComponentMap<string>, options?: { rewire?: boolean }) {\n const bitIds = compDirMap.toArray().map(([component]) => component.id);\n return linkToNodeModulesWithCodemod(this.workspace, bitIds, options?.rewire ?? false);\n }\n\n async link(options: WorkspaceLinkOptions = {}): Promise<WorkspaceLinkResults> {\n const { linkResults, linkedRootDeps } = await this.calculateLinks(options);\n await createLinks(options.linkToDir ?? this.workspace.path, linkedRootDeps, {\n avoidHardLink: true,\n skipIfSymlinkValid: true,\n });\n return linkResults;\n }\n\n private async _linkAllComponentsToBitRoots(compDirMap: ComponentMap<string>) {\n const envs = await this._getAllUsedEnvIds();\n const apps = (await this.app.listAppsComponents()).map((component) => component.id);\n await Promise.all(\n [...envs, ...apps].map(async (id) => {\n const dir = await this.getRootComponentDirByRootId(this.workspace.rootComponentsPath, id);\n await fs.mkdirp(dir);\n })\n );\n await linkPkgsToRootComponents(\n {\n rootComponentsPath: this.workspace.rootComponentsPath,\n workspacePath: this.workspace.path,\n },\n compDirMap.components.map((component) => this.dependencyResolver.getPackageName(component))\n );\n }\n\n private async getRootComponentDirByRootId(rootComponentsPath: string, rootComponentId: ComponentID): Promise<string> {\n // Root directories for local envs and apps are created without their version number.\n // This is done in order to avoid changes to the lockfile after such components are tagged.\n const id = this.workspace.hasId(rootComponentId)\n ? rootComponentId.toStringWithoutVersion()\n : rootComponentId.toString();\n return getRootComponentDir(rootComponentsPath, id);\n }\n\n /**\n * Generate a filter to pass to the installer\n * This will filter deps which are come from remotes which defined in scope.json\n * those components comes from local remotes, usually doesn't have a package in a registry\n * so no reason to try to install them (it will fail)\n */\n private async generateFilterFnForDepsFromLocalRemote() {\n // TODO: once scope create a new API for this, replace it with the new one\n const remotes = await this.workspace.scope._legacyRemotes();\n const reg = await this.dependencyResolver.getRegistries();\n const packageScopes = Object.keys(reg.scopes);\n return (dependencyList: DependencyList): DependencyList => {\n const filtered = dependencyList.filter((dep) => {\n if (!(dep instanceof ComponentDependency)) {\n return true;\n }\n if (remotes.isHub(dep.componentId.scope)) {\n return true;\n }\n if (packageScopes.some((scope) => dep.packageName.startsWith(`@${scope}/`))) {\n return true;\n }\n return false;\n });\n return filtered;\n };\n }\n\n private async getComponentsDirectory(ids: ComponentID[]): Promise<ComponentMap<string>> {\n const components = ids.length\n ? await this.workspace.getMany(ids)\n : await this.workspace.list(undefined, { loadSeedersAsAspects: false });\n return ComponentMap.as<string>(components, (component) => this.workspace.componentDir(component.id));\n }\n\n private async onRootAspectAddedSubscriber(_aspectId: ComponentID, inWs: boolean): Promise<void> {\n if (!inWs) {\n await this.install();\n }\n }\n private async onAspectsResolveSubscriber(aspectComponents: Component[]): Promise<void> {\n let needLink = false;\n let needInstall = false;\n const promises = aspectComponents.map(async (aspectComponent) => {\n const aspectIdStr = aspectComponent.id.toString();\n if (this.visitedAspects.has(aspectIdStr)) return;\n\n this.visitedAspects.add(aspectIdStr);\n const packagePath = await this.workspace.getComponentPackagePath(aspectComponent);\n const exists = await pathExists(packagePath);\n if (!exists) {\n const inWs = await this.workspace.hasId(aspectComponent.id);\n if (inWs) {\n needLink = true;\n } else {\n needInstall = true;\n }\n }\n });\n await Promise.all(promises);\n if (needInstall) {\n await this.install();\n return;\n }\n if (needLink) {\n await this.link();\n }\n }\n\n static slots = [Slot.withType<PreLinkSlot>(), Slot.withType<PreInstallSlot>(), Slot.withType<PostInstallSlot>()];\n static dependencies = [\n DependencyResolverAspect,\n WorkspaceAspect,\n LoggerAspect,\n VariantsAspect,\n CLIAspect,\n CompilerAspect,\n IssuesAspect,\n EnvsAspect,\n ApplicationAspect,\n IpcEventsAspect,\n GeneratorAspect,\n WorkspaceConfigFilesAspect,\n AspectLoaderAspect,\n ];\n\n static runtime = MainRuntime;\n\n static async provider(\n [\n dependencyResolver,\n workspace,\n loggerExt,\n variants,\n cli,\n compiler,\n issues,\n envs,\n app,\n ipcEvents,\n generator,\n wsConfigFiles,\n aspectLoader,\n ]: [\n DependencyResolverMain,\n Workspace,\n LoggerMain,\n VariantsMain,\n CLIMain,\n CompilerMain,\n IssuesMain,\n EnvsMain,\n ApplicationMain,\n IpcEventsMain,\n GeneratorMain,\n WorkspaceConfigFilesMain,\n AspectLoaderMain,\n ],\n _,\n [preLinkSlot, preInstallSlot, postInstallSlot]: [PreLinkSlot, PreInstallSlot, PostInstallSlot],\n harmony: Harmony\n ) {\n const logger = loggerExt.createLogger(InstallAspect.id);\n ipcEvents.registerGotEventSlot(async (eventName) => {\n if (eventName !== 'onPostInstall') return;\n logger.debug('got onPostInstall event, clear workspace and all components cache');\n await workspace.clearCache();\n workspace.clearAllComponentsCache();\n await pMapSeries(postInstallSlot.values(), (fn) => fn());\n });\n const installExt = new InstallMain(\n dependencyResolver,\n logger,\n workspace,\n variants,\n compiler,\n envs,\n wsConfigFiles,\n aspectLoader,\n app,\n generator,\n preLinkSlot,\n preInstallSlot,\n postInstallSlot,\n ipcEvents,\n harmony\n );\n if (issues) {\n issues.registerAddComponentsIssues(installExt.addDuplicateComponentAndPackageIssue.bind(installExt));\n }\n generator.registerOnComponentCreate(installExt.onComponentCreate.bind(installExt));\n const commands: CommandList = [\n new InstallCmd(installExt, workspace, logger),\n new UninstallCmd(installExt),\n new UpdateCmd(installExt),\n new LinkCommand(installExt, workspace, logger),\n ];\n // For now do not automate installation during aspect resolving\n // workspace.registerOnAspectsResolve(installExt.onAspectsResolveSubscriber.bind(installExt));\n if (workspace) {\n workspace.registerOnRootAspectAdded(installExt.onRootAspectAddedSubscriber.bind(installExt));\n }\n cli.register(...commands);\n return installExt;\n }\n}\n\ntype ComponentsAndManifests = {\n componentDirectoryMap: ComponentMap<string>;\n manifests: Record<string, ProjectManifest>;\n};\n\nfunction hasComponentsFromWorkspaceInMissingDeps({\n componentDirectoryMap,\n manifests,\n}: ComponentsAndManifests): boolean {\n const missingDeps = new Set<string>(\n componentDirectoryMap\n .toArray()\n .map(([{ state }]) => {\n const issue = state.issues.getIssue(IssuesClasses.MissingPackagesDependenciesOnFs);\n if (!issue) return [];\n return issue.data.map((d) => d.missingPackages).flat();\n })\n .flat()\n );\n return Object.values(manifests).some(({ name }) => name && missingDeps.has(name));\n}\n\nInstallAspect.addRuntime(InstallMain);\n\nexport default InstallMain;\n\nfunction manifestsHash(manifests: Record<string, ProjectManifest>): string {\n // We don't care if the type of the dependency changes as it doesn't change the node_modules structure\n const depsByProjectPaths = mapValues(manifests, (manifest) => ({\n ...manifest.devDependencies,\n ...manifest.dependencies,\n }));\n return hash(depsByProjectPaths);\n}\n"],"mappings":";;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,SAAA;EAAA,MAAAH,IAAA,GAAAI,uBAAA,CAAAF,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,MAAA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d,WAAW,CAAC;AAAC,IAAA+d,QAAA,GAAAlB,OAAA,CAAApf,OAAA,GAEvBuC,WAAW;AAE1B,SAAS2K,aAAaA,CAACzB,SAA0C,EAAU;EACzE;EACA,MAAM8U,kBAAkB,GAAG,IAAAC,mBAAS,EAAC/U,SAAS,EAAGuF,QAAQ,IAAA1P,aAAA,CAAAA,aAAA,KACpD0P,QAAQ,CAACF,eAAe,GACxBE,QAAQ,CAACxK,YAAY,CACxB,CAAC;EACH,OAAO,IAAAia,qBAAI,EAACF,kBAAkB,CAAC;AACjC","ignoreList":[]}
|
1
|
+
{"version":3,"names":["_pFilter","data","_interopRequireDefault","require","_fsExtra","_interopRequireWildcard","_path","_workspace","_compiler","_cli","_chalk","_workspace2","_lodash","_generator","_pkgModules","_application","_variants","_component","_dependenciesFs","_pMapSeries","_harmony","_workspaceModules","_envs","_ipcEvents","_componentIssues","_dependencyResolver","_workspaceConfigFiles","_logger","_issues","_componentPackageVersion","_aspectLoader","_objectHash","_exceptions","_install","_pickOutdatedPkgs","_link","_install2","_uninstall","_update","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ownKeys","keys","getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","_toPropertyKey","value","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","InstallMain","constructor","dependencyResolver","logger","workspace","variants","compiler","envs","wsConfigFiles","aspectLoader","app","generator","preLinkSlot","preInstallSlot","postInstallSlot","ipcEvents","harmony","Set","install","packages","options","inInstallContext","_addPackages","addMissingPeers","compDirMap","getComponentsDirectory","mergedRootPolicy","getWorkspacePolicy","depsFilterFn","generateFilterFnForDepsFromLocalRemote","pmInstallOptions","dedupe","copyPeerToRuntimeOnRoot","copyPeerToRuntimeOnComponents","dependencyFilterFn","overrides","config","hoistPatterns","packageImportMethod","missingPeers","getMissingPeerDependencies","path","missingPeerPackages","entries","map","peerName","range","console","pMapSeries","values","fn","res","_installModules","publishIpcEvent","registerPreLink","register","registerPreInstall","registerPostInstall","onComponentCreate","generateResults","installOptions","runInstall","installMissing","ids","generateResult","dependencies","concat","installMissingDependencies","isApp","isEnv","id","nonLoadedEnvs","clearComponentCache","component","envId","calculateEnvId","toString","isLoaded","isEnvRegistered","addMissingDeps","skipIfExisting","writeConfigFiles","lifecycleType","DependencyTypeNotSupportedInPolicy","debug","join","resolver","getVersionResolver","resolvedPackagesP","packageName","resolveRemoteVersion","rootDir","resolvedPackages","Promise","all","newWorkspacePolicyEntries","resolvedPackage","version","versionWithPrefix","getVersionWithSavePrefix","overridePrefix","savePrefix","wantedRange","dependencyId","addToRootPolicy","updateExisting","persistConfig","pm","getPackageManager","name","chalk","cyan","getPackageManagerName","hasRootComponents","installer","getInstaller","calcManifestsOpts","nodeLinker","linkOpts","linkTeambitBit","linkCoreAspects","linkDepsResolvedFromEnv","linkNestedDepsInNM","isLegacy","linkedRootDeps","calculateLinks","componentsAndManifests","current","_getComponentsManifestsAndRootPolicy","autoInstallPeers","includeOptionalDeps","neverBuiltDependencies","hoistInjectedDependencies","rootComponents","updateAll","optimizeReportForNonTerminal","lockfileOnly","prevManifests","linkedDependencies","installCycle","hasMissingLocalComponents","forceTeambitHarmonyLink","hasHarmonyInRootPolicy","hasComponentsFromWorkspaceInMissingDeps","dependenciesChanged","installComponents","manifests","componentDirectoryMap","installTeambitBit","cacheCleared","linkCodemods","oldNonLoadedEnvs","setOldNonLoadedEnvs","reloadMovedEnvs","reloadNonLoadedEnvs","shouldClearCacheOnInstall","compile","compileStartTime","process","hrtime","compileOutputMessage","setStatusLine","clearCache","compileOnWorkspace","initiator","CompilationInitiator","Install","consoleSuccess","tryWriteConfigFiles","recurringInstall","add","manifestsHash","skipClearFailedToLoadEnvs","_getComponentsManifests","skipPrune","pruneModules","getFailedToLoadEnvs","allEnvs","getAllRegisteredEnvs","movedEnvs","pFilter","env","__path","regularPathExists","pathExists","resolvedPathExists","__resolvedPath","idsToLoad","componentIdsToLoad","ComponentID","fromString","reloadEnvs","aspects","resolveAspects","undefined","requestedOnly","excludeCore","throwOnError","aspectDef","reloadAspects","groups","groupAspectsToLoad","group","reloadOneAspectsGroup","envOfAspect","loadedPlugins","compact","localPath","aspectPath","plugins","getPlugins","load","MainRuntime","plugin","runtime","getRuntime","provider","groupBy","hasId","workspaceSubGroups","regroupEnvsIdsFromTheList","comps","noComp","scope","otherAspects","envsOfAspects","idWithoutVersion","toStringWithoutVersion","addConfiguredAspectsToWorkspacePolicy","addConfiguredGeneratorEnvsToWorkspacePolicy","rootDeps","devDependencies","omit","manifest","addedNewPkgs","_addMissingPackagesToRootPolicy","mergedRootPolicyWithMissingDeps","shouldWrite","isWorkspaceConfigWriteEnabled","err","clean","silent","throw","consoleFailure","message","rootPolicy","aspectsPackages","getConfiguredUserAspectsPackages","externalsOnly","aspectsPackage","configuredEnvs","getConfiguredEnvs","resolvedEnvs","envIdStr","isCoreEnv","parsedId","resolveComponentId","inWs","importAndGetMany","idWithVersion","resolveEnvIdWithPotentialVersionForConfig","split","getPackageName","_getMissingPackagesWithoutRootDeps","_getAllMissingPackages","pkg","list","uniq","comp","state","issues","getIssue","IssuesClasses","MissingPackagesDependenciesOnFs","d","missingPackages","flat","dependencyInstaller","getComponentManifests","referenceLocalPackages","rootManifests","_getRootManifests","_updateRootDirs","envsWithoutManifest","Array","from","intersection","getOldNonLoadedEnvs","rootDirs","existingDirs","fs","readdir","rootComponentsPath","dirName","dirPath","includes","remove","code","mkdir","recursive","nonRootManifests","workspaceDeps","getWorkspaceDepsOfBitRoots","workspaceDepsMeta","reduce","acc","depName","injected","envManifests","_getEnvManifests","appManifests","_getAppManifests","_getAllUsedEnvIds","fromEntries","getRootComponentDirByRootId","_getEnvDependencies","_getEnvPackage","dependenciesMeta","installConfig","hoistingLimits","policy","getEnvPolicyFromEnvId","selfPolicy","force","envComponent","getEnvComponentByEnvId","finalVersion","snapToSemver","listAppsComponents","appPkgName","appManifest","find","Map","components","updateDependencies","componentPolicies","_getComponentsWithDependencyPolicies","variantPatterns","raw","variantPoliciesByPatterns","_variantPatternsToDepPolicesDict","outdatedPkgs","getOutdatedPkgsFromPolicies","patterns","forceVersionBump","outdatedPkgsToUpdate","off","pickOutdatedPkgs","on","updatedVariants","updatedComponents","applyUpdates","_updateVariantsPolicies","_updateComponentsConfig","_reloadConsumer","addDuplicateComponentAndPackageIssue","workspacePolicy","_consumer","removed","pkgName","componentIdToPackageName","found","getOrCreate","DuplicateComponentAndPackage","allComponentIds","listIds","componentId","componentConfigFile","index","depResolverConfig","DependencyResolverAspect","variantPattern","extensions","addSpecificComponentConfig","shouldMergeWithExisting","shouldMergeWithPrevious","bitMap","write","updateVariantPolicies","setExtension","overrideExisting","uninstallDependencies","removeFromRootPolicy","linker","getLinker","linkingOptions","linkResults","calculateLinkedDeps","workspaceRes","legacyResults","legacyLinkResults","linksResults","legacyLinkCodemodResults","codemodResults","linkToBitRoots","_linkAllComponentsToBitRoots","bitIds","toArray","linkToNodeModulesWithCodemod","rewire","link","createLinks","linkToDir","avoidHardLink","skipIfSymlinkValid","apps","dir","mkdirp","linkPkgsToRootComponents","workspacePath","rootComponentId","getRootComponentDir","remotes","_legacyRemotes","reg","getRegistries","packageScopes","scopes","dependencyList","filtered","dep","ComponentDependency","isHub","some","startsWith","getMany","loadSeedersAsAspects","ComponentMap","as","componentDir","onRootAspectAddedSubscriber","_aspectId","onAspectsResolveSubscriber","aspectComponents","needLink","needInstall","promises","aspectComponent","aspectIdStr","visitedAspects","packagePath","getComponentPackagePath","exists","onComponentChange","loggerExt","cli","_","createLogger","InstallAspect","registerGotEventSlot","eventName","clearAllComponentsCache","installExt","registerAddComponentsIssues","bind","registerOnComponentCreate","commands","InstallCmd","UninstallCmd","UpdateCmd","LinkCommand","registerOnRootAspectAdded","registerOnComponentChange","exports","Slot","withType","WorkspaceAspect","LoggerAspect","VariantsAspect","CLIAspect","CompilerAspect","IssuesAspect","EnvsAspect","ApplicationAspect","IpcEventsAspect","GeneratorAspect","WorkspaceConfigFilesAspect","AspectLoaderAspect","missingDeps","issue","addRuntime","_default","depsByProjectPaths","mapValues","hash"],"sources":["install.main.runtime.ts"],"sourcesContent":["import pFilter from 'p-filter';\nimport fs, { pathExists } from 'fs-extra';\nimport path from 'path';\nimport { getRootComponentDir, linkPkgsToRootComponents } from '@teambit/workspace.root-components';\nimport { CompilerMain, CompilerAspect, CompilationInitiator } from '@teambit/compiler';\nimport { CLIMain, CommandList, CLIAspect, MainRuntime } from '@teambit/cli';\nimport chalk from 'chalk';\nimport { WorkspaceAspect, Workspace, ComponentConfigFile } from '@teambit/workspace';\nimport { compact, mapValues, omit, uniq, intersection, groupBy } from 'lodash';\nimport { ProjectManifest } from '@pnpm/types';\nimport { GenerateResult, GeneratorAspect, GeneratorMain } from '@teambit/generator';\nimport { componentIdToPackageName } from '@teambit/pkg.modules.component-package-name';\nimport { ApplicationMain, ApplicationAspect } from '@teambit/application';\nimport { VariantsMain, Patterns, VariantsAspect } from '@teambit/variants';\nimport { Component, ComponentID, ComponentMap } from '@teambit/component';\nimport { createLinks } from '@teambit/dependencies.fs.linked-dependencies';\nimport pMapSeries from 'p-map-series';\nimport { Harmony, Slot, SlotRegistry } from '@teambit/harmony';\nimport {\n CodemodResult,\n linkToNodeModulesWithCodemod,\n NodeModulesLinksResult,\n} from '@teambit/workspace.modules.node-modules-linker';\nimport { EnvsMain, EnvsAspect } from '@teambit/envs';\nimport { IpcEventsAspect, IpcEventsMain } from '@teambit/ipc-events';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport {\n GetComponentManifestsOptions,\n WorkspaceDependencyLifecycleType,\n DependencyResolverMain,\n DependencyInstaller,\n DependencyResolverAspect,\n PackageManagerInstallOptions,\n ComponentDependency,\n VariantPolicyConfigObject,\n WorkspacePolicyEntry,\n LinkingOptions,\n LinkResults,\n DependencyList,\n MergedOutdatedPkg,\n WorkspacePolicy,\n UpdatedComponent,\n} from '@teambit/dependency-resolver';\nimport { WorkspaceConfigFilesAspect, WorkspaceConfigFilesMain } from '@teambit/workspace-config-files';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { IssuesAspect, IssuesMain } from '@teambit/issues';\nimport { snapToSemver } from '@teambit/component-package-version';\nimport { AspectDefinition, AspectLoaderAspect, AspectLoaderMain } from '@teambit/aspect-loader';\nimport hash from 'object-hash';\nimport { DependencyTypeNotSupportedInPolicy } from './exceptions';\nimport { InstallAspect } from './install.aspect';\nimport { pickOutdatedPkgs } from './pick-outdated-pkgs';\nimport { LinkCommand } from './link';\nimport InstallCmd from './install.cmd';\nimport UninstallCmd from './uninstall.cmd';\nimport UpdateCmd from './update.cmd';\n\nexport type WorkspaceLinkOptions = LinkingOptions & {\n rootPolicy?: WorkspacePolicy;\n linkToBitRoots?: boolean;\n includePeers?: boolean;\n};\n\nexport type WorkspaceLinkResults = {\n legacyLinkResults?: NodeModulesLinksResult[];\n legacyLinkCodemodResults?: CodemodResult[];\n} & LinkResults;\n\nexport type WorkspaceInstallOptions = {\n addMissingDeps?: boolean;\n addMissingPeers?: boolean;\n lifecycleType?: WorkspaceDependencyLifecycleType;\n dedupe?: boolean;\n import?: boolean;\n copyPeerToRuntimeOnRoot?: boolean;\n copyPeerToRuntimeOnComponents?: boolean;\n updateExisting?: boolean;\n skipIfExisting?: boolean;\n savePrefix?: string;\n compile?: boolean;\n includeOptionalDeps?: boolean;\n updateAll?: boolean;\n recurringInstall?: boolean;\n optimizeReportForNonTerminal?: boolean;\n lockfileOnly?: boolean;\n writeConfigFiles?: boolean;\n skipPrune?: boolean;\n};\n\nexport type ModulesInstallOptions = Omit<WorkspaceInstallOptions, 'updateExisting' | 'lifecycleType' | 'import'>;\n\ntype PreLink = (linkOpts?: WorkspaceLinkOptions) => Promise<void>;\ntype PreInstall = (installOpts?: WorkspaceInstallOptions) => Promise<void>;\ntype PostInstall = () => Promise<void>;\n\ntype PreLinkSlot = SlotRegistry<PreLink>;\ntype PreInstallSlot = SlotRegistry<PreInstall>;\ntype PostInstallSlot = SlotRegistry<PostInstall>;\n\ntype GetComponentsAndManifestsOptions = Omit<\n GetComponentManifestsOptions,\n 'componentDirectoryMap' | 'rootPolicy' | 'rootDir'\n> &\n Pick<PackageManagerInstallOptions, 'nodeLinker'>;\n\ntype ReloadAspectGroup = { comps: boolean; workspace: boolean; envOfAspect?: boolean; aspects: AspectDefinition[] };\nexport class InstallMain {\n private visitedAspects: Set<string> = new Set();\n\n private oldNonLoadedEnvs: string[] = [];\n\n constructor(\n private dependencyResolver: DependencyResolverMain,\n\n private logger: Logger,\n\n private workspace: Workspace,\n\n private variants: VariantsMain,\n\n private compiler: CompilerMain,\n\n private envs: EnvsMain,\n\n private wsConfigFiles: WorkspaceConfigFilesMain,\n\n private aspectLoader: AspectLoaderMain,\n\n private app: ApplicationMain,\n\n private generator: GeneratorMain,\n\n private preLinkSlot: PreLinkSlot,\n\n private preInstallSlot: PreInstallSlot,\n\n private postInstallSlot: PostInstallSlot,\n\n private ipcEvents: IpcEventsMain,\n\n private harmony: Harmony\n ) {}\n /**\n * Install dependencies for all components in the workspace\n *\n * @returns\n * @memberof Workspace\n */\n async install(packages?: string[], options?: WorkspaceInstallOptions): Promise<ComponentMap<string>> {\n // set workspace in install context\n this.workspace.inInstallContext = true;\n if (packages && packages.length) {\n await this._addPackages(packages, options);\n }\n if (options?.addMissingPeers) {\n const compDirMap = await this.getComponentsDirectory([]);\n const mergedRootPolicy = this.dependencyResolver.getWorkspacePolicy();\n const depsFilterFn = await this.generateFilterFnForDepsFromLocalRemote();\n const pmInstallOptions: PackageManagerInstallOptions = {\n dedupe: options?.dedupe,\n copyPeerToRuntimeOnRoot: options?.copyPeerToRuntimeOnRoot ?? true,\n copyPeerToRuntimeOnComponents: options?.copyPeerToRuntimeOnComponents ?? false,\n dependencyFilterFn: depsFilterFn,\n overrides: this.dependencyResolver.config.overrides,\n hoistPatterns: this.dependencyResolver.config.hoistPatterns,\n packageImportMethod: this.dependencyResolver.config.packageImportMethod,\n };\n const missingPeers = await this.dependencyResolver.getMissingPeerDependencies(\n this.workspace.path,\n mergedRootPolicy,\n compDirMap,\n pmInstallOptions\n );\n if (missingPeers) {\n const missingPeerPackages = Object.entries(missingPeers).map(([peerName, range]) => `${peerName}@${range}`);\n await this._addPackages(missingPeerPackages, options);\n } else {\n this.logger.console('No missing peer dependencies found.');\n }\n }\n await pMapSeries(this.preInstallSlot.values(), (fn) => fn(options)); // import objects if not disabled in options\n const res = await this._installModules(options);\n this.workspace.inInstallContext = false;\n\n await this.ipcEvents.publishIpcEvent('onPostInstall');\n\n return res;\n }\n\n registerPreLink(fn: PreLink) {\n this.preLinkSlot.register(fn);\n }\n\n registerPreInstall(fn: PreInstall) {\n this.preInstallSlot.register(fn);\n }\n\n registerPostInstall(fn: PostInstall) {\n this.postInstallSlot.register(fn);\n }\n\n async onComponentCreate(generateResults: GenerateResult[], installOptions?: Partial<WorkspaceInstallOptions>) {\n this.workspace.inInstallContext = true;\n let runInstall = false;\n let packages: string[] = [];\n let installMissing = false;\n\n const ids = generateResults.map((generateResult) => {\n if (generateResult.dependencies && generateResult.dependencies.length) {\n packages = packages.concat(generateResult.dependencies);\n runInstall = true;\n }\n if (generateResult.installMissingDependencies) {\n installMissing = true;\n runInstall = true;\n }\n if (generateResult.isApp || generateResult.isEnv) {\n runInstall = true;\n }\n return generateResult.id;\n });\n const nonLoadedEnvs: string[] = [];\n\n ids.map((id) => this.workspace.clearComponentCache(id));\n await pMapSeries(ids, async (id) => {\n const component = await this.workspace.get(id);\n // const envId = await this.envs.getEnvId(component);\n const envId = (await this.envs.calculateEnvId(component)).toString();\n const isLoaded = this.envs.isEnvRegistered(envId);\n if (!isLoaded) {\n nonLoadedEnvs.push(envId);\n }\n return component;\n });\n if (nonLoadedEnvs.length) {\n runInstall = true;\n }\n if (!runInstall) {\n this.workspace.inInstallContext = false;\n return;\n }\n // this.logger.console(\n // `the following environments are not installed yet: ${nonLoadedEnvs.join(', ')}. installing them now...`\n // );\n await this.install(packages, {\n ...installOptions,\n addMissingDeps: installMissing,\n skipIfExisting: true,\n writeConfigFiles: false,\n // skipPrune: true,\n });\n }\n\n private async _addPackages(packages: string[], options?: WorkspaceInstallOptions) {\n if ((options?.lifecycleType as string) === 'dev') {\n throw new DependencyTypeNotSupportedInPolicy(options?.lifecycleType as string);\n }\n this.logger.debug(`installing the following packages: ${packages.join()}`);\n const resolver = await this.dependencyResolver.getVersionResolver();\n const resolvedPackagesP = packages.map((packageName) =>\n resolver.resolveRemoteVersion(packageName, {\n rootDir: this.workspace.path,\n })\n );\n const resolvedPackages = await Promise.all(resolvedPackagesP);\n const newWorkspacePolicyEntries: WorkspacePolicyEntry[] = [];\n resolvedPackages.forEach((resolvedPackage) => {\n if (resolvedPackage.version) {\n const versionWithPrefix = this.dependencyResolver.getVersionWithSavePrefix({\n version: resolvedPackage.version,\n overridePrefix: options?.savePrefix,\n wantedRange: resolvedPackage.wantedRange,\n });\n newWorkspacePolicyEntries.push({\n dependencyId: resolvedPackage.packageName,\n value: {\n version: versionWithPrefix,\n },\n lifecycleType: options?.lifecycleType || 'runtime',\n });\n }\n });\n this.dependencyResolver.addToRootPolicy(newWorkspacePolicyEntries, {\n updateExisting: options?.updateExisting ?? false,\n skipIfExisting: options?.skipIfExisting ?? false,\n });\n await this.dependencyResolver.persistConfig('install');\n }\n\n private async _installModules(options?: ModulesInstallOptions): Promise<ComponentMap<string>> {\n const pm = this.dependencyResolver.getPackageManager();\n this.logger.console(\n `installing dependencies in workspace using ${pm?.name} (${chalk.cyan(\n this.dependencyResolver.getPackageManagerName()\n )})`\n );\n this.logger.debug(`installing dependencies in workspace with options`, options);\n const depsFilterFn = await this.generateFilterFnForDepsFromLocalRemote();\n const hasRootComponents = this.dependencyResolver.hasRootComponents();\n // TODO: pass get install options\n const installer = this.dependencyResolver.getInstaller({});\n const calcManifestsOpts: GetComponentsAndManifestsOptions = {\n copyPeerToRuntimeOnComponents: options?.copyPeerToRuntimeOnComponents ?? false,\n copyPeerToRuntimeOnRoot: options?.copyPeerToRuntimeOnRoot ?? true,\n dedupe: !hasRootComponents && options?.dedupe,\n dependencyFilterFn: depsFilterFn,\n nodeLinker: this.dependencyResolver.nodeLinker(),\n };\n const linkOpts = {\n linkTeambitBit: true,\n linkCoreAspects: this.dependencyResolver.linkCoreAspects(),\n linkDepsResolvedFromEnv: !hasRootComponents,\n linkNestedDepsInNM: !this.workspace.isLegacy && !hasRootComponents,\n };\n const { linkedRootDeps } = await this.calculateLinks(linkOpts);\n // eslint-disable-next-line prefer-const\n let { mergedRootPolicy, componentsAndManifests: current } = await this._getComponentsManifestsAndRootPolicy(\n installer,\n {\n ...calcManifestsOpts,\n addMissingDeps: options?.addMissingDeps,\n linkedRootDeps,\n }\n );\n\n const pmInstallOptions: PackageManagerInstallOptions = {\n ...calcManifestsOpts,\n autoInstallPeers: this.dependencyResolver.config.autoInstallPeers,\n includeOptionalDeps: options?.includeOptionalDeps,\n neverBuiltDependencies: this.dependencyResolver.config.neverBuiltDependencies,\n overrides: this.dependencyResolver.config.overrides,\n hoistPatterns: this.dependencyResolver.config.hoistPatterns,\n hoistInjectedDependencies: this.dependencyResolver.config.hoistInjectedDependencies,\n packageImportMethod: this.dependencyResolver.config.packageImportMethod,\n rootComponents: hasRootComponents,\n updateAll: options?.updateAll,\n optimizeReportForNonTerminal: options?.optimizeReportForNonTerminal,\n lockfileOnly: options?.lockfileOnly,\n };\n const prevManifests = new Set<string>();\n // TODO: this make duplicate\n // this.logger.consoleSuccess();\n const linkedDependencies = {\n [this.workspace.path]: linkedRootDeps,\n };\n const compDirMap = await this.getComponentsDirectory([]);\n let installCycle = 0;\n let hasMissingLocalComponents = true;\n const forceTeambitHarmonyLink = !this.dependencyResolver.hasHarmonyInRootPolicy();\n /* eslint-disable no-await-in-loop */\n do {\n // In case there are missing local components,\n // we'll need to make another round of installation as on the first round the missing local components\n // are not added to the manifests.\n // This is an issue when installation is done using root components.\n hasMissingLocalComponents = hasRootComponents && hasComponentsFromWorkspaceInMissingDeps(current);\n const { dependenciesChanged } = await installer.installComponents(\n this.workspace.path,\n current.manifests,\n mergedRootPolicy,\n current.componentDirectoryMap,\n {\n linkedDependencies,\n installTeambitBit: false,\n forceTeambitHarmonyLink,\n },\n pmInstallOptions\n );\n let cacheCleared = false;\n await this.linkCodemods(compDirMap);\n const oldNonLoadedEnvs = this.setOldNonLoadedEnvs();\n await this.reloadMovedEnvs();\n await this.reloadNonLoadedEnvs();\n\n const shouldClearCacheOnInstall = this.shouldClearCacheOnInstall();\n if (options?.compile ?? true) {\n const compileStartTime = process.hrtime();\n const compileOutputMessage = `compiling components`;\n this.logger.setStatusLine(compileOutputMessage);\n if (shouldClearCacheOnInstall) {\n // We need to clear cache before compiling the components or it might compile them with the default env\n // incorrectly in case the env was not loaded correctly before the installation.\n // We don't want to clear the failed to load envs because we want to show the warning at the end\n // await this.workspace.clearCache({ skipClearFailedToLoadEnvs: true });\n await this.workspace.clearCache();\n cacheCleared = true;\n }\n await this.compiler.compileOnWorkspace([], { initiator: CompilationInitiator.Install });\n\n // Right now we don't need to load extensions/execute load slot at this point\n // await this.compiler.compileOnWorkspace([], { initiator: CompilationInitiator.Install }, undefined, {\n // executeLoadSlot: true,\n // loadExtensions: true,\n // });\n this.logger.consoleSuccess(compileOutputMessage, compileStartTime);\n }\n if (options?.writeConfigFiles ?? true) {\n await this.tryWriteConfigFiles(!cacheCleared && shouldClearCacheOnInstall);\n }\n if (!dependenciesChanged) break;\n if (!options?.recurringInstall) break;\n\n if (!oldNonLoadedEnvs.length) break;\n prevManifests.add(manifestsHash(current.manifests));\n // If we run compile we do the clear cache before the compilation so no need to clean it again (it's an expensive\n // operation)\n if (!cacheCleared && shouldClearCacheOnInstall) {\n // We need to clear cache before creating the new component manifests.\n // this.workspace.consumer.componentLoader.clearComponentsCache();\n // We don't want to clear the failed to load envs because we want to show the warning at the end\n await this.workspace.clearCache({ skipClearFailedToLoadEnvs: true });\n }\n current = await this._getComponentsManifests(installer, mergedRootPolicy, calcManifestsOpts);\n installCycle += 1;\n } while ((!prevManifests.has(manifestsHash(current.manifests)) || hasMissingLocalComponents) && installCycle < 5);\n if (!options?.lockfileOnly && !options?.skipPrune) {\n // We clean node_modules only after the last install.\n // Otherwise, we might load an env from a location that we later remove.\n await installer.pruneModules(this.workspace.path);\n }\n // this is now commented out because we assume we don't need it anymore.\n // even when the env was not loaded before and it is loaded now, it should be fine because the dependencies-data\n // is only about the auto-detect-deps. there are two more steps: version-resolution and apply-overrides that\n // disregard the dependencies-cache.\n // await this.workspace.consumer.componentFsCache.deleteAllDependenciesDataCache();\n /* eslint-enable no-await-in-loop */\n return current.componentDirectoryMap;\n }\n\n private shouldClearCacheOnInstall(): boolean {\n const nonLoadedEnvs = this.envs.getFailedToLoadEnvs();\n return nonLoadedEnvs.length > 0;\n }\n\n /**\n * This function is very important to fix some issues that might happen during the installation process.\n * The case is the following:\n * during/before the installation process we load some envs from their bit.env files\n * this contains code like:\n * protected tsconfigPath = require.resolve('./config/tsconfig.json');\n * protected eslintConfigPath = require.resolve('./config/eslintrc.cjs');\n * When we load that file, we calculated the resolved path, and it's stored in the env\n * object instance.\n * then later on during the install we move the env to another location (like bit roots)\n * which points to a .pnpm folder with some peers, that changed during the install\n * then when we take this env object and call write ws config for example\n * or compile\n * we use that resolved path to calculate the final tsconfig\n * however that file is no longer exists which result in an error\n * This function will check if an env folder doesn't exist anymore, and will re-load it\n * from its new location.\n * This usually happen when we have install running in the middle of the process followed\n * by other bit ops.\n * examples:\n * bit new - which might run few installs then other ops.\n * bit switch - which might run few installs then other ops, and potentially change the\n * peer deps during the install.\n * bit server (vscode plugin) - which keep the process always live, so any install ops\n * that change the location, will cause the vscode plugin/bit server to crash later.\n * @returns\n */\n private async reloadMovedEnvs() {\n const allEnvs = this.envs.getAllRegisteredEnvs();\n const movedEnvs = await pFilter(allEnvs, async (env) => {\n if (!env.__path) return false;\n const regularPathExists = await pathExists(env.__path);\n const resolvedPathExists = await pathExists(env.__resolvedPath);\n return !regularPathExists || !resolvedPathExists;\n });\n const idsToLoad = movedEnvs.map((env) => env.id);\n const componentIdsToLoad = idsToLoad.map((id) => ComponentID.fromString(id));\n await this.reloadEnvs(componentIdsToLoad);\n }\n\n private async reloadNonLoadedEnvs() {\n const nonLoadedEnvs = this.envs.getFailedToLoadEnvs();\n const componentIdsToLoad = nonLoadedEnvs.map((id) => ComponentID.fromString(id));\n await this.reloadEnvs(componentIdsToLoad);\n }\n\n private async reloadEnvs(componentIdsToLoad: ComponentID[]) {\n if (componentIdsToLoad.length && this.workspace) {\n const aspects = await this.workspace.resolveAspects(undefined, componentIdsToLoad, {\n requestedOnly: true,\n excludeCore: true,\n throwOnError: false,\n // Theoretically we should use skipDeps here, but according to implementation at the moment\n // it will lead to plugins not load, and we need them to be loaded.\n // This is a bug in the flow and should be fixed.\n // skipDeps: true,\n });\n\n await Promise.all(\n aspects.map(async (aspectDef) => {\n const id = aspectDef.component?.id;\n if (!id) return;\n await this.workspace.clearComponentCache(id);\n })\n );\n await this.reloadAspects(aspects || []);\n\n // Keeping this here for now, it was removed as part of #9138 as now that we load envs of envs\n // correctly first it seems to be not needed anymore.\n // But there might be cases where it will be needed. So keeping it here for now.\n\n // This is a very special case which we need to compile our envs before loading them correctly.\n // const grouped = groupBy(aspects, (aspectDef) => {\n // return aspectDef.component?.id.toStringWithoutVersion() === 'bitdev.general/envs/bit-env';\n // });\n // await this.reloadAspects(grouped.true || []);\n // const otherEnvs = grouped.false || [];\n // await Promise.all(\n // otherEnvs.map(async (aspectDef) => {\n // const id = aspectDef.component?.id;\n // if (!id) return;\n // await this.workspace.clearComponentCache(id);\n // })\n // );\n // await this.reloadAspects(grouped.false || []);\n }\n }\n\n private async reloadAspects(aspects: AspectDefinition[]) {\n const groups = await this.groupAspectsToLoad(aspects);\n // We need to make sure we load group by group and not in parallel\n await pMapSeries(groups, async (group) => {\n await this.reloadOneAspectsGroup(group);\n });\n }\n\n private async reloadOneAspectsGroup(group: ReloadAspectGroup) {\n const aspects = group.aspects || [];\n if (group.workspace && !group.envOfAspect) {\n aspects.forEach((aspectDef) => {\n if (aspectDef.component?.id) {\n this.workspace.clearComponentCache(aspectDef.component.id);\n }\n });\n }\n const loadedPlugins = compact(\n await Promise.all(\n aspects.map((aspectDef) => {\n const localPath = aspectDef.aspectPath;\n const component = aspectDef.component;\n if (!component) return undefined;\n const plugins = this.aspectLoader.getPlugins(component, localPath);\n if (plugins.has()) {\n return plugins.load(MainRuntime.name);\n }\n })\n )\n );\n await Promise.all(\n loadedPlugins.map((plugin) => {\n const runtime = plugin.getRuntime(MainRuntime);\n return runtime?.provider(undefined, undefined, undefined, this.harmony);\n })\n );\n }\n\n /**\n * This function groups the components to aspects to load into groups.\n * The order of the groups is important, the first group should be loaded first.\n * The order inside the group is not important.\n * The groups are:\n * 1. aspects definitions without components (this should be an empty group, if it's not, we should check why).\n * 2. aspects which are not in the workspace but in the scope / node modules.\n * 3. envs of aspects (which are also aspects)\n * 4. other aspects (the rest)\n * @param aspects\n * @returns\n */\n private async groupAspectsToLoad(aspects: AspectDefinition[]): Promise<Array<ReloadAspectGroup>> {\n const groups = groupBy(aspects, (aspectDef) => {\n if (!aspectDef.component) return 'no-comp';\n if (!this.workspace.hasId(aspectDef.component.id)) return 'scope';\n return 'workspace';\n });\n const workspaceSubGroups = await this.regroupEnvsIdsFromTheList(groups.workspace || []);\n return [\n { comps: false, workspace: false, aspects: groups.noComp || [] },\n { comps: true, workspace: false, aspects: groups.scope || [] },\n { comps: true, workspace: true, envOfAspect: true, aspects: workspaceSubGroups.envOfAspect },\n { comps: true, workspace: true, aspects: workspaceSubGroups.otherAspects },\n ];\n }\n\n private async regroupEnvsIdsFromTheList(aspects: AspectDefinition[]): Promise<Record<string, AspectDefinition[]>> {\n const envsOfAspects = new Set<string>();\n await Promise.all(\n aspects.map(async (aspectDef) => {\n if (!aspectDef.component) return;\n const envId = aspectDef.component ? await this.envs.calculateEnvId(aspectDef.component) : undefined;\n if (envId) {\n envsOfAspects.add(envId.toString());\n }\n })\n );\n const groups = groupBy(aspects, (aspectDef) => {\n const id = aspectDef.component?.id.toString();\n const idWithoutVersion = aspectDef.component?.id.toStringWithoutVersion();\n if ((id && envsOfAspects.has(id)) || (idWithoutVersion && envsOfAspects.has(idWithoutVersion))) {\n return 'envOfAspect';\n }\n return 'otherAspects';\n });\n\n return groups;\n }\n\n private async _getComponentsManifestsAndRootPolicy(\n installer: DependencyInstaller,\n options: GetComponentsAndManifestsOptions & {\n addMissingDeps?: boolean;\n linkedRootDeps: Record<string, string>;\n }\n ): Promise<{ componentsAndManifests: ComponentsAndManifests; mergedRootPolicy: WorkspacePolicy }> {\n const mergedRootPolicy = await this.addConfiguredAspectsToWorkspacePolicy();\n await this.addConfiguredGeneratorEnvsToWorkspacePolicy(mergedRootPolicy);\n const componentsAndManifests = await this._getComponentsManifests(installer, mergedRootPolicy, options);\n if (!options?.addMissingDeps) {\n return { componentsAndManifests, mergedRootPolicy };\n }\n const rootDeps = new Set(\n Object.keys({\n ...componentsAndManifests.manifests[this.workspace.path].devDependencies,\n ...componentsAndManifests.manifests[this.workspace.path].dependencies,\n ...options.linkedRootDeps,\n })\n );\n Object.values(omit(componentsAndManifests.manifests, [this.workspace.path])).forEach((manifest) => {\n if ((manifest as ProjectManifest).name) {\n rootDeps.add((manifest as ProjectManifest).name!); // eslint-disable-line @typescript-eslint/no-non-null-assertion\n }\n });\n const addedNewPkgs = await this._addMissingPackagesToRootPolicy(rootDeps);\n if (!addedNewPkgs) {\n return { componentsAndManifests, mergedRootPolicy };\n }\n const mergedRootPolicyWithMissingDeps = await this.addConfiguredAspectsToWorkspacePolicy();\n await this.addConfiguredGeneratorEnvsToWorkspacePolicy(mergedRootPolicyWithMissingDeps);\n return {\n mergedRootPolicy: mergedRootPolicyWithMissingDeps,\n componentsAndManifests: await this._getComponentsManifests(installer, mergedRootPolicyWithMissingDeps, options),\n };\n }\n\n /**\n * The function `tryWriteConfigFiles` attempts to write workspace config files, and if it fails, it logs an error\n * message.\n * @returns If the condition `!shouldWrite` is true, then nothing is being returned. Otherwise, if the `writeConfigFiles`\n * function is successfully executed, nothing is being returned. If an error occurs during the execution of\n * `writeConfigFiles`, an error message is being returned.\n */\n private async tryWriteConfigFiles(clearCache: boolean) {\n const shouldWrite = this.wsConfigFiles.isWorkspaceConfigWriteEnabled();\n if (!shouldWrite) return;\n if (clearCache) {\n await this.workspace.clearCache({ skipClearFailedToLoadEnvs: true });\n }\n const { err } = await this.wsConfigFiles.writeConfigFiles({\n clean: true,\n silent: true,\n dedupe: true,\n throw: false,\n });\n\n if (err) {\n this.logger.consoleFailure(\n `failed generating workspace config files, please run \"bit ws-config write\" manually. error: ${err.message}`\n );\n }\n }\n\n private async addConfiguredAspectsToWorkspacePolicy(): Promise<WorkspacePolicy> {\n const rootPolicy = this.dependencyResolver.getWorkspacePolicy();\n const aspectsPackages = await this.workspace.getConfiguredUserAspectsPackages({ externalsOnly: true });\n aspectsPackages.forEach((aspectsPackage) => {\n rootPolicy.add(\n {\n dependencyId: aspectsPackage.packageName,\n value: {\n version: aspectsPackage.version,\n },\n lifecycleType: 'runtime',\n },\n // If it's already exist from the root, take the version from the root policy\n { skipIfExisting: true }\n );\n });\n return rootPolicy;\n }\n\n private async addConfiguredGeneratorEnvsToWorkspacePolicy(rootPolicy: WorkspacePolicy): Promise<void> {\n const configuredEnvs = this.generator.getConfiguredEnvs();\n const resolvedEnvs = compact(\n await Promise.all(\n configuredEnvs.map(async (envIdStr) => {\n if (this.envs.isCoreEnv(envIdStr)) {\n return undefined;\n }\n const parsedId = await this.workspace.resolveComponentId(envIdStr);\n // If we have the env in the workspace, we don't want to install it\n const inWs = await this.workspace.hasId(parsedId);\n if (inWs) {\n return undefined;\n }\n const comps = await this.workspace.importAndGetMany(\n [parsedId],\n `to get the env ${parsedId.toString()} for installation`\n );\n const idWithVersion = await this.workspace.resolveEnvIdWithPotentialVersionForConfig(parsedId);\n const version = idWithVersion.split('@')[1] || '*';\n const packageName = this.dependencyResolver.getPackageName(comps[0]);\n return {\n packageName,\n version,\n };\n })\n )\n );\n\n resolvedEnvs.forEach((env) => {\n rootPolicy.add(\n {\n dependencyId: env.packageName,\n value: {\n version: env.version,\n },\n lifecycleType: 'runtime',\n },\n // If it's already exist from the root, take the version from the root policy\n { skipIfExisting: true }\n );\n });\n }\n\n private async _addMissingPackagesToRootPolicy(\n rootDeps: Set<string>,\n options?: WorkspaceInstallOptions\n ): Promise<boolean> {\n const packages = await this._getMissingPackagesWithoutRootDeps(rootDeps);\n if (packages && packages.length) {\n await this._addPackages(packages, options);\n }\n return packages.length > 0;\n }\n\n private async _getMissingPackagesWithoutRootDeps(rootDeps: Set<string>) {\n const packages = await this._getAllMissingPackages();\n return packages.filter((pkg) => !rootDeps.has(pkg));\n }\n\n private async _getAllMissingPackages(): Promise<string[]> {\n const comps = await this.workspace.list();\n return uniq(\n comps\n .map((comp) => {\n const data = comp.state.issues.getIssue(IssuesClasses.MissingPackagesDependenciesOnFs)?.data || [];\n return data.map((d) => d.missingPackages).flat();\n })\n .flat()\n );\n }\n\n private async _getComponentsManifests(\n dependencyInstaller: DependencyInstaller,\n rootPolicy: WorkspacePolicy,\n installOptions: GetComponentsAndManifestsOptions\n ): Promise<ComponentsAndManifests> {\n const componentDirectoryMap = await this.getComponentsDirectory([]);\n let manifests = await dependencyInstaller.getComponentManifests({\n ...installOptions,\n componentDirectoryMap,\n rootPolicy,\n rootDir: this.workspace.path,\n referenceLocalPackages: this.dependencyResolver.hasRootComponents() && installOptions.nodeLinker === 'isolated',\n });\n\n if (this.dependencyResolver.hasRootComponents()) {\n const rootManifests = await this._getRootManifests(manifests);\n await this._updateRootDirs(Object.keys(rootManifests));\n manifests = {\n ...manifests,\n ...rootManifests,\n };\n }\n return {\n componentDirectoryMap,\n manifests,\n };\n }\n\n public setOldNonLoadedEnvs() {\n const nonLoadedEnvs = this.envs.getFailedToLoadEnvs();\n const envsWithoutManifest = Array.from(this.dependencyResolver.envsWithoutManifest);\n const oldNonLoadedEnvs = intersection(nonLoadedEnvs, envsWithoutManifest);\n this.oldNonLoadedEnvs = oldNonLoadedEnvs;\n return oldNonLoadedEnvs;\n }\n\n /**\n * This function returns a list of old non-loaded environments names.\n * @returns an array of strings called `oldNonLoadedEnvs`. This array contains the names of environment variables that\n * failed to load as extensions and are also don't have an env.jsonc file.\n * If this list is not empty, then the user might need to run another install to make sure all dependencies resolved\n * correctly\n */\n public getOldNonLoadedEnvs() {\n return this.oldNonLoadedEnvs;\n }\n\n private async _updateRootDirs(rootDirs: string[]) {\n try {\n const existingDirs = await fs.readdir(this.workspace.rootComponentsPath);\n await Promise.all(\n existingDirs.map(async (dirName) => {\n const dirPath = path.join(this.workspace.rootComponentsPath, dirName);\n if (!rootDirs.includes(dirPath)) {\n await fs.remove(dirPath);\n }\n })\n );\n } catch (err: any) {\n if (err.code !== 'ENOENT') throw err;\n }\n await Promise.all(rootDirs.map((dirPath) => fs.mkdir(dirPath, { recursive: true })));\n }\n\n private async _getRootManifests(\n manifests: Record<string, ProjectManifest>\n ): Promise<Record<string, ProjectManifest>> {\n const nonRootManifests = Object.values(manifests).filter(({ name }) => name !== 'workspace');\n const workspaceDeps = this.dependencyResolver.getWorkspaceDepsOfBitRoots(nonRootManifests);\n const workspaceDepsMeta = Object.keys(workspaceDeps).reduce((acc, depName) => {\n acc[depName] = { injected: true };\n return acc;\n }, {});\n const envManifests = await this._getEnvManifests(workspaceDeps, workspaceDepsMeta);\n const appManifests = await this._getAppManifests(manifests, workspaceDeps, workspaceDepsMeta);\n return {\n ...envManifests,\n ...appManifests,\n };\n }\n\n private async _getEnvManifests(\n workspaceDeps: Record<string, string>,\n workspaceDepsMeta: Record<string, { injected: true }>\n ): Promise<Record<string, ProjectManifest>> {\n const envs = await this._getAllUsedEnvIds();\n return Object.fromEntries(\n await Promise.all(\n envs.map(async (envId) => {\n return [\n await this.getRootComponentDirByRootId(this.workspace.rootComponentsPath, envId),\n {\n dependencies: {\n ...(await this._getEnvDependencies(envId)),\n ...workspaceDeps,\n ...(await this._getEnvPackage(envId)),\n },\n dependenciesMeta: workspaceDepsMeta,\n installConfig: {\n hoistingLimits: 'workspaces',\n },\n },\n ];\n })\n )\n );\n }\n\n private async _getEnvDependencies(envId: ComponentID): Promise<Record<string, string>> {\n const policy = await this.dependencyResolver.getEnvPolicyFromEnvId(envId);\n if (!policy) return {};\n return Object.fromEntries(\n policy.selfPolicy.entries\n .filter(({ force, value }) => force && value.version !== '-')\n .map(({ dependencyId, value }) => [dependencyId, value.version])\n );\n }\n\n /**\n * Return the package name of the env with its version.\n * (only if the env is not a core env and is not in the workspace)\n * @param envId\n * @returns\n */\n private async _getEnvPackage(envId: ComponentID): Promise<Record<string, string> | undefined> {\n if (this.envs.isCoreEnv(envId.toStringWithoutVersion())) return undefined;\n const inWs = await this.workspace.hasId(envId);\n if (inWs) return undefined;\n const envComponent = await this.envs.getEnvComponentByEnvId(envId.toString(), envId.toString());\n if (!envComponent) return undefined;\n const packageName = this.dependencyResolver.getPackageName(envComponent);\n const version = envId.version;\n const finalVersion = snapToSemver(version as string);\n return { [packageName]: finalVersion };\n }\n\n private async _getAppManifests(\n manifests: Record<string, ProjectManifest>,\n workspaceDeps: Record<string, string>,\n workspaceDepsMeta: Record<string, { injected: true }>\n ): Promise<Record<string, ProjectManifest>> {\n return Object.fromEntries(\n compact(\n await Promise.all(\n (await this.app.listAppsComponents()).map(async (app) => {\n const appPkgName = this.dependencyResolver.getPackageName(app);\n const appManifest = Object.values(manifests).find(({ name }) => name === appPkgName);\n if (!appManifest) return null;\n const envId = await this.envs.calculateEnvId(app);\n return [\n await this.getRootComponentDirByRootId(this.workspace.rootComponentsPath, app.id),\n {\n ...omit(appManifest, ['name', 'version']),\n dependencies: {\n ...(await this._getEnvDependencies(envId)),\n ...appManifest.dependencies,\n ...workspaceDeps,\n },\n dependenciesMeta: {\n ...appManifest.dependenciesMeta,\n ...workspaceDepsMeta,\n },\n installConfig: {\n hoistingLimits: 'workspaces',\n },\n },\n ];\n })\n )\n )\n );\n }\n\n private async _getAllUsedEnvIds(): Promise<ComponentID[]> {\n const envs = new Map<string, ComponentID>();\n const components = await this.workspace.list();\n await pMapSeries(components, async (component) => {\n const envId = await this.envs.calculateEnvId(component);\n envs.set(envId.toString(), envId);\n });\n return Array.from(envs.values());\n }\n\n /**\n * Updates out-of-date dependencies in the workspace.\n *\n * @param options.all {Boolean} updates all outdated dependencies without showing a prompt.\n */\n async updateDependencies(options: {\n forceVersionBump?: 'major' | 'minor' | 'patch' | 'compatible';\n patterns?: string[];\n all: boolean;\n }): Promise<ComponentMap<string> | null> {\n const componentPolicies = await this._getComponentsWithDependencyPolicies();\n const variantPatterns = this.variants.raw();\n const variantPoliciesByPatterns = this._variantPatternsToDepPolicesDict(variantPatterns);\n const components = await this.workspace.list();\n const outdatedPkgs = await this.dependencyResolver.getOutdatedPkgsFromPolicies({\n rootDir: this.workspace.path,\n variantPoliciesByPatterns,\n componentPolicies,\n components,\n patterns: options.patterns,\n forceVersionBump: options.forceVersionBump,\n });\n if (outdatedPkgs == null) {\n this.logger.consoleFailure('No dependencies found that match the patterns');\n return null;\n }\n let outdatedPkgsToUpdate!: MergedOutdatedPkg[];\n if (options.all) {\n outdatedPkgsToUpdate = outdatedPkgs;\n } else {\n this.logger.off();\n outdatedPkgsToUpdate = await pickOutdatedPkgs(outdatedPkgs);\n this.logger.on();\n }\n if (outdatedPkgsToUpdate.length === 0) {\n this.logger.consoleSuccess('No outdated dependencies found');\n if (options.forceVersionBump === 'compatible') {\n this.logger.console(\n \"If you want to find new versions that don't match the current version ranges, retry with the --latest flag\"\n );\n }\n return null;\n }\n const { updatedVariants, updatedComponents } = this.dependencyResolver.applyUpdates(outdatedPkgsToUpdate, {\n variantPoliciesByPatterns,\n });\n await this._updateVariantsPolicies(variantPatterns, updatedVariants);\n await this._updateComponentsConfig(updatedComponents);\n await this.workspace._reloadConsumer();\n return this._installModules({ dedupe: true });\n }\n\n async addDuplicateComponentAndPackageIssue(components: Component[]) {\n const workspacePolicy = this.dependencyResolver.getWorkspacePolicy();\n components.forEach((component) => {\n if (component.state._consumer.removed) return;\n const pkgName = componentIdToPackageName(component.state._consumer);\n const found = workspacePolicy.find(pkgName);\n if (found) {\n component.state.issues.getOrCreate(IssuesClasses.DuplicateComponentAndPackage).data = found.dependencyId;\n }\n });\n }\n\n private async _getComponentsWithDependencyPolicies() {\n const allComponentIds = this.workspace.listIds();\n const componentPolicies = [] as Array<{ componentId: ComponentID; policy: any }>;\n (\n await Promise.all<ComponentConfigFile | undefined>(\n allComponentIds.map((componentId) => this.workspace.componentConfigFile(componentId))\n )\n ).forEach((componentConfigFile, index) => {\n if (!componentConfigFile) return;\n const depResolverConfig = componentConfigFile.aspects.get(DependencyResolverAspect.id);\n if (!depResolverConfig) return;\n const componentId = allComponentIds[index];\n componentPolicies.push({ componentId, policy: depResolverConfig.config.policy });\n });\n return componentPolicies;\n }\n\n private _variantPatternsToDepPolicesDict(variantPatterns: Patterns): Record<string, VariantPolicyConfigObject> {\n const variantPoliciesByPatterns: Record<string, VariantPolicyConfigObject> = {};\n for (const [variantPattern, extensions] of Object.entries(variantPatterns)) {\n if (extensions[DependencyResolverAspect.id]?.policy) {\n variantPoliciesByPatterns[variantPattern] = extensions[DependencyResolverAspect.id]?.policy;\n }\n }\n return variantPoliciesByPatterns;\n }\n\n private async _updateComponentsConfig(updatedComponents: UpdatedComponent[]) {\n if (updatedComponents.length === 0) return;\n await Promise.all(\n updatedComponents.map(({ componentId, config }) => {\n return this.workspace.addSpecificComponentConfig(componentId, DependencyResolverAspect.id, config, {\n shouldMergeWithExisting: true,\n shouldMergeWithPrevious: true,\n });\n })\n );\n await this.workspace.bitMap.write('update (dependencies)');\n }\n\n private async _updateVariantsPolicies(variantPatterns: Record<string, any>, updateVariantPolicies: string[]) {\n for (const variantPattern of updateVariantPolicies) {\n this.variants.setExtension(\n variantPattern,\n DependencyResolverAspect.id,\n variantPatterns[variantPattern][DependencyResolverAspect.id],\n { overrideExisting: true }\n );\n }\n await this.dependencyResolver.persistConfig('update dependencies');\n }\n\n /**\n * Uninstall the specified packages from dependencies.\n *\n * @param {string[]} the list of packages that should be removed from dependencies.\n */\n async uninstallDependencies(packages: string[]) {\n this.dependencyResolver.removeFromRootPolicy(packages);\n await this.dependencyResolver.persistConfig('uninstall dependencies');\n return this._installModules({ dedupe: true });\n }\n\n /**\n * This function returns all the locations of the external links that should be created inside node_modules.\n * This information may then be passed to the package manager, which will create the links on its own.\n */\n async calculateLinks(\n options: WorkspaceLinkOptions = {}\n ): Promise<{ linkResults: WorkspaceLinkResults; linkedRootDeps: Record<string, string> }> {\n await pMapSeries(this.preLinkSlot.values(), (fn) => fn(options)); // import objects if not disabled in options\n const compDirMap = await this.getComponentsDirectory([]);\n const linker = this.dependencyResolver.getLinker({\n rootDir: this.workspace.path,\n linkingOptions: options,\n });\n const { linkResults: res, linkedRootDeps } = await linker.calculateLinkedDeps(\n this.workspace.path,\n compDirMap,\n options\n );\n const workspaceRes = res as WorkspaceLinkResults;\n\n const legacyResults = await this.linkCodemods(compDirMap, options);\n workspaceRes.legacyLinkResults = legacyResults.linksResults;\n workspaceRes.legacyLinkCodemodResults = legacyResults.codemodResults;\n\n if (this.dependencyResolver.hasRootComponents() && options.linkToBitRoots) {\n await this._linkAllComponentsToBitRoots(compDirMap);\n }\n return { linkResults: res, linkedRootDeps };\n }\n\n async linkCodemods(compDirMap: ComponentMap<string>, options?: { rewire?: boolean }) {\n const bitIds = compDirMap.toArray().map(([component]) => component.id);\n return linkToNodeModulesWithCodemod(this.workspace, bitIds, options?.rewire ?? false);\n }\n\n async link(options: WorkspaceLinkOptions = {}): Promise<WorkspaceLinkResults> {\n const { linkResults, linkedRootDeps } = await this.calculateLinks(options);\n await createLinks(options.linkToDir ?? this.workspace.path, linkedRootDeps, {\n avoidHardLink: true,\n skipIfSymlinkValid: true,\n });\n return linkResults;\n }\n\n private async _linkAllComponentsToBitRoots(compDirMap: ComponentMap<string>) {\n const envs = await this._getAllUsedEnvIds();\n const apps = (await this.app.listAppsComponents()).map((component) => component.id);\n await Promise.all(\n [...envs, ...apps].map(async (id) => {\n const dir = await this.getRootComponentDirByRootId(this.workspace.rootComponentsPath, id);\n await fs.mkdirp(dir);\n })\n );\n await linkPkgsToRootComponents(\n {\n rootComponentsPath: this.workspace.rootComponentsPath,\n workspacePath: this.workspace.path,\n },\n compDirMap.components.map((component) => this.dependencyResolver.getPackageName(component))\n );\n }\n\n private async getRootComponentDirByRootId(rootComponentsPath: string, rootComponentId: ComponentID): Promise<string> {\n // Root directories for local envs and apps are created without their version number.\n // This is done in order to avoid changes to the lockfile after such components are tagged.\n const id = this.workspace.hasId(rootComponentId)\n ? rootComponentId.toStringWithoutVersion()\n : rootComponentId.toString();\n return getRootComponentDir(rootComponentsPath, id);\n }\n\n /**\n * Generate a filter to pass to the installer\n * This will filter deps which are come from remotes which defined in scope.json\n * those components comes from local remotes, usually doesn't have a package in a registry\n * so no reason to try to install them (it will fail)\n */\n private async generateFilterFnForDepsFromLocalRemote() {\n // TODO: once scope create a new API for this, replace it with the new one\n const remotes = await this.workspace.scope._legacyRemotes();\n const reg = await this.dependencyResolver.getRegistries();\n const packageScopes = Object.keys(reg.scopes);\n return (dependencyList: DependencyList): DependencyList => {\n const filtered = dependencyList.filter((dep) => {\n if (!(dep instanceof ComponentDependency)) {\n return true;\n }\n if (remotes.isHub(dep.componentId.scope)) {\n return true;\n }\n if (packageScopes.some((scope) => dep.packageName.startsWith(`@${scope}/`))) {\n return true;\n }\n return false;\n });\n return filtered;\n };\n }\n\n private async getComponentsDirectory(ids: ComponentID[]): Promise<ComponentMap<string>> {\n const components = ids.length\n ? await this.workspace.getMany(ids)\n : await this.workspace.list(undefined, { loadSeedersAsAspects: false });\n return ComponentMap.as<string>(components, (component) => this.workspace.componentDir(component.id));\n }\n\n private async onRootAspectAddedSubscriber(_aspectId: ComponentID, inWs: boolean): Promise<void> {\n if (!inWs) {\n await this.install();\n }\n }\n private async onAspectsResolveSubscriber(aspectComponents: Component[]): Promise<void> {\n let needLink = false;\n let needInstall = false;\n const promises = aspectComponents.map(async (aspectComponent) => {\n const aspectIdStr = aspectComponent.id.toString();\n if (this.visitedAspects.has(aspectIdStr)) return;\n\n this.visitedAspects.add(aspectIdStr);\n const packagePath = await this.workspace.getComponentPackagePath(aspectComponent);\n const exists = await pathExists(packagePath);\n if (!exists) {\n const inWs = await this.workspace.hasId(aspectComponent.id);\n if (inWs) {\n needLink = true;\n } else {\n needInstall = true;\n }\n }\n });\n await Promise.all(promises);\n if (needInstall) {\n await this.install();\n return;\n }\n if (needLink) {\n await this.link();\n }\n }\n\n async onComponentChange(component: Component) {\n const isEnv = this.envs.isEnv(component);\n if (isEnv) {\n await this.reloadEnvs([component.id]);\n }\n }\n\n static slots = [Slot.withType<PreLinkSlot>(), Slot.withType<PreInstallSlot>(), Slot.withType<PostInstallSlot>()];\n static dependencies = [\n DependencyResolverAspect,\n WorkspaceAspect,\n LoggerAspect,\n VariantsAspect,\n CLIAspect,\n CompilerAspect,\n IssuesAspect,\n EnvsAspect,\n ApplicationAspect,\n IpcEventsAspect,\n GeneratorAspect,\n WorkspaceConfigFilesAspect,\n AspectLoaderAspect,\n ];\n\n static runtime = MainRuntime;\n\n static async provider(\n [\n dependencyResolver,\n workspace,\n loggerExt,\n variants,\n cli,\n compiler,\n issues,\n envs,\n app,\n ipcEvents,\n generator,\n wsConfigFiles,\n aspectLoader,\n ]: [\n DependencyResolverMain,\n Workspace,\n LoggerMain,\n VariantsMain,\n CLIMain,\n CompilerMain,\n IssuesMain,\n EnvsMain,\n ApplicationMain,\n IpcEventsMain,\n GeneratorMain,\n WorkspaceConfigFilesMain,\n AspectLoaderMain,\n ],\n _,\n [preLinkSlot, preInstallSlot, postInstallSlot]: [PreLinkSlot, PreInstallSlot, PostInstallSlot],\n harmony: Harmony\n ) {\n const logger = loggerExt.createLogger(InstallAspect.id);\n ipcEvents.registerGotEventSlot(async (eventName) => {\n if (eventName !== 'onPostInstall') return;\n logger.debug('got onPostInstall event, clear workspace and all components cache');\n await workspace.clearCache();\n workspace.clearAllComponentsCache();\n await pMapSeries(postInstallSlot.values(), (fn) => fn());\n });\n const installExt = new InstallMain(\n dependencyResolver,\n logger,\n workspace,\n variants,\n compiler,\n envs,\n wsConfigFiles,\n aspectLoader,\n app,\n generator,\n preLinkSlot,\n preInstallSlot,\n postInstallSlot,\n ipcEvents,\n harmony\n );\n if (issues) {\n issues.registerAddComponentsIssues(installExt.addDuplicateComponentAndPackageIssue.bind(installExt));\n }\n generator.registerOnComponentCreate(installExt.onComponentCreate.bind(installExt));\n const commands: CommandList = [\n new InstallCmd(installExt, workspace, logger),\n new UninstallCmd(installExt),\n new UpdateCmd(installExt),\n new LinkCommand(installExt, workspace, logger),\n ];\n // For now do not automate installation during aspect resolving\n // workspace.registerOnAspectsResolve(installExt.onAspectsResolveSubscriber.bind(installExt));\n if (workspace) {\n workspace.registerOnRootAspectAdded(installExt.onRootAspectAddedSubscriber.bind(installExt));\n workspace.registerOnComponentChange(installExt.onComponentChange.bind(installExt));\n }\n cli.register(...commands);\n return installExt;\n }\n}\n\ntype ComponentsAndManifests = {\n componentDirectoryMap: ComponentMap<string>;\n manifests: Record<string, ProjectManifest>;\n};\n\nfunction hasComponentsFromWorkspaceInMissingDeps({\n componentDirectoryMap,\n manifests,\n}: ComponentsAndManifests): boolean {\n const missingDeps = new Set<string>(\n componentDirectoryMap\n .toArray()\n .map(([{ state }]) => {\n const issue = state.issues.getIssue(IssuesClasses.MissingPackagesDependenciesOnFs);\n if (!issue) return [];\n return issue.data.map((d) => d.missingPackages).flat();\n })\n .flat()\n );\n return Object.values(manifests).some(({ name }) => name && missingDeps.has(name));\n}\n\nInstallAspect.addRuntime(InstallMain);\n\nexport default InstallMain;\n\nfunction manifestsHash(manifests: Record<string, ProjectManifest>): string {\n // We don't care if the type of the dependency changes as it doesn't change the node_modules structure\n const depsByProjectPaths = mapValues(manifests, (manifest) => ({\n ...manifest.devDependencies,\n ...manifest.dependencies,\n }));\n return hash(depsByProjectPaths);\n}\n"],"mappings":";;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,SAAA;EAAA,MAAAH,IAAA,GAAAI,uBAAA,CAAAF,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,MAAA;EAAA,MAAAL,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAG,KAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,WAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,UAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,UAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,SAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,KAAA;EAAA,MAAAR,IAAA,GAAAE,OAAA;EAAAM,IAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAS,OAAA;EAAA,MAAAT,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAO,MAAA,YAAAA,CAAA;IAAA,OAAAT,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAU,YAAA;EAAA,MAAAV,IAAA,GAAAE,OAAA;EAAAQ,WAAA,YAAAA,CAAA;IAAA,OAAAV,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAW,QAAA;EAAA,MAAAX,IAA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