@teambit/install 1.0.338 → 1.0.339

Sign up to get free protection for your applications and to get access to all the features.
@@ -18,9 +18,9 @@ function _path() {
18
18
  };
19
19
  return data;
20
20
  }
21
- function _bitRoots() {
22
- const data = require("@teambit/bit-roots");
23
- _bitRoots = function () {
21
+ function _workspace() {
22
+ const data = require("@teambit/workspace.root-components");
23
+ _workspace = function () {
24
24
  return data;
25
25
  };
26
26
  return data;
@@ -46,9 +46,9 @@ function _chalk() {
46
46
  };
47
47
  return data;
48
48
  }
49
- function _workspace() {
49
+ function _workspace2() {
50
50
  const data = require("@teambit/workspace");
51
- _workspace = function () {
51
+ _workspace2 = function () {
52
52
  return data;
53
53
  };
54
54
  return data;
@@ -687,10 +687,9 @@ class InstallMain {
687
687
  }
688
688
  async _updateRootDirs(rootDirs) {
689
689
  try {
690
- const bitRootCompsDir = (0, _bitRoots().getBitRootsDir)(this.workspace.path);
691
- const existingDirs = await _fsExtra().default.readdir(bitRootCompsDir);
690
+ const existingDirs = await _fsExtra().default.readdir(this.workspace.rootComponentsPath);
692
691
  await Promise.all(existingDirs.map(async dirName => {
693
- const dirPath = _path().default.join(bitRootCompsDir, dirName);
692
+ const dirPath = _path().default.join(this.workspace.rootComponentsPath, dirName);
694
693
  if (!rootDirs.includes(dirPath)) {
695
694
  await _fsExtra().default.remove(dirPath);
696
695
  }
@@ -720,7 +719,7 @@ class InstallMain {
720
719
  async _getEnvManifests(workspaceDeps, workspaceDepsMeta) {
721
720
  const envs = await this._getAllUsedEnvIds();
722
721
  return Object.fromEntries(await Promise.all(envs.map(async envId => {
723
- return [await this.getRootComponentDirByRootId(this.workspace.path, envId), {
722
+ return [await this.getRootComponentDirByRootId(this.workspace.rootComponentsPath, envId), {
724
723
  dependencies: _objectSpread(_objectSpread(_objectSpread({}, await this._getEnvDependencies(envId)), workspaceDeps), await this._getEnvPackage(envId)),
725
724
  dependenciesMeta: workspaceDepsMeta,
726
725
  installConfig: {
@@ -768,7 +767,7 @@ class InstallMain {
768
767
  }) => name === appPkgName);
769
768
  if (!appManifest) return null;
770
769
  const envId = await this.envs.calculateEnvId(app);
771
- return [await this.getRootComponentDirByRootId(this.workspace.path, app.id), _objectSpread(_objectSpread({}, (0, _lodash().omit)(appManifest, ['name', 'version'])), {}, {
770
+ return [await this.getRootComponentDirByRootId(this.workspace.rootComponentsPath, app.id), _objectSpread(_objectSpread({}, (0, _lodash().omit)(appManifest, ['name', 'version'])), {}, {
772
771
  dependencies: _objectSpread(_objectSpread(_objectSpread({}, await this._getEnvDependencies(envId)), appManifest.dependencies), workspaceDeps),
773
772
  dependenciesMeta: _objectSpread(_objectSpread({}, appManifest.dependenciesMeta), workspaceDepsMeta),
774
773
  installConfig: {
@@ -953,16 +952,19 @@ class InstallMain {
953
952
  const envs = await this._getAllUsedEnvIds();
954
953
  const apps = (await this.app.listAppsComponents()).map(component => component.id);
955
954
  await Promise.all([...envs, ...apps].map(async id => {
956
- const dir = await this.getRootComponentDirByRootId(this.workspace.path, id);
955
+ const dir = await this.getRootComponentDirByRootId(this.workspace.rootComponentsPath, id);
957
956
  await _fsExtra().default.mkdirp(dir);
958
957
  }));
959
- await (0, _bitRoots().linkPkgsToBitRoots)(this.workspace.path, compDirMap.components.map(component => this.dependencyResolver.getPackageName(component)));
958
+ await (0, _workspace().linkPkgsToRootComponents)({
959
+ rootComponentsPath: this.workspace.rootComponentsPath,
960
+ workspacePath: this.workspace.path
961
+ }, compDirMap.components.map(component => this.dependencyResolver.getPackageName(component)));
960
962
  }
961
- async getRootComponentDirByRootId(workspacePath, rootComponentId) {
963
+ async getRootComponentDirByRootId(rootComponentsPath, rootComponentId) {
962
964
  // Root directories for local envs and apps are created without their version number.
963
965
  // This is done in order to avoid changes to the lockfile after such components are tagged.
964
- const id = (await this.workspace.hasId(rootComponentId)) ? rootComponentId.toStringWithoutVersion() : rootComponentId.toString();
965
- return (0, _bitRoots().getRootComponentDir)(workspacePath, id);
966
+ const id = this.workspace.hasId(rootComponentId) ? rootComponentId.toStringWithoutVersion() : rootComponentId.toString();
967
+ return (0, _workspace().getRootComponentDir)(rootComponentsPath, id);
966
968
  }
967
969
 
968
970
  /**
@@ -1056,7 +1058,7 @@ class InstallMain {
1056
1058
  }
1057
1059
  exports.InstallMain = InstallMain;
1058
1060
  _defineProperty(InstallMain, "slots", [_harmony().Slot.withType(), _harmony().Slot.withType(), _harmony().Slot.withType()]);
1059
- _defineProperty(InstallMain, "dependencies", [_dependencyResolver().DependencyResolverAspect, _workspace().WorkspaceAspect, _logger().LoggerAspect, _variants().VariantsAspect, _cli().CLIAspect, _compiler().CompilerAspect, _issues().IssuesAspect, _envs().EnvsAspect, _application().ApplicationAspect, _ipcEvents().IpcEventsAspect, _generator().GeneratorAspect, _workspaceConfigFiles().WorkspaceConfigFilesAspect]);
1061
+ _defineProperty(InstallMain, "dependencies", [_dependencyResolver().DependencyResolverAspect, _workspace2().WorkspaceAspect, _logger().LoggerAspect, _variants().VariantsAspect, _cli().CLIAspect, _compiler().CompilerAspect, _issues().IssuesAspect, _envs().EnvsAspect, _application().ApplicationAspect, _ipcEvents().IpcEventsAspect, _generator().GeneratorAspect, _workspaceConfigFiles().WorkspaceConfigFilesAspect]);
1060
1062
  _defineProperty(InstallMain, "runtime", _cli().MainRuntime);
1061
1063
  function hasComponentsFromWorkspaceInMissingDeps({
1062
1064
  componentDirectoryMap,
@@ -1 +1 @@
1
- {"version":3,"names":["_fsExtra","data","_interopRequireWildcard","require","_path","_interopRequireDefault","_bitRoots","_compiler","_cli","_chalk","_workspace","_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","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","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","app","generator","preLinkSlot","preInstallSlot","postInstallSlot","ipcEvents","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","skipPrune","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","shouldClearCacheOnInstall","compile","compileStartTime","process","hrtime","compileOutputMessage","setStatusLine","clearCache","skipClearFailedToLoadEnvs","compileOnWorkspace","initiator","CompilationInitiator","Install","consoleSuccess","tryWriteConfigFiles","recurringInstall","oldNonLoadedEnvs","getOldNonLoadedEnvs","add","manifestsHash","_getComponentsManifests","pruneModules","getFailedToLoadEnvs","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","compact","envIdStr","isCoreEnv","undefined","parsedId","resolveComponentId","inWs","hasId","comps","importAndGetMany","idWithVersion","resolveEnvIdWithPotentialVersionForConfig","split","getPackageName","env","_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","bitRootCompsDir","getBitRootsDir","existingDirs","fs","readdir","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","aspects","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","linkPkgsToBitRoots","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","pathExists","provider","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","MainRuntime","missingDeps","issue","addRuntime","_default","depsByProjectPaths","mapValues","hash"],"sources":["install.main.runtime.ts"],"sourcesContent":["import fs, { pathExists } from 'fs-extra';\nimport path from 'path';\nimport { getRootComponentDir, getBitRootsDir, linkPkgsToBitRoots } from '@teambit/bit-roots';\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 { 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';\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 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 /**\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 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 // 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 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 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 bitRootCompsDir = getBitRootsDir(this.workspace.path);\n const existingDirs = await fs.readdir(bitRootCompsDir);\n await Promise.all(\n existingDirs.map(async (dirName) => {\n const dirPath = path.join(bitRootCompsDir, 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.path, 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.path, 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.path, id);\n await fs.mkdirp(dir);\n })\n );\n await linkPkgsToBitRoots(\n this.workspace.path,\n compDirMap.components.map((component) => this.dependencyResolver.getPackageName(component))\n );\n }\n\n private async getRootComponentDirByRootId(workspacePath: 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 = (await this.workspace.hasId(rootComponentId))\n ? rootComponentId.toStringWithoutVersion()\n : rootComponentId.toString();\n return getRootComponentDir(workspacePath, 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 ];\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 ]: [\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 ],\n _,\n [preLinkSlot, preInstallSlot, postInstallSlot]: [PreLinkSlot, PreInstallSlot, PostInstallSlot]\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 app,\n generator,\n preLinkSlot,\n preInstallSlot,\n postInstallSlot,\n ipcEvents\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,uBAAA,CAAAC,OAAA;EAAAH,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,MAAA;EAAA,MAAAH,IAAA,GAAAI,sBAAA,CAAAF,OAAA;EAA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AAC,CAAC;IAAE7Q;EAAK,CAAC,KAAKA,IAAI,IAAIoU,WAAW,CAACrd,GAAG,CAACiJ,IAAI,CAAC,CAAC;AACnF;AAEAuS,wBAAa,CAAC+B,UAAU,CAACjb,WAAW,CAAC;AAAC,IAAAkb,QAAA,GAAAlB,OAAA,CAAA3c,OAAA,GAEvB2C,WAAW;AAE1B,SAASwK,aAAaA,CAACxB,SAA0C,EAAU;EACzE;EACA,MAAMmS,kBAAkB,GAAG,IAAAC,mBAAS,EAACpS,SAAS,EAAGiC,QAAQ,IAAAlM,aAAA,CAAAA,aAAA,KACpDkM,QAAQ,CAACF,eAAe,GACxBE,QAAQ,CAACnH,YAAY,CACxB,CAAC;EACH,OAAO,IAAAuX,qBAAI,EAACF,kBAAkB,CAAC;AACjC","ignoreList":[]}
1
+ {"version":3,"names":["_fsExtra","data","_interopRequireWildcard","require","_path","_interopRequireDefault","_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","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","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","app","generator","preLinkSlot","preInstallSlot","postInstallSlot","ipcEvents","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","skipPrune","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","shouldClearCacheOnInstall","compile","compileStartTime","process","hrtime","compileOutputMessage","setStatusLine","clearCache","skipClearFailedToLoadEnvs","compileOnWorkspace","initiator","CompilationInitiator","Install","consoleSuccess","tryWriteConfigFiles","recurringInstall","oldNonLoadedEnvs","getOldNonLoadedEnvs","add","manifestsHash","_getComponentsManifests","pruneModules","getFailedToLoadEnvs","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","compact","envIdStr","isCoreEnv","undefined","parsedId","resolveComponentId","inWs","hasId","comps","importAndGetMany","idWithVersion","resolveEnvIdWithPotentialVersionForConfig","split","getPackageName","env","_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","aspects","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","pathExists","provider","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","MainRuntime","missingDeps","issue","addRuntime","_default","depsByProjectPaths","mapValues","hash"],"sources":["install.main.runtime.ts"],"sourcesContent":["import 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 { 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';\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 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 /**\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 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 // 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 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 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 ];\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 ]: [\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 ],\n _,\n [preLinkSlot, preInstallSlot, postInstallSlot]: [PreLinkSlot, PreInstallSlot, PostInstallSlot]\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 app,\n generator,\n preLinkSlot,\n preInstallSlot,\n postInstallSlot,\n ipcEvents\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,uBAAA,CAAAC,OAAA;EAAAH,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,MAAA;EAAA,MAAAH,IAAA,GAAAI,sBAAA,CAAAF,OAAA;EAAAC,KAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,WAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,UAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,UAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,SAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,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0C,EAAU;EACzE;EACA,MAAMkS,kBAAkB,GAAG,IAAAC,mBAAS,EAACnS,SAAS,EAAGiC,QAAQ,IAAAlM,aAAA,CAAAA,aAAA,KACpDkM,QAAQ,CAACF,eAAe,GACxBE,QAAQ,CAACnH,YAAY,CACxB,CAAC;EACH,OAAO,IAAAsX,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.338",
3
+ "version": "1.0.339",
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.338"
9
+ "version": "1.0.339"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "2.4.2",
@@ -20,26 +20,26 @@
20
20
  "enquirer": "2.3.6",
21
21
  "table": "5.4.6",
22
22
  "@teambit/harmony": "0.4.6",
23
- "@teambit/bit-roots": "0.0.133",
23
+ "@teambit/workspace.root-components": "1.0.0",
24
24
  "@teambit/bit-error": "0.0.404",
25
- "@teambit/cli": "0.0.915",
26
- "@teambit/dependency-resolver": "1.0.338",
27
- "@teambit/logger": "0.0.1008",
28
- "@teambit/workspace": "1.0.338",
29
- "@teambit/application": "1.0.338",
30
- "@teambit/compiler": "1.0.338",
25
+ "@teambit/cli": "0.0.916",
26
+ "@teambit/dependency-resolver": "1.0.339",
27
+ "@teambit/logger": "0.0.1009",
28
+ "@teambit/workspace": "1.0.339",
29
+ "@teambit/application": "1.0.339",
30
+ "@teambit/compiler": "1.0.339",
31
31
  "@teambit/component-issues": "0.0.150",
32
32
  "@teambit/component-package-version": "0.0.434",
33
- "@teambit/component": "1.0.338",
33
+ "@teambit/component": "1.0.339",
34
34
  "@teambit/dependencies.fs.linked-dependencies": "0.0.9",
35
- "@teambit/envs": "1.0.338",
36
- "@teambit/generator": "1.0.339",
37
- "@teambit/ipc-events": "1.0.338",
38
- "@teambit/issues": "1.0.338",
35
+ "@teambit/envs": "1.0.339",
36
+ "@teambit/generator": "1.0.340",
37
+ "@teambit/ipc-events": "1.0.339",
38
+ "@teambit/issues": "1.0.339",
39
39
  "@teambit/pkg.modules.component-package-name": "0.0.3",
40
- "@teambit/variants": "0.0.1182",
41
- "@teambit/workspace-config-files": "1.0.338",
42
- "@teambit/workspace.modules.node-modules-linker": "0.0.180",
40
+ "@teambit/variants": "0.0.1183",
41
+ "@teambit/workspace-config-files": "1.0.339",
42
+ "@teambit/workspace.modules.node-modules-linker": "0.0.181",
43
43
  "@teambit/toolbox.time.time-format": "0.0.496"
44
44
  },
45
45
  "devDependencies": {