@teambit/install 1.0.396 → 1.0.397

Sign up to get free protection for your applications and to get access to all the features.
@@ -369,7 +369,8 @@ class InstallMain {
369
369
  await this.install(packages, {
370
370
  addMissingDeps: installMissing,
371
371
  skipIfExisting: true,
372
- writeConfigFiles: false
372
+ writeConfigFiles: false,
373
+ optimizeReportForNonTerminal: !process.stdout.isTTY
373
374
  // skipPrune: true,
374
375
  });
375
376
  }
@@ -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","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","installOptions","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[]) {\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 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 (\n await this.app.listAppsComponents()\n ).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,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,WAAW,CAAClgB,GAAG,CAACkJ,IAAI,CAAC,CAAC;AACnF;AAEAmV,wBAAa,CAAC+B,UAAU,CAAC9d,WAAW,CAAC;AAAC,IAAA+d,QAAA,GAAAlB,OAAA,CAAApf,OAAA,GAEvBuC,WAAW;AAE1B,SAAS0K,aAAaA,CAACzB,SAA0C,EAAU;EACzE;EACA,MAAM+U,kBAAkB,GAAG,IAAAC,mBAAS,EAAChV,SAAS,EAAGuF,QAAQ,IAAAzP,aAAA,CAAAA,aAAA,KACpDyP,QAAQ,CAACF,eAAe,GACxBE,QAAQ,CAACxK,YAAY,CACxB,CAAC;EACH,OAAO,IAAAka,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","runInstall","installMissing","ids","generateResult","dependencies","concat","installMissingDependencies","isApp","isEnv","id","nonLoadedEnvs","clearComponentCache","component","envId","calculateEnvId","toString","isLoaded","isEnvRegistered","addMissingDeps","skipIfExisting","writeConfigFiles","optimizeReportForNonTerminal","process","stdout","isTTY","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","lockfileOnly","prevManifests","linkedDependencies","installCycle","hasMissingLocalComponents","forceTeambitHarmonyLink","hasHarmonyInRootPolicy","hasComponentsFromWorkspaceInMissingDeps","dependenciesChanged","installComponents","manifests","componentDirectoryMap","installTeambitBit","cacheCleared","linkCodemods","oldNonLoadedEnvs","setOldNonLoadedEnvs","reloadMovedEnvs","reloadNonLoadedEnvs","shouldClearCacheOnInstall","compile","compileStartTime","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","installOptions","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[]) {\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 addMissingDeps: installMissing,\n skipIfExisting: true,\n writeConfigFiles: false,\n optimizeReportForNonTerminal: !process.stdout.isTTY,\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 (\n await this.app.listAppsComponents()\n ).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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K,EAAE,OAAO,EAAE;IACrB,OAAOA,KAAK,CAACljB,IAAI,CAAC+H,GAAG,CAAEuO,CAAC,IAAKA,CAAC,CAACC,eAAe,CAAC,CAACC,IAAI,CAAC,CAAC;EACxD,CAAC,CAAC,CACDA,IAAI,CAAC,CACV,CAAC;EACD,OAAOtT,MAAM,CAACkF,MAAM,CAACmG,SAAS,CAAC,CAACqR,IAAI,CAAC,CAAC;IAAEzT;EAAK,CAAC,KAAKA,IAAI,IAAI8W,WAAW,CAACpgB,GAAG,CAACsJ,IAAI,CAAC,CAAC;AACnF;AAEAiV,wBAAa,CAAC+B,UAAU,CAAChe,WAAW,CAAC;AAAC,IAAAie,QAAA,GAAAlB,OAAA,CAAAtf,OAAA,GAEvBuC,WAAW;AAE1B,SAAS4K,aAAaA,CAACxB,SAA0C,EAAU;EACzE;EACA,MAAM8U,kBAAkB,GAAG,IAAAC,mBAAS,EAAC/U,SAAS,EAAGsF,QAAQ,IAAA3P,aAAA,CAAAA,aAAA,KACpD2P,QAAQ,CAACF,eAAe,GACxBE,QAAQ,CAAC1K,YAAY,CACxB,CAAC;EACH,OAAO,IAAAoa,qBAAI,EAACF,kBAAkB,CAAC;AACjC","ignoreList":[]}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/install",
3
- "version": "1.0.396",
3
+ "version": "1.0.397",
4
4
  "homepage": "https://bit.cloud/teambit/workspace/install",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.workspace",
8
8
  "name": "install",
9
- "version": "1.0.396"
9
+ "version": "1.0.397"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "2.4.2",
@@ -23,24 +23,24 @@
23
23
  "@teambit/harmony": "0.4.6",
24
24
  "@teambit/workspace.root-components": "1.0.0",
25
25
  "@teambit/bit-error": "0.0.404",
26
- "@teambit/cli": "0.0.973",
27
- "@teambit/dependency-resolver": "1.0.396",
28
- "@teambit/logger": "0.0.1066",
29
- "@teambit/workspace": "1.0.396",
30
- "@teambit/application": "1.0.396",
31
- "@teambit/aspect-loader": "1.0.396",
32
- "@teambit/compiler": "1.0.396",
26
+ "@teambit/cli": "0.0.974",
27
+ "@teambit/dependency-resolver": "1.0.397",
28
+ "@teambit/logger": "0.0.1067",
29
+ "@teambit/workspace": "1.0.397",
30
+ "@teambit/application": "1.0.397",
31
+ "@teambit/aspect-loader": "1.0.397",
32
+ "@teambit/compiler": "1.0.397",
33
33
  "@teambit/component-issues": "0.0.150",
34
34
  "@teambit/component-package-version": "0.0.434",
35
- "@teambit/component": "1.0.396",
35
+ "@teambit/component": "1.0.397",
36
36
  "@teambit/dependencies.fs.linked-dependencies": "0.0.9",
37
- "@teambit/envs": "1.0.396",
38
- "@teambit/generator": "1.0.397",
39
- "@teambit/ipc-events": "1.0.396",
40
- "@teambit/issues": "1.0.396",
37
+ "@teambit/envs": "1.0.397",
38
+ "@teambit/generator": "1.0.398",
39
+ "@teambit/ipc-events": "1.0.397",
40
+ "@teambit/issues": "1.0.397",
41
41
  "@teambit/pkg.modules.component-package-name": "0.0.3",
42
- "@teambit/variants": "0.0.1240",
43
- "@teambit/workspace-config-files": "1.0.396",
42
+ "@teambit/variants": "0.0.1241",
43
+ "@teambit/workspace-config-files": "1.0.397",
44
44
  "@teambit/workspace.modules.node-modules-linker": "0.0.198",
45
45
  "@teambit/toolbox.time.time-format": "0.0.496"
46
46
  },