@teambit/install 1.0.384 → 1.0.386

Sign up to get free protection for your applications and to get access to all the features.
@@ -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","_objectHash","_exceptions","_install","_pickOutdatedPkgs","_link","_install2","_uninstall","_update","_aspectLoader","_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","reloadMovedEnvs","shouldClearCacheOnInstall","compile","compileStartTime","process","hrtime","compileOutputMessage","setStatusLine","clearCache","skipClearFailedToLoadEnvs","compileOnWorkspace","initiator","CompilationInitiator","Install","consoleSuccess","tryWriteConfigFiles","recurringInstall","oldNonLoadedEnvs","getOldNonLoadedEnvs","add","manifestsHash","_getComponentsManifests","skipPrune","pruneModules","getFailedToLoadEnvs","allEnvs","getAllRegisteredEnvs","movedEnvs","pFilter","env","__path","regularPathExists","pathExists","resolvedPathExists","__resolvedPath","idsToLoad","componentIdsToLoad","ComponentID","fromString","aspects","resolveAspects","undefined","requestedOnly","excludeCore","throwOnError","loadedPlugins","compact","aspectDef","localPath","aspectPath","plugins","getPlugins","load","MainRuntime","plugin","runtime","getRuntime","provider","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","hasId","comps","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","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","toStringWithoutVersion","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","scope","_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 } 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 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';\nimport { AspectLoaderAspect, AspectLoaderMain } from '@teambit/aspect-loader';\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\nexport class InstallMain {\n private visitedAspects: Set<string> = new Set();\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 await this.reloadMovedEnvs();\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 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 const oldNonLoadedEnvs = this.getOldNonLoadedEnvs();\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 envPlugin = this.envs.getEnvPlugin();\n\n if (idsToLoad.length && this.workspace) {\n const componentIdsToLoad = idsToLoad.map((id) => ComponentID.fromString(id));\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 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 return movedEnvs;\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 /**\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 const nonLoadedEnvs = this.envs.getFailedToLoadEnvs();\n const envsWithoutManifest = Array.from(this.dependencyResolver.envsWithoutManifest);\n const oldNonLoadedEnvs = intersection(nonLoadedEnvs, envsWithoutManifest);\n return 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,MAAAH,IAAA,GAAAI,uBAAA,CAAAF,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,MAAA;EAAA,MAAAL,IAAA,GAAAC,sBAAA,CAAAC,OAAA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C9c,WAAW,CAAC;AAAC,IAAA+c,QAAA,GAAAlB,OAAA,CAAApe,OAAA,GAEvBuC,WAAW;AAE1B,SAAS0K,aAAaA,CAACzB,SAA0C,EAAU;EACzE;EACA,MAAM+T,kBAAkB,GAAG,IAAAC,mBAAS,EAAChU,SAAS,EAAGoE,QAAQ,IAAAtO,aAAA,CAAAA,aAAA,KACpDsO,QAAQ,CAACF,eAAe,GACxBE,QAAQ,CAACrJ,YAAY,CACxB,CAAC;EACH,OAAO,IAAAkZ,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","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","grouped","groupBy","aspectDef","toStringWithoutVersion","reloadAspects","true","otherEnvs","false","loadedPlugins","compact","localPath","aspectPath","plugins","getPlugins","load","MainRuntime","plugin","runtime","getRuntime","provider","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","hasId","comps","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","scope","_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\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 // 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 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 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,MAAAH,IAAA,GAAAI,uBAAA,CAAAF,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,MAAA;EAAA,MAAAL,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAG,KAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,WAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,UAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,O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,CAAAA,aAAA,KACpD+O,QAAQ,CAACF,eAAe,GACxBE,QAAQ,CAAC9J,YAAY,CACxB,CAAC;EACH,OAAO,IAAA2Z,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.384",
3
+ "version": "1.0.386",
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.384"
9
+ "version": "1.0.386"
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.961",
27
- "@teambit/dependency-resolver": "1.0.384",
28
- "@teambit/logger": "0.0.1054",
29
- "@teambit/workspace": "1.0.384",
30
- "@teambit/application": "1.0.384",
31
- "@teambit/aspect-loader": "1.0.384",
32
- "@teambit/compiler": "1.0.384",
26
+ "@teambit/cli": "0.0.963",
27
+ "@teambit/dependency-resolver": "1.0.386",
28
+ "@teambit/logger": "0.0.1056",
29
+ "@teambit/workspace": "1.0.386",
30
+ "@teambit/application": "1.0.386",
31
+ "@teambit/aspect-loader": "1.0.386",
32
+ "@teambit/compiler": "1.0.386",
33
33
  "@teambit/component-issues": "0.0.150",
34
34
  "@teambit/component-package-version": "0.0.434",
35
- "@teambit/component": "1.0.384",
35
+ "@teambit/component": "1.0.386",
36
36
  "@teambit/dependencies.fs.linked-dependencies": "0.0.9",
37
- "@teambit/envs": "1.0.384",
38
- "@teambit/generator": "1.0.385",
39
- "@teambit/ipc-events": "1.0.384",
40
- "@teambit/issues": "1.0.384",
37
+ "@teambit/envs": "1.0.386",
38
+ "@teambit/generator": "1.0.387",
39
+ "@teambit/ipc-events": "1.0.386",
40
+ "@teambit/issues": "1.0.386",
41
41
  "@teambit/pkg.modules.component-package-name": "0.0.3",
42
- "@teambit/variants": "0.0.1228",
43
- "@teambit/workspace-config-files": "1.0.384",
42
+ "@teambit/variants": "0.0.1230",
43
+ "@teambit/workspace-config-files": "1.0.386",
44
44
  "@teambit/workspace.modules.node-modules-linker": "0.0.195",
45
45
  "@teambit/toolbox.time.time-format": "0.0.496"
46
46
  },