@teambit/merge-lanes 0.0.0-03bafa4b511c8c802476c3037efbe9a84c4c66cb

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.
@@ -0,0 +1,173 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.MergeLaneCmd = void 0;
7
+ function _chalk() {
8
+ const data = _interopRequireDefault(require("chalk"));
9
+ _chalk = function () {
10
+ return data;
11
+ };
12
+ return data;
13
+ }
14
+ function _merging() {
15
+ const data = require("@teambit/merging");
16
+ _merging = function () {
17
+ return data;
18
+ };
19
+ return data;
20
+ }
21
+ function _legacy() {
22
+ const data = require("@teambit/legacy.constants");
23
+ _legacy = function () {
24
+ return data;
25
+ };
26
+ return data;
27
+ }
28
+ function _bitError() {
29
+ const data = require("@teambit/bit-error");
30
+ _bitError = function () {
31
+ return data;
32
+ };
33
+ return data;
34
+ }
35
+ function _remove() {
36
+ const data = require("@teambit/remove");
37
+ _remove = function () {
38
+ return data;
39
+ };
40
+ return data;
41
+ }
42
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
43
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
44
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
45
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
46
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
47
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
48
+ class MergeLaneCmd {
49
+ constructor(mergeLanes, configStore) {
50
+ this.mergeLanes = mergeLanes;
51
+ this.configStore = configStore;
52
+ _defineProperty(this, "name", 'merge <lane> [pattern]');
53
+ _defineProperty(this, "description", `merge a local or a remote lane to the current lane`);
54
+ _defineProperty(this, "extendedDescription", `by default, the provided lane will be fetched from the remote before merging.
55
+ to merge the lane from the local scope without updating it first, use "--skip-fetch" flag.
56
+
57
+ when the current and merge candidate lanes are diverged in history and the files could be merged with no conflicts,
58
+ these components will be snap-merged to complete the merge. use "no-auto-snap" to opt-out, or "tag" to tag instead.
59
+
60
+ when the components are not diverged in history, and the current lane is behind the merge candidate, the merge will
61
+ simply update the components and the heads according to the merge candidate.
62
+ to opt-out, use "--no-snap", the components will be written as the merge candidate, and will be left as modified.
63
+
64
+ in case a component in both ends don't share history (no snap is found in common), the merge will require "--resolve-unrelated" flag.
65
+ this flag keeps the history of one end and saves a reference to the other end. the decision of which end to keep is determined by the following:
66
+ 1. if the component exists on main, then the history linked to main will be kept.
67
+ in this case, the strategy of "--resolve-unrelated" only determines which source-code to keep. it's not about the history.
68
+ 2. if the component doesn't exist on main, then by default, the history of the current lane will be kept.
69
+ unless "--resolve-unrelated" is set to "theirs", in which case the history of the other lane will be kept.
70
+ 2. a. an edge case: if the component is deleted on the current lane, the strategy will always be "theirs".
71
+ so then the history (and the source-code) of the other lane will be kept.
72
+ `);
73
+ _defineProperty(this, "arguments", [{
74
+ name: 'lane',
75
+ description: 'lane-name or full lane-id (if remote) to merge to the current lane'
76
+ }, {
77
+ name: 'pattern',
78
+ description: `partially merge the lane - only components that match the specified component-pattern
79
+ Component pattern format: ${_legacy().COMPONENT_PATTERN_HELP}`
80
+ }]);
81
+ _defineProperty(this, "alias", '');
82
+ _defineProperty(this, "options", [['', 'manual', 'same as "--auto-merge-resolve manual". in case of merge conflict, write the files with the conflict markers'], ['r', 'auto-merge-resolve <merge-strategy>', 'in case of a merge conflict, resolve according to the provided strategy: [ours, theirs, manual]'], ['', 'ours', 'DEPRECATED. use --auto-merge-resolve. in case of a conflict, keep local modifications'], ['', 'theirs', 'DEPRECATED. use --auto-merge-resolve. in case of a conflict, override local with incoming changes'], ['', 'workspace', 'merge only lane components that are in the current workspace'], ['', 'no-auto-snap', 'do not auto snap after merge completed without conflicts of diverged components (see command description)'], ['', 'no-snap', 'do not pass snaps from the other lane even for non-diverged components (see command description)'], ['', 'tag', 'auto-tag all lane components after merging into main (or tag-merge in case of snap-merge)'], ['', 'build', 'in case of snap during the merge, run the build-pipeline (similar to bit snap --build)'], ['', 'loose', 'relevant for --build, to allow build to succeed even if tasks like tests or lint fail'], ['m', 'message <message>', 'override the default message for the auto snap'], ['', 'keep-readme', 'skip deleting the lane readme component after merging'], ['', 'no-squash', 'relevant for merging lanes into main, which by default squashes all lane snaps'], ['', 'squash', 'relevant for merging a lane into another non-main lane, which by default does not squash'], ['', 'ignore-config-changes', 'allow merging when components are modified due to config changes (such as dependencies) only and not files'], ['', 'verbose', 'display detailed information about components that were legitimately unmerged'], ['x', 'skip-dependency-installation', 'do not install dependencies of the imported components'], ['', 'skip-fetch', 'use the local state of target-lane if exits locally, without updating it from the remote'], ['', 'include-deps', 'relevant for "pattern" and "--workspace". merge also dependencies of the specified components'], ['', 'resolve-unrelated [merge-strategy]', 'relevant when a component on a lane and the component on main have nothing in common. merge-strategy can be "ours" (default) or "theirs"'], ['', 'include-non-lane-comps', 'DEPRECATED (this is now the default). when merging main, include workspace components that are not on the lane (by default only lane components are merged)'], ['', 'exclude-non-lane-comps', 'when merging main into a lane, exclude workspace components that are not on the lane (by default all workspace components are merged)'], ['', 'detach-head', 'UNSUPPORTED YET. for each component, find the divergent point from main and merge to that point. do not change the head']]);
83
+ _defineProperty(this, "loader", true);
84
+ _defineProperty(this, "private", true);
85
+ _defineProperty(this, "remoteOp", true);
86
+ }
87
+ async report([name, pattern], {
88
+ ours,
89
+ theirs,
90
+ manual,
91
+ autoMergeResolve,
92
+ build,
93
+ workspace: existingOnWorkspaceOnly = false,
94
+ squash = false,
95
+ noAutoSnap = false,
96
+ noSnap = false,
97
+ tag = false,
98
+ message: snapMessage = '',
99
+ keepReadme = false,
100
+ noSquash = false,
101
+ skipDependencyInstallation = false,
102
+ skipFetch = false,
103
+ includeDeps = false,
104
+ resolveUnrelated,
105
+ ignoreConfigChanges,
106
+ verbose = false,
107
+ excludeNonLaneComps = false,
108
+ detachHead,
109
+ loose = false
110
+ }) {
111
+ build = this.configStore.getConfigBoolean(_legacy().CFG_FORCE_LOCAL_BUILD) || Boolean(build);
112
+ if (ours || theirs) {
113
+ throw new (_bitError().BitError)('the "--ours" and "--theirs" flags are deprecated. use "--auto-merge-resolve" instead. see "bit lane merge --help" for more information');
114
+ }
115
+ if (autoMergeResolve && autoMergeResolve !== 'ours' && autoMergeResolve !== 'theirs' && autoMergeResolve !== 'manual') {
116
+ throw new (_bitError().BitError)('--auto-merge-resolve must be one of the following: [ours, theirs, manual]');
117
+ }
118
+ if (manual) autoMergeResolve = 'manual';
119
+ const mergeStrategy = autoMergeResolve;
120
+ if (noAutoSnap && snapMessage) throw new (_bitError().BitError)('unable to use "no-snap" and "message" flags together');
121
+ if (includeDeps && !pattern && !existingOnWorkspaceOnly) {
122
+ throw new (_bitError().BitError)(`"--include-deps" flag is relevant only for --workspace and --pattern flags`);
123
+ }
124
+ const getResolveUnrelated = () => {
125
+ if (!resolveUnrelated) return undefined;
126
+ if (typeof resolveUnrelated === 'boolean') return 'ours';
127
+ if (resolveUnrelated !== 'ours' && resolveUnrelated !== 'theirs' && resolveUnrelated !== 'manual') {
128
+ throw new Error('--resolve-unrelated must be one of the following: [ours, theirs, manual]');
129
+ }
130
+ return resolveUnrelated;
131
+ };
132
+ if (resolveUnrelated && typeof resolveUnrelated === 'boolean') {
133
+ resolveUnrelated = 'ours';
134
+ }
135
+ const {
136
+ mergeResults,
137
+ deleteResults,
138
+ configMergeResults
139
+ } = await this.mergeLanes.mergeLaneByCLI(name, {
140
+ build,
141
+ // @ts-ignore
142
+ mergeStrategy,
143
+ ours,
144
+ theirs,
145
+ existingOnWorkspaceOnly,
146
+ noAutoSnap,
147
+ noSnap,
148
+ snapMessage,
149
+ keepReadme,
150
+ squash,
151
+ noSquash,
152
+ tag,
153
+ pattern,
154
+ skipDependencyInstallation,
155
+ skipFetch,
156
+ resolveUnrelated: getResolveUnrelated(),
157
+ ignoreConfigChanges,
158
+ includeDeps,
159
+ excludeNonLaneComps,
160
+ detachHead,
161
+ loose
162
+ });
163
+ const mergeResult = (0, _merging().mergeReport)(_objectSpread(_objectSpread({}, mergeResults), {}, {
164
+ configMergeResults,
165
+ verbose
166
+ }));
167
+ const deleteOutput = `\n${deleteResults.localResult ? (0, _remove().removeTemplate)(deleteResults.localResult, false) : ''}${(deleteResults.remoteResult || []).map(item => (0, _remove().removeTemplate)(item, true))}${deleteResults.readmeResult && _chalk().default.yellow(deleteResults.readmeResult) || ''}\n`;
168
+ return mergeResult + deleteOutput;
169
+ }
170
+ }
171
+ exports.MergeLaneCmd = MergeLaneCmd;
172
+
173
+ //# sourceMappingURL=merge-lane.cmd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_merging","_legacy","_bitError","_remove","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","MergeLaneCmd","constructor","mergeLanes","configStore","name","description","COMPONENT_PATTERN_HELP","report","pattern","ours","theirs","manual","autoMergeResolve","build","workspace","existingOnWorkspaceOnly","squash","noAutoSnap","noSnap","tag","message","snapMessage","keepReadme","noSquash","skipDependencyInstallation","skipFetch","includeDeps","resolveUnrelated","ignoreConfigChanges","verbose","excludeNonLaneComps","detachHead","loose","getConfigBoolean","CFG_FORCE_LOCAL_BUILD","Boolean","BitError","mergeStrategy","getResolveUnrelated","undefined","Error","mergeResults","deleteResults","configMergeResults","mergeLaneByCLI","mergeResult","mergeReport","deleteOutput","localResult","removeTemplate","remoteResult","map","item","readmeResult","chalk","yellow","exports"],"sources":["merge-lane.cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { mergeReport, MergeStrategy } from '@teambit/merging';\nimport { COMPONENT_PATTERN_HELP, CFG_FORCE_LOCAL_BUILD } from '@teambit/legacy.constants';\nimport { BitError } from '@teambit/bit-error';\nimport { removeTemplate } from '@teambit/remove';\nimport { MergeLanesMain } from './merge-lanes.main.runtime';\nimport { ConfigStoreMain } from '@teambit/config-store';\n\nexport class MergeLaneCmd implements Command {\n name = 'merge <lane> [pattern]';\n description = `merge a local or a remote lane to the current lane`;\n extendedDescription = `by default, the provided lane will be fetched from the remote before merging.\nto merge the lane from the local scope without updating it first, use \"--skip-fetch\" flag.\n\nwhen the current and merge candidate lanes are diverged in history and the files could be merged with no conflicts,\nthese components will be snap-merged to complete the merge. use \"no-auto-snap\" to opt-out, or \"tag\" to tag instead.\n\nwhen the components are not diverged in history, and the current lane is behind the merge candidate, the merge will\nsimply update the components and the heads according to the merge candidate.\nto opt-out, use \"--no-snap\", the components will be written as the merge candidate, and will be left as modified.\n\nin case a component in both ends don't share history (no snap is found in common), the merge will require \"--resolve-unrelated\" flag.\nthis flag keeps the history of one end and saves a reference to the other end. the decision of which end to keep is determined by the following:\n1. if the component exists on main, then the history linked to main will be kept.\nin this case, the strategy of \"--resolve-unrelated\" only determines which source-code to keep. it's not about the history.\n2. if the component doesn't exist on main, then by default, the history of the current lane will be kept.\nunless \"--resolve-unrelated\" is set to \"theirs\", in which case the history of the other lane will be kept.\n2. a. an edge case: if the component is deleted on the current lane, the strategy will always be \"theirs\".\nso then the history (and the source-code) of the other lane will be kept.\n`;\n arguments = [\n {\n name: 'lane',\n description: 'lane-name or full lane-id (if remote) to merge to the current lane',\n },\n {\n name: 'pattern',\n description: `partially merge the lane - only components that match the specified component-pattern\nComponent pattern format: ${COMPONENT_PATTERN_HELP}`,\n },\n ];\n alias = '';\n options = [\n [\n '',\n 'manual',\n 'same as \"--auto-merge-resolve manual\". in case of merge conflict, write the files with the conflict markers',\n ],\n [\n 'r',\n 'auto-merge-resolve <merge-strategy>',\n 'in case of a merge conflict, resolve according to the provided strategy: [ours, theirs, manual]',\n ],\n ['', 'ours', 'DEPRECATED. use --auto-merge-resolve. in case of a conflict, keep local modifications'],\n ['', 'theirs', 'DEPRECATED. use --auto-merge-resolve. in case of a conflict, override local with incoming changes'],\n ['', 'workspace', 'merge only lane components that are in the current workspace'],\n [\n '',\n 'no-auto-snap',\n 'do not auto snap after merge completed without conflicts of diverged components (see command description)',\n ],\n ['', 'no-snap', 'do not pass snaps from the other lane even for non-diverged components (see command description)'],\n ['', 'tag', 'auto-tag all lane components after merging into main (or tag-merge in case of snap-merge)'],\n ['', 'build', 'in case of snap during the merge, run the build-pipeline (similar to bit snap --build)'],\n ['', 'loose', 'relevant for --build, to allow build to succeed even if tasks like tests or lint fail'],\n ['m', 'message <message>', 'override the default message for the auto snap'],\n ['', 'keep-readme', 'skip deleting the lane readme component after merging'],\n ['', 'no-squash', 'relevant for merging lanes into main, which by default squashes all lane snaps'],\n ['', 'squash', 'relevant for merging a lane into another non-main lane, which by default does not squash'],\n [\n '',\n 'ignore-config-changes',\n 'allow merging when components are modified due to config changes (such as dependencies) only and not files',\n ],\n ['', 'verbose', 'display detailed information about components that were legitimately unmerged'],\n ['x', 'skip-dependency-installation', 'do not install dependencies of the imported components'],\n ['', 'skip-fetch', 'use the local state of target-lane if exits locally, without updating it from the remote'],\n [\n '',\n 'include-deps',\n 'relevant for \"pattern\" and \"--workspace\". merge also dependencies of the specified components',\n ],\n [\n '',\n 'resolve-unrelated [merge-strategy]',\n 'relevant when a component on a lane and the component on main have nothing in common. merge-strategy can be \"ours\" (default) or \"theirs\"',\n ],\n [\n '',\n 'include-non-lane-comps',\n 'DEPRECATED (this is now the default). when merging main, include workspace components that are not on the lane (by default only lane components are merged)',\n ],\n [\n '',\n 'exclude-non-lane-comps',\n 'when merging main into a lane, exclude workspace components that are not on the lane (by default all workspace components are merged)',\n ],\n [\n '',\n 'detach-head',\n 'UNSUPPORTED YET. for each component, find the divergent point from main and merge to that point. do not change the head',\n ],\n ] as CommandOptions;\n loader = true;\n private = true;\n remoteOp = true;\n\n constructor(\n private mergeLanes: MergeLanesMain,\n private configStore: ConfigStoreMain\n ) {}\n\n async report(\n [name, pattern]: [string, string],\n {\n ours,\n theirs,\n manual,\n autoMergeResolve,\n build,\n workspace: existingOnWorkspaceOnly = false,\n squash = false,\n noAutoSnap = false,\n noSnap = false,\n tag = false,\n message: snapMessage = '',\n keepReadme = false,\n noSquash = false,\n skipDependencyInstallation = false,\n skipFetch = false,\n includeDeps = false,\n resolveUnrelated,\n ignoreConfigChanges,\n verbose = false,\n excludeNonLaneComps = false,\n detachHead,\n loose = false,\n }: {\n ours?: boolean;\n theirs?: boolean;\n manual?: boolean;\n autoMergeResolve?: string;\n workspace?: boolean;\n build?: boolean;\n noAutoSnap: boolean;\n noSnap: boolean;\n tag: boolean;\n message: string;\n keepReadme?: boolean;\n squash?: boolean;\n noSquash: boolean;\n skipDependencyInstallation?: boolean;\n skipFetch: boolean;\n includeDeps?: boolean;\n resolveUnrelated?: string | boolean;\n ignoreConfigChanges?: boolean;\n verbose?: boolean;\n excludeNonLaneComps?: boolean;\n detachHead?: boolean;\n loose?: boolean;\n }\n ): Promise<string> {\n build = this.configStore.getConfigBoolean(CFG_FORCE_LOCAL_BUILD) || Boolean(build);\n if (ours || theirs) {\n throw new BitError(\n 'the \"--ours\" and \"--theirs\" flags are deprecated. use \"--auto-merge-resolve\" instead. see \"bit lane merge --help\" for more information'\n );\n }\n if (\n autoMergeResolve &&\n autoMergeResolve !== 'ours' &&\n autoMergeResolve !== 'theirs' &&\n autoMergeResolve !== 'manual'\n ) {\n throw new BitError('--auto-merge-resolve must be one of the following: [ours, theirs, manual]');\n }\n if (manual) autoMergeResolve = 'manual';\n const mergeStrategy = autoMergeResolve;\n if (noAutoSnap && snapMessage) throw new BitError('unable to use \"no-snap\" and \"message\" flags together');\n if (includeDeps && !pattern && !existingOnWorkspaceOnly) {\n throw new BitError(`\"--include-deps\" flag is relevant only for --workspace and --pattern flags`);\n }\n const getResolveUnrelated = (): MergeStrategy | undefined => {\n if (!resolveUnrelated) return undefined;\n if (typeof resolveUnrelated === 'boolean') return 'ours';\n if (resolveUnrelated !== 'ours' && resolveUnrelated !== 'theirs' && resolveUnrelated !== 'manual') {\n throw new Error('--resolve-unrelated must be one of the following: [ours, theirs, manual]');\n }\n return resolveUnrelated;\n };\n if (resolveUnrelated && typeof resolveUnrelated === 'boolean') {\n resolveUnrelated = 'ours';\n }\n const { mergeResults, deleteResults, configMergeResults } = await this.mergeLanes.mergeLaneByCLI(name, {\n build,\n // @ts-ignore\n mergeStrategy,\n ours,\n theirs,\n existingOnWorkspaceOnly,\n noAutoSnap,\n noSnap,\n snapMessage,\n keepReadme,\n squash,\n noSquash,\n tag,\n pattern,\n skipDependencyInstallation,\n skipFetch,\n resolveUnrelated: getResolveUnrelated(),\n ignoreConfigChanges,\n includeDeps,\n excludeNonLaneComps,\n detachHead,\n loose,\n });\n\n const mergeResult = mergeReport({ ...mergeResults, configMergeResults, verbose });\n const deleteOutput = `\\n${deleteResults.localResult ? removeTemplate(deleteResults.localResult, false) : ''}${(\n deleteResults.remoteResult || []\n ).map((item) => removeTemplate(item, true))}${\n (deleteResults.readmeRes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,aAAa;MACb5B,IAAI;MACJC,MAAM;MACNK,uBAAuB;MACvBE,UAAU;MACVC,MAAM;MACNG,WAAW;MACXC,UAAU;MACVN,MAAM;MACNO,QAAQ;MACRJ,GAAG;MACHX,OAAO;MACPgB,0BAA0B;MAC1BC,SAAS;MACTE,gBAAgB,EAAEW,mBAAmB,CAAC,CAAC;MACvCV,mBAAmB;MACnBF,WAAW;MACXI,mBAAmB;MACnBC,UAAU;MACVC;IACF,CAAC,CAAC;IAEF,MAAMa,WAAW,GAAG,IAAAC,sBAAW,EAAAlE,aAAA,CAAAA,aAAA,KAAM6D,YAAY;MAAEE,kBAAkB;MAAEd;IAAO,EAAE,CAAC;IACjF,MAAMkB,YAAY,GAAG,KAAKL,aAAa,CAACM,WAAW,GAAG,IAAAC,wBAAc,EAACP,aAAa,CAACM,WAAW,EAAE,KAAK,CAAC,GAAG,EAAE,GAAG,CAC5GN,aAAa,CAACQ,YAAY,IAAI,EAAE,EAChCC,GAAG,CAAEC,IAAI,IAAK,IAAAH,wBAAc,EAACG,IAAI,EAAE,IAAI,CAAC,CAAC,GACxCV,aAAa,CAACW,YAAY,IAAIC,gBAAK,CAACC,MAAM,CAACb,aAAa,CAACW,YAAY,CAAC,IAAK,EAAE,IAC5E;IACJ,OAAOR,WAAW,GAAGE,YAAY;EACnC;AACF;AAACS,OAAA,CAAAxD,YAAA,GAAAA,YAAA","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ import { Aspect } from '@teambit/harmony';
2
+ export declare const MergeLanesAspect: Aspect;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.MergeLanesAspect = void 0;
7
+ function _harmony() {
8
+ const data = require("@teambit/harmony");
9
+ _harmony = function () {
10
+ return data;
11
+ };
12
+ return data;
13
+ }
14
+ const MergeLanesAspect = exports.MergeLanesAspect = _harmony().Aspect.create({
15
+ id: 'teambit.lanes/merge-lanes'
16
+ });
17
+
18
+ //# sourceMappingURL=merge-lanes.aspect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_harmony","data","require","MergeLanesAspect","exports","Aspect","create","id"],"sources":["merge-lanes.aspect.ts"],"sourcesContent":["import { Aspect } from '@teambit/harmony';\n\nexport const MergeLanesAspect = Aspect.create({\n id: 'teambit.lanes/merge-lanes',\n});\n"],"mappings":";;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAME,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAGE,iBAAM,CAACC,MAAM,CAAC;EAC5CC,EAAE,EAAE;AACN,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,113 @@
1
+ import { CLIMain } from '@teambit/cli';
2
+ import { ImporterMain } from '@teambit/importer';
3
+ import { LanesMain } from '@teambit/lanes';
4
+ import { MergingMain, ApplyVersionResults, MergeStrategy } from '@teambit/merging';
5
+ import { Workspace } from '@teambit/workspace';
6
+ import { ConfigStoreMain } from '@teambit/config-store';
7
+ import { ComponentID } from '@teambit/component-id';
8
+ import { ScopeMain } from '@teambit/scope';
9
+ import { LaneId } from '@teambit/lane-id';
10
+ import { ConfigMergeResult } from '@teambit/config-merger';
11
+ import { Logger, LoggerMain } from '@teambit/logger';
12
+ import { CheckoutMain, CheckoutProps } from '@teambit/checkout';
13
+ import { RemoveMain } from '@teambit/remove';
14
+ import { ExportMain } from '@teambit/export';
15
+ import { MergeAbortOpts } from './merge-abort.cmd';
16
+ import { ExpressMain } from '@teambit/express';
17
+ export type MergeLaneOptions = {
18
+ mergeStrategy: MergeStrategy;
19
+ ours?: boolean;
20
+ theirs?: boolean;
21
+ noAutoSnap?: boolean;
22
+ noSnap?: boolean;
23
+ snapMessage?: string;
24
+ existingOnWorkspaceOnly?: boolean;
25
+ build?: boolean;
26
+ keepReadme?: boolean;
27
+ squash?: boolean;
28
+ noSquash?: boolean;
29
+ tag?: boolean;
30
+ pattern?: string;
31
+ includeDeps?: boolean;
32
+ skipDependencyInstallation?: boolean;
33
+ resolveUnrelated?: MergeStrategy;
34
+ ignoreConfigChanges?: boolean;
35
+ skipFetch?: boolean;
36
+ excludeNonLaneComps?: boolean;
37
+ shouldIncludeUpdateDependents?: boolean;
38
+ throwIfNotUpToDate?: boolean;
39
+ fetchCurrent?: boolean;
40
+ detachHead?: boolean;
41
+ loose?: boolean;
42
+ };
43
+ export type ConflictPerId = {
44
+ id: ComponentID;
45
+ files: string[];
46
+ config?: boolean;
47
+ configConflict?: string;
48
+ };
49
+ export declare class MergeLanesMain {
50
+ private workspace;
51
+ private merging;
52
+ readonly lanes: LanesMain;
53
+ readonly logger: Logger;
54
+ private remove;
55
+ private scope;
56
+ private exporter;
57
+ private importer;
58
+ private checkout;
59
+ constructor(workspace: Workspace | undefined, merging: MergingMain, lanes: LanesMain, logger: Logger, remove: RemoveMain, scope: ScopeMain, exporter: ExportMain, importer: ImporterMain, checkout: CheckoutMain);
60
+ mergeLaneByCLI(laneName: string, options: MergeLaneOptions): Promise<{
61
+ mergeResults: ApplyVersionResults;
62
+ deleteResults: any;
63
+ configMergeResults: ConfigMergeResult[];
64
+ mergedSuccessfullyIds: ComponentID[];
65
+ conflicts: ConflictPerId[];
66
+ }>;
67
+ /**
68
+ * merge otherLaneId into currentLaneId
69
+ */
70
+ mergeLane(otherLaneId: LaneId, currentLaneId: LaneId, options: MergeLaneOptions): Promise<{
71
+ mergeResults: ApplyVersionResults;
72
+ deleteResults: any;
73
+ configMergeResults: ConfigMergeResult[];
74
+ mergedSuccessfullyIds: ComponentID[];
75
+ conflicts: ConflictPerId[];
76
+ }>;
77
+ private validateMergeFlags;
78
+ private resolveMergeContext;
79
+ /**
80
+ * check conflicts in case of merging sourceLaneId into targetLaneId
81
+ */
82
+ checkLaneForConflicts(sourceLaneIdStr: string, targetLaneIdStr: string, options: Partial<MergeLaneOptions>): Promise<{
83
+ conflicts: ConflictPerId[];
84
+ }>;
85
+ mergeMove(newLaneName: string, options: {
86
+ scope?: string;
87
+ }): Promise<import("@teambit/lanes").CreateLaneResult>;
88
+ abortLaneMerge(checkoutProps: CheckoutProps, mergeAbortOpts: MergeAbortOpts): Promise<{
89
+ checkoutResults: ApplyVersionResults | undefined;
90
+ restoredItems: string[];
91
+ checkoutError: Error | undefined;
92
+ }>;
93
+ private getMainIdsToMerge;
94
+ private throwIfNotUpToDate;
95
+ static slots: never[];
96
+ static dependencies: import("@teambit/harmony").Aspect[];
97
+ static runtime: import("@teambit/harmony").RuntimeDefinition;
98
+ static provider([lanes, cli, workspace, merging, loggerMain, remove, scope, exporter, importer, checkout, configStore, express,]: [
99
+ LanesMain,
100
+ CLIMain,
101
+ Workspace,
102
+ MergingMain,
103
+ LoggerMain,
104
+ RemoveMain,
105
+ ScopeMain,
106
+ ExportMain,
107
+ ImporterMain,
108
+ CheckoutMain,
109
+ ConfigStoreMain,
110
+ ExpressMain
111
+ ]): Promise<MergeLanesMain>;
112
+ }
113
+ export default MergeLanesMain;