@teambit/dependency-resolver 1.0.484 → 1.0.486
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/artifacts/__bit_junit.xml +29 -29
- package/artifacts/preview/teambit_dependencies_dependency_resolver-preview.js +1 -1
- package/artifacts/schema.json +1 -1
- package/dependencies/component-dependency/component-dependency-factory.ts +2 -2
- package/dist/dependencies/component-dependency/component-dependency-factory.js.map +1 -1
- package/dist/dependency-resolver.main.runtime.d.ts +1 -1
- package/dist/dependency-resolver.main.runtime.js +4 -4
- package/dist/dependency-resolver.main.runtime.js.map +1 -1
- package/dist/{preview-1733282408194.js → preview-1733541556857.js} +2 -2
- package/package.json +18 -17
|
@@ -1,55 +1,55 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<testsuites tests="50" failures="0" errors="0" skipped="0">
|
|
3
|
-
<testsuite name="teambit.dependencies/dependency-resolver@1.0.
|
|
4
|
-
<testcase classname="update-dependency-version.spec.js" name="should pick version from root policy, when no variation policy is present" time="0.
|
|
5
|
-
<testcase classname="validate-env-policy.spec.js" name="should throw an exception if peer supportedRange is empty" time="0.
|
|
6
|
-
<testcase classname="validate-env-policy.spec.js" name="should throw an exception if peer supportedRange is null"/>
|
|
3
|
+
<testsuite name="teambit.dependencies/dependency-resolver@1.0.486" timestamp="2024-12-07T03:54:50.363Z" tests="50" failures="0" errors="0" skipped="0">
|
|
4
|
+
<testcase classname="update-dependency-version.spec.js" name="should pick version from root policy, when no variation policy is present" time="0.031"/>
|
|
5
|
+
<testcase classname="validate-env-policy.spec.js" name="should throw an exception if peer supportedRange is empty" time="0.073"/>
|
|
6
|
+
<testcase classname="validate-env-policy.spec.js" name="should throw an exception if peer supportedRange is null" time="0.001"/>
|
|
7
7
|
<testcase classname="validate-env-policy.spec.js" name="should throw an exception if peer version is empty" time="0.001"/>
|
|
8
8
|
<testcase classname="validate-env-policy.spec.js" name="should throw an exception if peer version is null"/>
|
|
9
|
-
<testcase classname="apply-updates.spec.js" name="should apply updates on root dependencies" time="0.
|
|
9
|
+
<testcase classname="apply-updates.spec.js" name="should apply updates on root dependencies" time="0.065"/>
|
|
10
10
|
<testcase classname="apply-updates.spec.js" name="should apply updates on variant dependencies" time="0.001"/>
|
|
11
|
-
<testcase classname="apply-updates.spec.js" name="should apply updates on component dependencies" time="0.
|
|
12
|
-
<testcase classname="get-all-policy-pkgs.spec.js" name="should read the version from a version object" time="0.
|
|
13
|
-
<testcase classname="get-all-policy-pkgs.spec.js" name="should deduplicate dependencies that are present in root policies" time="0.
|
|
14
|
-
<testcase classname="hoist-dependencies.spec.js" name="the root manifest should have the preserved version" time="0.
|
|
11
|
+
<testcase classname="apply-updates.spec.js" name="should apply updates on component dependencies" time="0.173"/>
|
|
12
|
+
<testcase classname="get-all-policy-pkgs.spec.js" name="should read the version from a version object" time="0.206"/>
|
|
13
|
+
<testcase classname="get-all-policy-pkgs.spec.js" name="should deduplicate dependencies that are present in root policies" time="0.116"/>
|
|
14
|
+
<testcase classname="hoist-dependencies.spec.js" name="the root manifest should have the preserved version" time="0.148"/>
|
|
15
15
|
<testcase classname="hoist-dependencies.spec.js" name="the component dependencies which intersects with the preserved should be empty" time="0.002"/>
|
|
16
|
-
<testcase classname="hoist-dependencies.spec.js" name="the component dependencies which not intersects with the preserved to have a proper version" time="0.
|
|
16
|
+
<testcase classname="hoist-dependencies.spec.js" name="the component dependencies which not intersects with the preserved to have a proper version" time="0.001"/>
|
|
17
17
|
<testcase classname="hoist-dependencies.spec.js" name="the component dependencies should be empty" time="0.001"/>
|
|
18
18
|
<testcase classname="hoist-dependencies.spec.js" name="should hoist the dependency to the root" time="0.001"/>
|
|
19
19
|
<testcase classname="hoist-dependencies.spec.js" name="the component dependencies should be empty"/>
|
|
20
|
-
<testcase classname="hoist-dependencies.spec.js" name="should hoist the dependency to the root"/>
|
|
20
|
+
<testcase classname="hoist-dependencies.spec.js" name="should hoist the dependency to the root" time="0.001"/>
|
|
21
21
|
<testcase classname="hoist-dependencies.spec.js" name="the component dependencies should be empty"/>
|
|
22
22
|
<testcase classname="hoist-dependencies.spec.js" name="should not hoist the dependency to the root" time="0.001"/>
|
|
23
|
-
<testcase classname="hoist-dependencies.spec.js" name="should have the peers in each component" time="0.
|
|
23
|
+
<testcase classname="hoist-dependencies.spec.js" name="should have the peers in each component" time="0.022"/>
|
|
24
24
|
<testcase classname="hoist-dependencies.spec.js" name="should not hoist the dependency to the root"/>
|
|
25
|
-
<testcase classname="hoist-dependencies.spec.js" name="should not report about peer conflicts"/>
|
|
25
|
+
<testcase classname="hoist-dependencies.spec.js" name="should not report about peer conflicts" time="0.001"/>
|
|
26
26
|
<testcase classname="hoist-dependencies.spec.js" name="should have the peers in each component" time="0.001"/>
|
|
27
27
|
<testcase classname="hoist-dependencies.spec.js" name="should not hoist the dependency to the root" time="0.001"/>
|
|
28
28
|
<testcase classname="hoist-dependencies.spec.js" name="should report about peer conflicts" time="0.001"/>
|
|
29
|
-
<testcase classname="hoist-dependencies.spec.js" name="should hoist the most common version to the root" time="0.
|
|
29
|
+
<testcase classname="hoist-dependencies.spec.js" name="should hoist the most common version to the root" time="0.045"/>
|
|
30
30
|
<testcase classname="hoist-dependencies.spec.js" name="should not put the most common version in the components that has it" time="0.001"/>
|
|
31
|
-
<testcase classname="hoist-dependencies.spec.js" name="should put other versions in the components"/>
|
|
32
|
-
<testcase classname="hoist-dependencies.spec.js" name="should hoist the best range to the root" time="0.
|
|
33
|
-
<testcase classname="hoist-dependencies.spec.js" name="should not put the dependency in components that matches the best range" time="0.
|
|
34
|
-
<testcase classname="hoist-dependencies.spec.js" name="should put other ranges in the components" time="0.
|
|
35
|
-
<testcase classname="hoist-dependencies.spec.js" name="should hoist the best version to the root" time="0.
|
|
31
|
+
<testcase classname="hoist-dependencies.spec.js" name="should put other versions in the components" time="0.001"/>
|
|
32
|
+
<testcase classname="hoist-dependencies.spec.js" name="should hoist the best range to the root" time="0.006"/>
|
|
33
|
+
<testcase classname="hoist-dependencies.spec.js" name="should not put the dependency in components that matches the best range" time="0.003"/>
|
|
34
|
+
<testcase classname="hoist-dependencies.spec.js" name="should put other ranges in the components" time="0.003"/>
|
|
35
|
+
<testcase classname="hoist-dependencies.spec.js" name="should hoist the best version to the root" time="0.001"/>
|
|
36
36
|
<testcase classname="hoist-dependencies.spec.js" name="should not put the dependency in components that matches the best version" time="0.001"/>
|
|
37
37
|
<testcase classname="hoist-dependencies.spec.js" name="should put other ranges in the components" time="0.001"/>
|
|
38
38
|
<testcase classname="hoist-dependencies.spec.js" name="should hoist the best range to the root" time="0.002"/>
|
|
39
|
-
<testcase classname="hoist-dependencies.spec.js" name="should not put the dependency in components that matches the best range" time="0.
|
|
39
|
+
<testcase classname="hoist-dependencies.spec.js" name="should not put the dependency in components that matches the best range" time="0.007"/>
|
|
40
40
|
<testcase classname="hoist-dependencies.spec.js" name="should put other ranges in the components" time="0.002"/>
|
|
41
|
-
<testcase classname="hoist-dependencies.spec.js" name="should hoist the best range to the root" time="0.
|
|
42
|
-
<testcase classname="hoist-dependencies.spec.js" name="should not put the dependency in components that matches the best range or the combined version" time="0.
|
|
43
|
-
<testcase classname="hoist-dependencies.spec.js" name="should put other ranges in the components" time="0.
|
|
44
|
-
<testcase classname="dependency-resolver.main.runtime.spec.js" name="should return settings from global config" time="0.
|
|
45
|
-
<testcase classname="dependency-resolver.main.runtime.spec.js" name="should return settings from package manager config" time="0.
|
|
41
|
+
<testcase classname="hoist-dependencies.spec.js" name="should hoist the best range to the root" time="0.055"/>
|
|
42
|
+
<testcase classname="hoist-dependencies.spec.js" name="should not put the dependency in components that matches the best range or the combined version" time="0.047"/>
|
|
43
|
+
<testcase classname="hoist-dependencies.spec.js" name="should put other ranges in the components" time="0.03"/>
|
|
44
|
+
<testcase classname="dependency-resolver.main.runtime.spec.js" name="should return settings from global config" time="0.009"/>
|
|
45
|
+
<testcase classname="dependency-resolver.main.runtime.spec.js" name="should return settings from package manager config" time="0.001"/>
|
|
46
46
|
<testcase classname="dependency-resolver.main.runtime.spec.js" name="should return settings from aspect config" time="0.001"/>
|
|
47
47
|
<testcase classname="dependency-resolver.main.runtime.spec.js" name="should merge settings from global config, package manager config, and aspect config" time="0.001"/>
|
|
48
|
-
<testcase classname="dependency-resolver.main.runtime.spec.js" name="should read cafile when it is returned by the global config" time="0.
|
|
49
|
-
<testcase classname="dependency-resolver.main.runtime.spec.js" name="should return outdated dependencies" time="0.
|
|
48
|
+
<testcase classname="dependency-resolver.main.runtime.spec.js" name="should read cafile when it is returned by the global config" time="0.008"/>
|
|
49
|
+
<testcase classname="dependency-resolver.main.runtime.spec.js" name="should return outdated dependencies" time="0.095"/>
|
|
50
50
|
<testcase classname="dependency-resolver.main.runtime.spec.js" name="should return outdated dependencies when forcedVersionBump is set to patch" time="0.001"/>
|
|
51
|
-
<testcase classname="dependency-resolver.main.runtime.spec.js" name="should return outdated dependencies when forcedVersionBump is set to minor" time="0.
|
|
51
|
+
<testcase classname="dependency-resolver.main.runtime.spec.js" name="should return outdated dependencies when forcedVersionBump is set to minor" time="0.001"/>
|
|
52
52
|
<testcase classname="dependency-resolver.main.runtime.spec.js" name="should return outdated dependencies when forcedVersionBump is set to major" time="0.001"/>
|
|
53
|
-
<testcase classname="dependency-resolver.main.runtime.spec.js" name="should throw an error if the env policy has a peer with an empty string set for the supportedRange" time="0.
|
|
53
|
+
<testcase classname="dependency-resolver.main.runtime.spec.js" name="should throw an error if the env policy has a peer with an empty string set for the supportedRange" time="0.148"/>
|
|
54
54
|
</testsuite>
|
|
55
55
|
</testsuites>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports["teambit.dependencies/dependency-resolver-preview"]=n():e["teambit.dependencies/dependency-resolver-preview"]=n()}(self,(()=>(()=>{"use strict";var e={979:(e,n,t)=>{var a={id:"teambit.dependencies/aspect-docs/dependency-resolver@0.0.178",homepage:"https://bit.cloud/teambit/dependencies/aspect-docs/dependency-resolver",exported:!0};Object.defineProperty(n,"__esModule",{value:!0}),n.default=c,d(t(594));var o=t(16),i=["components"];function d(e){return e&&e.__esModule?e:{default:e}}function r(){return r=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var a in t)({}).hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},r.apply(null,arguments)}function l(e,n){if(null==e)return{};var t,a,o=s(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)t=i[a],n.includes(t)||{}.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}function s(e,n){if(null==e)return{};var t={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(n.includes(a))continue;t[a]=e[a]}return t}d.__bit_component=a,r.__bit_component=a,l.__bit_component=a,s.__bit_component=a;var p={},m="wrapper";function c(e){var n=e.components,t=l(e,i);return(0,o.mdx)(m,r({},p,t,{components:n,mdxType:"MDXLayout"}),(0,o.mdx)("p",null,"The ",(0,o.mdx)("a",{parentName:"p",href:"https://bit.cloud/teambit/dependencies/dependency-resolver"},"Dependency Resolver")," configures and installs dependencies for components in a Bit workspace. It auto-generates the dependency graph for components to spare us the tedious work of manually configuring it ourselves.\nIt does so by integrating the dependency policies set by various Bit extensions (primarily the workspace) with the components' parsed and analyzed ",(0,o.mdx)("inlineCode",{parentName:"p"},"import"),"/",(0,o.mdx)("inlineCode",{parentName:"p"},"require")," statements.\nIn addition to that, the Dependency Resolver offers an efficient API to manually modify the generated graph using policies that can be applied on groups of components."),(0,o.mdx)("h4",null,"Features"),(0,o.mdx)("ul",null,(0,o.mdx)("li",{parentName:"ul"},(0,o.mdx)("p",{parentName:"li"},(0,o.mdx)("strong",{parentName:"p"},"Auto-generated dependency graph"),":\nThe Dependency Resolver saves us time and effort by generating the dependency graph for each component handled by the workspace. It does so by parsing out all ",(0,o.mdx)("inlineCode",{parentName:"p"},"import")," \\ ",(0,o.mdx)("inlineCode",{parentName:"p"},"require")," statements in the component's files.\nIt then determines if these dependencies are packages, components or internal implementation files.\nIf they are external components or packages, it goes on to determine their version and dependency-type (",(0,o.mdx)("inlineCode",{parentName:"p"},"dependencies"),", ",(0,o.mdx)("inlineCode",{parentName:"p"},"devDependencies"),", ",(0,o.mdx)("inlineCode",{parentName:"p"},"peerDependencies"),").")),(0,o.mdx)("li",{parentName:"ul"},(0,o.mdx)("p",{parentName:"li"},(0,o.mdx)("strong",{parentName:"p"},"An efficient dependency configuration API:"),"\nThe Dependency Resolver strikes the right balance between automation and customization by offering a simple and efficient configuration API.\nUse it in the workspace configuration file to manually modify the version and dependency type of dependencies in the generated dependency graph.\nWhen used in combination with ",(0,o.mdx)("inlineCode",{parentName:"p"},"@teambit.workspace/variant")," it allows to define, in a cascading (CSS-like) way,\ndifferent dependency policies for different sets of components, and even to add or remove dependencies altogether.")),(0,o.mdx)("li",{parentName:"ul"},(0,o.mdx)("p",{parentName:"li"},(0,o.mdx)("strong",{parentName:"p"},"Optimized dependency installation:"),"\nThe Dependency Resolver directs the package manager to install the correct packages in the correct location in the workspace file structure.\nWhen a dependency appears in the workspace dependency graph more than once, the Resolver searches for a common version that satisfies ",(0,o.mdx)("em",{parentName:"p"},"most")," dependent\ncomponents and installs it at the workspace root directory, where it can be shared by all relevant components."),(0,o.mdx)("blockquote",{parentName:"li"},(0,o.mdx)("p",{parentName:"blockquote"},"dependency versions that are used by a minority of components will be installed in each component's directory."))),(0,o.mdx)("li",{parentName:"ul"},(0,o.mdx)("p",{parentName:"li"},(0,o.mdx)("strong",{parentName:"p"},"A single 'install command for packages and components:"),"\nA single ",(0,o.mdx)("inlineCode",{parentName:"p"},"bit install")," command will not only install packages but will also import components listed in your ",(0,o.mdx)("inlineCode",{parentName:"p"},".bitmap")," file.\nThese components will then be linked to your ",(0,o.mdx)("inlineCode",{parentName:"p"},"node_modules")," directory, to keep the same import pattern for both module types, components and packages.")),(0,o.mdx)("li",{parentName:"ul"},(0,o.mdx)("p",{parentName:"li"},(0,o.mdx)("strong",{parentName:"p"},"Programmatic API for extensions and environments"),"\nThe Dependency Resolver provides other extensions and environments with an API that allows them to register their own dependency policies.\nFor example, the 'React environment' uses the Dependency Resolver to set 'react-dom' as a peerDependency for all components using it (in case a component author had either left ",(0,o.mdx)("inlineCode",{parentName:"p"},"react-dom")," out of its dependencies, or even registered it as a regular dependency)."))),(0,o.mdx)("h2",null,"Quickstart & configuration"),(0,o.mdx)("h3",null,"Auto-registered dependency version and type"),(0,o.mdx)("p",null,"Dependency policies define the version and dependency type of each package used by components in the workspace.\nWhen installing a package, the Dependency Resolver registers its version in the dependency configuration (if a version is not specified upon installation, it will default to the latest one)."),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'// At the root-level of the workspace configuration JSON\n{\n "@teambit.dependencies/dependency-resolver": {\n "policy": {\n "dependencies": {\n "lodash": "4.17.0"\n }\n }\n }\n}\n')),(0,o.mdx)("h2",null,"The dependency policies hierarchy"),(0,o.mdx)("p",null,"The Dependency Resolver integrates dependency policies from various sources to determine the component's final dependency graph.\nCases of conflicting policies are resolved according to a hierarchy of source types, where a 'higher' rule in the list overrides lower rules."),(0,o.mdx)("p",null,"The hierarchy in a descending order:"),(0,o.mdx)("ol",null,(0,o.mdx)("li",{parentName:"ol"},"Policies set by Variants (",(0,o.mdx)("inlineCode",{parentName:"li"},"@teambit/variants"),") and the ",(0,o.mdx)("inlineCode",{parentName:"li"},"component.json"),' files of "ejected" components (these two sources are merged by Variants).'),(0,o.mdx)("li",{parentName:"ol"},"Policies set by various extensions/aspects (using ",(0,o.mdx)("inlineCode",{parentName:"li"},"registerDependencyPolicy"),")"),(0,o.mdx)("li",{parentName:"ol"},"Policies set by the environment (using ",(0,o.mdx)("inlineCode",{parentName:"li"},"getDependencies"),")"),(0,o.mdx)("li",{parentName:"ol"},"Bit’s automated dependency detections, and policies set by the Dependency Resolver at the workspace configuration root-level.")),(0,o.mdx)("blockquote",null,(0,o.mdx)("p",{parentName:"blockquote"},"Use the ",(0,o.mdx)("inlineCode",{parentName:"p"},"bit dependencies <component-id>")," command to understand the calculations and interactions which resolved to the generated dependency graph of a specific component.")),(0,o.mdx)("h3",null,"Select a package manager"),(0,o.mdx)("p",null,"The Dependency resolver does not replace package managers - it uses them and directs them.\nTo choose between 'Yarn' and 'pnpm', set the ",(0,o.mdx)("inlineCode",{parentName:"p"},"packageManager")," property to either of the following:"),(0,o.mdx)("ul",null,(0,o.mdx)("li",{parentName:"ul"},(0,o.mdx)("inlineCode",{parentName:"li"},"teambit.dependencies/yarn")),(0,o.mdx)("li",{parentName:"ul"},(0,o.mdx)("inlineCode",{parentName:"li"},"teambit.dependencies/pnpm"))),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'// At the root-level of the workspace configuration JSON\n{\n "teambit.dependencies/dependency-resolver": {\n "packageManager": "teambit.dependencies/yarn"\n }\n}\n')),(0,o.mdx)("h3",null,"Select the type of node_modules"),(0,o.mdx)("p",null,"By default, pnpm creates a symlinked ",(0,o.mdx)("inlineCode",{parentName:"p"},"node_modules"),' whereas Yarn creates a "classic" hoisted one.\nThis may be changed by setting the ',(0,o.mdx)("inlineCode",{parentName:"p"},"nodeLinker")," configuration option."),(0,o.mdx)("p",null,"Allowed values of ",(0,o.mdx)("inlineCode",{parentName:"p"},"nodeLinker"),":"),(0,o.mdx)("ul",null,(0,o.mdx)("li",{parentName:"ul"},(0,o.mdx)("inlineCode",{parentName:"li"},'"hoisted"')," - create a hoisted (aka flat) ",(0,o.mdx)("inlineCode",{parentName:"li"},"node_modules")," directory without using symlinks. Similar to the one created by npm or Yarn classic."),(0,o.mdx)("li",{parentName:"ul"},(0,o.mdx)("inlineCode",{parentName:"li"},'"isolated"')," - create a ",(0,o.mdx)("inlineCode",{parentName:"li"},"node_modules")," directory using symlinks. All dependencies are symlinked from a flat storage at ",(0,o.mdx)("inlineCode",{parentName:"li"},"node_modules/.pnpm")," (when using pnpm) or ",(0,o.mdx)("inlineCode",{parentName:"li"},"node_modules/.store")," (when using Yarn).")),(0,o.mdx)("h3",null,"Apply policies on all relevant components"),(0,o.mdx)("p",null,"A dependency policy configured at the root level of the workspace configuration (JSON) will by default affect ",(0,o.mdx)("em",{parentName:"p"},"all")," components that have that package as their dependency (i.e., components that have this module listed in their generated dependency graph).\n",(0,o.mdx)("strong",{parentName:"p"},"Components that do not have this package as a dependency will not be affected.")),(0,o.mdx)("p",null,"For example:"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'// At the root-level of the workspace configuration JSON\n\n// Every component in the workspace that has \'lodash\' as a dependency will version \'3.0.0\'.\n// This policy will not affect any component that does not have \'lodash\' as a dependency.\n\n{\n "teambit.dependencies/dependency-resolver": {\n "policy": {\n "dependencies": {\n "lodash": "3.0.0"\n }\n }\n }\n}\n')),(0,o.mdx)("h3",null,"Apply policies on a selected group of components"),(0,o.mdx)("p",null,"Dependency policies can be applied on a specific group of components. This is done using the ",(0,o.mdx)("inlineCode",{parentName:"p"},"@teambit.workspace/variants")," configuration API."),(0,o.mdx)("p",null,"For example, to set version ",(0,o.mdx)("inlineCode",{parentName:"p"},"1.0.0")," of ",(0,o.mdx)("inlineCode",{parentName:"p"},"classnames")," as a dependency of all components located inside the ",(0,o.mdx)("inlineCode",{parentName:"p"},"./components/react")," directory (or any of its sub-directories):"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'{\n "teambit.workspace/variants": {\n "components/react": {\n // this creates a variant for all components contained in the components/react directory and it\'s sub-directories\n "teambit.dependencies/dependency-resolver": {\n // this creates dependencies overrides for the current variant\n "policy": {\n "dependencies": {\n "classnames": "1.0.0"\n }\n }\n }\n }\n }\n}\n')),(0,o.mdx)("h3",null,"Remove a dependency"),(0,o.mdx)("p",null,'Dependency policies can also be used to move or remove a dependency. That\'s especially useful when a dependency is defined with an incorrect dependency type.\nFor example, a module can be "moved" from ',(0,o.mdx)("inlineCode",{parentName:"p"},"dependencies")," to ",(0,o.mdx)("inlineCode",{parentName:"p"},"peerDependencies")," by removing it from ",(0,o.mdx)("inlineCode",{parentName:"p"},"dependencies")," and listing it under ",(0,o.mdx)("inlineCode",{parentName:"p"},"peerDependencies"),"."),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},' "teambit.dependencies/dependency-resolver": {\n "policy": {\n "dependencies": {\n "enzyme": "-"\n },\n "peerDependencies": {\n "enzyme": "^3.11.0"\n }\n }\n')),(0,o.mdx)("h3",null,"Override cascading policies"),(0,o.mdx)("p",null,"Policies set on a specific group of components will override any conflicting policies that have cascaded from more general configurations."),(0,o.mdx)("p",null,"For example, the following configuration will set ",(0,o.mdx)("inlineCode",{parentName:"p"},"classnames")," version ",(0,o.mdx)("inlineCode",{parentName:"p"},"1.0.0")," on all components using the ",(0,o.mdx)("inlineCode",{parentName:"p"},"react-ui")," namespace. This policy will override the workspace-level policy that uses version ",(0,o.mdx)("inlineCode",{parentName:"p"},"2.0.0")," of that same package."),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'// All components using the namespace \'react-ui\' will use version 1.0.0 of "classnames"\n// instead of version "2.0.0" which is set as the more general default for all components in the workspace\n{\n "teambit.workspace/workspace": {\n "name": "my-workspace"\n },\n "teambit.dependencies/dependency-resolver": {\n "policy": {\n "dependencies": {\n "classnames": "2.0.0"\n }\n }\n },\n "teambit.workspace/variants": {\n "{react-ui/*}": {\n // the {} notation sets the variant grouping via namespace, so in this case any (/*) components whose namespace begins with \'react-ui\'\n "teambit.dependencies/dependency-resolver": {\n "policy": {\n "classnames": "1.0.0"\n }\n }\n }\n }\n}\n')),(0,o.mdx)("h3",null,'"Forcibly" add dependencies to a component'),(0,o.mdx)("p",null,'Dependency policies applied on a selected group of components will "forcibly" add the listed packages to any ',"[selected]"," component for whom the Dependency Resolved has not already identified that package as a dependency.\nThis can be useful when a component depends on another module but has no ",(0,o.mdx)("inlineCode",{parentName:"p"},"import"),"/",(0,o.mdx)("inlineCode",{parentName:"p"},"require")," statement to be parsed by the Dependency Resolver (for example, in a Webpack configuration file, or as a peerDependency of a consumed package)."),(0,o.mdx)("p",null,"In the following example, ",(0,o.mdx)("inlineCode",{parentName:"p"},"classnames@1.0.0"),' will be "forcibly" added as a dependency to any component using the ',(0,o.mdx)("inlineCode",{parentName:"p"},"react-ui")," namespace."),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},' "teambit.workspace/variants": {\n "{react-ui/*}": {\n "teambit.dependencies/dependency-resolver": {\n "policy": {\n "classnames": "1.0.0"\n }\n }\n }\n }\n')),(0,o.mdx)("h3",null,"Set dependency types"),(0,o.mdx)("h4",null,"dev dependencies"),(0,o.mdx)("p",null,"Dev dependencies are determined by the type of file in a component that uses the dependency.\nIf it is a development file (e.g, ",(0,o.mdx)("inlineCode",{parentName:"p"},"doSomething.test.ts"),") then the packages consumed by it are also considered\nto be used for development and will therefore be registered as ",(0,o.mdx)("inlineCode",{parentName:"p"},"devDependencies"),". In cases where a module is consumed by both a runtime file and a development file, the module will be considered as a runtime (regular) dependency."),(0,o.mdx)("blockquote",null,(0,o.mdx)("p",{parentName:"blockquote"},(0,o.mdx)("inlineCode",{parentName:"p"},"devDependencies")," that are set by the Dependency Resolver will not be visible in the component's configuration. To validate that a dependency is registered as a dev dependency, use the ",(0,o.mdx)("inlineCode",{parentName:"p"},"bit show <component>")," command.")),(0,o.mdx)("p",null,"The list of file patterns to be considered as development files is determined by the various Bit extensions. For example, the ",(0,o.mdx)("inlineCode",{parentName:"p"},"@teambit.react/react")," environment lists all ",(0,o.mdx)("inlineCode",{parentName:"p"},"*.spec.tsx")," files as dev files.\nAny component using that environment will have its ",(0,o.mdx)("inlineCode",{parentName:"p"},".spec.tsx")," files considered as dev files and all these files' dependencies considered as ",(0,o.mdx)("inlineCode",{parentName:"p"},"devDependencies"),"."),(0,o.mdx)("h5",null,"Register file patterns to be considered as dev files"),(0,o.mdx)("p",null,"Set the ",(0,o.mdx)("inlineCode",{parentName:"p"},"devFilePatterns")," property to add your own list of file extensions to be considered as development files (and to have all their dependencies considered as ",(0,o.mdx)("inlineCode",{parentName:"p"},"devDependencies"),"):"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'// At the root-level of the workspace configuration JSON\n{\n "teambit.dependencies/dependency-resolver": {\n "devFilePatterns": [".spec.ts"]\n }\n}\n')),(0,o.mdx)("h5",null,"Configure specific dependencies as devDependencies"),(0,o.mdx)("blockquote",null,(0,o.mdx)("p",{parentName:"blockquote"},"Dependencies can be ",(0,o.mdx)("em",{parentName:"p"},"directly")," configured as ",(0,o.mdx)("inlineCode",{parentName:"p"},"devDependencies")," ",(0,o.mdx)("em",{parentName:"p"},"only")," via the ",(0,o.mdx)("inlineCode",{parentName:"p"},"variants")," config API.")),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'{\n "teambit.workspace/variants": {\n "*": {\n "teambit.dependencies/dependency-resolver": {\n "policy": {\n "devDependencies": {\n "react-test-renderer": "17.0.1"\n }\n }\n }\n }\n }\n}\n')),(0,o.mdx)("h4",null,"peer dependencies"),(0,o.mdx)("p",null,"Setting a package as a peer dependency ensures the package manager installs only a single version of that package. If that is not possible, i.e. if there is no single “agreed upon” version for all components in the workspace, then an error will be thrown."),(0,o.mdx)("p",null,"This can be crucial when different components communicate with each other using shared objects that are instantiated by an installed package (the dependency). If different versions of the same package create different object instances then the “means of communication” is broken. There is no single object to address, no single source of truth. This can turn out to be critical when working with modules that are used as “plugins” of another module (for example, Babel), or when working with components that are coordinated in runtime using a shared library (for example, React)."),(0,o.mdx)("p",null,"To set a package as a peer dependency, place it under the ",(0,o.mdx)("inlineCode",{parentName:"p"},"peerDependencies")," entry, like so:"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'{\n "teambit.bit/dependency-resolver": {\n "policy": {\n "dependencies": {},\n "peerDependencies": {\n "react": "^17.0.0",\n "react-dom": "^17.0.0",\n }\n }\n}\n')),(0,o.mdx)("blockquote",null,(0,o.mdx)("p",{parentName:"blockquote"},'Peer dependencies are usually used in the context of a single "hosting code". That could be an application or a single component library.\nBit may generate multiple "hosts", one for each environment being used, to run components of different types.\nThat could translate into multiple versions of the same peer dependency, one for each environment.')),(0,o.mdx)("h2",null,"Enforce the installation of a specific package version"),(0,o.mdx)("p",null,"The dependency resolver determines the package version that best fits the requirements of most components consuming the same package.\nIt then installs it at the root of the workspace to make it available to all components sharing the same package (those that cannot use it will have their dependency installed inside their own directory)."),(0,o.mdx)("p",null,"As a result, a package installed by the Dependency Resolver may not have the same version that was specified in the Dependency Resolver policy.\nTo enforce the installation of the exact version specified in the policy, set the ",(0,o.mdx)("inlineCode",{parentName:"p"},"preserve")," property to ",(0,o.mdx)("inlineCode",{parentName:"p"},"true"),"."),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'{\n "teambit.dependencies/dependency-resolver": {\n "policy": {\n "dependencies": {\n "lodash": {\n "version": "3.0.0",\n "preserve": true\n }\n }\n }\n }\n}\n')),(0,o.mdx)("h2",null,"Set a proxy for outgoing HTTP/HTTPS requests"),(0,o.mdx)("p",null,"The package manager can be configured to use a proxy for outgoing network requests."),(0,o.mdx)("p",null,(0,o.mdx)("inlineCode",{parentName:"p"},"proxy")," - A URL for a proxy to be used in both HTTP and HTTPS requests."),(0,o.mdx)("p",null,(0,o.mdx)("inlineCode",{parentName:"p"},"httpsProxy")," - A URL specific for HTTPS requests (this will override the value set in ",(0,o.mdx)("inlineCode",{parentName:"p"},"proxy")," for HTTPS requests)."),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'{\n "teambit.dependencies/dependency-resolver": {\n "proxy": "http://domain-one.proxy.com:8080",\n "httpsProxy": "http://domain-two.proxy.com:8080"\n }\n}\n')),(0,o.mdx)("h5",null,"A proxy can also be set in NPM's and Bit's global configurations"),(0,o.mdx)("p",null,"To get the value for 'proxy'/'https-proxy':"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-bash"},"bit config get proxy\n\nbit config get https-proxy\n")),(0,o.mdx)("p",null,"To set a new 'proxy'/'https-proxy' value:"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-bash"},"bit config set proxy http://domain-one.proxy.com:8080\n\nbit config set https-proxy http://domain-one.proxy.com:8080\n")),(0,o.mdx)("p",null,"Read about setting a proxy in NPM's global configuration ",(0,o.mdx)("a",{parentName:"p",href:"https://docs.npmjs.com/cli/v6/using-npm/config#https-proxy"},"here")),(0,o.mdx)("blockquote",null,(0,o.mdx)("p",{parentName:"blockquote"},"Notice the Dependency Resolver config will override ",(0,o.mdx)("em",{parentName:"p"},"all")," other proxy configurations. The NPM config will override Bit's global proxy configurations.")),(0,o.mdx)("h2",null,"Network settings"),(0,o.mdx)("p",null,"Settings that allow to change how aggressively the package manager is making and retrying network requests. Currently, these settings affect only the behavior of pnpm."),(0,o.mdx)("p",null,"These are settings passed to the aspect configuration. For instance:"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'{\n "teambit.dependencies/dependency-resolver": {\n "networkConcurrency": 4\n }\n}\n')),(0,o.mdx)("h3",null,"networkConcurrency"),(0,o.mdx)("p",null,"Controls the maximum number of HTTP(S) requests to process simultaneously."),(0,o.mdx)("h3",null,"fetchRetries"),(0,o.mdx)("p",null,"How many times to retry if Bit fails to fetch from the registry."),(0,o.mdx)("h3",null,"fetchRetryFactor"),(0,o.mdx)("p",null,"The exponential factor for retry backoff."),(0,o.mdx)("h3",null,"fetchRetryMintimeout"),(0,o.mdx)("p",null,"The minimum (base) timeout for retrying requests."),(0,o.mdx)("h3",null,"fetchRetryMaxtimeout"),(0,o.mdx)("p",null,"The maximum fallback timeout to ensure the retry factor does not make requests too long."),(0,o.mdx)("h3",null,"fetchTimeout"),(0,o.mdx)("p",null,"The maximum amount of time (in milliseconds) to wait for HTTP requests to complete."),(0,o.mdx)("h3",null,"maxSockets"),(0,o.mdx)("p",null,"The maximum number of connections to use per origin (protocol/host/port combination)."),(0,o.mdx)("h2",null,"Overrides"),(0,o.mdx)("p",null,"This field allows you to instruct Bit to override any dependency in the dependency graph. This is useful to enforce all your packages to use a single version of a dependency, backport a fix, or replace a dependency with a fork."),(0,o.mdx)("p",null,"An example of the ",(0,o.mdx)("inlineCode",{parentName:"p"},'"overrides"')," field:"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'{\n "@teambit.dependencies/dependency-resolver": {\n "overrides": {\n "foo": "^1.0.0",\n "quux": "npm:@myorg/quux@^1.0.0",\n "bar@^2.1.0": "3.0.0",\n "qar@1>zoo": "2"\n }\n }\n}\n')),(0,o.mdx)("p",null,"You may specify the package the overriden dependency belongs to by separating the package selector from the dependency selector with a ",(0,o.mdx)("inlineCode",{parentName:"p"},'">"'),", for example ",(0,o.mdx)("inlineCode",{parentName:"p"},"qar@1>zoo")," will only override the ",(0,o.mdx)("inlineCode",{parentName:"p"},"zoo")," dependency of ",(0,o.mdx)("inlineCode",{parentName:"p"},"qar@1"),", not for any other dependencies."),(0,o.mdx)("h2",null,"Side-Effects cache"),(0,o.mdx)("p",null,"By default, when pnpm is set as the package manager, build artifacts are cached. So when installing a package with pre/postinstall hooks, it is only built the first time it is installed on a computer."),(0,o.mdx)("p",null,"Side-effects cache can be turned off by setting the ",(0,o.mdx)("inlineCode",{parentName:"p"},"sideEffectsCache")," field to ",(0,o.mdx)("inlineCode",{parentName:"p"},"false"),":"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'{\n "@teambit.dependencies/dependency-resolver": {\n "sideEffectsCache": false\n }\n}\n')),(0,o.mdx)("h2",null,"Node.js engine checks"),(0,o.mdx)("p",null,"If you want to prevent contributors of your project from adding new incompatible dependencies, use ",(0,o.mdx)("inlineCode",{parentName:"p"},"nodeVersion")," and ",(0,o.mdx)("inlineCode",{parentName:"p"},"engineStrict")," in your ",(0,o.mdx)("inlineCode",{parentName:"p"},"workspace.jsonc"),":"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'{\n "@teambit.dependencies/dependency-resolver": {\n "engineStrict": true,\n "nodeVersion": "12.22.0"\n }\n}\n')),(0,o.mdx)("p",null,"This way, even if someone is using Node.js v16, they will not be able to install a new dependency that doesn't support Node.js v12.22.0."),(0,o.mdx)("p",null,"NOTE: This works only with pnpm currently."),(0,o.mdx)("h2",null,"peerDependencyRules"),(0,o.mdx)("h3",null,"peerDependencyRules.ignoreMissing"),(0,o.mdx)("p",null,"Bit will not print warnings about missing peer dependencies from this list."),(0,o.mdx)("p",null,"For instance, with the following configuration, Bit will not print warnings if a dependency needs ",(0,o.mdx)("inlineCode",{parentName:"p"},"react")," but ",(0,o.mdx)("inlineCode",{parentName:"p"},"react")," is not installed:"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'{\n "@teambit.dependencies/dependency-resolver": {\n "peerDependencyRules": {\n "ignoreMissing": ["react"]\n }\n }\n}\n')),(0,o.mdx)("p",null,"Package name patterns may also be used:"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'{\n "@teambit.dependencies/dependency-resolver": {\n "peerDependencyRules": {\n "ignoreMissing": ["@babel/*", "@eslint/*"]\n }\n }\n}\n')),(0,o.mdx)("h3",null,"peerDependencyRules.allowedVersions"),(0,o.mdx)("p",null,"Unmet peer dependency warnings will not be printed for peer dependencies of the specified range."),(0,o.mdx)("p",null,"For instance, if you have some dependencies that need ",(0,o.mdx)("inlineCode",{parentName:"p"},"react@16")," but you know that they work fine with ",(0,o.mdx)("inlineCode",{parentName:"p"},"react@17"),", then you may use the following configuration:"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'{\n "@teambit.dependencies/dependency-resolver": {\n "peerDependencyRules": {\n "allowedVersions": {\n "react": "17"\n }\n }\n }\n}\n')),(0,o.mdx)("p",null,"This will tell Bit that any dependency that has react in its peer dependencies should allow ",(0,o.mdx)("inlineCode",{parentName:"p"},"react")," v17 to be installed."),(0,o.mdx)("h3",null,"peerDependencyRules.allowAny"),(0,o.mdx)("p",null,(0,o.mdx)("inlineCode",{parentName:"p"},"allowAny")," is an array of package name patterns, any peer dependency matching the pattern will be resolved from any version, regardless of the range specified in ",(0,o.mdx)("inlineCode",{parentName:"p"},"peerDependencies"),". For instance:"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'{\n "@teambit.dependencies/dependency-resolver": {\n "peerDependencyRules": {\n "allowAny": ["@babel/*", "eslint"]\n }\n }\n}\n')),(0,o.mdx)("p",null,"The above setting will mute any warnings about peer dependency version mismatches related to ",(0,o.mdx)("inlineCode",{parentName:"p"},"@babel/")," packages or ",(0,o.mdx)("inlineCode",{parentName:"p"},"eslint"),"."),(0,o.mdx)("h2",null,"Build"),(0,o.mdx)("h3",null,"neverBuiltDependencies"),(0,o.mdx)("p",null,'This field allows to ignore the builds of specific dependencies. The "preinstall", "install", and "postinstall" scripts of the listed packages will not be executed during installation.'),(0,o.mdx)("p",null,'An example of the "neverBuiltDependencies" field:'),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'{\n "@teambit.dependencies/dependency-resolver": {\n "neverBuiltDependencies": ["fsevents", "level"]\n }\n}\n')),(0,o.mdx)("h2",null,"CLI reference"),(0,o.mdx)("h3",null,"install"),(0,o.mdx)("blockquote",null,(0,o.mdx)("p",{parentName:"blockquote"},"By default, the Dependency Resolver installs packages from Bit.dev's registry. The authentication for that registry is via your Bit.dev token, listed under ",(0,o.mdx)("inlineCode",{parentName:"p"},"@bit"),", in your ",(0,o.mdx)("inlineCode",{parentName:"p"},".npmrc")," file.\nIf that token cannot be found in the ",(0,o.mdx)("inlineCode",{parentName:"p"},".npmrc")," file, Bit will look for it in your global Bit configurations (use the ",(0,o.mdx)("inlineCode",{parentName:"p"},"bit config")," command to output your ",(0,o.mdx)("inlineCode",{parentName:"p"},"user.token")," property)."),(0,o.mdx)("br",null),"If your npm is configured to use a registry other than npmjs's, then the Dependency Resolver will use that configured registry, instead."),(0,o.mdx)("blockquote",null,(0,o.mdx)("p",{parentName:"blockquote"},"The 'install' process includes importing components and linking them to the ",(0,o.mdx)("inlineCode",{parentName:"p"},"node_modules")," directory.")),(0,o.mdx)("h5",null,"Install all dependencies listed in the Dependency Resolver configuration:"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-bash"},"bit install\n")),(0,o.mdx)("h5",null,"Install the latest version of a package:"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-bash"},"bit install <package>\n\n// For example\nbit install lodash\n")),(0,o.mdx)("h5",null,"Install a specific version of a package:"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-bash"},"bit install <package>@<version>\n\n// For example\nbit install lodash@1.0.0\n")),(0,o.mdx)("h5",null,"Install packages without importing components"),(0,o.mdx)("p",null,"The 'install' process includes importing components listed in the ",(0,o.mdx)("inlineCode",{parentName:"p"},".bitmap")," file and linking them to the ",(0,o.mdx)("inlineCode",{parentName:"p"},"node_modules")," directory.\nTo disable importing and install all packages and components as standard packages use:"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-bash"},"bit install --skip-import\n")))}c.__bit_component=a,c.isMDXComponent=!0},844:(e,n,t)=>{Object.defineProperty(n,"Q",{enumerable:!0,get:function(){return a.default}});var a=o(t(979));function o(e){return e&&e.__esModule?e:{default:e}}o.__bit_component={id:"teambit.dependencies/aspect-docs/dependency-resolver@0.0.178",homepage:"https://bit.cloud/teambit/dependencies/aspect-docs/dependency-resolver",exported:!0}},266:(e,n,t)=>{var a={id:"teambit.dependencies/dependency-resolver@1.0.484",homepage:"https://bit.cloud/teambit/dependencies/dependency-resolver",exported:!0};function o(){const e=i(t(594));return o=function(){return e},e}function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0}),n.Logo=void 0,o.__bit_component=a,i.__bit_component=a;const d=()=>o().default.createElement("div",{style:{height:"100%",display:"flex",justifyContent:"center"}},o().default.createElement("img",{style:{width:70},src:"https://static.bit.dev/extensions-icons/dependencies.svg"}));d.__bit_component=a,n.Logo=d},16:e=>{e.exports=MdxJsReact},594:e=>{e.exports=React}},n={};function t(a){var o=n[a];if(void 0!==o)return o.exports;var i=n[a]={exports:{}};return e[a](i,i.exports,t),i.exports}t.d=(e,n)=>{for(var a in n)t.o(n,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:n[a]})},t.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};t.r(a),t.d(a,{compositions:()=>h,compositions_metadata:()=>y,overview:()=>x});var o={};t.r(o),t.d(o,{default:()=>u});var i=t(266),d=(t(594),t(16));const r=TeambitMdxUiMdxScopeContext;var l=t(844),s=["components"];function p(){return p=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var a in t)({}).hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},p.apply(null,arguments)}var m={},c="wrapper";function u(e){var n=e.components,t=function(e,n){if(null==e)return{};var t,a,o=function(e,n){if(null==e)return{};var t={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(n.includes(a))continue;t[a]=e[a]}return t}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)t=i[a],n.includes(t)||{}.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}(e,s);return(0,d.mdx)(c,p({},m,t,{components:n,mdxType:"MDXLayout"}),(0,d.mdx)(r.MDXScopeProvider,{components:{DependencyResolver:l.Q},mdxType:"MDXScopeProvider"},(0,d.mdx)(l.Q,{mdxType:"DependencyResolver"})))}u.isMDXComponent=!0;const h=[i],x=[o],y={compositions:[{displayName:"Logo",identifier:"Logo"}]};return a})()));
|
|
1
|
+
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports["teambit.dependencies/dependency-resolver-preview"]=n():e["teambit.dependencies/dependency-resolver-preview"]=n()}(self,(()=>(()=>{"use strict";var e={979:(e,n,t)=>{var a={id:"teambit.dependencies/aspect-docs/dependency-resolver@0.0.178",homepage:"https://bit.cloud/teambit/dependencies/aspect-docs/dependency-resolver",exported:!0};Object.defineProperty(n,"__esModule",{value:!0}),n.default=c,d(t(594));var o=t(16),i=["components"];function d(e){return e&&e.__esModule?e:{default:e}}function r(){return r=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var a in t)({}).hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},r.apply(null,arguments)}function l(e,n){if(null==e)return{};var t,a,o=s(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)t=i[a],n.includes(t)||{}.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}function s(e,n){if(null==e)return{};var t={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(n.includes(a))continue;t[a]=e[a]}return t}d.__bit_component=a,r.__bit_component=a,l.__bit_component=a,s.__bit_component=a;var p={},m="wrapper";function c(e){var n=e.components,t=l(e,i);return(0,o.mdx)(m,r({},p,t,{components:n,mdxType:"MDXLayout"}),(0,o.mdx)("p",null,"The ",(0,o.mdx)("a",{parentName:"p",href:"https://bit.cloud/teambit/dependencies/dependency-resolver"},"Dependency Resolver")," configures and installs dependencies for components in a Bit workspace. It auto-generates the dependency graph for components to spare us the tedious work of manually configuring it ourselves.\nIt does so by integrating the dependency policies set by various Bit extensions (primarily the workspace) with the components' parsed and analyzed ",(0,o.mdx)("inlineCode",{parentName:"p"},"import"),"/",(0,o.mdx)("inlineCode",{parentName:"p"},"require")," statements.\nIn addition to that, the Dependency Resolver offers an efficient API to manually modify the generated graph using policies that can be applied on groups of components."),(0,o.mdx)("h4",null,"Features"),(0,o.mdx)("ul",null,(0,o.mdx)("li",{parentName:"ul"},(0,o.mdx)("p",{parentName:"li"},(0,o.mdx)("strong",{parentName:"p"},"Auto-generated dependency graph"),":\nThe Dependency Resolver saves us time and effort by generating the dependency graph for each component handled by the workspace. It does so by parsing out all ",(0,o.mdx)("inlineCode",{parentName:"p"},"import")," \\ ",(0,o.mdx)("inlineCode",{parentName:"p"},"require")," statements in the component's files.\nIt then determines if these dependencies are packages, components or internal implementation files.\nIf they are external components or packages, it goes on to determine their version and dependency-type (",(0,o.mdx)("inlineCode",{parentName:"p"},"dependencies"),", ",(0,o.mdx)("inlineCode",{parentName:"p"},"devDependencies"),", ",(0,o.mdx)("inlineCode",{parentName:"p"},"peerDependencies"),").")),(0,o.mdx)("li",{parentName:"ul"},(0,o.mdx)("p",{parentName:"li"},(0,o.mdx)("strong",{parentName:"p"},"An efficient dependency configuration API:"),"\nThe Dependency Resolver strikes the right balance between automation and customization by offering a simple and efficient configuration API.\nUse it in the workspace configuration file to manually modify the version and dependency type of dependencies in the generated dependency graph.\nWhen used in combination with ",(0,o.mdx)("inlineCode",{parentName:"p"},"@teambit.workspace/variant")," it allows to define, in a cascading (CSS-like) way,\ndifferent dependency policies for different sets of components, and even to add or remove dependencies altogether.")),(0,o.mdx)("li",{parentName:"ul"},(0,o.mdx)("p",{parentName:"li"},(0,o.mdx)("strong",{parentName:"p"},"Optimized dependency installation:"),"\nThe Dependency Resolver directs the package manager to install the correct packages in the correct location in the workspace file structure.\nWhen a dependency appears in the workspace dependency graph more than once, the Resolver searches for a common version that satisfies ",(0,o.mdx)("em",{parentName:"p"},"most")," dependent\ncomponents and installs it at the workspace root directory, where it can be shared by all relevant components."),(0,o.mdx)("blockquote",{parentName:"li"},(0,o.mdx)("p",{parentName:"blockquote"},"dependency versions that are used by a minority of components will be installed in each component's directory."))),(0,o.mdx)("li",{parentName:"ul"},(0,o.mdx)("p",{parentName:"li"},(0,o.mdx)("strong",{parentName:"p"},"A single 'install command for packages and components:"),"\nA single ",(0,o.mdx)("inlineCode",{parentName:"p"},"bit install")," command will not only install packages but will also import components listed in your ",(0,o.mdx)("inlineCode",{parentName:"p"},".bitmap")," file.\nThese components will then be linked to your ",(0,o.mdx)("inlineCode",{parentName:"p"},"node_modules")," directory, to keep the same import pattern for both module types, components and packages.")),(0,o.mdx)("li",{parentName:"ul"},(0,o.mdx)("p",{parentName:"li"},(0,o.mdx)("strong",{parentName:"p"},"Programmatic API for extensions and environments"),"\nThe Dependency Resolver provides other extensions and environments with an API that allows them to register their own dependency policies.\nFor example, the 'React environment' uses the Dependency Resolver to set 'react-dom' as a peerDependency for all components using it (in case a component author had either left ",(0,o.mdx)("inlineCode",{parentName:"p"},"react-dom")," out of its dependencies, or even registered it as a regular dependency)."))),(0,o.mdx)("h2",null,"Quickstart & configuration"),(0,o.mdx)("h3",null,"Auto-registered dependency version and type"),(0,o.mdx)("p",null,"Dependency policies define the version and dependency type of each package used by components in the workspace.\nWhen installing a package, the Dependency Resolver registers its version in the dependency configuration (if a version is not specified upon installation, it will default to the latest one)."),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'// At the root-level of the workspace configuration JSON\n{\n "@teambit.dependencies/dependency-resolver": {\n "policy": {\n "dependencies": {\n "lodash": "4.17.0"\n }\n }\n }\n}\n')),(0,o.mdx)("h2",null,"The dependency policies hierarchy"),(0,o.mdx)("p",null,"The Dependency Resolver integrates dependency policies from various sources to determine the component's final dependency graph.\nCases of conflicting policies are resolved according to a hierarchy of source types, where a 'higher' rule in the list overrides lower rules."),(0,o.mdx)("p",null,"The hierarchy in a descending order:"),(0,o.mdx)("ol",null,(0,o.mdx)("li",{parentName:"ol"},"Policies set by Variants (",(0,o.mdx)("inlineCode",{parentName:"li"},"@teambit/variants"),") and the ",(0,o.mdx)("inlineCode",{parentName:"li"},"component.json"),' files of "ejected" components (these two sources are merged by Variants).'),(0,o.mdx)("li",{parentName:"ol"},"Policies set by various extensions/aspects (using ",(0,o.mdx)("inlineCode",{parentName:"li"},"registerDependencyPolicy"),")"),(0,o.mdx)("li",{parentName:"ol"},"Policies set by the environment (using ",(0,o.mdx)("inlineCode",{parentName:"li"},"getDependencies"),")"),(0,o.mdx)("li",{parentName:"ol"},"Bit’s automated dependency detections, and policies set by the Dependency Resolver at the workspace configuration root-level.")),(0,o.mdx)("blockquote",null,(0,o.mdx)("p",{parentName:"blockquote"},"Use the ",(0,o.mdx)("inlineCode",{parentName:"p"},"bit dependencies <component-id>")," command to understand the calculations and interactions which resolved to the generated dependency graph of a specific component.")),(0,o.mdx)("h3",null,"Select a package manager"),(0,o.mdx)("p",null,"The Dependency resolver does not replace package managers - it uses them and directs them.\nTo choose between 'Yarn' and 'pnpm', set the ",(0,o.mdx)("inlineCode",{parentName:"p"},"packageManager")," property to either of the following:"),(0,o.mdx)("ul",null,(0,o.mdx)("li",{parentName:"ul"},(0,o.mdx)("inlineCode",{parentName:"li"},"teambit.dependencies/yarn")),(0,o.mdx)("li",{parentName:"ul"},(0,o.mdx)("inlineCode",{parentName:"li"},"teambit.dependencies/pnpm"))),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'// At the root-level of the workspace configuration JSON\n{\n "teambit.dependencies/dependency-resolver": {\n "packageManager": "teambit.dependencies/yarn"\n }\n}\n')),(0,o.mdx)("h3",null,"Select the type of node_modules"),(0,o.mdx)("p",null,"By default, pnpm creates a symlinked ",(0,o.mdx)("inlineCode",{parentName:"p"},"node_modules"),' whereas Yarn creates a "classic" hoisted one.\nThis may be changed by setting the ',(0,o.mdx)("inlineCode",{parentName:"p"},"nodeLinker")," configuration option."),(0,o.mdx)("p",null,"Allowed values of ",(0,o.mdx)("inlineCode",{parentName:"p"},"nodeLinker"),":"),(0,o.mdx)("ul",null,(0,o.mdx)("li",{parentName:"ul"},(0,o.mdx)("inlineCode",{parentName:"li"},'"hoisted"')," - create a hoisted (aka flat) ",(0,o.mdx)("inlineCode",{parentName:"li"},"node_modules")," directory without using symlinks. Similar to the one created by npm or Yarn classic."),(0,o.mdx)("li",{parentName:"ul"},(0,o.mdx)("inlineCode",{parentName:"li"},'"isolated"')," - create a ",(0,o.mdx)("inlineCode",{parentName:"li"},"node_modules")," directory using symlinks. All dependencies are symlinked from a flat storage at ",(0,o.mdx)("inlineCode",{parentName:"li"},"node_modules/.pnpm")," (when using pnpm) or ",(0,o.mdx)("inlineCode",{parentName:"li"},"node_modules/.store")," (when using Yarn).")),(0,o.mdx)("h3",null,"Apply policies on all relevant components"),(0,o.mdx)("p",null,"A dependency policy configured at the root level of the workspace configuration (JSON) will by default affect ",(0,o.mdx)("em",{parentName:"p"},"all")," components that have that package as their dependency (i.e., components that have this module listed in their generated dependency graph).\n",(0,o.mdx)("strong",{parentName:"p"},"Components that do not have this package as a dependency will not be affected.")),(0,o.mdx)("p",null,"For example:"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'// At the root-level of the workspace configuration JSON\n\n// Every component in the workspace that has \'lodash\' as a dependency will version \'3.0.0\'.\n// This policy will not affect any component that does not have \'lodash\' as a dependency.\n\n{\n "teambit.dependencies/dependency-resolver": {\n "policy": {\n "dependencies": {\n "lodash": "3.0.0"\n }\n }\n }\n}\n')),(0,o.mdx)("h3",null,"Apply policies on a selected group of components"),(0,o.mdx)("p",null,"Dependency policies can be applied on a specific group of components. This is done using the ",(0,o.mdx)("inlineCode",{parentName:"p"},"@teambit.workspace/variants")," configuration API."),(0,o.mdx)("p",null,"For example, to set version ",(0,o.mdx)("inlineCode",{parentName:"p"},"1.0.0")," of ",(0,o.mdx)("inlineCode",{parentName:"p"},"classnames")," as a dependency of all components located inside the ",(0,o.mdx)("inlineCode",{parentName:"p"},"./components/react")," directory (or any of its sub-directories):"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'{\n "teambit.workspace/variants": {\n "components/react": {\n // this creates a variant for all components contained in the components/react directory and it\'s sub-directories\n "teambit.dependencies/dependency-resolver": {\n // this creates dependencies overrides for the current variant\n "policy": {\n "dependencies": {\n "classnames": "1.0.0"\n }\n }\n }\n }\n }\n}\n')),(0,o.mdx)("h3",null,"Remove a dependency"),(0,o.mdx)("p",null,'Dependency policies can also be used to move or remove a dependency. That\'s especially useful when a dependency is defined with an incorrect dependency type.\nFor example, a module can be "moved" from ',(0,o.mdx)("inlineCode",{parentName:"p"},"dependencies")," to ",(0,o.mdx)("inlineCode",{parentName:"p"},"peerDependencies")," by removing it from ",(0,o.mdx)("inlineCode",{parentName:"p"},"dependencies")," and listing it under ",(0,o.mdx)("inlineCode",{parentName:"p"},"peerDependencies"),"."),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},' "teambit.dependencies/dependency-resolver": {\n "policy": {\n "dependencies": {\n "enzyme": "-"\n },\n "peerDependencies": {\n "enzyme": "^3.11.0"\n }\n }\n')),(0,o.mdx)("h3",null,"Override cascading policies"),(0,o.mdx)("p",null,"Policies set on a specific group of components will override any conflicting policies that have cascaded from more general configurations."),(0,o.mdx)("p",null,"For example, the following configuration will set ",(0,o.mdx)("inlineCode",{parentName:"p"},"classnames")," version ",(0,o.mdx)("inlineCode",{parentName:"p"},"1.0.0")," on all components using the ",(0,o.mdx)("inlineCode",{parentName:"p"},"react-ui")," namespace. This policy will override the workspace-level policy that uses version ",(0,o.mdx)("inlineCode",{parentName:"p"},"2.0.0")," of that same package."),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'// All components using the namespace \'react-ui\' will use version 1.0.0 of "classnames"\n// instead of version "2.0.0" which is set as the more general default for all components in the workspace\n{\n "teambit.workspace/workspace": {\n "name": "my-workspace"\n },\n "teambit.dependencies/dependency-resolver": {\n "policy": {\n "dependencies": {\n "classnames": "2.0.0"\n }\n }\n },\n "teambit.workspace/variants": {\n "{react-ui/*}": {\n // the {} notation sets the variant grouping via namespace, so in this case any (/*) components whose namespace begins with \'react-ui\'\n "teambit.dependencies/dependency-resolver": {\n "policy": {\n "classnames": "1.0.0"\n }\n }\n }\n }\n}\n')),(0,o.mdx)("h3",null,'"Forcibly" add dependencies to a component'),(0,o.mdx)("p",null,'Dependency policies applied on a selected group of components will "forcibly" add the listed packages to any ',"[selected]"," component for whom the Dependency Resolved has not already identified that package as a dependency.\nThis can be useful when a component depends on another module but has no ",(0,o.mdx)("inlineCode",{parentName:"p"},"import"),"/",(0,o.mdx)("inlineCode",{parentName:"p"},"require")," statement to be parsed by the Dependency Resolver (for example, in a Webpack configuration file, or as a peerDependency of a consumed package)."),(0,o.mdx)("p",null,"In the following example, ",(0,o.mdx)("inlineCode",{parentName:"p"},"classnames@1.0.0"),' will be "forcibly" added as a dependency to any component using the ',(0,o.mdx)("inlineCode",{parentName:"p"},"react-ui")," namespace."),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},' "teambit.workspace/variants": {\n "{react-ui/*}": {\n "teambit.dependencies/dependency-resolver": {\n "policy": {\n "classnames": "1.0.0"\n }\n }\n }\n }\n')),(0,o.mdx)("h3",null,"Set dependency types"),(0,o.mdx)("h4",null,"dev dependencies"),(0,o.mdx)("p",null,"Dev dependencies are determined by the type of file in a component that uses the dependency.\nIf it is a development file (e.g, ",(0,o.mdx)("inlineCode",{parentName:"p"},"doSomething.test.ts"),") then the packages consumed by it are also considered\nto be used for development and will therefore be registered as ",(0,o.mdx)("inlineCode",{parentName:"p"},"devDependencies"),". In cases where a module is consumed by both a runtime file and a development file, the module will be considered as a runtime (regular) dependency."),(0,o.mdx)("blockquote",null,(0,o.mdx)("p",{parentName:"blockquote"},(0,o.mdx)("inlineCode",{parentName:"p"},"devDependencies")," that are set by the Dependency Resolver will not be visible in the component's configuration. To validate that a dependency is registered as a dev dependency, use the ",(0,o.mdx)("inlineCode",{parentName:"p"},"bit show <component>")," command.")),(0,o.mdx)("p",null,"The list of file patterns to be considered as development files is determined by the various Bit extensions. For example, the ",(0,o.mdx)("inlineCode",{parentName:"p"},"@teambit.react/react")," environment lists all ",(0,o.mdx)("inlineCode",{parentName:"p"},"*.spec.tsx")," files as dev files.\nAny component using that environment will have its ",(0,o.mdx)("inlineCode",{parentName:"p"},".spec.tsx")," files considered as dev files and all these files' dependencies considered as ",(0,o.mdx)("inlineCode",{parentName:"p"},"devDependencies"),"."),(0,o.mdx)("h5",null,"Register file patterns to be considered as dev files"),(0,o.mdx)("p",null,"Set the ",(0,o.mdx)("inlineCode",{parentName:"p"},"devFilePatterns")," property to add your own list of file extensions to be considered as development files (and to have all their dependencies considered as ",(0,o.mdx)("inlineCode",{parentName:"p"},"devDependencies"),"):"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'// At the root-level of the workspace configuration JSON\n{\n "teambit.dependencies/dependency-resolver": {\n "devFilePatterns": [".spec.ts"]\n }\n}\n')),(0,o.mdx)("h5",null,"Configure specific dependencies as devDependencies"),(0,o.mdx)("blockquote",null,(0,o.mdx)("p",{parentName:"blockquote"},"Dependencies can be ",(0,o.mdx)("em",{parentName:"p"},"directly")," configured as ",(0,o.mdx)("inlineCode",{parentName:"p"},"devDependencies")," ",(0,o.mdx)("em",{parentName:"p"},"only")," via the ",(0,o.mdx)("inlineCode",{parentName:"p"},"variants")," config API.")),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'{\n "teambit.workspace/variants": {\n "*": {\n "teambit.dependencies/dependency-resolver": {\n "policy": {\n "devDependencies": {\n "react-test-renderer": "17.0.1"\n }\n }\n }\n }\n }\n}\n')),(0,o.mdx)("h4",null,"peer dependencies"),(0,o.mdx)("p",null,"Setting a package as a peer dependency ensures the package manager installs only a single version of that package. If that is not possible, i.e. if there is no single “agreed upon” version for all components in the workspace, then an error will be thrown."),(0,o.mdx)("p",null,"This can be crucial when different components communicate with each other using shared objects that are instantiated by an installed package (the dependency). If different versions of the same package create different object instances then the “means of communication” is broken. There is no single object to address, no single source of truth. This can turn out to be critical when working with modules that are used as “plugins” of another module (for example, Babel), or when working with components that are coordinated in runtime using a shared library (for example, React)."),(0,o.mdx)("p",null,"To set a package as a peer dependency, place it under the ",(0,o.mdx)("inlineCode",{parentName:"p"},"peerDependencies")," entry, like so:"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'{\n "teambit.bit/dependency-resolver": {\n "policy": {\n "dependencies": {},\n "peerDependencies": {\n "react": "^17.0.0",\n "react-dom": "^17.0.0",\n }\n }\n}\n')),(0,o.mdx)("blockquote",null,(0,o.mdx)("p",{parentName:"blockquote"},'Peer dependencies are usually used in the context of a single "hosting code". That could be an application or a single component library.\nBit may generate multiple "hosts", one for each environment being used, to run components of different types.\nThat could translate into multiple versions of the same peer dependency, one for each environment.')),(0,o.mdx)("h2",null,"Enforce the installation of a specific package version"),(0,o.mdx)("p",null,"The dependency resolver determines the package version that best fits the requirements of most components consuming the same package.\nIt then installs it at the root of the workspace to make it available to all components sharing the same package (those that cannot use it will have their dependency installed inside their own directory)."),(0,o.mdx)("p",null,"As a result, a package installed by the Dependency Resolver may not have the same version that was specified in the Dependency Resolver policy.\nTo enforce the installation of the exact version specified in the policy, set the ",(0,o.mdx)("inlineCode",{parentName:"p"},"preserve")," property to ",(0,o.mdx)("inlineCode",{parentName:"p"},"true"),"."),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'{\n "teambit.dependencies/dependency-resolver": {\n "policy": {\n "dependencies": {\n "lodash": {\n "version": "3.0.0",\n "preserve": true\n }\n }\n }\n }\n}\n')),(0,o.mdx)("h2",null,"Set a proxy for outgoing HTTP/HTTPS requests"),(0,o.mdx)("p",null,"The package manager can be configured to use a proxy for outgoing network requests."),(0,o.mdx)("p",null,(0,o.mdx)("inlineCode",{parentName:"p"},"proxy")," - A URL for a proxy to be used in both HTTP and HTTPS requests."),(0,o.mdx)("p",null,(0,o.mdx)("inlineCode",{parentName:"p"},"httpsProxy")," - A URL specific for HTTPS requests (this will override the value set in ",(0,o.mdx)("inlineCode",{parentName:"p"},"proxy")," for HTTPS requests)."),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'{\n "teambit.dependencies/dependency-resolver": {\n "proxy": "http://domain-one.proxy.com:8080",\n "httpsProxy": "http://domain-two.proxy.com:8080"\n }\n}\n')),(0,o.mdx)("h5",null,"A proxy can also be set in NPM's and Bit's global configurations"),(0,o.mdx)("p",null,"To get the value for 'proxy'/'https-proxy':"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-bash"},"bit config get proxy\n\nbit config get https-proxy\n")),(0,o.mdx)("p",null,"To set a new 'proxy'/'https-proxy' value:"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-bash"},"bit config set proxy http://domain-one.proxy.com:8080\n\nbit config set https-proxy http://domain-one.proxy.com:8080\n")),(0,o.mdx)("p",null,"Read about setting a proxy in NPM's global configuration ",(0,o.mdx)("a",{parentName:"p",href:"https://docs.npmjs.com/cli/v6/using-npm/config#https-proxy"},"here")),(0,o.mdx)("blockquote",null,(0,o.mdx)("p",{parentName:"blockquote"},"Notice the Dependency Resolver config will override ",(0,o.mdx)("em",{parentName:"p"},"all")," other proxy configurations. The NPM config will override Bit's global proxy configurations.")),(0,o.mdx)("h2",null,"Network settings"),(0,o.mdx)("p",null,"Settings that allow to change how aggressively the package manager is making and retrying network requests. Currently, these settings affect only the behavior of pnpm."),(0,o.mdx)("p",null,"These are settings passed to the aspect configuration. For instance:"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'{\n "teambit.dependencies/dependency-resolver": {\n "networkConcurrency": 4\n }\n}\n')),(0,o.mdx)("h3",null,"networkConcurrency"),(0,o.mdx)("p",null,"Controls the maximum number of HTTP(S) requests to process simultaneously."),(0,o.mdx)("h3",null,"fetchRetries"),(0,o.mdx)("p",null,"How many times to retry if Bit fails to fetch from the registry."),(0,o.mdx)("h3",null,"fetchRetryFactor"),(0,o.mdx)("p",null,"The exponential factor for retry backoff."),(0,o.mdx)("h3",null,"fetchRetryMintimeout"),(0,o.mdx)("p",null,"The minimum (base) timeout for retrying requests."),(0,o.mdx)("h3",null,"fetchRetryMaxtimeout"),(0,o.mdx)("p",null,"The maximum fallback timeout to ensure the retry factor does not make requests too long."),(0,o.mdx)("h3",null,"fetchTimeout"),(0,o.mdx)("p",null,"The maximum amount of time (in milliseconds) to wait for HTTP requests to complete."),(0,o.mdx)("h3",null,"maxSockets"),(0,o.mdx)("p",null,"The maximum number of connections to use per origin (protocol/host/port combination)."),(0,o.mdx)("h2",null,"Overrides"),(0,o.mdx)("p",null,"This field allows you to instruct Bit to override any dependency in the dependency graph. This is useful to enforce all your packages to use a single version of a dependency, backport a fix, or replace a dependency with a fork."),(0,o.mdx)("p",null,"An example of the ",(0,o.mdx)("inlineCode",{parentName:"p"},'"overrides"')," field:"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'{\n "@teambit.dependencies/dependency-resolver": {\n "overrides": {\n "foo": "^1.0.0",\n "quux": "npm:@myorg/quux@^1.0.0",\n "bar@^2.1.0": "3.0.0",\n "qar@1>zoo": "2"\n }\n }\n}\n')),(0,o.mdx)("p",null,"You may specify the package the overriden dependency belongs to by separating the package selector from the dependency selector with a ",(0,o.mdx)("inlineCode",{parentName:"p"},'">"'),", for example ",(0,o.mdx)("inlineCode",{parentName:"p"},"qar@1>zoo")," will only override the ",(0,o.mdx)("inlineCode",{parentName:"p"},"zoo")," dependency of ",(0,o.mdx)("inlineCode",{parentName:"p"},"qar@1"),", not for any other dependencies."),(0,o.mdx)("h2",null,"Side-Effects cache"),(0,o.mdx)("p",null,"By default, when pnpm is set as the package manager, build artifacts are cached. So when installing a package with pre/postinstall hooks, it is only built the first time it is installed on a computer."),(0,o.mdx)("p",null,"Side-effects cache can be turned off by setting the ",(0,o.mdx)("inlineCode",{parentName:"p"},"sideEffectsCache")," field to ",(0,o.mdx)("inlineCode",{parentName:"p"},"false"),":"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'{\n "@teambit.dependencies/dependency-resolver": {\n "sideEffectsCache": false\n }\n}\n')),(0,o.mdx)("h2",null,"Node.js engine checks"),(0,o.mdx)("p",null,"If you want to prevent contributors of your project from adding new incompatible dependencies, use ",(0,o.mdx)("inlineCode",{parentName:"p"},"nodeVersion")," and ",(0,o.mdx)("inlineCode",{parentName:"p"},"engineStrict")," in your ",(0,o.mdx)("inlineCode",{parentName:"p"},"workspace.jsonc"),":"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'{\n "@teambit.dependencies/dependency-resolver": {\n "engineStrict": true,\n "nodeVersion": "12.22.0"\n }\n}\n')),(0,o.mdx)("p",null,"This way, even if someone is using Node.js v16, they will not be able to install a new dependency that doesn't support Node.js v12.22.0."),(0,o.mdx)("p",null,"NOTE: This works only with pnpm currently."),(0,o.mdx)("h2",null,"peerDependencyRules"),(0,o.mdx)("h3",null,"peerDependencyRules.ignoreMissing"),(0,o.mdx)("p",null,"Bit will not print warnings about missing peer dependencies from this list."),(0,o.mdx)("p",null,"For instance, with the following configuration, Bit will not print warnings if a dependency needs ",(0,o.mdx)("inlineCode",{parentName:"p"},"react")," but ",(0,o.mdx)("inlineCode",{parentName:"p"},"react")," is not installed:"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'{\n "@teambit.dependencies/dependency-resolver": {\n "peerDependencyRules": {\n "ignoreMissing": ["react"]\n }\n }\n}\n')),(0,o.mdx)("p",null,"Package name patterns may also be used:"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'{\n "@teambit.dependencies/dependency-resolver": {\n "peerDependencyRules": {\n "ignoreMissing": ["@babel/*", "@eslint/*"]\n }\n }\n}\n')),(0,o.mdx)("h3",null,"peerDependencyRules.allowedVersions"),(0,o.mdx)("p",null,"Unmet peer dependency warnings will not be printed for peer dependencies of the specified range."),(0,o.mdx)("p",null,"For instance, if you have some dependencies that need ",(0,o.mdx)("inlineCode",{parentName:"p"},"react@16")," but you know that they work fine with ",(0,o.mdx)("inlineCode",{parentName:"p"},"react@17"),", then you may use the following configuration:"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'{\n "@teambit.dependencies/dependency-resolver": {\n "peerDependencyRules": {\n "allowedVersions": {\n "react": "17"\n }\n }\n }\n}\n')),(0,o.mdx)("p",null,"This will tell Bit that any dependency that has react in its peer dependencies should allow ",(0,o.mdx)("inlineCode",{parentName:"p"},"react")," v17 to be installed."),(0,o.mdx)("h3",null,"peerDependencyRules.allowAny"),(0,o.mdx)("p",null,(0,o.mdx)("inlineCode",{parentName:"p"},"allowAny")," is an array of package name patterns, any peer dependency matching the pattern will be resolved from any version, regardless of the range specified in ",(0,o.mdx)("inlineCode",{parentName:"p"},"peerDependencies"),". For instance:"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'{\n "@teambit.dependencies/dependency-resolver": {\n "peerDependencyRules": {\n "allowAny": ["@babel/*", "eslint"]\n }\n }\n}\n')),(0,o.mdx)("p",null,"The above setting will mute any warnings about peer dependency version mismatches related to ",(0,o.mdx)("inlineCode",{parentName:"p"},"@babel/")," packages or ",(0,o.mdx)("inlineCode",{parentName:"p"},"eslint"),"."),(0,o.mdx)("h2",null,"Build"),(0,o.mdx)("h3",null,"neverBuiltDependencies"),(0,o.mdx)("p",null,'This field allows to ignore the builds of specific dependencies. The "preinstall", "install", and "postinstall" scripts of the listed packages will not be executed during installation.'),(0,o.mdx)("p",null,'An example of the "neverBuiltDependencies" field:'),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'{\n "@teambit.dependencies/dependency-resolver": {\n "neverBuiltDependencies": ["fsevents", "level"]\n }\n}\n')),(0,o.mdx)("h2",null,"CLI reference"),(0,o.mdx)("h3",null,"install"),(0,o.mdx)("blockquote",null,(0,o.mdx)("p",{parentName:"blockquote"},"By default, the Dependency Resolver installs packages from Bit.dev's registry. The authentication for that registry is via your Bit.dev token, listed under ",(0,o.mdx)("inlineCode",{parentName:"p"},"@bit"),", in your ",(0,o.mdx)("inlineCode",{parentName:"p"},".npmrc")," file.\nIf that token cannot be found in the ",(0,o.mdx)("inlineCode",{parentName:"p"},".npmrc")," file, Bit will look for it in your global Bit configurations (use the ",(0,o.mdx)("inlineCode",{parentName:"p"},"bit config")," command to output your ",(0,o.mdx)("inlineCode",{parentName:"p"},"user.token")," property)."),(0,o.mdx)("br",null),"If your npm is configured to use a registry other than npmjs's, then the Dependency Resolver will use that configured registry, instead."),(0,o.mdx)("blockquote",null,(0,o.mdx)("p",{parentName:"blockquote"},"The 'install' process includes importing components and linking them to the ",(0,o.mdx)("inlineCode",{parentName:"p"},"node_modules")," directory.")),(0,o.mdx)("h5",null,"Install all dependencies listed in the Dependency Resolver configuration:"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-bash"},"bit install\n")),(0,o.mdx)("h5",null,"Install the latest version of a package:"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-bash"},"bit install <package>\n\n// For example\nbit install lodash\n")),(0,o.mdx)("h5",null,"Install a specific version of a package:"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-bash"},"bit install <package>@<version>\n\n// For example\nbit install lodash@1.0.0\n")),(0,o.mdx)("h5",null,"Install packages without importing components"),(0,o.mdx)("p",null,"The 'install' process includes importing components listed in the ",(0,o.mdx)("inlineCode",{parentName:"p"},".bitmap")," file and linking them to the ",(0,o.mdx)("inlineCode",{parentName:"p"},"node_modules")," directory.\nTo disable importing and install all packages and components as standard packages use:"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-bash"},"bit install --skip-import\n")))}c.__bit_component=a,c.isMDXComponent=!0},844:(e,n,t)=>{Object.defineProperty(n,"Q",{enumerable:!0,get:function(){return a.default}});var a=o(t(979));function o(e){return e&&e.__esModule?e:{default:e}}o.__bit_component={id:"teambit.dependencies/aspect-docs/dependency-resolver@0.0.178",homepage:"https://bit.cloud/teambit/dependencies/aspect-docs/dependency-resolver",exported:!0}},392:(e,n,t)=>{var a={id:"teambit.dependencies/dependency-resolver@1.0.486",homepage:"https://bit.cloud/teambit/dependencies/dependency-resolver",exported:!0};function o(){const e=i(t(594));return o=function(){return e},e}function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0}),n.Logo=void 0,o.__bit_component=a,i.__bit_component=a;const d=()=>o().default.createElement("div",{style:{height:"100%",display:"flex",justifyContent:"center"}},o().default.createElement("img",{style:{width:70},src:"https://static.bit.dev/extensions-icons/dependencies.svg"}));d.__bit_component=a,n.Logo=d},16:e=>{e.exports=MdxJsReact},594:e=>{e.exports=React}},n={};function t(a){var o=n[a];if(void 0!==o)return o.exports;var i=n[a]={exports:{}};return e[a](i,i.exports,t),i.exports}t.d=(e,n)=>{for(var a in n)t.o(n,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:n[a]})},t.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};t.r(a),t.d(a,{compositions:()=>h,compositions_metadata:()=>y,overview:()=>x});var o={};t.r(o),t.d(o,{default:()=>u});var i=t(392),d=(t(594),t(16));const r=TeambitMdxUiMdxScopeContext;var l=t(844),s=["components"];function p(){return p=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var a in t)({}).hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},p.apply(null,arguments)}var m={},c="wrapper";function u(e){var n=e.components,t=function(e,n){if(null==e)return{};var t,a,o=function(e,n){if(null==e)return{};var t={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(n.includes(a))continue;t[a]=e[a]}return t}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)t=i[a],n.includes(t)||{}.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}(e,s);return(0,d.mdx)(c,p({},m,t,{components:n,mdxType:"MDXLayout"}),(0,d.mdx)(r.MDXScopeProvider,{components:{DependencyResolver:l.Q},mdxType:"MDXScopeProvider"},(0,d.mdx)(l.Q,{mdxType:"DependencyResolver"})))}u.isMDXComponent=!0;const h=[i],x=[o],y={compositions:[{displayName:"Logo",identifier:"Logo"}]};return a})()));
|
package/artifacts/schema.json
CHANGED
|
@@ -56453,7 +56453,7 @@
|
|
|
56453
56453
|
"componentId": {
|
|
56454
56454
|
"scope": "teambit.dependencies",
|
|
56455
56455
|
"name": "dependency-resolver",
|
|
56456
|
-
"version": "1.0.
|
|
56456
|
+
"version": "1.0.486"
|
|
56457
56457
|
},
|
|
56458
56458
|
"taggedModuleExports": []
|
|
56459
56459
|
}
|
|
@@ -4,7 +4,7 @@ import { compact } from 'lodash';
|
|
|
4
4
|
import { ComponentID } from '@teambit/component-id';
|
|
5
5
|
import { Dependency as LegacyDependency } from '@teambit/legacy/dist/consumer/component/dependencies';
|
|
6
6
|
import LegacyComponent from '@teambit/legacy/dist/consumer/component';
|
|
7
|
-
import { ExtensionDataEntry } from '@teambit/legacy
|
|
7
|
+
import type { ExtensionDataEntry } from '@teambit/legacy.extension-data';
|
|
8
8
|
import { componentIdToPackageName } from '@teambit/pkg.modules.component-package-name';
|
|
9
9
|
import { ComponentDependency, SerializedComponentDependency, TYPE } from './component-dependency';
|
|
10
10
|
import { DependencyLifecycleType } from '../dependency';
|
|
@@ -55,7 +55,7 @@ export class ComponentDependencyFactory implements DependencyFactory {
|
|
|
55
55
|
const peerDeps = await mapSeries(legacyComponent.peerDependencies.get(), (dep) =>
|
|
56
56
|
this.transformLegacyComponentDepToSerializedDependency(dep, 'peer')
|
|
57
57
|
);
|
|
58
|
-
const extensionDeps = await mapSeries(legacyComponent.extensions, (extension) =>
|
|
58
|
+
const extensionDeps = await mapSeries(legacyComponent.extensions, (extension: ExtensionDataEntry) =>
|
|
59
59
|
this.transformLegacyComponentExtensionToSerializedDependency(extension, 'dev')
|
|
60
60
|
);
|
|
61
61
|
const filteredExtensionDeps: SerializedComponentDependency[] = compact(extensionDeps);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_pMapSeries","data","_interopRequireDefault","require","_lodash","_componentId","_pkgModules","_componentDependency","_dependencyList","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","ComponentDependencyFactory","constructor","componentAspect","type","TYPE","parse","serialized","id","componentId","ComponentID","scope","fromObject","Error","ComponentDependency","isExtension","packageName","version","lifecycle","source","hidden","optional","versionRange","fromLegacyComponent","legacyComponent","runtimeDeps","mapSeries","dependencies","get","dep","transformLegacyComponentDepToSerializedDependency","devDeps","devDependencies","peerDeps","peerDependencies","extensionDeps","extensions","extension","transformLegacyComponentExtensionToSerializedDependency","filteredExtensionDeps","compact","serializedComponentDeps","componentDeps","dependencyList","DependencyList","legacyDep","host","getHost","depComponent","getLegacyMinimal","componentIdToPackageName","toString","serialize","_legacy","getVersion","__type","extensionId","undefined","extComponent","state","_consumer","exports"],"sources":["component-dependency-factory.ts"],"sourcesContent":["import mapSeries from 'p-map-series';\nimport { ComponentMain } from '@teambit/component';\nimport { compact } from 'lodash';\nimport { ComponentID } from '@teambit/component-id';\nimport { Dependency as LegacyDependency } from '@teambit/legacy/dist/consumer/component/dependencies';\nimport LegacyComponent from '@teambit/legacy/dist/consumer/component';\nimport { ExtensionDataEntry } from '@teambit/legacy/dist/consumer/config';\nimport { componentIdToPackageName } from '@teambit/pkg.modules.component-package-name';\nimport { ComponentDependency, SerializedComponentDependency, TYPE } from './component-dependency';\nimport { DependencyLifecycleType } from '../dependency';\nimport { DependencyFactory } from '../dependency-factory';\nimport { DependencyList } from '../dependency-list';\n\nexport class ComponentDependencyFactory implements DependencyFactory {\n type: string;\n\n constructor(private componentAspect: ComponentMain) {\n this.type = TYPE;\n }\n\n // TODO: solve this generics issue and remove the ts-ignore\n // @ts-ignore\n parse<ComponentDependency, S extends SerializedComponentDependency>(serialized: S): ComponentDependency {\n let id;\n\n if (serialized.componentId instanceof ComponentID) {\n id = serialized.componentId;\n } else if (typeof serialized.componentId === 'object' && serialized.componentId.scope) {\n id = ComponentID.fromObject(serialized.componentId as any);\n } else {\n throw new Error(`ComponentDependencyFactory, unable to parse ${serialized.componentId}`);\n }\n\n return new ComponentDependency(\n id,\n serialized.isExtension,\n serialized.packageName,\n serialized.id,\n serialized.version,\n serialized.lifecycle as DependencyLifecycleType,\n serialized.source,\n serialized.hidden,\n serialized.optional,\n serialized.versionRange\n ) as unknown as ComponentDependency;\n }\n\n async fromLegacyComponent(legacyComponent: LegacyComponent): Promise<DependencyList> {\n const runtimeDeps = await mapSeries(legacyComponent.dependencies.get(), (dep) =>\n this.transformLegacyComponentDepToSerializedDependency(dep, 'runtime')\n );\n const devDeps = await mapSeries(legacyComponent.devDependencies.get(), (dep) =>\n this.transformLegacyComponentDepToSerializedDependency(dep, 'dev')\n );\n const peerDeps = await mapSeries(legacyComponent.peerDependencies.get(), (dep) =>\n this.transformLegacyComponentDepToSerializedDependency(dep, 'peer')\n );\n const extensionDeps = await mapSeries(legacyComponent.extensions, (extension) =>\n this.transformLegacyComponentExtensionToSerializedDependency(extension, 'dev')\n );\n const filteredExtensionDeps: SerializedComponentDependency[] = compact(extensionDeps);\n const serializedComponentDeps = [...runtimeDeps, ...devDeps, ...peerDeps, ...filteredExtensionDeps];\n const componentDeps: ComponentDependency[] = await mapSeries(serializedComponentDeps, (dep) => this.parse(dep));\n const dependencyList = new DependencyList(componentDeps);\n return dependencyList;\n }\n\n private async transformLegacyComponentDepToSerializedDependency(\n legacyDep: LegacyDependency,\n lifecycle: DependencyLifecycleType\n ): Promise<SerializedComponentDependency> {\n let packageName = legacyDep.packageName || '';\n if (!packageName) {\n const host = this.componentAspect.getHost();\n const id = legacyDep.id;\n const depComponent = await host.getLegacyMinimal(id);\n if (depComponent) {\n packageName = componentIdToPackageName(depComponent);\n }\n }\n\n return {\n id: legacyDep.id.toString(),\n isExtension: false,\n packageName,\n componentId: legacyDep.id.serialize(),\n version: legacyDep.id._legacy.getVersion().toString(),\n versionRange: legacyDep.versionRange,\n __type: TYPE,\n lifecycle,\n };\n }\n\n private async transformLegacyComponentExtensionToSerializedDependency(\n extension: ExtensionDataEntry,\n lifecycle: DependencyLifecycleType\n ): Promise<SerializedComponentDependency | undefined> {\n if (!extension.extensionId) {\n return undefined;\n }\n const host = this.componentAspect.getHost();\n const id = extension.extensionId;\n const extComponent = await host.get(id);\n let packageName = '';\n if (extComponent) {\n packageName = componentIdToPackageName(extComponent.state._consumer);\n }\n return {\n id: extension.extensionId.toString(),\n isExtension: true,\n packageName,\n componentId: extension.extensionId.serialize(),\n version: extension.extensionId._legacy.getVersion().toString(),\n __type: TYPE,\n lifecycle,\n };\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,a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CAAA5D,0BAAA,GAAAA,0BAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_pMapSeries","data","_interopRequireDefault","require","_lodash","_componentId","_pkgModules","_componentDependency","_dependencyList","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","ComponentDependencyFactory","constructor","componentAspect","type","TYPE","parse","serialized","id","componentId","ComponentID","scope","fromObject","Error","ComponentDependency","isExtension","packageName","version","lifecycle","source","hidden","optional","versionRange","fromLegacyComponent","legacyComponent","runtimeDeps","mapSeries","dependencies","get","dep","transformLegacyComponentDepToSerializedDependency","devDeps","devDependencies","peerDeps","peerDependencies","extensionDeps","extensions","extension","transformLegacyComponentExtensionToSerializedDependency","filteredExtensionDeps","compact","serializedComponentDeps","componentDeps","dependencyList","DependencyList","legacyDep","host","getHost","depComponent","getLegacyMinimal","componentIdToPackageName","toString","serialize","_legacy","getVersion","__type","extensionId","undefined","extComponent","state","_consumer","exports"],"sources":["component-dependency-factory.ts"],"sourcesContent":["import mapSeries from 'p-map-series';\nimport { ComponentMain } from '@teambit/component';\nimport { compact } from 'lodash';\nimport { ComponentID } from '@teambit/component-id';\nimport { Dependency as LegacyDependency } from '@teambit/legacy/dist/consumer/component/dependencies';\nimport LegacyComponent from '@teambit/legacy/dist/consumer/component';\nimport type { ExtensionDataEntry } from '@teambit/legacy.extension-data';\nimport { componentIdToPackageName } from '@teambit/pkg.modules.component-package-name';\nimport { ComponentDependency, SerializedComponentDependency, TYPE } from './component-dependency';\nimport { DependencyLifecycleType } from '../dependency';\nimport { DependencyFactory } from '../dependency-factory';\nimport { DependencyList } from '../dependency-list';\n\nexport class ComponentDependencyFactory implements DependencyFactory {\n type: string;\n\n constructor(private componentAspect: ComponentMain) {\n this.type = TYPE;\n }\n\n // TODO: solve this generics issue and remove the ts-ignore\n // @ts-ignore\n parse<ComponentDependency, S extends SerializedComponentDependency>(serialized: S): ComponentDependency {\n let id;\n\n if (serialized.componentId instanceof ComponentID) {\n id = serialized.componentId;\n } else if (typeof serialized.componentId === 'object' && serialized.componentId.scope) {\n id = ComponentID.fromObject(serialized.componentId as any);\n } else {\n throw new Error(`ComponentDependencyFactory, unable to parse ${serialized.componentId}`);\n }\n\n return new ComponentDependency(\n id,\n serialized.isExtension,\n serialized.packageName,\n serialized.id,\n serialized.version,\n serialized.lifecycle as DependencyLifecycleType,\n serialized.source,\n serialized.hidden,\n serialized.optional,\n serialized.versionRange\n ) as unknown as ComponentDependency;\n }\n\n async fromLegacyComponent(legacyComponent: LegacyComponent): Promise<DependencyList> {\n const runtimeDeps = await mapSeries(legacyComponent.dependencies.get(), (dep) =>\n this.transformLegacyComponentDepToSerializedDependency(dep, 'runtime')\n );\n const devDeps = await mapSeries(legacyComponent.devDependencies.get(), (dep) =>\n this.transformLegacyComponentDepToSerializedDependency(dep, 'dev')\n );\n const peerDeps = await mapSeries(legacyComponent.peerDependencies.get(), (dep) =>\n this.transformLegacyComponentDepToSerializedDependency(dep, 'peer')\n );\n const extensionDeps = await mapSeries(legacyComponent.extensions, (extension: ExtensionDataEntry) =>\n this.transformLegacyComponentExtensionToSerializedDependency(extension, 'dev')\n );\n const filteredExtensionDeps: SerializedComponentDependency[] = compact(extensionDeps);\n const serializedComponentDeps = [...runtimeDeps, ...devDeps, ...peerDeps, ...filteredExtensionDeps];\n const componentDeps: ComponentDependency[] = await mapSeries(serializedComponentDeps, (dep) => this.parse(dep));\n const dependencyList = new DependencyList(componentDeps);\n return dependencyList;\n }\n\n private async transformLegacyComponentDepToSerializedDependency(\n legacyDep: LegacyDependency,\n lifecycle: DependencyLifecycleType\n ): Promise<SerializedComponentDependency> {\n let packageName = legacyDep.packageName || '';\n if (!packageName) {\n const host = this.componentAspect.getHost();\n const id = legacyDep.id;\n const depComponent = await host.getLegacyMinimal(id);\n if (depComponent) {\n packageName = componentIdToPackageName(depComponent);\n }\n }\n\n return {\n id: legacyDep.id.toString(),\n isExtension: false,\n packageName,\n componentId: legacyDep.id.serialize(),\n version: legacyDep.id._legacy.getVersion().toString(),\n versionRange: legacyDep.versionRange,\n __type: TYPE,\n lifecycle,\n };\n }\n\n private async transformLegacyComponentExtensionToSerializedDependency(\n extension: ExtensionDataEntry,\n lifecycle: DependencyLifecycleType\n ): Promise<SerializedComponentDependency | undefined> {\n if (!extension.extensionId) {\n return undefined;\n }\n const host = this.componentAspect.getHost();\n const id = extension.extensionId;\n const extComponent = await host.get(id);\n let packageName = '';\n if (extComponent) {\n packageName = componentIdToPackageName(extComponent.state._consumer);\n }\n return {\n id: extension.extensionId.toString(),\n isExtension: true,\n packageName,\n componentId: extension.extensionId.serialize(),\n version: extension.extensionId._legacy.getVersion().toString(),\n __type: TYPE,\n lifecycle,\n };\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,aAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,YAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIA,SAAAK,YAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,WAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,qBAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,oBAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAO,gBAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK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ACnED,SAA6B,EAC7BnB,SAAkC,EACkB;IACpD,IAAI,CAACmB,SAAS,CAACmB,WAAW,EAAE;MAC1B,OAAOC,SAAS;IAClB;IACA,MAAMX,IAAI,GAAG,IAAI,CAAC3C,eAAe,CAAC4C,OAAO,CAAC,CAAC;IAC3C,MAAMvC,EAAE,GAAG6B,SAAS,CAACmB,WAAW;IAChC,MAAME,YAAY,GAAG,MAAMZ,IAAI,CAAClB,GAAG,CAACpB,EAAE,CAAC;IACvC,IAAIQ,WAAW,GAAG,EAAE;IACpB,IAAI0C,YAAY,EAAE;MAChB1C,WAAW,GAAG,IAAAkC,sCAAwB,EAACQ,YAAY,CAACC,KAAK,CAACC,SAAS,CAAC;IACtE;IACA,OAAO;MACLpD,EAAE,EAAE6B,SAAS,CAACmB,WAAW,CAACL,QAAQ,CAAC,CAAC;MACpCpC,WAAW,EAAE,IAAI;MACjBC,WAAW;MACXP,WAAW,EAAE4B,SAAS,CAACmB,WAAW,CAACJ,SAAS,CAAC,CAAC;MAC9CnC,OAAO,EAAEoB,SAAS,CAACmB,WAAW,CAACH,OAAO,CAACC,UAAU,CAAC,CAAC,CAACH,QAAQ,CAAC,CAAC;MAC9DI,MAAM,EAAElD,2BAAI;MACZa;IACF,CAAC;EACH;AACF;AAAC2C,OAAA,CAAA5D,0BAAA,GAAAA,0BAAA","ignoreList":[]}
|
|
@@ -6,7 +6,7 @@ import { RequireableComponent } from '@teambit/harmony.modules.requireable-compo
|
|
|
6
6
|
import type { LoggerMain } from '@teambit/logger';
|
|
7
7
|
import { GraphqlMain } from '@teambit/graphql';
|
|
8
8
|
import { Logger } from '@teambit/logger';
|
|
9
|
-
import { ExtensionDataList } from '@teambit/legacy
|
|
9
|
+
import { ExtensionDataList } from '@teambit/legacy.extension-data';
|
|
10
10
|
import { ProxyConfig, NetworkConfig } from '@teambit/legacy/dist/scope/network/http';
|
|
11
11
|
import { onTagIdTransformer } from '@teambit/snapping';
|
|
12
12
|
import LegacyComponent from '@teambit/legacy/dist/consumer/component';
|
|
@@ -121,9 +121,9 @@ function _constants() {
|
|
|
121
121
|
};
|
|
122
122
|
return data;
|
|
123
123
|
}
|
|
124
|
-
function
|
|
125
|
-
const data = require("@teambit/legacy
|
|
126
|
-
|
|
124
|
+
function _legacy() {
|
|
125
|
+
const data = require("@teambit/legacy.extension-data");
|
|
126
|
+
_legacy = function () {
|
|
127
127
|
return data;
|
|
128
128
|
};
|
|
129
129
|
return data;
|
|
@@ -1458,7 +1458,7 @@ class DependencyResolverMain {
|
|
|
1458
1458
|
}
|
|
1459
1459
|
});
|
|
1460
1460
|
};
|
|
1461
|
-
|
|
1461
|
+
_legacy().ExtensionDataList.toModelObjectsHook.push(serializeDepResolverDataBeforePersist);
|
|
1462
1462
|
_workspaceModules().PackageJsonTransformer.registerPackageJsonTransformer(async (component, packageJsonObject) => {
|
|
1463
1463
|
const deps = dependencyResolver.getDependencies(component);
|
|
1464
1464
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_multimatch","data","_interopRequireDefault","require","_pMapSeries","_harmonyModules","_cli","_bit","_workspace","_component","_path","_lodash","_config","_envs","_harmony","_graphql","_logger","_constants","_extensionData","_pkgModules","_dependencies","_http","_component2","_fsExtra","_componentId","_network","_semver","_interopRequireWildcard","_aspectLoader","_globalConfig","_workspaceModules","_registry","_applyUpdates","_constants2","_dependencyInstaller","_dependencyResolver","_dependencyVersionResolver","_dependencyLinker","_getAllPolicyPkgs","_exceptions","_manifest","_policy","_dependencies2","_showFragments","_dependencyResolver2","_dependencies3","_envPolicy","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ownKeys","keys","getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","_toPropertyKey","value","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","BIT_CLOUD_REGISTRY","exports","getCloudDomain","NPM_REGISTRY","defaultLinkingOptions","linkTeambitBit","linkCoreAspects","defaultCreateFromComponentsOptions","filterComponentsFromManifests","createManifestForComponentsWithoutDependencies","DependencyResolverMain","constructor","config","rootPolicyRegistry","policiesRegistry","envs","logger","configAspect","aspectLoader","globalConfig","componentAspect","packageManagerSlot","dependencyFactorySlot","preInstallSlot","postInstallSlot","Set","supportsDedupingOnExistingRoot","packageManager","getPackageManager","isolatedCapsules","setConfig","hasRootComponents","Boolean","rootComponents","getSync","CFG_ISOLATED_SCOPE_CAPSULES","defaultVal","undefined","res","hasHarmonyInRootPolicy","rootPolicy","getWorkspacePolicyFromConfig","entries","some","dependencyId","nodeLinker","packageManagerName","pmName","defaultConfig","registerPackageManager","register","registerDependencyFactories","factories","registerPreInstallSubscribers","subscribers","registerPostInstallSubscribers","getSavePrefix","savePrefix","getVersionWithSavePrefix","version","overridePrefix","wantedRange","semver","parse","prerelease","includes","prefix","versionWithPrefix","validRange","InvalidVersionWithPrefix","getPolicy","component","entry","state","aspects","DependencyResolverAspect","id","VariantPolicy","getEmpty","serializedPolicy","extractDepsFromLegacy","policy","componentPolicy","legacyComponent","_consumer","listFactory","getDependencyListFactory","dependencyList","fromLegacyComponent","dep","found","find","packageName","getPackageName","source","hidden","optional","values","flat","factoriesMap","reduce","acc","factory","type","DependencyListFactory","getDependencies","includeHidden","DependencyList","fromArray","serializedDependencies","dependencies","depList","getDependenciesFromSerializedDependencies","filterHidden","getDependenciesFromLegacyComponent","extensions","findCoreExtension","getComponentDependencies","deps","fromSerializedDependencies","getWorkspacePolicy","_workspacePolicy","policyFromConfig","externalPolicies","toArray","map","mergeWorkspacePolices","getWorkspacePolicyManifest","workspacePolicy","toManifest","clearCache","WorkspacePolicyFactory","fromConfigObject","getWorkspacePolicyFromConfigObject","obj","getWorkspacePolicyFromPackageJson","packageJson","fromPackageJson","polices","WorkspacePolicy","mergePolices","getWorkspaceManifest","name","ROOT_NAME","SemVer","rootDir","components","options","context","statusMessage","inCapsule","setStatusLine","concreteOpts","workspaceManifestFactory","WorkspaceManifestFactory","createFromComponents","consoleSuccess","getDepResolverData","calcPackageName","createComponentIdByPkgNameMap","componentIdByPkgName","Map","componentIdToPackageName","getRuntimeModulePath","modulePath","getModulePath","pkgName","rootComponentsRelativePath","relative","workspacePath","rootComponentsPath","getRelativeRootComponentDir","getRootComponentDir","bind","selfRootDir","isInWorkspace","toStringWithoutVersion","toString","fs","pathExistsSync","innerDir","join","dirInEnvRoot","getComponentDirInBitRoots","envId","getEnvId","relativePath","addDependenciesGraph","componentRelativeDir","dependenciesGraph","calcDependenciesGraph","componentRootDir","err","isFeatureEnabled","DEPS_GRAPH","getInstaller","cacheRootDir","cacheRootDirectory","CFG_PACKAGE_MANAGER_CACHE","PackageManagerNotFound","debug","ensureDirSync","preInstallSubscribers","getPreInstallSubscribers","postInstallSubscribers","getPostInstallSubscribers","DependencyInstaller","packageImportMethod","sideEffectsCache","nodeVersion","engineStrict","peerDependencyRules","neverBuiltDependencies","preferOffline","installingContext","getLinker","linkingOptions","assign","DependencyLinker","linkingContext","getPackageManagerName","getVersionResolver","networkConcurrency","getNetworkConfig","DependencyVersionResolver","getCompIdsThatShouldNotBeInPolicy","getAllCoreAspectsIds","getSystemPackageManager","defaultPm","Error","getProxyConfig","proxyConfigFromDepResolverConfig","getProxyConfigFromDepResolverConfig","httpProxy","httpsProxy","proxyConfigFromPackageManager","getProxyConfigFromPackageManager","proxyConfigFromGlobalConfig","getProxyConfigFromGlobalConfig","proxy","noProxy","networkConfig","getNetworkConfigFromGlobalConfig","getNetworkConfigFromPackageManager","getNetworkConfigFromDepResolverConfig","JSON","stringify","key","globalNetworkConfig","Http","ca","cafile","readCAFileSync","pick","strictSsl","strictSSL","toLowerCase","networkConfigFromPackageManager","systemPm","getMissingPeerDependencies","componentDirectoryMap","peerDependencyIssues","installer","manifests","getComponentManifests","getPeerDependencyIssues","intersections","getRegistries","registries","getDefaultBitRegistry","bitGlobalConfigRegistry","CFG_REGISTRY_URL_KEY","bitRegistry","bitOriginalAuthType","bitAuthHeaderValue","bitOriginalAuthValue","getBitAuthConfig","alwaysAuth","bitDefaultRegistry","Registry","installFromBitDevRegistry","defaultRegistry","uri","startsWith","setDefaultRegistry","addAuthToScopedBitRegistries","updatedRegistries","scopes","registry","authHeaderValue","registryWithAuth","updateScopedRegistry","bitGlobalConfigToken","CFG_USER_TOKEN_KEY","addToRootPolicy","add","updateConfigPolicy","removeFromRootPolicy","dependencyIds","workspacePolicyUpdated","remove","isRemoved","workspacePolicyObject","toConfigObject","setExtension","overrideExisting","ignoreVersion","persistConfig","reasonForChange","workspaceConfig","write","registerDependenciesPolicies","registerRootPolicy","getComponentEnvPolicyFromExtension","configuredExtensions","calculateEnvIdFromExtensions","isCoreEnv","env","calculateEnvFromExtensions","getComponentEnvPolicyFromEnv","fromFile","getEnvPolicyFromFile","getEnvPolicyFromEnvId","legacyFiles","envDef","getEnvDefinitionById","getEnvPolicyFromEnvLegacyId","getComponentEnvPolicy","calculateEnvId","envIdWithoutVersion","getEnv","envsWithoutManifest","getEnvManifest","envComponent","object","allPoliciesFromEnv","EnvPolicy","includeLegacyPeersInSelfPolicy","mergeEnvManifestPolicy","parent","child","cloneDeep","childEntries","foundChildEntry","childEntry","concat","getEnvComponentByEnvId","policiesFromEnvConfig","idWithoutVersion","split","getComponentEnvPolicyFromEnvDefinition","getPreviewHostDependenciesFromEnv","hostDeps","getAdditionalHostDependencies","uniq","mergeVariantPolicies","policiesFromSlots","policiesFromConfig","policiesFromEnv","configuredIds","ids","policiesTuples","extId","policyTupleToApply","policyRegistrar","currentPolicy","currentExtension","findExtension","currentConfig","policiesFromEnvForItself","getPoliciesFromEnvForItself","result","envPolicy","selfPolicy","updateDepsOnLegacyTag","idTransformer","__type","COMPONENT_DEP_TYPE","depId","componentId","ComponentID","fromObject","newDepId","serialize","registerDetector","detector","DetectorHook","hooks","calcComponentEnvDepDetectors","depEnv","getDepDetectors","onLoadRequireableExtensionSubscriber","requireableExtension","manifest","parentComponent","resolveRequireableExtensionManifestDepsVersionsRecursively","resolvedParentComponent","resolvedParentDeps","updateDirectDepsVersions","mapSeries","isCoreAspect","parentComponentId","getHost","resolveComponentId","error","resolvedDep","findDependency","cloneManifest","_runtimes","runtime","getOutdatedPkgsFromPolicies","variantPoliciesByPatterns","componentPolicies","patterns","forceVersionBump","localComponentPkgNames","componentModelVersions","Promise","all","lifecycle","isAuto","lifecycleType","allPkgs","getAllPolicyPkgs","selectedPkgNames","multimatch","outdatedPkgs","getOutdatedPkgs","mergeOutdatedPkgs","pkgs","resolver","tryResolve","spec","resolveRemoteVersion","compact","pkg","latestVersion","newVersionRange","currentRange","pkgSource","currentVersion","valid","replace","gt","latestRange","repeatPrefix","applyUpdates","updatedVariants","updatedComponents","updatedWorkspacePolicyEntries","updateExisting","provider","loggerExt","configMain","graphql","createLogger","dependencyResolver","registerShowFragments","DependenciesFragment","DevDependenciesFragment","PeerDependenciesFragment","ComponentDependencyFactory","LegacyComponent","registerOnComponentOverridesLoading","toLegacyDepsOverrides","registerOnLoadRequireableExtensionSlot","dependencyResolverSchema","registerService","DependenciesService","registerEnvJsoncMergeCustomizer","serializeDepResolverDataBeforePersist","extDataList","ExtensionDataList","toModelObjectsHook","PackageJsonTransformer","registerPackageJsonTransformer","packageJsonObject","optionalDependencies","peerDependenciesMeta","toDependenciesManifest","peer","bit","defaultPeerRange","getEmptyDepsObject","devDependencies","peerDependencies","getInjectedDirs","componentDir","getWorkspaceDepsOfBitRoots","MainRuntime","EnvsAspect","LoggerAspect","ConfigAspect","AspectLoaderAspect","ComponentAspect","GraphqlAspect","GlobalConfigAspect","Slot","withType","addRuntime","originalSpec","newVersion","opts","major","minor","mergedOutdatedPkgs","outdatedPkgsNotFromComponentModel","outdatedPkg","omit","dependentComponents","hasDifferentRanges","tryPickLowestRange","targetField","range1","range2","lt","rangeToVersion","range","substring"],"sources":["dependency-resolver.main.runtime.ts"],"sourcesContent":["import multimatch from 'multimatch';\nimport mapSeries from 'p-map-series';\nimport { DEPS_GRAPH, isFeatureEnabled } from '@teambit/harmony.modules.feature-toggle';\nimport { MainRuntime } from '@teambit/cli';\nimport { getAllCoreAspectsIds } from '@teambit/bit';\nimport { getRootComponentDir } from '@teambit/workspace.root-components';\nimport { ComponentAspect, Component, ComponentMap, ComponentMain, IComponent } from '@teambit/component';\nimport type { ConfigMain } from '@teambit/config';\nimport { join, relative } from 'path';\nimport { compact, get, pick, uniq, omit, cloneDeep } from 'lodash';\nimport { ConfigAspect } from '@teambit/config';\nimport { EnvsAspect } from '@teambit/envs';\nimport type { DependenciesEnv, EnvDefinition, EnvJsonc, EnvsMain } from '@teambit/envs';\nimport { Slot, SlotRegistry, ExtensionManifest, Aspect, RuntimeManifest } from '@teambit/harmony';\nimport { RequireableComponent } from '@teambit/harmony.modules.requireable-component';\nimport type { LoggerMain } from '@teambit/logger';\nimport { GraphqlAspect, GraphqlMain } from '@teambit/graphql';\nimport { Logger, LoggerAspect } from '@teambit/logger';\nimport {\n CFG_PACKAGE_MANAGER_CACHE,\n CFG_REGISTRY_URL_KEY,\n CFG_USER_TOKEN_KEY,\n CFG_ISOLATED_SCOPE_CAPSULES,\n getCloudDomain,\n} from '@teambit/legacy/dist/constants';\nimport { ExtensionDataList } from '@teambit/legacy/dist/consumer/config/extension-data';\nimport { componentIdToPackageName } from '@teambit/pkg.modules.component-package-name';\nimport { DetectorHook } from '@teambit/dependencies';\nimport { Http, ProxyConfig, NetworkConfig } from '@teambit/legacy/dist/scope/network/http';\nimport { onTagIdTransformer } from '@teambit/snapping';\nimport LegacyComponent from '@teambit/legacy/dist/consumer/component';\nimport fs from 'fs-extra';\nimport { ComponentID } from '@teambit/component-id';\nimport { readCAFileSync } from '@pnpm/network.ca-file';\nimport { SourceFile } from '@teambit/component.sources';\nimport { ProjectManifest } from '@pnpm/types';\nimport semver, { SemVer } from 'semver';\nimport { AspectLoaderAspect, AspectLoaderMain } from '@teambit/aspect-loader';\nimport { GlobalConfigAspect, GlobalConfigMain } from '@teambit/global-config';\nimport { PackageJsonTransformer } from '@teambit/workspace.modules.node-modules-linker';\nimport { Registries, Registry } from './registry';\nimport { applyUpdates, UpdatedComponent } from './apply-updates';\nimport { ROOT_NAME } from './dependencies/constants';\nimport {\n DependencyInstaller,\n PreInstallSubscriberList,\n PostInstallSubscriberList,\n DepInstallerContext,\n} from './dependency-installer';\nimport { DependencyResolverAspect } from './dependency-resolver.aspect';\nimport { DependencyVersionResolver } from './dependency-version-resolver';\nimport { DepLinkerContext, DependencyLinker, LinkingOptions } from './dependency-linker';\nimport { DependencyResolverWorkspaceConfig, NodeLinker } from './dependency-resolver-workspace-config';\nimport { ComponentModelVersion, getAllPolicyPkgs, OutdatedPkg, CurrentPkgSource } from './get-all-policy-pkgs';\nimport { InvalidVersionWithPrefix, PackageManagerNotFound } from './exceptions';\nimport {\n CreateFromComponentsOptions,\n WorkspaceManifest,\n WorkspaceManifestFactory,\n ManifestDependenciesObject,\n} from './manifest';\nimport {\n WorkspacePolicyConfigObject,\n VariantPolicyConfigObject,\n WorkspacePolicy,\n WorkspacePolicyFactory,\n VariantPolicy,\n WorkspacePolicyAddEntryOptions,\n WorkspacePolicyEntry,\n SerializedVariantPolicy,\n} from './policy';\nimport {\n PackageManager,\n PeerDependencyIssuesByProjects,\n PackageManagerGetPeerDependencyIssuesOptions,\n} from './package-manager';\n\nimport {\n SerializedDependency,\n DependencyListFactory,\n DependencyFactory,\n ComponentDependencyFactory,\n COMPONENT_DEP_TYPE,\n DependencyList,\n ComponentDependency,\n} from './dependencies';\nimport { DependenciesFragment, DevDependenciesFragment, PeerDependenciesFragment } from './show-fragments';\nimport { dependencyResolverSchema } from './dependency-resolver.graphql';\nimport { DependencyDetector } from './dependency-detector';\nimport { DependenciesService } from './dependencies.service';\nimport { EnvPolicy } from './policy/env-policy';\n\nexport const BIT_CLOUD_REGISTRY = `https://node-registry.${getCloudDomain()}/`;\nexport const NPM_REGISTRY = 'https://registry.npmjs.org/';\n\nexport { ProxyConfig, NetworkConfig } from '@teambit/legacy/dist/scope/network/http';\n\nexport interface DependencyResolverComponentData {\n packageName: string;\n policy: SerializedVariantPolicy;\n dependencies: SerializedDependency;\n}\n\nexport interface DependencyResolverVariantConfig {\n policy: VariantPolicyConfigObject;\n}\n\nexport type RootPolicyRegistry = SlotRegistry<WorkspacePolicy>;\nexport type PoliciesRegistry = SlotRegistry<VariantPolicyConfigObject>;\nexport type PackageManagerSlot = SlotRegistry<PackageManager>;\nexport type DependencyFactorySlot = SlotRegistry<DependencyFactory[]>;\nexport type PreInstallSlot = SlotRegistry<PreInstallSubscriberList>;\nexport type PostInstallSlot = SlotRegistry<PostInstallSubscriberList>;\n\nexport type MergeDependenciesFunc = (configuredExtensions: ExtensionDataList) => Promise<VariantPolicyConfigObject>;\n\nexport type GetInstallerOptions = {\n rootDir?: string;\n packageManager?: string;\n cacheRootDirectory?: string;\n installingContext?: DepInstallerContext;\n nodeLinker?: NodeLinker;\n};\n\nexport type GetLinkerOptions = {\n rootDir?: string;\n linkingOptions?: LinkingOptions;\n linkingContext?: DepLinkerContext;\n};\n\nexport type GetDependenciesOptions = {\n includeHidden?: boolean;\n};\n\nexport type GetVersionResolverOptions = {\n cacheRootDirectory?: string;\n};\n\nconst defaultLinkingOptions: LinkingOptions = {\n linkTeambitBit: true,\n linkCoreAspects: true,\n};\n\nconst defaultCreateFromComponentsOptions: CreateFromComponentsOptions = {\n filterComponentsFromManifests: true,\n createManifestForComponentsWithoutDependencies: true,\n};\n\nexport class DependencyResolverMain {\n /**\n * cache the workspace policy to improve performance. when workspace.jsonc is changed, this gets cleared.\n * @see workspace.triggerOnWorkspaceConfigChange\n */\n private _workspacePolicy: WorkspacePolicy | undefined;\n constructor(\n /**\n * Dependency resolver extension configuration.\n */\n public config: DependencyResolverWorkspaceConfig,\n\n /**\n * Registry for changes by other extensions.\n */\n private rootPolicyRegistry: RootPolicyRegistry,\n\n /**\n * Registry for changes by other extensions.\n */\n private policiesRegistry: PoliciesRegistry,\n\n /**\n * envs extension.\n */\n private envs: EnvsMain,\n\n private logger: Logger,\n\n private configAspect: ConfigMain,\n\n private aspectLoader: AspectLoaderMain,\n\n private globalConfig: GlobalConfigMain,\n\n /**\n * component aspect.\n */\n readonly componentAspect: ComponentMain,\n\n private packageManagerSlot: PackageManagerSlot,\n\n private dependencyFactorySlot: DependencyFactorySlot,\n\n private preInstallSlot: PreInstallSlot,\n\n private postInstallSlot: PostInstallSlot\n ) {}\n\n /**\n * Save list of envs that doesn't contains env.jsonc file\n * this is used to show warning / instuctions to the user\n */\n public envsWithoutManifest = new Set<string>();\n\n /**\n * This function is a temporary workaround for installation in capsules with pnpm.\n * Currently pnpm breaks the root node_modules inside the capsule because it removes deps from it.\n * Install runs several times in the same capsule and pnpm removes deps from the previous runs.\n *\n * This workaround unfortunately also breaks pnpm on angular projects. Because dedupe doesn't work properly.\n * To fix this issue we'll either have to switch to root components or try to change pnpm code.\n *\n * Here is the PR where initially dedupe was turned off for pnpm: https://github.com/teambit/bit/pull/5410\n */\n supportsDedupingOnExistingRoot(): boolean {\n const packageManager = this.getPackageManager();\n return packageManager?.supportsDedupingOnExistingRoot?.() === true && !this.isolatedCapsules();\n }\n\n setConfig(config: DependencyResolverWorkspaceConfig) {\n this.config = config;\n }\n\n hasRootComponents(): boolean {\n return Boolean(this.config.rootComponents);\n }\n\n isolatedCapsules(): boolean {\n const globalConfig = this.globalConfig.getSync(CFG_ISOLATED_SCOPE_CAPSULES);\n // @ts-ignore\n const defaultVal = globalConfig !== undefined ? globalConfig === true || globalConfig === 'true' : true;\n const res = this.config.isolatedCapsules ?? defaultVal;\n return res;\n }\n\n hasHarmonyInRootPolicy(): boolean {\n const rootPolicy = this.getWorkspacePolicyFromConfig();\n return rootPolicy.entries.some(({ dependencyId }) => dependencyId === '@teambit/harmony');\n }\n\n nodeLinker(packageManagerName?: string): NodeLinker {\n if (this.config.nodeLinker) return this.config.nodeLinker;\n const pmName = packageManagerName || this.config.packageManager;\n if (pmName === 'teambit.dependencies/yarn') return 'hoisted';\n return 'isolated';\n }\n\n linkCoreAspects(): boolean {\n return this.config.linkCoreAspects ?? DependencyResolverMain.defaultConfig.linkCoreAspects;\n }\n\n /**\n * register a new package manager to the dependency resolver.\n */\n registerPackageManager(packageManager: PackageManager) {\n this.packageManagerSlot.register(packageManager);\n }\n\n registerDependencyFactories(factories: DependencyFactory[]) {\n this.dependencyFactorySlot.register(factories);\n }\n\n registerPreInstallSubscribers(subscribers: PreInstallSubscriberList) {\n this.preInstallSlot.register(subscribers);\n }\n\n registerPostInstallSubscribers(subscribers: PreInstallSubscriberList) {\n this.postInstallSlot.register(subscribers);\n }\n\n getSavePrefix(): string {\n return this.config.savePrefix || '^';\n }\n\n getVersionWithSavePrefix({\n version,\n overridePrefix,\n wantedRange,\n }: {\n version: string;\n overridePrefix?: string;\n wantedRange?: string;\n }): string {\n // A prerelease version is always added as an exact version.\n // A package installed by its exact version is also added as an exact version.\n if (semver.parse(version)?.prerelease.length || wantedRange === version) {\n return version;\n }\n if (wantedRange && ['~', '^'].includes(wantedRange[0])) {\n return wantedRange;\n }\n const prefix = overridePrefix || this.getSavePrefix();\n const versionWithPrefix = `${prefix}${version}`;\n if (!semver.validRange(versionWithPrefix)) {\n throw new InvalidVersionWithPrefix(versionWithPrefix);\n }\n return versionWithPrefix;\n }\n\n async getPolicy(component: Component): Promise<VariantPolicy> {\n const entry = component.state.aspects.get(DependencyResolverAspect.id);\n if (!entry) {\n return VariantPolicy.getEmpty();\n }\n const serializedPolicy: SerializedVariantPolicy = get(entry, ['data', 'policy'], []);\n return VariantPolicy.parse(serializedPolicy);\n }\n\n /**\n * This function called on component load in order to calculate the dependencies based on the legacy (consumer) component\n * and write them to the dependencyResolver data.\n * Do not use this function for other purpose.\n * If you want to get the component dependencies call getDependencies (which will give you the dependencies from the data itself)\n * TODO: once we switch deps resolver <> workspace relation we should make it private\n * TODO: once we switch deps resolver <> workspace relation we should remove the resolveId func here\n * @param component\n */\n async extractDepsFromLegacy(component: Component, policy?: VariantPolicy): Promise<DependencyList> {\n const componentPolicy = policy || (await this.getPolicy(component));\n const legacyComponent: LegacyComponent = component.state._consumer;\n const listFactory = this.getDependencyListFactory();\n const dependencyList = await listFactory.fromLegacyComponent(legacyComponent);\n\n dependencyList.forEach((dep) => {\n let found = componentPolicy.find(dep.id);\n if (!found) {\n const packageName = dep?.getPackageName?.();\n found = packageName ? componentPolicy.find(packageName) : undefined;\n }\n // if no policy found, the dependency was auto-resolved from the source code\n dep.source = found?.source || 'auto';\n dep.hidden = found?.hidden;\n dep.optional = found?.optional;\n });\n return dependencyList;\n }\n\n private getDependencyListFactory(): DependencyListFactory {\n const factories = this.dependencyFactorySlot.values().flat();\n const factoriesMap = factories.reduce((acc, factory) => {\n acc[factory.type] = factory;\n return acc;\n }, {});\n const listFactory = new DependencyListFactory(factoriesMap);\n return listFactory;\n }\n\n /**\n * Main function to get the dependency list of a given component\n * @param component\n */\n getDependencies(component: IComponent, { includeHidden = false }: GetDependenciesOptions = {}): DependencyList {\n const entry = component.get(DependencyResolverAspect.id);\n if (!entry) {\n return DependencyList.fromArray([]);\n }\n const serializedDependencies: SerializedDependency[] = entry?.data?.dependencies || [];\n const depList = this.getDependenciesFromSerializedDependencies(serializedDependencies);\n if (includeHidden) return depList;\n return depList.filterHidden();\n }\n\n getDependenciesFromLegacyComponent(\n component: LegacyComponent,\n { includeHidden = false }: GetDependenciesOptions = {}\n ) {\n const entry = component.extensions.findCoreExtension(DependencyResolverAspect.id);\n if (!entry) {\n return DependencyList.fromArray([]);\n }\n const serializedDependencies: SerializedDependency[] = entry?.data?.dependencies || [];\n const depList = this.getDependenciesFromSerializedDependencies(serializedDependencies);\n if (includeHidden) return depList;\n return depList.filterHidden();\n }\n\n /**\n * returns only the dependencies that are bit-components.\n */\n getComponentDependencies(component: IComponent): ComponentDependency[] {\n const dependencyList = this.getDependencies(component);\n return dependencyList.getComponentDependencies();\n }\n\n getDependenciesFromSerializedDependencies(dependencies: SerializedDependency[]): DependencyList {\n if (!dependencies.length) {\n return DependencyList.fromArray([]);\n }\n const listFactory = this.getDependencyListFactory();\n const deps = listFactory.fromSerializedDependencies(dependencies);\n return deps;\n }\n\n /**\n * Getting the merged workspace policy (from dep resolver config and others like root package.json)\n */\n getWorkspacePolicy(): WorkspacePolicy {\n if (!this._workspacePolicy) {\n const policyFromConfig = this.getWorkspacePolicyFromConfig();\n const externalPolicies = this.rootPolicyRegistry.toArray().map(([, policy]) => policy);\n this._workspacePolicy = this.mergeWorkspacePolices([policyFromConfig, ...externalPolicies]);\n }\n return this._workspacePolicy;\n }\n\n getWorkspacePolicyManifest() {\n const workspacePolicy = this.getWorkspacePolicy();\n return workspacePolicy.toManifest();\n }\n\n clearCache() {\n this._workspacePolicy = undefined;\n }\n\n /**\n * Getting the workspace policy as defined in the workspace.jsonc in the dependencyResolver aspect\n * This will not take into account packages that defined in the package.json of the root for example\n * in most cases you should use getWorkspacePolicy\n * @returns\n */\n getWorkspacePolicyFromConfig(): WorkspacePolicy {\n const factory = new WorkspacePolicyFactory();\n return factory.fromConfigObject(this.config.policy);\n }\n\n getWorkspacePolicyFromConfigObject(obj: WorkspacePolicyConfigObject): WorkspacePolicy {\n const factory = new WorkspacePolicyFactory();\n return factory.fromConfigObject(obj);\n }\n\n getWorkspacePolicyFromPackageJson(packageJson: Record<string, any>): WorkspacePolicy {\n const factory = new WorkspacePolicyFactory();\n return factory.fromPackageJson(packageJson);\n }\n\n mergeWorkspacePolices(polices: WorkspacePolicy[]): WorkspacePolicy {\n return WorkspacePolicy.mergePolices(polices);\n }\n\n /**\n * Create a workspace manifest\n * The term workspace here is not the same as \"bit workspace\" but a workspace that represent a shared root\n * for installation of many components (sometime it might point to the workspace path)\n * in other case it can be for example the capsules root dir\n *\n * @param {string} [name=ROOT_NAME]\n * @param {SemVer} [version=new SemVer('1.0.0')]\n * @param {ManifestDependenciesObject} dependencies\n * @param {string} rootDir\n * @param {Component[]} components\n * @param {CreateFromComponentsOptions} [options={\n * filterComponentsFromManifests: true,\n * createManifestForComponentsWithoutDependencies: true,\n * }]\n * @returns {WorkspaceManifest}\n * @memberof DependencyResolverMain\n */\n async getWorkspaceManifest(\n name: string = ROOT_NAME,\n version: SemVer = new SemVer('1.0.0'),\n rootPolicy: WorkspacePolicy,\n rootDir: string,\n components: Component[],\n options: CreateFromComponentsOptions = defaultCreateFromComponentsOptions,\n context: DepInstallerContext = {}\n ): Promise<WorkspaceManifest> {\n const statusMessage = context?.inCapsule\n ? `(capsule) deduping dependencies for installation in root dir ${rootDir}`\n : 'deduping dependencies for installation';\n if (!context?.inCapsule) {\n this.logger.setStatusLine(statusMessage);\n }\n const concreteOpts = {\n ...defaultCreateFromComponentsOptions,\n ...options,\n };\n const workspaceManifestFactory = new WorkspaceManifestFactory(this, this.aspectLoader);\n const res = await workspaceManifestFactory.createFromComponents(\n name,\n version,\n rootPolicy,\n rootDir,\n components,\n concreteOpts\n );\n if (!context?.inCapsule) {\n this.logger.consoleSuccess();\n }\n return res;\n }\n\n /**\n * get the package name of a component.\n */\n getPackageName(component: Component): string {\n return this.getDepResolverData(component)?.packageName ?? this.calcPackageName(component);\n }\n\n createComponentIdByPkgNameMap(components: Component[]): Map<string, ComponentID> {\n const componentIdByPkgName = new Map<string, ComponentID>();\n for (const component of components) {\n componentIdByPkgName.set(this.getPackageName(component), component.id);\n }\n return componentIdByPkgName;\n }\n\n getDepResolverData(component: Component): DependencyResolverComponentData | undefined {\n return component.state.aspects.get(DependencyResolverAspect.id)?.data as DependencyResolverComponentData;\n }\n\n calcPackageName(component: Component): string {\n return componentIdToPackageName(component.state._consumer);\n }\n\n /*\n * Returns the location where the component is installed with its peer dependencies\n * This is used in cases you want to actually run the components and make sure all the dependencies (especially peers) are resolved correctly\n */\n getRuntimeModulePath(\n component: Component,\n options: {\n workspacePath: string;\n rootComponentsPath: string;\n isInWorkspace?: boolean;\n }\n ) {\n if (!this.hasRootComponents()) {\n const modulePath = this.getModulePath(component);\n return modulePath;\n }\n const pkgName = this.getPackageName(component);\n const rootComponentsRelativePath = relative(options.workspacePath, options.rootComponentsPath);\n const getRelativeRootComponentDir = getRootComponentDir.bind(null, rootComponentsRelativePath ?? '');\n const selfRootDir = getRelativeRootComponentDir(\n options.isInWorkspace ? component.id.toStringWithoutVersion() : component.id.toString()\n );\n // In case the component is it's own root we want to load it from it's own root folder\n if (fs.pathExistsSync(selfRootDir)) {\n const innerDir = join(selfRootDir, 'node_modules', pkgName);\n if (fs.pathExistsSync(innerDir)) return innerDir;\n // sometime for the env itself we don't have the env package in the env root dir, because it was hoisted\n // in that case we return the dir from the root node_modules\n return this.getModulePath(component);\n }\n const dirInEnvRoot = join(this.getComponentDirInBitRoots(component, options), 'node_modules', pkgName);\n if (fs.pathExistsSync(dirInEnvRoot)) return dirInEnvRoot;\n return this.getModulePath(component);\n }\n\n getComponentDirInBitRoots(\n component: Component,\n options: {\n workspacePath: string;\n rootComponentsPath: string;\n }\n ) {\n const envId = this.envs.getEnvId(component);\n const rootComponentsRelativePath = relative(options.workspacePath, options.rootComponentsPath);\n return getRootComponentDir(rootComponentsRelativePath ?? '', envId);\n }\n\n /**\n * returns the package path in the /node_modules/ folder\n * In case you call this in order to run the code from the path, please refer to the `getRuntimeModulePath` API\n */\n getModulePath(component: Component) {\n const pkgName = this.getPackageName(component);\n const relativePath = join('node_modules', pkgName);\n return relativePath;\n }\n\n async addDependenciesGraph(\n component: Component,\n componentRelativeDir: string,\n options: {\n rootDir: string;\n rootComponentsPath?: string;\n componentIdByPkgName: Map<string, ComponentID>;\n }\n ): Promise<void> {\n try {\n component.state._consumer.dependenciesGraph = await this.getPackageManager()?.calcDependenciesGraph?.({\n rootDir: options.rootDir,\n componentRootDir: options.rootComponentsPath\n ? this.getComponentDirInBitRoots(component, {\n workspacePath: options.rootDir,\n rootComponentsPath: options.rootComponentsPath,\n })\n : undefined,\n pkgName: this.getPackageName(component),\n componentRelativeDir,\n componentIdByPkgName: options.componentIdByPkgName,\n });\n } catch (err) {\n // If the dependencies graph feature is disabled, we ignore the error\n if (isFeatureEnabled(DEPS_GRAPH)) {\n throw err;\n }\n }\n }\n\n /**\n * get a component dependency installer.\n */\n getInstaller(options: GetInstallerOptions = {}) {\n const packageManagerName = options.packageManager || this.config.packageManager;\n const packageManager = this.packageManagerSlot.get(packageManagerName);\n const cacheRootDir = options.cacheRootDirectory || this.globalConfig.getSync(CFG_PACKAGE_MANAGER_CACHE);\n\n if (!packageManager) {\n throw new PackageManagerNotFound(this.config.packageManager);\n }\n\n if (cacheRootDir && !fs.pathExistsSync(cacheRootDir)) {\n this.logger.debug(`creating package manager cache dir at ${cacheRootDir}`);\n fs.ensureDirSync(cacheRootDir);\n }\n const preInstallSubscribers = this.getPreInstallSubscribers();\n const postInstallSubscribers = this.getPostInstallSubscribers();\n // TODO: we should somehow pass the cache root dir to the package manager constructor\n return new DependencyInstaller(\n packageManager,\n this.aspectLoader,\n this.logger,\n this,\n options.rootDir,\n cacheRootDir,\n preInstallSubscribers,\n postInstallSubscribers,\n options.nodeLinker || this.nodeLinker(packageManagerName),\n this.config.packageImportMethod,\n this.config.sideEffectsCache,\n this.config.nodeVersion,\n this.config.engineStrict,\n this.config.peerDependencyRules,\n this.config.neverBuiltDependencies,\n this.config.preferOffline,\n options.installingContext\n );\n }\n\n private getPreInstallSubscribers(): PreInstallSubscriberList {\n return this.preInstallSlot.values().flat();\n }\n\n private getPostInstallSubscribers(): PostInstallSubscriberList {\n return this.postInstallSlot.values().flat();\n }\n\n /**\n * get a component dependency linker.\n */\n getLinker(options: GetLinkerOptions = {}) {\n const linkingOptions = Object.assign({}, defaultLinkingOptions, options?.linkingOptions || {});\n // TODO: we should somehow pass the cache root dir to the package manager constructor\n return new DependencyLinker(\n this,\n this.aspectLoader,\n this.componentAspect,\n this.envs,\n this.logger,\n options.rootDir,\n linkingOptions,\n options.linkingContext\n );\n }\n\n /**\n * This function returns the package manager if it exists, otherwise it returns undefined.\n * @returns The `getPackageManager()` function returns a `PackageManager` object or `undefined`.\n */\n getPackageManager(): PackageManager | undefined {\n const packageManager = this.packageManagerSlot.get(this.config.packageManager);\n return packageManager;\n }\n\n getPackageManagerName() {\n return this.config.packageManager;\n }\n\n async getVersionResolver(options: GetVersionResolverOptions = {}) {\n const packageManager = this.getPackageManager();\n const cacheRootDir = options.cacheRootDirectory || this.globalConfig.getSync(CFG_PACKAGE_MANAGER_CACHE);\n\n if (!packageManager) {\n throw new PackageManagerNotFound(this.config.packageManager);\n }\n\n if (cacheRootDir && !fs.pathExistsSync(cacheRootDir)) {\n this.logger.debug(`creating package manager cache dir at ${cacheRootDir}`);\n fs.ensureDirSync(cacheRootDir);\n }\n const { networkConcurrency } = await this.getNetworkConfig();\n // TODO: we should somehow pass the cache root dir to the package manager constructor\n return new DependencyVersionResolver(packageManager, cacheRootDir, networkConcurrency);\n }\n\n /**\n * these ids should not be in the dependencyResolver policy normally.\n * one exception is bit itself, which needs teambit.harmony/harmony in the dependencies.\n *\n * returns component-ids string without a version.\n */\n getCompIdsThatShouldNotBeInPolicy(): string[] {\n return [...getAllCoreAspectsIds(), 'teambit.harmony/harmony'];\n }\n\n /**\n * return the system configured package manager. by default pnpm.\n */\n getSystemPackageManager(): PackageManager {\n const defaultPm = 'teambit.dependencies/pnpm';\n const packageManager = this.packageManagerSlot.get(defaultPm);\n if (!packageManager) throw new Error(`default package manager: ${defaultPm} was not found`);\n return packageManager;\n }\n\n async getProxyConfig(): Promise<ProxyConfig> {\n const proxyConfigFromDepResolverConfig = this.getProxyConfigFromDepResolverConfig();\n let httpProxy = proxyConfigFromDepResolverConfig.httpProxy;\n let httpsProxy = proxyConfigFromDepResolverConfig.httpsProxy;\n\n // Take config from the aspect config if defined\n if (httpProxy || httpsProxy) {\n this.logger.debug(\n `proxy config taken from the dep resolver config. proxy: ${httpProxy} httpsProxy: ${httpsProxy}`\n );\n return proxyConfigFromDepResolverConfig;\n }\n\n // Take config from the package manager (npmrc) config if defined\n const proxyConfigFromPackageManager = await this.getProxyConfigFromPackageManager();\n if (proxyConfigFromPackageManager?.httpProxy || proxyConfigFromPackageManager?.httpsProxy) {\n this.logger.debug(\n `proxy config taken from the package manager config (npmrc). proxy: ${proxyConfigFromPackageManager.httpProxy} httpsProxy: ${proxyConfigFromPackageManager.httpsProxy}`\n );\n return proxyConfigFromPackageManager;\n }\n\n // Take config from global bit config\n const proxyConfigFromGlobalConfig = await this.getProxyConfigFromGlobalConfig();\n httpProxy = proxyConfigFromGlobalConfig.httpProxy;\n httpsProxy = proxyConfigFromGlobalConfig.httpsProxy;\n if (httpProxy || httpsProxy) {\n this.logger.debug(`proxy config taken from the global bit config. proxy: ${httpProxy} httpsProxy: ${httpsProxy}`);\n return proxyConfigFromGlobalConfig;\n }\n return {};\n }\n\n private getProxyConfigFromDepResolverConfig(): ProxyConfig {\n return {\n httpProxy: this.config.proxy,\n httpsProxy: this.config.httpsProxy || this.config.proxy,\n noProxy: this.config.noProxy,\n };\n }\n\n async getNetworkConfig(): Promise<NetworkConfig> {\n const networkConfig = {\n ...(await this.getNetworkConfigFromGlobalConfig()),\n ...(await this.getNetworkConfigFromPackageManager()),\n ...this.getNetworkConfigFromDepResolverConfig(),\n };\n this.logger.debug(\n `the next network configuration is used in dependency-resolver: ${JSON.stringify(\n {\n ...networkConfig,\n key: networkConfig.key ? 'set' : 'not set', // this is sensitive information, we should not log it\n },\n null,\n 2\n )}`\n );\n return networkConfig;\n }\n\n private async getNetworkConfigFromGlobalConfig(): Promise<NetworkConfig> {\n const globalNetworkConfig = await Http.getNetworkConfig();\n if (!globalNetworkConfig.ca && globalNetworkConfig.cafile) {\n globalNetworkConfig.ca = readCAFileSync(globalNetworkConfig.cafile);\n }\n return globalNetworkConfig;\n }\n\n private getNetworkConfigFromDepResolverConfig(): NetworkConfig {\n const config: NetworkConfig = pick(this.config, [\n 'fetchTimeout',\n 'fetchRetries',\n 'fetchRetryFactor',\n 'fetchRetryMintimeout',\n 'fetchRetryMaxtimeout',\n 'maxSockets',\n 'networkConcurrency',\n 'key',\n 'cert',\n 'ca',\n 'cafile',\n ]);\n if (this.config.strictSsl != null) {\n config.strictSSL =\n typeof this.config.strictSsl === 'string'\n ? this.config.strictSsl.toLowerCase() === 'true'\n : this.config.strictSsl;\n }\n return config;\n }\n\n private async getNetworkConfigFromPackageManager(): Promise<NetworkConfig> {\n const packageManager = this.getPackageManager();\n let networkConfigFromPackageManager: NetworkConfig = {};\n if (typeof packageManager?.getNetworkConfig === 'function') {\n networkConfigFromPackageManager = await packageManager?.getNetworkConfig();\n } else {\n const systemPm = this.getSystemPackageManager();\n if (!systemPm.getNetworkConfig) throw new Error('system package manager must implement `getNetworkConfig()`');\n networkConfigFromPackageManager = await systemPm.getNetworkConfig();\n }\n return networkConfigFromPackageManager;\n }\n\n private async getProxyConfigFromPackageManager(): Promise<ProxyConfig> {\n const packageManager = this.getPackageManager();\n let proxyConfigFromPackageManager: ProxyConfig = {};\n if (packageManager?.getProxyConfig && typeof packageManager?.getProxyConfig === 'function') {\n proxyConfigFromPackageManager = await packageManager?.getProxyConfig();\n } else {\n const systemPm = this.getSystemPackageManager();\n if (!systemPm.getProxyConfig) throw new Error('system package manager must implement `getProxyConfig()`');\n proxyConfigFromPackageManager = await systemPm.getProxyConfig();\n }\n return proxyConfigFromPackageManager;\n }\n\n private getProxyConfigFromGlobalConfig(): Promise<ProxyConfig> {\n return Http.getProxyConfig();\n }\n\n /**\n * Return the peer dependencies and their ranges that may be installed\n * without causing unmet peer dependency issues in some of the dependencies.\n */\n async getMissingPeerDependencies(\n rootDir: string,\n rootPolicy: WorkspacePolicy,\n componentDirectoryMap: ComponentMap<string>,\n options: PackageManagerGetPeerDependencyIssuesOptions\n ): Promise<Record<string, string>> {\n this.logger.setStatusLine('finding missing peer dependencies');\n const packageManager = this.getPackageManager();\n let peerDependencyIssues!: PeerDependencyIssuesByProjects;\n const installer = this.getInstaller();\n const manifests = await installer.getComponentManifests({\n ...options,\n componentDirectoryMap,\n rootPolicy,\n rootDir,\n });\n if (packageManager?.getPeerDependencyIssues && typeof packageManager?.getPeerDependencyIssues === 'function') {\n peerDependencyIssues = await packageManager?.getPeerDependencyIssues(rootDir, manifests, options);\n } else {\n const systemPm = this.getSystemPackageManager();\n if (!systemPm.getPeerDependencyIssues)\n throw new Error('system package manager must implement `getPeerDependencyIssues()`');\n peerDependencyIssues = await systemPm?.getPeerDependencyIssues(rootDir, manifests, options);\n }\n this.logger.consoleSuccess();\n return peerDependencyIssues['.']?.intersections;\n }\n\n async getRegistries(): Promise<Registries> {\n const packageManager = this.getPackageManager();\n let registries;\n if (packageManager?.getRegistries && typeof packageManager?.getRegistries === 'function') {\n registries = await packageManager?.getRegistries();\n } else {\n const systemPm = this.getSystemPackageManager();\n if (!systemPm.getRegistries) throw new Error('system package manager must implement `getRegistries()`');\n registries = await systemPm.getRegistries();\n }\n\n const getDefaultBitRegistry = (): Registry => {\n const bitGlobalConfigRegistry = this.globalConfig.getSync(CFG_REGISTRY_URL_KEY);\n const bitRegistry = bitGlobalConfigRegistry || BIT_CLOUD_REGISTRY;\n\n const { bitOriginalAuthType, bitAuthHeaderValue, bitOriginalAuthValue } = this.getBitAuthConfig();\n\n const alwaysAuth = !!bitAuthHeaderValue;\n const bitDefaultRegistry = new Registry(\n bitRegistry,\n alwaysAuth,\n bitAuthHeaderValue,\n bitOriginalAuthType,\n bitOriginalAuthValue\n );\n return bitDefaultRegistry;\n };\n\n const bitDefaultRegistry = getDefaultBitRegistry();\n\n const installFromBitDevRegistry = this.config.installFromBitDevRegistry ?? true;\n\n // Override default registry to use bit registry in case npmjs is the default - bit registry will proxy it\n // We check also NPM_REGISTRY.startsWith because the uri might not have the trailing / we have in NPM_REGISTRY\n if (\n installFromBitDevRegistry &&\n (!registries.defaultRegistry.uri ||\n registries.defaultRegistry.uri === NPM_REGISTRY ||\n NPM_REGISTRY.startsWith(registries.defaultRegistry.uri))\n ) {\n // TODO: this will not handle cases where you have token for private npm registries stored on npmjs\n // it should be handled by somehow in such case (default is npmjs and there is token for default) by sending the token of npmjs to the registry\n // (for example by setting some special header in the request)\n // then in the registry server it should be use it when proxies\n registries = registries.setDefaultRegistry(bitDefaultRegistry);\n }\n\n registries = this.addAuthToScopedBitRegistries(registries);\n return registries;\n }\n\n /**\n * This will mutate any registry which point to BIT_DEV_REGISTRY to have the auth config from the @bit scoped registry or from the user.token in bit's config\n */\n private addAuthToScopedBitRegistries(registries: Registries): Registries {\n const { bitOriginalAuthType, bitAuthHeaderValue, bitOriginalAuthValue } = this.getBitAuthConfig();\n const alwaysAuth = bitAuthHeaderValue !== undefined;\n let updatedRegistries = registries;\n Object.entries(registries.scopes).map(([name, registry]) => {\n if (!registry.authHeaderValue && BIT_CLOUD_REGISTRY.includes(registry.uri)) {\n const registryWithAuth = new Registry(\n registry.uri,\n alwaysAuth,\n bitAuthHeaderValue,\n bitOriginalAuthType,\n bitOriginalAuthValue\n );\n updatedRegistries = updatedRegistries.updateScopedRegistry(name, registryWithAuth);\n }\n return updatedRegistries;\n });\n return updatedRegistries;\n }\n\n private getBitAuthConfig(): Partial<{\n bitOriginalAuthType: string;\n bitAuthHeaderValue: string;\n bitOriginalAuthValue: string;\n }> {\n const bitGlobalConfigToken = this.globalConfig.getSync(CFG_USER_TOKEN_KEY);\n const res = {\n bitOriginalAuthType: '',\n bitAuthHeaderValue: '',\n bitOriginalAuthValue: '',\n };\n\n // In case there is no auth configuration in the npmrc, but there is token in bit config, take it from the config\n if (bitGlobalConfigToken) {\n res.bitOriginalAuthType = 'authToken';\n res.bitAuthHeaderValue = `Bearer ${bitGlobalConfigToken}`;\n res.bitOriginalAuthValue = bitGlobalConfigToken;\n }\n\n return res;\n }\n\n get packageManagerName(): string {\n return this.config.packageManager;\n }\n\n addToRootPolicy(entries: WorkspacePolicyEntry[], options?: WorkspacePolicyAddEntryOptions): WorkspacePolicy {\n const workspacePolicy = this.getWorkspacePolicyFromConfig();\n entries.forEach((entry) => workspacePolicy.add(entry, options));\n this.updateConfigPolicy(workspacePolicy);\n return workspacePolicy;\n }\n\n removeFromRootPolicy(dependencyIds: string[]): boolean {\n const workspacePolicy = this.getWorkspacePolicyFromConfig();\n const workspacePolicyUpdated = workspacePolicy.remove(dependencyIds);\n const isRemoved = workspacePolicyUpdated.entries.length !== workspacePolicy.entries.length;\n if (isRemoved) this.updateConfigPolicy(workspacePolicyUpdated);\n return isRemoved;\n }\n\n private updateConfigPolicy(workspacePolicy: WorkspacePolicy) {\n const workspacePolicyObject = workspacePolicy.toConfigObject();\n this.config.policy = workspacePolicyObject;\n this.configAspect.setExtension(DependencyResolverAspect.id, this.config, {\n overrideExisting: true,\n ignoreVersion: true,\n });\n }\n\n async persistConfig(reasonForChange?: string) {\n await this.configAspect.workspaceConfig?.write({ reasonForChange });\n this.clearCache();\n }\n\n /**\n * register new dependencies policies\n */\n registerDependenciesPolicies(policy: VariantPolicyConfigObject): void {\n return this.policiesRegistry.register(policy);\n }\n\n /**\n * register new dependencies policies\n */\n registerRootPolicy(policy: WorkspacePolicy): void {\n return this.rootPolicyRegistry.register(policy);\n }\n\n // async getComponentEnvPolicyFromExtension(configuredExtensions: ExtensionDataList): Promise<EnvPolicy> {\n // const env = this.envs.calculateEnvFromExtensions(configuredExtensions);\n // const fromFile = await this.getEnvPolicyFromFile(env.id);\n // if (fromFile) return fromFile;\n // return this.getComponentEnvPolicyFromEnv(env.env);\n // }\n\n async getComponentEnvPolicyFromExtension(configuredExtensions: ExtensionDataList): Promise<EnvPolicy> {\n const envId = await this.envs.calculateEnvIdFromExtensions(configuredExtensions);\n if (this.envs.isCoreEnv(envId)) {\n const env = await this.envs.calculateEnvFromExtensions(configuredExtensions);\n return this.getComponentEnvPolicyFromEnv(env.env, { envId });\n }\n\n const fromFile = await this.getEnvPolicyFromFile(envId);\n if (fromFile) return fromFile;\n const env = await this.envs.calculateEnvFromExtensions(configuredExtensions);\n return this.getComponentEnvPolicyFromEnv(env.env, { envId });\n }\n\n async getEnvPolicyFromEnvId(id: ComponentID, legacyFiles?: SourceFile[]): Promise<EnvPolicy | undefined> {\n const fromFile = await this.getEnvPolicyFromFile(id.toString(), legacyFiles);\n if (fromFile) return fromFile;\n const envDef = this.envs.getEnvDefinitionById(id);\n if (!envDef) return undefined;\n const env = envDef.env;\n return this.getComponentEnvPolicyFromEnv(env, {\n envId: id.toStringWithoutVersion(),\n });\n }\n\n /**\n * @deprecated use getEnvPolicyFromEnvId instead (it's the same)\n */\n async getEnvPolicyFromEnvLegacyId(id: ComponentID, legacyFiles?: SourceFile[]): Promise<EnvPolicy | undefined> {\n return this.getEnvPolicyFromEnvId(id, legacyFiles);\n }\n\n async getComponentEnvPolicy(component: Component): Promise<EnvPolicy> {\n // const envComponent = await this.envs.getEnvComponent(component);\n const envId = await this.envs.calculateEnvId(component);\n const envIdWithoutVersion = envId.toStringWithoutVersion();\n if (this.envs.isCoreEnv(envIdWithoutVersion)) {\n const env = this.envs.getEnv(component).env;\n return this.getComponentEnvPolicyFromEnv(env, { envId: envIdWithoutVersion });\n }\n const fromFile = await this.getEnvPolicyFromFile(envId.toString());\n if (fromFile) return fromFile;\n this.envsWithoutManifest.add(envId.toString());\n const env = this.envs.getEnv(component).env;\n return this.getComponentEnvPolicyFromEnv(env, { envId: envIdWithoutVersion });\n }\n\n getEnvManifest(envComponent?: Component, legacyFiles?: SourceFile[]): EnvPolicy | undefined {\n const object = this.envs.getEnvManifest(envComponent, legacyFiles) as any;\n const policy = object?.policy;\n if (!policy) return undefined;\n const allPoliciesFromEnv = EnvPolicy.fromConfigObject(policy, {\n includeLegacyPeersInSelfPolicy: envComponent && this.envs.isCoreEnv(envComponent.id.toStringWithoutVersion()),\n });\n return allPoliciesFromEnv;\n }\n\n /**\n * Merge policy from parent and child env.jsonc files\n * The rule is that for each type of dependency (dev, runtime, peer) we check each item.\n * if a dep with a name exists on the child we will take the entire object from the child (including the version,\n * supported range, force etc')\n * if a dep exists with a version value \"-\" we will remove it from the policy\n */\n mergeEnvManifestPolicy(parent: EnvJsonc, child: EnvJsonc): object {\n const policy = {};\n ['peers', 'dev', 'runtime'].forEach((key) => {\n policy[key] = cloneDeep(parent.policy?.[key] || []);\n const childEntries = cloneDeep(child.policy?.[key] || []);\n\n policy[key] = policy[key].filter((entry) => {\n const foundChildEntry = childEntries.find((childEntry) => {\n return childEntry.name === entry.name;\n });\n return !foundChildEntry;\n });\n policy[key] = policy[key].concat(childEntries);\n policy[key] = policy[key].filter((entry) => {\n return entry.version !== '-';\n });\n });\n return { policy };\n }\n\n private async getEnvPolicyFromFile(envId: string, legacyFiles?: SourceFile[]): Promise<EnvPolicy | undefined> {\n const isCoreEnv = this.envs.isCoreEnv(envId);\n if (isCoreEnv) return undefined;\n if (legacyFiles) {\n return this.getEnvManifest(undefined, legacyFiles);\n }\n const envComponent = await this.envs.getEnvComponentByEnvId(envId, envId);\n return this.getEnvManifest(envComponent);\n }\n\n async getComponentEnvPolicyFromEnv(env: DependenciesEnv, options: { envId: string }): Promise<EnvPolicy> {\n if (env.getDependencies && typeof env.getDependencies === 'function') {\n const policiesFromEnvConfig = await env.getDependencies();\n if (policiesFromEnvConfig) {\n const idWithoutVersion = options.envId.split('@')[0];\n const allPoliciesFromEnv = EnvPolicy.fromConfigObject(policiesFromEnvConfig, {\n includeLegacyPeersInSelfPolicy: this.envs.isCoreEnv(idWithoutVersion),\n });\n return allPoliciesFromEnv;\n }\n }\n return EnvPolicy.getEmpty();\n }\n\n async getComponentEnvPolicyFromEnvDefinition(envDef: EnvDefinition): Promise<EnvPolicy> {\n const fromFile = await this.getEnvPolicyFromFile(envDef.id);\n if (fromFile) return fromFile;\n return this.getComponentEnvPolicyFromEnv(envDef.env, { envId: envDef.id });\n }\n\n /**\n *\n * dependencies that will bundled as part of the env template and will configured as externals for the component bundle\n * these dependencies will be available in the preview on the window.\n * these dependencies will have only one instance on the page.\n * for dev server these dependencies will be aliased.\n * TODO: this should probably moved to the preview aspect. the main issue is that is used for dev server which can't bring the preview aspect.\n * @param env\n */\n async getPreviewHostDependenciesFromEnv(env: DependenciesEnv): Promise<string[]> {\n let hostDeps: string[] = [];\n if (env.getAdditionalHostDependencies && typeof env.getAdditionalHostDependencies === 'function') {\n hostDeps = await env.getAdditionalHostDependencies();\n }\n return uniq(hostDeps);\n }\n\n /**\n * Merge the dependencies provided by:\n * 1. envs configured in the component - via dependencies method\n * 2. extensions that registered to the registerDependencyPolicy slot (and configured for the component)\n * 3. props defined by the user (they are the strongest one)\n * @param configuredExtensions\n */\n async mergeVariantPolicies(\n configuredExtensions: ExtensionDataList,\n id: ComponentID,\n legacyFiles?: SourceFile[]\n ): Promise<VariantPolicy> {\n let policiesFromSlots: VariantPolicy = VariantPolicy.getEmpty();\n let policiesFromConfig: VariantPolicy = VariantPolicy.getEmpty();\n const policiesFromEnv: VariantPolicy = await this.getComponentEnvPolicyFromExtension(configuredExtensions);\n const configuredIds = configuredExtensions.ids;\n const policiesTuples = this.policiesRegistry.toArray();\n configuredIds.forEach((extId) => {\n // TODO: change this way of search, once we have workspace as dep-resolver dependency\n // we can use something like:\n // const resolvedId = this.workspace.resolveComponentId(extId)\n // const currentPolicy = this.policiesRegistry.get(resolvedId.toString());\n // Only get props from configured extensions on this specific component\n const policyTupleToApply = policiesTuples.find(([policyRegistrar]) => {\n return policyRegistrar === extId || policyRegistrar.includes(extId);\n });\n\n if (policyTupleToApply && policyTupleToApply[1]) {\n const currentPolicy = VariantPolicy.fromConfigObject(policyTupleToApply[1], { source: 'slots' });\n policiesFromSlots = VariantPolicy.mergePolices([policiesFromSlots, currentPolicy]);\n }\n });\n const currentExtension = configuredExtensions.findExtension(DependencyResolverAspect.id);\n const currentConfig = currentExtension?.config as unknown as DependencyResolverVariantConfig;\n if (currentConfig && currentConfig.policy) {\n policiesFromConfig = VariantPolicy.fromConfigObject(currentConfig.policy, { source: 'config' });\n }\n const policiesFromEnvForItself =\n (await this.getPoliciesFromEnvForItself(id, legacyFiles)) ?? VariantPolicy.getEmpty();\n\n const result = VariantPolicy.mergePolices([\n policiesFromEnv,\n policiesFromEnvForItself,\n policiesFromSlots,\n policiesFromConfig,\n ]);\n return result;\n }\n\n /**\n * These are the policies that the env itself defines for itself.\n * So policies installed only locally for the env, not to any components that use the env.\n */\n async getPoliciesFromEnvForItself(id: ComponentID, legacyFiles?: SourceFile[]): Promise<VariantPolicy | undefined> {\n const envPolicy = await this.getEnvPolicyFromEnvId(id, legacyFiles);\n return envPolicy?.selfPolicy;\n }\n\n updateDepsOnLegacyTag(component: LegacyComponent, idTransformer: onTagIdTransformer): LegacyComponent {\n const entry = component.extensions.findCoreExtension(DependencyResolverAspect.id);\n if (!entry) {\n return component;\n }\n const dependencies = get(entry, ['data', 'dependencies'], []);\n dependencies.forEach((dep) => {\n if (dep.__type === COMPONENT_DEP_TYPE) {\n // @todo: it's unclear why \"dep.componentId\" randomly becomes a ComponentID instance.\n // this check is added because on Ripple in some scenarios it was throwing:\n // \"ComponentID.fromObject expect to get an object, got an instance of ComponentID\" (locally it didn't happen)\n const depId =\n dep.componentId instanceof ComponentID ? dep.componentId : ComponentID.fromObject(dep.componentId);\n const newDepId = idTransformer(depId);\n dep.componentId = (newDepId || depId).serialize();\n dep.id = (newDepId || depId).toString();\n dep.version = (newDepId || depId).version;\n }\n });\n return component;\n }\n\n /**\n * Register a new dependency detector. Detectors allow to extend Bit's dependency detection\n * mechanism to support new file extensions and types.\n */\n registerDetector(detector: DependencyDetector) {\n DetectorHook.hooks.push(detector);\n return this;\n }\n\n /**\n * This function called on component load in order to calculate the custom\n * dependency detectors from an env, which is got by extension data list.\n * Do not use this function for other purposes.\n */\n async calcComponentEnvDepDetectors(extensions: ExtensionDataList) {\n const envDef = await this.envs.calculateEnvFromExtensions(extensions);\n const depEnv = envDef.env as DependenciesEnv;\n if (typeof depEnv?.getDepDetectors === 'function') {\n return depEnv.getDepDetectors();\n }\n return null;\n }\n\n /**\n * This function registered to the onLoadRequireableExtensionSlot of the aspect-loader\n * Update the aspect / manifest deps versions in the runtimes (recursively)\n * This function mutate the manifest directly as otherwise it becomes very complicated\n * TODO: think if this funciton should be here as it about dependencies, or on the aspect loader\n * (as it's aware of the internal structure of aspects)\n * Maybe only register the dep resolution part to the aspect loader\n * at the moment it here for simplify the process\n * @param requireableExtension\n * @param manifest\n * @returns\n */\n async onLoadRequireableExtensionSubscriber(\n requireableExtension: RequireableComponent,\n manifest: ExtensionManifest | Aspect\n ): Promise<ExtensionManifest | Aspect> {\n const parentComponent = requireableExtension.component;\n return this.resolveRequireableExtensionManifestDepsVersionsRecursively(parentComponent, manifest);\n }\n\n /**\n * Update the aspect / manifest deps versions in the runtimes (recursively)\n * @param parentComponent\n * @param manifest\n */\n private async resolveRequireableExtensionManifestDepsVersionsRecursively(\n // Allow getting here string for lazy load the component\n // we only want to load the component in case there are deps to resolve\n parentComponent: Component | string,\n manifest: ExtensionManifest | Aspect\n // TODO: add visited = new Map() for performence improve\n ): Promise<ExtensionManifest | Aspect> {\n // Not resolve it immediately for performance sake\n let resolvedParentComponent: Component | undefined;\n let resolvedParentDeps: DependencyList;\n const updateDirectDepsVersions = (deps: Array<ExtensionManifest | Aspect>): Promise<void[]> => {\n return mapSeries(deps, async (dep) => {\n // Nothing to update (this shouldn't happen ever)\n if (!dep.id) return;\n // In case of core aspect, do not update the version, as it's loaded to harmony without version\n if (this.aspectLoader.isCoreAspect(dep.id)) return;\n // Lazily get the parent component\n if (typeof parentComponent === 'string') {\n const parentComponentId = await this.componentAspect.getHost().resolveComponentId(parentComponent);\n resolvedParentComponent = await this.componentAspect.getHost().get(parentComponentId);\n } else {\n // it's of type component;\n resolvedParentComponent = parentComponent;\n }\n if (!resolvedParentComponent) {\n this.logger.error(\n `could not resolve the component ${parentComponent} during manifest deps resolution. it shouldn't happen`\n );\n return;\n }\n // Lazily get the dependencies\n resolvedParentDeps = resolvedParentDeps || (await this.getDependencies(resolvedParentComponent));\n const resolvedDep = resolvedParentDeps.findDependency(dep.id, { ignoreVersion: true });\n dep.id = resolvedDep?.id ?? dep.id;\n await this.resolveRequireableExtensionManifestDepsVersionsRecursively(dep.id, dep);\n });\n };\n if (manifest.dependencies) {\n manifest.dependencies = manifest.dependencies.map((dep) => this.aspectLoader.cloneManifest(dep));\n await updateDirectDepsVersions(manifest.dependencies);\n }\n // @ts-ignore\n if (manifest?._runtimes) {\n // @ts-ignore\n await mapSeries(manifest?._runtimes, async (runtime: RuntimeManifest) => {\n if (runtime.dependencies) {\n runtime.dependencies = runtime.dependencies.map((dep) => this.aspectLoader.cloneManifest(dep));\n await updateDirectDepsVersions(runtime.dependencies);\n }\n });\n }\n\n return manifest;\n }\n\n /**\n * Return a list of outdated policy dependencies.\n */\n async getOutdatedPkgsFromPolicies({\n rootDir,\n variantPoliciesByPatterns,\n componentPolicies,\n components,\n patterns,\n forceVersionBump,\n }: {\n rootDir: string;\n variantPoliciesByPatterns: Record<string, VariantPolicyConfigObject>;\n componentPolicies: Array<{ componentId: ComponentID; policy: any }>;\n components: Component[];\n patterns?: string[];\n forceVersionBump?: 'major' | 'minor' | 'patch' | 'compatible';\n }): Promise<MergedOutdatedPkg[] | null> {\n const localComponentPkgNames = new Set(components.map((component) => this.getPackageName(component)));\n const componentModelVersions: ComponentModelVersion[] = (\n await Promise.all(\n components.map(async (component) => {\n const depList = await this.getDependencies(component);\n return depList\n .filter(\n (dep) =>\n typeof dep.getPackageName === 'function' &&\n // If the dependency is referenced not via a valid range it means that it wasn't yet published to the registry\n semver.validRange(dep.version) != null &&\n !dep['isExtension'] && // eslint-disable-line\n dep.lifecycle !== 'peer' &&\n !localComponentPkgNames.has(dep.getPackageName())\n )\n .map((dep) => ({\n name: dep.getPackageName!(), // eslint-disable-line\n version: dep.version,\n isAuto: dep.source === 'auto',\n componentId: component.id,\n lifecycleType: dep.lifecycle,\n }));\n })\n )\n ).flat();\n let allPkgs = getAllPolicyPkgs({\n rootPolicy: this.getWorkspacePolicyFromConfig(),\n variantPoliciesByPatterns,\n componentPolicies,\n componentModelVersions,\n });\n if (patterns?.length) {\n const selectedPkgNames = new Set(\n multimatch(\n allPkgs.map(({ name }) => name),\n patterns\n )\n );\n allPkgs = allPkgs.filter(({ name }) => selectedPkgNames.has(name));\n if (!allPkgs.length) {\n return null;\n }\n }\n const outdatedPkgs = await this.getOutdatedPkgs({ rootDir, forceVersionBump }, allPkgs);\n return mergeOutdatedPkgs(outdatedPkgs);\n }\n\n /**\n * Accepts a list of package dependency policies and returns a list of outdated policies extended with their \"latestRange\"\n */\n async getOutdatedPkgs<T>(\n {\n rootDir,\n forceVersionBump,\n }: {\n rootDir: string;\n forceVersionBump?: 'major' | 'minor' | 'patch' | 'compatible';\n },\n pkgs: Array<\n { name: string; currentRange: string; source: 'variants' | 'component' | 'rootPolicy' | 'component-model' } & T\n >\n ): Promise<Array<{ name: string; currentRange: string; latestRange: string } & T>> {\n this.logger.setStatusLine('checking the latest versions of dependencies');\n const resolver = await this.getVersionResolver();\n const tryResolve = async (spec: string) => {\n try {\n return (\n await resolver.resolveRemoteVersion(spec, {\n rootDir,\n })\n ).version;\n } catch {\n // If latest cannot be found for the package, then just ignore it\n return null;\n }\n };\n const outdatedPkgs = compact(\n await Promise.all(\n pkgs.map(async (pkg) => {\n const latestVersion = await tryResolve(\n `${pkg.name}@${newVersionRange(pkg.currentRange, { pkgSource: pkg.source, forceVersionBump })}`\n );\n if (!latestVersion) return null;\n const currentVersion = semver.valid(pkg.currentRange.replace(/[\\^~]/, ''));\n // If the current version is newer than the latest, then no need to update the dependency\n if (currentVersion && (semver.gt(currentVersion, latestVersion) || currentVersion === latestVersion))\n return null;\n return {\n ...pkg,\n latestRange:\n pkg.source === 'component-model' && this.config.savePrefix != null\n ? `${this.config.savePrefix}${latestVersion}`\n : repeatPrefix(pkg.currentRange, latestVersion),\n } as any;\n })\n )\n );\n this.logger.consoleSuccess();\n return outdatedPkgs;\n }\n\n /**\n * Update the specified packages to their latest versions in all policies;\n * root polcies, variant pocilicies, and component configuration policies (component.json).\n */\n applyUpdates(\n outdatedPkgs: Array<Omit<OutdatedPkg, 'currentRange'>>,\n options: {\n variantPoliciesByPatterns: Record<string, any>;\n }\n ): {\n updatedVariants: string[];\n updatedComponents: UpdatedComponent[];\n } {\n const { updatedVariants, updatedComponents, updatedWorkspacePolicyEntries } = applyUpdates(outdatedPkgs, {\n variantPoliciesByPatterns: options.variantPoliciesByPatterns,\n });\n this.addToRootPolicy(updatedWorkspacePolicyEntries, {\n updateExisting: true,\n });\n return {\n updatedVariants,\n updatedComponents,\n };\n }\n\n static runtime = MainRuntime;\n static dependencies = [\n EnvsAspect,\n LoggerAspect,\n ConfigAspect,\n AspectLoaderAspect,\n ComponentAspect,\n GraphqlAspect,\n GlobalConfigAspect,\n ];\n\n static slots = [\n Slot.withType<WorkspacePolicy>(),\n Slot.withType<VariantPolicyConfigObject>(),\n Slot.withType<PackageManager>(),\n Slot.withType<RegExp>(),\n Slot.withType<DependencyFactory>(),\n Slot.withType<PreInstallSubscriberList>(),\n Slot.withType<PostInstallSubscriberList>(),\n Slot.withType<DependencyDetector>(),\n ];\n\n static defaultConfig: DependencyResolverWorkspaceConfig &\n Required<Pick<DependencyResolverWorkspaceConfig, 'linkCoreAspects'>> = {\n /**\n * default package manager.\n */\n packageManager: 'teambit.dependencies/pnpm',\n policy: {},\n linkCoreAspects: true,\n };\n\n static async provider(\n [envs, loggerExt, configMain, aspectLoader, componentAspect, graphql, globalConfig]: [\n EnvsMain,\n LoggerMain,\n ConfigMain,\n AspectLoaderMain,\n ComponentMain,\n GraphqlMain,\n GlobalConfigMain,\n ],\n config: DependencyResolverWorkspaceConfig,\n [\n rootPolicyRegistry,\n policiesRegistry,\n packageManagerSlot,\n dependencyFactorySlot,\n preInstallSlot,\n postInstallSlot,\n ]: [\n RootPolicyRegistry,\n PoliciesRegistry,\n PackageManagerSlot,\n DependencyFactorySlot,\n PreInstallSlot,\n PostInstallSlot,\n ]\n ) {\n // const packageManager = new PackageManagerLegacy(config.packageManager, logger);\n const logger = loggerExt.createLogger(DependencyResolverAspect.id);\n const dependencyResolver = new DependencyResolverMain(\n config,\n rootPolicyRegistry,\n policiesRegistry,\n envs,\n logger,\n configMain,\n aspectLoader,\n globalConfig,\n componentAspect,\n packageManagerSlot,\n dependencyFactorySlot,\n preInstallSlot,\n postInstallSlot\n );\n\n componentAspect.registerShowFragments([\n new DependenciesFragment(dependencyResolver),\n new DevDependenciesFragment(dependencyResolver),\n new PeerDependenciesFragment(dependencyResolver),\n ]);\n // TODO: solve this generics issue and remove the ts-ignore\n // @ts-ignore\n dependencyResolver.registerDependencyFactories([new ComponentDependencyFactory(componentAspect)]);\n\n LegacyComponent.registerOnComponentOverridesLoading(\n DependencyResolverAspect.id,\n async (configuredExtensions: ExtensionDataList, id: ComponentID, legacyFiles: SourceFile[]) => {\n const policy = await dependencyResolver.mergeVariantPolicies(configuredExtensions, id, legacyFiles);\n return policy.toLegacyDepsOverrides();\n }\n );\n if (aspectLoader)\n aspectLoader.registerOnLoadRequireableExtensionSlot(\n dependencyResolver.onLoadRequireableExtensionSubscriber.bind(dependencyResolver)\n );\n\n graphql.register(dependencyResolverSchema(dependencyResolver));\n envs.registerService(new DependenciesService());\n envs.registerEnvJsoncMergeCustomizer(dependencyResolver.mergeEnvManifestPolicy.bind(dependencyResolver));\n\n // this is needed because during tag process, the data.dependencies can be loaded and the componentId can become\n // an instance of ComponentID class. it needs to be serialized before saved into objects.\n const serializeDepResolverDataBeforePersist = (extDataList: ExtensionDataList) => {\n const entry = extDataList.findCoreExtension(DependencyResolverAspect.id);\n if (!entry) return;\n const dependencies = get(entry, ['data', 'dependencies'], []);\n dependencies.forEach((dep) => {\n if (dep.__type === COMPONENT_DEP_TYPE) {\n dep.componentId = dep.componentId instanceof ComponentID ? dep.componentId.serialize() : dep.componentId;\n }\n });\n };\n ExtensionDataList.toModelObjectsHook.push(serializeDepResolverDataBeforePersist);\n PackageJsonTransformer.registerPackageJsonTransformer(async (component, packageJsonObject) => {\n const deps = dependencyResolver.getDependencies(component);\n const { optionalDependencies, peerDependenciesMeta } = deps.toDependenciesManifest();\n packageJsonObject.optionalDependencies = optionalDependencies;\n packageJsonObject.peerDependenciesMeta = peerDependenciesMeta;\n const entry = component.get(DependencyResolverAspect.id);\n if (entry?.config.peer) {\n if (!packageJsonObject.bit) {\n packageJsonObject.bit = {};\n }\n packageJsonObject.bit.peer = true;\n if (entry.config.defaultPeerRange) {\n packageJsonObject.bit.defaultPeerRange = entry.config.defaultPeerRange;\n }\n }\n return packageJsonObject;\n });\n\n return dependencyResolver;\n }\n\n getEmptyDepsObject(): ManifestDependenciesObject {\n return {\n dependencies: {},\n devDependencies: {},\n peerDependencies: {},\n };\n }\n\n /**\n * Returns a list of target locations where that given component was hard linked to.\n *\n * @param rootDir - The root directory of the workspace\n * @param componentDir - Relative path to the component's directory\n * @param packageName - The injected component's packageName\n */\n async getInjectedDirs(rootDir: string, componentDir: string, packageName: string): Promise<string[]> {\n const packageManager = this.getPackageManager();\n if (typeof packageManager?.getInjectedDirs === 'function') {\n return packageManager.getInjectedDirs(rootDir, componentDir, packageName);\n }\n return [];\n }\n\n getWorkspaceDepsOfBitRoots(manifests: ProjectManifest[]): Record<string, string> {\n const packageManager = this.getPackageManager();\n if (!packageManager) {\n throw new PackageManagerNotFound(this.config.packageManager);\n }\n return packageManager.getWorkspaceDepsOfBitRoots(manifests);\n }\n}\n\nDependencyResolverAspect.addRuntime(DependencyResolverMain);\n\nfunction repeatPrefix(originalSpec: string, newVersion: string): string {\n switch (originalSpec[0]) {\n case '~':\n case '^':\n return `${originalSpec[0]}${newVersion}`;\n default:\n return newVersion;\n }\n}\n\nfunction newVersionRange(\n currentRange: string,\n opts: { pkgSource: CurrentPkgSource; forceVersionBump?: 'major' | 'minor' | 'patch' | 'compatible' }\n) {\n if (opts.forceVersionBump == null || opts.forceVersionBump === 'major') return 'latest';\n const currentVersion = semver.valid(currentRange.replace(/[\\^~]/, ''));\n if (opts.forceVersionBump === 'compatible') {\n if ((opts.pkgSource === 'component' || opts.pkgSource === 'component-model') && currentVersion === currentRange) {\n return `^${currentVersion}`;\n }\n return currentRange;\n }\n if (!currentVersion) return null;\n const [major, minor] = currentVersion.split('.');\n switch (opts.forceVersionBump) {\n case 'patch':\n return `>=${currentVersion} <${major}.${+minor + 1}.0`;\n case 'minor':\n return `>=${currentVersion} <${+major + 1}.0.0`;\n default:\n return null;\n }\n}\n\nexport interface MergedOutdatedPkg extends OutdatedPkg {\n dependentComponents?: ComponentID[];\n hasDifferentRanges?: boolean;\n}\n\nfunction mergeOutdatedPkgs(outdatedPkgs: OutdatedPkg[]): MergedOutdatedPkg[] {\n const mergedOutdatedPkgs: Record<\n string,\n MergedOutdatedPkg & Required<Pick<MergedOutdatedPkg, 'dependentComponents'>>\n > = {};\n const outdatedPkgsNotFromComponentModel: OutdatedPkg[] = [];\n for (const outdatedPkg of outdatedPkgs) {\n if (outdatedPkg.source === 'component-model' && outdatedPkg.componentId) {\n if (!mergedOutdatedPkgs[outdatedPkg.name]) {\n mergedOutdatedPkgs[outdatedPkg.name] = {\n ...omit(outdatedPkg, ['componentId']),\n source: 'rootPolicy',\n dependentComponents: [outdatedPkg.componentId],\n };\n } else {\n if (mergedOutdatedPkgs[outdatedPkg.name].currentRange !== outdatedPkg.currentRange) {\n mergedOutdatedPkgs[outdatedPkg.name].hasDifferentRanges = true;\n }\n mergedOutdatedPkgs[outdatedPkg.name].currentRange = tryPickLowestRange(\n mergedOutdatedPkgs[outdatedPkg.name].currentRange,\n outdatedPkg.currentRange\n );\n mergedOutdatedPkgs[outdatedPkg.name].dependentComponents.push(outdatedPkg.componentId);\n if (outdatedPkg.targetField === 'dependencies') {\n mergedOutdatedPkgs[outdatedPkg.name].targetField = outdatedPkg.targetField;\n }\n }\n } else {\n outdatedPkgsNotFromComponentModel.push(outdatedPkg);\n }\n }\n return [...Object.values(mergedOutdatedPkgs), ...outdatedPkgsNotFromComponentModel];\n}\n\nfunction tryPickLowestRange(range1: string, range2: string) {\n if (range1 === '*' || range2 === '*') return '*';\n try {\n return semver.lt(rangeToVersion(range1), rangeToVersion(range2)) ? range1 : range2;\n } catch {\n return '*';\n }\n}\n\nfunction rangeToVersion(range: string) {\n if (range.startsWith('~') || range.startsWith('^')) {\n return range.substring(1);\n }\n return range;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,YAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,gBAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,eAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,KAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,IAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,KAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,IAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,WAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,UAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,WAAA;EAAA,MAAAR,IAAA,GAAAE,OAAA;EAAAM,UAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAS,MAAA;EAAA,MAAAT,IAAA,GAAAE,OAAA;EAAAO,KAAA,YAAAA,CAAA;IAAA,OAAAT,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAU,QAAA;EAAA,MAAAV,IAAA,GAA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c,CAACH,MAAM,CAAC,EAAEG,cAAc,CAACF,MAAM,CAAC,CAAC,GAAGD,MAAM,GAAGC,MAAM;EACpF,CAAC,CAAC,MAAM;IACN,OAAO,GAAG;EACZ;AACF;AAEA,SAASE,cAAcA,CAACC,KAAa,EAAE;EACrC,IAAIA,KAAK,CAAC1O,UAAU,CAAC,GAAG,CAAC,IAAI0O,KAAK,CAAC1O,UAAU,CAAC,GAAG,CAAC,EAAE;IAClD,OAAO0O,KAAK,CAACC,SAAS,CAAC,CAAC,CAAC;EAC3B;EACA,OAAOD,KAAK;AACd","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_multimatch","data","_interopRequireDefault","require","_pMapSeries","_harmonyModules","_cli","_bit","_workspace","_component","_path","_lodash","_config","_envs","_harmony","_graphql","_logger","_constants","_legacy","_pkgModules","_dependencies","_http","_component2","_fsExtra","_componentId","_network","_semver","_interopRequireWildcard","_aspectLoader","_globalConfig","_workspaceModules","_registry","_applyUpdates","_constants2","_dependencyInstaller","_dependencyResolver","_dependencyVersionResolver","_dependencyLinker","_getAllPolicyPkgs","_exceptions","_manifest","_policy","_dependencies2","_showFragments","_dependencyResolver2","_dependencies3","_envPolicy","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ownKeys","keys","getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","_toPropertyKey","value","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","BIT_CLOUD_REGISTRY","exports","getCloudDomain","NPM_REGISTRY","defaultLinkingOptions","linkTeambitBit","linkCoreAspects","defaultCreateFromComponentsOptions","filterComponentsFromManifests","createManifestForComponentsWithoutDependencies","DependencyResolverMain","constructor","config","rootPolicyRegistry","policiesRegistry","envs","logger","configAspect","aspectLoader","globalConfig","componentAspect","packageManagerSlot","dependencyFactorySlot","preInstallSlot","postInstallSlot","Set","supportsDedupingOnExistingRoot","packageManager","getPackageManager","isolatedCapsules","setConfig","hasRootComponents","Boolean","rootComponents","getSync","CFG_ISOLATED_SCOPE_CAPSULES","defaultVal","undefined","res","hasHarmonyInRootPolicy","rootPolicy","getWorkspacePolicyFromConfig","entries","some","dependencyId","nodeLinker","packageManagerName","pmName","defaultConfig","registerPackageManager","register","registerDependencyFactories","factories","registerPreInstallSubscribers","subscribers","registerPostInstallSubscribers","getSavePrefix","savePrefix","getVersionWithSavePrefix","version","overridePrefix","wantedRange","semver","parse","prerelease","includes","prefix","versionWithPrefix","validRange","InvalidVersionWithPrefix","getPolicy","component","entry","state","aspects","DependencyResolverAspect","id","VariantPolicy","getEmpty","serializedPolicy","extractDepsFromLegacy","policy","componentPolicy","legacyComponent","_consumer","listFactory","getDependencyListFactory","dependencyList","fromLegacyComponent","dep","found","find","packageName","getPackageName","source","hidden","optional","values","flat","factoriesMap","reduce","acc","factory","type","DependencyListFactory","getDependencies","includeHidden","DependencyList","fromArray","serializedDependencies","dependencies","depList","getDependenciesFromSerializedDependencies","filterHidden","getDependenciesFromLegacyComponent","extensions","findCoreExtension","getComponentDependencies","deps","fromSerializedDependencies","getWorkspacePolicy","_workspacePolicy","policyFromConfig","externalPolicies","toArray","map","mergeWorkspacePolices","getWorkspacePolicyManifest","workspacePolicy","toManifest","clearCache","WorkspacePolicyFactory","fromConfigObject","getWorkspacePolicyFromConfigObject","obj","getWorkspacePolicyFromPackageJson","packageJson","fromPackageJson","polices","WorkspacePolicy","mergePolices","getWorkspaceManifest","name","ROOT_NAME","SemVer","rootDir","components","options","context","statusMessage","inCapsule","setStatusLine","concreteOpts","workspaceManifestFactory","WorkspaceManifestFactory","createFromComponents","consoleSuccess","getDepResolverData","calcPackageName","createComponentIdByPkgNameMap","componentIdByPkgName","Map","componentIdToPackageName","getRuntimeModulePath","modulePath","getModulePath","pkgName","rootComponentsRelativePath","relative","workspacePath","rootComponentsPath","getRelativeRootComponentDir","getRootComponentDir","bind","selfRootDir","isInWorkspace","toStringWithoutVersion","toString","fs","pathExistsSync","innerDir","join","dirInEnvRoot","getComponentDirInBitRoots","envId","getEnvId","relativePath","addDependenciesGraph","componentRelativeDir","dependenciesGraph","calcDependenciesGraph","componentRootDir","err","isFeatureEnabled","DEPS_GRAPH","getInstaller","cacheRootDir","cacheRootDirectory","CFG_PACKAGE_MANAGER_CACHE","PackageManagerNotFound","debug","ensureDirSync","preInstallSubscribers","getPreInstallSubscribers","postInstallSubscribers","getPostInstallSubscribers","DependencyInstaller","packageImportMethod","sideEffectsCache","nodeVersion","engineStrict","peerDependencyRules","neverBuiltDependencies","preferOffline","installingContext","getLinker","linkingOptions","assign","DependencyLinker","linkingContext","getPackageManagerName","getVersionResolver","networkConcurrency","getNetworkConfig","DependencyVersionResolver","getCompIdsThatShouldNotBeInPolicy","getAllCoreAspectsIds","getSystemPackageManager","defaultPm","Error","getProxyConfig","proxyConfigFromDepResolverConfig","getProxyConfigFromDepResolverConfig","httpProxy","httpsProxy","proxyConfigFromPackageManager","getProxyConfigFromPackageManager","proxyConfigFromGlobalConfig","getProxyConfigFromGlobalConfig","proxy","noProxy","networkConfig","getNetworkConfigFromGlobalConfig","getNetworkConfigFromPackageManager","getNetworkConfigFromDepResolverConfig","JSON","stringify","key","globalNetworkConfig","Http","ca","cafile","readCAFileSync","pick","strictSsl","strictSSL","toLowerCase","networkConfigFromPackageManager","systemPm","getMissingPeerDependencies","componentDirectoryMap","peerDependencyIssues","installer","manifests","getComponentManifests","getPeerDependencyIssues","intersections","getRegistries","registries","getDefaultBitRegistry","bitGlobalConfigRegistry","CFG_REGISTRY_URL_KEY","bitRegistry","bitOriginalAuthType","bitAuthHeaderValue","bitOriginalAuthValue","getBitAuthConfig","alwaysAuth","bitDefaultRegistry","Registry","installFromBitDevRegistry","defaultRegistry","uri","startsWith","setDefaultRegistry","addAuthToScopedBitRegistries","updatedRegistries","scopes","registry","authHeaderValue","registryWithAuth","updateScopedRegistry","bitGlobalConfigToken","CFG_USER_TOKEN_KEY","addToRootPolicy","add","updateConfigPolicy","removeFromRootPolicy","dependencyIds","workspacePolicyUpdated","remove","isRemoved","workspacePolicyObject","toConfigObject","setExtension","overrideExisting","ignoreVersion","persistConfig","reasonForChange","workspaceConfig","write","registerDependenciesPolicies","registerRootPolicy","getComponentEnvPolicyFromExtension","configuredExtensions","calculateEnvIdFromExtensions","isCoreEnv","env","calculateEnvFromExtensions","getComponentEnvPolicyFromEnv","fromFile","getEnvPolicyFromFile","getEnvPolicyFromEnvId","legacyFiles","envDef","getEnvDefinitionById","getEnvPolicyFromEnvLegacyId","getComponentEnvPolicy","calculateEnvId","envIdWithoutVersion","getEnv","envsWithoutManifest","getEnvManifest","envComponent","object","allPoliciesFromEnv","EnvPolicy","includeLegacyPeersInSelfPolicy","mergeEnvManifestPolicy","parent","child","cloneDeep","childEntries","foundChildEntry","childEntry","concat","getEnvComponentByEnvId","policiesFromEnvConfig","idWithoutVersion","split","getComponentEnvPolicyFromEnvDefinition","getPreviewHostDependenciesFromEnv","hostDeps","getAdditionalHostDependencies","uniq","mergeVariantPolicies","policiesFromSlots","policiesFromConfig","policiesFromEnv","configuredIds","ids","policiesTuples","extId","policyTupleToApply","policyRegistrar","currentPolicy","currentExtension","findExtension","currentConfig","policiesFromEnvForItself","getPoliciesFromEnvForItself","result","envPolicy","selfPolicy","updateDepsOnLegacyTag","idTransformer","__type","COMPONENT_DEP_TYPE","depId","componentId","ComponentID","fromObject","newDepId","serialize","registerDetector","detector","DetectorHook","hooks","calcComponentEnvDepDetectors","depEnv","getDepDetectors","onLoadRequireableExtensionSubscriber","requireableExtension","manifest","parentComponent","resolveRequireableExtensionManifestDepsVersionsRecursively","resolvedParentComponent","resolvedParentDeps","updateDirectDepsVersions","mapSeries","isCoreAspect","parentComponentId","getHost","resolveComponentId","error","resolvedDep","findDependency","cloneManifest","_runtimes","runtime","getOutdatedPkgsFromPolicies","variantPoliciesByPatterns","componentPolicies","patterns","forceVersionBump","localComponentPkgNames","componentModelVersions","Promise","all","lifecycle","isAuto","lifecycleType","allPkgs","getAllPolicyPkgs","selectedPkgNames","multimatch","outdatedPkgs","getOutdatedPkgs","mergeOutdatedPkgs","pkgs","resolver","tryResolve","spec","resolveRemoteVersion","compact","pkg","latestVersion","newVersionRange","currentRange","pkgSource","currentVersion","valid","replace","gt","latestRange","repeatPrefix","applyUpdates","updatedVariants","updatedComponents","updatedWorkspacePolicyEntries","updateExisting","provider","loggerExt","configMain","graphql","createLogger","dependencyResolver","registerShowFragments","DependenciesFragment","DevDependenciesFragment","PeerDependenciesFragment","ComponentDependencyFactory","LegacyComponent","registerOnComponentOverridesLoading","toLegacyDepsOverrides","registerOnLoadRequireableExtensionSlot","dependencyResolverSchema","registerService","DependenciesService","registerEnvJsoncMergeCustomizer","serializeDepResolverDataBeforePersist","extDataList","ExtensionDataList","toModelObjectsHook","PackageJsonTransformer","registerPackageJsonTransformer","packageJsonObject","optionalDependencies","peerDependenciesMeta","toDependenciesManifest","peer","bit","defaultPeerRange","getEmptyDepsObject","devDependencies","peerDependencies","getInjectedDirs","componentDir","getWorkspaceDepsOfBitRoots","MainRuntime","EnvsAspect","LoggerAspect","ConfigAspect","AspectLoaderAspect","ComponentAspect","GraphqlAspect","GlobalConfigAspect","Slot","withType","addRuntime","originalSpec","newVersion","opts","major","minor","mergedOutdatedPkgs","outdatedPkgsNotFromComponentModel","outdatedPkg","omit","dependentComponents","hasDifferentRanges","tryPickLowestRange","targetField","range1","range2","lt","rangeToVersion","range","substring"],"sources":["dependency-resolver.main.runtime.ts"],"sourcesContent":["import multimatch from 'multimatch';\nimport mapSeries from 'p-map-series';\nimport { DEPS_GRAPH, isFeatureEnabled } from '@teambit/harmony.modules.feature-toggle';\nimport { MainRuntime } from '@teambit/cli';\nimport { getAllCoreAspectsIds } from '@teambit/bit';\nimport { getRootComponentDir } from '@teambit/workspace.root-components';\nimport { ComponentAspect, Component, ComponentMap, ComponentMain, IComponent } from '@teambit/component';\nimport type { ConfigMain } from '@teambit/config';\nimport { join, relative } from 'path';\nimport { compact, get, pick, uniq, omit, cloneDeep } from 'lodash';\nimport { ConfigAspect } from '@teambit/config';\nimport { EnvsAspect } from '@teambit/envs';\nimport type { DependenciesEnv, EnvDefinition, EnvJsonc, EnvsMain } from '@teambit/envs';\nimport { Slot, SlotRegistry, ExtensionManifest, Aspect, RuntimeManifest } from '@teambit/harmony';\nimport { RequireableComponent } from '@teambit/harmony.modules.requireable-component';\nimport type { LoggerMain } from '@teambit/logger';\nimport { GraphqlAspect, GraphqlMain } from '@teambit/graphql';\nimport { Logger, LoggerAspect } from '@teambit/logger';\nimport {\n CFG_PACKAGE_MANAGER_CACHE,\n CFG_REGISTRY_URL_KEY,\n CFG_USER_TOKEN_KEY,\n CFG_ISOLATED_SCOPE_CAPSULES,\n getCloudDomain,\n} from '@teambit/legacy/dist/constants';\nimport { ExtensionDataList } from '@teambit/legacy.extension-data';\nimport { componentIdToPackageName } from '@teambit/pkg.modules.component-package-name';\nimport { DetectorHook } from '@teambit/dependencies';\nimport { Http, ProxyConfig, NetworkConfig } from '@teambit/legacy/dist/scope/network/http';\nimport { onTagIdTransformer } from '@teambit/snapping';\nimport LegacyComponent from '@teambit/legacy/dist/consumer/component';\nimport fs from 'fs-extra';\nimport { ComponentID } from '@teambit/component-id';\nimport { readCAFileSync } from '@pnpm/network.ca-file';\nimport { SourceFile } from '@teambit/component.sources';\nimport { ProjectManifest } from '@pnpm/types';\nimport semver, { SemVer } from 'semver';\nimport { AspectLoaderAspect, AspectLoaderMain } from '@teambit/aspect-loader';\nimport { GlobalConfigAspect, GlobalConfigMain } from '@teambit/global-config';\nimport { PackageJsonTransformer } from '@teambit/workspace.modules.node-modules-linker';\nimport { Registries, Registry } from './registry';\nimport { applyUpdates, UpdatedComponent } from './apply-updates';\nimport { ROOT_NAME } from './dependencies/constants';\nimport {\n DependencyInstaller,\n PreInstallSubscriberList,\n PostInstallSubscriberList,\n DepInstallerContext,\n} from './dependency-installer';\nimport { DependencyResolverAspect } from './dependency-resolver.aspect';\nimport { DependencyVersionResolver } from './dependency-version-resolver';\nimport { DepLinkerContext, DependencyLinker, LinkingOptions } from './dependency-linker';\nimport { DependencyResolverWorkspaceConfig, NodeLinker } from './dependency-resolver-workspace-config';\nimport { ComponentModelVersion, getAllPolicyPkgs, OutdatedPkg, CurrentPkgSource } from './get-all-policy-pkgs';\nimport { InvalidVersionWithPrefix, PackageManagerNotFound } from './exceptions';\nimport {\n CreateFromComponentsOptions,\n WorkspaceManifest,\n WorkspaceManifestFactory,\n ManifestDependenciesObject,\n} from './manifest';\nimport {\n WorkspacePolicyConfigObject,\n VariantPolicyConfigObject,\n WorkspacePolicy,\n WorkspacePolicyFactory,\n VariantPolicy,\n WorkspacePolicyAddEntryOptions,\n WorkspacePolicyEntry,\n SerializedVariantPolicy,\n} from './policy';\nimport {\n PackageManager,\n PeerDependencyIssuesByProjects,\n PackageManagerGetPeerDependencyIssuesOptions,\n} from './package-manager';\n\nimport {\n SerializedDependency,\n DependencyListFactory,\n DependencyFactory,\n ComponentDependencyFactory,\n COMPONENT_DEP_TYPE,\n DependencyList,\n ComponentDependency,\n} from './dependencies';\nimport { DependenciesFragment, DevDependenciesFragment, PeerDependenciesFragment } from './show-fragments';\nimport { dependencyResolverSchema } from './dependency-resolver.graphql';\nimport { DependencyDetector } from './dependency-detector';\nimport { DependenciesService } from './dependencies.service';\nimport { EnvPolicy } from './policy/env-policy';\n\nexport const BIT_CLOUD_REGISTRY = `https://node-registry.${getCloudDomain()}/`;\nexport const NPM_REGISTRY = 'https://registry.npmjs.org/';\n\nexport { ProxyConfig, NetworkConfig } from '@teambit/legacy/dist/scope/network/http';\n\nexport interface DependencyResolverComponentData {\n packageName: string;\n policy: SerializedVariantPolicy;\n dependencies: SerializedDependency;\n}\n\nexport interface DependencyResolverVariantConfig {\n policy: VariantPolicyConfigObject;\n}\n\nexport type RootPolicyRegistry = SlotRegistry<WorkspacePolicy>;\nexport type PoliciesRegistry = SlotRegistry<VariantPolicyConfigObject>;\nexport type PackageManagerSlot = SlotRegistry<PackageManager>;\nexport type DependencyFactorySlot = SlotRegistry<DependencyFactory[]>;\nexport type PreInstallSlot = SlotRegistry<PreInstallSubscriberList>;\nexport type PostInstallSlot = SlotRegistry<PostInstallSubscriberList>;\n\nexport type MergeDependenciesFunc = (configuredExtensions: ExtensionDataList) => Promise<VariantPolicyConfigObject>;\n\nexport type GetInstallerOptions = {\n rootDir?: string;\n packageManager?: string;\n cacheRootDirectory?: string;\n installingContext?: DepInstallerContext;\n nodeLinker?: NodeLinker;\n};\n\nexport type GetLinkerOptions = {\n rootDir?: string;\n linkingOptions?: LinkingOptions;\n linkingContext?: DepLinkerContext;\n};\n\nexport type GetDependenciesOptions = {\n includeHidden?: boolean;\n};\n\nexport type GetVersionResolverOptions = {\n cacheRootDirectory?: string;\n};\n\nconst defaultLinkingOptions: LinkingOptions = {\n linkTeambitBit: true,\n linkCoreAspects: true,\n};\n\nconst defaultCreateFromComponentsOptions: CreateFromComponentsOptions = {\n filterComponentsFromManifests: true,\n createManifestForComponentsWithoutDependencies: true,\n};\n\nexport class DependencyResolverMain {\n /**\n * cache the workspace policy to improve performance. when workspace.jsonc is changed, this gets cleared.\n * @see workspace.triggerOnWorkspaceConfigChange\n */\n private _workspacePolicy: WorkspacePolicy | undefined;\n constructor(\n /**\n * Dependency resolver extension configuration.\n */\n public config: DependencyResolverWorkspaceConfig,\n\n /**\n * Registry for changes by other extensions.\n */\n private rootPolicyRegistry: RootPolicyRegistry,\n\n /**\n * Registry for changes by other extensions.\n */\n private policiesRegistry: PoliciesRegistry,\n\n /**\n * envs extension.\n */\n private envs: EnvsMain,\n\n private logger: Logger,\n\n private configAspect: ConfigMain,\n\n private aspectLoader: AspectLoaderMain,\n\n private globalConfig: GlobalConfigMain,\n\n /**\n * component aspect.\n */\n readonly componentAspect: ComponentMain,\n\n private packageManagerSlot: PackageManagerSlot,\n\n private dependencyFactorySlot: DependencyFactorySlot,\n\n private preInstallSlot: PreInstallSlot,\n\n private postInstallSlot: PostInstallSlot\n ) {}\n\n /**\n * Save list of envs that doesn't contains env.jsonc file\n * this is used to show warning / instuctions to the user\n */\n public envsWithoutManifest = new Set<string>();\n\n /**\n * This function is a temporary workaround for installation in capsules with pnpm.\n * Currently pnpm breaks the root node_modules inside the capsule because it removes deps from it.\n * Install runs several times in the same capsule and pnpm removes deps from the previous runs.\n *\n * This workaround unfortunately also breaks pnpm on angular projects. Because dedupe doesn't work properly.\n * To fix this issue we'll either have to switch to root components or try to change pnpm code.\n *\n * Here is the PR where initially dedupe was turned off for pnpm: https://github.com/teambit/bit/pull/5410\n */\n supportsDedupingOnExistingRoot(): boolean {\n const packageManager = this.getPackageManager();\n return packageManager?.supportsDedupingOnExistingRoot?.() === true && !this.isolatedCapsules();\n }\n\n setConfig(config: DependencyResolverWorkspaceConfig) {\n this.config = config;\n }\n\n hasRootComponents(): boolean {\n return Boolean(this.config.rootComponents);\n }\n\n isolatedCapsules(): boolean {\n const globalConfig = this.globalConfig.getSync(CFG_ISOLATED_SCOPE_CAPSULES);\n // @ts-ignore\n const defaultVal = globalConfig !== undefined ? globalConfig === true || globalConfig === 'true' : true;\n const res = this.config.isolatedCapsules ?? defaultVal;\n return res;\n }\n\n hasHarmonyInRootPolicy(): boolean {\n const rootPolicy = this.getWorkspacePolicyFromConfig();\n return rootPolicy.entries.some(({ dependencyId }) => dependencyId === '@teambit/harmony');\n }\n\n nodeLinker(packageManagerName?: string): NodeLinker {\n if (this.config.nodeLinker) return this.config.nodeLinker;\n const pmName = packageManagerName || this.config.packageManager;\n if (pmName === 'teambit.dependencies/yarn') return 'hoisted';\n return 'isolated';\n }\n\n linkCoreAspects(): boolean {\n return this.config.linkCoreAspects ?? DependencyResolverMain.defaultConfig.linkCoreAspects;\n }\n\n /**\n * register a new package manager to the dependency resolver.\n */\n registerPackageManager(packageManager: PackageManager) {\n this.packageManagerSlot.register(packageManager);\n }\n\n registerDependencyFactories(factories: DependencyFactory[]) {\n this.dependencyFactorySlot.register(factories);\n }\n\n registerPreInstallSubscribers(subscribers: PreInstallSubscriberList) {\n this.preInstallSlot.register(subscribers);\n }\n\n registerPostInstallSubscribers(subscribers: PreInstallSubscriberList) {\n this.postInstallSlot.register(subscribers);\n }\n\n getSavePrefix(): string {\n return this.config.savePrefix || '^';\n }\n\n getVersionWithSavePrefix({\n version,\n overridePrefix,\n wantedRange,\n }: {\n version: string;\n overridePrefix?: string;\n wantedRange?: string;\n }): string {\n // A prerelease version is always added as an exact version.\n // A package installed by its exact version is also added as an exact version.\n if (semver.parse(version)?.prerelease.length || wantedRange === version) {\n return version;\n }\n if (wantedRange && ['~', '^'].includes(wantedRange[0])) {\n return wantedRange;\n }\n const prefix = overridePrefix || this.getSavePrefix();\n const versionWithPrefix = `${prefix}${version}`;\n if (!semver.validRange(versionWithPrefix)) {\n throw new InvalidVersionWithPrefix(versionWithPrefix);\n }\n return versionWithPrefix;\n }\n\n async getPolicy(component: Component): Promise<VariantPolicy> {\n const entry = component.state.aspects.get(DependencyResolverAspect.id);\n if (!entry) {\n return VariantPolicy.getEmpty();\n }\n const serializedPolicy: SerializedVariantPolicy = get(entry, ['data', 'policy'], []);\n return VariantPolicy.parse(serializedPolicy);\n }\n\n /**\n * This function called on component load in order to calculate the dependencies based on the legacy (consumer) component\n * and write them to the dependencyResolver data.\n * Do not use this function for other purpose.\n * If you want to get the component dependencies call getDependencies (which will give you the dependencies from the data itself)\n * TODO: once we switch deps resolver <> workspace relation we should make it private\n * TODO: once we switch deps resolver <> workspace relation we should remove the resolveId func here\n * @param component\n */\n async extractDepsFromLegacy(component: Component, policy?: VariantPolicy): Promise<DependencyList> {\n const componentPolicy = policy || (await this.getPolicy(component));\n const legacyComponent: LegacyComponent = component.state._consumer;\n const listFactory = this.getDependencyListFactory();\n const dependencyList = await listFactory.fromLegacyComponent(legacyComponent);\n\n dependencyList.forEach((dep) => {\n let found = componentPolicy.find(dep.id);\n if (!found) {\n const packageName = dep?.getPackageName?.();\n found = packageName ? componentPolicy.find(packageName) : undefined;\n }\n // if no policy found, the dependency was auto-resolved from the source code\n dep.source = found?.source || 'auto';\n dep.hidden = found?.hidden;\n dep.optional = found?.optional;\n });\n return dependencyList;\n }\n\n private getDependencyListFactory(): DependencyListFactory {\n const factories = this.dependencyFactorySlot.values().flat();\n const factoriesMap = factories.reduce((acc, factory) => {\n acc[factory.type] = factory;\n return acc;\n }, {});\n const listFactory = new DependencyListFactory(factoriesMap);\n return listFactory;\n }\n\n /**\n * Main function to get the dependency list of a given component\n * @param component\n */\n getDependencies(component: IComponent, { includeHidden = false }: GetDependenciesOptions = {}): DependencyList {\n const entry = component.get(DependencyResolverAspect.id);\n if (!entry) {\n return DependencyList.fromArray([]);\n }\n const serializedDependencies: SerializedDependency[] = entry?.data?.dependencies || [];\n const depList = this.getDependenciesFromSerializedDependencies(serializedDependencies);\n if (includeHidden) return depList;\n return depList.filterHidden();\n }\n\n getDependenciesFromLegacyComponent(\n component: LegacyComponent,\n { includeHidden = false }: GetDependenciesOptions = {}\n ) {\n const entry = component.extensions.findCoreExtension(DependencyResolverAspect.id);\n if (!entry) {\n return DependencyList.fromArray([]);\n }\n const serializedDependencies: SerializedDependency[] = entry?.data?.dependencies || [];\n const depList = this.getDependenciesFromSerializedDependencies(serializedDependencies);\n if (includeHidden) return depList;\n return depList.filterHidden();\n }\n\n /**\n * returns only the dependencies that are bit-components.\n */\n getComponentDependencies(component: IComponent): ComponentDependency[] {\n const dependencyList = this.getDependencies(component);\n return dependencyList.getComponentDependencies();\n }\n\n getDependenciesFromSerializedDependencies(dependencies: SerializedDependency[]): DependencyList {\n if (!dependencies.length) {\n return DependencyList.fromArray([]);\n }\n const listFactory = this.getDependencyListFactory();\n const deps = listFactory.fromSerializedDependencies(dependencies);\n return deps;\n }\n\n /**\n * Getting the merged workspace policy (from dep resolver config and others like root package.json)\n */\n getWorkspacePolicy(): WorkspacePolicy {\n if (!this._workspacePolicy) {\n const policyFromConfig = this.getWorkspacePolicyFromConfig();\n const externalPolicies = this.rootPolicyRegistry.toArray().map(([, policy]) => policy);\n this._workspacePolicy = this.mergeWorkspacePolices([policyFromConfig, ...externalPolicies]);\n }\n return this._workspacePolicy;\n }\n\n getWorkspacePolicyManifest() {\n const workspacePolicy = this.getWorkspacePolicy();\n return workspacePolicy.toManifest();\n }\n\n clearCache() {\n this._workspacePolicy = undefined;\n }\n\n /**\n * Getting the workspace policy as defined in the workspace.jsonc in the dependencyResolver aspect\n * This will not take into account packages that defined in the package.json of the root for example\n * in most cases you should use getWorkspacePolicy\n * @returns\n */\n getWorkspacePolicyFromConfig(): WorkspacePolicy {\n const factory = new WorkspacePolicyFactory();\n return factory.fromConfigObject(this.config.policy);\n }\n\n getWorkspacePolicyFromConfigObject(obj: WorkspacePolicyConfigObject): WorkspacePolicy {\n const factory = new WorkspacePolicyFactory();\n return factory.fromConfigObject(obj);\n }\n\n getWorkspacePolicyFromPackageJson(packageJson: Record<string, any>): WorkspacePolicy {\n const factory = new WorkspacePolicyFactory();\n return factory.fromPackageJson(packageJson);\n }\n\n mergeWorkspacePolices(polices: WorkspacePolicy[]): WorkspacePolicy {\n return WorkspacePolicy.mergePolices(polices);\n }\n\n /**\n * Create a workspace manifest\n * The term workspace here is not the same as \"bit workspace\" but a workspace that represent a shared root\n * for installation of many components (sometime it might point to the workspace path)\n * in other case it can be for example the capsules root dir\n *\n * @param {string} [name=ROOT_NAME]\n * @param {SemVer} [version=new SemVer('1.0.0')]\n * @param {ManifestDependenciesObject} dependencies\n * @param {string} rootDir\n * @param {Component[]} components\n * @param {CreateFromComponentsOptions} [options={\n * filterComponentsFromManifests: true,\n * createManifestForComponentsWithoutDependencies: true,\n * }]\n * @returns {WorkspaceManifest}\n * @memberof DependencyResolverMain\n */\n async getWorkspaceManifest(\n name: string = ROOT_NAME,\n version: SemVer = new SemVer('1.0.0'),\n rootPolicy: WorkspacePolicy,\n rootDir: string,\n components: Component[],\n options: CreateFromComponentsOptions = defaultCreateFromComponentsOptions,\n context: DepInstallerContext = {}\n ): Promise<WorkspaceManifest> {\n const statusMessage = context?.inCapsule\n ? `(capsule) deduping dependencies for installation in root dir ${rootDir}`\n : 'deduping dependencies for installation';\n if (!context?.inCapsule) {\n this.logger.setStatusLine(statusMessage);\n }\n const concreteOpts = {\n ...defaultCreateFromComponentsOptions,\n ...options,\n };\n const workspaceManifestFactory = new WorkspaceManifestFactory(this, this.aspectLoader);\n const res = await workspaceManifestFactory.createFromComponents(\n name,\n version,\n rootPolicy,\n rootDir,\n components,\n concreteOpts\n );\n if (!context?.inCapsule) {\n this.logger.consoleSuccess();\n }\n return res;\n }\n\n /**\n * get the package name of a component.\n */\n getPackageName(component: Component): string {\n return this.getDepResolverData(component)?.packageName ?? this.calcPackageName(component);\n }\n\n createComponentIdByPkgNameMap(components: Component[]): Map<string, ComponentID> {\n const componentIdByPkgName = new Map<string, ComponentID>();\n for (const component of components) {\n componentIdByPkgName.set(this.getPackageName(component), component.id);\n }\n return componentIdByPkgName;\n }\n\n getDepResolverData(component: Component): DependencyResolverComponentData | undefined {\n return component.state.aspects.get(DependencyResolverAspect.id)?.data as DependencyResolverComponentData;\n }\n\n calcPackageName(component: Component): string {\n return componentIdToPackageName(component.state._consumer);\n }\n\n /*\n * Returns the location where the component is installed with its peer dependencies\n * This is used in cases you want to actually run the components and make sure all the dependencies (especially peers) are resolved correctly\n */\n getRuntimeModulePath(\n component: Component,\n options: {\n workspacePath: string;\n rootComponentsPath: string;\n isInWorkspace?: boolean;\n }\n ) {\n if (!this.hasRootComponents()) {\n const modulePath = this.getModulePath(component);\n return modulePath;\n }\n const pkgName = this.getPackageName(component);\n const rootComponentsRelativePath = relative(options.workspacePath, options.rootComponentsPath);\n const getRelativeRootComponentDir = getRootComponentDir.bind(null, rootComponentsRelativePath ?? '');\n const selfRootDir = getRelativeRootComponentDir(\n options.isInWorkspace ? component.id.toStringWithoutVersion() : component.id.toString()\n );\n // In case the component is it's own root we want to load it from it's own root folder\n if (fs.pathExistsSync(selfRootDir)) {\n const innerDir = join(selfRootDir, 'node_modules', pkgName);\n if (fs.pathExistsSync(innerDir)) return innerDir;\n // sometime for the env itself we don't have the env package in the env root dir, because it was hoisted\n // in that case we return the dir from the root node_modules\n return this.getModulePath(component);\n }\n const dirInEnvRoot = join(this.getComponentDirInBitRoots(component, options), 'node_modules', pkgName);\n if (fs.pathExistsSync(dirInEnvRoot)) return dirInEnvRoot;\n return this.getModulePath(component);\n }\n\n getComponentDirInBitRoots(\n component: Component,\n options: {\n workspacePath: string;\n rootComponentsPath: string;\n }\n ) {\n const envId = this.envs.getEnvId(component);\n const rootComponentsRelativePath = relative(options.workspacePath, options.rootComponentsPath);\n return getRootComponentDir(rootComponentsRelativePath ?? '', envId);\n }\n\n /**\n * returns the package path in the /node_modules/ folder\n * In case you call this in order to run the code from the path, please refer to the `getRuntimeModulePath` API\n */\n getModulePath(component: Component) {\n const pkgName = this.getPackageName(component);\n const relativePath = join('node_modules', pkgName);\n return relativePath;\n }\n\n async addDependenciesGraph(\n component: Component,\n componentRelativeDir: string,\n options: {\n rootDir: string;\n rootComponentsPath?: string;\n componentIdByPkgName: Map<string, ComponentID>;\n }\n ): Promise<void> {\n try {\n component.state._consumer.dependenciesGraph = await this.getPackageManager()?.calcDependenciesGraph?.({\n rootDir: options.rootDir,\n componentRootDir: options.rootComponentsPath\n ? this.getComponentDirInBitRoots(component, {\n workspacePath: options.rootDir,\n rootComponentsPath: options.rootComponentsPath,\n })\n : undefined,\n pkgName: this.getPackageName(component),\n componentRelativeDir,\n componentIdByPkgName: options.componentIdByPkgName,\n });\n } catch (err) {\n // If the dependencies graph feature is disabled, we ignore the error\n if (isFeatureEnabled(DEPS_GRAPH)) {\n throw err;\n }\n }\n }\n\n /**\n * get a component dependency installer.\n */\n getInstaller(options: GetInstallerOptions = {}) {\n const packageManagerName = options.packageManager || this.config.packageManager;\n const packageManager = this.packageManagerSlot.get(packageManagerName);\n const cacheRootDir = options.cacheRootDirectory || this.globalConfig.getSync(CFG_PACKAGE_MANAGER_CACHE);\n\n if (!packageManager) {\n throw new PackageManagerNotFound(this.config.packageManager);\n }\n\n if (cacheRootDir && !fs.pathExistsSync(cacheRootDir)) {\n this.logger.debug(`creating package manager cache dir at ${cacheRootDir}`);\n fs.ensureDirSync(cacheRootDir);\n }\n const preInstallSubscribers = this.getPreInstallSubscribers();\n const postInstallSubscribers = this.getPostInstallSubscribers();\n // TODO: we should somehow pass the cache root dir to the package manager constructor\n return new DependencyInstaller(\n packageManager,\n this.aspectLoader,\n this.logger,\n this,\n options.rootDir,\n cacheRootDir,\n preInstallSubscribers,\n postInstallSubscribers,\n options.nodeLinker || this.nodeLinker(packageManagerName),\n this.config.packageImportMethod,\n this.config.sideEffectsCache,\n this.config.nodeVersion,\n this.config.engineStrict,\n this.config.peerDependencyRules,\n this.config.neverBuiltDependencies,\n this.config.preferOffline,\n options.installingContext\n );\n }\n\n private getPreInstallSubscribers(): PreInstallSubscriberList {\n return this.preInstallSlot.values().flat();\n }\n\n private getPostInstallSubscribers(): PostInstallSubscriberList {\n return this.postInstallSlot.values().flat();\n }\n\n /**\n * get a component dependency linker.\n */\n getLinker(options: GetLinkerOptions = {}) {\n const linkingOptions = Object.assign({}, defaultLinkingOptions, options?.linkingOptions || {});\n // TODO: we should somehow pass the cache root dir to the package manager constructor\n return new DependencyLinker(\n this,\n this.aspectLoader,\n this.componentAspect,\n this.envs,\n this.logger,\n options.rootDir,\n linkingOptions,\n options.linkingContext\n );\n }\n\n /**\n * This function returns the package manager if it exists, otherwise it returns undefined.\n * @returns The `getPackageManager()` function returns a `PackageManager` object or `undefined`.\n */\n getPackageManager(): PackageManager | undefined {\n const packageManager = this.packageManagerSlot.get(this.config.packageManager);\n return packageManager;\n }\n\n getPackageManagerName() {\n return this.config.packageManager;\n }\n\n async getVersionResolver(options: GetVersionResolverOptions = {}) {\n const packageManager = this.getPackageManager();\n const cacheRootDir = options.cacheRootDirectory || this.globalConfig.getSync(CFG_PACKAGE_MANAGER_CACHE);\n\n if (!packageManager) {\n throw new PackageManagerNotFound(this.config.packageManager);\n }\n\n if (cacheRootDir && !fs.pathExistsSync(cacheRootDir)) {\n this.logger.debug(`creating package manager cache dir at ${cacheRootDir}`);\n fs.ensureDirSync(cacheRootDir);\n }\n const { networkConcurrency } = await this.getNetworkConfig();\n // TODO: we should somehow pass the cache root dir to the package manager constructor\n return new DependencyVersionResolver(packageManager, cacheRootDir, networkConcurrency);\n }\n\n /**\n * these ids should not be in the dependencyResolver policy normally.\n * one exception is bit itself, which needs teambit.harmony/harmony in the dependencies.\n *\n * returns component-ids string without a version.\n */\n getCompIdsThatShouldNotBeInPolicy(): string[] {\n return [...getAllCoreAspectsIds(), 'teambit.harmony/harmony'];\n }\n\n /**\n * return the system configured package manager. by default pnpm.\n */\n getSystemPackageManager(): PackageManager {\n const defaultPm = 'teambit.dependencies/pnpm';\n const packageManager = this.packageManagerSlot.get(defaultPm);\n if (!packageManager) throw new Error(`default package manager: ${defaultPm} was not found`);\n return packageManager;\n }\n\n async getProxyConfig(): Promise<ProxyConfig> {\n const proxyConfigFromDepResolverConfig = this.getProxyConfigFromDepResolverConfig();\n let httpProxy = proxyConfigFromDepResolverConfig.httpProxy;\n let httpsProxy = proxyConfigFromDepResolverConfig.httpsProxy;\n\n // Take config from the aspect config if defined\n if (httpProxy || httpsProxy) {\n this.logger.debug(\n `proxy config taken from the dep resolver config. proxy: ${httpProxy} httpsProxy: ${httpsProxy}`\n );\n return proxyConfigFromDepResolverConfig;\n }\n\n // Take config from the package manager (npmrc) config if defined\n const proxyConfigFromPackageManager = await this.getProxyConfigFromPackageManager();\n if (proxyConfigFromPackageManager?.httpProxy || proxyConfigFromPackageManager?.httpsProxy) {\n this.logger.debug(\n `proxy config taken from the package manager config (npmrc). proxy: ${proxyConfigFromPackageManager.httpProxy} httpsProxy: ${proxyConfigFromPackageManager.httpsProxy}`\n );\n return proxyConfigFromPackageManager;\n }\n\n // Take config from global bit config\n const proxyConfigFromGlobalConfig = await this.getProxyConfigFromGlobalConfig();\n httpProxy = proxyConfigFromGlobalConfig.httpProxy;\n httpsProxy = proxyConfigFromGlobalConfig.httpsProxy;\n if (httpProxy || httpsProxy) {\n this.logger.debug(`proxy config taken from the global bit config. proxy: ${httpProxy} httpsProxy: ${httpsProxy}`);\n return proxyConfigFromGlobalConfig;\n }\n return {};\n }\n\n private getProxyConfigFromDepResolverConfig(): ProxyConfig {\n return {\n httpProxy: this.config.proxy,\n httpsProxy: this.config.httpsProxy || this.config.proxy,\n noProxy: this.config.noProxy,\n };\n }\n\n async getNetworkConfig(): Promise<NetworkConfig> {\n const networkConfig = {\n ...(await this.getNetworkConfigFromGlobalConfig()),\n ...(await this.getNetworkConfigFromPackageManager()),\n ...this.getNetworkConfigFromDepResolverConfig(),\n };\n this.logger.debug(\n `the next network configuration is used in dependency-resolver: ${JSON.stringify(\n {\n ...networkConfig,\n key: networkConfig.key ? 'set' : 'not set', // this is sensitive information, we should not log it\n },\n null,\n 2\n )}`\n );\n return networkConfig;\n }\n\n private async getNetworkConfigFromGlobalConfig(): Promise<NetworkConfig> {\n const globalNetworkConfig = await Http.getNetworkConfig();\n if (!globalNetworkConfig.ca && globalNetworkConfig.cafile) {\n globalNetworkConfig.ca = readCAFileSync(globalNetworkConfig.cafile);\n }\n return globalNetworkConfig;\n }\n\n private getNetworkConfigFromDepResolverConfig(): NetworkConfig {\n const config: NetworkConfig = pick(this.config, [\n 'fetchTimeout',\n 'fetchRetries',\n 'fetchRetryFactor',\n 'fetchRetryMintimeout',\n 'fetchRetryMaxtimeout',\n 'maxSockets',\n 'networkConcurrency',\n 'key',\n 'cert',\n 'ca',\n 'cafile',\n ]);\n if (this.config.strictSsl != null) {\n config.strictSSL =\n typeof this.config.strictSsl === 'string'\n ? this.config.strictSsl.toLowerCase() === 'true'\n : this.config.strictSsl;\n }\n return config;\n }\n\n private async getNetworkConfigFromPackageManager(): Promise<NetworkConfig> {\n const packageManager = this.getPackageManager();\n let networkConfigFromPackageManager: NetworkConfig = {};\n if (typeof packageManager?.getNetworkConfig === 'function') {\n networkConfigFromPackageManager = await packageManager?.getNetworkConfig();\n } else {\n const systemPm = this.getSystemPackageManager();\n if (!systemPm.getNetworkConfig) throw new Error('system package manager must implement `getNetworkConfig()`');\n networkConfigFromPackageManager = await systemPm.getNetworkConfig();\n }\n return networkConfigFromPackageManager;\n }\n\n private async getProxyConfigFromPackageManager(): Promise<ProxyConfig> {\n const packageManager = this.getPackageManager();\n let proxyConfigFromPackageManager: ProxyConfig = {};\n if (packageManager?.getProxyConfig && typeof packageManager?.getProxyConfig === 'function') {\n proxyConfigFromPackageManager = await packageManager?.getProxyConfig();\n } else {\n const systemPm = this.getSystemPackageManager();\n if (!systemPm.getProxyConfig) throw new Error('system package manager must implement `getProxyConfig()`');\n proxyConfigFromPackageManager = await systemPm.getProxyConfig();\n }\n return proxyConfigFromPackageManager;\n }\n\n private getProxyConfigFromGlobalConfig(): Promise<ProxyConfig> {\n return Http.getProxyConfig();\n }\n\n /**\n * Return the peer dependencies and their ranges that may be installed\n * without causing unmet peer dependency issues in some of the dependencies.\n */\n async getMissingPeerDependencies(\n rootDir: string,\n rootPolicy: WorkspacePolicy,\n componentDirectoryMap: ComponentMap<string>,\n options: PackageManagerGetPeerDependencyIssuesOptions\n ): Promise<Record<string, string>> {\n this.logger.setStatusLine('finding missing peer dependencies');\n const packageManager = this.getPackageManager();\n let peerDependencyIssues!: PeerDependencyIssuesByProjects;\n const installer = this.getInstaller();\n const manifests = await installer.getComponentManifests({\n ...options,\n componentDirectoryMap,\n rootPolicy,\n rootDir,\n });\n if (packageManager?.getPeerDependencyIssues && typeof packageManager?.getPeerDependencyIssues === 'function') {\n peerDependencyIssues = await packageManager?.getPeerDependencyIssues(rootDir, manifests, options);\n } else {\n const systemPm = this.getSystemPackageManager();\n if (!systemPm.getPeerDependencyIssues)\n throw new Error('system package manager must implement `getPeerDependencyIssues()`');\n peerDependencyIssues = await systemPm?.getPeerDependencyIssues(rootDir, manifests, options);\n }\n this.logger.consoleSuccess();\n return peerDependencyIssues['.']?.intersections;\n }\n\n async getRegistries(): Promise<Registries> {\n const packageManager = this.getPackageManager();\n let registries;\n if (packageManager?.getRegistries && typeof packageManager?.getRegistries === 'function') {\n registries = await packageManager?.getRegistries();\n } else {\n const systemPm = this.getSystemPackageManager();\n if (!systemPm.getRegistries) throw new Error('system package manager must implement `getRegistries()`');\n registries = await systemPm.getRegistries();\n }\n\n const getDefaultBitRegistry = (): Registry => {\n const bitGlobalConfigRegistry = this.globalConfig.getSync(CFG_REGISTRY_URL_KEY);\n const bitRegistry = bitGlobalConfigRegistry || BIT_CLOUD_REGISTRY;\n\n const { bitOriginalAuthType, bitAuthHeaderValue, bitOriginalAuthValue } = this.getBitAuthConfig();\n\n const alwaysAuth = !!bitAuthHeaderValue;\n const bitDefaultRegistry = new Registry(\n bitRegistry,\n alwaysAuth,\n bitAuthHeaderValue,\n bitOriginalAuthType,\n bitOriginalAuthValue\n );\n return bitDefaultRegistry;\n };\n\n const bitDefaultRegistry = getDefaultBitRegistry();\n\n const installFromBitDevRegistry = this.config.installFromBitDevRegistry ?? true;\n\n // Override default registry to use bit registry in case npmjs is the default - bit registry will proxy it\n // We check also NPM_REGISTRY.startsWith because the uri might not have the trailing / we have in NPM_REGISTRY\n if (\n installFromBitDevRegistry &&\n (!registries.defaultRegistry.uri ||\n registries.defaultRegistry.uri === NPM_REGISTRY ||\n NPM_REGISTRY.startsWith(registries.defaultRegistry.uri))\n ) {\n // TODO: this will not handle cases where you have token for private npm registries stored on npmjs\n // it should be handled by somehow in such case (default is npmjs and there is token for default) by sending the token of npmjs to the registry\n // (for example by setting some special header in the request)\n // then in the registry server it should be use it when proxies\n registries = registries.setDefaultRegistry(bitDefaultRegistry);\n }\n\n registries = this.addAuthToScopedBitRegistries(registries);\n return registries;\n }\n\n /**\n * This will mutate any registry which point to BIT_DEV_REGISTRY to have the auth config from the @bit scoped registry or from the user.token in bit's config\n */\n private addAuthToScopedBitRegistries(registries: Registries): Registries {\n const { bitOriginalAuthType, bitAuthHeaderValue, bitOriginalAuthValue } = this.getBitAuthConfig();\n const alwaysAuth = bitAuthHeaderValue !== undefined;\n let updatedRegistries = registries;\n Object.entries(registries.scopes).map(([name, registry]) => {\n if (!registry.authHeaderValue && BIT_CLOUD_REGISTRY.includes(registry.uri)) {\n const registryWithAuth = new Registry(\n registry.uri,\n alwaysAuth,\n bitAuthHeaderValue,\n bitOriginalAuthType,\n bitOriginalAuthValue\n );\n updatedRegistries = updatedRegistries.updateScopedRegistry(name, registryWithAuth);\n }\n return updatedRegistries;\n });\n return updatedRegistries;\n }\n\n private getBitAuthConfig(): Partial<{\n bitOriginalAuthType: string;\n bitAuthHeaderValue: string;\n bitOriginalAuthValue: string;\n }> {\n const bitGlobalConfigToken = this.globalConfig.getSync(CFG_USER_TOKEN_KEY);\n const res = {\n bitOriginalAuthType: '',\n bitAuthHeaderValue: '',\n bitOriginalAuthValue: '',\n };\n\n // In case there is no auth configuration in the npmrc, but there is token in bit config, take it from the config\n if (bitGlobalConfigToken) {\n res.bitOriginalAuthType = 'authToken';\n res.bitAuthHeaderValue = `Bearer ${bitGlobalConfigToken}`;\n res.bitOriginalAuthValue = bitGlobalConfigToken;\n }\n\n return res;\n }\n\n get packageManagerName(): string {\n return this.config.packageManager;\n }\n\n addToRootPolicy(entries: WorkspacePolicyEntry[], options?: WorkspacePolicyAddEntryOptions): WorkspacePolicy {\n const workspacePolicy = this.getWorkspacePolicyFromConfig();\n entries.forEach((entry) => workspacePolicy.add(entry, options));\n this.updateConfigPolicy(workspacePolicy);\n return workspacePolicy;\n }\n\n removeFromRootPolicy(dependencyIds: string[]): boolean {\n const workspacePolicy = this.getWorkspacePolicyFromConfig();\n const workspacePolicyUpdated = workspacePolicy.remove(dependencyIds);\n const isRemoved = workspacePolicyUpdated.entries.length !== workspacePolicy.entries.length;\n if (isRemoved) this.updateConfigPolicy(workspacePolicyUpdated);\n return isRemoved;\n }\n\n private updateConfigPolicy(workspacePolicy: WorkspacePolicy) {\n const workspacePolicyObject = workspacePolicy.toConfigObject();\n this.config.policy = workspacePolicyObject;\n this.configAspect.setExtension(DependencyResolverAspect.id, this.config, {\n overrideExisting: true,\n ignoreVersion: true,\n });\n }\n\n async persistConfig(reasonForChange?: string) {\n await this.configAspect.workspaceConfig?.write({ reasonForChange });\n this.clearCache();\n }\n\n /**\n * register new dependencies policies\n */\n registerDependenciesPolicies(policy: VariantPolicyConfigObject): void {\n return this.policiesRegistry.register(policy);\n }\n\n /**\n * register new dependencies policies\n */\n registerRootPolicy(policy: WorkspacePolicy): void {\n return this.rootPolicyRegistry.register(policy);\n }\n\n // async getComponentEnvPolicyFromExtension(configuredExtensions: ExtensionDataList): Promise<EnvPolicy> {\n // const env = this.envs.calculateEnvFromExtensions(configuredExtensions);\n // const fromFile = await this.getEnvPolicyFromFile(env.id);\n // if (fromFile) return fromFile;\n // return this.getComponentEnvPolicyFromEnv(env.env);\n // }\n\n async getComponentEnvPolicyFromExtension(configuredExtensions: ExtensionDataList): Promise<EnvPolicy> {\n const envId = await this.envs.calculateEnvIdFromExtensions(configuredExtensions);\n if (this.envs.isCoreEnv(envId)) {\n const env = await this.envs.calculateEnvFromExtensions(configuredExtensions);\n return this.getComponentEnvPolicyFromEnv(env.env, { envId });\n }\n\n const fromFile = await this.getEnvPolicyFromFile(envId);\n if (fromFile) return fromFile;\n const env = await this.envs.calculateEnvFromExtensions(configuredExtensions);\n return this.getComponentEnvPolicyFromEnv(env.env, { envId });\n }\n\n async getEnvPolicyFromEnvId(id: ComponentID, legacyFiles?: SourceFile[]): Promise<EnvPolicy | undefined> {\n const fromFile = await this.getEnvPolicyFromFile(id.toString(), legacyFiles);\n if (fromFile) return fromFile;\n const envDef = this.envs.getEnvDefinitionById(id);\n if (!envDef) return undefined;\n const env = envDef.env;\n return this.getComponentEnvPolicyFromEnv(env, {\n envId: id.toStringWithoutVersion(),\n });\n }\n\n /**\n * @deprecated use getEnvPolicyFromEnvId instead (it's the same)\n */\n async getEnvPolicyFromEnvLegacyId(id: ComponentID, legacyFiles?: SourceFile[]): Promise<EnvPolicy | undefined> {\n return this.getEnvPolicyFromEnvId(id, legacyFiles);\n }\n\n async getComponentEnvPolicy(component: Component): Promise<EnvPolicy> {\n // const envComponent = await this.envs.getEnvComponent(component);\n const envId = await this.envs.calculateEnvId(component);\n const envIdWithoutVersion = envId.toStringWithoutVersion();\n if (this.envs.isCoreEnv(envIdWithoutVersion)) {\n const env = this.envs.getEnv(component).env;\n return this.getComponentEnvPolicyFromEnv(env, { envId: envIdWithoutVersion });\n }\n const fromFile = await this.getEnvPolicyFromFile(envId.toString());\n if (fromFile) return fromFile;\n this.envsWithoutManifest.add(envId.toString());\n const env = this.envs.getEnv(component).env;\n return this.getComponentEnvPolicyFromEnv(env, { envId: envIdWithoutVersion });\n }\n\n getEnvManifest(envComponent?: Component, legacyFiles?: SourceFile[]): EnvPolicy | undefined {\n const object = this.envs.getEnvManifest(envComponent, legacyFiles) as any;\n const policy = object?.policy;\n if (!policy) return undefined;\n const allPoliciesFromEnv = EnvPolicy.fromConfigObject(policy, {\n includeLegacyPeersInSelfPolicy: envComponent && this.envs.isCoreEnv(envComponent.id.toStringWithoutVersion()),\n });\n return allPoliciesFromEnv;\n }\n\n /**\n * Merge policy from parent and child env.jsonc files\n * The rule is that for each type of dependency (dev, runtime, peer) we check each item.\n * if a dep with a name exists on the child we will take the entire object from the child (including the version,\n * supported range, force etc')\n * if a dep exists with a version value \"-\" we will remove it from the policy\n */\n mergeEnvManifestPolicy(parent: EnvJsonc, child: EnvJsonc): object {\n const policy = {};\n ['peers', 'dev', 'runtime'].forEach((key) => {\n policy[key] = cloneDeep(parent.policy?.[key] || []);\n const childEntries = cloneDeep(child.policy?.[key] || []);\n\n policy[key] = policy[key].filter((entry) => {\n const foundChildEntry = childEntries.find((childEntry) => {\n return childEntry.name === entry.name;\n });\n return !foundChildEntry;\n });\n policy[key] = policy[key].concat(childEntries);\n policy[key] = policy[key].filter((entry) => {\n return entry.version !== '-';\n });\n });\n return { policy };\n }\n\n private async getEnvPolicyFromFile(envId: string, legacyFiles?: SourceFile[]): Promise<EnvPolicy | undefined> {\n const isCoreEnv = this.envs.isCoreEnv(envId);\n if (isCoreEnv) return undefined;\n if (legacyFiles) {\n return this.getEnvManifest(undefined, legacyFiles);\n }\n const envComponent = await this.envs.getEnvComponentByEnvId(envId, envId);\n return this.getEnvManifest(envComponent);\n }\n\n async getComponentEnvPolicyFromEnv(env: DependenciesEnv, options: { envId: string }): Promise<EnvPolicy> {\n if (env.getDependencies && typeof env.getDependencies === 'function') {\n const policiesFromEnvConfig = await env.getDependencies();\n if (policiesFromEnvConfig) {\n const idWithoutVersion = options.envId.split('@')[0];\n const allPoliciesFromEnv = EnvPolicy.fromConfigObject(policiesFromEnvConfig, {\n includeLegacyPeersInSelfPolicy: this.envs.isCoreEnv(idWithoutVersion),\n });\n return allPoliciesFromEnv;\n }\n }\n return EnvPolicy.getEmpty();\n }\n\n async getComponentEnvPolicyFromEnvDefinition(envDef: EnvDefinition): Promise<EnvPolicy> {\n const fromFile = await this.getEnvPolicyFromFile(envDef.id);\n if (fromFile) return fromFile;\n return this.getComponentEnvPolicyFromEnv(envDef.env, { envId: envDef.id });\n }\n\n /**\n *\n * dependencies that will bundled as part of the env template and will configured as externals for the component bundle\n * these dependencies will be available in the preview on the window.\n * these dependencies will have only one instance on the page.\n * for dev server these dependencies will be aliased.\n * TODO: this should probably moved to the preview aspect. the main issue is that is used for dev server which can't bring the preview aspect.\n * @param env\n */\n async getPreviewHostDependenciesFromEnv(env: DependenciesEnv): Promise<string[]> {\n let hostDeps: string[] = [];\n if (env.getAdditionalHostDependencies && typeof env.getAdditionalHostDependencies === 'function') {\n hostDeps = await env.getAdditionalHostDependencies();\n }\n return uniq(hostDeps);\n }\n\n /**\n * Merge the dependencies provided by:\n * 1. envs configured in the component - via dependencies method\n * 2. extensions that registered to the registerDependencyPolicy slot (and configured for the component)\n * 3. props defined by the user (they are the strongest one)\n * @param configuredExtensions\n */\n async mergeVariantPolicies(\n configuredExtensions: ExtensionDataList,\n id: ComponentID,\n legacyFiles?: SourceFile[]\n ): Promise<VariantPolicy> {\n let policiesFromSlots: VariantPolicy = VariantPolicy.getEmpty();\n let policiesFromConfig: VariantPolicy = VariantPolicy.getEmpty();\n const policiesFromEnv: VariantPolicy = await this.getComponentEnvPolicyFromExtension(configuredExtensions);\n const configuredIds = configuredExtensions.ids;\n const policiesTuples = this.policiesRegistry.toArray();\n configuredIds.forEach((extId) => {\n // TODO: change this way of search, once we have workspace as dep-resolver dependency\n // we can use something like:\n // const resolvedId = this.workspace.resolveComponentId(extId)\n // const currentPolicy = this.policiesRegistry.get(resolvedId.toString());\n // Only get props from configured extensions on this specific component\n const policyTupleToApply = policiesTuples.find(([policyRegistrar]) => {\n return policyRegistrar === extId || policyRegistrar.includes(extId);\n });\n\n if (policyTupleToApply && policyTupleToApply[1]) {\n const currentPolicy = VariantPolicy.fromConfigObject(policyTupleToApply[1], { source: 'slots' });\n policiesFromSlots = VariantPolicy.mergePolices([policiesFromSlots, currentPolicy]);\n }\n });\n const currentExtension = configuredExtensions.findExtension(DependencyResolverAspect.id);\n const currentConfig = currentExtension?.config as unknown as DependencyResolverVariantConfig;\n if (currentConfig && currentConfig.policy) {\n policiesFromConfig = VariantPolicy.fromConfigObject(currentConfig.policy, { source: 'config' });\n }\n const policiesFromEnvForItself =\n (await this.getPoliciesFromEnvForItself(id, legacyFiles)) ?? VariantPolicy.getEmpty();\n\n const result = VariantPolicy.mergePolices([\n policiesFromEnv,\n policiesFromEnvForItself,\n policiesFromSlots,\n policiesFromConfig,\n ]);\n return result;\n }\n\n /**\n * These are the policies that the env itself defines for itself.\n * So policies installed only locally for the env, not to any components that use the env.\n */\n async getPoliciesFromEnvForItself(id: ComponentID, legacyFiles?: SourceFile[]): Promise<VariantPolicy | undefined> {\n const envPolicy = await this.getEnvPolicyFromEnvId(id, legacyFiles);\n return envPolicy?.selfPolicy;\n }\n\n updateDepsOnLegacyTag(component: LegacyComponent, idTransformer: onTagIdTransformer): LegacyComponent {\n const entry = component.extensions.findCoreExtension(DependencyResolverAspect.id);\n if (!entry) {\n return component;\n }\n const dependencies = get(entry, ['data', 'dependencies'], []);\n dependencies.forEach((dep) => {\n if (dep.__type === COMPONENT_DEP_TYPE) {\n // @todo: it's unclear why \"dep.componentId\" randomly becomes a ComponentID instance.\n // this check is added because on Ripple in some scenarios it was throwing:\n // \"ComponentID.fromObject expect to get an object, got an instance of ComponentID\" (locally it didn't happen)\n const depId =\n dep.componentId instanceof ComponentID ? dep.componentId : ComponentID.fromObject(dep.componentId);\n const newDepId = idTransformer(depId);\n dep.componentId = (newDepId || depId).serialize();\n dep.id = (newDepId || depId).toString();\n dep.version = (newDepId || depId).version;\n }\n });\n return component;\n }\n\n /**\n * Register a new dependency detector. Detectors allow to extend Bit's dependency detection\n * mechanism to support new file extensions and types.\n */\n registerDetector(detector: DependencyDetector) {\n DetectorHook.hooks.push(detector);\n return this;\n }\n\n /**\n * This function called on component load in order to calculate the custom\n * dependency detectors from an env, which is got by extension data list.\n * Do not use this function for other purposes.\n */\n async calcComponentEnvDepDetectors(extensions: ExtensionDataList) {\n const envDef = await this.envs.calculateEnvFromExtensions(extensions);\n const depEnv = envDef.env as DependenciesEnv;\n if (typeof depEnv?.getDepDetectors === 'function') {\n return depEnv.getDepDetectors();\n }\n return null;\n }\n\n /**\n * This function registered to the onLoadRequireableExtensionSlot of the aspect-loader\n * Update the aspect / manifest deps versions in the runtimes (recursively)\n * This function mutate the manifest directly as otherwise it becomes very complicated\n * TODO: think if this funciton should be here as it about dependencies, or on the aspect loader\n * (as it's aware of the internal structure of aspects)\n * Maybe only register the dep resolution part to the aspect loader\n * at the moment it here for simplify the process\n * @param requireableExtension\n * @param manifest\n * @returns\n */\n async onLoadRequireableExtensionSubscriber(\n requireableExtension: RequireableComponent,\n manifest: ExtensionManifest | Aspect\n ): Promise<ExtensionManifest | Aspect> {\n const parentComponent = requireableExtension.component;\n return this.resolveRequireableExtensionManifestDepsVersionsRecursively(parentComponent, manifest);\n }\n\n /**\n * Update the aspect / manifest deps versions in the runtimes (recursively)\n * @param parentComponent\n * @param manifest\n */\n private async resolveRequireableExtensionManifestDepsVersionsRecursively(\n // Allow getting here string for lazy load the component\n // we only want to load the component in case there are deps to resolve\n parentComponent: Component | string,\n manifest: ExtensionManifest | Aspect\n // TODO: add visited = new Map() for performence improve\n ): Promise<ExtensionManifest | Aspect> {\n // Not resolve it immediately for performance sake\n let resolvedParentComponent: Component | undefined;\n let resolvedParentDeps: DependencyList;\n const updateDirectDepsVersions = (deps: Array<ExtensionManifest | Aspect>): Promise<void[]> => {\n return mapSeries(deps, async (dep) => {\n // Nothing to update (this shouldn't happen ever)\n if (!dep.id) return;\n // In case of core aspect, do not update the version, as it's loaded to harmony without version\n if (this.aspectLoader.isCoreAspect(dep.id)) return;\n // Lazily get the parent component\n if (typeof parentComponent === 'string') {\n const parentComponentId = await this.componentAspect.getHost().resolveComponentId(parentComponent);\n resolvedParentComponent = await this.componentAspect.getHost().get(parentComponentId);\n } else {\n // it's of type component;\n resolvedParentComponent = parentComponent;\n }\n if (!resolvedParentComponent) {\n this.logger.error(\n `could not resolve the component ${parentComponent} during manifest deps resolution. it shouldn't happen`\n );\n return;\n }\n // Lazily get the dependencies\n resolvedParentDeps = resolvedParentDeps || (await this.getDependencies(resolvedParentComponent));\n const resolvedDep = resolvedParentDeps.findDependency(dep.id, { ignoreVersion: true });\n dep.id = resolvedDep?.id ?? dep.id;\n await this.resolveRequireableExtensionManifestDepsVersionsRecursively(dep.id, dep);\n });\n };\n if (manifest.dependencies) {\n manifest.dependencies = manifest.dependencies.map((dep) => this.aspectLoader.cloneManifest(dep));\n await updateDirectDepsVersions(manifest.dependencies);\n }\n // @ts-ignore\n if (manifest?._runtimes) {\n // @ts-ignore\n await mapSeries(manifest?._runtimes, async (runtime: RuntimeManifest) => {\n if (runtime.dependencies) {\n runtime.dependencies = runtime.dependencies.map((dep) => this.aspectLoader.cloneManifest(dep));\n await updateDirectDepsVersions(runtime.dependencies);\n }\n });\n }\n\n return manifest;\n }\n\n /**\n * Return a list of outdated policy dependencies.\n */\n async getOutdatedPkgsFromPolicies({\n rootDir,\n variantPoliciesByPatterns,\n componentPolicies,\n components,\n patterns,\n forceVersionBump,\n }: {\n rootDir: string;\n variantPoliciesByPatterns: Record<string, VariantPolicyConfigObject>;\n componentPolicies: Array<{ componentId: ComponentID; policy: any }>;\n components: Component[];\n patterns?: string[];\n forceVersionBump?: 'major' | 'minor' | 'patch' | 'compatible';\n }): Promise<MergedOutdatedPkg[] | null> {\n const localComponentPkgNames = new Set(components.map((component) => this.getPackageName(component)));\n const componentModelVersions: ComponentModelVersion[] = (\n await Promise.all(\n components.map(async (component) => {\n const depList = await this.getDependencies(component);\n return depList\n .filter(\n (dep) =>\n typeof dep.getPackageName === 'function' &&\n // If the dependency is referenced not via a valid range it means that it wasn't yet published to the registry\n semver.validRange(dep.version) != null &&\n !dep['isExtension'] && // eslint-disable-line\n dep.lifecycle !== 'peer' &&\n !localComponentPkgNames.has(dep.getPackageName())\n )\n .map((dep) => ({\n name: dep.getPackageName!(), // eslint-disable-line\n version: dep.version,\n isAuto: dep.source === 'auto',\n componentId: component.id,\n lifecycleType: dep.lifecycle,\n }));\n })\n )\n ).flat();\n let allPkgs = getAllPolicyPkgs({\n rootPolicy: this.getWorkspacePolicyFromConfig(),\n variantPoliciesByPatterns,\n componentPolicies,\n componentModelVersions,\n });\n if (patterns?.length) {\n const selectedPkgNames = new Set(\n multimatch(\n allPkgs.map(({ name }) => name),\n patterns\n )\n );\n allPkgs = allPkgs.filter(({ name }) => selectedPkgNames.has(name));\n if (!allPkgs.length) {\n return null;\n }\n }\n const outdatedPkgs = await this.getOutdatedPkgs({ rootDir, forceVersionBump }, allPkgs);\n return mergeOutdatedPkgs(outdatedPkgs);\n }\n\n /**\n * Accepts a list of package dependency policies and returns a list of outdated policies extended with their \"latestRange\"\n */\n async getOutdatedPkgs<T>(\n {\n rootDir,\n forceVersionBump,\n }: {\n rootDir: string;\n forceVersionBump?: 'major' | 'minor' | 'patch' | 'compatible';\n },\n pkgs: Array<\n { name: string; currentRange: string; source: 'variants' | 'component' | 'rootPolicy' | 'component-model' } & T\n >\n ): Promise<Array<{ name: string; currentRange: string; latestRange: string } & T>> {\n this.logger.setStatusLine('checking the latest versions of dependencies');\n const resolver = await this.getVersionResolver();\n const tryResolve = async (spec: string) => {\n try {\n return (\n await resolver.resolveRemoteVersion(spec, {\n rootDir,\n })\n ).version;\n } catch {\n // If latest cannot be found for the package, then just ignore it\n return null;\n }\n };\n const outdatedPkgs = compact(\n await Promise.all(\n pkgs.map(async (pkg) => {\n const latestVersion = await tryResolve(\n `${pkg.name}@${newVersionRange(pkg.currentRange, { pkgSource: pkg.source, forceVersionBump })}`\n );\n if (!latestVersion) return null;\n const currentVersion = semver.valid(pkg.currentRange.replace(/[\\^~]/, ''));\n // If the current version is newer than the latest, then no need to update the dependency\n if (currentVersion && (semver.gt(currentVersion, latestVersion) || currentVersion === latestVersion))\n return null;\n return {\n ...pkg,\n latestRange:\n pkg.source === 'component-model' && this.config.savePrefix != null\n ? `${this.config.savePrefix}${latestVersion}`\n : repeatPrefix(pkg.currentRange, latestVersion),\n } as any;\n })\n )\n );\n this.logger.consoleSuccess();\n return outdatedPkgs;\n }\n\n /**\n * Update the specified packages to their latest versions in all policies;\n * root polcies, variant pocilicies, and component configuration policies (component.json).\n */\n applyUpdates(\n outdatedPkgs: Array<Omit<OutdatedPkg, 'currentRange'>>,\n options: {\n variantPoliciesByPatterns: Record<string, any>;\n }\n ): {\n updatedVariants: string[];\n updatedComponents: UpdatedComponent[];\n } {\n const { updatedVariants, updatedComponents, updatedWorkspacePolicyEntries } = applyUpdates(outdatedPkgs, {\n variantPoliciesByPatterns: options.variantPoliciesByPatterns,\n });\n this.addToRootPolicy(updatedWorkspacePolicyEntries, {\n updateExisting: true,\n });\n return {\n updatedVariants,\n updatedComponents,\n };\n }\n\n static runtime = MainRuntime;\n static dependencies = [\n EnvsAspect,\n LoggerAspect,\n ConfigAspect,\n AspectLoaderAspect,\n ComponentAspect,\n GraphqlAspect,\n GlobalConfigAspect,\n ];\n\n static slots = [\n Slot.withType<WorkspacePolicy>(),\n Slot.withType<VariantPolicyConfigObject>(),\n Slot.withType<PackageManager>(),\n Slot.withType<RegExp>(),\n Slot.withType<DependencyFactory>(),\n Slot.withType<PreInstallSubscriberList>(),\n Slot.withType<PostInstallSubscriberList>(),\n Slot.withType<DependencyDetector>(),\n ];\n\n static defaultConfig: DependencyResolverWorkspaceConfig &\n Required<Pick<DependencyResolverWorkspaceConfig, 'linkCoreAspects'>> = {\n /**\n * default package manager.\n */\n packageManager: 'teambit.dependencies/pnpm',\n policy: {},\n linkCoreAspects: true,\n };\n\n static async provider(\n [envs, loggerExt, configMain, aspectLoader, componentAspect, graphql, globalConfig]: [\n EnvsMain,\n LoggerMain,\n ConfigMain,\n AspectLoaderMain,\n ComponentMain,\n GraphqlMain,\n GlobalConfigMain,\n ],\n config: DependencyResolverWorkspaceConfig,\n [\n rootPolicyRegistry,\n policiesRegistry,\n packageManagerSlot,\n dependencyFactorySlot,\n preInstallSlot,\n postInstallSlot,\n ]: [\n RootPolicyRegistry,\n PoliciesRegistry,\n PackageManagerSlot,\n DependencyFactorySlot,\n PreInstallSlot,\n PostInstallSlot,\n ]\n ) {\n // const packageManager = new PackageManagerLegacy(config.packageManager, logger);\n const logger = loggerExt.createLogger(DependencyResolverAspect.id);\n const dependencyResolver = new DependencyResolverMain(\n config,\n rootPolicyRegistry,\n policiesRegistry,\n envs,\n logger,\n configMain,\n aspectLoader,\n globalConfig,\n componentAspect,\n packageManagerSlot,\n dependencyFactorySlot,\n preInstallSlot,\n postInstallSlot\n );\n\n componentAspect.registerShowFragments([\n new DependenciesFragment(dependencyResolver),\n new DevDependenciesFragment(dependencyResolver),\n new PeerDependenciesFragment(dependencyResolver),\n ]);\n // TODO: solve this generics issue and remove the ts-ignore\n // @ts-ignore\n dependencyResolver.registerDependencyFactories([new ComponentDependencyFactory(componentAspect)]);\n\n LegacyComponent.registerOnComponentOverridesLoading(\n DependencyResolverAspect.id,\n async (configuredExtensions: ExtensionDataList, id: ComponentID, legacyFiles: SourceFile[]) => {\n const policy = await dependencyResolver.mergeVariantPolicies(configuredExtensions, id, legacyFiles);\n return policy.toLegacyDepsOverrides();\n }\n );\n if (aspectLoader)\n aspectLoader.registerOnLoadRequireableExtensionSlot(\n dependencyResolver.onLoadRequireableExtensionSubscriber.bind(dependencyResolver)\n );\n\n graphql.register(dependencyResolverSchema(dependencyResolver));\n envs.registerService(new DependenciesService());\n envs.registerEnvJsoncMergeCustomizer(dependencyResolver.mergeEnvManifestPolicy.bind(dependencyResolver));\n\n // this is needed because during tag process, the data.dependencies can be loaded and the componentId can become\n // an instance of ComponentID class. it needs to be serialized before saved into objects.\n const serializeDepResolverDataBeforePersist = (extDataList: ExtensionDataList) => {\n const entry = extDataList.findCoreExtension(DependencyResolverAspect.id);\n if (!entry) return;\n const dependencies = get(entry, ['data', 'dependencies'], []);\n dependencies.forEach((dep) => {\n if (dep.__type === COMPONENT_DEP_TYPE) {\n dep.componentId = dep.componentId instanceof ComponentID ? dep.componentId.serialize() : dep.componentId;\n }\n });\n };\n ExtensionDataList.toModelObjectsHook.push(serializeDepResolverDataBeforePersist);\n PackageJsonTransformer.registerPackageJsonTransformer(async (component, packageJsonObject) => {\n const deps = dependencyResolver.getDependencies(component);\n const { optionalDependencies, peerDependenciesMeta } = deps.toDependenciesManifest();\n packageJsonObject.optionalDependencies = optionalDependencies;\n packageJsonObject.peerDependenciesMeta = peerDependenciesMeta;\n const entry = component.get(DependencyResolverAspect.id);\n if (entry?.config.peer) {\n if (!packageJsonObject.bit) {\n packageJsonObject.bit = {};\n }\n packageJsonObject.bit.peer = true;\n if (entry.config.defaultPeerRange) {\n packageJsonObject.bit.defaultPeerRange = entry.config.defaultPeerRange;\n }\n }\n return packageJsonObject;\n });\n\n return dependencyResolver;\n }\n\n getEmptyDepsObject(): ManifestDependenciesObject {\n return {\n dependencies: {},\n devDependencies: {},\n peerDependencies: {},\n };\n }\n\n /**\n * Returns a list of target locations where that given component was hard linked to.\n *\n * @param rootDir - The root directory of the workspace\n * @param componentDir - Relative path to the component's directory\n * @param packageName - The injected component's packageName\n */\n async getInjectedDirs(rootDir: string, componentDir: string, packageName: string): Promise<string[]> {\n const packageManager = this.getPackageManager();\n if (typeof packageManager?.getInjectedDirs === 'function') {\n return packageManager.getInjectedDirs(rootDir, componentDir, packageName);\n }\n return [];\n }\n\n getWorkspaceDepsOfBitRoots(manifests: ProjectManifest[]): Record<string, string> {\n const packageManager = this.getPackageManager();\n if (!packageManager) {\n throw new PackageManagerNotFound(this.config.packageManager);\n }\n return packageManager.getWorkspaceDepsOfBitRoots(manifests);\n }\n}\n\nDependencyResolverAspect.addRuntime(DependencyResolverMain);\n\nfunction repeatPrefix(originalSpec: string, newVersion: string): string {\n switch (originalSpec[0]) {\n case '~':\n case '^':\n return `${originalSpec[0]}${newVersion}`;\n default:\n return newVersion;\n }\n}\n\nfunction newVersionRange(\n currentRange: string,\n opts: { pkgSource: CurrentPkgSource; forceVersionBump?: 'major' | 'minor' | 'patch' | 'compatible' }\n) {\n if (opts.forceVersionBump == null || opts.forceVersionBump === 'major') return 'latest';\n const currentVersion = semver.valid(currentRange.replace(/[\\^~]/, ''));\n if (opts.forceVersionBump === 'compatible') {\n if ((opts.pkgSource === 'component' || opts.pkgSource === 'component-model') && currentVersion === currentRange) {\n return `^${currentVersion}`;\n }\n return currentRange;\n }\n if (!currentVersion) return null;\n const [major, minor] = currentVersion.split('.');\n switch (opts.forceVersionBump) {\n case 'patch':\n return `>=${currentVersion} <${major}.${+minor + 1}.0`;\n case 'minor':\n return `>=${currentVersion} <${+major + 1}.0.0`;\n default:\n return null;\n }\n}\n\nexport interface MergedOutdatedPkg extends OutdatedPkg {\n dependentComponents?: ComponentID[];\n hasDifferentRanges?: boolean;\n}\n\nfunction mergeOutdatedPkgs(outdatedPkgs: OutdatedPkg[]): MergedOutdatedPkg[] {\n const mergedOutdatedPkgs: Record<\n string,\n MergedOutdatedPkg & Required<Pick<MergedOutdatedPkg, 'dependentComponents'>>\n > = {};\n const outdatedPkgsNotFromComponentModel: OutdatedPkg[] = [];\n for (const outdatedPkg of outdatedPkgs) {\n if (outdatedPkg.source === 'component-model' && outdatedPkg.componentId) {\n if (!mergedOutdatedPkgs[outdatedPkg.name]) {\n mergedOutdatedPkgs[outdatedPkg.name] = {\n ...omit(outdatedPkg, ['componentId']),\n source: 'rootPolicy',\n dependentComponents: [outdatedPkg.componentId],\n };\n } else {\n if (mergedOutdatedPkgs[outdatedPkg.name].currentRange !== outdatedPkg.currentRange) {\n mergedOutdatedPkgs[outdatedPkg.name].hasDifferentRanges = true;\n }\n mergedOutdatedPkgs[outdatedPkg.name].currentRange = tryPickLowestRange(\n mergedOutdatedPkgs[outdatedPkg.name].currentRange,\n outdatedPkg.currentRange\n );\n mergedOutdatedPkgs[outdatedPkg.name].dependentComponents.push(outdatedPkg.componentId);\n if (outdatedPkg.targetField === 'dependencies') {\n mergedOutdatedPkgs[outdatedPkg.name].targetField = outdatedPkg.targetField;\n }\n }\n } else {\n outdatedPkgsNotFromComponentModel.push(outdatedPkg);\n }\n }\n return [...Object.values(mergedOutdatedPkgs), ...outdatedPkgsNotFromComponentModel];\n}\n\nfunction tryPickLowestRange(range1: string, range2: string) {\n if (range1 === '*' || range2 === '*') return '*';\n try {\n return semver.lt(rangeToVersion(range1), rangeToVersion(range2)) ? range1 : range2;\n } catch {\n return '*';\n }\n}\n\nfunction rangeToVersion(range: string) {\n if (range.startsWith('~') || range.startsWith('^')) {\n return range.substring(1);\n }\n return range;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IA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C1O,UAAU,CAAC,GAAG,CAAC,EAAE;IAClD,OAAO0O,KAAK,CAACC,SAAS,CAAC,CAAC,CAAC;EAC3B;EACA,OAAOD,KAAK;AACd","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.dependencies_dependency-resolver@1.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.dependencies_dependency-resolver@1.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.dependencies_dependency-resolver@1.0.486/dist/dependency-resolver.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.dependencies_dependency-resolver@1.0.486/dist/dependency-resolver.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/dependency-resolver",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.486",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/dependencies/dependency-resolver",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.dependencies",
|
|
8
8
|
"name": "dependency-resolver",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.486"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "2.4.2",
|
|
@@ -34,24 +34,25 @@
|
|
|
34
34
|
"@teambit/legacy-bit-id": "1.1.1",
|
|
35
35
|
"@teambit/component-version": "1.0.3",
|
|
36
36
|
"@teambit/toolbox.object.sorter": "0.0.2",
|
|
37
|
-
"@teambit/component": "1.0.
|
|
38
|
-
"@teambit/envs": "1.0.
|
|
39
|
-
"@teambit/dependencies": "1.0.
|
|
40
|
-
"@teambit/aspect-loader": "1.0.
|
|
41
|
-
"@teambit/logger": "0.0.
|
|
37
|
+
"@teambit/component": "1.0.486",
|
|
38
|
+
"@teambit/envs": "1.0.486",
|
|
39
|
+
"@teambit/dependencies": "1.0.486",
|
|
40
|
+
"@teambit/aspect-loader": "1.0.486",
|
|
41
|
+
"@teambit/logger": "0.0.1156",
|
|
42
42
|
"@teambit/toolbox.path.path": "0.0.4",
|
|
43
|
-
"@teambit/pkg.modules.component-package-name": "0.0.
|
|
44
|
-
"@teambit/graphql": "1.0.
|
|
45
|
-
"@teambit/bit": "1.9.
|
|
46
|
-
"@teambit/cli": "0.0.
|
|
47
|
-
"@teambit/component.sources": "0.0.
|
|
48
|
-
"@teambit/config": "0.0.
|
|
49
|
-
"@teambit/global-config": "0.0.
|
|
43
|
+
"@teambit/pkg.modules.component-package-name": "0.0.7",
|
|
44
|
+
"@teambit/graphql": "1.0.486",
|
|
45
|
+
"@teambit/bit": "1.9.4",
|
|
46
|
+
"@teambit/cli": "0.0.1063",
|
|
47
|
+
"@teambit/component.sources": "0.0.52",
|
|
48
|
+
"@teambit/config": "0.0.1237",
|
|
49
|
+
"@teambit/global-config": "0.0.1066",
|
|
50
50
|
"@teambit/harmony.modules.feature-toggle": "0.0.7",
|
|
51
51
|
"@teambit/harmony.modules.requireable-component": "0.0.498",
|
|
52
|
-
"@teambit/
|
|
53
|
-
"@teambit/
|
|
54
|
-
"@teambit/
|
|
52
|
+
"@teambit/legacy.extension-data": "0.0.2",
|
|
53
|
+
"@teambit/snapping": "1.0.486",
|
|
54
|
+
"@teambit/workspace.modules.node-modules-linker": "0.0.228",
|
|
55
|
+
"@teambit/isolator": "1.0.486",
|
|
55
56
|
"@teambit/toolbox.fs.link-or-symlink": "0.0.1",
|
|
56
57
|
"@teambit/component-issues": "0.0.151",
|
|
57
58
|
"@teambit/component-package-version": "0.0.434",
|