1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[110],{511740(j,c,l){l.r(c),l.d(c,{Solutions:()=>b});var t=l(134307),n=l(344651),f=l(660296),e=l(235704),s={id:"teambit.docs/docs/[email protected]",homepage:"https://bit.cloud/teambit/docs/docs/update-repositories",exported:!0};const b=()=>{const m=[{title:"Github Actions",body:(0,t.jsx)(f.A,{})},{title:"NodeJS Scripts",body:(0,t.jsx)(e.A,{})}];return(0,t.jsx)(n.ContentTabs,{tabsContent:m})};b.__bit_component=s},77818(j,c,l){l.r(c),l.d(c,{BitDiff:()=>p,BitInstall:()=>u,BitUpdate:()=>N,BitUpdateOutput:()=>_,DiffAfterCheckout:()=>g,DiffAfterExternalUpdate:()=>v,DiffAllExample:()=>a,DiffExample:()=>o,DiffNamesExample:()=>r,DiffPatternExample:()=>i,DiffSpecifiedVerLocalModExample:()=>d,DiffSpecifiedVersionsExample:()=>x,ExpandedDiff:()=>C,InstallUpdate:()=>w,InstallUpdateOutput:()=>E,UpdateEnvs:()=>k});var t=l(134307),n=l(880383),f=l(292073),e=l(982780),s=l(819267);const b={diffContainer:"update-repositories_diffContainer__ZDKC-"};var m={id:"teambit.docs/docs/[email protected]",homepage:"https://bit.cloud/teambit/docs/docs/update-repositories",exported:!0};const N=()=>(0,t.jsx)(e.CommandExample,{commandName:"update",commandExample:{}});N.__bit_component=m;const u=()=>(0,t.jsx)(e.CommandExample,{commandName:"install",commandExample:{}});u.__bit_component=m;const _=()=>(0,t.jsxs)(n.Terminal,{isOutput:!0,children:[(0,t.jsxs)("span",{children:["\u25CF @my-org/design.icon (runtime) 0.0.8 \u276F 0.0.",(0,t.jsx)(n.Red,{children:"10"})," because of my-org.shop/[email protected]"," "]}),(0,t.jsx)("br",{}),(0,t.jsxs)("span",{children:["\u25CB @my-org/design.input-text (runtime) 0.0.2 \u276F ",(0,t.jsx)(n.Red,{children:"1.0.9"})," because of my-org.shop/[email protected]"]})]});_.__bit_component=m;const v=()=>(0,t.jsxs)(n.Terminal,{isOutput:!0,children:[(0,t.jsx)(n.Blue,{children:`------------------------------------------------------------------------- 2showing diff for `}),(0,t.jsx)(n.Blue,{bold:!0,br:!0,children:"my-org.shop/form"}),(0,t.jsx)(n.Blue,{br:!0,children:"-------------------------------------------------------------------------"}),(0,t.jsx)("br",{}),(0,t.jsx)(n.Neutral,{br:!0,children:"--- dependencies 0.0.1 original"}),(0,t.jsx)(n.Neutral,{br:!0,bold:!0,children:"+++ dependencies 0.0.1 modified"}),(0,t.jsx)(n.Neutral,{br:!0,children:"@my-org/design.icon"}),(0,t.jsx)(n.Red,{br:!0,children:"- @my-org/[email protected]"}),(0,t.jsx)(n.Green,{br:!0,children:"+ @my-org/[email protected]"}),(0,t.jsx)("br",{}),(0,t.jsx)(n.Neutral,{br:!0,children:"@my-org/design.input-text"}),(0,t.jsx)(n.Red,{br:!0,children:"- @my-org/[email protected]"}),(0,t.jsx)(n.Green,{br:!0,children:"+ @my-org/[email protected]"})]});v.__bit_component=m;const g=()=>(0,t.jsxs)(n.Terminal,{isOutput:!0,children:[(0,t.jsx)(n.Blue,{children:`------------------------------------------------------------------------- 3showing diff for `}),(0,t.jsx)(n.Blue,{bold:!0,br:!0,children:"learnbit.getting-started-with-lanes/hello-world"}),(0,t.jsx)(n.Blue,{br:!0,children:"-------------------------------------------------------------------------"}),(0,t.jsx)(n.Neutral,{br:!0,children:"--- hello-world.ts (main)"}),(0,t.jsx)(n.Neutral,{br:!0,bold:!0,children:"+++ hello-world.ts (my-lane)"}),(0,t.jsx)(n.Blue,{br:!0,children:"@@ -1,8 +1,9 @@"}),(0,t.jsx)(n.Neutral,{br:!0,children:" import { capitalize } from 'lodash';"}),(0,t.jsx)("br",{}),(0,t.jsx)(n.Red,{br:!0,children:"-type Language = 'en' | 'es';"}),(0,t.jsx)(n.Green,{br:!0,children:"+type Language = 'en' | 'es' | 'it';"}),(0,t.jsx)("br",{}),(0,t.jsx)(n.Neutral,{br:!0,children:" export function helloWorld(language: Language) {"}),(0,t.jsx)(n.Green,{br:!0,children:"+ if (language === 'it') return 'Ciao mondo!';"}),(0,t.jsx)(n.Neutral,{br:!0,children:` if (language === 'es') return '\xA1Hola mundo!'; 4 return capitalize('hello world!'); 5 }`}),(0,t.jsx)("br",{}),(0,t.jsx)(n.Neutral,{br:!0,children:"--- packageDependencies dabf6c88559715b3f0ad94835ea286410692d9d1"}),(0,t.jsx)(n.Neutral,{br:!0,bold:!0,children:"+++ packageDependencies f944ed8d24275a27401e0a9278d21cc5a006b9a1"}),(0,t.jsx)(n.Red,{br:!0,children:"- lodash@^4.17.19"}),(0,t.jsx)(n.Green,{br:!0,children:"+ lodash@^4.17.21"}),(0,t.jsx)("br",{}),(0,t.jsx)(n.Neutral,{br:!0,children:"--- extensionDependencies dabf6c88559715b3f0ad94835ea286410692d9d1"}),(0,t.jsx)(n.Neutral,{br:!0,bold:!0,children:"+++ extensionDependencies f944ed8d24275a27401e0a9278d21cc5a006b9a"}),(0,t.jsx)(n.Neutral,{br:!0,children:"teambit.node/node-env"}),(0,t.jsx)(n.Red,{br:!0,children:"- teambit.node/[email protected]"}),(0,t.jsx)(n.Green,{children:"+ teambit.node/[email protected]"})]});g.__bit_component=m;
5const o=()=>{const h={"values...":"apps/to-do"};return(0,t.jsx)(f.CommandsExplorer,{commandName:"diff",commandExample:h})};o.__bit_component=m;const p=()=>(0,t.jsx)(f.CommandsExplorer,{commandName:"diff",commandExample:{}});p.__bit_component=m;const a=()=>(0,t.jsx)(f.CommandsExplorer,{commandName:"diff",commandExample:{}});a.__bit_component=m;const r=()=>{const h={"values...":"apps/to-do info/icon-text"};return(0,t.jsx)(f.CommandsExplorer,{commandName:"diff",commandExample:h})};r.__bit_component=m;const i=()=>{const h={"values...":'"my-org.tasks-scope/*"'};return(0,t.jsx)(f.CommandsExplorer,{commandName:"diff",commandExample:h})};i.__bit_component=m;const d=()=>{const h={"values...":"info/icon-text-do 0.0.4"};return(0,t.jsx)(f.CommandsExplorer,{commandName:"diff",commandExample:h})};d.__bit_component=m;const x=()=>{const h={"values...":"info/icon-text-do 0.0.4 0.0.7"};return(0,t.jsx)(f.CommandsExplorer,{commandName:"diff",commandExample:h})};x.__bit_component=m;const y=()=>(0,t.jsxs)("div",{className:b.diffContainer,children:[(0,t.jsx)(p,{}),(0,t.jsx)("h4",{children:"Examples:"}),(0,t.jsx)("p",{children:"Compare a list of components' check-out snaps with their local changes:"}),(0,t.jsx)(r,{}),(0,t.jsx)("p",{children:"Compare a list of components' check-out snaps with their local changes (using a component pattern):"}),(0,t.jsx)(i,{}),(0,t.jsx)("p",{children:"Compare a component's local changes with a specific snap:"}),(0,t.jsx)(d,{}),(0,t.jsx)("p",{children:"Compare two snaps:"}),(0,t.jsx)(x,{})]});y.__bit_component=m;const C=()=>(0,t.jsx)(s._,{snippet:y});C.__bit_component=m;const w=()=>{const h={update:!0};return(0,t.jsx)(e.CommandExample,{commandName:"install",commandExample:h})};w.__bit_component=m;const E=()=>(0,t.jsxs)(n.Terminal,{isOutput:!0,children:[(0,t.jsx)(n.Neutral,{children:"Resolving component dependencies for workspace: '"}),(0,t.jsx)(n.Blue,{children:"my-workspace"}),(0,t.jsx)(n.Neutral,{br:!0,children:"'"}),(0,t.jsx)("br",{}),(0,t.jsx)(n.Blue,{br:!0,children:"dependencies:"}),(0,t.jsx)(n.Red,{children:"- "}),(0,t.jsx)(n.Neutral,{br:!0,children:"@my-org/design.icon 1.1.0"}),(0,t.jsx)(n.Green,{children:"+ "}),(0,t.jsx)(n.Neutral,{br:!0,children:"@my-org/design.icon 1.1.1"})]});E.__bit_component=m;const k=()=>{const h={update:!0};return(0,t.jsx)(e.CommandExample,{commandName:"envs",subCommandName:"update",commandExample:h})};k.__bit_component=m},127491(j,c,l){l.r(c),l.d(c,{default:()=>t.A,updateRepositories:()=>t.A});var t=l(897366),n={id:"teambit.docs/docs/[email protected]",homepage:"https://bit.cloud/teambit/docs/docs/update-repositories",exported:!0}},660296(j,c,l){var t,n={id:"teambit.docs/docs/[email protected]",homepage:"https://bit.cloud/teambit/docs/docs/update-repositories",exported:!0};t={value:!0},c.A=g;var f=b(l(531715)),e=l(437910),s=["components"];function b(o){return o&&o.__esModule?o:{default:o}}b.__bit_component=n;function m(){return m=Object.assign?Object.assign.bind():function(o){for(var p=1;p<arguments.length;p++){var a=arguments[p];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(o[r]=a[r])}return o},m.apply(this,arguments)}m.__bit_component=n;function N(o,p){if(o==null)return{};var a=u(o,p),r,i;if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(o);for(i=0;i<d.length;i++)r=d[i],!(p.indexOf(r)>=0)&&(!Object.prototype.propertyIsEnumerable.call(o,r)||(a[r]=o[r]))}return a}N.__bit_component=n;function u(o,p){if(o==null)return{};var a={},r=Object.keys(o),i,d;for(d=0;d<r.length;d++)i=r[d],!(p.indexOf(i)>=0)&&(a[i]=o[i]);return a}u.__bit_component=n;var _={},v="wrapper";function g(o){var p=o.components,a=N(o,s);return(0,e.mdx)(v,m({},_,a,{components:p,mdxType:"MDXLayout"}),(0,e.mdx)("ol",null,(0,e.mdx)("li",{parentName:"ol"},(0,e.mdx)("a",{parentName:"li",href:"https://github.com/bit-tasks/github-action-examples/raw/main/downloads/dependency-update.zip"},"Download this file")," and place it in your ",(0,e.mdx)("inlineCode",{parentName:"li"},".github/workflows")," directory.")),(0,e.mdx)("ol",{start:2},(0,e.mdx)("li",{parentName:"ol"},"Set the following env variables:")),(0,e.mdx)("table",null,(0,e.mdx)("thead",{parentName:"table"},(0,e.mdx)("tr",{parentName:"thead"},(0,e.mdx)("th",{parentName:"tr",align:null},"Environment Variable"),(0,e.mdx)("th",{parentName:"tr",align:null},"Value/Description"))),(0,e.mdx)("tbody",{parentName:"table"},(0,e.mdx)("tr",{parentName:"tbody"},(0,e.mdx)("td",{parentName:"tr",align:null},(0,e.mdx)("inlineCode",{parentName:"td"},"GITHUB_TOKEN")),(0,e.mdx)("td",{parentName:"tr",align:null},"a ",(0,e.mdx)("a",{parentName:"td",href:"https://docs.github.com/en/actions/security-guides/encrypted-secrets"},"Github secret")," set with a ",(0,e.mdx)("a",{parentName:"td",href:"/config/bit-config#user.token"},"Github token")," that has the permission levels required to perform the CI actions in your repository")),(0,e.mdx)("tr",{parentName:"tbody"},(0,e.mdx)("td",{parentName:"tr",align:null},(0,e.mdx)("inlineCode",{parentName:"td"},"BIT_CONFIG_USER_TOKEN")),(0,e.mdx)("td",{parentName:"tr",align:null},"a ",(0,e.mdx)("a",{parentName:"td",href:"https://docs.github.com/en/actions/security-guides/encrypted-secrets"},"Github secret")," set with a ",(0,e.mdx)("a",{parentName:"td",href:"/config/bit-config#user.token"},"Bit token")," that has the permission levels required for your workflow")),(0,e.mdx)("tr",{parentName:"tbody"},(0,e.mdx)("td",{parentName:"tr",align:null},(0,e.mdx)("inlineCode",{parentName:"td"},"GIT_USER_NAME")),(0,e.mdx)("td",{parentName:"tr",align:null},"a username for git commits made by the CI")),(0,e.mdx)("tr",{parentName:"tbody"},(0,e.mdx)("td",{parentName:"tr",align:null},(0,e.mdx)("inlineCode",{parentName:"td"},"GIT_USER_EMAIL")),(0,e.mdx)("td",{parentName:"tr",align:null},"an email for git commits made by the CI")))),(0,e.mdx)("p",null,"To learn more read ",(0,e.mdx)("a",{parentName:"p",href:"https://github.com/bit-tasks/github-action-examples"},"the docs")," for this implementation of the workflow or check out ",(0,e.mdx)("a",{parentName:"p",href:"https://github.com/bitdev-community/feature-branch-ga-demo"},"this demo"),"."),(0,e.mdx)("ol",{start:3},(0,e.mdx)("li",{parentName:"ol"},"Choose the schedule for the job using ",(0,e.mdx)("inlineCode",{parentName:"li"},"cron"),", or replace it with a different trigger.")),(0,e.mdx)("pre",null,(0,e.mdx)("code",{parentName:"pre",className:"language-yaml"},`name: Dependency Update 6on: 7 schedule: 8 - cron: '0 0 * * *' # run every day at midnight 9`)),(0,e.mdx)("ol",{start:4},(0,e.mdx)("li",{parentName:"ol"},"Set the ",(0,e.mdx)("inlineCode",{parentName:"li"},"allow")," input to one if the following:",(0,e.mdx)("ul",{parentName:"li"},(0,e.mdx)("li",{parentName:"ul"},(0,e.mdx)("inlineCode",{parentName:"li"},"workspace-components"),": checkout the latest version of components maintained in the workspace (components that might be updated from another workspace)"),(0,e.mdx)("li",{parentName:"ul"},(0,e.mdx)("inlineCode",{parentName:"li"},"external-dependencies"),": update component dependencies that are not maintained in the repo (packages or Bit components)"),(0,e.mdx)("li",{parentName:"ul"},(0,e.mdx)("inlineCode",{parentName:"li"},"envs"),": update the envs of components maintained in that workspace "),(0,e.mdx)("li",{parentName:"ul"},(0,e.mdx)("inlineCode",{parentName:"li"},"all"),": update all of the above")))),(0,e.mdx)("p",null,"For example:"),(0,e.mdx)("pre",null,(0,e.mdx)("code",{parentName:"pre",className:"language-yaml"},`- name: Bit Dependency Update 10uses: bit-tasks/dependency-update@v1 11 branch: 'main' # the target branch to update 12 allow: 'all' # permissible updates 13`)),(0,e.mdx)("p",null,"To learn more read the ",(0,e.mdx)("a",{parentName:"p",href:"https://github.com/bit-tasks/github-action-examples"},"full documentation")," for this type of implementation, or check out ",(0,e.mdx)("a",{parentName:"p",href:"https://github.com/bitdev-community/dependency-update-demo"},"this demo"),"."))}g.__bit_component=n,g.isMDXComponent=!0},235704(j,c,l){var t,n={id:"teambit.docs/docs/[email protected]",homepage:"https://bit.cloud/teambit/docs/docs/update-repositories",exported:!0}
13;t={value:!0},c.A=g;var f=b(l(531715)),e=l(437910),s=["components"];function b(o){return o&&o.__esModule?o:{default:o}}b.__bit_component=n;function m(){return m=Object.assign?Object.assign.bind():function(o){for(var p=1;p<arguments.length;p++){var a=arguments[p];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(o[r]=a[r])}return o},m.apply(this,arguments)}m.__bit_component=n;function N(o,p){if(o==null)return{};var a=u(o,p),r,i;if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(o);for(i=0;i<d.length;i++)r=d[i],!(p.indexOf(r)>=0)&&(!Object.prototype.propertyIsEnumerable.call(o,r)||(a[r]=o[r]))}return a}N.__bit_component=n;function u(o,p){if(o==null)return{};var a={},r=Object.keys(o),i,d;for(d=0;d<r.length;d++)i=r[d],!(p.indexOf(i)>=0)&&(a[i]=o[i]);return a}u.__bit_component=n;var _={},v="wrapper";function g(o){var p=o.components,a=N(o,s);return(0,e.mdx)(v,m({},_,a,{components:p,mdxType:"MDXLayout"}),(0,e.mdx)("ol",null,(0,e.mdx)("li",{parentName:"ol"},"Download ",(0,e.mdx)("a",{parentName:"li",href:"https://github.com/bit-tasks/nodejs/raw/main/downloads/dependency-update.zip"},"these Node.js scripts"))),(0,e.mdx)("ol",{start:2},(0,e.mdx)("li",{parentName:"ol"},"Set the following env variables in your CI system:")),(0,e.mdx)("table",null,(0,e.mdx)("thead",{parentName:"table"},(0,e.mdx)("tr",{parentName:"thead"},(0,e.mdx)("th",{parentName:"tr",align:null},"Environment Variable"),(0,e.mdx)("th",{parentName:"tr",align:null},"Value/Description"),(0,e.mdx)("th",{parentName:"tr",align:null}))),(0,e.mdx)("tbody",{parentName:"table"},(0,e.mdx)("tr",{parentName:"tbody"},(0,e.mdx)("td",{parentName:"tr",align:null},(0,e.mdx)("inlineCode",{parentName:"td"},"BIT_CONFIG_USER_TOKEN")),(0,e.mdx)("td",{parentName:"tr",align:null},"a ",(0,e.mdx)("a",{parentName:"td",href:"/config/bit-config#user.token"},"Bit token")," with permission levels required for your workflow."),(0,e.mdx)("td",{parentName:"tr",align:null})),(0,e.mdx)("tr",{parentName:"tbody"},(0,e.mdx)("td",{parentName:"tr",align:null},(0,e.mdx)("inlineCode",{parentName:"td"},"BIT_CONFIG_INTERACTIVE")),(0,e.mdx)("td",{parentName:"tr",align:null},(0,e.mdx)("inlineCode",{parentName:"td"},"false")),(0,e.mdx)("td",{parentName:"tr",align:null})),(0,e.mdx)("tr",{parentName:"tbody"},(0,e.mdx)("td",{parentName:"tr",align:null},(0,e.mdx)("inlineCode",{parentName:"td"},"BIT_CONFIG_ANALYTICS_REPORTING")),(0,e.mdx)("td",{parentName:"tr",align:null},(0,e.mdx)("inlineCode",{parentName:"td"},"false")),(0,e.mdx)("td",{parentName:"tr",align:null})),(0,e.mdx)("tr",{parentName:"tbody"},(0,e.mdx)("td",{parentName:"tr",align:null},(0,e.mdx)("inlineCode",{parentName:"td"},"BIT_CONFIG_ANONYMOUS_REPORTING")),(0,e.mdx)("td",{parentName:"tr",align:null},(0,e.mdx)("inlineCode",{parentName:"td"},"false")),(0,e.mdx)("td",{parentName:"tr",align:null})),(0,e.mdx)("tr",{parentName:"tbody"},(0,e.mdx)("td",{parentName:"tr",align:null},(0,e.mdx)("inlineCode",{parentName:"td"},"GIT_USER_NAME")),(0,e.mdx)("td",{parentName:"tr",align:null},"a username for git commits made by the CI"),(0,e.mdx)("td",{parentName:"tr",align:null})),(0,e.mdx)("tr",{parentName:"tbody"},(0,e.mdx)("td",{parentName:"tr",align:null},(0,e.mdx)("inlineCode",{parentName:"td"},"GIT_USER_EMAIL")),(0,e.mdx)("td",{parentName:"tr",align:null},"an email for git commits made by the CI"),(0,e.mdx)("td",{parentName:"tr",align:null})))),(0,e.mdx)("ol",{start:3},(0,e.mdx)("li",{parentName:"ol"},"Run the ",(0,e.mdx)("inlineCode",{parentName:"li"},"bit-init.js")," script, before running the ",(0,e.mdx)("inlineCode",{parentName:"li"},"dependency-update.js")," script.")),(0,e.mdx)("ol",{start:4},(0,e.mdx)("li",{parentName:"ol"},"Remove the type of update you don't need from the ",(0,e.mdx)("inlineCode",{parentName:"li"},"dependency-update.js")," script:",(0,e.mdx)("ul",{parentName:"li"},(0,e.mdx)("li",{parentName:"ul"},(0,e.mdx)("inlineCode",{parentName:"li"},"bit checkout head --all"),": checkout the latest version of components maintained in the workspace (components that might be updated from another workspace)"),(0,e.mdx)("li",{parentName:"ul"},(0,e.mdx)("inlineCode",{parentName:"li"},"bit envs update"),": update the envs of components maintained in that workspace "),(0,e.mdx)("li",{parentName:"ul"},(0,e.mdx)("inlineCode",{parentName:"li"},"bit update -y"),": update dependencies that are not maintained in the repo (packages or Bit components)")))),(0,e.mdx)("ol",{start:5},(0,e.mdx)("li",{parentName:"ol"},`Add the implementation for automated PR creation, in your repository hosting service. 14For example, see this `,(0,e.mdx)("a",{parentName:"li",href:"https://github.com/bit-tasks/dependency-update/blob/main/scripts/dependency-update.ts"},"demo of a PR created using Github's API"),".")),(0,e.mdx)("ol",{start:6},(0,e.mdx)("li",{parentName:"ol"},"Set your CI to execute this script on a schedule or any other trigger that might be suitable for you.")))}g.__bit_component=n,g.isMDXComponent=!0},897366(j,c,l){var t,n={id:"teambit.docs/docs/[email protected]",homepage:"https://bit.cloud/teambit/docs/docs/update-repositories",exported:!0}
14;t={value:!0},c.A=p;var f=N(l(531715)),e=l(437910),s=l(77818),b=l(511740),m=["components"];function N(a){return a&&a.__esModule?a:{default:a}}N.__bit_component=n;function u(){return u=Object.assign?Object.assign.bind():function(a){for(var r=1;r<arguments.length;r++){var i=arguments[r];for(var d in i)Object.prototype.hasOwnProperty.call(i,d)&&(a[d]=i[d])}return a},u.apply(this,arguments)}u.__bit_component=n;function _(a,r){if(a==null)return{};var i=v(a,r),d,x;if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(a);for(x=0;x<y.length;x++)d=y[x],!(r.indexOf(d)>=0)&&(!Object.prototype.propertyIsEnumerable.call(a,d)||(i[d]=a[d]))}return i}_.__bit_component=n;function v(a,r){if(a==null)return{};var i={},d=Object.keys(a),x,y;for(y=0;y<d.length;y++)x=d[y],!(r.indexOf(x)>=0)&&(i[x]=a[x]);return i}v.__bit_component=n;var g={},o="wrapper";function p(a){var r=a.components,i=_(a,m);return(0,e.mdx)(o,u({},g,i,{components:r,mdxType:"MDXLayout"}),(0,e.mdx)("h1",null,"Updating Repositories"),(0,e.mdx)("p",null,`Bit components used or maintained in your repository might have newer versions available in their remote scopes. 15These component changes can be introduced by other collaborators who maintain these components outside of your repository.`),(0,e.mdx)("p",null,"For this reason, we recommend that updates to the main branch, including those originating from the components' remote scopes, should be made via the standard feature-branch workflow."),(0,e.mdx)("ol",null,(0,e.mdx)("li",{parentName:"ol"},"Create a new feature branch"),(0,e.mdx)("li",{parentName:"ol"},"Update components in the repository with the latest versions from the remote scopes"),(0,e.mdx)("li",{parentName:"ol"},"Commit and push the changes to the remote repository"),(0,e.mdx)("li",{parentName:"ol"},"Create a pull request and merge the changes to the main branch")),(0,e.mdx)("blockquote",null,(0,e.mdx)("p",{parentName:"blockquote"},"See the ",(0,e.mdx)("a",{parentName:"p",href:"#automated-updates"},"Automated updates")," section for an automated workflow.")),(0,e.mdx)("h2",null,"Update external dependencies"),(0,e.mdx)("p",null,"External dependencies are Bit components or packages that are not maintained in the repository, but are consumed by components in the repository."),(0,e.mdx)("blockquote",null,(0,e.mdx)("p",{parentName:"blockquote"},"Repositories without a Bit workspace can update their external dependencies, components and packages, using the standard package manager commands.")),(0,e.mdx)("h3",null,"Update to the latest dependency versions within the permissible range"),(0,e.mdx)("p",null,"To update dependencies to their latest version within the permissible range, as listed in the ",(0,e.mdx)("inlineCode",{parentName:"p"},"workspace.jsonc")," or ",(0,e.mdx)("inlineCode",{parentName:"p"},"package.json")," files, run the following command:"),(0,e.mdx)(s.InstallUpdate,{mdxType:"InstallUpdate"}),(0,e.mdx)("p",null,"Note that component-to-component dependencies are always concrete. That means, that a component's dependency graph will include version ranges for packages, but will only include concrete versions for components."),(0,e.mdx)("p",null,"When updating external dependencies based on a range, the range for component versions will ",(0,e.mdx)("em",{parentName:"p"},"only")," be read from the workspace dependency policy or the ",(0,e.mdx)("inlineCode",{parentName:"p"},"package.json")," file, but not in the component's dependency graph."),(0,e.mdx)("p",null,"For example, the following ",(0,e.mdx)("a",{parentName:"p",href:"dependencies/dependency-policies"},"workspace dependency policy")," permits updating the ",(0,e.mdx)("inlineCode",{parentName:"p"},"@my-org/design.icon")," dependency (component) to any version within the ",(0,e.mdx)("inlineCode",{parentName:"p"},"^1.1.0")," range (i.e, ",(0,e.mdx)("inlineCode",{parentName:"p"},"1.1.0")," up to ",(0,e.mdx)("inlineCode",{parentName:"p"},"2.0.0")," - excluding ",(0,e.mdx)("inlineCode",{parentName:"p"},"2.0.2"),"):"),(0,e.mdx)("pre",null,(0,e.mdx)("code",{parentName:"pre",className:"language-json"},`/* @filename: workspace.jsonc */ 16 17{ 18 "teambit.dependencies/dependency-resolver": { 19 "policy": { 20 "dependencies": { 21 "@my-org/design.icon": "^1.1.0" 22 } 23 } 24 } 25} 26`)),(0,e.mdx)("p",null,"Assuming the latest available version is ",(0,e.mdx)("inlineCode",{parentName:"p"},"1.1.1"),", the output for the previous command should be:"),(0,e.mdx)(s.InstallUpdateOutput,{mdxType:"InstallUpdateOutput"}),(0,e.mdx)("h3",null,"Update to the latest available dependency versions"),(0,e.mdx)("p",null,"This option is particularly useful when component dependencies are not listed in the workspace dependency policy or the ",(0,e.mdx)("inlineCode",{parentName:"p"},"package.json"),` file.
27As mentioned earlier, a component's dependency graph will only include concrete versions for components. In this case, updates withing a range will not be possible.`),(0,e.mdx)("p",null,"Run the following command to update external dependencies in your repository:"),(0,e.mdx)(s.BitUpdate,{mdxType:"BitUpdate"}),(0,e.mdx)("blockquote",null,(0,e.mdx)("p",{parentName:"blockquote"},"Use the ",(0,e.mdx)("inlineCode",{parentName:"p"},"--yes")," flag to skip the interactive prompt, and accept all available updates.")),(0,e.mdx)("p",null,"The interactive prompt displays the available updates for dependencies listed in your ",(0,e.mdx)("inlineCode",{parentName:"p"},"workspace.jsonc"),", but also for dependencies that are read from the component snaps."),(0,e.mdx)("p",null,"For example, the following prompt lists two available updates, and the Bit components that will be affected by these updates:"),(0,e.mdx)(s.BitUpdateOutput,{mdxType:"BitUpdateOutput"}),(0,e.mdx)("h3",null,"Inspect components with a modified dependency graph"),(0,e.mdx)("p",null,"A component is more than its source code. It also includes, among other things, its dependency graph. When Bit resolves a component's dependency version to a newer version, the component's dependency graph is modified (and so is the component)."),(0,e.mdx)("p",null,"Run the following to examine the changes introduced to components in your repository, as a result of a dependency update:"),(0,e.mdx)(s.BitDiff,{mdxType:"BitDiff"}),(0,e.mdx)(s.ExpandedDiff,{mdxType:"ExpandedDiff"}),(0,e.mdx)("p",null,"The output should list the affected components and the changes made to their dependency graph:"),(0,e.mdx)(s.DiffAfterExternalUpdate,{mdxType:"DiffAfterExternalUpdate"}),(0,e.mdx)("h2",null,"Update workspace components"),(0,e.mdx)("p",null,"Workspace components are components maintained in your repository."),(0,e.mdx)("p",null,"To learn how to checkout the latest version of a component (available in its remote scope) into your repository, see ",(0,e.mdx)("a",{parentName:"p",href:"docs/getting-started/collaborate/update-components#update-workspace-components"},"Update workspace components"),"."),(0,e.mdx)("h3",null,"Update component envs"),(0,e.mdx)("p",null,"To update your components' envs to the latest version available run the following command:"),(0,e.mdx)(s.UpdateEnvs,{mdxType:"UpdateEnvs"}),(0,e.mdx)("p",null,"Changes to the component configuration (in this case, their env version) are registered in the ",(0,e.mdx)("inlineCode",{parentName:"p"},".bitmap")," file, until the components are snapped (at which point the changes are stored in the component snap)."),(0,e.mdx)("p",null,"For example, the following ",(0,e.mdx)("inlineCode",{parentName:"p"},".bitmap")," file lists the updated env version for the ",(0,e.mdx)("inlineCode",{parentName:"p"},"my-component")," component:"),(0,e.mdx)("pre",null,(0,e.mdx)("code",{parentName:"pre",className:"language-json"},`/* @filename: .bitmap */ 28 29{ 30 "my-component": { 31 "scope": "my-org.my-scope", 32 "version": "0.0.1", 33 "mainFile": "index.ts", 34 "rootDir": "my-scope/my-component", 35 "config": { 36 "teambit.react/[email protected]": {} 37 } 38 }, 39} 40`)),(0,e.mdx)("h2",null,"Automated updates"),(0,e.mdx)("h3",null,"Update external dependencies, components and envs"),(0,e.mdx)("p",null,"The following workflows automate the process of updating external dependencies, components and envs in your repository."),(0,e.mdx)("ol",null,(0,e.mdx)("li",{parentName:"ol"},"The CI job is triggered by a schedule or by a webhook"),(0,e.mdx)("li",{parentName:"ol"},"One or more of the following actions are performed (in the order listed below):",(0,e.mdx)("ol",{parentName:"li"},(0,e.mdx)("li",{parentName:"ol"},(0,e.mdx)("a",{parentName:"li",href:"#update-workspace-components"},"Workspace components update")),(0,e.mdx)("li",{parentName:"ol"},(0,e.mdx)("a",{parentName:"li",href:"#update-to-the-latest-available-dependency-versions"},"External dependencies update")),(0,e.mdx)("li",{parentName:"ol"},(0,e.mdx)("a",{parentName:"li",href:"##update-component-envs"},"Component envs update")))),(0,e.mdx)("li",{parentName:"ol"},"A pull request is created with the changes")),(0,e.mdx)("p",null,"See ",(0,e.mdx)("a",{parentName:"p",href:"https://github.com/bitdev-community/dependency-update-demo"},"a demo of this automated workflow")," using Github Actions, scheduled to run at every midnight."),(0,e.mdx)("p",null,"Choose the implementation that best fits your needs:"),(0,e.mdx)(b.Solutions,{mdxType:"Solutions"}
40),(0,e.mdx)("h3",null,"Update components using Dependabot"),(0,e.mdx)("blockquote",null,(0,e.mdx)("p",{parentName:"blockquote"},"This option is only available for repositories using the ",(0,e.mdx)("inlineCode",{parentName:"p"},"package.json")," file to manage their dependencies.")),(0,e.mdx)("p",null,"This option uses ",(0,e.mdx)("a",{parentName:"p",href:"https://dependabot.com/"},"Dependabot"),` to update components used (but not maintained) in your repository. 41For more information read the `,(0,e.mdx)("a",{parentName:"p",href:"https://github.com/bit-tasks/dependabot"},"full documentation")," or check out ",(0,e.mdx)("a",{parentName:"p",href:"https://github.com/bitdev-community/dependabot-demo/tree/main"},"this demo"),"."),(0,e.mdx)("ol",null,(0,e.mdx)("li",{parentName:"ol"},"Create a file named ",(0,e.mdx)("inlineCode",{parentName:"li"},"dependabot.yml")," under your ",(0,e.mdx)("inlineCode",{parentName:"li"},".github")," directory and add the following configuration:")),(0,e.mdx)("pre",null,(0,e.mdx)("code",{parentName:"pre",className:"language-yml"},`version: 2 42updates: 43 - package-ecosystem: "npm" 44 directory: "/" 45 schedule: 46 interval: "daily" 47 groups: 48 bit-scope-dependencies: 49 patterns: 50 - "@my-bit-org*" # your bit.cloud organization or account name 51`)),(0,e.mdx)("ol",{start:2},(0,e.mdx)("li",{parentName:"ol"},"At the root of your project (next to ",(0,e.mdx)("inlineCode",{parentName:"li"},"package.json"),"), create npm configuration file named ",(0,e.mdx)("a",{parentName:"li",href:"/packages/npmrc"},(0,e.mdx)("inlineCode",{parentName:"a"},".npmrc"))," and add the following (replace ",(0,e.mdx)("inlineCode",{parentName:"li"},"your-bit-cloud-organization")," with your bit.cloud account or organization name):")),(0,e.mdx)("pre",null,(0,e.mdx)("code",{parentName:"pre",className:"language-txt"},`registry=https://registry.npmjs.org/ 52@your-bit-cloud-organization:registry=https://node-registry.bit.cloud 53@bit:registry=https://node.bit.cloud 54@teambit:registry=https://node-registry.bit.cloud 55//node.bit.cloud/:_authToken=\${BIT_CONFIG_USER_TOKEN} 56`)))}p.__bit_component=n,p.isMDXComponent=!0}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.