@teambit/lanes 1.0.189 → 1.0.190

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,22 +1,22 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <testsuites tests="17" failures="0" errors="0" skipped="0">
3
- <testsuite name="teambit.lanes/lanes@1.0.189" tests="17" failures="0" errors="0" skipped="0">
4
- <testcase classname="dist/lanes.spec.js" name="should list all lanes" time="0.002"/>
5
- <testcase classname="dist/lanes.spec.js" name="should return that the lane is up to date when the lane is ahead of main" time="0.029"/>
6
- <testcase classname="dist/lanes.spec.js" name="should return that the lane is not up to date when main is ahead" time="0.348"/>
7
- <testcase classname="dist/lanes.spec.js" name="should return that the lane is up to date when the lane is ahead of main" time="0.051"/>
8
- <testcase classname="dist/lanes.spec.js" name="should return that the lane is not up to date when main is ahead" time="0.329"/>
9
- <testcase classname="dist/lanes.spec.js" name="should restore the deleted lane"/>
3
+ <testsuite name="teambit.lanes/lanes@1.0.190" tests="17" failures="0" errors="0" skipped="0">
4
+ <testcase classname="dist/lanes.spec.js" name="should list all lanes" time="0.005"/>
5
+ <testcase classname="dist/lanes.spec.js" name="should return that the lane is up to date when the lane is ahead of main" time="0.069"/>
6
+ <testcase classname="dist/lanes.spec.js" name="should return that the lane is not up to date when main is ahead" time="0.534"/>
7
+ <testcase classname="dist/lanes.spec.js" name="should return that the lane is up to date when the lane is ahead of main" time="0.086"/>
8
+ <testcase classname="dist/lanes.spec.js" name="should return that the lane is not up to date when main is ahead" time="0.338"/>
9
+ <testcase classname="dist/lanes.spec.js" name="should restore the deleted lane" time="0.001"/>
10
10
  <testcase classname="dist/lanes.spec.js" name="should not throw"/>
11
- <testcase classname="dist/lanes.spec.js" name="should throw when restoring the lane" time="0.002"/>
12
- <testcase classname="dist/lanes.spec.js" name="should create lane history object when creating a new lane" time="0.002"/>
11
+ <testcase classname="dist/lanes.spec.js" name="should throw when restoring the lane" time="0.001"/>
12
+ <testcase classname="dist/lanes.spec.js" name="should create lane history object when creating a new lane" time="0.003"/>
13
13
  <testcase classname="dist/lanes.spec.js" name="should add a record to LaneHistory when snapping" time="0.001"/>
14
14
  <testcase classname="dist/lanes.spec.js" name="should export successfully"/>
15
15
  <testcase classname="dist/lanes.spec.js" name="should not add a record to the lane-history" time="0.001"/>
16
- <testcase classname="dist/lanes.spec.js" name="should be able to checkout to a previous state of the lane" time="0.051"/>
17
- <testcase classname="dist/lanes.spec.js" name="should be able to revert to a previous history id" time="1.552"/>
18
- <testcase classname="dist/lanes.spec.js" name="should not throw when creating the second lane" time="0.462"/>
19
- <testcase classname="dist/lanes.spec.js" name="should save the deleted data into the lane object"/>
16
+ <testcase classname="dist/lanes.spec.js" name="should be able to checkout to a previous state of the lane" time="0.132"/>
17
+ <testcase classname="dist/lanes.spec.js" name="should be able to revert to a previous history id" time="1.901"/>
18
+ <testcase classname="dist/lanes.spec.js" name="should not throw when creating the second lane" time="0.488"/>
19
+ <testcase classname="dist/lanes.spec.js" name="should save the deleted data into the lane object" time="0.001"/>
20
20
  <testcase classname="dist/lanes.spec.js" name="should save the deleted data into lane history" time="0.001"/>
21
21
  </testsuite>
22
22
  </testsuites>
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["teambit.lanes/lanes-preview"]=t():e["teambit.lanes/lanes-preview"]=t()}(self,(()=>(()=>{"use strict";var e={17548:(e,t,n)=>{var a={id:"teambit.lanes/lanes@1.0.189",homepage:"https://bit.cloud/teambit/lanes/lanes",exported:!0};function o(){const e=i(n(41594));return o=function(){return e},e}function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Logo=void 0,o.__bit_component=a,i.__bit_component=a;const r=()=>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/lanes.svg"}));r.__bit_component=a,t.Logo=r},41594:e=>{e.exports=React}},t={};function n(a){var o=t[a];if(void 0!==o)return o.exports;var i=t[a]={exports:{}};return e[a](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return(()=>{n.r(a),n.d(a,{compositions:()=>p,compositions_metadata:()=>c,overview:()=>h});var e={};n.r(e),n.d(e,{default:()=>d});var t=n(17548);n(41594);const o=MdxJsReact,i=TeambitMdxUiMdxScopeContext;var r=["components"];function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},l.apply(this,arguments)}var s={},m="wrapper";function d(e){var t=e.components,n=function(e,t){if(null==e)return{};var n,a,o=function(e,t){if(null==e)return{};var n,a,o={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,r);return(0,o.mdx)(m,l({},s,n,{components:t,mdxType:"MDXLayout"}),(0,o.mdx)(i.MDXScopeProvider,{components:{},mdxType:"MDXScopeProvider"},(0,o.mdx)("p",null,"See more details about these two features here: ",(0,o.mdx)("a",{parentName:"p",href:"https://github.com/teambit/bit/issues/1986"},"Lanes"),". ",(0,o.mdx)("a",{parentName:"p",href:"https://github.com/teambit/bit/issues/1985"},"Snaps"),"."),(0,o.mdx)("p",null,"The following describes the final implementation, which differs from the specification above."),(0,o.mdx)("h2",null,"Synopsis"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre"},"- create a snap: `bit snap` (synopsis similar to the `bit tag`)\n- create a new lane: `bit lane create <name>`\n- list lanes: `bit lane list`\n- switch between lanes: `bit switch <name>`\n- merge lanes: `bit lane merge`\n- show lane details: `bit lane show <name>`\n- diff between lanes: `bit lane diff <values>`\n- track local lane to a remote lane: `bit switch --as`\n- remove a lane: `bit lane remove <name>`.\n- fetch lane objects (without the components): `bit fetch --lanes`\n- import a lane: `bit lane import`\n- export current lane: `bit export`\n- (internal) cat lane object: `bit cat-lane <name>`\n")),(0,o.mdx)("h2",null,"Important points"),(0,o.mdx)("h3",null,"Lane ID"),(0,o.mdx)("p",null,"The Lane id consists of the lane name and the scope. If this is a new lane, the scope is the defaultScope.\nThe ",(0,o.mdx)("inlineCode",{parentName:"p"},"LaneId")," ",(0,o.mdx)("em",{parentName:"p"},"always")," has these two props."),(0,o.mdx)("h3",null,"Performance consideration"),(0,o.mdx)("p",null,"Currently, if it imports with no-deps, it doesn't ask for parents, if it imports with deps it imports with all parents. It is originated from src/api/scope/lib/fetch.ts: ",(0,o.mdx)("inlineCode",{parentName:"p"},"const collectParents = !noDependencies;"),". We need to make a decision here."),(0,o.mdx)("h3",null,"Hash"),(0,o.mdx)("ul",null,(0,o.mdx)("li",{parentName:"ul"},"Snap's hash is generated by a UUID and then converted into sha1. ",(0,o.mdx)("inlineCode",{parentName:"li"},"sha1(v4())"),"."),(0,o.mdx)("li",{parentName:"ul"},"Lane's hash is generated by a UUID and then converted into sha1. ",(0,o.mdx)("inlineCode",{parentName:"li"},"sha1(v4())"),"."),(0,o.mdx)("li",{parentName:"ul"},"Tag's hash stays the same. Generated by the ",(0,o.mdx)("inlineCode",{parentName:"li"},"Version.id()"),"."),(0,o.mdx)("li",{parentName:"ul"},"Lane's hash doesn't get changed even if the lane has been renamed or its scope changed.")),(0,o.mdx)("h3",null,"Lane Data"),(0,o.mdx)("p",null,"Lane data, for the most cases is a map of component-id:snap-head, in other words, it saves per component the head snap. There are 3 different places where we store such data for different purposes."),(0,o.mdx)("ul",null,(0,o.mdx)("li",{parentName:"ul"},(0,o.mdx)("inlineCode",{parentName:"li"},"lane-object"),' "Lane" is saved in the scope ',(0,o.mdx)("inlineCode",{parentName:"li"},".bit/objects")," (.bit can be .git/bit locally), it has a unique hash and contains a map of components and their heads. This object exists on both local and remote scopes. Its main purpose is to sync lane-data between scopes. See ",(0,o.mdx)("inlineCode",{parentName:"li"},"Lane")," class (in scope/model) for the implementation details."),(0,o.mdx)("li",{parentName:"ul"},(0,o.mdx)("inlineCode",{parentName:"li"},"remote-lane")," (component and their heads) is saved in ",(0,o.mdx)("inlineCode",{parentName:"li"},".bit/refs/remote/remote-name/lane-name"),". These refs files are saved in both, local and remote scopes. Its main purpose is to keep track where the remote-heads are per lane. See ",(0,o.mdx)("inlineCode",{parentName:"li"},"RemoteLanes")," class for the implementation details.")),(0,o.mdx)("p",null,"More places that stores lanes related data:"),(0,o.mdx)("ul",null,(0,o.mdx)("li",{parentName:"ul"},"the currently checked out lane is saved in the scope.json file. (e.g. ",(0,o.mdx)("inlineCode",{parentName:"li"},'{ lanes: { current: "lane-a", tracking: "remote/lane-a" } }'),")."),(0,o.mdx)("li",{parentName:"ul"},"When switching to a remote lane, the .bitmap is updated as well with the remote-name, so then, when cloning the project, it's possible to fetch the remote lane data.")),(0,o.mdx)("p",null,"Summary of when/what lanes data is saved per command:"),(0,o.mdx)("ul",null,(0,o.mdx)("li",{parentName:"ul"},(0,o.mdx)("inlineCode",{parentName:"li"},"bit lane create"),": creates a new lane-object and creates a new lane record in scope.json and .bitmap."),(0,o.mdx)("li",{parentName:"ul"},(0,o.mdx)("inlineCode",{parentName:"li"},"bit snap"),": adds an entry to the lane-object."),(0,o.mdx)("li",{parentName:"ul"},(0,o.mdx)("inlineCode",{parentName:"li"},"bit export"),": pushes the lane-object to the remote. On the remote, the lane-object is created or updated/merged."),(0,o.mdx)("li",{parentName:"ul"},(0,o.mdx)("inlineCode",{parentName:"li"},"bit switch --remote"),": 1) creates/updates lane-object in the scope. 2) creates/updates remote-lane. the remote-lane is updated also for main."),(0,o.mdx)("li",{parentName:"ul"},(0,o.mdx)("inlineCode",{parentName:"li"},"bit fetch")," or ",(0,o.mdx)("inlineCode",{parentName:"li"},"bit import --objects"),": creates/updates remote-lane. the remote-lane is updated also for main. It doesn't update/merge the lane object.")),(0,o.mdx)("h3",null,"Merge during import"),(0,o.mdx)("ul",null,(0,o.mdx)("li",{parentName:"ul"},"When the remote is ahead, it's easy, just update the head to the remote-head."),(0,o.mdx)("li",{parentName:"ul"},"When the local and remote have diverged, it's more complex. We need to create a snap-merge that has two parents, one point to the local head and one point to the remote head."),(0,o.mdx)("li",{parentName:"ul"},"On ",(0,o.mdx)("inlineCode",{parentName:"li"},"bit import --objects")," (or ",(0,o.mdx)("inlineCode",{parentName:"li"},"bit fetch"),") we don't merge. The remote head is saved in the .bit/refs/remote dir. Then, ",(0,o.mdx)("inlineCode",{parentName:"li"},"bit status")," shows that these components are merge-pending."),(0,o.mdx)("li",{parentName:"ul"},"On ",(0,o.mdx)("inlineCode",{parentName:"li"},"bit import <id>")," we do the merge."),(0,o.mdx)("li",{parentName:"ul"},"in case the merge wasn't done and the user is trying to export, the remote blocks is as it finds out that its head doesn't exist on the incoming component."),(0,o.mdx)("li",{parentName:"ul"},"in case the snap-merge failed due to a conflict, it saves the conflict and heads data into ",(0,o.mdx)("inlineCode",{parentName:"li"},".bit/unmerged.json")," file.")),(0,o.mdx)("h3",null,"Merge components"),(0,o.mdx)("ul",null,(0,o.mdx)("li",{parentName:"ul"},"to merge an entire lane, use ",(0,o.mdx)("inlineCode",{parentName:"li"},"bit lane merge"),"."),(0,o.mdx)("li",{parentName:"ul"},"to get updates from a remote lane, run ",(0,o.mdx)("inlineCode",{parentName:"li"},"bit import"),", and then ",(0,o.mdx)("inlineCode",{parentName:"li"},"bit checkout head"),". alternatively, run ",(0,o.mdx)("inlineCode",{parentName:"li"},"bit merge <component-id>")," in one command."),(0,o.mdx)("li",{parentName:"ul"},"to merge an individual component from a lane to main, run ",(0,o.mdx)("inlineCode",{parentName:"li"},"bit lane merge <lane> --pattern <component-id>")," when on main.")),(0,o.mdx)("h3",null,"Useful APIs"),(0,o.mdx)("ul",null,(0,o.mdx)("li",{parentName:"ul"},"bit-map ",(0,o.mdx)("inlineCode",{parentName:"li"},"getAllIdsAvailableOnLane()")," filters the currently checked out lane.")),(0,o.mdx)("h3",null,"Remove component from a lane"),(0,o.mdx)("p",null,"Locally, to remove a component from a lane, use ",(0,o.mdx)("inlineCode",{parentName:"p"},"bit remove")," command. It will remove the component from the local lane-object.\nThis change won't affect the remote scope, even after exporting the lane.\nThis is becuase on the remote, the merge-lane process doesn't remove anything, only adds/changes components to the lane object.\nRemember that by default when importing a lane, only the components on the workspace are part of the lane, so the same lane-object, locally can have less components than the remote and obviously in this case we don't want to remove them from the remote on export."),(0,o.mdx)("p",null,"To mark a component as removed on the lane, use ",(0,o.mdx)("inlineCode",{parentName:"p"},"bit remove --delete"),", which will modify the component, mark it as removed, then, on the next snap+export, the remote will be updated.\nOnce a component is marked as removed, it won't be merged during ",(0,o.mdx)("inlineCode",{parentName:"p"},"bit lane merge"),", and won't be imported during ",(0,o.mdx)("inlineCode",{parentName:"p"},"bit lane import"),"."),(0,o.mdx)("h3",null,"Debug issues during merge"),(0,o.mdx)("p",null,"The merge operation performs 3-way merge to minimize the number of conflicts.\nIt searches the common parent of the current-snap and the other-snap. This parent-snap or base-snap is common to these two lanes.\nFor most case, it works as follows:\nIf the base and current has the same data but the other has different data, it means, the other made a change.\nIn which case, no need for conflicts, just bring the data from the other to the local.\nOn the other hand, if the base the other has the same data but the current has different data, then, the current made a change. No need to do anything.\nOnly when the current and the other, both are different, and both are different than the base, there is a conflict."),(0,o.mdx)("p",null,'In case of merging lanes, and it\'s unclear why/how some changes were introduced or marked conflicted, go to the log to find out what is the base-snap and the other-snap.\nThe log message starts with "merging snaps details", and it lists per component-id the base-snap, current-snap and other-snap.\nFrom here, you can investigate the data of each one of the snaps by running ',(0,o.mdx)("inlineCode",{parentName:"p"},"bit cat-object -p <snap>"),".\nTo make this process easier, there are some tools that can help. keep reading."),(0,o.mdx)("h4",null,"source code merges/conflicts"),(0,o.mdx)("p",null,"To find out when a change was introduced to a file or when a file was added/removed, run ",(0,o.mdx)("inlineCode",{parentName:"p"},"bit log-file <file-path>"),".\nIt might be helpful to create a new temporary workspace, import the other lane and run the same there.\nThis way, you get the full picture from both lanes when a change was introduced, and you can see whether it happened before and after the split from the base-snap.\nObviously, ",(0,o.mdx)("inlineCode",{parentName:"p"},"bit log <comp-id> --one-line")," is helpful here to see the distance from each lane from the base-snap."),(0,o.mdx)("h4",null,"dependencies merges/conflicts"),(0,o.mdx)("p",null,"Similar to file-changes, you can run ",(0,o.mdx)("inlineCode",{parentName:"p"},"bit deps blame"),' to understhand when a dependency was introduced/deleted/changed from a component.\nHere again, it\'ll be helpful to import to a new workspace the other lane and run the same there.\nAlso, becuase the dependencies merge is pretty complex, during the merge lots of valuable info is printed to the log.\nHowever, to avoid the extra noise it is not logged as "debug" but as "trace". Before you run the merge, you can add ',(0,o.mdx)("inlineCode",{parentName:"p"},"--log=trace")," to see these messages on the screen.")))}d.isMDXComponent=!0;const p=[t],h=[e],c={compositions:[{displayName:"Logo",identifier:"Logo"}]}})(),a})()));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["teambit.lanes/lanes-preview"]=t():e["teambit.lanes/lanes-preview"]=t()}(self,(()=>(()=>{"use strict";var e={67726:(e,t,n)=>{var a={id:"teambit.lanes/lanes@1.0.190",homepage:"https://bit.cloud/teambit/lanes/lanes",exported:!0};function o(){const e=i(n(41594));return o=function(){return e},e}function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Logo=void 0,o.__bit_component=a,i.__bit_component=a;const r=()=>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/lanes.svg"}));r.__bit_component=a,t.Logo=r},41594:e=>{e.exports=React}},t={};function n(a){var o=t[a];if(void 0!==o)return o.exports;var i=t[a]={exports:{}};return e[a](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return(()=>{n.r(a),n.d(a,{compositions:()=>p,compositions_metadata:()=>c,overview:()=>h});var e={};n.r(e),n.d(e,{default:()=>d});var t=n(67726);n(41594);const o=MdxJsReact,i=TeambitMdxUiMdxScopeContext;var r=["components"];function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},l.apply(this,arguments)}var s={},m="wrapper";function d(e){var t=e.components,n=function(e,t){if(null==e)return{};var n,a,o=function(e,t){if(null==e)return{};var n,a,o={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,r);return(0,o.mdx)(m,l({},s,n,{components:t,mdxType:"MDXLayout"}),(0,o.mdx)(i.MDXScopeProvider,{components:{},mdxType:"MDXScopeProvider"},(0,o.mdx)("p",null,"See more details about these two features here: ",(0,o.mdx)("a",{parentName:"p",href:"https://github.com/teambit/bit/issues/1986"},"Lanes"),". ",(0,o.mdx)("a",{parentName:"p",href:"https://github.com/teambit/bit/issues/1985"},"Snaps"),"."),(0,o.mdx)("p",null,"The following describes the final implementation, which differs from the specification above."),(0,o.mdx)("h2",null,"Synopsis"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre"},"- create a snap: `bit snap` (synopsis similar to the `bit tag`)\n- create a new lane: `bit lane create <name>`\n- list lanes: `bit lane list`\n- switch between lanes: `bit switch <name>`\n- merge lanes: `bit lane merge`\n- show lane details: `bit lane show <name>`\n- diff between lanes: `bit lane diff <values>`\n- track local lane to a remote lane: `bit switch --as`\n- remove a lane: `bit lane remove <name>`.\n- fetch lane objects (without the components): `bit fetch --lanes`\n- import a lane: `bit lane import`\n- export current lane: `bit export`\n- (internal) cat lane object: `bit cat-lane <name>`\n")),(0,o.mdx)("h2",null,"Important points"),(0,o.mdx)("h3",null,"Lane ID"),(0,o.mdx)("p",null,"The Lane id consists of the lane name and the scope. If this is a new lane, the scope is the defaultScope.\nThe ",(0,o.mdx)("inlineCode",{parentName:"p"},"LaneId")," ",(0,o.mdx)("em",{parentName:"p"},"always")," has these two props."),(0,o.mdx)("h3",null,"Performance consideration"),(0,o.mdx)("p",null,"Currently, if it imports with no-deps, it doesn't ask for parents, if it imports with deps it imports with all parents. It is originated from src/api/scope/lib/fetch.ts: ",(0,o.mdx)("inlineCode",{parentName:"p"},"const collectParents = !noDependencies;"),". We need to make a decision here."),(0,o.mdx)("h3",null,"Hash"),(0,o.mdx)("ul",null,(0,o.mdx)("li",{parentName:"ul"},"Snap's hash is generated by a UUID and then converted into sha1. ",(0,o.mdx)("inlineCode",{parentName:"li"},"sha1(v4())"),"."),(0,o.mdx)("li",{parentName:"ul"},"Lane's hash is generated by a UUID and then converted into sha1. ",(0,o.mdx)("inlineCode",{parentName:"li"},"sha1(v4())"),"."),(0,o.mdx)("li",{parentName:"ul"},"Tag's hash stays the same. Generated by the ",(0,o.mdx)("inlineCode",{parentName:"li"},"Version.id()"),"."),(0,o.mdx)("li",{parentName:"ul"},"Lane's hash doesn't get changed even if the lane has been renamed or its scope changed.")),(0,o.mdx)("h3",null,"Lane Data"),(0,o.mdx)("p",null,"Lane data, for the most cases is a map of component-id:snap-head, in other words, it saves per component the head snap. There are 3 different places where we store such data for different purposes."),(0,o.mdx)("ul",null,(0,o.mdx)("li",{parentName:"ul"},(0,o.mdx)("inlineCode",{parentName:"li"},"lane-object"),' "Lane" is saved in the scope ',(0,o.mdx)("inlineCode",{parentName:"li"},".bit/objects")," (.bit can be .git/bit locally), it has a unique hash and contains a map of components and their heads. This object exists on both local and remote scopes. Its main purpose is to sync lane-data between scopes. See ",(0,o.mdx)("inlineCode",{parentName:"li"},"Lane")," class (in scope/model) for the implementation details."),(0,o.mdx)("li",{parentName:"ul"},(0,o.mdx)("inlineCode",{parentName:"li"},"remote-lane")," (component and their heads) is saved in ",(0,o.mdx)("inlineCode",{parentName:"li"},".bit/refs/remote/remote-name/lane-name"),". These refs files are saved in both, local and remote scopes. Its main purpose is to keep track where the remote-heads are per lane. See ",(0,o.mdx)("inlineCode",{parentName:"li"},"RemoteLanes")," class for the implementation details.")),(0,o.mdx)("p",null,"More places that stores lanes related data:"),(0,o.mdx)("ul",null,(0,o.mdx)("li",{parentName:"ul"},"the currently checked out lane is saved in the scope.json file. (e.g. ",(0,o.mdx)("inlineCode",{parentName:"li"},'{ lanes: { current: "lane-a", tracking: "remote/lane-a" } }'),")."),(0,o.mdx)("li",{parentName:"ul"},"When switching to a remote lane, the .bitmap is updated as well with the remote-name, so then, when cloning the project, it's possible to fetch the remote lane data.")),(0,o.mdx)("p",null,"Summary of when/what lanes data is saved per command:"),(0,o.mdx)("ul",null,(0,o.mdx)("li",{parentName:"ul"},(0,o.mdx)("inlineCode",{parentName:"li"},"bit lane create"),": creates a new lane-object and creates a new lane record in scope.json and .bitmap."),(0,o.mdx)("li",{parentName:"ul"},(0,o.mdx)("inlineCode",{parentName:"li"},"bit snap"),": adds an entry to the lane-object."),(0,o.mdx)("li",{parentName:"ul"},(0,o.mdx)("inlineCode",{parentName:"li"},"bit export"),": pushes the lane-object to the remote. On the remote, the lane-object is created or updated/merged."),(0,o.mdx)("li",{parentName:"ul"},(0,o.mdx)("inlineCode",{parentName:"li"},"bit switch --remote"),": 1) creates/updates lane-object in the scope. 2) creates/updates remote-lane. the remote-lane is updated also for main."),(0,o.mdx)("li",{parentName:"ul"},(0,o.mdx)("inlineCode",{parentName:"li"},"bit fetch")," or ",(0,o.mdx)("inlineCode",{parentName:"li"},"bit import --objects"),": creates/updates remote-lane. the remote-lane is updated also for main. It doesn't update/merge the lane object.")),(0,o.mdx)("h3",null,"Merge during import"),(0,o.mdx)("ul",null,(0,o.mdx)("li",{parentName:"ul"},"When the remote is ahead, it's easy, just update the head to the remote-head."),(0,o.mdx)("li",{parentName:"ul"},"When the local and remote have diverged, it's more complex. We need to create a snap-merge that has two parents, one point to the local head and one point to the remote head."),(0,o.mdx)("li",{parentName:"ul"},"On ",(0,o.mdx)("inlineCode",{parentName:"li"},"bit import --objects")," (or ",(0,o.mdx)("inlineCode",{parentName:"li"},"bit fetch"),") we don't merge. The remote head is saved in the .bit/refs/remote dir. Then, ",(0,o.mdx)("inlineCode",{parentName:"li"},"bit status")," shows that these components are merge-pending."),(0,o.mdx)("li",{parentName:"ul"},"On ",(0,o.mdx)("inlineCode",{parentName:"li"},"bit import <id>")," we do the merge."),(0,o.mdx)("li",{parentName:"ul"},"in case the merge wasn't done and the user is trying to export, the remote blocks is as it finds out that its head doesn't exist on the incoming component."),(0,o.mdx)("li",{parentName:"ul"},"in case the snap-merge failed due to a conflict, it saves the conflict and heads data into ",(0,o.mdx)("inlineCode",{parentName:"li"},".bit/unmerged.json")," file.")),(0,o.mdx)("h3",null,"Merge components"),(0,o.mdx)("ul",null,(0,o.mdx)("li",{parentName:"ul"},"to merge an entire lane, use ",(0,o.mdx)("inlineCode",{parentName:"li"},"bit lane merge"),"."),(0,o.mdx)("li",{parentName:"ul"},"to get updates from a remote lane, run ",(0,o.mdx)("inlineCode",{parentName:"li"},"bit import"),", and then ",(0,o.mdx)("inlineCode",{parentName:"li"},"bit checkout head"),". alternatively, run ",(0,o.mdx)("inlineCode",{parentName:"li"},"bit merge <component-id>")," in one command."),(0,o.mdx)("li",{parentName:"ul"},"to merge an individual component from a lane to main, run ",(0,o.mdx)("inlineCode",{parentName:"li"},"bit lane merge <lane> --pattern <component-id>")," when on main.")),(0,o.mdx)("h3",null,"Useful APIs"),(0,o.mdx)("ul",null,(0,o.mdx)("li",{parentName:"ul"},"bit-map ",(0,o.mdx)("inlineCode",{parentName:"li"},"getAllIdsAvailableOnLane()")," filters the currently checked out lane.")),(0,o.mdx)("h3",null,"Remove component from a lane"),(0,o.mdx)("p",null,"Locally, to remove a component from a lane, use ",(0,o.mdx)("inlineCode",{parentName:"p"},"bit remove")," command. It will remove the component from the local lane-object.\nThis change won't affect the remote scope, even after exporting the lane.\nThis is becuase on the remote, the merge-lane process doesn't remove anything, only adds/changes components to the lane object.\nRemember that by default when importing a lane, only the components on the workspace are part of the lane, so the same lane-object, locally can have less components than the remote and obviously in this case we don't want to remove them from the remote on export."),(0,o.mdx)("p",null,"To mark a component as removed on the lane, use ",(0,o.mdx)("inlineCode",{parentName:"p"},"bit remove --delete"),", which will modify the component, mark it as removed, then, on the next snap+export, the remote will be updated.\nOnce a component is marked as removed, it won't be merged during ",(0,o.mdx)("inlineCode",{parentName:"p"},"bit lane merge"),", and won't be imported during ",(0,o.mdx)("inlineCode",{parentName:"p"},"bit lane import"),"."),(0,o.mdx)("h3",null,"Debug issues during merge"),(0,o.mdx)("p",null,"The merge operation performs 3-way merge to minimize the number of conflicts.\nIt searches the common parent of the current-snap and the other-snap. This parent-snap or base-snap is common to these two lanes.\nFor most case, it works as follows:\nIf the base and current has the same data but the other has different data, it means, the other made a change.\nIn which case, no need for conflicts, just bring the data from the other to the local.\nOn the other hand, if the base the other has the same data but the current has different data, then, the current made a change. No need to do anything.\nOnly when the current and the other, both are different, and both are different than the base, there is a conflict."),(0,o.mdx)("p",null,'In case of merging lanes, and it\'s unclear why/how some changes were introduced or marked conflicted, go to the log to find out what is the base-snap and the other-snap.\nThe log message starts with "merging snaps details", and it lists per component-id the base-snap, current-snap and other-snap.\nFrom here, you can investigate the data of each one of the snaps by running ',(0,o.mdx)("inlineCode",{parentName:"p"},"bit cat-object -p <snap>"),".\nTo make this process easier, there are some tools that can help. keep reading."),(0,o.mdx)("h4",null,"source code merges/conflicts"),(0,o.mdx)("p",null,"To find out when a change was introduced to a file or when a file was added/removed, run ",(0,o.mdx)("inlineCode",{parentName:"p"},"bit log-file <file-path>"),".\nIt might be helpful to create a new temporary workspace, import the other lane and run the same there.\nThis way, you get the full picture from both lanes when a change was introduced, and you can see whether it happened before and after the split from the base-snap.\nObviously, ",(0,o.mdx)("inlineCode",{parentName:"p"},"bit log <comp-id> --one-line")," is helpful here to see the distance from each lane from the base-snap."),(0,o.mdx)("h4",null,"dependencies merges/conflicts"),(0,o.mdx)("p",null,"Similar to file-changes, you can run ",(0,o.mdx)("inlineCode",{parentName:"p"},"bit deps blame"),' to understhand when a dependency was introduced/deleted/changed from a component.\nHere again, it\'ll be helpful to import to a new workspace the other lane and run the same there.\nAlso, becuase the dependencies merge is pretty complex, during the merge lots of valuable info is printed to the log.\nHowever, to avoid the extra noise it is not logged as "debug" but as "trace". Before you run the merge, you can add ',(0,o.mdx)("inlineCode",{parentName:"p"},"--log=trace")," to see these messages on the screen.")))}d.isMDXComponent=!0;const p=[t],h=[e],c={compositions:[{displayName:"Logo",identifier:"Logo"}]}})(),a})()));
@@ -3895,7 +3895,7 @@
3895
3895
  "componentId": {
3896
3896
  "scope": "teambit.lanes",
3897
3897
  "name": "ui/models/lanes-model",
3898
- "version": "0.0.215"
3898
+ "version": "0.0.216"
3899
3899
  }
3900
3900
  },
3901
3901
  {
@@ -3909,7 +3909,7 @@
3909
3909
  "componentId": {
3910
3910
  "scope": "teambit.lanes",
3911
3911
  "name": "ui/models/lanes-model",
3912
- "version": "0.0.215"
3912
+ "version": "0.0.216"
3913
3913
  }
3914
3914
  },
3915
3915
  {
@@ -4062,7 +4062,7 @@
4062
4062
  "componentId": {
4063
4063
  "scope": "teambit.ui-foundation",
4064
4064
  "name": "ui/react-router/slot-router",
4065
- "version": "0.0.507"
4065
+ "version": "0.0.508"
4066
4066
  }
4067
4067
  },
4068
4068
  "isOptional": false,
@@ -4137,7 +4137,7 @@
4137
4137
  "componentId": {
4138
4138
  "scope": "teambit.lanes",
4139
4139
  "name": "ui/lane-overview",
4140
- "version": "0.0.224"
4140
+ "version": "0.0.225"
4141
4141
  }
4142
4142
  },
4143
4143
  "isOptional": false,
@@ -4786,7 +4786,7 @@
4786
4786
  "componentId": {
4787
4787
  "scope": "teambit.lanes",
4788
4788
  "name": "hooks/use-lanes",
4789
- "version": "0.0.263"
4789
+ "version": "0.0.264"
4790
4790
  }
4791
4791
  },
4792
4792
  "isOptional": false,
@@ -4956,7 +4956,7 @@
4956
4956
  "componentId": {
4957
4957
  "scope": "teambit.lanes",
4958
4958
  "name": "ui/lane-overview",
4959
- "version": "0.0.224"
4959
+ "version": "0.0.225"
4960
4960
  }
4961
4961
  }
4962
4962
  },
@@ -5194,7 +5194,7 @@
5194
5194
  "componentId": {
5195
5195
  "scope": "teambit.ui-foundation",
5196
5196
  "name": "ui/react-router/slot-router",
5197
- "version": "0.0.507"
5197
+ "version": "0.0.508"
5198
5198
  }
5199
5199
  },
5200
5200
  {
@@ -5208,7 +5208,7 @@
5208
5208
  "componentId": {
5209
5209
  "scope": "teambit.lanes",
5210
5210
  "name": "ui/lane-overview",
5211
- "version": "0.0.224"
5211
+ "version": "0.0.225"
5212
5212
  }
5213
5213
  },
5214
5214
  {
@@ -5361,7 +5361,7 @@
5361
5361
  "componentId": {
5362
5362
  "scope": "teambit.lanes",
5363
5363
  "name": "hooks/use-lanes",
5364
- "version": "0.0.263"
5364
+ "version": "0.0.264"
5365
5365
  }
5366
5366
  }
5367
5367
  ]
@@ -10257,7 +10257,7 @@
10257
10257
  "componentId": {
10258
10258
  "scope": "teambit.lanes",
10259
10259
  "name": "hooks/use-lanes",
10260
- "version": "0.0.263"
10260
+ "version": "0.0.264"
10261
10261
  }
10262
10262
  }
10263
10263
  ]
@@ -10514,7 +10514,7 @@
10514
10514
  "componentId": {
10515
10515
  "scope": "teambit.ui-foundation",
10516
10516
  "name": "ui/react-router/slot-router",
10517
- "version": "0.0.507"
10517
+ "version": "0.0.508"
10518
10518
  }
10519
10519
  },
10520
10520
  "isOptional": false,
@@ -10589,7 +10589,7 @@
10589
10589
  "componentId": {
10590
10590
  "scope": "teambit.lanes",
10591
10591
  "name": "ui/lane-overview",
10592
- "version": "0.0.224"
10592
+ "version": "0.0.225"
10593
10593
  }
10594
10594
  },
10595
10595
  "isOptional": false,
@@ -11238,7 +11238,7 @@
11238
11238
  "componentId": {
11239
11239
  "scope": "teambit.lanes",
11240
11240
  "name": "hooks/use-lanes",
11241
- "version": "0.0.263"
11241
+ "version": "0.0.264"
11242
11242
  }
11243
11243
  },
11244
11244
  "isOptional": false,
@@ -11408,7 +11408,7 @@
11408
11408
  "componentId": {
11409
11409
  "scope": "teambit.lanes",
11410
11410
  "name": "ui/lane-overview",
11411
- "version": "0.0.224"
11411
+ "version": "0.0.225"
11412
11412
  }
11413
11413
  }
11414
11414
  },
@@ -11646,7 +11646,7 @@
11646
11646
  "componentId": {
11647
11647
  "scope": "teambit.ui-foundation",
11648
11648
  "name": "ui/react-router/slot-router",
11649
- "version": "0.0.507"
11649
+ "version": "0.0.508"
11650
11650
  }
11651
11651
  },
11652
11652
  {
@@ -11660,7 +11660,7 @@
11660
11660
  "componentId": {
11661
11661
  "scope": "teambit.lanes",
11662
11662
  "name": "ui/lane-overview",
11663
- "version": "0.0.224"
11663
+ "version": "0.0.225"
11664
11664
  }
11665
11665
  },
11666
11666
  {
@@ -11824,7 +11824,7 @@
11824
11824
  "componentId": {
11825
11825
  "scope": "teambit.lanes",
11826
11826
  "name": "lanes",
11827
- "version": "1.0.189"
11827
+ "version": "1.0.190"
11828
11828
  },
11829
11829
  "taggedModuleExports": []
11830
11830
  }
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/Users/giladshoham/Library/Caches/Bit/capsules/root/b5ea46ec36fa42b9dbedfc12ecb7bb63e03fcfe6/teambit.lanes_lanes@1.0.189/dist/lanes.composition.js';
2
- import * as overview_0 from '/Users/giladshoham/Library/Caches/Bit/capsules/root/b5ea46ec36fa42b9dbedfc12ecb7bb63e03fcfe6/teambit.lanes_lanes@1.0.189/dist/lanes.docs.mdx';
1
+ import * as compositions_0 from '/Users/giladshoham/Library/Caches/Bit/capsules/root/b5ea46ec36fa42b9dbedfc12ecb7bb63e03fcfe6/teambit.lanes_lanes@1.0.190/dist/lanes.composition.js';
2
+ import * as overview_0 from '/Users/giladshoham/Library/Caches/Bit/capsules/root/b5ea46ec36fa42b9dbedfc12ecb7bb63e03fcfe6/teambit.lanes_lanes@1.0.190/dist/lanes.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/lanes",
3
- "version": "1.0.189",
3
+ "version": "1.0.190",
4
4
  "homepage": "https://bit.cloud/teambit/lanes/lanes",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.lanes",
8
8
  "name": "lanes",
9
- "version": "1.0.189"
9
+ "version": "1.0.190"
10
10
  },
11
11
  "dependencies": {
12
12
  "lodash": "4.17.21",
@@ -27,32 +27,32 @@
27
27
  "@teambit/scope.ui.scope-icon": "0.0.91",
28
28
  "@teambit/ui-foundation.ui.menu": "0.0.502",
29
29
  "@teambit/ui-foundation.ui.react-router.use-query": "0.0.501",
30
- "@teambit/scope": "1.0.189",
31
- "@teambit/workspace": "1.0.189",
32
- "@teambit/lanes.ui.models.lanes-model": "0.0.215",
33
- "@teambit/checkout": "1.0.189",
34
- "@teambit/cli": "0.0.856",
35
- "@teambit/express": "0.0.955",
36
- "@teambit/logger": "0.0.949",
37
- "@teambit/graphql": "1.0.189",
38
- "@teambit/component-compare": "1.0.189",
39
- "@teambit/component-writer": "1.0.189",
40
- "@teambit/component": "1.0.189",
41
- "@teambit/export": "1.0.189",
42
- "@teambit/importer": "1.0.189",
30
+ "@teambit/scope": "1.0.190",
31
+ "@teambit/workspace": "1.0.190",
32
+ "@teambit/lanes.ui.models.lanes-model": "0.0.216",
33
+ "@teambit/checkout": "1.0.190",
34
+ "@teambit/cli": "0.0.857",
35
+ "@teambit/express": "0.0.956",
36
+ "@teambit/logger": "0.0.950",
37
+ "@teambit/graphql": "1.0.190",
38
+ "@teambit/component-compare": "1.0.190",
39
+ "@teambit/component-writer": "1.0.190",
40
+ "@teambit/component": "1.0.190",
41
+ "@teambit/export": "1.0.190",
42
+ "@teambit/importer": "1.0.190",
43
43
  "@teambit/lanes.modules.diff": "0.0.443",
44
- "@teambit/merging": "1.0.189",
45
- "@teambit/remove": "1.0.189",
44
+ "@teambit/merging": "1.0.190",
45
+ "@teambit/remove": "1.0.190",
46
46
  "@teambit/lanes.entities.lane-diff": "0.0.166",
47
- "@teambit/lanes.hooks.use-lanes": "0.0.263",
48
- "@teambit/lanes.hooks.use-viewed-lane-from-url": "0.0.222",
49
- "@teambit/lanes.ui.compare.lane-compare-page": "0.0.158",
50
- "@teambit/lanes.ui.compare.lane-compare": "0.0.178",
51
- "@teambit/lanes.ui.lane-overview": "0.0.224",
52
- "@teambit/lanes.ui.menus.use-lanes-menu": "0.0.214",
53
- "@teambit/lanes.ui.navigation.lane-switcher": "0.0.221",
54
- "@teambit/ui-foundation.ui.react-router.slot-router": "0.0.507",
55
- "@teambit/ui": "1.0.189"
47
+ "@teambit/lanes.hooks.use-lanes": "0.0.264",
48
+ "@teambit/lanes.hooks.use-viewed-lane-from-url": "0.0.223",
49
+ "@teambit/lanes.ui.compare.lane-compare-page": "0.0.159",
50
+ "@teambit/lanes.ui.compare.lane-compare": "0.0.179",
51
+ "@teambit/lanes.ui.lane-overview": "0.0.225",
52
+ "@teambit/lanes.ui.menus.use-lanes-menu": "0.0.215",
53
+ "@teambit/lanes.ui.navigation.lane-switcher": "0.0.222",
54
+ "@teambit/ui-foundation.ui.react-router.slot-router": "0.0.508",
55
+ "@teambit/ui": "1.0.190"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@types/lodash": "4.14.165",
@@ -64,7 +64,7 @@
64
64
  "@teambit/harmony.envs.core-aspect-env": "0.0.27",
65
65
  "@teambit/component.testing.mock-components": "0.0.193",
66
66
  "@teambit/harmony.testing.load-aspect": "0.0.188",
67
- "@teambit/snapping": "1.0.189",
67
+ "@teambit/snapping": "1.0.190",
68
68
  "@teambit/workspace.testing.mock-workspace": "0.0.27"
69
69
  },
70
70
  "peerDependencies": {