@teambit/lanes 1.0.128 → 1.0.130

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,13 +1,13 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <testsuites>
3
- <testsuite name="teambit.lanes/lanes@1.0.128" timestamp="2024-01-08T03:40:49.766Z" tests="8" failures="0" errors="0" skipped="0">
4
- <testcase classname="lanes.spec.js" name="should list all lanes" time="0.147"/>
5
- <testcase classname="lanes.spec.js" name="should return that the lane is up to date when the lane is ahead of main" time="0.297"/>
6
- <testcase classname="lanes.spec.js" name="should return that the lane is not up to date when main is ahead" time="0.256"/>
7
- <testcase classname="lanes.spec.js" name="should return that the lane is up to date when the lane is ahead of main" time="0.134"/>
8
- <testcase classname="lanes.spec.js" name="should return that the lane is not up to date when main is ahead" time="0.09"/>
3
+ <testsuite name="teambit.lanes/lanes@1.0.130" timestamp="2024-01-09T16:36:26.305Z" tests="8" failures="0" errors="0" skipped="0">
4
+ <testcase classname="lanes.spec.js" name="should list all lanes" time="0.15"/>
5
+ <testcase classname="lanes.spec.js" name="should return that the lane is up to date when the lane is ahead of main" time="0.293"/>
6
+ <testcase classname="lanes.spec.js" name="should return that the lane is not up to date when main is ahead" time="0.31"/>
7
+ <testcase classname="lanes.spec.js" name="should return that the lane is up to date when the lane is ahead of main" time="0.156"/>
8
+ <testcase classname="lanes.spec.js" name="should return that the lane is not up to date when main is ahead" time="0.087"/>
9
9
  <testcase classname="lanes.spec.js" name="should restore the deleted lane" time="0.001"/>
10
- <testcase classname="lanes.spec.js" name="should not throw" time="0.001"/>
10
+ <testcase classname="lanes.spec.js" name="should not throw"/>
11
11
  <testcase classname="lanes.spec.js" name="should throw when restoring the lane" time="0.002"/>
12
12
  </testsuite>
13
13
  </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={75678:(e,t,n)=>{var a={id:"teambit.lanes/lanes@1.0.128",homepage:"https://bit.cloud/teambit/lanes/lanes",exported:!0};function o(){const e=i(n(87363));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},87363: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(75678);n(87363);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={5199:(e,t,n)=>{var a={id:"teambit.lanes/lanes@1.0.130",homepage:"https://bit.cloud/teambit/lanes/lanes",exported:!0};function o(){const e=i(n(87363));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},87363: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(5199);n(87363);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})()));
@@ -28,13 +28,6 @@ function _componentVersion() {
28
28
  };
29
29
  return data;
30
30
  }
31
- function _snapping() {
32
- const data = require("@teambit/snapping");
33
- _snapping = function () {
34
- return data;
35
- };
36
- return data;
37
- }
38
31
  function _componentsList() {
39
32
  const data = _interopRequireDefault(require("@teambit/legacy/dist/consumer/component/components-list"));
40
33
  _componentsList = function () {
@@ -56,6 +49,13 @@ function _lodash() {
56
49
  };
57
50
  return data;
58
51
  }
52
+ function _getCloudUser() {
53
+ const data = require("@teambit/legacy/dist/utils/bit/get-cloud-user");
54
+ _getCloudUser = function () {
55
+ return data;
56
+ };
57
+ return data;
58
+ }
59
59
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
60
60
  // import { ComponentIdList } from '@teambit/component-id';
61
61
 
@@ -66,7 +66,7 @@ async function createLane(workspace, laneName, scopeName, remoteLane) {
66
66
  if (lanes.find(lane => lane.name === laneName)) {
67
67
  throw new (_bitError().BitError)(`lane "${laneName}" already exists, to switch to this lane, please use "bit switch" command`);
68
68
  }
69
- const bitCloudUser = await (0, _snapping().getBitCloudUser)();
69
+ const bitCloudUser = await (0, _getCloudUser().getBitCloudUser)();
70
70
  throwForInvalidLaneName(laneName);
71
71
  await throwForStagedComponents(consumer);
72
72
  const getDataToPopulateLaneObjectIfNeeded = async () => {
@@ -108,7 +108,10 @@ async function createLane(workspace, laneName, scopeName, remoteLane) {
108
108
  }) : _lane().default.create(laneName, scopeName, forkedFrom, bitCloudUser);
109
109
  const dataToPopulate = await getDataToPopulateLaneObjectIfNeeded();
110
110
  newLane.setLaneComponents(dataToPopulate);
111
- await consumer.scope.lanes.saveLane(newLane);
111
+ const laneHistoryMsg = remoteLane ? `fork lane "${remoteLane.name}"` : 'new lane';
112
+ await consumer.scope.lanes.saveLane(newLane, {
113
+ laneHistoryMsg
114
+ });
112
115
  return newLane;
113
116
  }
114
117
  async function createLaneInScope(laneName, scope) {
@@ -118,7 +121,9 @@ async function createLaneInScope(laneName, scope) {
118
121
  }
119
122
  throwForInvalidLaneName(laneName);
120
123
  const newLane = _lane().default.create(laneName, scope.name);
121
- await scope.legacyScope.lanes.saveLane(newLane);
124
+ await scope.legacyScope.lanes.saveLane(newLane, {
125
+ laneHistoryMsg: 'new lane (created from scope)'
126
+ });
122
127
  return newLane;
123
128
  }
124
129
  async function getLaneOrigin(consumer) {
@@ -1 +1 @@
1
- {"version":3,"names":["_bitError","data","require","_lane","_interopRequireDefault","_componentVersion","_snapping","_componentsList","_objects","_lodash","obj","__esModule","default","MAX_LANE_NAME_LENGTH","createLane","workspace","laneName","scopeName","remoteLane","consumer","lanes","scope","listLanes","find","lane","name","BitError","bitCloudUser","getBitCloudUser","throwForInvalidLaneName","throwForStagedComponents","getDataToPopulateLaneObjectIfNeeded","components","currentLaneObject","getCurrentLaneObject","laneComponents","workspaceIds","bitMap","getAllBitIds","laneComponentWithBitmapHead","Promise","all","map","id","head","compId","resolveComponentId","changeVersion","toString","isRemoved","isComponentRemoved","bitmapHead","searchWithoutVersion","isSnap","version","Ref","from","compact","forkedFrom","getLaneOrigin","newLane","Lane","hash","log","create","dataToPopulate","setLaneComponents","saveLane","createLaneInScope","legacyScope","currentLaneId","laneId","undefined","isLaneExported","currentLane","isValidLaneName","componentList","ComponentsList","stagedComponents","listExportPendingComponentsIds","length","join","val","test"],"sources":["create-lane.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\nimport { LaneId } from '@teambit/lane-id';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport { ScopeMain } from '@teambit/scope';\n// import { ComponentIdList } from '@teambit/component-id';\nimport Lane, { LaneComponent } from '@teambit/legacy/dist/scope/models/lane';\nimport { isSnap } from '@teambit/component-version';\nimport { getBitCloudUser } from '@teambit/snapping';\nimport ComponentsList from '@teambit/legacy/dist/consumer/component/components-list';\nimport { Ref } from '@teambit/legacy/dist/scope/objects';\nimport { Workspace } from '@teambit/workspace';\nimport { compact } from 'lodash';\n\nconst MAX_LANE_NAME_LENGTH = 800;\n\nexport async function createLane(\n workspace: Workspace,\n laneName: string,\n scopeName: string,\n remoteLane?: Lane\n): Promise<Lane> {\n const consumer = workspace.consumer;\n const lanes = await consumer.scope.listLanes();\n if (lanes.find((lane) => lane.name === laneName)) {\n throw new BitError(`lane \"${laneName}\" already exists, to switch to this lane, please use \"bit switch\" command`);\n }\n const bitCloudUser = await getBitCloudUser();\n throwForInvalidLaneName(laneName);\n await throwForStagedComponents(consumer);\n const getDataToPopulateLaneObjectIfNeeded = async (): Promise<LaneComponent[]> => {\n if (remoteLane) return remoteLane.components;\n // when branching from one lane to another, copy components from the origin lane\n // when branching from main, no need to copy anything\n const currentLaneObject = await consumer.getCurrentLaneObject();\n if (!currentLaneObject) return [];\n const laneComponents = currentLaneObject.components;\n const workspaceIds = consumer.bitMap.getAllBitIds();\n const laneComponentWithBitmapHead = await Promise.all(\n laneComponents.map(async ({ id, head }) => {\n const compId = await workspace.resolveComponentId(id.changeVersion(head.toString()));\n const isRemoved = await workspace.scope.isComponentRemoved(compId);\n if (isRemoved) return null;\n const bitmapHead = workspaceIds.searchWithoutVersion(id);\n if (bitmapHead && isSnap(bitmapHead.version)) {\n return { id, head: Ref.from(bitmapHead.version as string) };\n }\n return { id, head };\n })\n );\n return compact(laneComponentWithBitmapHead);\n };\n\n const forkedFrom = await getLaneOrigin(consumer);\n const newLane = remoteLane\n ? Lane.from({\n name: laneName,\n hash: remoteLane.hash().toString(),\n log: remoteLane.log,\n scope: remoteLane.scope,\n forkedFrom,\n })\n : Lane.create(laneName, scopeName, forkedFrom, bitCloudUser);\n const dataToPopulate = await getDataToPopulateLaneObjectIfNeeded();\n newLane.setLaneComponents(dataToPopulate);\n\n await consumer.scope.lanes.saveLane(newLane);\n\n return newLane;\n}\n\nexport async function createLaneInScope(laneName: string, scope: ScopeMain): Promise<Lane> {\n const lanes = await scope.legacyScope.listLanes();\n if (lanes.find((lane) => lane.name === laneName)) {\n throw new BitError(`lane \"${laneName}\" already exists`);\n }\n throwForInvalidLaneName(laneName);\n const newLane = Lane.create(laneName, scope.name);\n await scope.legacyScope.lanes.saveLane(newLane);\n return newLane;\n}\n\nasync function getLaneOrigin(consumer: Consumer): Promise<LaneId | undefined> {\n const currentLaneId = consumer.bitMap.laneId;\n if (!currentLaneId) return undefined;\n if (consumer.bitMap.isLaneExported) {\n return currentLaneId;\n }\n // current lane is new.\n const currentLane = await consumer.getCurrentLaneObject();\n return currentLane?.forkedFrom;\n}\n\nexport function throwForInvalidLaneName(laneName: string) {\n if (!isValidLaneName(laneName)) {\n throw new BitError(\n `lane \"${laneName}\" has invalid characters. lane name can only contain alphanumeric, lowercase characters, and the following [\"-\", \"_\", \"$\", \"!\"]`\n );\n }\n}\n\nexport async function throwForStagedComponents(consumer: Consumer) {\n const componentList = new ComponentsList(consumer);\n const stagedComponents = await componentList.listExportPendingComponentsIds();\n if (stagedComponents.length) {\n throw new BitError(\n `unable to switch/create a new lane, please export or reset the following components first: ${stagedComponents.join(\n ', '\n )}`\n );\n }\n}\n\nfunction isValidLaneName(val: unknown): boolean {\n if (typeof val !== 'string') return false;\n if (val.length > MAX_LANE_NAME_LENGTH) return false;\n // @todo: should we allow slash? if so, we should probably replace the lane-delimiter with something else. (maybe \":\")\n return /^[$\\-_!a-z0-9]+$/.test(val);\n}\n"],"mappings":";;;;;;;;;AAAA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAKA,SAAAE,MAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,KAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA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EAC5C,IAAI,CAACD,aAAa,EAAE,OAAOE,SAAS;EACpC,IAAIrD,QAAQ,CAACkB,MAAM,CAACoC,cAAc,EAAE;IAClC,OAAOH,aAAa;EACtB;EACA;EACA,MAAMI,WAAW,GAAG,MAAMvD,QAAQ,CAACe,oBAAoB,CAAC,CAAC;EACzD,OAAOwC,WAAW,EAAEhB,UAAU;AAChC;AAEO,SAAS7B,uBAAuBA,CAACb,QAAgB,EAAE;EACxD,IAAI,CAAC2D,eAAe,CAAC3D,QAAQ,CAAC,EAAE;IAC9B,MAAM,KAAIU,oBAAQ,EACf,SAAQV,QAAS,iIACpB,CAAC;EACH;AACF;AAEO,eAAec,wBAAwBA,CAACX,QAAkB,EAAE;EACjE,MAAMyD,aAAa,GAAG,KAAIC,yBAAc,EAAC1D,QAAQ,CAAC;EAClD,MAAM2D,gBAAgB,GAAG,MAAMF,aAAa,CAACG,8BAA8B,CAAC,CAAC;EAC7E,IAAID,gBAAgB,CAACE,MAAM,EAAE;IAC3B,MAAM,KAAItD,oBAAQ,EACf,8FAA6FoD,gBAAgB,CAACG,IAAI,CACjH,IACF,CAAE,EACJ,CAAC;EACH;AACF;AAEA,SAASN,eAAeA,CAACO,GAAY,EAAW;EAC9C,IAAI,OAAOA,GAAG,KAAK,QAAQ,EAAE,OAAO,KAAK;EACzC,IAAIA,GAAG,CAACF,MAAM,GAAGnE,oBAAoB,EAAE,OAAO,KAAK;EACnD;EACA,OAAO,kBAAkB,CAACsE,IAAI,CAACD,GAAG,CAAC;AACrC"}
1
+ {"version":3,"names":["_bitError","data","require","_lane","_interopRequireDefault","_componentVersion","_componentsList","_objects","_lodash","_getCloudUser","obj","__esModule","default","MAX_LANE_NAME_LENGTH","createLane","workspace","laneName","scopeName","remoteLane","consumer","lanes","scope","listLanes","find","lane","name","BitError","bitCloudUser","getBitCloudUser","throwForInvalidLaneName","throwForStagedComponents","getDataToPopulateLaneObjectIfNeeded","components","currentLaneObject","getCurrentLaneObject","laneComponents","workspaceIds","bitMap","getAllBitIds","laneComponentWithBitmapHead","Promise","all","map","id","head","compId","resolveComponentId","changeVersion","toString","isRemoved","isComponentRemoved","bitmapHead","searchWithoutVersion","isSnap","version","Ref","from","compact","forkedFrom","getLaneOrigin","newLane","Lane","hash","log","create","dataToPopulate","setLaneComponents","laneHistoryMsg","saveLane","createLaneInScope","legacyScope","currentLaneId","laneId","undefined","isLaneExported","currentLane","isValidLaneName","componentList","ComponentsList","stagedComponents","listExportPendingComponentsIds","length","join","val","test"],"sources":["create-lane.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\nimport { LaneId } from '@teambit/lane-id';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport { ScopeMain } from '@teambit/scope';\n// import { ComponentIdList } from '@teambit/component-id';\nimport Lane, { LaneComponent } from '@teambit/legacy/dist/scope/models/lane';\nimport { isSnap } from '@teambit/component-version';\nimport ComponentsList from '@teambit/legacy/dist/consumer/component/components-list';\nimport { Ref } from '@teambit/legacy/dist/scope/objects';\nimport { Workspace } from '@teambit/workspace';\nimport { compact } from 'lodash';\nimport { getBitCloudUser } from '@teambit/legacy/dist/utils/bit/get-cloud-user';\n\nconst MAX_LANE_NAME_LENGTH = 800;\n\nexport async function createLane(\n workspace: Workspace,\n laneName: string,\n scopeName: string,\n remoteLane?: Lane\n): Promise<Lane> {\n const consumer = workspace.consumer;\n const lanes = await consumer.scope.listLanes();\n if (lanes.find((lane) => lane.name === laneName)) {\n throw new BitError(`lane \"${laneName}\" already exists, to switch to this lane, please use \"bit switch\" command`);\n }\n const bitCloudUser = await getBitCloudUser();\n throwForInvalidLaneName(laneName);\n await throwForStagedComponents(consumer);\n const getDataToPopulateLaneObjectIfNeeded = async (): Promise<LaneComponent[]> => {\n if (remoteLane) return remoteLane.components;\n // when branching from one lane to another, copy components from the origin lane\n // when branching from main, no need to copy anything\n const currentLaneObject = await consumer.getCurrentLaneObject();\n if (!currentLaneObject) return [];\n const laneComponents = currentLaneObject.components;\n const workspaceIds = consumer.bitMap.getAllBitIds();\n const laneComponentWithBitmapHead = await Promise.all(\n laneComponents.map(async ({ id, head }) => {\n const compId = await workspace.resolveComponentId(id.changeVersion(head.toString()));\n const isRemoved = await workspace.scope.isComponentRemoved(compId);\n if (isRemoved) return null;\n const bitmapHead = workspaceIds.searchWithoutVersion(id);\n if (bitmapHead && isSnap(bitmapHead.version)) {\n return { id, head: Ref.from(bitmapHead.version as string) };\n }\n return { id, head };\n })\n );\n return compact(laneComponentWithBitmapHead);\n };\n\n const forkedFrom = await getLaneOrigin(consumer);\n const newLane = remoteLane\n ? Lane.from({\n name: laneName,\n hash: remoteLane.hash().toString(),\n log: remoteLane.log,\n scope: remoteLane.scope,\n forkedFrom,\n })\n : Lane.create(laneName, scopeName, forkedFrom, bitCloudUser);\n const dataToPopulate = await getDataToPopulateLaneObjectIfNeeded();\n newLane.setLaneComponents(dataToPopulate);\n\n const laneHistoryMsg = remoteLane ? `fork lane \"${remoteLane.name}\"` : 'new lane';\n await consumer.scope.lanes.saveLane(newLane, { laneHistoryMsg });\n\n return newLane;\n}\n\nexport async function createLaneInScope(laneName: string, scope: ScopeMain): Promise<Lane> {\n const lanes = await scope.legacyScope.listLanes();\n if (lanes.find((lane) => lane.name === laneName)) {\n throw new BitError(`lane \"${laneName}\" already exists`);\n }\n throwForInvalidLaneName(laneName);\n const newLane = Lane.create(laneName, scope.name);\n await scope.legacyScope.lanes.saveLane(newLane, { laneHistoryMsg: 'new lane (created from scope)' });\n return newLane;\n}\n\nasync function getLaneOrigin(consumer: Consumer): Promise<LaneId | undefined> {\n const currentLaneId = consumer.bitMap.laneId;\n if (!currentLaneId) return undefined;\n if (consumer.bitMap.isLaneExported) {\n return currentLaneId;\n }\n // current lane is new.\n const currentLane = await consumer.getCurrentLaneObject();\n return currentLane?.forkedFrom;\n}\n\nexport function throwForInvalidLaneName(laneName: string) {\n if (!isValidLaneName(laneName)) {\n throw new BitError(\n `lane \"${laneName}\" has invalid characters. lane name can only contain alphanumeric, lowercase characters, and the following [\"-\", \"_\", \"$\", \"!\"]`\n );\n }\n}\n\nexport async function throwForStagedComponents(consumer: Consumer) {\n const componentList = new ComponentsList(consumer);\n const stagedComponents = await componentList.listExportPendingComponentsIds();\n if (stagedComponents.length) {\n throw new BitError(\n `unable to switch/create a new lane, please export or reset the following components first: ${stagedComponents.join(\n ', '\n )}`\n );\n }\n}\n\nfunction isValidLaneName(val: unknown): boolean {\n if (typeof val !== 'string') return false;\n if (val.length > MAX_LANE_NAME_LENGTH) return false;\n // @todo: should we allow slash? if so, we should probably replace the lane-delimiter with something else. (maybe \":\")\n return /^[$\\-_!a-z0-9]+$/.test(val);\n}\n"],"mappings":";;;;;;;;;AAAA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAKA,SAAAE,MAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,KAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,kBAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,iBAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,gBAAA;EAAA,MAAAL,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAI,eAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,SAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,QAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAO,QAAA;EAAA,MAAAP,IAAA,GAAAC,OAAA;EAAAM,OAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAC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AACF;AAEO,eAAec,wBAAwBA,CAACX,QAAkB,EAAE;EACjE,MAAM0D,aAAa,GAAG,KAAIC,yBAAc,EAAC3D,QAAQ,CAAC;EAClD,MAAM4D,gBAAgB,GAAG,MAAMF,aAAa,CAACG,8BAA8B,CAAC,CAAC;EAC7E,IAAID,gBAAgB,CAACE,MAAM,EAAE;IAC3B,MAAM,KAAIvD,oBAAQ,EACf,8FAA6FqD,gBAAgB,CAACG,IAAI,CACjH,IACF,CAAE,EACJ,CAAC;EACH;AACF;AAEA,SAASN,eAAeA,CAACO,GAAY,EAAW;EAC9C,IAAI,OAAOA,GAAG,KAAK,QAAQ,EAAE,OAAO,KAAK;EACzC,IAAIA,GAAG,CAACF,MAAM,GAAGpE,oBAAoB,EAAE,OAAO,KAAK;EACnD;EACA,OAAO,kBAAkB,CAACuE,IAAI,CAACD,GAAG,CAAC;AACrC"}
@@ -104,6 +104,27 @@ export declare class LaneAliasCmd implements Command {
104
104
  constructor(lanes: LanesMain);
105
105
  report([laneName, alias]: [string, string, string]): Promise<string>;
106
106
  }
107
+ export declare class CatLaneHistoryCmd implements Command {
108
+ private lanes;
109
+ name: string;
110
+ description: string;
111
+ private: boolean;
112
+ alias: string;
113
+ options: CommandOptions;
114
+ loader: boolean;
115
+ constructor(lanes: LanesMain);
116
+ report([laneName]: [string]): Promise<string>;
117
+ }
118
+ export declare class LaneHistoryCmd implements Command {
119
+ private lanes;
120
+ name: string;
121
+ description: string;
122
+ alias: string;
123
+ options: CommandOptions;
124
+ loader: boolean;
125
+ constructor(lanes: LanesMain);
126
+ report([laneName, id]: [string, string]): Promise<string>;
127
+ }
107
128
  export declare class LaneChangeScopeCmd implements Command {
108
129
  private lanes;
109
130
  name: string;
package/dist/lane.cmd.js CHANGED
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.LaneShowCmd = exports.LaneRenameCmd = exports.LaneRemoveReadmeCmd = exports.LaneRemoveCompCmd = exports.LaneRemoveCmd = exports.LaneListCmd = exports.LaneImportCmd = exports.LaneCreateCmd = exports.LaneCmd = exports.LaneChangeScopeCmd = exports.LaneAliasCmd = exports.LaneAddReadmeCmd = void 0;
6
+ exports.LaneShowCmd = exports.LaneRenameCmd = exports.LaneRemoveReadmeCmd = exports.LaneRemoveCompCmd = exports.LaneRemoveCmd = exports.LaneListCmd = exports.LaneImportCmd = exports.LaneHistoryCmd = exports.LaneCreateCmd = exports.LaneCmd = exports.LaneChangeScopeCmd = exports.LaneAliasCmd = exports.LaneAddReadmeCmd = exports.CatLaneHistoryCmd = void 0;
7
7
  function _chalk() {
8
8
  const data = _interopRequireDefault(require("chalk"));
9
9
  _chalk = function () {
@@ -253,6 +253,54 @@ it is useful e.g. when having multiple lanes with the same name, but with differ
253
253
  }
254
254
  }
255
255
  exports.LaneAliasCmd = LaneAliasCmd;
256
+ class CatLaneHistoryCmd {
257
+ constructor(lanes) {
258
+ this.lanes = lanes;
259
+ _defineProperty(this, "name", 'cat-lane-history <lane-name>');
260
+ _defineProperty(this, "description", 'cat lane-history object by lane-name');
261
+ _defineProperty(this, "private", true);
262
+ _defineProperty(this, "alias", 'clh');
263
+ _defineProperty(this, "options", []);
264
+ _defineProperty(this, "loader", true);
265
+ }
266
+ async report([laneName]) {
267
+ const laneId = await this.lanes.parseLaneId(laneName);
268
+ const laneHistory = await this.lanes.getLaneHistory(laneId);
269
+ return JSON.stringify(laneHistory.toObject(), null, 2);
270
+ }
271
+ }
272
+ exports.CatLaneHistoryCmd = CatLaneHistoryCmd;
273
+ class LaneHistoryCmd {
274
+ constructor(lanes) {
275
+ this.lanes = lanes;
276
+ _defineProperty(this, "name", 'history <lane-name> [id]');
277
+ _defineProperty(this, "description", 'EXPERIMENTAL. show lane history');
278
+ _defineProperty(this, "alias", '');
279
+ _defineProperty(this, "options", []);
280
+ _defineProperty(this, "loader", true);
281
+ }
282
+ async report([laneName, id]) {
283
+ const laneId = await this.lanes.parseLaneId(laneName);
284
+ await this.lanes.importLaneHistory(laneId);
285
+ const laneHistory = await this.lanes.getLaneHistory(laneId);
286
+ const history = laneHistory.getHistory();
287
+ if (id) {
288
+ const historyItem = history[id];
289
+ if (!historyItem) throw new Error(`history id ${id} was not found`);
290
+ const date = new Date(parseInt(historyItem.log.date)).toLocaleString();
291
+ const message = historyItem.log.message;
292
+ return `${id} ${date} ${historyItem.log.username} ${message}\n\n${historyItem.components.join('\n')}`;
293
+ }
294
+ const items = Object.keys(history).map(uuid => {
295
+ const historyItem = history[uuid];
296
+ const date = new Date(parseInt(historyItem.log.date)).toLocaleString();
297
+ const message = historyItem.log.message;
298
+ return `${uuid} ${date} ${historyItem.log.username} ${message}`;
299
+ });
300
+ return items.join('\n');
301
+ }
302
+ }
303
+ exports.LaneHistoryCmd = LaneHistoryCmd;
256
304
  class LaneChangeScopeCmd {
257
305
  constructor(lanes) {
258
306
  this.lanes = lanes;
@@ -1 +1 @@
1
- {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_yn","_laneId","_lanes","_bitError","_prompts","_constants","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","LaneListCmd","constructor","lanes","workspace","scope","report","args","laneOptions","details","remote","merged","notMerged","laneIdStr","laneId","alias","isDefault","name","toString","getLanes","showDefaultLane","mergedLanes","filter","l","isMerged","length","chalk","green","map","m","join","unmergedLanes","currentLane","getCurrentLaneId","getDefaultLaneId","laneDataOfCurrentLane","find","isEqual","id","undefined","currentAlias","currentLaneReadmeComponentStr","outputReadmeComponent","readmeComponent","currentLaneStr","currentLaneComponents","outputComponents","components","availableLanes","laneData","readmeComponentStr","laneTitle","bold","concat","outputFooter","footer","outputCurrentLane","outputAvailableLanes","json","lanesData","serializeLaneData","getCurrentLaneNameOrAlias","exports","LaneShowCmd","Error","getCurrentLaneName","DEFAULT_LANE","parseLaneId","onlyLane","title","author","log","username","email","date","Date","parseInt","toLocaleString","link","DEFAULT_CLOUD_DOMAIN","replace","LaneCreateCmd","description","createLaneOptions","getCurrentLane","remoteScope","result","createLane","remoteScopeOrDefaultScope","yellow","remoteScopeOutput","LaneAliasCmd","laneName","aliasLane","LaneChangeScopeCmd","remoteScopeBefore","localName","changeScope","LaneRenameCmd","newName","currentName","rename","LaneRemoveCmd","names","force","silent","removePromptResult","approveOperation","yn","shouldProceed","BitError","laneResults","removeLanes","LaneRemoveCompCmd","COMPONENT_PATTERN_HELP","LaneImportCmd","switchCmd","lane","skipDependencyInstallation","pattern","getAll","LaneCmd","LaneRemoveReadmeCmd","message","removeLaneReadme","red","LaneAddReadmeCmd","componentId","addLaneReadme","componentsTitle","componentsStr","c","head","component","fullName"],"sources":["lane.cmd.ts"],"sourcesContent":["// eslint-disable-next-line max-classes-per-file\nimport chalk from 'chalk';\nimport yn from 'yn';\nimport { ScopeMain } from '@teambit/scope';\nimport { DEFAULT_LANE, LaneId } from '@teambit/lane-id';\nimport { Workspace } from '@teambit/workspace';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { LaneData, serializeLaneData } from '@teambit/legacy/dist/scope/lanes/lanes';\nimport { BitError } from '@teambit/bit-error';\nimport { approveOperation } from '@teambit/legacy/dist/prompts';\nimport { COMPONENT_PATTERN_HELP, DEFAULT_CLOUD_DOMAIN } from '@teambit/legacy/dist/constants';\nimport { CreateLaneOptions, LanesMain } from './lanes.main.runtime';\nimport { SwitchCmd } from './switch.cmd';\n\ntype LaneOptions = {\n details?: boolean;\n remote?: string;\n merged?: boolean;\n notMerged?: boolean;\n json?: boolean;\n};\n\nexport class LaneListCmd implements Command {\n name = 'list';\n description = `list local lanes`;\n alias = '';\n options = [\n ['d', 'details', 'show more details on the state of each component in each lane'],\n ['j', 'json', \"show lanes' details in a json format\"],\n ['r', 'remote <remote-scope-name>', 'show all remote lanes from the specified scope'],\n ['', 'merged', 'list only merged lanes'],\n ['', 'not-merged', \"list only lanes that haven't been merged\"],\n ] as CommandOptions;\n loader = true;\n remoteOp = true;\n skipWorkspace = true;\n\n constructor(private lanes: LanesMain, private workspace: Workspace, private scope: ScopeMain) {}\n\n async report(args, laneOptions: LaneOptions): Promise<string> {\n const { details, remote, merged, notMerged } = laneOptions;\n const laneIdStr = (laneId: LaneId, alias?: string | null) => {\n if (laneId.isDefault()) return laneId.name;\n if (alias) return `${laneId.toString()} (${alias})`;\n return laneId.toString();\n };\n const lanes = await this.lanes.getLanes({\n remote,\n merged,\n notMerged,\n showDefaultLane: true,\n });\n if (merged) {\n const mergedLanes = lanes.filter((l) => l.isMerged);\n if (!mergedLanes.length) return chalk.green('None of the lanes is merged');\n return chalk.green(mergedLanes.map((m) => m.name).join('\\n'));\n }\n if (notMerged) {\n const unmergedLanes = lanes.filter((l) => !l.isMerged);\n if (!unmergedLanes.length) return chalk.green('All lanes are merged');\n return chalk.green(unmergedLanes.map((m) => m.name).join('\\n'));\n }\n const currentLane = this.lanes.getCurrentLaneId() || this.lanes.getDefaultLaneId();\n const laneDataOfCurrentLane = currentLane ? lanes.find((l) => currentLane.isEqual(l.id)) : undefined;\n const currentAlias = laneDataOfCurrentLane ? laneDataOfCurrentLane.alias : undefined;\n const currentLaneReadmeComponentStr = outputReadmeComponent(laneDataOfCurrentLane?.readmeComponent);\n let currentLaneStr = `current lane - ${chalk.green.green(laneIdStr(currentLane, currentAlias))}`;\n currentLaneStr += currentLaneReadmeComponentStr;\n\n if (details) {\n const currentLaneComponents = laneDataOfCurrentLane ? outputComponents(laneDataOfCurrentLane.components) : '';\n if (currentLaneStr) {\n currentLaneStr += `\\n${currentLaneComponents}`;\n }\n }\n\n const availableLanes = lanes\n .filter((l) => !currentLane.isEqual(l.id))\n .map((laneData) => {\n const readmeComponentStr = outputReadmeComponent(laneData.readmeComponent);\n if (details) {\n const laneTitle = `> ${chalk.bold(laneIdStr(laneData.id, laneData.alias))}\\n`;\n const components = outputComponents(laneData.components);\n return laneTitle + readmeComponentStr.concat('\\n') + components;\n }\n return ` > ${chalk.green(laneIdStr(laneData.id, laneData.alias))} (${\n laneData.components.length\n } components)${readmeComponentStr}`;\n })\n .join('\\n');\n\n const outputFooter = () => {\n let footer = '\\n';\n if (details) {\n footer += 'You can use --merged and --not-merged to see which of the lanes is fully merged.';\n } else {\n footer +=\n \"to get more info on all lanes in local scope use 'bit lane list --details', or 'bit lane show <lane-name>' for a specific lane.\";\n }\n if (!remote && this.workspace)\n footer += `\\nswitch lanes using 'bit switch <name>'. create lanes using 'bit lane create <name>'.`;\n\n return footer;\n };\n\n return outputCurrentLane() + outputAvailableLanes() + outputFooter();\n\n function outputCurrentLane() {\n return currentLaneStr ? `${currentLaneStr}\\n` : '';\n }\n\n function outputAvailableLanes() {\n if (!availableLanes) return '';\n return remote ? `${availableLanes}\\n` : `\\nAvailable lanes:\\n${availableLanes}\\n`;\n }\n }\n async json(args, laneOptions: LaneOptions) {\n const { remote, merged = false, notMerged = false } = laneOptions;\n\n const lanesData = await this.lanes.getLanes({\n remote,\n showDefaultLane: true,\n merged,\n notMerged,\n });\n const lanes = lanesData.map(serializeLaneData);\n const currentLane = this.lanes.getCurrentLaneNameOrAlias();\n return { lanes, currentLane };\n }\n}\n\nexport class LaneShowCmd implements Command {\n name = 'show [lane-name]';\n description = `show lane details. if no lane specified, show the current lane`;\n alias = '';\n options = [\n ['j', 'json', 'show the lane details in json format'],\n ['r', 'remote', 'show details of the remote head of the provided lane'],\n ] as CommandOptions;\n loader = true;\n remoteOp = true;\n skipWorkspace = true;\n\n constructor(private lanes: LanesMain, private workspace: Workspace, private scope: ScopeMain) {}\n\n async report([name]: [string], laneOptions: LaneOptions): Promise<string> {\n const { remote } = laneOptions;\n\n if (!name && remote) {\n throw new Error('remote flag is not supported without lane name');\n }\n if (!name) {\n name = this.lanes.getCurrentLaneName() || DEFAULT_LANE;\n }\n\n const laneId = await this.lanes.parseLaneId(name);\n\n const lanes = await this.lanes.getLanes({\n name: laneId.name,\n remote: remote ? laneId.scope : undefined,\n });\n\n const onlyLane = lanes[0];\n const title = `showing information for ${chalk.bold(onlyLane.id.toString())}\\n`;\n const author = `author: ${onlyLane.log?.username || 'N/A'} <${onlyLane.log?.email || 'N/A'}>\\n`;\n const date = onlyLane.log?.date\n ? `created: ${new Date(parseInt(onlyLane.log.date)).toLocaleString()}\\n`\n : undefined;\n const link = `link: https://${DEFAULT_CLOUD_DOMAIN}/${laneId.scope.replace('.', '/')}/~lane/${laneId.name}\\n`;\n return title + author + date + link + outputComponents(onlyLane.components);\n }\n\n async json([name]: [string], laneOptions: LaneOptions) {\n const { remote } = laneOptions;\n\n const lanes = await this.lanes.getLanes({\n name,\n remote,\n });\n\n return serializeLaneData(lanes[0]);\n }\n}\n\nexport class LaneCreateCmd implements Command {\n name = 'create <lane-name>';\n arguments = [\n {\n name: 'lane-name',\n description: 'the name for the new lane',\n },\n ];\n description = `creates a new lane and switches to it`;\n extendedDescription = `a lane created from main (default-lane) is empty until components are snapped.\na lane created from another lane contains all the components of the original lane.`;\n alias = '';\n options = [\n [\n 's',\n 'scope <scope-name>',\n 'remote scope to which this lane will be exported, default to the workspace.json\\'s defaultScope (can be changed up to first export of the lane with \"bit lane change-scope\")',\n ],\n ['', 'remote-scope <scope-name>', 'DEPRECATED. use --scope'],\n [\n '',\n 'alias <name>',\n 'a local alias to refer to this lane, defaults to the `<lane-name>` (can be added later with \"bit lane alias\")',\n ],\n [\n '',\n 'fork-lane-new-scope',\n 'create the new lane in a different scope than its parent lane (if created from another lane)',\n ],\n ] as CommandOptions;\n loader = true;\n\n constructor(private lanes: LanesMain) {}\n\n async report([name]: [string], createLaneOptions: CreateLaneOptions & { remoteScope?: string }): Promise<string> {\n const currentLane = await this.lanes.getCurrentLane();\n if (createLaneOptions.remoteScope) createLaneOptions.scope = createLaneOptions.remoteScope;\n const result = await this.lanes.createLane(name, createLaneOptions);\n const remoteScopeOrDefaultScope = createLaneOptions.scope\n ? `the remote scope ${chalk.bold(createLaneOptions.scope)}`\n : `the default-scope ${chalk.bold(\n result.laneId.scope\n )}. you can change the lane's scope, before it is exported, with the \"bit lane change-scope\" command`;\n const title = chalk.green(\n `successfully added and checked out to the new lane ${chalk.bold(result.alias || result.laneId.name)}\n ${currentLane !== null ? chalk.yellow(`\\nnote - your new lane will be based on lane ${currentLane.name}`) : ''}\n `\n );\n const remoteScopeOutput = `this lane will be exported to ${remoteScopeOrDefaultScope}`;\n return `${title}\\n${remoteScopeOutput}`;\n }\n}\n\nexport class LaneAliasCmd implements Command {\n name = 'alias <lane-name> <alias>';\n description = 'adds an alias to a lane';\n extendedDescription = `an alias is a name that can be used locally to refer to a lane. it is saved locally and never reaches the remote.\nit is useful e.g. when having multiple lanes with the same name, but with different remote scopes.`;\n alias = '';\n options = [] as CommandOptions;\n loader = true;\n\n constructor(private lanes: LanesMain) {}\n\n async report([laneName, alias]: [string, string, string]): Promise<string> {\n const { laneId } = await this.lanes.aliasLane(laneName, alias);\n return `successfully added the alias ${chalk.bold(alias)} for lane ${chalk.bold(laneId.toString())}`;\n }\n}\n\nexport class LaneChangeScopeCmd implements Command {\n name = 'change-scope <remote-scope-name>';\n description = `changes the remote scope of a lane`;\n extendedDescription = 'NOTE: available only before the lane is exported to the remote';\n alias = '';\n options = [\n [\n 'l',\n 'lane-name <lane-name>',\n 'the name of the lane to change its remote scope. if not specified, the current lane is used',\n ],\n ] as CommandOptions;\n loader = true;\n\n constructor(private lanes: LanesMain) {}\n\n async report([remoteScope]: [string], { laneName }: { laneName?: string }): Promise<string> {\n const { remoteScopeBefore, localName } = await this.lanes.changeScope(remoteScope, laneName);\n return `the remote-scope of ${chalk.bold(localName)} has been changed from ${chalk.bold(\n remoteScopeBefore\n )} to ${chalk.bold(remoteScope)}`;\n }\n}\n\nexport class LaneRenameCmd implements Command {\n name = 'rename <new-name>';\n description = `EXPERIMENTAL. change the lane-name locally`;\n extendedDescription = 'the remote will be updated after the next \"bit export\" command';\n alias = '';\n options = [\n ['l', 'lane-name <lane-name>', 'the name of the lane to rename. if not specified, the current lane is used'],\n ] as CommandOptions;\n loader = true;\n constructor(private lanes: LanesMain) {}\n\n async report([newName]: [string], { laneName }: { laneName?: string }): Promise<string> {\n const { currentName } = await this.lanes.rename(newName, laneName);\n return `the lane ${chalk.bold(currentName)}'s name has been changed to ${chalk.bold(newName)}.`;\n }\n}\n\nexport class LaneRemoveCmd implements Command {\n name = 'remove <lanes...>';\n arguments = [{ name: 'lanes...', description: 'A list of lane names, separated by spaces' }];\n description = `remove or delete lanes`;\n group = 'collaborate';\n alias = '';\n options = [\n [\n 'r',\n 'remote',\n 'delete a remote lane. use remote/lane-id syntax e.g. bit lane remove owner.org/my-lane --remote. Delete is immediate, no export required',\n ],\n ['f', 'force', 'removes/deletes the lane even when the lane is not yet merged to main'],\n ['s', 'silent', 'skip confirmation'],\n ] as CommandOptions;\n loader = true;\n\n constructor(private lanes: LanesMain) {}\n\n async report(\n [names]: [string[]],\n {\n remote = false,\n force = false,\n silent = false,\n }: {\n remote: boolean;\n force: boolean;\n silent: boolean;\n }\n ): Promise<string> {\n if (!silent) {\n const removePromptResult = await approveOperation();\n // @ts-ignore\n if (!yn(removePromptResult.shouldProceed)) {\n throw new BitError('the operation has been cancelled');\n }\n }\n const laneResults = await this.lanes.removeLanes(names, { remote, force });\n return chalk.green(`successfully removed the following lane(s): ${chalk.bold(laneResults.join(', '))}`);\n }\n}\n\nexport type RemoveCompsOpts = { workspaceOnly?: boolean; updateMain?: boolean };\n\nexport class LaneRemoveCompCmd implements Command {\n name = 'remove-comp <component-pattern>';\n arguments = [\n {\n name: 'component-pattern',\n description: COMPONENT_PATTERN_HELP,\n },\n ];\n description = `DEPRECATED. remove components when on a lane`;\n group = 'collaborate';\n alias = 'rc';\n options = [\n [\n '',\n 'workspace-only',\n 'do not mark the components as removed from the lane. instead, remove them from the workspace only',\n ],\n [\n '',\n 'update-main',\n 'EXPERIMENTAL. remove, i.e. delete, component/s on the main lane after merging this lane into main',\n ],\n ] as CommandOptions;\n loader = true;\n\n constructor(private workspace: Workspace, private lanes: LanesMain) {}\n\n async report(): Promise<string> {\n throw new BitError(`bit lane remove-comp has been removed. please use \"bit remove\" or \"bit delete\" instead`);\n }\n}\n\nexport class LaneImportCmd implements Command {\n name = 'import <lane>';\n description = `import a remote lane to your workspace and switch to that lane`;\n arguments = [{ name: 'lane', description: 'the remote lane name' }];\n alias = '';\n options = [\n ['x', 'skip-dependency-installation', 'do not install dependencies of the imported components'],\n [\n 'p',\n 'pattern <component-pattern>',\n 'import only components from the lane that fit the specified component-pattern to the workspace. works only when the workspace is empty',\n ],\n ] as CommandOptions;\n loader = true;\n\n constructor(private switchCmd: SwitchCmd) {}\n\n async report(\n [lane]: [string],\n { skipDependencyInstallation = false, pattern }: { skipDependencyInstallation: boolean; pattern?: string }\n ): Promise<string> {\n return this.switchCmd.report([lane], { getAll: true, skipDependencyInstallation, pattern });\n }\n}\n\nexport class LaneCmd implements Command {\n name = 'lane [sub-command]';\n description = 'manage lanes - if no sub-command is used, runs \"bit lane list\"';\n alias = 'l';\n options = [\n ['d', 'details', 'show more details on the state of each component in each lane'],\n ['j', 'json', 'show lanes details in json format'],\n ['r', 'remote <remote-scope-name>', 'show all remote lanes from the specified scope'],\n ['', 'merged', 'list only merged lanes'],\n ['', 'not-merged', \"list only lanes that haven't been merged\"],\n ] as CommandOptions;\n loader = true;\n group = 'collaborate';\n remoteOp = true;\n skipWorkspace = true;\n helpUrl = 'reference/components/lanes';\n commands: Command[] = [];\n\n constructor(private lanes: LanesMain, private workspace: Workspace, private scope: ScopeMain) {}\n\n async report([name]: [string], laneOptions: LaneOptions): Promise<string> {\n return new LaneListCmd(this.lanes, this.workspace, this.scope).report([name], laneOptions);\n }\n}\n\nexport class LaneRemoveReadmeCmd implements Command {\n name = 'remove-readme [laneName]';\n description = 'EXPERIMENTAL. remove lane readme component';\n options = [] as CommandOptions;\n loader = true;\n skipWorkspace = false;\n\n constructor(private lanes: LanesMain) {}\n\n async report([laneName]: [string]): Promise<string> {\n const { result, message } = await this.lanes.removeLaneReadme(laneName);\n\n if (result) {\n return chalk.green(\n `the readme component has been successfully removed from the lane ${\n laneName || this.lanes.getCurrentLaneName()\n }`\n );\n }\n\n return chalk.red(`${message}\\n`);\n }\n}\n\nexport class LaneAddReadmeCmd implements Command {\n name = 'add-readme <component-name> [lane-name]';\n description = 'EXPERIMENTAL. sets an existing component as the readme of a lane';\n arguments = [\n { name: 'component-id', description: \"the component name or id of the component to use as the lane's readme\" },\n { name: 'lane-name', description: 'the lane to attach the readme to (defaults to the current lane)' },\n ];\n options = [] as CommandOptions;\n loader = true;\n skipWorkspace = false;\n\n constructor(private lanes: LanesMain) {}\n\n async report([componentId, laneName]: [string, string]): Promise<string> {\n const { result, message } = await this.lanes.addLaneReadme(componentId, laneName);\n\n if (result)\n return chalk.green(\n `the component ${componentId} has been successfully added as the readme component for the lane ${\n laneName || this.lanes.getCurrentLaneName()\n }`\n );\n\n return chalk.red(\n `${message || ''}\\nthe component ${componentId} could not be added as a readme component for the lane ${\n laneName || this.lanes.getCurrentLaneName()\n }`\n );\n }\n}\n\nfunction outputComponents(components: LaneData['components']): string {\n const componentsTitle = `\\t${chalk.bold(`components (${components.length})`)}\\n`;\n const componentsStr = components.map((c) => `\\t ${c.id.toString()} - ${c.head}`).join('\\n');\n return componentsTitle + componentsStr;\n}\n\nfunction outputReadmeComponent(component: LaneData['readmeComponent']): string {\n if (!component) return '';\n return `\\n\\t${`${chalk.yellow('readme component')}\\n\\t ${component.id} - ${\n component.head ||\n `(unsnapped)\\n\\t(\"use bit snap ${component.id.fullName}\" to snap the readme component on the lane before exporting)`\n }`}\\n`;\n}\n"],"mappings":";;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,IAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,GAAA,YAAAA,CAA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AC7CnC,QAAQ,IAAI,IAAI,CAACzF,KAAK,CAAC8D,kBAAkB,CAAC,CAC3C,EACH,CAAC;EACH;AACF;AAACH,OAAA,CAAAgE,gBAAA,GAAAA,gBAAA;AAED,SAAShF,gBAAgBA,CAACC,UAAkC,EAAU;EACpE,MAAMkF,eAAe,GAAI,KAAIvG,gBAAK,CAAC0B,IAAI,CAAE,eAAcL,UAAU,CAACtB,MAAO,GAAE,CAAE,IAAG;EAChF,MAAMyG,aAAa,GAAGnF,UAAU,CAACnB,GAAG,CAAEuG,CAAC,IAAM,OAAMA,CAAC,CAAC7F,EAAE,CAACpB,QAAQ,CAAC,CAAE,MAAKiH,CAAC,CAACC,IAAK,EAAC,CAAC,CAACtG,IAAI,CAAC,IAAI,CAAC;EAC5F,OAAOmG,eAAe,GAAGC,aAAa;AACxC;AAEA,SAASxF,qBAAqBA,CAAC2F,SAAsC,EAAU;EAC7E,IAAI,CAACA,SAAS,EAAE,OAAO,EAAE;EACzB,OAAQ,OAAO,GAAE3G,gBAAK,CAAC+D,MAAM,CAAC,kBAAkB,CAAE,SAAQ4C,SAAS,CAAC/F,EAAG,MACrE+F,SAAS,CAACD,IAAI,IACb,iCAAgCC,SAAS,CAAC/F,EAAE,CAACgG,QAAS,8DACxD,EAAE,IAAG;AACR"}
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_yn","_laneId","_lanes","_bitError","_prompts","_constants","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","LaneListCmd","constructor","lanes","workspace","scope","report","args","laneOptions","details","remote","merged","notMerged","laneIdStr","laneId","alias","isDefault","name","toString","getLanes","showDefaultLane","mergedLanes","filter","l","isMerged","length","chalk","green","map","m","join","unmergedLanes","currentLane","getCurrentLaneId","getDefaultLaneId","laneDataOfCurrentLane","find","isEqual","id","undefined","currentAlias","currentLaneReadmeComponentStr","outputReadmeComponent","readmeComponent","currentLaneStr","currentLaneComponents","outputComponents","components","availableLanes","laneData","readmeComponentStr","laneTitle","bold","concat","outputFooter","footer","outputCurrentLane","outputAvailableLanes","json","lanesData","serializeLaneData","getCurrentLaneNameOrAlias","exports","LaneShowCmd","Error","getCurrentLaneName","DEFAULT_LANE","parseLaneId","onlyLane","title","author","log","username","email","date","Date","parseInt","toLocaleString","link","DEFAULT_CLOUD_DOMAIN","replace","LaneCreateCmd","description","createLaneOptions","getCurrentLane","remoteScope","result","createLane","remoteScopeOrDefaultScope","yellow","remoteScopeOutput","LaneAliasCmd","laneName","aliasLane","CatLaneHistoryCmd","laneHistory","getLaneHistory","JSON","stringify","toObject","LaneHistoryCmd","importLaneHistory","history","getHistory","historyItem","message","items","keys","uuid","LaneChangeScopeCmd","remoteScopeBefore","localName","changeScope","LaneRenameCmd","newName","currentName","rename","LaneRemoveCmd","names","force","silent","removePromptResult","approveOperation","yn","shouldProceed","BitError","laneResults","removeLanes","LaneRemoveCompCmd","COMPONENT_PATTERN_HELP","LaneImportCmd","switchCmd","lane","skipDependencyInstallation","pattern","getAll","LaneCmd","LaneRemoveReadmeCmd","removeLaneReadme","red","LaneAddReadmeCmd","componentId","addLaneReadme","componentsTitle","componentsStr","c","head","component","fullName"],"sources":["lane.cmd.ts"],"sourcesContent":["// eslint-disable-next-line max-classes-per-file\nimport chalk from 'chalk';\nimport yn from 'yn';\nimport { ScopeMain } from '@teambit/scope';\nimport { DEFAULT_LANE, LaneId } from '@teambit/lane-id';\nimport { Workspace } from '@teambit/workspace';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { LaneData, serializeLaneData } from '@teambit/legacy/dist/scope/lanes/lanes';\nimport { BitError } from '@teambit/bit-error';\nimport { approveOperation } from '@teambit/legacy/dist/prompts';\nimport { COMPONENT_PATTERN_HELP, DEFAULT_CLOUD_DOMAIN } from '@teambit/legacy/dist/constants';\nimport { CreateLaneOptions, LanesMain } from './lanes.main.runtime';\nimport { SwitchCmd } from './switch.cmd';\n\ntype LaneOptions = {\n details?: boolean;\n remote?: string;\n merged?: boolean;\n notMerged?: boolean;\n json?: boolean;\n};\n\nexport class LaneListCmd implements Command {\n name = 'list';\n description = `list local lanes`;\n alias = '';\n options = [\n ['d', 'details', 'show more details on the state of each component in each lane'],\n ['j', 'json', \"show lanes' details in a json format\"],\n ['r', 'remote <remote-scope-name>', 'show all remote lanes from the specified scope'],\n ['', 'merged', 'list only merged lanes'],\n ['', 'not-merged', \"list only lanes that haven't been merged\"],\n ] as CommandOptions;\n loader = true;\n remoteOp = true;\n skipWorkspace = true;\n\n constructor(private lanes: LanesMain, private workspace: Workspace, private scope: ScopeMain) {}\n\n async report(args, laneOptions: LaneOptions): Promise<string> {\n const { details, remote, merged, notMerged } = laneOptions;\n const laneIdStr = (laneId: LaneId, alias?: string | null) => {\n if (laneId.isDefault()) return laneId.name;\n if (alias) return `${laneId.toString()} (${alias})`;\n return laneId.toString();\n };\n const lanes = await this.lanes.getLanes({\n remote,\n merged,\n notMerged,\n showDefaultLane: true,\n });\n if (merged) {\n const mergedLanes = lanes.filter((l) => l.isMerged);\n if (!mergedLanes.length) return chalk.green('None of the lanes is merged');\n return chalk.green(mergedLanes.map((m) => m.name).join('\\n'));\n }\n if (notMerged) {\n const unmergedLanes = lanes.filter((l) => !l.isMerged);\n if (!unmergedLanes.length) return chalk.green('All lanes are merged');\n return chalk.green(unmergedLanes.map((m) => m.name).join('\\n'));\n }\n const currentLane = this.lanes.getCurrentLaneId() || this.lanes.getDefaultLaneId();\n const laneDataOfCurrentLane = currentLane ? lanes.find((l) => currentLane.isEqual(l.id)) : undefined;\n const currentAlias = laneDataOfCurrentLane ? laneDataOfCurrentLane.alias : undefined;\n const currentLaneReadmeComponentStr = outputReadmeComponent(laneDataOfCurrentLane?.readmeComponent);\n let currentLaneStr = `current lane - ${chalk.green.green(laneIdStr(currentLane, currentAlias))}`;\n currentLaneStr += currentLaneReadmeComponentStr;\n\n if (details) {\n const currentLaneComponents = laneDataOfCurrentLane ? outputComponents(laneDataOfCurrentLane.components) : '';\n if (currentLaneStr) {\n currentLaneStr += `\\n${currentLaneComponents}`;\n }\n }\n\n const availableLanes = lanes\n .filter((l) => !currentLane.isEqual(l.id))\n .map((laneData) => {\n const readmeComponentStr = outputReadmeComponent(laneData.readmeComponent);\n if (details) {\n const laneTitle = `> ${chalk.bold(laneIdStr(laneData.id, laneData.alias))}\\n`;\n const components = outputComponents(laneData.components);\n return laneTitle + readmeComponentStr.concat('\\n') + components;\n }\n return ` > ${chalk.green(laneIdStr(laneData.id, laneData.alias))} (${\n laneData.components.length\n } components)${readmeComponentStr}`;\n })\n .join('\\n');\n\n const outputFooter = () => {\n let footer = '\\n';\n if (details) {\n footer += 'You can use --merged and --not-merged to see which of the lanes is fully merged.';\n } else {\n footer +=\n \"to get more info on all lanes in local scope use 'bit lane list --details', or 'bit lane show <lane-name>' for a specific lane.\";\n }\n if (!remote && this.workspace)\n footer += `\\nswitch lanes using 'bit switch <name>'. create lanes using 'bit lane create <name>'.`;\n\n return footer;\n };\n\n return outputCurrentLane() + outputAvailableLanes() + outputFooter();\n\n function outputCurrentLane() {\n return currentLaneStr ? `${currentLaneStr}\\n` : '';\n }\n\n function outputAvailableLanes() {\n if (!availableLanes) return '';\n return remote ? `${availableLanes}\\n` : `\\nAvailable lanes:\\n${availableLanes}\\n`;\n }\n }\n async json(args, laneOptions: LaneOptions) {\n const { remote, merged = false, notMerged = false } = laneOptions;\n\n const lanesData = await this.lanes.getLanes({\n remote,\n showDefaultLane: true,\n merged,\n notMerged,\n });\n const lanes = lanesData.map(serializeLaneData);\n const currentLane = this.lanes.getCurrentLaneNameOrAlias();\n return { lanes, currentLane };\n }\n}\n\nexport class LaneShowCmd implements Command {\n name = 'show [lane-name]';\n description = `show lane details. if no lane specified, show the current lane`;\n alias = '';\n options = [\n ['j', 'json', 'show the lane details in json format'],\n ['r', 'remote', 'show details of the remote head of the provided lane'],\n ] as CommandOptions;\n loader = true;\n remoteOp = true;\n skipWorkspace = true;\n\n constructor(private lanes: LanesMain, private workspace: Workspace, private scope: ScopeMain) {}\n\n async report([name]: [string], laneOptions: LaneOptions): Promise<string> {\n const { remote } = laneOptions;\n\n if (!name && remote) {\n throw new Error('remote flag is not supported without lane name');\n }\n if (!name) {\n name = this.lanes.getCurrentLaneName() || DEFAULT_LANE;\n }\n\n const laneId = await this.lanes.parseLaneId(name);\n\n const lanes = await this.lanes.getLanes({\n name: laneId.name,\n remote: remote ? laneId.scope : undefined,\n });\n\n const onlyLane = lanes[0];\n const title = `showing information for ${chalk.bold(onlyLane.id.toString())}\\n`;\n const author = `author: ${onlyLane.log?.username || 'N/A'} <${onlyLane.log?.email || 'N/A'}>\\n`;\n const date = onlyLane.log?.date\n ? `created: ${new Date(parseInt(onlyLane.log.date)).toLocaleString()}\\n`\n : undefined;\n const link = `link: https://${DEFAULT_CLOUD_DOMAIN}/${laneId.scope.replace('.', '/')}/~lane/${laneId.name}\\n`;\n return title + author + date + link + outputComponents(onlyLane.components);\n }\n\n async json([name]: [string], laneOptions: LaneOptions) {\n const { remote } = laneOptions;\n\n const lanes = await this.lanes.getLanes({\n name,\n remote,\n });\n\n return serializeLaneData(lanes[0]);\n }\n}\n\nexport class LaneCreateCmd implements Command {\n name = 'create <lane-name>';\n arguments = [\n {\n name: 'lane-name',\n description: 'the name for the new lane',\n },\n ];\n description = `creates a new lane and switches to it`;\n extendedDescription = `a lane created from main (default-lane) is empty until components are snapped.\na lane created from another lane contains all the components of the original lane.`;\n alias = '';\n options = [\n [\n 's',\n 'scope <scope-name>',\n 'remote scope to which this lane will be exported, default to the workspace.json\\'s defaultScope (can be changed up to first export of the lane with \"bit lane change-scope\")',\n ],\n ['', 'remote-scope <scope-name>', 'DEPRECATED. use --scope'],\n [\n '',\n 'alias <name>',\n 'a local alias to refer to this lane, defaults to the `<lane-name>` (can be added later with \"bit lane alias\")',\n ],\n [\n '',\n 'fork-lane-new-scope',\n 'create the new lane in a different scope than its parent lane (if created from another lane)',\n ],\n ] as CommandOptions;\n loader = true;\n\n constructor(private lanes: LanesMain) {}\n\n async report([name]: [string], createLaneOptions: CreateLaneOptions & { remoteScope?: string }): Promise<string> {\n const currentLane = await this.lanes.getCurrentLane();\n if (createLaneOptions.remoteScope) createLaneOptions.scope = createLaneOptions.remoteScope;\n const result = await this.lanes.createLane(name, createLaneOptions);\n const remoteScopeOrDefaultScope = createLaneOptions.scope\n ? `the remote scope ${chalk.bold(createLaneOptions.scope)}`\n : `the default-scope ${chalk.bold(\n result.laneId.scope\n )}. you can change the lane's scope, before it is exported, with the \"bit lane change-scope\" command`;\n const title = chalk.green(\n `successfully added and checked out to the new lane ${chalk.bold(result.alias || result.laneId.name)}\n ${currentLane !== null ? chalk.yellow(`\\nnote - your new lane will be based on lane ${currentLane.name}`) : ''}\n `\n );\n const remoteScopeOutput = `this lane will be exported to ${remoteScopeOrDefaultScope}`;\n return `${title}\\n${remoteScopeOutput}`;\n }\n}\n\nexport class LaneAliasCmd implements Command {\n name = 'alias <lane-name> <alias>';\n description = 'adds an alias to a lane';\n extendedDescription = `an alias is a name that can be used locally to refer to a lane. it is saved locally and never reaches the remote.\nit is useful e.g. when having multiple lanes with the same name, but with different remote scopes.`;\n alias = '';\n options = [] as CommandOptions;\n loader = true;\n\n constructor(private lanes: LanesMain) {}\n\n async report([laneName, alias]: [string, string, string]): Promise<string> {\n const { laneId } = await this.lanes.aliasLane(laneName, alias);\n return `successfully added the alias ${chalk.bold(alias)} for lane ${chalk.bold(laneId.toString())}`;\n }\n}\n\nexport class CatLaneHistoryCmd implements Command {\n name = 'cat-lane-history <lane-name>';\n description = 'cat lane-history object by lane-name';\n private = true;\n alias = 'clh';\n options = [] as CommandOptions;\n loader = true;\n\n constructor(private lanes: LanesMain) {}\n\n async report([laneName]: [string]): Promise<string> {\n const laneId = await this.lanes.parseLaneId(laneName);\n const laneHistory = await this.lanes.getLaneHistory(laneId);\n return JSON.stringify(laneHistory.toObject(), null, 2);\n }\n}\n\nexport class LaneHistoryCmd implements Command {\n name = 'history <lane-name> [id]';\n description = 'EXPERIMENTAL. show lane history';\n alias = '';\n options = [] as CommandOptions;\n loader = true;\n\n constructor(private lanes: LanesMain) {}\n\n async report([laneName, id]: [string, string]): Promise<string> {\n const laneId = await this.lanes.parseLaneId(laneName);\n await this.lanes.importLaneHistory(laneId);\n const laneHistory = await this.lanes.getLaneHistory(laneId);\n const history = laneHistory.getHistory();\n if (id) {\n const historyItem = history[id];\n if (!historyItem) throw new Error(`history id ${id} was not found`);\n const date = new Date(parseInt(historyItem.log.date)).toLocaleString();\n const message = historyItem.log.message;\n return `${id} ${date} ${historyItem.log.username} ${message}\\n\\n${historyItem.components.join('\\n')}`;\n }\n const items = Object.keys(history).map((uuid) => {\n const historyItem = history[uuid];\n const date = new Date(parseInt(historyItem.log.date)).toLocaleString();\n const message = historyItem.log.message;\n return `${uuid} ${date} ${historyItem.log.username} ${message}`;\n });\n return items.join('\\n');\n }\n}\n\nexport class LaneChangeScopeCmd implements Command {\n name = 'change-scope <remote-scope-name>';\n description = `changes the remote scope of a lane`;\n extendedDescription = 'NOTE: available only before the lane is exported to the remote';\n alias = '';\n options = [\n [\n 'l',\n 'lane-name <lane-name>',\n 'the name of the lane to change its remote scope. if not specified, the current lane is used',\n ],\n ] as CommandOptions;\n loader = true;\n\n constructor(private lanes: LanesMain) {}\n\n async report([remoteScope]: [string], { laneName }: { laneName?: string }): Promise<string> {\n const { remoteScopeBefore, localName } = await this.lanes.changeScope(remoteScope, laneName);\n return `the remote-scope of ${chalk.bold(localName)} has been changed from ${chalk.bold(\n remoteScopeBefore\n )} to ${chalk.bold(remoteScope)}`;\n }\n}\n\nexport class LaneRenameCmd implements Command {\n name = 'rename <new-name>';\n description = `EXPERIMENTAL. change the lane-name locally`;\n extendedDescription = 'the remote will be updated after the next \"bit export\" command';\n alias = '';\n options = [\n ['l', 'lane-name <lane-name>', 'the name of the lane to rename. if not specified, the current lane is used'],\n ] as CommandOptions;\n loader = true;\n constructor(private lanes: LanesMain) {}\n\n async report([newName]: [string], { laneName }: { laneName?: string }): Promise<string> {\n const { currentName } = await this.lanes.rename(newName, laneName);\n return `the lane ${chalk.bold(currentName)}'s name has been changed to ${chalk.bold(newName)}.`;\n }\n}\n\nexport class LaneRemoveCmd implements Command {\n name = 'remove <lanes...>';\n arguments = [{ name: 'lanes...', description: 'A list of lane names, separated by spaces' }];\n description = `remove or delete lanes`;\n group = 'collaborate';\n alias = '';\n options = [\n [\n 'r',\n 'remote',\n 'delete a remote lane. use remote/lane-id syntax e.g. bit lane remove owner.org/my-lane --remote. Delete is immediate, no export required',\n ],\n ['f', 'force', 'removes/deletes the lane even when the lane is not yet merged to main'],\n ['s', 'silent', 'skip confirmation'],\n ] as CommandOptions;\n loader = true;\n\n constructor(private lanes: LanesMain) {}\n\n async report(\n [names]: [string[]],\n {\n remote = false,\n force = false,\n silent = false,\n }: {\n remote: boolean;\n force: boolean;\n silent: boolean;\n }\n ): Promise<string> {\n if (!silent) {\n const removePromptResult = await approveOperation();\n // @ts-ignore\n if (!yn(removePromptResult.shouldProceed)) {\n throw new BitError('the operation has been cancelled');\n }\n }\n const laneResults = await this.lanes.removeLanes(names, { remote, force });\n return chalk.green(`successfully removed the following lane(s): ${chalk.bold(laneResults.join(', '))}`);\n }\n}\n\nexport type RemoveCompsOpts = { workspaceOnly?: boolean; updateMain?: boolean };\n\nexport class LaneRemoveCompCmd implements Command {\n name = 'remove-comp <component-pattern>';\n arguments = [\n {\n name: 'component-pattern',\n description: COMPONENT_PATTERN_HELP,\n },\n ];\n description = `DEPRECATED. remove components when on a lane`;\n group = 'collaborate';\n alias = 'rc';\n options = [\n [\n '',\n 'workspace-only',\n 'do not mark the components as removed from the lane. instead, remove them from the workspace only',\n ],\n [\n '',\n 'update-main',\n 'EXPERIMENTAL. remove, i.e. delete, component/s on the main lane after merging this lane into main',\n ],\n ] as CommandOptions;\n loader = true;\n\n constructor(private workspace: Workspace, private lanes: LanesMain) {}\n\n async report(): Promise<string> {\n throw new BitError(`bit lane remove-comp has been removed. please use \"bit remove\" or \"bit delete\" instead`);\n }\n}\n\nexport class LaneImportCmd implements Command {\n name = 'import <lane>';\n description = `import a remote lane to your workspace and switch to that lane`;\n arguments = [{ name: 'lane', description: 'the remote lane name' }];\n alias = '';\n options = [\n ['x', 'skip-dependency-installation', 'do not install dependencies of the imported components'],\n [\n 'p',\n 'pattern <component-pattern>',\n 'import only components from the lane that fit the specified component-pattern to the workspace. works only when the workspace is empty',\n ],\n ] as CommandOptions;\n loader = true;\n\n constructor(private switchCmd: SwitchCmd) {}\n\n async report(\n [lane]: [string],\n { skipDependencyInstallation = false, pattern }: { skipDependencyInstallation: boolean; pattern?: string }\n ): Promise<string> {\n return this.switchCmd.report([lane], { getAll: true, skipDependencyInstallation, pattern });\n }\n}\n\nexport class LaneCmd implements Command {\n name = 'lane [sub-command]';\n description = 'manage lanes - if no sub-command is used, runs \"bit lane list\"';\n alias = 'l';\n options = [\n ['d', 'details', 'show more details on the state of each component in each lane'],\n ['j', 'json', 'show lanes details in json format'],\n ['r', 'remote <remote-scope-name>', 'show all remote lanes from the specified scope'],\n ['', 'merged', 'list only merged lanes'],\n ['', 'not-merged', \"list only lanes that haven't been merged\"],\n ] as CommandOptions;\n loader = true;\n group = 'collaborate';\n remoteOp = true;\n skipWorkspace = true;\n helpUrl = 'reference/components/lanes';\n commands: Command[] = [];\n\n constructor(private lanes: LanesMain, private workspace: Workspace, private scope: ScopeMain) {}\n\n async report([name]: [string], laneOptions: LaneOptions): Promise<string> {\n return new LaneListCmd(this.lanes, this.workspace, this.scope).report([name], laneOptions);\n }\n}\n\nexport class LaneRemoveReadmeCmd implements Command {\n name = 'remove-readme [laneName]';\n description = 'EXPERIMENTAL. remove lane readme component';\n options = [] as CommandOptions;\n loader = true;\n skipWorkspace = false;\n\n constructor(private lanes: LanesMain) {}\n\n async report([laneName]: [string]): Promise<string> {\n const { result, message } = await this.lanes.removeLaneReadme(laneName);\n\n if (result) {\n return chalk.green(\n `the readme component has been successfully removed from the lane ${\n laneName || this.lanes.getCurrentLaneName()\n }`\n );\n }\n\n return chalk.red(`${message}\\n`);\n }\n}\n\nexport class LaneAddReadmeCmd implements Command {\n name = 'add-readme <component-name> [lane-name]';\n description = 'EXPERIMENTAL. sets an existing component as the readme of a lane';\n arguments = [\n { name: 'component-id', description: \"the component name or id of the component to use as the lane's readme\" },\n { name: 'lane-name', description: 'the lane to attach the readme to (defaults to the current lane)' },\n ];\n options = [] as CommandOptions;\n loader = true;\n skipWorkspace = false;\n\n constructor(private lanes: LanesMain) {}\n\n async report([componentId, laneName]: [string, string]): Promise<string> {\n const { result, message } = await this.lanes.addLaneReadme(componentId, laneName);\n\n if (result)\n return chalk.green(\n `the component ${componentId} has been successfully added as the readme component for the lane ${\n laneName || this.lanes.getCurrentLaneName()\n }`\n );\n\n return chalk.red(\n `${message || ''}\\nthe component ${componentId} could not be added as a readme component for the lane ${\n laneName || this.lanes.getCurrentLaneName()\n }`\n );\n }\n}\n\nfunction outputComponents(components: LaneData['components']): string {\n const componentsTitle = `\\t${chalk.bold(`components (${components.length})`)}\\n`;\n const componentsStr = components.map((c) => `\\t ${c.id.toString()} - ${c.head}`).join('\\n');\n return componentsTitle + componentsStr;\n}\n\nfunction outputReadmeComponent(component: LaneData['readmeComponent']): string {\n if (!component) return '';\n return `\\n\\t${`${chalk.yellow('readme component')}\\n\\t ${component.id} - ${\n component.head ||\n `(unsnapped)\\n\\t(\"use bit snap ${component.id.fullName}\" to snap the readme component on the lane before exporting)`\n }`}\\n`;\n}\n"],"mappings":";;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,IAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,GAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;E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gBAAA;AAED,SAAS9F,gBAAgBA,CAACC,UAAkC,EAAU;EACpE,MAAMgG,eAAe,GAAI,KAAIrH,gBAAK,CAAC0B,IAAI,CAAE,eAAcL,UAAU,CAACtB,MAAO,GAAE,CAAE,IAAG;EAChF,MAAMuH,aAAa,GAAGjG,UAAU,CAACnB,GAAG,CAAEqH,CAAC,IAAM,OAAMA,CAAC,CAAC3G,EAAE,CAACpB,QAAQ,CAAC,CAAE,MAAK+H,CAAC,CAACC,IAAK,EAAC,CAAC,CAACpH,IAAI,CAAC,IAAI,CAAC;EAC5F,OAAOiH,eAAe,GAAGC,aAAa;AACxC;AAEA,SAAStG,qBAAqBA,CAACyG,SAAsC,EAAU;EAC7E,IAAI,CAACA,SAAS,EAAE,OAAO,EAAE;EACzB,OAAQ,OAAO,GAAEzH,gBAAK,CAAC+D,MAAM,CAAC,kBAAkB,CAAE,SAAQ0D,SAAS,CAAC7G,EAAG,MACrE6G,SAAS,CAACD,IAAI,IACb,iCAAgCC,SAAS,CAAC7G,EAAE,CAAC8G,QAAS,8DACxD,EAAE,IAAG;AACR"}
@@ -13,7 +13,7 @@ import { TrackLane } from '@teambit/legacy/dist/scope/scope-json';
13
13
  import { ImporterMain } from '@teambit/importer';
14
14
  import { ComponentID } from '@teambit/component-id';
15
15
  import { Component, ComponentMain } from '@teambit/component';
16
- import { Lane } from '@teambit/legacy/dist/scope/models';
16
+ import { Lane, LaneHistory } from '@teambit/legacy/dist/scope/models';
17
17
  import { ExportMain } from '@teambit/export';
18
18
  import { ComponentCompareMain } from '@teambit/component-compare';
19
19
  import { ComponentWriterMain } from '@teambit/component-writer';
@@ -98,6 +98,8 @@ export declare class LanesMain {
98
98
  notMerged?: boolean;
99
99
  }): Promise<LaneData[]>;
100
100
  parseLaneId(idStr: string): Promise<LaneId>;
101
+ getLaneHistory(laneId: LaneId): Promise<LaneHistory>;
102
+ importLaneHistory(laneId: LaneId): Promise<void>;
101
103
  private filterSoftRemovedLaneComps;
102
104
  getCurrentLaneName(): string | null;
103
105
  getCurrentLaneNameOrAlias(): string | null;
@@ -234,6 +234,13 @@ function _concurrency() {
234
234
  };
235
235
  return data;
236
236
  }
237
+ function _featureToggle() {
238
+ const data = require("@teambit/legacy/dist/api/consumer/lib/feature-toggle");
239
+ _featureToggle = function () {
240
+ return data;
241
+ };
242
+ return data;
243
+ }
237
244
  function _lanes() {
238
245
  const data = require("./lanes.aspect");
239
246
  _lanes = function () {
@@ -348,6 +355,15 @@ class LanesMain {
348
355
  const scope = this.scope.legacyScope;
349
356
  return scope.lanes.parseLaneIdFromString(idStr);
350
357
  }
358
+ async getLaneHistory(laneId) {
359
+ const lane = await this.loadLane(laneId);
360
+ if (!lane) throw new (_bitError().BitError)(`unable to find a lane "${laneId.toString()}"`);
361
+ const laneHistory = await this.scope.legacyScope.lanes.getOrCreateLaneHistory(lane);
362
+ return laneHistory;
363
+ }
364
+ async importLaneHistory(laneId) {
365
+ await this.importer.importLaneObject(laneId, undefined, true);
366
+ }
351
367
  async filterSoftRemovedLaneComps(lanes) {
352
368
  return Promise.all(lanes.map(async lane => {
353
369
  if (lane.id.isDefault()) return lane;
@@ -523,7 +539,7 @@ please create a new lane instead, which will include all components of this lane
523
539
  throw new (_legacyBitId().InvalidScopeName)(remoteScope);
524
540
  }
525
541
  const remoteScopeBefore = lane.scope;
526
- lane.scope = remoteScope;
542
+ lane.changeScope(remoteScope);
527
543
  const newLaneId = _laneId().LaneId.from(laneId.name, remoteScope);
528
544
  const trackData = {
529
545
  localLane: laneNameWithoutScope,
@@ -531,7 +547,9 @@ please create a new lane instead, which will include all components of this lane
531
547
  remoteScope
532
548
  };
533
549
  this.scope.legacyScope.lanes.trackLane(trackData);
534
- await this.scope.legacyScope.lanes.saveLane(lane);
550
+ await this.scope.legacyScope.lanes.saveLane(lane, {
551
+ laneHistoryMsg: `change scope from ${remoteScopeBefore} to ${remoteScope}`
552
+ });
535
553
  this.workspace.consumer.bitMap.setCurrentLane(newLaneId, false);
536
554
  await this.workspace.consumer.onDestroy('lane-scope-change');
537
555
  return {
@@ -762,7 +780,9 @@ please create a new lane instead, which will include all components of this lane
762
780
  await this.workspace.addSpecificComponentConfig(readmeComponentId, _lanes().LanesAspect.id, existingLaneConfig);
763
781
  }
764
782
  lane.setReadmeComponent(undefined);
765
- await scope.lanes.saveLane(lane);
783
+ await scope.lanes.saveLane(lane, {
784
+ laneHistoryMsg: 'remove readme'
785
+ });
766
786
  await this.workspace.bitMap.write(`lane-remove-readme`);
767
787
  return {
768
788
  result: true
@@ -979,7 +999,9 @@ please create a new lane instead, which will include all components of this lane
979
999
  };
980
1000
  }
981
1001
  lane.setReadmeComponent(readmeComponentId);
982
- await scope.lanes.saveLane(lane);
1002
+ await scope.lanes.saveLane(lane, {
1003
+ laneHistoryMsg: 'add readme'
1004
+ });
983
1005
  const existingLaneConfig = (await this.workspace.getSpecificComponentConfig(readmeComponentId, _lanes().LanesAspect.id)) || {};
984
1006
  const remoteLaneIdStr = lane.toLaneId().toString();
985
1007
  if (existingLaneConfig.readme) {
@@ -1085,7 +1107,10 @@ please create a new lane instead, which will include all components of this lane
1085
1107
  const switchCmd = new (_switch().SwitchCmd)(lanesMain);
1086
1108
  const laneCmd = new (_lane().LaneCmd)(lanesMain, workspace, scope);
1087
1109
  laneCmd.commands = [new (_lane().LaneListCmd)(lanesMain, workspace, scope), switchCmd, new (_lane().LaneShowCmd)(lanesMain, workspace, scope), new (_lane().LaneCreateCmd)(lanesMain), new (_lane().LaneRemoveCmd)(lanesMain), new (_lane().LaneChangeScopeCmd)(lanesMain), new (_lane().LaneAliasCmd)(lanesMain), new (_lane().LaneRenameCmd)(lanesMain), new (_lanesModules().LaneDiffCmd)(workspace, scope, componentCompare), new (_lane().LaneAddReadmeCmd)(lanesMain), new (_lane().LaneRemoveReadmeCmd)(lanesMain), new (_lane().LaneImportCmd)(switchCmd), new (_lane().LaneRemoveCompCmd)(workspace, lanesMain)];
1088
- cli.register(laneCmd, switchCmd);
1110
+ if ((0, _featureToggle().isFeatureEnabled)(_featureToggle().SUPPORT_LANE_HISTORY)) {
1111
+ laneCmd.commands.push(new (_lane().LaneHistoryCmd)(lanesMain));
1112
+ }
1113
+ cli.register(laneCmd, switchCmd, new (_lane().CatLaneHistoryCmd)(lanesMain));
1089
1114
  cli.registerOnStart(async () => {
1090
1115
  await lanesMain.recreateNewLaneIfDeleted();
1091
1116
  });
@@ -1 +1 @@
1
- {"version":3,"names":["_cli","data","require","_pMapSeries","_interopRequireDefault","_pMap","_scope","_graphql","_express","_workspace","_getRemoteByName","_lanesModules","_laneId","_bitError","_logger","_mergeVersion","_importer","_componentId","_legacyBitId","_component","_removeLanes","_models","_getDivergeData","_export","_lodash","_componentCompare","_objects","_componentWriter","_remove","_merging","_checkout","_lanesEntities","_exceptions","_noCommonSnap","_concurrency","_lanes","_lane","_lanes2","_switch","_switchLanes","_createLane","_lanesCreate","_lanesDelete","_lanesRestore","obj","__esModule","default","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","key","value","_toPropertyKey","configurable","writable","i","_toPrimitive","String","Symbol","toPrimitive","call","TypeError","Number","LanesMain","constructor","workspace","scope","merging","componentAspect","logger","importer","exporter","componentCompare","componentWriter","remove","checkout","getLanes","name","remote","merged","showDefaultLane","notMerged","showMergeData","Boolean","consumer","laneId","LaneId","from","undefined","remoteObj","getRemoteByName","lanes","listLanes","toString","DEFAULT_LANE","defaultLane","getLaneDataOfDefaultLane","legacyScope","getLanesData","filterSoftRemovedLaneComps","parseLaneId","idStr","parseLaneIdFromString","Promise","all","map","lane","id","isDefault","componentIds","compact","getLaneComponentIds","laneCompId","isComponentRemoved","err","ComponentNotFound","warn","head","version","laneData","components","getCurrentLaneName","getCurrentLaneId","getCurrentLaneNameOrAlias","currentLaneId","trackingData","getLocalTrackedLaneByRemoteName","getCurrentLane","loadLane","getDefaultLaneId","setCurrentLane","alias","exported","createLane","forkLaneNewScope","newLane","createLaneInScope","toLaneId","hash","throwForInvalidLaneName","currentLaneScope","BitError","defaultScope","laneObj","trackLaneData","localLane","remoteLane","remoteScope","trackLane","scopeJson","setLaneAsNew","onDestroy","results","localName","remoteName","beforeTrackData","getRemoteTrackedDataByLocalLane","beforeTrackDataCloned","afterTrackData","aliasLane","laneName","includes","LANE_REMOTE_DELIMITER","trackData","laneNameWithoutScope","split","removeTrackLane","changeScope","isNew","isValidScopeName","InvalidScopeName","remoteScopeBefore","newLaneId","saveLane","bitMap","rename","newName","currentName","existingAliasWithNewName","remoteIdStr","objects","remoteLanes","renameRefByNewLaneName","renameLane","isEqual","isExported","isLaneExported","exportLane","exportMany","laneObject","ids","ComponentIdList","idsWithFutureScope","allVersions","importLaneObject","persistIfNotExists","getHeadOnMain","componentId","modelComponent","getModelComponent","fetchLaneWithItsComponents","debug","Error","fetchLaneComponents","removeLanes","laneNames","opts","force","laneResults","restoreLane","laneHash","ref","Ref","objectsFromTrash","getFromTrash","laneIdFromTrash","existingWithSameId","restoreFromTrash","switchLanes","merge","pattern","getAll","skipDependencyInstallation","mergeStrategy","mergeOptions","MergeOptions","join","switchProps","existingOnWorkspaceOnly","checkoutProps","skipNpmInstall","verbose","ignorePackageJson","ignoreDist","isLane","promptMergeOptions","writeConfig","reset","LaneSwitcher","switch","getDiff","values","diffOptions","laneDiffGenerator","LaneDiffGenerator","generate","getLaneComponentModels","host","getHost","laneComponentIds","getMany","laneComponents","bitIdsFromBitmap","getAllBitIdsFromAllLanes","filteredComponentIds","laneComponent","some","bitmapComponentId","isEqualWithoutVersion","legacyIdWithVersion","changeVersion","resolveComponentId","getLaneReadmeComponent","laneReadmeComponent","readmeComponent","laneReadmeComponentId","get","removeLaneReadme","currentLaneName","result","message","readmeComponentId","existingLaneConfig","getSpecificComponentConfig","LanesAspect","remoteLaneIdStr","readme","removeSpecificComponentConfig","addSpecificComponentConfig","setReadmeComponent","write","diffStatus","sourceLaneId","targetLaneId","options","profile","sourceLane","sourceLaneComponents","main","targetLane","targetLaneIds","toBitIds","targetMainHeads","headOnMain","importObjectsFromMainIfExist","diffProps","sourceVersionObj","load","isRemoved","headOnTargetLane","searchWithoutVersion","targetVersionObj","sourceHead","targetHead","snapDistancesByComponentId","Map","pMap","snapsDistance","getSnapsDistanceBetweenTwoSnaps","set","concurrency","concurrentComponentsLimit","commonSnapsToImport","s","commonSnapBeforeDiverge","sourceOrTargetLane","skipChanges","scopeImporter","importWithoutDeps","fromArray","cache","reason","pMapSeries","componentDiffStatus","source","target","componentsStatus","noCommonSnap","NoCommonSnap","upToDate","isUpToDate","unrelated","changes","commonSnap","getChanges","ChangeType","NEW","compare","fields","code","c","status","NONE","changed","f","SOURCE_CODE","ASPECTS","depsFields","field","fieldName","DEPENDENCY","changeType","onSource","snapsOnSourceOnly","onTarget","snapsOnTargetOnly","common","componentDiffStatusOld","recreateNewLaneIfDeleted","getCurrentLaneObject","addLaneReadme","readmeComponentIdStr","listUpdatesFromForked","componentsList","isOnMain","forkedFromLaneId","forkedFrom","forkedFromLane","workspaceIds","getAllBitIds","duringMergeIds","listDuringMergeStateComponents","componentsFromModel","getModelComponents","compFromModelOnWorkspace","hasWithoutVersion","toComponentId","remoteForkedLane","getRemoteLane","headOnForked","find","headOnLane","laneHeadLocal","divergeData","getDivergeData","repo","throws","bitIds","scopeComponents","list","component","getIdsOfDefaultLane","bitId","isMerged","createRoutePath","deleteRoutePath","restoreRoutePath","provider","cli","graphql","loggerMain","express","createLogger","lanesMain","switchCmd","SwitchCmd","laneCmd","LaneCmd","commands","LaneListCmd","LaneShowCmd","LaneCreateCmd","LaneRemoveCmd","LaneChangeScopeCmd","LaneAliasCmd","LaneRenameCmd","LaneDiffCmd","LaneAddReadmeCmd","LaneRemoveReadmeCmd","LaneImportCmd","LaneRemoveCompCmd","register","registerOnStart","lanesSchema","LanesCreateRoute","LanesDeleteRoute","LanesRestoreRoute","exports","CLIAspect","ScopeAspect","WorkspaceAspect","GraphqlAspect","MergingAspect","ComponentAspect","LoggerAspect","ImporterAspect","ExportAspect","ExpressAspect","ComponentCompareAspect","ComponentWriterAspect","RemoveAspect","CheckoutAspect","MainRuntime","addRuntime","_default"],"sources":["lanes.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport pMapSeries from 'p-map-series';\nimport pMap from 'p-map';\nimport { ScopeMain, ScopeAspect } from '@teambit/scope';\nimport { GraphqlAspect, GraphqlMain } from '@teambit/graphql';\nimport { ExpressAspect, ExpressMain } from '@teambit/express';\nimport { Workspace, WorkspaceAspect } from '@teambit/workspace';\nimport getRemoteByName from '@teambit/legacy/dist/remotes/get-remote-by-name';\nimport { LaneDiffCmd, LaneDiffGenerator, LaneDiffResults } from '@teambit/lanes.modules.diff';\nimport { LaneData } from '@teambit/legacy/dist/scope/lanes/lanes';\nimport { LaneId, DEFAULT_LANE, LANE_REMOTE_DELIMITER } from '@teambit/lane-id';\nimport { BitError } from '@teambit/bit-error';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { DiffOptions } from '@teambit/legacy/dist/consumer/component-ops/components-diff';\nimport { MergeStrategy, MergeOptions } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { TrackLane } from '@teambit/legacy/dist/scope/scope-json';\nimport { ImporterAspect, ImporterMain } from '@teambit/importer';\nimport { ComponentIdList, ComponentID } from '@teambit/component-id';\nimport { InvalidScopeName, isValidScopeName } from '@teambit/legacy-bit-id';\nimport ComponentAspect, { Component, ComponentMain } from '@teambit/component';\nimport removeLanes from '@teambit/legacy/dist/consumer/lanes/remove-lanes';\nimport { Lane, Version } from '@teambit/legacy/dist/scope/models';\nimport { getDivergeData } from '@teambit/legacy/dist/scope/component-ops/get-diverge-data';\nimport { Scope as LegacyScope } from '@teambit/legacy/dist/scope';\nimport { ExportAspect, ExportMain } from '@teambit/export';\nimport { compact } from 'lodash';\nimport { ComponentCompareMain, ComponentCompareAspect } from '@teambit/component-compare';\nimport { Ref } from '@teambit/legacy/dist/scope/objects';\nimport ComponentWriterAspect, { ComponentWriterMain } from '@teambit/component-writer';\nimport { SnapsDistance } from '@teambit/legacy/dist/scope/component-ops/snaps-distance';\nimport RemoveAspect, { RemoveMain } from '@teambit/remove';\nimport { MergingMain, MergingAspect } from '@teambit/merging';\nimport CheckoutAspect, { CheckoutMain } from '@teambit/checkout';\nimport { ChangeType } from '@teambit/lanes.entities.lane-diff';\nimport { ComponentNotFound } from '@teambit/legacy/dist/scope/exceptions';\nimport ComponentsList, { DivergeDataPerId } from '@teambit/legacy/dist/consumer/component/components-list';\nimport { NoCommonSnap } from '@teambit/legacy/dist/scope/exceptions/no-common-snap';\nimport { concurrentComponentsLimit } from '@teambit/legacy/dist/utils/concurrency';\nimport { LanesAspect } from './lanes.aspect';\nimport {\n LaneCmd,\n LaneCreateCmd,\n LaneImportCmd,\n LaneListCmd,\n LaneRemoveCmd,\n LaneShowCmd,\n LaneChangeScopeCmd,\n LaneAliasCmd,\n LaneRenameCmd,\n LaneAddReadmeCmd,\n LaneRemoveReadmeCmd,\n LaneRemoveCompCmd,\n} from './lane.cmd';\nimport { lanesSchema } from './lanes.graphql';\nimport { SwitchCmd } from './switch.cmd';\nimport { LaneSwitcher } from './switch-lanes';\nimport { createLane, createLaneInScope, throwForInvalidLaneName } from './create-lane';\nimport { LanesCreateRoute } from './lanes.create.route';\nimport { LanesDeleteRoute } from './lanes.delete.route';\nimport { LanesRestoreRoute } from './lanes.restore.route';\n\nexport { Lane };\n\nexport type SnapsDistanceObj = {\n onSource: string[];\n onTarget: string[];\n common?: string;\n};\n\nexport type LaneResults = {\n lanes: LaneData[];\n currentLane?: string | null;\n};\n\nexport type CreateLaneOptions = {\n scope?: string; // default to the defaultScope in workspace.jsonc\n alias?: string; // default to the remote name\n forkLaneNewScope?: boolean;\n};\n\nexport type SwitchLaneOptions = {\n alias?: string;\n merge?: MergeStrategy;\n getAll?: boolean;\n pattern?: string;\n skipDependencyInstallation?: boolean;\n verbose?: boolean;\n override?: boolean;\n};\n\nexport type LaneComponentDiffStatus = {\n componentId: ComponentID;\n sourceHead: string;\n targetHead?: string;\n /**\n * @deprecated\n * use changes to get list of all the changes\n */\n changeType?: ChangeType;\n changes?: ChangeType[];\n upToDate?: boolean;\n snapsDistance?: SnapsDistanceObj;\n unrelated?: boolean;\n};\n\nexport type LaneDiffStatusOptions = {\n skipChanges?: boolean;\n};\n\nexport type LaneDiffStatus = {\n source: LaneId;\n target: LaneId;\n componentsStatus: LaneComponentDiffStatus[];\n};\n\nexport type MarkRemoveOnLaneResult = { removedFromWs: ComponentID[]; markedRemoved: ComponentID[] };\n\nexport type CreateLaneResult = {\n laneId: LaneId;\n hash: string;\n alias?: string;\n};\n\nexport class LanesMain {\n constructor(\n private workspace: Workspace | undefined,\n private scope: ScopeMain,\n private merging: MergingMain,\n private componentAspect: ComponentMain,\n public logger: Logger,\n readonly importer: ImporterMain,\n private exporter: ExportMain,\n private componentCompare: ComponentCompareMain,\n readonly componentWriter: ComponentWriterMain,\n private remove: RemoveMain,\n readonly checkout: CheckoutMain\n ) {}\n\n async getLanes({\n name,\n remote,\n merged,\n showDefaultLane,\n notMerged,\n }: {\n name?: string;\n remote?: string;\n merged?: boolean;\n showDefaultLane?: boolean;\n notMerged?: boolean;\n }): Promise<LaneData[]> {\n const showMergeData = Boolean(merged || notMerged);\n const consumer = this.workspace?.consumer;\n\n if (remote) {\n const laneId = name ? LaneId.from(name, remote) : undefined;\n const remoteObj = await getRemoteByName(remote, consumer);\n const lanes = await remoteObj.listLanes(laneId?.toString(), showMergeData);\n // no need to filter soft-removed here. it was filtered already in the remote\n return lanes;\n }\n\n if (name === DEFAULT_LANE) {\n const defaultLane = await this.getLaneDataOfDefaultLane();\n return defaultLane ? [defaultLane] : [];\n }\n\n const lanes = await this.scope.legacyScope.lanes.getLanesData(this.scope.legacyScope, name, showMergeData);\n\n if (showDefaultLane) {\n const defaultLane = await this.getLaneDataOfDefaultLane();\n if (defaultLane) lanes.push(defaultLane);\n }\n\n return this.filterSoftRemovedLaneComps(lanes);\n }\n\n async parseLaneId(idStr: string): Promise<LaneId> {\n const scope: LegacyScope = this.scope.legacyScope;\n return scope.lanes.parseLaneIdFromString(idStr);\n }\n\n private async filterSoftRemovedLaneComps(lanes: LaneData[]): Promise<LaneData[]> {\n return Promise.all(\n lanes.map(async (lane) => {\n if (lane.id.isDefault()) return lane;\n\n const componentIds = compact(\n await Promise.all(\n (\n await this.getLaneComponentIds(lane)\n ).map(async (laneCompId) => {\n try {\n if (await this.scope.isComponentRemoved(laneCompId)) return undefined;\n } catch (err) {\n // if (err instanceof ComponentNotFound)\n // throw new Error(\n // `component \"${laneCompId.toString()}\" from the lane \"${lane.id.toString()}\" not found`\n // );\n // throw err;\n if (err instanceof ComponentNotFound)\n this.logger.warn(\n `component \"${laneCompId.toString()}\" from the lane \"${lane.id.toString()}\" not found`\n );\n\n return undefined;\n }\n return { id: laneCompId, head: laneCompId.version as string };\n })\n )\n );\n\n const laneData: LaneData = {\n ...lane,\n components: componentIds,\n };\n return laneData;\n })\n );\n }\n\n getCurrentLaneName(): string | null {\n return this.getCurrentLaneId()?.name || null;\n }\n\n getCurrentLaneNameOrAlias(): string | null {\n const currentLaneId = this.getCurrentLaneId();\n if (!currentLaneId) return null;\n const trackingData = this.scope.legacyScope.lanes.getLocalTrackedLaneByRemoteName(\n currentLaneId.name,\n currentLaneId.scope\n );\n return trackingData || currentLaneId.name;\n }\n\n getCurrentLaneId(): LaneId | null {\n if (!this.workspace) return null;\n return this.workspace.consumer.getCurrentLaneId();\n }\n\n /**\n * get the currently checked out lane object, if on main - return null.\n */\n async getCurrentLane(): Promise<Lane | null> {\n const laneId = this.getCurrentLaneId();\n if (!laneId || laneId.isDefault()) return null;\n return this.loadLane(laneId);\n }\n\n getDefaultLaneId(): LaneId {\n return LaneId.from(DEFAULT_LANE, this.scope.name);\n }\n\n setCurrentLane(laneId: LaneId, alias?: string, exported?: boolean) {\n this.workspace?.consumer.setCurrentLane(laneId, exported);\n }\n\n async createLane(\n name: string,\n { scope, alias, forkLaneNewScope }: CreateLaneOptions = {}\n ): Promise<CreateLaneResult> {\n if (!this.workspace) {\n const newLane = await createLaneInScope(name, this.scope);\n return {\n laneId: newLane.toLaneId(),\n hash: newLane.hash().toString(),\n };\n }\n if (alias) {\n throwForInvalidLaneName(alias);\n }\n const currentLaneId = this.workspace.getCurrentLaneId();\n const currentLaneScope = currentLaneId.isDefault() ? undefined : currentLaneId.scope;\n if (!forkLaneNewScope && !currentLaneId.isDefault() && scope && currentLaneScope !== scope) {\n throw new BitError(`you're about to create a lane forked from ${currentLaneId.toString()} and assign it to a different scope \"${scope}\".\nif the lane components have a large history, it would be best to stick with the same scope as the current lane.\nto do that, re-run the command without the \"--scope\" flag. it will create the lane and set the scope to \"${currentLaneScope}\"\nif you wish to keep ${scope} scope, please re-run the command with \"--fork-lane-new-scope\" flag.`);\n }\n scope = scope || (currentLaneId.isDefault() ? this.workspace.defaultScope : currentLaneId.scope);\n const laneObj = await createLane(this.workspace, name, scope);\n const laneId = LaneId.from(name, scope);\n this.setCurrentLane(laneId, alias, false);\n const trackLaneData = {\n localLane: alias || name,\n remoteLane: name,\n remoteScope: scope,\n };\n this.scope.legacyScope.lanes.trackLane(trackLaneData);\n this.scope.legacyScope.scopeJson.setLaneAsNew(name);\n await this.workspace.consumer.onDestroy('lane-create');\n\n const results = {\n alias,\n laneId: laneObj.toLaneId(),\n hash: laneObj.hash().toString(),\n };\n return results;\n }\n\n async loadLane(id: LaneId): Promise<Lane | null> {\n return this.scope.legacyScope.lanes.loadLane(id);\n }\n\n async trackLane(\n localName: string,\n remoteScope: string,\n remoteName?: string\n ): Promise<{ beforeTrackData?: TrackLane; afterTrackData: TrackLane }> {\n if (!this.workspace) {\n throw new BitError(`unable to track a lane outside of Bit workspace`);\n }\n const laneId = await this.scope.legacyScope.lanes.parseLaneIdFromString(localName);\n const lane = await this.loadLane(laneId);\n if (!lane) {\n throw new BitError(`unable to find a local lane \"${localName}\"`);\n }\n const beforeTrackData = this.scope.legacyScope.lanes.getRemoteTrackedDataByLocalLane(localName);\n const beforeTrackDataCloned = beforeTrackData ? { ...beforeTrackData } : undefined;\n const afterTrackData = {\n localLane: localName,\n remoteLane: remoteName || beforeTrackData?.remoteLane || localName,\n remoteScope,\n };\n this.scope.legacyScope.lanes.trackLane(afterTrackData);\n await this.workspace.consumer.onDestroy('lane-track');\n\n return { beforeTrackData: beforeTrackDataCloned, afterTrackData };\n }\n\n async aliasLane(laneName: string, alias: string): Promise<{ laneId: LaneId }> {\n if (!this.workspace) {\n throw new BitError(`unable to alias a lane outside of Bit workspace`);\n }\n if (alias.includes(LANE_REMOTE_DELIMITER)) {\n throw new BitError(`an alias cannot include a delimiter \"${LANE_REMOTE_DELIMITER}\"`);\n }\n if (alias === laneName) {\n throw new BitError(`an alias cannot be the same as the lane name`);\n }\n const laneId = await this.scope.legacyScope.lanes.parseLaneIdFromString(laneName);\n const lane = await this.loadLane(laneId);\n if (!lane) {\n throw new BitError(`unable to find a local lane \"${laneName}\"`);\n }\n const trackData = {\n localLane: alias,\n remoteLane: laneId.name,\n remoteScope: laneId.scope,\n };\n const laneNameWithoutScope = laneName.includes(LANE_REMOTE_DELIMITER)\n ? laneName.split(LANE_REMOTE_DELIMITER)[1]\n : laneName;\n this.scope.legacyScope.lanes.removeTrackLane(laneNameWithoutScope);\n this.scope.legacyScope.lanes.trackLane(trackData);\n await this.workspace.consumer.onDestroy('lane-alias');\n\n return { laneId };\n }\n\n async changeScope(remoteScope: string, laneName?: string): Promise<{ remoteScopeBefore: string; localName: string }> {\n if (!this.workspace) {\n throw new BitError(`unable to change-scope of a lane outside of Bit workspace`);\n }\n let laneId: LaneId;\n let laneNameWithoutScope: string;\n if (laneName) {\n laneNameWithoutScope = laneName.includes(LANE_REMOTE_DELIMITER)\n ? laneName.split(LANE_REMOTE_DELIMITER)[1]\n : laneName;\n laneId = await this.scope.legacyScope.lanes.parseLaneIdFromString(laneName);\n } else {\n laneId = this.workspace.getCurrentLaneId();\n laneNameWithoutScope = laneId.name;\n }\n const lane = await this.loadLane(laneId);\n if (!lane) {\n throw new BitError(`unable to find a local lane \"${laneName}\"`);\n }\n if (!lane.isNew) {\n throw new BitError(`changing lane scope-name is allowed for new lanes only. this lane has been exported already.\nplease create a new lane instead, which will include all components of this lane`);\n }\n if (!isValidScopeName(remoteScope)) {\n throw new InvalidScopeName(remoteScope);\n }\n const remoteScopeBefore = lane.scope;\n lane.scope = remoteScope;\n const newLaneId = LaneId.from(laneId.name, remoteScope);\n const trackData = {\n localLane: laneNameWithoutScope,\n remoteLane: laneId.name,\n remoteScope,\n };\n this.scope.legacyScope.lanes.trackLane(trackData);\n await this.scope.legacyScope.lanes.saveLane(lane);\n this.workspace.consumer.bitMap.setCurrentLane(newLaneId, false);\n await this.workspace.consumer.onDestroy('lane-scope-change');\n\n return { remoteScopeBefore, localName: laneNameWithoutScope };\n }\n\n /**\n * change a lane-name and if possible, export the lane to the remote\n */\n async rename(newName: string, laneName?: string): Promise<{ currentName: string }> {\n if (!this.workspace) {\n throw new BitError(`unable to rename a lane outside of Bit workspace`);\n }\n throwForInvalidLaneName(newName);\n const currentName = laneName || this.workspace.getCurrentLaneId().name;\n const existingAliasWithNewName = this.scope.legacyScope.lanes.getRemoteTrackedDataByLocalLane(newName);\n if (existingAliasWithNewName) {\n const remoteIdStr = `${existingAliasWithNewName.remoteLane}/${existingAliasWithNewName.remoteScope}`;\n throw new BitError(`unable to rename to ${newName}. this name is already used to track: ${remoteIdStr}`);\n }\n const laneNameWithoutScope = currentName.includes(LANE_REMOTE_DELIMITER)\n ? currentName.split(LANE_REMOTE_DELIMITER)[1]\n : currentName;\n const laneId = await this.scope.legacyScope.lanes.parseLaneIdFromString(currentName);\n const lane = await this.loadLane(laneId);\n if (!lane) {\n throw new BitError(`unable to find a local lane \"${currentName}\"`);\n }\n\n // rename the ref file\n await this.scope.legacyScope.objects.remoteLanes.renameRefByNewLaneName(laneNameWithoutScope, newName, lane.scope);\n\n // change scope.json related data and change the lane object\n await this.scope.legacyScope.lanes.renameLane(lane, newName);\n\n // change current-lane if needed\n const currentLaneId = this.getCurrentLaneId();\n if (currentLaneId?.isEqual(laneId)) {\n const newLaneId = LaneId.from(newName, lane.scope);\n const isExported = this.workspace.consumer.bitMap.isLaneExported;\n this.setCurrentLane(newLaneId, undefined, isExported);\n }\n\n // this writes the changes done on scope.json file (along with .bitmap)\n await this.workspace.consumer.onDestroy('lane-rename');\n\n return { currentName };\n }\n\n async exportLane(lane: Lane) {\n await this.exporter.exportMany({\n scope: this.scope.legacyScope,\n laneObject: lane,\n ids: new ComponentIdList(),\n idsWithFutureScope: new ComponentIdList(),\n allVersions: false,\n });\n }\n\n async importLaneObject(laneId: LaneId, persistIfNotExists = true): Promise<Lane> {\n return this.importer.importLaneObject(laneId, persistIfNotExists);\n }\n\n /**\n * get the head hash (snap) of main. return undefined if the component exists only on a lane and was never merged to main\n */\n async getHeadOnMain(componentId: ComponentID): Promise<string | undefined> {\n const modelComponent = await this.scope.legacyScope.getModelComponent(componentId);\n return modelComponent.head?.toString();\n }\n\n /**\n * fetch the lane object and its components from the remote.\n * save the objects and the lane to the local scope.\n * this method doesn't change anything in the workspace.\n */\n async fetchLaneWithItsComponents(laneId: LaneId): Promise<Lane> {\n this.logger.debug(`fetching lane ${laneId.toString()}`);\n if (!this.workspace) {\n throw new BitError('unable to fetch lanes outside of Bit workspace');\n }\n const lane = await this.importer.importLaneObject(laneId);\n if (!lane) throw new Error(`unable to import lane ${laneId.toString()} from the remote`);\n\n await this.importer.fetchLaneComponents(lane);\n this.logger.debug(`fetching lane ${laneId.toString()} done, fetched ${lane.components.length} components`);\n return lane;\n }\n\n async removeLanes(laneNames: string[], opts?: { remote: boolean; force: boolean }): Promise<string[]> {\n if (!this.workspace && !opts?.remote) {\n await this.scope.legacyScope.lanes.removeLanes(this.scope.legacyScope, laneNames, true);\n return laneNames;\n }\n const results = await removeLanes(this.workspace?.consumer, laneNames, !!opts?.remote, !!opts?.force);\n if (this.workspace) await this.workspace.consumer.onDestroy('lane-remove');\n\n return results.laneResults;\n }\n\n /**\n * when deleting a lane object, it is sent into the \"trash\" directory in the scope.\n * this method restores it and put it back in the \"objects\" directory.\n * as an argument, it needs a hash. the reason for not supporting lane-id is because the trash may have multiple\n * lanes with the same lane-id but different hashes.\n */\n async restoreLane(laneHash: string) {\n const ref = Ref.from(laneHash);\n const objectsFromTrash = (await this.scope.legacyScope.objects.getFromTrash([ref])) as Lane[];\n const laneIdFromTrash = objectsFromTrash[0].toLaneId();\n const existingWithSameId = await this.loadLane(laneIdFromTrash);\n if (existingWithSameId) {\n if (existingWithSameId.hash().isEqual(ref)) {\n throw new BitError(`unable to restore lane ${laneIdFromTrash.toString()}, as it already exists`);\n }\n throw new BitError(\n `unable to restore lane ${laneIdFromTrash.toString()}, as a lane with the same id already exists`\n );\n }\n await this.scope.legacyScope.objects.restoreFromTrash([ref]);\n }\n\n /**\n * switch to a different local or remote lane.\n * switching to a remote lane also imports and writes the components of that remote lane.\n * by default, only the components existing on the workspace will be imported from that lane, unless the \"getAll\"\n * flag is true.\n */\n async switchLanes(\n laneName: string,\n { alias, merge, pattern, getAll = false, skipDependencyInstallation = false }: SwitchLaneOptions\n ) {\n if (!this.workspace) {\n throw new BitError(`unable to switch lanes outside of Bit workspace`);\n }\n let mergeStrategy;\n if (merge && typeof merge === 'string') {\n const mergeOptions = Object.keys(MergeOptions);\n if (!mergeOptions.includes(merge)) {\n throw new BitError(`merge must be one of the following: ${mergeOptions.join(', ')}`);\n }\n mergeStrategy = merge;\n }\n if (alias) {\n throwForInvalidLaneName(alias);\n }\n\n const switchProps = {\n laneName,\n existingOnWorkspaceOnly: !getAll,\n pattern,\n alias,\n };\n const checkoutProps = {\n mergeStrategy,\n skipNpmInstall: skipDependencyInstallation,\n verbose: false, // not relevant in Harmony\n ignorePackageJson: true, // not relevant in Harmony\n ignoreDist: true, // not relevant in Harmony\n isLane: true,\n promptMergeOptions: false,\n writeConfig: false,\n reset: false,\n all: false,\n };\n return new LaneSwitcher(this.workspace, this.logger, switchProps, checkoutProps, this).switch();\n }\n\n /**\n * the values array may include zero to two values and will be processed as following:\n * [] => diff between the current lane and default lane. (only inside workspace).\n * [to] => diff between the current lane (or default-lane when in scope) and \"to\" lane.\n * [from, to] => diff between \"from\" lane and \"to\" lane.\n */\n public async getDiff(values: string[], diffOptions: DiffOptions = {}, pattern?: string): Promise<LaneDiffResults> {\n const laneDiffGenerator = new LaneDiffGenerator(this.workspace, this.scope, this.componentCompare);\n return laneDiffGenerator.generate(values, diffOptions, pattern);\n }\n\n async getLaneComponentModels(lane: LaneData): Promise<Component[]> {\n const host = this.componentAspect.getHost();\n const laneComponentIds = await this.getLaneComponentIds(lane);\n const components = await host.getMany(laneComponentIds);\n return components;\n }\n\n async getLaneComponentIds(lane: LaneData): Promise<ComponentID[]> {\n if (!lane) return [];\n\n const laneComponents = lane.components;\n const workspace = this.workspace;\n const bitIdsFromBitmap = workspace ? workspace.consumer.bitMap.getAllBitIdsFromAllLanes() : [];\n\n const filteredComponentIds = workspace\n ? laneComponents.filter((laneComponent) =>\n bitIdsFromBitmap.some((bitmapComponentId) => bitmapComponentId.isEqualWithoutVersion(laneComponent.id))\n )\n : laneComponents;\n\n const host = this.componentAspect.getHost();\n\n return Promise.all(\n filteredComponentIds.map((laneComponent) => {\n const legacyIdWithVersion = laneComponent.id.changeVersion(laneComponent.head);\n return host.resolveComponentId(legacyIdWithVersion);\n })\n );\n }\n\n async getLaneReadmeComponent(lane: LaneData): Promise<Component | undefined> {\n if (!lane) return undefined;\n const laneReadmeComponent = lane.readmeComponent;\n if (!laneReadmeComponent) return undefined;\n const host = this.componentAspect.getHost();\n const laneReadmeComponentId = await host.resolveComponentId(\n laneReadmeComponent.id.changeVersion(laneReadmeComponent.head)\n );\n const readmeComponent = await host.get(laneReadmeComponentId);\n return readmeComponent;\n }\n\n async removeLaneReadme(laneName?: string): Promise<{ result: boolean; message?: string }> {\n if (!this.workspace) {\n throw new BitError('unable to remove the lane readme component outside of Bit workspace');\n }\n const currentLaneName = this.getCurrentLaneName();\n\n if (!laneName && !currentLaneName) {\n return {\n result: false,\n message: 'unable to remove the lane readme component. Either pass a laneName or switch to a lane',\n };\n }\n\n const scope: LegacyScope = this.workspace.scope.legacyScope;\n const laneId: LaneId = laneName\n ? await scope.lanes.parseLaneIdFromString(laneName)\n : (this.getCurrentLaneId() as LaneId);\n const lane: Lane | null | undefined = await scope.loadLane(laneId);\n\n if (!lane?.readmeComponent) {\n throw new BitError(`there is no readme component added to the lane ${laneName || currentLaneName}`);\n }\n\n const readmeComponentId = await this.workspace.resolveComponentId(lane.readmeComponent.id);\n const existingLaneConfig =\n (await this.workspace.getSpecificComponentConfig(readmeComponentId, LanesAspect.id)) || {};\n\n const remoteLaneIdStr = lane.toLaneId().toString();\n\n if (existingLaneConfig.readme) {\n delete existingLaneConfig.readme[remoteLaneIdStr];\n await this.workspace.removeSpecificComponentConfig(readmeComponentId, LanesAspect.id, false);\n await this.workspace.addSpecificComponentConfig(readmeComponentId, LanesAspect.id, existingLaneConfig);\n }\n\n lane.setReadmeComponent(undefined);\n await scope.lanes.saveLane(lane);\n await this.workspace.bitMap.write(`lane-remove-readme`);\n\n return { result: true };\n }\n\n async diffStatus(\n sourceLaneId: LaneId,\n targetLaneId?: LaneId,\n options?: LaneDiffStatusOptions\n ): Promise<LaneDiffStatus> {\n this.logger.profile(`diff status for source lane: ${sourceLaneId.name} and target lane: ${targetLaneId?.name}`);\n\n const sourceLane = sourceLaneId.isDefault()\n ? await this.getLaneDataOfDefaultLane()\n : await this.loadLane(sourceLaneId);\n\n const sourceLaneComponents = sourceLaneId.isDefault()\n ? sourceLane?.components.map((main) => ({ id: main.id, head: Ref.from(main.head) }))\n : sourceLane?.components;\n\n const targetLane = targetLaneId ? await this.loadLane(targetLaneId) : undefined;\n const targetLaneIds = targetLane?.toBitIds();\n const host = this.componentAspect.getHost();\n\n const targetMainHeads =\n !targetLaneId || targetLaneId?.isDefault()\n ? compact(\n await Promise.all(\n (sourceLaneComponents || []).map(async ({ id }) => {\n const componentId = await host.resolveComponentId(id);\n const headOnMain = await this.getHeadOnMain(componentId);\n return headOnMain ? id.changeVersion(headOnMain) : undefined;\n })\n )\n )\n : [];\n\n await this.importer.importObjectsFromMainIfExist(targetMainHeads);\n\n const diffProps = compact(\n await Promise.all(\n (sourceLaneComponents || []).map(async ({ id, head }) => {\n const componentId = await host.resolveComponentId(id);\n const sourceVersionObj = (await this.scope.legacyScope.objects.load(head, true)) as Version;\n\n if (sourceVersionObj.isRemoved()) {\n return null;\n }\n\n const headOnTargetLane = targetLaneIds\n ? targetLaneIds.searchWithoutVersion(id)?.version\n : await this.getHeadOnMain(componentId);\n\n if (headOnTargetLane) {\n const targetVersionObj = (await this.scope.legacyScope.objects.load(\n Ref.from(headOnTargetLane),\n true\n )) as Version;\n\n if (targetVersionObj.isRemoved()) {\n return null;\n }\n }\n\n const sourceHead = head.toString();\n const targetHead = headOnTargetLane;\n\n return { componentId, sourceHead, targetHead };\n })\n )\n );\n\n const snapDistancesByComponentId = new Map<\n string,\n {\n snapsDistance: SnapsDistance;\n sourceHead: string;\n targetHead?: string;\n componentId: ComponentID;\n }\n >();\n\n this.logger.profile(\n `get snaps distance for source lane: ${sourceLane?.id.name} and target lane: ${targetLane?.id.name} with ${diffProps.length} components`\n );\n await pMap(\n diffProps,\n async ({ componentId, sourceHead, targetHead }) => {\n const snapsDistance = await this.scope.getSnapsDistanceBetweenTwoSnaps(\n componentId,\n sourceHead,\n targetHead,\n false\n );\n if (snapsDistance) {\n snapDistancesByComponentId.set(componentId.toString(), {\n snapsDistance,\n sourceHead,\n targetHead,\n componentId,\n });\n }\n },\n {\n concurrency: concurrentComponentsLimit(),\n }\n );\n this.logger.profile(\n `get snaps distance for source lane: ${sourceLane?.id.name} and target lane: ${targetLane?.id.name} with ${diffProps.length} components`\n );\n\n const commonSnapsToImport = compact(\n [...snapDistancesByComponentId.values()].map((s) =>\n s.snapsDistance.commonSnapBeforeDiverge\n ? s.componentId.changeVersion(s.snapsDistance.commonSnapBeforeDiverge.hash)\n : null\n )\n );\n\n const sourceOrTargetLane =\n ((sourceLaneId.isDefault() ? null : (sourceLane as Lane)) ||\n (targetLaneId?.isDefault() ? null : (targetLane as Lane))) ??\n undefined;\n\n if (commonSnapsToImport.length > 0 && !options?.skipChanges) {\n await this.scope.legacyScope.scopeImporter.importWithoutDeps(ComponentIdList.fromArray(commonSnapsToImport), {\n cache: true,\n reason: `get the common snap for lane diff`,\n lane: sourceOrTargetLane,\n });\n }\n\n const results = await pMapSeries(diffProps, async ({ componentId, sourceHead, targetHead }) =>\n this.componentDiffStatus(\n componentId,\n sourceHead,\n targetHead,\n snapDistancesByComponentId.get(componentId.toString())?.snapsDistance,\n options\n )\n );\n\n this.logger.profile(`diff status for source lane: ${sourceLaneId.name} and target lane: ${targetLaneId?.name}`);\n\n return {\n source: sourceLaneId,\n target: targetLaneId || this.getDefaultLaneId(),\n componentsStatus: results,\n };\n }\n\n private async componentDiffStatus(\n componentId: ComponentID,\n sourceHead: string,\n targetHead?: string,\n snapsDistance?: SnapsDistance,\n options?: LaneDiffStatusOptions\n ): Promise<LaneComponentDiffStatus> {\n if (snapsDistance?.err) {\n const noCommonSnap = snapsDistance.err instanceof NoCommonSnap;\n\n return {\n componentId,\n sourceHead,\n targetHead,\n upToDate: snapsDistance?.isUpToDate(),\n unrelated: noCommonSnap || undefined,\n changes: [],\n };\n }\n\n const commonSnap = snapsDistance?.commonSnapBeforeDiverge;\n\n const getChanges = async (): Promise<ChangeType[]> => {\n if (!commonSnap) return [ChangeType.NEW];\n\n // import common snap before we compare\n const compare = await this.componentCompare.compare(\n componentId.changeVersion(commonSnap.hash).toString(),\n componentId.changeVersion(sourceHead).toString()\n );\n\n if (!compare.fields.length && (!compare.code.length || !compare.code.some((c) => c.status !== 'UNCHANGED'))) {\n return [ChangeType.NONE];\n }\n\n const changed: ChangeType[] = [];\n\n if (compare.code.some((f) => f.status !== 'UNCHANGED')) {\n changed.push(ChangeType.SOURCE_CODE);\n }\n\n if (compare.fields.length > 0) {\n changed.push(ChangeType.ASPECTS);\n }\n\n const depsFields = ['dependencies', 'devDependencies', 'extensionDependencies'];\n if (compare.fields.some((field) => depsFields.includes(field.fieldName))) {\n changed.push(ChangeType.DEPENDENCY);\n }\n\n return changed;\n };\n\n const changes = !options?.skipChanges ? await getChanges() : undefined;\n const changeType = changes ? changes[0] : undefined;\n\n return {\n componentId,\n changeType,\n changes,\n sourceHead,\n targetHead: commonSnap?.hash,\n upToDate: snapsDistance?.isUpToDate(),\n snapsDistance: {\n onSource: snapsDistance?.snapsOnSourceOnly.map((s) => s.hash) ?? [],\n onTarget: snapsDistance?.snapsOnTargetOnly.map((s) => s.hash) ?? [],\n common: snapsDistance?.commonSnapBeforeDiverge?.hash,\n },\n };\n }\n\n async componentDiffStatusOld(\n componentId: ComponentID,\n sourceHead: string,\n targetHead?: string,\n options?: LaneDiffStatusOptions\n ): Promise<LaneComponentDiffStatus> {\n const snapsDistance = await this.scope.getSnapsDistanceBetweenTwoSnaps(componentId, sourceHead, targetHead, false);\n\n if (snapsDistance?.err) {\n const noCommonSnap = snapsDistance.err instanceof NoCommonSnap;\n\n return {\n componentId,\n sourceHead,\n targetHead,\n upToDate: snapsDistance?.isUpToDate(),\n unrelated: noCommonSnap || undefined,\n changes: [],\n };\n }\n\n const commonSnap = snapsDistance?.commonSnapBeforeDiverge;\n\n const getChanges = async (): Promise<ChangeType[]> => {\n if (!commonSnap) return [ChangeType.NEW];\n\n const compare = await this.componentCompare.compare(\n componentId.changeVersion(commonSnap.hash).toString(),\n componentId.changeVersion(sourceHead).toString()\n );\n\n if (!compare.fields.length && (!compare.code.length || !compare.code.some((c) => c.status !== 'UNCHANGED'))) {\n return [ChangeType.NONE];\n }\n\n const changed: ChangeType[] = [];\n\n if (compare.code.some((f) => f.status !== 'UNCHANGED')) {\n changed.push(ChangeType.SOURCE_CODE);\n }\n\n if (compare.fields.length > 0) {\n changed.push(ChangeType.ASPECTS);\n }\n\n const depsFields = ['dependencies', 'devDependencies', 'extensionDependencies'];\n if (compare.fields.some((field) => depsFields.includes(field.fieldName))) {\n changed.push(ChangeType.DEPENDENCY);\n }\n\n return changed;\n };\n\n const changes = !options?.skipChanges ? await getChanges() : undefined;\n const changeType = changes ? changes[0] : undefined;\n\n return {\n componentId,\n changeType,\n changes,\n sourceHead,\n targetHead: commonSnap?.hash,\n upToDate: snapsDistance?.isUpToDate(),\n snapsDistance: {\n onSource: snapsDistance?.snapsOnSourceOnly.map((s) => s.hash) ?? [],\n onTarget: snapsDistance?.snapsOnTargetOnly.map((s) => s.hash) ?? [],\n common: snapsDistance?.commonSnapBeforeDiverge?.hash,\n },\n };\n }\n\n private async recreateNewLaneIfDeleted() {\n if (!this.workspace) return;\n const laneId = this.getCurrentLaneId();\n if (!laneId || laneId.isDefault() || this.workspace.consumer.bitMap.isLaneExported) {\n return;\n }\n const laneObj = await this.scope.legacyScope.getCurrentLaneObject();\n if (laneObj) {\n return;\n }\n await this.createLane(laneId.name, { scope: laneId.scope });\n }\n\n async addLaneReadme(readmeComponentIdStr: string, laneName?: string): Promise<{ result: boolean; message?: string }> {\n if (!this.workspace) {\n throw new BitError(`unable to track a lane readme component outside of Bit workspace`);\n }\n const readmeComponentId = await this.workspace.resolveComponentId(readmeComponentIdStr);\n\n const scope: LegacyScope = this.workspace.scope.legacyScope;\n const laneId: LaneId = laneName\n ? await scope.lanes.parseLaneIdFromString(laneName)\n : (this.getCurrentLaneId() as LaneId);\n\n const lane: Lane | null | undefined = await scope.loadLane(laneId);\n\n if (!lane) {\n return { result: false, message: `cannot find lane ${laneName}` };\n }\n\n lane.setReadmeComponent(readmeComponentId);\n await scope.lanes.saveLane(lane);\n\n const existingLaneConfig =\n (await this.workspace.getSpecificComponentConfig(readmeComponentId, LanesAspect.id)) || {};\n\n const remoteLaneIdStr = lane.toLaneId().toString();\n\n if (existingLaneConfig.readme) {\n await this.workspace.addSpecificComponentConfig(readmeComponentId, LanesAspect.id, {\n ...existingLaneConfig,\n readme: {\n ...existingLaneConfig.readme,\n [remoteLaneIdStr]: true,\n },\n });\n } else {\n await this.workspace.addSpecificComponentConfig(readmeComponentId, LanesAspect.id, {\n ...existingLaneConfig,\n readme: {\n [remoteLaneIdStr]: true,\n },\n });\n }\n await this.workspace.bitMap.write('lane-add-readme');\n return { result: true };\n }\n\n /**\n * if the local lane was forked from another lane, this gets the differences between the two.\n * it also fetches the original lane from the remote to make sure the data is up to date.\n */\n async listUpdatesFromForked(componentsList: ComponentsList): Promise<DivergeDataPerId[]> {\n const consumer = this.workspace?.consumer;\n if (!consumer) throw new Error(`unable to get listUpdatesFromForked outside of a workspace`);\n if (consumer.isOnMain()) {\n return [];\n }\n const lane = await consumer.getCurrentLaneObject();\n const forkedFromLaneId = lane?.forkedFrom;\n if (!forkedFromLaneId) {\n return [];\n }\n const forkedFromLane = await consumer.scope.loadLane(forkedFromLaneId);\n if (!forkedFromLane) return []; // should we fetch it here?\n\n const workspaceIds = consumer.bitMap.getAllBitIds();\n\n const duringMergeIds = componentsList.listDuringMergeStateComponents();\n\n const componentsFromModel = await componentsList.getModelComponents();\n const compFromModelOnWorkspace = componentsFromModel\n .filter((c) => workspaceIds.hasWithoutVersion(c.toComponentId()))\n // if a component is merge-pending, it needs to be resolved first before getting more updates from main\n .filter((c) => !duringMergeIds.hasWithoutVersion(c.toComponentId()));\n\n // by default, when on a lane, forked is not fetched. we need to fetch it to get the latest updates.\n await this.fetchLaneWithItsComponents(forkedFromLaneId);\n\n const remoteForkedLane = await consumer.scope.objects.remoteLanes.getRemoteLane(forkedFromLaneId);\n if (!remoteForkedLane.length) return [];\n\n const results = await Promise.all(\n compFromModelOnWorkspace.map(async (modelComponent) => {\n const headOnForked = remoteForkedLane.find((c) => c.id.isEqualWithoutVersion(modelComponent.toComponentId()));\n const headOnLane = modelComponent.laneHeadLocal;\n if (!headOnForked || !headOnLane) return undefined;\n const divergeData = await getDivergeData({\n repo: consumer.scope.objects,\n modelComponent,\n targetHead: headOnForked.head,\n sourceHead: headOnLane,\n throws: false,\n });\n if (!divergeData.snapsOnTargetOnly.length && !divergeData.err) return undefined;\n return { id: modelComponent.toComponentId(), divergeData };\n })\n );\n\n return compact(results);\n }\n\n private async getLaneDataOfDefaultLane(): Promise<LaneData | null> {\n const consumer = this.workspace?.consumer;\n let bitIds: ComponentID[] = [];\n if (!consumer) {\n const scopeComponents = await this.scope.list();\n bitIds = scopeComponents.filter((component) => component.head).map((component) => component.id);\n } else {\n bitIds = await consumer.getIdsOfDefaultLane();\n }\n\n return {\n name: DEFAULT_LANE,\n remote: null,\n id: this.getDefaultLaneId(),\n components: bitIds.map((bitId) => ({ id: bitId, head: bitId.version as string })),\n isMerged: null,\n hash: '',\n };\n }\n\n get createRoutePath() {\n return '/lanes/create';\n }\n\n get deleteRoutePath() {\n return '/lanes/delete';\n }\n\n get restoreRoutePath() {\n return '/lanes/restore';\n }\n\n static slots = [];\n static dependencies = [\n CLIAspect,\n ScopeAspect,\n WorkspaceAspect,\n GraphqlAspect,\n MergingAspect,\n ComponentAspect,\n LoggerAspect,\n ImporterAspect,\n ExportAspect,\n ExpressAspect,\n ComponentCompareAspect,\n ComponentWriterAspect,\n RemoveAspect,\n CheckoutAspect,\n ];\n static runtime = MainRuntime;\n static async provider([\n cli,\n scope,\n workspace,\n graphql,\n merging,\n component,\n loggerMain,\n importer,\n exporter,\n express,\n componentCompare,\n componentWriter,\n remove,\n checkout,\n ]: [\n CLIMain,\n ScopeMain,\n Workspace,\n GraphqlMain,\n MergingMain,\n ComponentMain,\n LoggerMain,\n ImporterMain,\n ExportMain,\n ExpressMain,\n ComponentCompareMain,\n ComponentWriterMain,\n RemoveMain,\n CheckoutMain\n ]) {\n const logger = loggerMain.createLogger(LanesAspect.id);\n const lanesMain = new LanesMain(\n workspace,\n scope,\n merging,\n component,\n logger,\n importer,\n exporter,\n componentCompare,\n componentWriter,\n remove,\n checkout\n );\n const switchCmd = new SwitchCmd(lanesMain);\n const laneCmd = new LaneCmd(lanesMain, workspace, scope);\n laneCmd.commands = [\n new LaneListCmd(lanesMain, workspace, scope),\n switchCmd,\n new LaneShowCmd(lanesMain, workspace, scope),\n new LaneCreateCmd(lanesMain),\n new LaneRemoveCmd(lanesMain),\n new LaneChangeScopeCmd(lanesMain),\n new LaneAliasCmd(lanesMain),\n new LaneRenameCmd(lanesMain),\n new LaneDiffCmd(workspace, scope, componentCompare),\n new LaneAddReadmeCmd(lanesMain),\n new LaneRemoveReadmeCmd(lanesMain),\n new LaneImportCmd(switchCmd),\n new LaneRemoveCompCmd(workspace, lanesMain),\n ];\n cli.register(laneCmd, switchCmd);\n cli.registerOnStart(async () => {\n await lanesMain.recreateNewLaneIfDeleted();\n });\n graphql.register(lanesSchema(lanesMain));\n express.register([\n new LanesCreateRoute(lanesMain, logger),\n new LanesDeleteRoute(lanesMain, logger),\n new LanesRestoreRoute(lanesMain, logger),\n ]);\n return lanesMain;\n }\n}\n\nLanesAspect.addRuntime(LanesMain);\n\nexport default LanesMain;\n"],"mappings":";;;;;;;;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,YAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,MAAA;EAAA,MAAAJ,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAG,KAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,OAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,MAAA,YAAAA,CAAA;IAAA,OAAAL,IAA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SAAS,CAAC,CAAC;IACxCF,OAAO,CAACoB,QAAQ,CAAC,CACf,KAAIG,+BAAgB,EAACrB,SAAS,EAAE9U,MAAM,CAAC,EACvC,KAAIoW,+BAAgB,EAACtB,SAAS,EAAE9U,MAAM,CAAC,EACvC,KAAIqW,iCAAiB,EAACvB,SAAS,EAAE9U,MAAM,CAAC,CACzC,CAAC;IACF,OAAO8U,SAAS;EAClB;AACF;AAACwB,OAAA,CAAA5W,SAAA,GAAAA,SAAA;AAAAjB,eAAA,CApiCYiB,SAAS,WAw8BL,EAAE;AAAAjB,eAAA,CAx8BNiB,SAAS,kBAy8BE,CACpB6W,gBAAS,EACTC,oBAAW,EACXC,4BAAe,EACfC,wBAAa,EACbC,wBAAa,EACbC,oBAAe,EACfC,sBAAY,EACZC,0BAAc,EACdC,sBAAY,EACZC,wBAAa,EACbC,0CAAsB,EACtBC,0BAAqB,EACrBC,iBAAY,EACZC,mBAAc,CACf;AAAA3Y,eAAA,CAx9BUiB,SAAS,aAy9BH2X,kBAAW;AA6E9BxK,oBAAW,CAACyK,UAAU,CAAC5X,SAAS,CAAC;AAAC,IAAA6X,QAAA,GAAAjB,OAAA,CAAA/Y,OAAA,GAEnBmC,SAAS"}
1
+ {"version":3,"names":["_cli","data","require","_pMapSeries","_interopRequireDefault","_pMap","_scope","_graphql","_express","_workspace","_getRemoteByName","_lanesModules","_laneId","_bitError","_logger","_mergeVersion","_importer","_componentId","_legacyBitId","_component","_removeLanes","_models","_getDivergeData","_export","_lodash","_componentCompare","_objects","_componentWriter","_remove","_merging","_checkout","_lanesEntities","_exceptions","_noCommonSnap","_concurrency","_featureToggle","_lanes","_lane","_lanes2","_switch","_switchLanes","_createLane","_lanesCreate","_lanesDelete","_lanesRestore","obj","__esModule","default","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","key","value","_toPropertyKey","configurable","writable","i","_toPrimitive","String","Symbol","toPrimitive","call","TypeError","Number","LanesMain","constructor","workspace","scope","merging","componentAspect","logger","importer","exporter","componentCompare","componentWriter","remove","checkout","getLanes","name","remote","merged","showDefaultLane","notMerged","showMergeData","Boolean","consumer","laneId","LaneId","from","undefined","remoteObj","getRemoteByName","lanes","listLanes","toString","DEFAULT_LANE","defaultLane","getLaneDataOfDefaultLane","legacyScope","getLanesData","filterSoftRemovedLaneComps","parseLaneId","idStr","parseLaneIdFromString","getLaneHistory","lane","loadLane","BitError","laneHistory","getOrCreateLaneHistory","importLaneHistory","importLaneObject","Promise","all","map","id","isDefault","componentIds","compact","getLaneComponentIds","laneCompId","isComponentRemoved","err","ComponentNotFound","warn","head","version","laneData","components","getCurrentLaneName","getCurrentLaneId","getCurrentLaneNameOrAlias","currentLaneId","trackingData","getLocalTrackedLaneByRemoteName","getCurrentLane","getDefaultLaneId","setCurrentLane","alias","exported","createLane","forkLaneNewScope","newLane","createLaneInScope","toLaneId","hash","throwForInvalidLaneName","currentLaneScope","defaultScope","laneObj","trackLaneData","localLane","remoteLane","remoteScope","trackLane","scopeJson","setLaneAsNew","onDestroy","results","localName","remoteName","beforeTrackData","getRemoteTrackedDataByLocalLane","beforeTrackDataCloned","afterTrackData","aliasLane","laneName","includes","LANE_REMOTE_DELIMITER","trackData","laneNameWithoutScope","split","removeTrackLane","changeScope","isNew","isValidScopeName","InvalidScopeName","remoteScopeBefore","newLaneId","saveLane","laneHistoryMsg","bitMap","rename","newName","currentName","existingAliasWithNewName","remoteIdStr","objects","remoteLanes","renameRefByNewLaneName","renameLane","isEqual","isExported","isLaneExported","exportLane","exportMany","laneObject","ids","ComponentIdList","idsWithFutureScope","allVersions","persistIfNotExists","getHeadOnMain","componentId","modelComponent","getModelComponent","fetchLaneWithItsComponents","debug","Error","fetchLaneComponents","removeLanes","laneNames","opts","force","laneResults","restoreLane","laneHash","ref","Ref","objectsFromTrash","getFromTrash","laneIdFromTrash","existingWithSameId","restoreFromTrash","switchLanes","merge","pattern","getAll","skipDependencyInstallation","mergeStrategy","mergeOptions","MergeOptions","join","switchProps","existingOnWorkspaceOnly","checkoutProps","skipNpmInstall","verbose","ignorePackageJson","ignoreDist","isLane","promptMergeOptions","writeConfig","reset","LaneSwitcher","switch","getDiff","values","diffOptions","laneDiffGenerator","LaneDiffGenerator","generate","getLaneComponentModels","host","getHost","laneComponentIds","getMany","laneComponents","bitIdsFromBitmap","getAllBitIdsFromAllLanes","filteredComponentIds","laneComponent","some","bitmapComponentId","isEqualWithoutVersion","legacyIdWithVersion","changeVersion","resolveComponentId","getLaneReadmeComponent","laneReadmeComponent","readmeComponent","laneReadmeComponentId","get","removeLaneReadme","currentLaneName","result","message","readmeComponentId","existingLaneConfig","getSpecificComponentConfig","LanesAspect","remoteLaneIdStr","readme","removeSpecificComponentConfig","addSpecificComponentConfig","setReadmeComponent","write","diffStatus","sourceLaneId","targetLaneId","options","profile","sourceLane","sourceLaneComponents","main","targetLane","targetLaneIds","toBitIds","targetMainHeads","headOnMain","importObjectsFromMainIfExist","diffProps","sourceVersionObj","load","isRemoved","headOnTargetLane","searchWithoutVersion","targetVersionObj","sourceHead","targetHead","snapDistancesByComponentId","Map","pMap","snapsDistance","getSnapsDistanceBetweenTwoSnaps","set","concurrency","concurrentComponentsLimit","commonSnapsToImport","s","commonSnapBeforeDiverge","sourceOrTargetLane","skipChanges","scopeImporter","importWithoutDeps","fromArray","cache","reason","pMapSeries","componentDiffStatus","source","target","componentsStatus","noCommonSnap","NoCommonSnap","upToDate","isUpToDate","unrelated","changes","commonSnap","getChanges","ChangeType","NEW","compare","fields","code","c","status","NONE","changed","f","SOURCE_CODE","ASPECTS","depsFields","field","fieldName","DEPENDENCY","changeType","onSource","snapsOnSourceOnly","onTarget","snapsOnTargetOnly","common","componentDiffStatusOld","recreateNewLaneIfDeleted","getCurrentLaneObject","addLaneReadme","readmeComponentIdStr","listUpdatesFromForked","componentsList","isOnMain","forkedFromLaneId","forkedFrom","forkedFromLane","workspaceIds","getAllBitIds","duringMergeIds","listDuringMergeStateComponents","componentsFromModel","getModelComponents","compFromModelOnWorkspace","hasWithoutVersion","toComponentId","remoteForkedLane","getRemoteLane","headOnForked","find","headOnLane","laneHeadLocal","divergeData","getDivergeData","repo","throws","bitIds","scopeComponents","list","component","getIdsOfDefaultLane","bitId","isMerged","createRoutePath","deleteRoutePath","restoreRoutePath","provider","cli","graphql","loggerMain","express","createLogger","lanesMain","switchCmd","SwitchCmd","laneCmd","LaneCmd","commands","LaneListCmd","LaneShowCmd","LaneCreateCmd","LaneRemoveCmd","LaneChangeScopeCmd","LaneAliasCmd","LaneRenameCmd","LaneDiffCmd","LaneAddReadmeCmd","LaneRemoveReadmeCmd","LaneImportCmd","LaneRemoveCompCmd","isFeatureEnabled","SUPPORT_LANE_HISTORY","LaneHistoryCmd","register","CatLaneHistoryCmd","registerOnStart","lanesSchema","LanesCreateRoute","LanesDeleteRoute","LanesRestoreRoute","exports","CLIAspect","ScopeAspect","WorkspaceAspect","GraphqlAspect","MergingAspect","ComponentAspect","LoggerAspect","ImporterAspect","ExportAspect","ExpressAspect","ComponentCompareAspect","ComponentWriterAspect","RemoveAspect","CheckoutAspect","MainRuntime","addRuntime","_default"],"sources":["lanes.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport pMapSeries from 'p-map-series';\nimport pMap from 'p-map';\nimport { ScopeMain, ScopeAspect } from '@teambit/scope';\nimport { GraphqlAspect, GraphqlMain } from '@teambit/graphql';\nimport { ExpressAspect, ExpressMain } from '@teambit/express';\nimport { Workspace, WorkspaceAspect } from '@teambit/workspace';\nimport getRemoteByName from '@teambit/legacy/dist/remotes/get-remote-by-name';\nimport { LaneDiffCmd, LaneDiffGenerator, LaneDiffResults } from '@teambit/lanes.modules.diff';\nimport { LaneData } from '@teambit/legacy/dist/scope/lanes/lanes';\nimport { LaneId, DEFAULT_LANE, LANE_REMOTE_DELIMITER } from '@teambit/lane-id';\nimport { BitError } from '@teambit/bit-error';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { DiffOptions } from '@teambit/legacy/dist/consumer/component-ops/components-diff';\nimport { MergeStrategy, MergeOptions } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { TrackLane } from '@teambit/legacy/dist/scope/scope-json';\nimport { ImporterAspect, ImporterMain } from '@teambit/importer';\nimport { ComponentIdList, ComponentID } from '@teambit/component-id';\nimport { InvalidScopeName, isValidScopeName } from '@teambit/legacy-bit-id';\nimport ComponentAspect, { Component, ComponentMain } from '@teambit/component';\nimport removeLanes from '@teambit/legacy/dist/consumer/lanes/remove-lanes';\nimport { Lane, LaneHistory, Version } from '@teambit/legacy/dist/scope/models';\nimport { getDivergeData } from '@teambit/legacy/dist/scope/component-ops/get-diverge-data';\nimport { Scope as LegacyScope } from '@teambit/legacy/dist/scope';\nimport { ExportAspect, ExportMain } from '@teambit/export';\nimport { compact } from 'lodash';\nimport { ComponentCompareMain, ComponentCompareAspect } from '@teambit/component-compare';\nimport { Ref } from '@teambit/legacy/dist/scope/objects';\nimport ComponentWriterAspect, { ComponentWriterMain } from '@teambit/component-writer';\nimport { SnapsDistance } from '@teambit/legacy/dist/scope/component-ops/snaps-distance';\nimport RemoveAspect, { RemoveMain } from '@teambit/remove';\nimport { MergingMain, MergingAspect } from '@teambit/merging';\nimport CheckoutAspect, { CheckoutMain } from '@teambit/checkout';\nimport { ChangeType } from '@teambit/lanes.entities.lane-diff';\nimport { ComponentNotFound } from '@teambit/legacy/dist/scope/exceptions';\nimport ComponentsList, { DivergeDataPerId } from '@teambit/legacy/dist/consumer/component/components-list';\nimport { NoCommonSnap } from '@teambit/legacy/dist/scope/exceptions/no-common-snap';\nimport { concurrentComponentsLimit } from '@teambit/legacy/dist/utils/concurrency';\nimport { SUPPORT_LANE_HISTORY, isFeatureEnabled } from '@teambit/legacy/dist/api/consumer/lib/feature-toggle';\nimport { LanesAspect } from './lanes.aspect';\nimport {\n LaneCmd,\n LaneCreateCmd,\n LaneImportCmd,\n LaneListCmd,\n LaneRemoveCmd,\n LaneShowCmd,\n LaneChangeScopeCmd,\n LaneAliasCmd,\n LaneRenameCmd,\n LaneAddReadmeCmd,\n LaneRemoveReadmeCmd,\n LaneRemoveCompCmd,\n CatLaneHistoryCmd,\n LaneHistoryCmd,\n} from './lane.cmd';\nimport { lanesSchema } from './lanes.graphql';\nimport { SwitchCmd } from './switch.cmd';\nimport { LaneSwitcher } from './switch-lanes';\nimport { createLane, createLaneInScope, throwForInvalidLaneName } from './create-lane';\nimport { LanesCreateRoute } from './lanes.create.route';\nimport { LanesDeleteRoute } from './lanes.delete.route';\nimport { LanesRestoreRoute } from './lanes.restore.route';\n\nexport { Lane };\n\nexport type SnapsDistanceObj = {\n onSource: string[];\n onTarget: string[];\n common?: string;\n};\n\nexport type LaneResults = {\n lanes: LaneData[];\n currentLane?: string | null;\n};\n\nexport type CreateLaneOptions = {\n scope?: string; // default to the defaultScope in workspace.jsonc\n alias?: string; // default to the remote name\n forkLaneNewScope?: boolean;\n};\n\nexport type SwitchLaneOptions = {\n alias?: string;\n merge?: MergeStrategy;\n getAll?: boolean;\n pattern?: string;\n skipDependencyInstallation?: boolean;\n verbose?: boolean;\n override?: boolean;\n};\n\nexport type LaneComponentDiffStatus = {\n componentId: ComponentID;\n sourceHead: string;\n targetHead?: string;\n /**\n * @deprecated\n * use changes to get list of all the changes\n */\n changeType?: ChangeType;\n changes?: ChangeType[];\n upToDate?: boolean;\n snapsDistance?: SnapsDistanceObj;\n unrelated?: boolean;\n};\n\nexport type LaneDiffStatusOptions = {\n skipChanges?: boolean;\n};\n\nexport type LaneDiffStatus = {\n source: LaneId;\n target: LaneId;\n componentsStatus: LaneComponentDiffStatus[];\n};\n\nexport type MarkRemoveOnLaneResult = { removedFromWs: ComponentID[]; markedRemoved: ComponentID[] };\n\nexport type CreateLaneResult = {\n laneId: LaneId;\n hash: string;\n alias?: string;\n};\n\nexport class LanesMain {\n constructor(\n private workspace: Workspace | undefined,\n private scope: ScopeMain,\n private merging: MergingMain,\n private componentAspect: ComponentMain,\n public logger: Logger,\n readonly importer: ImporterMain,\n private exporter: ExportMain,\n private componentCompare: ComponentCompareMain,\n readonly componentWriter: ComponentWriterMain,\n private remove: RemoveMain,\n readonly checkout: CheckoutMain\n ) {}\n\n async getLanes({\n name,\n remote,\n merged,\n showDefaultLane,\n notMerged,\n }: {\n name?: string;\n remote?: string;\n merged?: boolean;\n showDefaultLane?: boolean;\n notMerged?: boolean;\n }): Promise<LaneData[]> {\n const showMergeData = Boolean(merged || notMerged);\n const consumer = this.workspace?.consumer;\n\n if (remote) {\n const laneId = name ? LaneId.from(name, remote) : undefined;\n const remoteObj = await getRemoteByName(remote, consumer);\n const lanes = await remoteObj.listLanes(laneId?.toString(), showMergeData);\n // no need to filter soft-removed here. it was filtered already in the remote\n return lanes;\n }\n\n if (name === DEFAULT_LANE) {\n const defaultLane = await this.getLaneDataOfDefaultLane();\n return defaultLane ? [defaultLane] : [];\n }\n\n const lanes = await this.scope.legacyScope.lanes.getLanesData(this.scope.legacyScope, name, showMergeData);\n\n if (showDefaultLane) {\n const defaultLane = await this.getLaneDataOfDefaultLane();\n if (defaultLane) lanes.push(defaultLane);\n }\n\n return this.filterSoftRemovedLaneComps(lanes);\n }\n\n async parseLaneId(idStr: string): Promise<LaneId> {\n const scope: LegacyScope = this.scope.legacyScope;\n return scope.lanes.parseLaneIdFromString(idStr);\n }\n\n async getLaneHistory(laneId: LaneId): Promise<LaneHistory> {\n const lane = await this.loadLane(laneId);\n if (!lane) throw new BitError(`unable to find a lane \"${laneId.toString()}\"`);\n const laneHistory = await this.scope.legacyScope.lanes.getOrCreateLaneHistory(lane);\n return laneHistory;\n }\n\n async importLaneHistory(laneId: LaneId) {\n await this.importer.importLaneObject(laneId, undefined, true);\n }\n\n private async filterSoftRemovedLaneComps(lanes: LaneData[]): Promise<LaneData[]> {\n return Promise.all(\n lanes.map(async (lane) => {\n if (lane.id.isDefault()) return lane;\n\n const componentIds = compact(\n await Promise.all(\n (\n await this.getLaneComponentIds(lane)\n ).map(async (laneCompId) => {\n try {\n if (await this.scope.isComponentRemoved(laneCompId)) return undefined;\n } catch (err) {\n // if (err instanceof ComponentNotFound)\n // throw new Error(\n // `component \"${laneCompId.toString()}\" from the lane \"${lane.id.toString()}\" not found`\n // );\n // throw err;\n if (err instanceof ComponentNotFound)\n this.logger.warn(\n `component \"${laneCompId.toString()}\" from the lane \"${lane.id.toString()}\" not found`\n );\n\n return undefined;\n }\n return { id: laneCompId, head: laneCompId.version as string };\n })\n )\n );\n\n const laneData: LaneData = {\n ...lane,\n components: componentIds,\n };\n return laneData;\n })\n );\n }\n\n getCurrentLaneName(): string | null {\n return this.getCurrentLaneId()?.name || null;\n }\n\n getCurrentLaneNameOrAlias(): string | null {\n const currentLaneId = this.getCurrentLaneId();\n if (!currentLaneId) return null;\n const trackingData = this.scope.legacyScope.lanes.getLocalTrackedLaneByRemoteName(\n currentLaneId.name,\n currentLaneId.scope\n );\n return trackingData || currentLaneId.name;\n }\n\n getCurrentLaneId(): LaneId | null {\n if (!this.workspace) return null;\n return this.workspace.consumer.getCurrentLaneId();\n }\n\n /**\n * get the currently checked out lane object, if on main - return null.\n */\n async getCurrentLane(): Promise<Lane | null> {\n const laneId = this.getCurrentLaneId();\n if (!laneId || laneId.isDefault()) return null;\n return this.loadLane(laneId);\n }\n\n getDefaultLaneId(): LaneId {\n return LaneId.from(DEFAULT_LANE, this.scope.name);\n }\n\n setCurrentLane(laneId: LaneId, alias?: string, exported?: boolean) {\n this.workspace?.consumer.setCurrentLane(laneId, exported);\n }\n\n async createLane(\n name: string,\n { scope, alias, forkLaneNewScope }: CreateLaneOptions = {}\n ): Promise<CreateLaneResult> {\n if (!this.workspace) {\n const newLane = await createLaneInScope(name, this.scope);\n return {\n laneId: newLane.toLaneId(),\n hash: newLane.hash().toString(),\n };\n }\n if (alias) {\n throwForInvalidLaneName(alias);\n }\n const currentLaneId = this.workspace.getCurrentLaneId();\n const currentLaneScope = currentLaneId.isDefault() ? undefined : currentLaneId.scope;\n if (!forkLaneNewScope && !currentLaneId.isDefault() && scope && currentLaneScope !== scope) {\n throw new BitError(`you're about to create a lane forked from ${currentLaneId.toString()} and assign it to a different scope \"${scope}\".\nif the lane components have a large history, it would be best to stick with the same scope as the current lane.\nto do that, re-run the command without the \"--scope\" flag. it will create the lane and set the scope to \"${currentLaneScope}\"\nif you wish to keep ${scope} scope, please re-run the command with \"--fork-lane-new-scope\" flag.`);\n }\n scope = scope || (currentLaneId.isDefault() ? this.workspace.defaultScope : currentLaneId.scope);\n const laneObj = await createLane(this.workspace, name, scope);\n const laneId = LaneId.from(name, scope);\n this.setCurrentLane(laneId, alias, false);\n const trackLaneData = {\n localLane: alias || name,\n remoteLane: name,\n remoteScope: scope,\n };\n this.scope.legacyScope.lanes.trackLane(trackLaneData);\n this.scope.legacyScope.scopeJson.setLaneAsNew(name);\n await this.workspace.consumer.onDestroy('lane-create');\n\n const results = {\n alias,\n laneId: laneObj.toLaneId(),\n hash: laneObj.hash().toString(),\n };\n return results;\n }\n\n async loadLane(id: LaneId): Promise<Lane | null> {\n return this.scope.legacyScope.lanes.loadLane(id);\n }\n\n async trackLane(\n localName: string,\n remoteScope: string,\n remoteName?: string\n ): Promise<{ beforeTrackData?: TrackLane; afterTrackData: TrackLane }> {\n if (!this.workspace) {\n throw new BitError(`unable to track a lane outside of Bit workspace`);\n }\n const laneId = await this.scope.legacyScope.lanes.parseLaneIdFromString(localName);\n const lane = await this.loadLane(laneId);\n if (!lane) {\n throw new BitError(`unable to find a local lane \"${localName}\"`);\n }\n const beforeTrackData = this.scope.legacyScope.lanes.getRemoteTrackedDataByLocalLane(localName);\n const beforeTrackDataCloned = beforeTrackData ? { ...beforeTrackData } : undefined;\n const afterTrackData = {\n localLane: localName,\n remoteLane: remoteName || beforeTrackData?.remoteLane || localName,\n remoteScope,\n };\n this.scope.legacyScope.lanes.trackLane(afterTrackData);\n await this.workspace.consumer.onDestroy('lane-track');\n\n return { beforeTrackData: beforeTrackDataCloned, afterTrackData };\n }\n\n async aliasLane(laneName: string, alias: string): Promise<{ laneId: LaneId }> {\n if (!this.workspace) {\n throw new BitError(`unable to alias a lane outside of Bit workspace`);\n }\n if (alias.includes(LANE_REMOTE_DELIMITER)) {\n throw new BitError(`an alias cannot include a delimiter \"${LANE_REMOTE_DELIMITER}\"`);\n }\n if (alias === laneName) {\n throw new BitError(`an alias cannot be the same as the lane name`);\n }\n const laneId = await this.scope.legacyScope.lanes.parseLaneIdFromString(laneName);\n const lane = await this.loadLane(laneId);\n if (!lane) {\n throw new BitError(`unable to find a local lane \"${laneName}\"`);\n }\n const trackData = {\n localLane: alias,\n remoteLane: laneId.name,\n remoteScope: laneId.scope,\n };\n const laneNameWithoutScope = laneName.includes(LANE_REMOTE_DELIMITER)\n ? laneName.split(LANE_REMOTE_DELIMITER)[1]\n : laneName;\n this.scope.legacyScope.lanes.removeTrackLane(laneNameWithoutScope);\n this.scope.legacyScope.lanes.trackLane(trackData);\n await this.workspace.consumer.onDestroy('lane-alias');\n\n return { laneId };\n }\n\n async changeScope(remoteScope: string, laneName?: string): Promise<{ remoteScopeBefore: string; localName: string }> {\n if (!this.workspace) {\n throw new BitError(`unable to change-scope of a lane outside of Bit workspace`);\n }\n let laneId: LaneId;\n let laneNameWithoutScope: string;\n if (laneName) {\n laneNameWithoutScope = laneName.includes(LANE_REMOTE_DELIMITER)\n ? laneName.split(LANE_REMOTE_DELIMITER)[1]\n : laneName;\n laneId = await this.scope.legacyScope.lanes.parseLaneIdFromString(laneName);\n } else {\n laneId = this.workspace.getCurrentLaneId();\n laneNameWithoutScope = laneId.name;\n }\n const lane = await this.loadLane(laneId);\n if (!lane) {\n throw new BitError(`unable to find a local lane \"${laneName}\"`);\n }\n if (!lane.isNew) {\n throw new BitError(`changing lane scope-name is allowed for new lanes only. this lane has been exported already.\nplease create a new lane instead, which will include all components of this lane`);\n }\n if (!isValidScopeName(remoteScope)) {\n throw new InvalidScopeName(remoteScope);\n }\n const remoteScopeBefore = lane.scope;\n lane.changeScope(remoteScope);\n const newLaneId = LaneId.from(laneId.name, remoteScope);\n const trackData = {\n localLane: laneNameWithoutScope,\n remoteLane: laneId.name,\n remoteScope,\n };\n this.scope.legacyScope.lanes.trackLane(trackData);\n await this.scope.legacyScope.lanes.saveLane(lane, {\n laneHistoryMsg: `change scope from ${remoteScopeBefore} to ${remoteScope}`,\n });\n this.workspace.consumer.bitMap.setCurrentLane(newLaneId, false);\n await this.workspace.consumer.onDestroy('lane-scope-change');\n\n return { remoteScopeBefore, localName: laneNameWithoutScope };\n }\n\n /**\n * change a lane-name and if possible, export the lane to the remote\n */\n async rename(newName: string, laneName?: string): Promise<{ currentName: string }> {\n if (!this.workspace) {\n throw new BitError(`unable to rename a lane outside of Bit workspace`);\n }\n throwForInvalidLaneName(newName);\n const currentName = laneName || this.workspace.getCurrentLaneId().name;\n const existingAliasWithNewName = this.scope.legacyScope.lanes.getRemoteTrackedDataByLocalLane(newName);\n if (existingAliasWithNewName) {\n const remoteIdStr = `${existingAliasWithNewName.remoteLane}/${existingAliasWithNewName.remoteScope}`;\n throw new BitError(`unable to rename to ${newName}. this name is already used to track: ${remoteIdStr}`);\n }\n const laneNameWithoutScope = currentName.includes(LANE_REMOTE_DELIMITER)\n ? currentName.split(LANE_REMOTE_DELIMITER)[1]\n : currentName;\n const laneId = await this.scope.legacyScope.lanes.parseLaneIdFromString(currentName);\n const lane = await this.loadLane(laneId);\n if (!lane) {\n throw new BitError(`unable to find a local lane \"${currentName}\"`);\n }\n\n // rename the ref file\n await this.scope.legacyScope.objects.remoteLanes.renameRefByNewLaneName(laneNameWithoutScope, newName, lane.scope);\n\n // change scope.json related data and change the lane object\n await this.scope.legacyScope.lanes.renameLane(lane, newName);\n\n // change current-lane if needed\n const currentLaneId = this.getCurrentLaneId();\n if (currentLaneId?.isEqual(laneId)) {\n const newLaneId = LaneId.from(newName, lane.scope);\n const isExported = this.workspace.consumer.bitMap.isLaneExported;\n this.setCurrentLane(newLaneId, undefined, isExported);\n }\n\n // this writes the changes done on scope.json file (along with .bitmap)\n await this.workspace.consumer.onDestroy('lane-rename');\n\n return { currentName };\n }\n\n async exportLane(lane: Lane) {\n await this.exporter.exportMany({\n scope: this.scope.legacyScope,\n laneObject: lane,\n ids: new ComponentIdList(),\n idsWithFutureScope: new ComponentIdList(),\n allVersions: false,\n });\n }\n\n async importLaneObject(laneId: LaneId, persistIfNotExists = true): Promise<Lane> {\n return this.importer.importLaneObject(laneId, persistIfNotExists);\n }\n\n /**\n * get the head hash (snap) of main. return undefined if the component exists only on a lane and was never merged to main\n */\n async getHeadOnMain(componentId: ComponentID): Promise<string | undefined> {\n const modelComponent = await this.scope.legacyScope.getModelComponent(componentId);\n return modelComponent.head?.toString();\n }\n\n /**\n * fetch the lane object and its components from the remote.\n * save the objects and the lane to the local scope.\n * this method doesn't change anything in the workspace.\n */\n async fetchLaneWithItsComponents(laneId: LaneId): Promise<Lane> {\n this.logger.debug(`fetching lane ${laneId.toString()}`);\n if (!this.workspace) {\n throw new BitError('unable to fetch lanes outside of Bit workspace');\n }\n const lane = await this.importer.importLaneObject(laneId);\n if (!lane) throw new Error(`unable to import lane ${laneId.toString()} from the remote`);\n\n await this.importer.fetchLaneComponents(lane);\n this.logger.debug(`fetching lane ${laneId.toString()} done, fetched ${lane.components.length} components`);\n return lane;\n }\n\n async removeLanes(laneNames: string[], opts?: { remote: boolean; force: boolean }): Promise<string[]> {\n if (!this.workspace && !opts?.remote) {\n await this.scope.legacyScope.lanes.removeLanes(this.scope.legacyScope, laneNames, true);\n return laneNames;\n }\n const results = await removeLanes(this.workspace?.consumer, laneNames, !!opts?.remote, !!opts?.force);\n if (this.workspace) await this.workspace.consumer.onDestroy('lane-remove');\n\n return results.laneResults;\n }\n\n /**\n * when deleting a lane object, it is sent into the \"trash\" directory in the scope.\n * this method restores it and put it back in the \"objects\" directory.\n * as an argument, it needs a hash. the reason for not supporting lane-id is because the trash may have multiple\n * lanes with the same lane-id but different hashes.\n */\n async restoreLane(laneHash: string) {\n const ref = Ref.from(laneHash);\n const objectsFromTrash = (await this.scope.legacyScope.objects.getFromTrash([ref])) as Lane[];\n const laneIdFromTrash = objectsFromTrash[0].toLaneId();\n const existingWithSameId = await this.loadLane(laneIdFromTrash);\n if (existingWithSameId) {\n if (existingWithSameId.hash().isEqual(ref)) {\n throw new BitError(`unable to restore lane ${laneIdFromTrash.toString()}, as it already exists`);\n }\n throw new BitError(\n `unable to restore lane ${laneIdFromTrash.toString()}, as a lane with the same id already exists`\n );\n }\n await this.scope.legacyScope.objects.restoreFromTrash([ref]);\n }\n\n /**\n * switch to a different local or remote lane.\n * switching to a remote lane also imports and writes the components of that remote lane.\n * by default, only the components existing on the workspace will be imported from that lane, unless the \"getAll\"\n * flag is true.\n */\n async switchLanes(\n laneName: string,\n { alias, merge, pattern, getAll = false, skipDependencyInstallation = false }: SwitchLaneOptions\n ) {\n if (!this.workspace) {\n throw new BitError(`unable to switch lanes outside of Bit workspace`);\n }\n let mergeStrategy;\n if (merge && typeof merge === 'string') {\n const mergeOptions = Object.keys(MergeOptions);\n if (!mergeOptions.includes(merge)) {\n throw new BitError(`merge must be one of the following: ${mergeOptions.join(', ')}`);\n }\n mergeStrategy = merge;\n }\n if (alias) {\n throwForInvalidLaneName(alias);\n }\n\n const switchProps = {\n laneName,\n existingOnWorkspaceOnly: !getAll,\n pattern,\n alias,\n };\n const checkoutProps = {\n mergeStrategy,\n skipNpmInstall: skipDependencyInstallation,\n verbose: false, // not relevant in Harmony\n ignorePackageJson: true, // not relevant in Harmony\n ignoreDist: true, // not relevant in Harmony\n isLane: true,\n promptMergeOptions: false,\n writeConfig: false,\n reset: false,\n all: false,\n };\n return new LaneSwitcher(this.workspace, this.logger, switchProps, checkoutProps, this).switch();\n }\n\n /**\n * the values array may include zero to two values and will be processed as following:\n * [] => diff between the current lane and default lane. (only inside workspace).\n * [to] => diff between the current lane (or default-lane when in scope) and \"to\" lane.\n * [from, to] => diff between \"from\" lane and \"to\" lane.\n */\n public async getDiff(values: string[], diffOptions: DiffOptions = {}, pattern?: string): Promise<LaneDiffResults> {\n const laneDiffGenerator = new LaneDiffGenerator(this.workspace, this.scope, this.componentCompare);\n return laneDiffGenerator.generate(values, diffOptions, pattern);\n }\n\n async getLaneComponentModels(lane: LaneData): Promise<Component[]> {\n const host = this.componentAspect.getHost();\n const laneComponentIds = await this.getLaneComponentIds(lane);\n const components = await host.getMany(laneComponentIds);\n return components;\n }\n\n async getLaneComponentIds(lane: LaneData): Promise<ComponentID[]> {\n if (!lane) return [];\n\n const laneComponents = lane.components;\n const workspace = this.workspace;\n const bitIdsFromBitmap = workspace ? workspace.consumer.bitMap.getAllBitIdsFromAllLanes() : [];\n\n const filteredComponentIds = workspace\n ? laneComponents.filter((laneComponent) =>\n bitIdsFromBitmap.some((bitmapComponentId) => bitmapComponentId.isEqualWithoutVersion(laneComponent.id))\n )\n : laneComponents;\n\n const host = this.componentAspect.getHost();\n\n return Promise.all(\n filteredComponentIds.map((laneComponent) => {\n const legacyIdWithVersion = laneComponent.id.changeVersion(laneComponent.head);\n return host.resolveComponentId(legacyIdWithVersion);\n })\n );\n }\n\n async getLaneReadmeComponent(lane: LaneData): Promise<Component | undefined> {\n if (!lane) return undefined;\n const laneReadmeComponent = lane.readmeComponent;\n if (!laneReadmeComponent) return undefined;\n const host = this.componentAspect.getHost();\n const laneReadmeComponentId = await host.resolveComponentId(\n laneReadmeComponent.id.changeVersion(laneReadmeComponent.head)\n );\n const readmeComponent = await host.get(laneReadmeComponentId);\n return readmeComponent;\n }\n\n async removeLaneReadme(laneName?: string): Promise<{ result: boolean; message?: string }> {\n if (!this.workspace) {\n throw new BitError('unable to remove the lane readme component outside of Bit workspace');\n }\n const currentLaneName = this.getCurrentLaneName();\n\n if (!laneName && !currentLaneName) {\n return {\n result: false,\n message: 'unable to remove the lane readme component. Either pass a laneName or switch to a lane',\n };\n }\n\n const scope: LegacyScope = this.workspace.scope.legacyScope;\n const laneId: LaneId = laneName\n ? await scope.lanes.parseLaneIdFromString(laneName)\n : (this.getCurrentLaneId() as LaneId);\n const lane: Lane | null | undefined = await scope.loadLane(laneId);\n\n if (!lane?.readmeComponent) {\n throw new BitError(`there is no readme component added to the lane ${laneName || currentLaneName}`);\n }\n\n const readmeComponentId = await this.workspace.resolveComponentId(lane.readmeComponent.id);\n const existingLaneConfig =\n (await this.workspace.getSpecificComponentConfig(readmeComponentId, LanesAspect.id)) || {};\n\n const remoteLaneIdStr = lane.toLaneId().toString();\n\n if (existingLaneConfig.readme) {\n delete existingLaneConfig.readme[remoteLaneIdStr];\n await this.workspace.removeSpecificComponentConfig(readmeComponentId, LanesAspect.id, false);\n await this.workspace.addSpecificComponentConfig(readmeComponentId, LanesAspect.id, existingLaneConfig);\n }\n\n lane.setReadmeComponent(undefined);\n await scope.lanes.saveLane(lane, { laneHistoryMsg: 'remove readme' });\n await this.workspace.bitMap.write(`lane-remove-readme`);\n\n return { result: true };\n }\n\n async diffStatus(\n sourceLaneId: LaneId,\n targetLaneId?: LaneId,\n options?: LaneDiffStatusOptions\n ): Promise<LaneDiffStatus> {\n this.logger.profile(`diff status for source lane: ${sourceLaneId.name} and target lane: ${targetLaneId?.name}`);\n\n const sourceLane = sourceLaneId.isDefault()\n ? await this.getLaneDataOfDefaultLane()\n : await this.loadLane(sourceLaneId);\n\n const sourceLaneComponents = sourceLaneId.isDefault()\n ? sourceLane?.components.map((main) => ({ id: main.id, head: Ref.from(main.head) }))\n : sourceLane?.components;\n\n const targetLane = targetLaneId ? await this.loadLane(targetLaneId) : undefined;\n const targetLaneIds = targetLane?.toBitIds();\n const host = this.componentAspect.getHost();\n\n const targetMainHeads =\n !targetLaneId || targetLaneId?.isDefault()\n ? compact(\n await Promise.all(\n (sourceLaneComponents || []).map(async ({ id }) => {\n const componentId = await host.resolveComponentId(id);\n const headOnMain = await this.getHeadOnMain(componentId);\n return headOnMain ? id.changeVersion(headOnMain) : undefined;\n })\n )\n )\n : [];\n\n await this.importer.importObjectsFromMainIfExist(targetMainHeads);\n\n const diffProps = compact(\n await Promise.all(\n (sourceLaneComponents || []).map(async ({ id, head }) => {\n const componentId = await host.resolveComponentId(id);\n const sourceVersionObj = (await this.scope.legacyScope.objects.load(head, true)) as Version;\n\n if (sourceVersionObj.isRemoved()) {\n return null;\n }\n\n const headOnTargetLane = targetLaneIds\n ? targetLaneIds.searchWithoutVersion(id)?.version\n : await this.getHeadOnMain(componentId);\n\n if (headOnTargetLane) {\n const targetVersionObj = (await this.scope.legacyScope.objects.load(\n Ref.from(headOnTargetLane),\n true\n )) as Version;\n\n if (targetVersionObj.isRemoved()) {\n return null;\n }\n }\n\n const sourceHead = head.toString();\n const targetHead = headOnTargetLane;\n\n return { componentId, sourceHead, targetHead };\n })\n )\n );\n\n const snapDistancesByComponentId = new Map<\n string,\n {\n snapsDistance: SnapsDistance;\n sourceHead: string;\n targetHead?: string;\n componentId: ComponentID;\n }\n >();\n\n this.logger.profile(\n `get snaps distance for source lane: ${sourceLane?.id.name} and target lane: ${targetLane?.id.name} with ${diffProps.length} components`\n );\n await pMap(\n diffProps,\n async ({ componentId, sourceHead, targetHead }) => {\n const snapsDistance = await this.scope.getSnapsDistanceBetweenTwoSnaps(\n componentId,\n sourceHead,\n targetHead,\n false\n );\n if (snapsDistance) {\n snapDistancesByComponentId.set(componentId.toString(), {\n snapsDistance,\n sourceHead,\n targetHead,\n componentId,\n });\n }\n },\n {\n concurrency: concurrentComponentsLimit(),\n }\n );\n this.logger.profile(\n `get snaps distance for source lane: ${sourceLane?.id.name} and target lane: ${targetLane?.id.name} with ${diffProps.length} components`\n );\n\n const commonSnapsToImport = compact(\n [...snapDistancesByComponentId.values()].map((s) =>\n s.snapsDistance.commonSnapBeforeDiverge\n ? s.componentId.changeVersion(s.snapsDistance.commonSnapBeforeDiverge.hash)\n : null\n )\n );\n\n const sourceOrTargetLane =\n ((sourceLaneId.isDefault() ? null : (sourceLane as Lane)) ||\n (targetLaneId?.isDefault() ? null : (targetLane as Lane))) ??\n undefined;\n\n if (commonSnapsToImport.length > 0 && !options?.skipChanges) {\n await this.scope.legacyScope.scopeImporter.importWithoutDeps(ComponentIdList.fromArray(commonSnapsToImport), {\n cache: true,\n reason: `get the common snap for lane diff`,\n lane: sourceOrTargetLane,\n });\n }\n\n const results = await pMapSeries(diffProps, async ({ componentId, sourceHead, targetHead }) =>\n this.componentDiffStatus(\n componentId,\n sourceHead,\n targetHead,\n snapDistancesByComponentId.get(componentId.toString())?.snapsDistance,\n options\n )\n );\n\n this.logger.profile(`diff status for source lane: ${sourceLaneId.name} and target lane: ${targetLaneId?.name}`);\n\n return {\n source: sourceLaneId,\n target: targetLaneId || this.getDefaultLaneId(),\n componentsStatus: results,\n };\n }\n\n private async componentDiffStatus(\n componentId: ComponentID,\n sourceHead: string,\n targetHead?: string,\n snapsDistance?: SnapsDistance,\n options?: LaneDiffStatusOptions\n ): Promise<LaneComponentDiffStatus> {\n if (snapsDistance?.err) {\n const noCommonSnap = snapsDistance.err instanceof NoCommonSnap;\n\n return {\n componentId,\n sourceHead,\n targetHead,\n upToDate: snapsDistance?.isUpToDate(),\n unrelated: noCommonSnap || undefined,\n changes: [],\n };\n }\n\n const commonSnap = snapsDistance?.commonSnapBeforeDiverge;\n\n const getChanges = async (): Promise<ChangeType[]> => {\n if (!commonSnap) return [ChangeType.NEW];\n\n // import common snap before we compare\n const compare = await this.componentCompare.compare(\n componentId.changeVersion(commonSnap.hash).toString(),\n componentId.changeVersion(sourceHead).toString()\n );\n\n if (!compare.fields.length && (!compare.code.length || !compare.code.some((c) => c.status !== 'UNCHANGED'))) {\n return [ChangeType.NONE];\n }\n\n const changed: ChangeType[] = [];\n\n if (compare.code.some((f) => f.status !== 'UNCHANGED')) {\n changed.push(ChangeType.SOURCE_CODE);\n }\n\n if (compare.fields.length > 0) {\n changed.push(ChangeType.ASPECTS);\n }\n\n const depsFields = ['dependencies', 'devDependencies', 'extensionDependencies'];\n if (compare.fields.some((field) => depsFields.includes(field.fieldName))) {\n changed.push(ChangeType.DEPENDENCY);\n }\n\n return changed;\n };\n\n const changes = !options?.skipChanges ? await getChanges() : undefined;\n const changeType = changes ? changes[0] : undefined;\n\n return {\n componentId,\n changeType,\n changes,\n sourceHead,\n targetHead: commonSnap?.hash,\n upToDate: snapsDistance?.isUpToDate(),\n snapsDistance: {\n onSource: snapsDistance?.snapsOnSourceOnly.map((s) => s.hash) ?? [],\n onTarget: snapsDistance?.snapsOnTargetOnly.map((s) => s.hash) ?? [],\n common: snapsDistance?.commonSnapBeforeDiverge?.hash,\n },\n };\n }\n\n async componentDiffStatusOld(\n componentId: ComponentID,\n sourceHead: string,\n targetHead?: string,\n options?: LaneDiffStatusOptions\n ): Promise<LaneComponentDiffStatus> {\n const snapsDistance = await this.scope.getSnapsDistanceBetweenTwoSnaps(componentId, sourceHead, targetHead, false);\n\n if (snapsDistance?.err) {\n const noCommonSnap = snapsDistance.err instanceof NoCommonSnap;\n\n return {\n componentId,\n sourceHead,\n targetHead,\n upToDate: snapsDistance?.isUpToDate(),\n unrelated: noCommonSnap || undefined,\n changes: [],\n };\n }\n\n const commonSnap = snapsDistance?.commonSnapBeforeDiverge;\n\n const getChanges = async (): Promise<ChangeType[]> => {\n if (!commonSnap) return [ChangeType.NEW];\n\n const compare = await this.componentCompare.compare(\n componentId.changeVersion(commonSnap.hash).toString(),\n componentId.changeVersion(sourceHead).toString()\n );\n\n if (!compare.fields.length && (!compare.code.length || !compare.code.some((c) => c.status !== 'UNCHANGED'))) {\n return [ChangeType.NONE];\n }\n\n const changed: ChangeType[] = [];\n\n if (compare.code.some((f) => f.status !== 'UNCHANGED')) {\n changed.push(ChangeType.SOURCE_CODE);\n }\n\n if (compare.fields.length > 0) {\n changed.push(ChangeType.ASPECTS);\n }\n\n const depsFields = ['dependencies', 'devDependencies', 'extensionDependencies'];\n if (compare.fields.some((field) => depsFields.includes(field.fieldName))) {\n changed.push(ChangeType.DEPENDENCY);\n }\n\n return changed;\n };\n\n const changes = !options?.skipChanges ? await getChanges() : undefined;\n const changeType = changes ? changes[0] : undefined;\n\n return {\n componentId,\n changeType,\n changes,\n sourceHead,\n targetHead: commonSnap?.hash,\n upToDate: snapsDistance?.isUpToDate(),\n snapsDistance: {\n onSource: snapsDistance?.snapsOnSourceOnly.map((s) => s.hash) ?? [],\n onTarget: snapsDistance?.snapsOnTargetOnly.map((s) => s.hash) ?? [],\n common: snapsDistance?.commonSnapBeforeDiverge?.hash,\n },\n };\n }\n\n private async recreateNewLaneIfDeleted() {\n if (!this.workspace) return;\n const laneId = this.getCurrentLaneId();\n if (!laneId || laneId.isDefault() || this.workspace.consumer.bitMap.isLaneExported) {\n return;\n }\n const laneObj = await this.scope.legacyScope.getCurrentLaneObject();\n if (laneObj) {\n return;\n }\n await this.createLane(laneId.name, { scope: laneId.scope });\n }\n\n async addLaneReadme(readmeComponentIdStr: string, laneName?: string): Promise<{ result: boolean; message?: string }> {\n if (!this.workspace) {\n throw new BitError(`unable to track a lane readme component outside of Bit workspace`);\n }\n const readmeComponentId = await this.workspace.resolveComponentId(readmeComponentIdStr);\n\n const scope: LegacyScope = this.workspace.scope.legacyScope;\n const laneId: LaneId = laneName\n ? await scope.lanes.parseLaneIdFromString(laneName)\n : (this.getCurrentLaneId() as LaneId);\n\n const lane: Lane | null | undefined = await scope.loadLane(laneId);\n\n if (!lane) {\n return { result: false, message: `cannot find lane ${laneName}` };\n }\n\n lane.setReadmeComponent(readmeComponentId);\n await scope.lanes.saveLane(lane, { laneHistoryMsg: 'add readme' });\n\n const existingLaneConfig =\n (await this.workspace.getSpecificComponentConfig(readmeComponentId, LanesAspect.id)) || {};\n\n const remoteLaneIdStr = lane.toLaneId().toString();\n\n if (existingLaneConfig.readme) {\n await this.workspace.addSpecificComponentConfig(readmeComponentId, LanesAspect.id, {\n ...existingLaneConfig,\n readme: {\n ...existingLaneConfig.readme,\n [remoteLaneIdStr]: true,\n },\n });\n } else {\n await this.workspace.addSpecificComponentConfig(readmeComponentId, LanesAspect.id, {\n ...existingLaneConfig,\n readme: {\n [remoteLaneIdStr]: true,\n },\n });\n }\n await this.workspace.bitMap.write('lane-add-readme');\n return { result: true };\n }\n\n /**\n * if the local lane was forked from another lane, this gets the differences between the two.\n * it also fetches the original lane from the remote to make sure the data is up to date.\n */\n async listUpdatesFromForked(componentsList: ComponentsList): Promise<DivergeDataPerId[]> {\n const consumer = this.workspace?.consumer;\n if (!consumer) throw new Error(`unable to get listUpdatesFromForked outside of a workspace`);\n if (consumer.isOnMain()) {\n return [];\n }\n const lane = await consumer.getCurrentLaneObject();\n const forkedFromLaneId = lane?.forkedFrom;\n if (!forkedFromLaneId) {\n return [];\n }\n const forkedFromLane = await consumer.scope.loadLane(forkedFromLaneId);\n if (!forkedFromLane) return []; // should we fetch it here?\n\n const workspaceIds = consumer.bitMap.getAllBitIds();\n\n const duringMergeIds = componentsList.listDuringMergeStateComponents();\n\n const componentsFromModel = await componentsList.getModelComponents();\n const compFromModelOnWorkspace = componentsFromModel\n .filter((c) => workspaceIds.hasWithoutVersion(c.toComponentId()))\n // if a component is merge-pending, it needs to be resolved first before getting more updates from main\n .filter((c) => !duringMergeIds.hasWithoutVersion(c.toComponentId()));\n\n // by default, when on a lane, forked is not fetched. we need to fetch it to get the latest updates.\n await this.fetchLaneWithItsComponents(forkedFromLaneId);\n\n const remoteForkedLane = await consumer.scope.objects.remoteLanes.getRemoteLane(forkedFromLaneId);\n if (!remoteForkedLane.length) return [];\n\n const results = await Promise.all(\n compFromModelOnWorkspace.map(async (modelComponent) => {\n const headOnForked = remoteForkedLane.find((c) => c.id.isEqualWithoutVersion(modelComponent.toComponentId()));\n const headOnLane = modelComponent.laneHeadLocal;\n if (!headOnForked || !headOnLane) return undefined;\n const divergeData = await getDivergeData({\n repo: consumer.scope.objects,\n modelComponent,\n targetHead: headOnForked.head,\n sourceHead: headOnLane,\n throws: false,\n });\n if (!divergeData.snapsOnTargetOnly.length && !divergeData.err) return undefined;\n return { id: modelComponent.toComponentId(), divergeData };\n })\n );\n\n return compact(results);\n }\n\n private async getLaneDataOfDefaultLane(): Promise<LaneData | null> {\n const consumer = this.workspace?.consumer;\n let bitIds: ComponentID[] = [];\n if (!consumer) {\n const scopeComponents = await this.scope.list();\n bitIds = scopeComponents.filter((component) => component.head).map((component) => component.id);\n } else {\n bitIds = await consumer.getIdsOfDefaultLane();\n }\n\n return {\n name: DEFAULT_LANE,\n remote: null,\n id: this.getDefaultLaneId(),\n components: bitIds.map((bitId) => ({ id: bitId, head: bitId.version as string })),\n isMerged: null,\n hash: '',\n };\n }\n\n get createRoutePath() {\n return '/lanes/create';\n }\n\n get deleteRoutePath() {\n return '/lanes/delete';\n }\n\n get restoreRoutePath() {\n return '/lanes/restore';\n }\n\n static slots = [];\n static dependencies = [\n CLIAspect,\n ScopeAspect,\n WorkspaceAspect,\n GraphqlAspect,\n MergingAspect,\n ComponentAspect,\n LoggerAspect,\n ImporterAspect,\n ExportAspect,\n ExpressAspect,\n ComponentCompareAspect,\n ComponentWriterAspect,\n RemoveAspect,\n CheckoutAspect,\n ];\n static runtime = MainRuntime;\n static async provider([\n cli,\n scope,\n workspace,\n graphql,\n merging,\n component,\n loggerMain,\n importer,\n exporter,\n express,\n componentCompare,\n componentWriter,\n remove,\n checkout,\n ]: [\n CLIMain,\n ScopeMain,\n Workspace,\n GraphqlMain,\n MergingMain,\n ComponentMain,\n LoggerMain,\n ImporterMain,\n ExportMain,\n ExpressMain,\n ComponentCompareMain,\n ComponentWriterMain,\n RemoveMain,\n CheckoutMain\n ]) {\n const logger = loggerMain.createLogger(LanesAspect.id);\n const lanesMain = new LanesMain(\n workspace,\n scope,\n merging,\n component,\n logger,\n importer,\n exporter,\n componentCompare,\n componentWriter,\n remove,\n checkout\n );\n const switchCmd = new SwitchCmd(lanesMain);\n const laneCmd = new LaneCmd(lanesMain, workspace, scope);\n laneCmd.commands = [\n new LaneListCmd(lanesMain, workspace, scope),\n switchCmd,\n new LaneShowCmd(lanesMain, workspace, scope),\n new LaneCreateCmd(lanesMain),\n new LaneRemoveCmd(lanesMain),\n new LaneChangeScopeCmd(lanesMain),\n new LaneAliasCmd(lanesMain),\n new LaneRenameCmd(lanesMain),\n new LaneDiffCmd(workspace, scope, componentCompare),\n new LaneAddReadmeCmd(lanesMain),\n new LaneRemoveReadmeCmd(lanesMain),\n new LaneImportCmd(switchCmd),\n new LaneRemoveCompCmd(workspace, lanesMain),\n ];\n if (isFeatureEnabled(SUPPORT_LANE_HISTORY)) {\n laneCmd.commands.push(new LaneHistoryCmd(lanesMain));\n }\n cli.register(laneCmd, switchCmd, new CatLaneHistoryCmd(lanesMain));\n cli.registerOnStart(async () => {\n await lanesMain.recreateNewLaneIfDeleted();\n });\n graphql.register(lanesSchema(lanesMain));\n express.register([\n new LanesCreateRoute(lanesMain, logger),\n new LanesDeleteRoute(lanesMain, logger),\n new LanesRestoreRoute(lanesMain, logger),\n ]);\n return lanesMain;\n }\n}\n\nLanesAspect.addRuntime(LanesMain);\n\nexport default LanesMain;\n"],"mappings":";;;;;;;;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,YAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,MAAA;EAAA,MAAAJ,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAG,KAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,OAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,MAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,SAA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AA,CAr9BNiB,SAAS,kBAs9BE,CACpBsX,gBAAS,EACTC,oBAAW,EACXC,4BAAe,EACfC,wBAAa,EACbC,wBAAa,EACbC,oBAAe,EACfC,sBAAY,EACZC,0BAAc,EACdC,sBAAY,EACZC,wBAAa,EACbC,0CAAsB,EACtBC,0BAAqB,EACrBC,iBAAY,EACZC,mBAAc,CACf;AAAApZ,eAAA,CAr+BUiB,SAAS,aAs+BHoY,kBAAW;AAgF9B5K,oBAAW,CAAC6K,UAAU,CAACrY,SAAS,CAAC;AAAC,IAAAsY,QAAA,GAAAjB,OAAA,CAAAxZ,OAAA,GAEnBmC,SAAS"}
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.lanes_lanes@1.0.128/dist/lanes.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.lanes_lanes@1.0.128/dist/lanes.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.lanes_lanes@1.0.130/dist/lanes.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.lanes_lanes@1.0.130/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.128",
3
+ "version": "1.0.130",
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.128"
9
+ "version": "1.0.130"
10
10
  },
11
11
  "dependencies": {
12
12
  "lodash": "4.17.21",
@@ -19,41 +19,40 @@
19
19
  "@teambit/bit-error": "0.0.404",
20
20
  "@teambit/component-version": "1.0.3",
21
21
  "@teambit/lane-id": "0.0.311",
22
- "@teambit/lanes.ui.models.lanes-model": "0.0.207",
22
+ "@teambit/lanes.ui.models.lanes-model": "0.0.210",
23
23
  "@teambit/harmony": "0.4.6",
24
24
  "@teambit/component-id": "1.2.0",
25
25
  "@teambit/legacy-bit-id": "1.1.0",
26
26
  "@teambit/design.ui.pages.not-found": "0.0.366",
27
- "@teambit/lanes.hooks.use-lanes": "0.0.254",
27
+ "@teambit/lanes.hooks.use-lanes": "0.0.257",
28
28
  "@teambit/lanes.hooks.use-viewed-lane-from-url": "0.0.217",
29
29
  "@teambit/lanes.ui.compare.lane-compare-page": "0.0.152",
30
30
  "@teambit/lanes.ui.compare.lane-compare": "0.0.170",
31
31
  "@teambit/lanes.ui.menus.lanes-overview-menu": "0.0.10",
32
32
  "@teambit/lanes.ui.menus.use-lanes-menu": "0.0.207",
33
- "@teambit/lanes.ui.navigation.lane-switcher": "0.0.213",
33
+ "@teambit/lanes.ui.navigation.lane-switcher": "0.0.215",
34
34
  "@teambit/scope.ui.scope-icon": "0.0.91",
35
35
  "@teambit/ui-foundation.ui.menu": "0.0.502",
36
36
  "@teambit/ui-foundation.ui.react-router.slot-router": "0.0.506",
37
37
  "@teambit/ui-foundation.ui.react-router.use-query": "0.0.501",
38
- "@teambit/scope": "1.0.128",
39
- "@teambit/snapping": "1.0.128",
40
- "@teambit/workspace": "1.0.128",
38
+ "@teambit/scope": "1.0.130",
39
+ "@teambit/workspace": "1.0.130",
41
40
  "@teambit/cli": "0.0.846",
42
41
  "@teambit/express": "0.0.945",
43
42
  "@teambit/logger": "0.0.939",
44
- "@teambit/graphql": "1.0.128",
45
- "@teambit/checkout": "1.0.128",
46
- "@teambit/component-compare": "1.0.128",
47
- "@teambit/component-writer": "1.0.128",
48
- "@teambit/component": "1.0.128",
49
- "@teambit/export": "1.0.128",
50
- "@teambit/importer": "1.0.128",
43
+ "@teambit/graphql": "1.0.130",
44
+ "@teambit/checkout": "1.0.130",
45
+ "@teambit/component-compare": "1.0.130",
46
+ "@teambit/component-writer": "1.0.130",
47
+ "@teambit/component": "1.0.130",
48
+ "@teambit/export": "1.0.130",
49
+ "@teambit/importer": "1.0.130",
51
50
  "@teambit/lanes.entities.lane-diff": "0.0.166",
52
51
  "@teambit/lanes.modules.diff": "0.0.442",
53
- "@teambit/merging": "1.0.128",
54
- "@teambit/remove": "1.0.128",
55
- "@teambit/lanes.ui.lane-overview": "0.0.212",
56
- "@teambit/ui": "1.0.128"
52
+ "@teambit/merging": "1.0.130",
53
+ "@teambit/remove": "1.0.130",
54
+ "@teambit/lanes.ui.lane-overview": "0.0.213",
55
+ "@teambit/ui": "1.0.130"
57
56
  },
58
57
  "devDependencies": {
59
58
  "@types/lodash": "4.14.165",
@@ -63,6 +62,7 @@
63
62
  "@teambit/harmony.envs.core-aspect-env": "0.0.19",
64
63
  "@teambit/component.testing.mock-components": "0.0.184",
65
64
  "@teambit/harmony.testing.load-aspect": "0.0.183",
65
+ "@teambit/snapping": "1.0.130",
66
66
  "@teambit/workspace.testing.mock-workspace": "0.0.20"
67
67
  },
68
68
  "peerDependencies": {