@teambit/dependency-resolver 1.0.515 → 1.0.516
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.
|
@@ -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.
|
|
3
|
+
<testsuite name="teambit.dependencies/dependency-resolver@1.0.516" timestamp="2025-01-16T03:55:09.539Z" 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.029"/>
|
|
5
|
+
<testcase classname="validate-env-policy.spec.js" name="should throw an exception if peer supportedRange is empty" time="0.052"/>
|
|
6
6
|
<testcase classname="validate-env-policy.spec.js" name="should throw an exception if peer supportedRange is null"/>
|
|
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.058"/>
|
|
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.15"/>
|
|
12
|
+
<testcase classname="get-all-policy-pkgs.spec.js" name="should read the version from a version object" time="0.152"/>
|
|
13
|
+
<testcase classname="get-all-policy-pkgs.spec.js" name="should deduplicate dependencies that are present in root policies" time="0.085"/>
|
|
14
|
+
<testcase classname="hoist-dependencies.spec.js" name="the root manifest should have the preserved version" time="0.102"/>
|
|
15
15
|
<testcase classname="hoist-dependencies.spec.js" name="the component dependencies which intersects with the preserved should be empty" time="0.001"/>
|
|
16
|
-
<testcase classname="hoist-dependencies.spec.js" name="the component dependencies which not intersects with the preserved to have a proper version"/>
|
|
17
|
-
<testcase classname="hoist-dependencies.spec.js" name="the component dependencies should be empty" 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
|
+
<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"/>
|
|
19
19
|
<testcase classname="hoist-dependencies.spec.js" name="the component dependencies should be empty"/>
|
|
20
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"/>
|
|
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.019"/>
|
|
24
24
|
<testcase classname="hoist-dependencies.spec.js" name="should not hoist the dependency to the root" time="0.001"/>
|
|
25
25
|
<testcase classname="hoist-dependencies.spec.js" name="should not report about peer conflicts"/>
|
|
26
|
-
<testcase classname="hoist-dependencies.spec.js" name="should have the peers in each component"/>
|
|
27
|
-
<testcase classname="hoist-dependencies.spec.js" name="should not hoist the dependency to the root"/>
|
|
26
|
+
<testcase classname="hoist-dependencies.spec.js" name="should have the peers in each component" time="0.001"/>
|
|
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.
|
|
30
|
-
<testcase classname="hoist-dependencies.spec.js" name="should not put the most common version in the components that has it"/>
|
|
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.
|
|
29
|
+
<testcase classname="hoist-dependencies.spec.js" name="should hoist the most common version to the root" time="0.037"/>
|
|
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.004"/>
|
|
33
|
+
<testcase classname="hoist-dependencies.spec.js" name="should not put the dependency in components that matches the best range" time="0.001"/>
|
|
34
34
|
<testcase classname="hoist-dependencies.spec.js" name="should put other ranges in the components" time="0.002"/>
|
|
35
35
|
<testcase classname="hoist-dependencies.spec.js" name="should hoist the best version to the root" time="0.001"/>
|
|
36
|
-
<testcase classname="hoist-dependencies.spec.js" name="should not put the dependency in components that matches the best version"
|
|
36
|
+
<testcase classname="hoist-dependencies.spec.js" name="should not put the dependency in components that matches the best version"/>
|
|
37
37
|
<testcase classname="hoist-dependencies.spec.js" name="should put other ranges in the components"/>
|
|
38
38
|
<testcase classname="hoist-dependencies.spec.js" name="should hoist the best range to the root" time="0.001"/>
|
|
39
39
|
<testcase classname="hoist-dependencies.spec.js" name="should not put the dependency in components that matches the best range" time="0.001"/>
|
|
40
|
-
<testcase classname="hoist-dependencies.spec.js" name="should put other ranges in the components" time="0.
|
|
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"
|
|
46
|
-
<testcase classname="dependency-resolver.main.runtime.spec.js" name="should return settings from aspect config"/>
|
|
47
|
-
<testcase classname="dependency-resolver.main.runtime.spec.js" name="should merge settings from global config, package manager config, and aspect config"/>
|
|
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.
|
|
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.046"/>
|
|
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.027"/>
|
|
43
|
+
<testcase classname="hoist-dependencies.spec.js" name="should put other ranges in the components" time="0.025"/>
|
|
44
|
+
<testcase classname="dependency-resolver.main.runtime.spec.js" name="should return settings from global config" time="0.006"/>
|
|
45
|
+
<testcase classname="dependency-resolver.main.runtime.spec.js" name="should return settings from package manager config"/>
|
|
46
|
+
<testcase classname="dependency-resolver.main.runtime.spec.js" name="should return settings from aspect config" time="0.001"/>
|
|
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.003"/>
|
|
49
|
+
<testcase classname="dependency-resolver.main.runtime.spec.js" name="should return outdated dependencies" time="0.083"/>
|
|
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
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.082"/>
|
|
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={392:(e,n,t)=>{var a={id:"teambit.dependencies/aspect-docs/dependency-resolver@0.0.181",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},171:(e,n,t)=>{Object.defineProperty(n,"Q",{enumerable:!0,get:function(){return a.default}});var a=o(t(392));function o(e){return e&&e.__esModule?e:{default:e}}o.__bit_component={id:"teambit.dependencies/aspect-docs/dependency-resolver@0.0.181",homepage:"https://bit.cloud/teambit/dependencies/aspect-docs/dependency-resolver",exported:!0}},158:(e,n,t)=>{var a={id:"teambit.dependencies/dependency-resolver@1.0.515",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(158),d=(t(594),t(16));const r=TeambitMdxUiMdxScopeContext;var l=t(171),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={392:(e,n,t)=>{var a={id:"teambit.dependencies/aspect-docs/dependency-resolver@0.0.181",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},171:(e,n,t)=>{Object.defineProperty(n,"Q",{enumerable:!0,get:function(){return a.default}});var a=o(t(392));function o(e){return e&&e.__esModule?e:{default:e}}o.__bit_component={id:"teambit.dependencies/aspect-docs/dependency-resolver@0.0.181",homepage:"https://bit.cloud/teambit/dependencies/aspect-docs/dependency-resolver",exported:!0}},845:(e,n,t)=>{var a={id:"teambit.dependencies/dependency-resolver@1.0.516",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(845),d=(t(594),t(16));const r=TeambitMdxUiMdxScopeContext;var l=t(171),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
|
@@ -2013,7 +2013,7 @@
|
|
|
2013
2013
|
"line": 10,
|
|
2014
2014
|
"character": 3
|
|
2015
2015
|
},
|
|
2016
|
-
"signature": "type PackageImportMethod = \"auto\" | \"copy\" | \"
|
|
2016
|
+
"signature": "type PackageImportMethod = \"auto\" | \"copy\" | \"clone\" | \"hardlink\"",
|
|
2017
2017
|
"name": "PackageImportMethod",
|
|
2018
2018
|
"exportNode": {
|
|
2019
2019
|
"__schema": "TypeSchema",
|
|
@@ -2022,7 +2022,7 @@
|
|
|
2022
2022
|
"line": 11,
|
|
2023
2023
|
"character": 1
|
|
2024
2024
|
},
|
|
2025
|
-
"signature": "type PackageImportMethod = \"auto\" | \"copy\" | \"
|
|
2025
|
+
"signature": "type PackageImportMethod = \"auto\" | \"copy\" | \"clone\" | \"hardlink\"",
|
|
2026
2026
|
"name": "PackageImportMethod",
|
|
2027
2027
|
"type": {
|
|
2028
2028
|
"__schema": "TypeUnionSchema",
|
|
@@ -3272,7 +3272,7 @@
|
|
|
3272
3272
|
"line": 39,
|
|
3273
3273
|
"character": 3
|
|
3274
3274
|
},
|
|
3275
|
-
"signature": "(property) nodeLinker?: \"
|
|
3275
|
+
"signature": "(property) nodeLinker?: \"hoisted\" | \"isolated\" | undefined",
|
|
3276
3276
|
"name": "nodeLinker",
|
|
3277
3277
|
"type": {
|
|
3278
3278
|
"__schema": "TypeUnionSchema",
|
|
@@ -5485,7 +5485,7 @@
|
|
|
5485
5485
|
"line": 18,
|
|
5486
5486
|
"character": 50
|
|
5487
5487
|
},
|
|
5488
|
-
"signature": "type NodeLinker = \"
|
|
5488
|
+
"signature": "type NodeLinker = \"hoisted\" | \"isolated\"",
|
|
5489
5489
|
"name": "NodeLinker",
|
|
5490
5490
|
"exportNode": {
|
|
5491
5491
|
"__schema": "TypeSchema",
|
|
@@ -5494,7 +5494,7 @@
|
|
|
5494
5494
|
"line": 5,
|
|
5495
5495
|
"character": 1
|
|
5496
5496
|
},
|
|
5497
|
-
"signature": "type NodeLinker = \"
|
|
5497
|
+
"signature": "type NodeLinker = \"hoisted\" | \"isolated\"",
|
|
5498
5498
|
"name": "NodeLinker",
|
|
5499
5499
|
"type": {
|
|
5500
5500
|
"__schema": "TypeUnionSchema",
|
|
@@ -8595,7 +8595,7 @@
|
|
|
8595
8595
|
"componentId": {
|
|
8596
8596
|
"scope": "teambit.scope",
|
|
8597
8597
|
"name": "network",
|
|
8598
|
-
"version": "0.0.
|
|
8598
|
+
"version": "0.0.21"
|
|
8599
8599
|
}
|
|
8600
8600
|
}
|
|
8601
8601
|
]
|
|
@@ -8634,7 +8634,7 @@
|
|
|
8634
8634
|
"componentId": {
|
|
8635
8635
|
"scope": "teambit.scope",
|
|
8636
8636
|
"name": "network",
|
|
8637
|
-
"version": "0.0.
|
|
8637
|
+
"version": "0.0.21"
|
|
8638
8638
|
}
|
|
8639
8639
|
}
|
|
8640
8640
|
]
|
|
@@ -9157,7 +9157,7 @@
|
|
|
9157
9157
|
"componentId": {
|
|
9158
9158
|
"scope": "teambit.legacy",
|
|
9159
9159
|
"name": "extension-data",
|
|
9160
|
-
"version": "0.0.
|
|
9160
|
+
"version": "0.0.23"
|
|
9161
9161
|
}
|
|
9162
9162
|
},
|
|
9163
9163
|
"isOptional": false,
|
|
@@ -9249,7 +9249,7 @@
|
|
|
9249
9249
|
"componentId": {
|
|
9250
9250
|
"scope": "teambit.component",
|
|
9251
9251
|
"name": "sources",
|
|
9252
|
-
"version": "0.0.
|
|
9252
|
+
"version": "0.0.73"
|
|
9253
9253
|
}
|
|
9254
9254
|
}
|
|
9255
9255
|
},
|
|
@@ -9411,7 +9411,7 @@
|
|
|
9411
9411
|
"componentId": {
|
|
9412
9412
|
"scope": "teambit.component",
|
|
9413
9413
|
"name": "sources",
|
|
9414
|
-
"version": "0.0.
|
|
9414
|
+
"version": "0.0.73"
|
|
9415
9415
|
}
|
|
9416
9416
|
}
|
|
9417
9417
|
},
|
|
@@ -9581,7 +9581,7 @@
|
|
|
9581
9581
|
"componentId": {
|
|
9582
9582
|
"scope": "teambit.component",
|
|
9583
9583
|
"name": "sources",
|
|
9584
|
-
"version": "0.0.
|
|
9584
|
+
"version": "0.0.73"
|
|
9585
9585
|
}
|
|
9586
9586
|
}
|
|
9587
9587
|
},
|
|
@@ -10040,7 +10040,7 @@
|
|
|
10040
10040
|
"componentId": {
|
|
10041
10041
|
"scope": "teambit.legacy",
|
|
10042
10042
|
"name": "extension-data",
|
|
10043
|
-
"version": "0.0.
|
|
10043
|
+
"version": "0.0.23"
|
|
10044
10044
|
}
|
|
10045
10045
|
},
|
|
10046
10046
|
"isOptional": false,
|
|
@@ -10097,7 +10097,7 @@
|
|
|
10097
10097
|
"componentId": {
|
|
10098
10098
|
"scope": "teambit.component",
|
|
10099
10099
|
"name": "sources",
|
|
10100
|
-
"version": "0.0.
|
|
10100
|
+
"version": "0.0.73"
|
|
10101
10101
|
}
|
|
10102
10102
|
}
|
|
10103
10103
|
},
|
|
@@ -10229,7 +10229,7 @@
|
|
|
10229
10229
|
"componentId": {
|
|
10230
10230
|
"scope": "teambit.component",
|
|
10231
10231
|
"name": "sources",
|
|
10232
|
-
"version": "0.0.
|
|
10232
|
+
"version": "0.0.73"
|
|
10233
10233
|
}
|
|
10234
10234
|
}
|
|
10235
10235
|
},
|
|
@@ -10467,7 +10467,7 @@
|
|
|
10467
10467
|
"componentId": {
|
|
10468
10468
|
"scope": "teambit.legacy",
|
|
10469
10469
|
"name": "extension-data",
|
|
10470
|
-
"version": "0.0.
|
|
10470
|
+
"version": "0.0.23"
|
|
10471
10471
|
}
|
|
10472
10472
|
},
|
|
10473
10473
|
"isOptional": false,
|
|
@@ -10907,7 +10907,7 @@
|
|
|
10907
10907
|
"line": 1375,
|
|
10908
10908
|
"character": 5
|
|
10909
10909
|
},
|
|
10910
|
-
"signature": "(property) forceVersionBump?: \"
|
|
10910
|
+
"signature": "(property) forceVersionBump?: \"major\" | \"minor\" | \"patch\" | \"compatible\" | undefined",
|
|
10911
10911
|
"name": "forceVersionBump",
|
|
10912
10912
|
"type": {
|
|
10913
10913
|
"__schema": "TypeUnionSchema",
|
|
@@ -11165,7 +11165,7 @@
|
|
|
11165
11165
|
"line": 1375,
|
|
11166
11166
|
"character": 5
|
|
11167
11167
|
},
|
|
11168
|
-
"signature": "(property) forceVersionBump?: \"
|
|
11168
|
+
"signature": "(property) forceVersionBump?: \"major\" | \"minor\" | \"patch\" | \"compatible\" | undefined",
|
|
11169
11169
|
"name": "forceVersionBump",
|
|
11170
11170
|
"type": {
|
|
11171
11171
|
"__schema": "TypeUnionSchema",
|
|
@@ -11334,7 +11334,7 @@
|
|
|
11334
11334
|
"line": 1433,
|
|
11335
11335
|
"character": 7
|
|
11336
11336
|
},
|
|
11337
|
-
"signature": "(property) forceVersionBump?: \"
|
|
11337
|
+
"signature": "(property) forceVersionBump?: \"major\" | \"minor\" | \"patch\" | \"compatible\" | undefined",
|
|
11338
11338
|
"name": "forceVersionBump",
|
|
11339
11339
|
"type": {
|
|
11340
11340
|
"__schema": "TypeUnionSchema",
|
|
@@ -11415,7 +11415,7 @@
|
|
|
11415
11415
|
"line": 1433,
|
|
11416
11416
|
"character": 7
|
|
11417
11417
|
},
|
|
11418
|
-
"signature": "(property) forceVersionBump?: \"
|
|
11418
|
+
"signature": "(property) forceVersionBump?: \"major\" | \"minor\" | \"patch\" | \"compatible\" | undefined",
|
|
11419
11419
|
"name": "forceVersionBump",
|
|
11420
11420
|
"type": {
|
|
11421
11421
|
"__schema": "TypeUnionSchema",
|
|
@@ -16274,7 +16274,7 @@
|
|
|
16274
16274
|
"line": 32,
|
|
16275
16275
|
"character": 3
|
|
16276
16276
|
},
|
|
16277
|
-
"signature": "type WorkspaceDependencyLifecycleType = \"
|
|
16277
|
+
"signature": "type WorkspaceDependencyLifecycleType = \"runtime\" | \"peer\"",
|
|
16278
16278
|
"name": "WorkspaceDependencyLifecycleType",
|
|
16279
16279
|
"exportNode": {
|
|
16280
16280
|
"__schema": "TypeSchema",
|
|
@@ -16283,7 +16283,7 @@
|
|
|
16283
16283
|
"line": 3,
|
|
16284
16284
|
"character": 1
|
|
16285
16285
|
},
|
|
16286
|
-
"signature": "type WorkspaceDependencyLifecycleType = \"
|
|
16286
|
+
"signature": "type WorkspaceDependencyLifecycleType = \"runtime\" | \"peer\"",
|
|
16287
16287
|
"name": "WorkspaceDependencyLifecycleType",
|
|
16288
16288
|
"type": {
|
|
16289
16289
|
"__schema": "TypeUnionSchema",
|
|
@@ -18895,7 +18895,7 @@
|
|
|
18895
18895
|
"componentId": {
|
|
18896
18896
|
"scope": "teambit.legacy",
|
|
18897
18897
|
"name": "consumer-config",
|
|
18898
|
-
"version": "0.0.
|
|
18898
|
+
"version": "0.0.21"
|
|
18899
18899
|
}
|
|
18900
18900
|
},
|
|
18901
18901
|
"modifiers": []
|
|
@@ -18921,7 +18921,7 @@
|
|
|
18921
18921
|
"componentId": {
|
|
18922
18922
|
"scope": "teambit.legacy",
|
|
18923
18923
|
"name": "consumer-config",
|
|
18924
|
-
"version": "0.0.
|
|
18924
|
+
"version": "0.0.21"
|
|
18925
18925
|
}
|
|
18926
18926
|
},
|
|
18927
18927
|
"modifiers": []
|
|
@@ -20301,7 +20301,7 @@
|
|
|
20301
20301
|
"_legacy": {
|
|
20302
20302
|
"scope": "teambit.legacy",
|
|
20303
20303
|
"name": "consumer-config",
|
|
20304
|
-
"version": "0.0.
|
|
20304
|
+
"version": "0.0.21"
|
|
20305
20305
|
}
|
|
20306
20306
|
}
|
|
20307
20307
|
},
|
|
@@ -20350,7 +20350,7 @@
|
|
|
20350
20350
|
"_legacy": {
|
|
20351
20351
|
"scope": "teambit.legacy",
|
|
20352
20352
|
"name": "consumer-config",
|
|
20353
|
-
"version": "0.0.
|
|
20353
|
+
"version": "0.0.21"
|
|
20354
20354
|
}
|
|
20355
20355
|
}
|
|
20356
20356
|
},
|
|
@@ -24724,7 +24724,7 @@
|
|
|
24724
24724
|
"line": 66,
|
|
24725
24725
|
"character": 15
|
|
24726
24726
|
},
|
|
24727
|
-
"signature": "type DependencySource = \"
|
|
24727
|
+
"signature": "type DependencySource = \"env\" | \"config\" | \"auto\" | \"env-own\" | \"slots\"",
|
|
24728
24728
|
"name": "DependencySource",
|
|
24729
24729
|
"exportNode": {
|
|
24730
24730
|
"__schema": "TypeSchema",
|
|
@@ -24733,7 +24733,7 @@
|
|
|
24733
24733
|
"line": 41,
|
|
24734
24734
|
"character": 1
|
|
24735
24735
|
},
|
|
24736
|
-
"signature": "type DependencySource = \"
|
|
24736
|
+
"signature": "type DependencySource = \"env\" | \"config\" | \"auto\" | \"env-own\" | \"slots\"",
|
|
24737
24737
|
"name": "DependencySource",
|
|
24738
24738
|
"type": {
|
|
24739
24739
|
"__schema": "TypeUnionSchema",
|
|
@@ -28965,7 +28965,7 @@
|
|
|
28965
28965
|
"line": 11,
|
|
28966
28966
|
"character": 1
|
|
28967
28967
|
},
|
|
28968
|
-
"signature": "type PackageImportMethod = \"auto\" | \"copy\" | \"
|
|
28968
|
+
"signature": "type PackageImportMethod = \"auto\" | \"copy\" | \"clone\" | \"hardlink\"",
|
|
28969
28969
|
"name": "PackageImportMethod",
|
|
28970
28970
|
"type": {
|
|
28971
28971
|
"__schema": "TypeUnionSchema",
|
|
@@ -29281,7 +29281,7 @@
|
|
|
29281
29281
|
"line": 39,
|
|
29282
29282
|
"character": 3
|
|
29283
29283
|
},
|
|
29284
|
-
"signature": "(property) nodeLinker?: \"
|
|
29284
|
+
"signature": "(property) nodeLinker?: \"hoisted\" | \"isolated\" | undefined",
|
|
29285
29285
|
"name": "nodeLinker",
|
|
29286
29286
|
"type": {
|
|
29287
29287
|
"__schema": "TypeUnionSchema",
|
|
@@ -31491,7 +31491,7 @@
|
|
|
31491
31491
|
"line": 5,
|
|
31492
31492
|
"character": 1
|
|
31493
31493
|
},
|
|
31494
|
-
"signature": "type NodeLinker = \"
|
|
31494
|
+
"signature": "type NodeLinker = \"hoisted\" | \"isolated\"",
|
|
31495
31495
|
"name": "NodeLinker",
|
|
31496
31496
|
"type": {
|
|
31497
31497
|
"__schema": "TypeUnionSchema",
|
|
@@ -32600,7 +32600,7 @@
|
|
|
32600
32600
|
"componentId": {
|
|
32601
32601
|
"scope": "teambit.scope",
|
|
32602
32602
|
"name": "network",
|
|
32603
|
-
"version": "0.0.
|
|
32603
|
+
"version": "0.0.21"
|
|
32604
32604
|
}
|
|
32605
32605
|
}
|
|
32606
32606
|
},
|
|
@@ -32624,7 +32624,7 @@
|
|
|
32624
32624
|
"componentId": {
|
|
32625
32625
|
"scope": "teambit.scope",
|
|
32626
32626
|
"name": "network",
|
|
32627
|
-
"version": "0.0.
|
|
32627
|
+
"version": "0.0.21"
|
|
32628
32628
|
}
|
|
32629
32629
|
}
|
|
32630
32630
|
},
|
|
@@ -32992,7 +32992,7 @@
|
|
|
32992
32992
|
"componentId": {
|
|
32993
32993
|
"scope": "teambit.legacy",
|
|
32994
32994
|
"name": "extension-data",
|
|
32995
|
-
"version": "0.0.
|
|
32995
|
+
"version": "0.0.23"
|
|
32996
32996
|
}
|
|
32997
32997
|
},
|
|
32998
32998
|
"isOptional": false,
|
|
@@ -36364,7 +36364,7 @@
|
|
|
36364
36364
|
"componentId": {
|
|
36365
36365
|
"scope": "teambit.scope",
|
|
36366
36366
|
"name": "network",
|
|
36367
|
-
"version": "0.0.
|
|
36367
|
+
"version": "0.0.21"
|
|
36368
36368
|
}
|
|
36369
36369
|
}
|
|
36370
36370
|
]
|
|
@@ -36403,7 +36403,7 @@
|
|
|
36403
36403
|
"componentId": {
|
|
36404
36404
|
"scope": "teambit.scope",
|
|
36405
36405
|
"name": "network",
|
|
36406
|
-
"version": "0.0.
|
|
36406
|
+
"version": "0.0.21"
|
|
36407
36407
|
}
|
|
36408
36408
|
}
|
|
36409
36409
|
]
|
|
@@ -36926,7 +36926,7 @@
|
|
|
36926
36926
|
"componentId": {
|
|
36927
36927
|
"scope": "teambit.legacy",
|
|
36928
36928
|
"name": "extension-data",
|
|
36929
|
-
"version": "0.0.
|
|
36929
|
+
"version": "0.0.23"
|
|
36930
36930
|
}
|
|
36931
36931
|
},
|
|
36932
36932
|
"isOptional": false,
|
|
@@ -37018,7 +37018,7 @@
|
|
|
37018
37018
|
"componentId": {
|
|
37019
37019
|
"scope": "teambit.component",
|
|
37020
37020
|
"name": "sources",
|
|
37021
|
-
"version": "0.0.
|
|
37021
|
+
"version": "0.0.73"
|
|
37022
37022
|
}
|
|
37023
37023
|
}
|
|
37024
37024
|
},
|
|
@@ -37180,7 +37180,7 @@
|
|
|
37180
37180
|
"componentId": {
|
|
37181
37181
|
"scope": "teambit.component",
|
|
37182
37182
|
"name": "sources",
|
|
37183
|
-
"version": "0.0.
|
|
37183
|
+
"version": "0.0.73"
|
|
37184
37184
|
}
|
|
37185
37185
|
}
|
|
37186
37186
|
},
|
|
@@ -37350,7 +37350,7 @@
|
|
|
37350
37350
|
"componentId": {
|
|
37351
37351
|
"scope": "teambit.component",
|
|
37352
37352
|
"name": "sources",
|
|
37353
|
-
"version": "0.0.
|
|
37353
|
+
"version": "0.0.73"
|
|
37354
37354
|
}
|
|
37355
37355
|
}
|
|
37356
37356
|
},
|
|
@@ -37809,7 +37809,7 @@
|
|
|
37809
37809
|
"componentId": {
|
|
37810
37810
|
"scope": "teambit.legacy",
|
|
37811
37811
|
"name": "extension-data",
|
|
37812
|
-
"version": "0.0.
|
|
37812
|
+
"version": "0.0.23"
|
|
37813
37813
|
}
|
|
37814
37814
|
},
|
|
37815
37815
|
"isOptional": false,
|
|
@@ -37866,7 +37866,7 @@
|
|
|
37866
37866
|
"componentId": {
|
|
37867
37867
|
"scope": "teambit.component",
|
|
37868
37868
|
"name": "sources",
|
|
37869
|
-
"version": "0.0.
|
|
37869
|
+
"version": "0.0.73"
|
|
37870
37870
|
}
|
|
37871
37871
|
}
|
|
37872
37872
|
},
|
|
@@ -37998,7 +37998,7 @@
|
|
|
37998
37998
|
"componentId": {
|
|
37999
37999
|
"scope": "teambit.component",
|
|
38000
38000
|
"name": "sources",
|
|
38001
|
-
"version": "0.0.
|
|
38001
|
+
"version": "0.0.73"
|
|
38002
38002
|
}
|
|
38003
38003
|
}
|
|
38004
38004
|
},
|
|
@@ -38236,7 +38236,7 @@
|
|
|
38236
38236
|
"componentId": {
|
|
38237
38237
|
"scope": "teambit.legacy",
|
|
38238
38238
|
"name": "extension-data",
|
|
38239
|
-
"version": "0.0.
|
|
38239
|
+
"version": "0.0.23"
|
|
38240
38240
|
}
|
|
38241
38241
|
},
|
|
38242
38242
|
"isOptional": false,
|
|
@@ -38676,7 +38676,7 @@
|
|
|
38676
38676
|
"line": 1375,
|
|
38677
38677
|
"character": 5
|
|
38678
38678
|
},
|
|
38679
|
-
"signature": "(property) forceVersionBump?: \"
|
|
38679
|
+
"signature": "(property) forceVersionBump?: \"major\" | \"minor\" | \"patch\" | \"compatible\" | undefined",
|
|
38680
38680
|
"name": "forceVersionBump",
|
|
38681
38681
|
"type": {
|
|
38682
38682
|
"__schema": "TypeUnionSchema",
|
|
@@ -38934,7 +38934,7 @@
|
|
|
38934
38934
|
"line": 1375,
|
|
38935
38935
|
"character": 5
|
|
38936
38936
|
},
|
|
38937
|
-
"signature": "(property) forceVersionBump?: \"
|
|
38937
|
+
"signature": "(property) forceVersionBump?: \"major\" | \"minor\" | \"patch\" | \"compatible\" | undefined",
|
|
38938
38938
|
"name": "forceVersionBump",
|
|
38939
38939
|
"type": {
|
|
38940
38940
|
"__schema": "TypeUnionSchema",
|
|
@@ -39103,7 +39103,7 @@
|
|
|
39103
39103
|
"line": 1433,
|
|
39104
39104
|
"character": 7
|
|
39105
39105
|
},
|
|
39106
|
-
"signature": "(property) forceVersionBump?: \"
|
|
39106
|
+
"signature": "(property) forceVersionBump?: \"major\" | \"minor\" | \"patch\" | \"compatible\" | undefined",
|
|
39107
39107
|
"name": "forceVersionBump",
|
|
39108
39108
|
"type": {
|
|
39109
39109
|
"__schema": "TypeUnionSchema",
|
|
@@ -39184,7 +39184,7 @@
|
|
|
39184
39184
|
"line": 1433,
|
|
39185
39185
|
"character": 7
|
|
39186
39186
|
},
|
|
39187
|
-
"signature": "(property) forceVersionBump?: \"
|
|
39187
|
+
"signature": "(property) forceVersionBump?: \"major\" | \"minor\" | \"patch\" | \"compatible\" | undefined",
|
|
39188
39188
|
"name": "forceVersionBump",
|
|
39189
39189
|
"type": {
|
|
39190
39190
|
"__schema": "TypeUnionSchema",
|
|
@@ -40671,7 +40671,7 @@
|
|
|
40671
40671
|
"line": 1694,
|
|
40672
40672
|
"character": 40
|
|
40673
40673
|
},
|
|
40674
|
-
"signature": "(property) forceVersionBump?: \"
|
|
40674
|
+
"signature": "(property) forceVersionBump?: \"major\" | \"minor\" | \"patch\" | \"compatible\" | undefined",
|
|
40675
40675
|
"name": "forceVersionBump",
|
|
40676
40676
|
"type": {
|
|
40677
40677
|
"__schema": "TypeUnionSchema",
|
|
@@ -43471,7 +43471,7 @@
|
|
|
43471
43471
|
"line": 3,
|
|
43472
43472
|
"character": 1
|
|
43473
43473
|
},
|
|
43474
|
-
"signature": "type WorkspaceDependencyLifecycleType = \"
|
|
43474
|
+
"signature": "type WorkspaceDependencyLifecycleType = \"runtime\" | \"peer\"",
|
|
43475
43475
|
"name": "WorkspaceDependencyLifecycleType",
|
|
43476
43476
|
"type": {
|
|
43477
43477
|
"__schema": "TypeUnionSchema",
|
|
@@ -48593,7 +48593,7 @@
|
|
|
48593
48593
|
"line": 41,
|
|
48594
48594
|
"character": 1
|
|
48595
48595
|
},
|
|
48596
|
-
"signature": "type DependencySource = \"
|
|
48596
|
+
"signature": "type DependencySource = \"env\" | \"config\" | \"auto\" | \"env-own\" | \"slots\"",
|
|
48597
48597
|
"name": "DependencySource",
|
|
48598
48598
|
"type": {
|
|
48599
48599
|
"__schema": "TypeUnionSchema",
|
|
@@ -49806,7 +49806,7 @@
|
|
|
49806
49806
|
"componentId": {
|
|
49807
49807
|
"scope": "teambit.legacy",
|
|
49808
49808
|
"name": "consumer-config",
|
|
49809
|
-
"version": "0.0.
|
|
49809
|
+
"version": "0.0.21"
|
|
49810
49810
|
}
|
|
49811
49811
|
},
|
|
49812
49812
|
"modifiers": []
|
|
@@ -49832,7 +49832,7 @@
|
|
|
49832
49832
|
"componentId": {
|
|
49833
49833
|
"scope": "teambit.legacy",
|
|
49834
49834
|
"name": "consumer-config",
|
|
49835
|
-
"version": "0.0.
|
|
49835
|
+
"version": "0.0.21"
|
|
49836
49836
|
}
|
|
49837
49837
|
},
|
|
49838
49838
|
"modifiers": []
|
|
@@ -50967,7 +50967,7 @@
|
|
|
50967
50967
|
"line": 31,
|
|
50968
50968
|
"character": 1
|
|
50969
50969
|
},
|
|
50970
|
-
"signature": "type EnvJsoncPolicyConfigKey = \"
|
|
50970
|
+
"signature": "type EnvJsoncPolicyConfigKey = \"peers\" | \"dev\" | \"runtime\"",
|
|
50971
50971
|
"name": "EnvJsoncPolicyConfigKey",
|
|
50972
50972
|
"type": {
|
|
50973
50973
|
"__schema": "TypeUnionSchema",
|
|
@@ -52290,7 +52290,7 @@
|
|
|
52290
52290
|
"_legacy": {
|
|
52291
52291
|
"scope": "teambit.legacy",
|
|
52292
52292
|
"name": "consumer-config",
|
|
52293
|
-
"version": "0.0.
|
|
52293
|
+
"version": "0.0.21"
|
|
52294
52294
|
}
|
|
52295
52295
|
}
|
|
52296
52296
|
},
|
|
@@ -52339,7 +52339,7 @@
|
|
|
52339
52339
|
"_legacy": {
|
|
52340
52340
|
"scope": "teambit.legacy",
|
|
52341
52341
|
"name": "consumer-config",
|
|
52342
|
-
"version": "0.0.
|
|
52342
|
+
"version": "0.0.21"
|
|
52343
52343
|
}
|
|
52344
52344
|
}
|
|
52345
52345
|
},
|
|
@@ -57561,7 +57561,7 @@
|
|
|
57561
57561
|
"componentId": {
|
|
57562
57562
|
"scope": "teambit.dependencies",
|
|
57563
57563
|
"name": "dependency-resolver",
|
|
57564
|
-
"version": "1.0.
|
|
57564
|
+
"version": "1.0.516"
|
|
57565
57565
|
},
|
|
57566
57566
|
"taggedModuleExports": []
|
|
57567
57567
|
}
|
|
@@ -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.516/dist/dependency-resolver.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.dependencies_dependency-resolver@1.0.516/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.516",
|
|
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.516"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "2.4.2",
|
|
@@ -33,30 +33,30 @@
|
|
|
33
33
|
"@teambit/legacy-bit-id": "1.1.1",
|
|
34
34
|
"@teambit/component-version": "1.0.3",
|
|
35
35
|
"@teambit/toolbox.object.sorter": "0.0.2",
|
|
36
|
-
"@teambit/component": "1.0.
|
|
37
|
-
"@teambit/envs": "1.0.
|
|
38
|
-
"@teambit/dependencies": "1.0.
|
|
39
|
-
"@teambit/aspect-loader": "1.0.
|
|
40
|
-
"@teambit/logger": "0.0.
|
|
41
|
-
"@teambit/objects": "0.0.
|
|
36
|
+
"@teambit/component": "1.0.516",
|
|
37
|
+
"@teambit/envs": "1.0.516",
|
|
38
|
+
"@teambit/dependencies": "1.0.516",
|
|
39
|
+
"@teambit/aspect-loader": "1.0.516",
|
|
40
|
+
"@teambit/logger": "0.0.1186",
|
|
41
|
+
"@teambit/objects": "0.0.23",
|
|
42
42
|
"@teambit/toolbox.path.path": "0.0.6",
|
|
43
|
-
"@teambit/pkg.modules.component-package-name": "0.0.
|
|
44
|
-
"@teambit/graphql": "1.0.
|
|
45
|
-
"@teambit/cli": "0.0.
|
|
46
|
-
"@teambit/component.sources": "0.0.
|
|
47
|
-
"@teambit/config": "0.0.
|
|
48
|
-
"@teambit/global-config": "0.0.
|
|
49
|
-
"@teambit/harmony.modules.feature-toggle": "0.0.
|
|
43
|
+
"@teambit/pkg.modules.component-package-name": "0.0.28",
|
|
44
|
+
"@teambit/graphql": "1.0.516",
|
|
45
|
+
"@teambit/cli": "0.0.1093",
|
|
46
|
+
"@teambit/component.sources": "0.0.73",
|
|
47
|
+
"@teambit/config": "0.0.1267",
|
|
48
|
+
"@teambit/global-config": "0.0.1096",
|
|
49
|
+
"@teambit/harmony.modules.feature-toggle": "0.0.15",
|
|
50
50
|
"@teambit/harmony.modules.requireable-component": "0.0.500",
|
|
51
|
-
"@teambit/legacy.constants": "0.0.
|
|
52
|
-
"@teambit/legacy.consumer-component": "0.0.
|
|
53
|
-
"@teambit/legacy.extension-data": "0.0.
|
|
54
|
-
"@teambit/scope.network": "0.0.
|
|
55
|
-
"@teambit/snapping": "1.0.
|
|
56
|
-
"@teambit/workspace.modules.node-modules-linker": "0.0.
|
|
51
|
+
"@teambit/legacy.constants": "0.0.7",
|
|
52
|
+
"@teambit/legacy.consumer-component": "0.0.22",
|
|
53
|
+
"@teambit/legacy.extension-data": "0.0.23",
|
|
54
|
+
"@teambit/scope.network": "0.0.21",
|
|
55
|
+
"@teambit/snapping": "1.0.516",
|
|
56
|
+
"@teambit/workspace.modules.node-modules-linker": "0.0.249",
|
|
57
57
|
"@teambit/component-issues": "0.0.153",
|
|
58
58
|
"@teambit/component-package-version": "0.0.435",
|
|
59
|
-
"@teambit/legacy.consumer-config": "0.0.
|
|
59
|
+
"@teambit/legacy.consumer-config": "0.0.21",
|
|
60
60
|
"@teambit/toolbox.crypto.sha1": "0.0.5"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|