@teambit/merge-lanes 0.0.1
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.
- package/dist/index.d.ts +4 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/dist/merge-lane.cmd.d.ts +34 -0
- package/dist/merge-lane.cmd.js +162 -0
- package/dist/merge-lane.cmd.js.map +1 -0
- package/dist/merge-lanes.aspect.d.ts +2 -0
- package/dist/merge-lanes.aspect.js +24 -0
- package/dist/merge-lanes.aspect.js.map +1 -0
- package/dist/merge-lanes.main.runtime.d.ts +44 -0
- package/dist/merge-lanes.main.runtime.js +493 -0
- package/dist/merge-lanes.main.runtime.js.map +1 -0
- package/package-tar/teambit-merge-lanes-0.0.1.tgz +0 -0
- package/package.json +62 -0
- package/preview-1661225521544.js +5 -0
- package/tsconfig.json +40 -0
- package/types/asset.d.ts +29 -0
- package/types/style.d.ts +42 -0
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
Object.defineProperty(exports, "MergeLanesAspect", {
|
7
|
+
enumerable: true,
|
8
|
+
get: function () {
|
9
|
+
return _mergeLanes().MergeLanesAspect;
|
10
|
+
}
|
11
|
+
});
|
12
|
+
exports.default = void 0;
|
13
|
+
|
14
|
+
function _mergeLanes() {
|
15
|
+
const data = require("./merge-lanes.aspect");
|
16
|
+
|
17
|
+
_mergeLanes = function () {
|
18
|
+
return data;
|
19
|
+
};
|
20
|
+
|
21
|
+
return data;
|
22
|
+
}
|
23
|
+
|
24
|
+
var _default = _mergeLanes().MergeLanesAspect;
|
25
|
+
|
26
|
+
exports.default = _default;
|
27
|
+
|
28
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["MergeLanesAspect"],"sources":["index.ts"],"sourcesContent":["import { MergeLanesAspect } from './merge-lanes.aspect';\n\nexport type { MergeLanesMain } from './merge-lanes.main.runtime';\nexport default MergeLanesAspect;\nexport { MergeLanesAspect };\n"],"mappings":";;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;eAGeA,8B"}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import { Command, CommandOptions } from '@teambit/cli';
|
2
|
+
import { MergeLanesMain } from './merge-lanes.main.runtime';
|
3
|
+
export declare class MergeLaneCmd implements Command {
|
4
|
+
private mergeLanes;
|
5
|
+
name: string;
|
6
|
+
description: string;
|
7
|
+
extendedDescription: string;
|
8
|
+
arguments: {
|
9
|
+
name: string;
|
10
|
+
description: string;
|
11
|
+
}[];
|
12
|
+
alias: string;
|
13
|
+
options: CommandOptions;
|
14
|
+
loader: boolean;
|
15
|
+
private: boolean;
|
16
|
+
migration: boolean;
|
17
|
+
remoteOp: boolean;
|
18
|
+
constructor(mergeLanes: MergeLanesMain);
|
19
|
+
report([name, pattern]: [string, string], { ours, theirs, manual, build, workspace: existingOnWorkspaceOnly, noSnap, message: snapMessage, keepReadme, squash, skipDependencyInstallation, remote, includeDeps, verbose, }: {
|
20
|
+
ours: boolean;
|
21
|
+
theirs: boolean;
|
22
|
+
manual: boolean;
|
23
|
+
workspace?: boolean;
|
24
|
+
build?: boolean;
|
25
|
+
noSnap: boolean;
|
26
|
+
message: string;
|
27
|
+
keepReadme?: boolean;
|
28
|
+
squash: boolean;
|
29
|
+
skipDependencyInstallation?: boolean;
|
30
|
+
remote: boolean;
|
31
|
+
includeDeps?: boolean;
|
32
|
+
verbose?: boolean;
|
33
|
+
}): Promise<string>;
|
34
|
+
}
|
@@ -0,0 +1,162 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
5
|
+
require("core-js/modules/es.array.iterator.js");
|
6
|
+
|
7
|
+
require("core-js/modules/es.promise.js");
|
8
|
+
|
9
|
+
Object.defineProperty(exports, "__esModule", {
|
10
|
+
value: true
|
11
|
+
});
|
12
|
+
exports.MergeLaneCmd = void 0;
|
13
|
+
|
14
|
+
function _defineProperty2() {
|
15
|
+
const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
16
|
+
|
17
|
+
_defineProperty2 = function () {
|
18
|
+
return data;
|
19
|
+
};
|
20
|
+
|
21
|
+
return data;
|
22
|
+
}
|
23
|
+
|
24
|
+
function _chalk() {
|
25
|
+
const data = _interopRequireDefault(require("chalk"));
|
26
|
+
|
27
|
+
_chalk = function () {
|
28
|
+
return data;
|
29
|
+
};
|
30
|
+
|
31
|
+
return data;
|
32
|
+
}
|
33
|
+
|
34
|
+
function _mergeVersion() {
|
35
|
+
const data = require("@teambit/legacy/dist/consumer/versions-ops/merge-version");
|
36
|
+
|
37
|
+
_mergeVersion = function () {
|
38
|
+
return data;
|
39
|
+
};
|
40
|
+
|
41
|
+
return data;
|
42
|
+
}
|
43
|
+
|
44
|
+
function _merging() {
|
45
|
+
const data = require("@teambit/merging");
|
46
|
+
|
47
|
+
_merging = function () {
|
48
|
+
return data;
|
49
|
+
};
|
50
|
+
|
51
|
+
return data;
|
52
|
+
}
|
53
|
+
|
54
|
+
function _featureToggle() {
|
55
|
+
const data = require("@teambit/legacy/dist/api/consumer/lib/feature-toggle");
|
56
|
+
|
57
|
+
_featureToggle = function () {
|
58
|
+
return data;
|
59
|
+
};
|
60
|
+
|
61
|
+
return data;
|
62
|
+
}
|
63
|
+
|
64
|
+
function _bitError() {
|
65
|
+
const data = require("@teambit/bit-error");
|
66
|
+
|
67
|
+
_bitError = function () {
|
68
|
+
return data;
|
69
|
+
};
|
70
|
+
|
71
|
+
return data;
|
72
|
+
}
|
73
|
+
|
74
|
+
function _removeTemplate() {
|
75
|
+
const data = _interopRequireDefault(require("@teambit/legacy/dist/cli/templates/remove-template"));
|
76
|
+
|
77
|
+
_removeTemplate = function () {
|
78
|
+
return data;
|
79
|
+
};
|
80
|
+
|
81
|
+
return data;
|
82
|
+
}
|
83
|
+
|
84
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
85
|
+
|
86
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2().default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
87
|
+
|
88
|
+
class MergeLaneCmd {
|
89
|
+
constructor(mergeLanes) {
|
90
|
+
this.mergeLanes = mergeLanes;
|
91
|
+
(0, _defineProperty2().default)(this, "name", 'merge <lane> [pattern]');
|
92
|
+
(0, _defineProperty2().default)(this, "description", `merge a local or a remote lane`);
|
93
|
+
(0, _defineProperty2().default)(this, "extendedDescription", `if the <lane> exists locally, it will be merged from the local lane.
|
94
|
+
otherwise, it will fetch the lane from the remote and merge it.
|
95
|
+
in case the <lane> exists locally but you want to merge the remote version of it, use --remote flag`);
|
96
|
+
(0, _defineProperty2().default)(this, "arguments", [{
|
97
|
+
name: 'lane',
|
98
|
+
description: 'lane-name or lane-id (if not exists locally) to merge to the current lane'
|
99
|
+
}, {
|
100
|
+
name: 'pattern',
|
101
|
+
description: 'EXPERIMENTAL. partially merge the lane with the specified component-pattern'
|
102
|
+
}]);
|
103
|
+
(0, _defineProperty2().default)(this, "alias", '');
|
104
|
+
(0, _defineProperty2().default)(this, "options", [['', 'ours', 'in case of a conflict, override the used version with the current modification'], ['', 'theirs', 'in case of a conflict, override the current modification with the specified version'], ['', 'manual', 'in case of a conflict, leave the files with a conflict state to resolve them manually later'], ['', 'workspace', 'merge only components in a lane that exist in the workspace'], ['', 'no-snap', 'do not auto snap in case the merge completed without conflicts'], ['', 'build', 'in case of snap during the merge, run the build-pipeline (similar to bit snap --build)'], ['m', 'message <message>', 'override the default message for the auto snap'], ['', 'keep-readme', 'skip deleting the lane readme component after merging'], ['', 'squash', 'EXPERIMENTAL. squash multiple snaps. keep the last one only'], ['', 'verbose', 'show details of components that were not merged legitimately'], ['', 'skip-dependency-installation', 'do not install packages of the imported components'], ['', 'remote', 'relevant when the target-lane locally is differ than the remote and you want the remote'], ['', 'include-deps', 'EXPERIMENTAL. relevant for "--pattern" and "--workspace". merge also dependencies of the given components']]);
|
105
|
+
(0, _defineProperty2().default)(this, "loader", true);
|
106
|
+
(0, _defineProperty2().default)(this, "private", true);
|
107
|
+
(0, _defineProperty2().default)(this, "migration", true);
|
108
|
+
(0, _defineProperty2().default)(this, "remoteOp", true);
|
109
|
+
}
|
110
|
+
|
111
|
+
async report([name, pattern], {
|
112
|
+
ours = false,
|
113
|
+
theirs = false,
|
114
|
+
manual = false,
|
115
|
+
build,
|
116
|
+
workspace: existingOnWorkspaceOnly = false,
|
117
|
+
noSnap = false,
|
118
|
+
message: snapMessage = '',
|
119
|
+
keepReadme = false,
|
120
|
+
squash = false,
|
121
|
+
skipDependencyInstallation = false,
|
122
|
+
remote = false,
|
123
|
+
includeDeps = false,
|
124
|
+
verbose = false
|
125
|
+
}) {
|
126
|
+
build = (0, _featureToggle().isFeatureEnabled)(_featureToggle().BUILD_ON_CI) ? Boolean(build) : true;
|
127
|
+
const mergeStrategy = (0, _mergeVersion().getMergeStrategy)(ours, theirs, manual);
|
128
|
+
if (noSnap && snapMessage) throw new (_bitError().BitError)('unable to use "noSnap" and "message" flags together');
|
129
|
+
|
130
|
+
if (includeDeps && !pattern && !existingOnWorkspaceOnly) {
|
131
|
+
throw new (_bitError().BitError)(`"--include-deps" flag is relevant only for --workspace and --pattern flags`);
|
132
|
+
}
|
133
|
+
|
134
|
+
const {
|
135
|
+
mergeResults,
|
136
|
+
deleteResults
|
137
|
+
} = await this.mergeLanes.mergeLane(name, {
|
138
|
+
build,
|
139
|
+
// @ts-ignore
|
140
|
+
mergeStrategy,
|
141
|
+
existingOnWorkspaceOnly,
|
142
|
+
noSnap,
|
143
|
+
snapMessage,
|
144
|
+
keepReadme,
|
145
|
+
squash,
|
146
|
+
pattern,
|
147
|
+
skipDependencyInstallation,
|
148
|
+
remote,
|
149
|
+
includeDeps
|
150
|
+
});
|
151
|
+
const mergeResult = (0, _merging().mergeReport)(_objectSpread(_objectSpread({}, mergeResults), {}, {
|
152
|
+
verbose
|
153
|
+
}));
|
154
|
+
const deleteResult = `${deleteResults.localResult ? (0, _removeTemplate().default)(deleteResults.localResult, false) : ''}${(deleteResults.remoteResult || []).map(item => (0, _removeTemplate().default)(item, true))}${deleteResults.readmeResult && _chalk().default.yellow(deleteResults.readmeResult) || ''}\n`;
|
155
|
+
return mergeResult + deleteResult;
|
156
|
+
}
|
157
|
+
|
158
|
+
}
|
159
|
+
|
160
|
+
exports.MergeLaneCmd = MergeLaneCmd;
|
161
|
+
|
162
|
+
//# sourceMappingURL=merge-lane.cmd.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["MergeLaneCmd","constructor","mergeLanes","name","description","report","pattern","ours","theirs","manual","build","workspace","existingOnWorkspaceOnly","noSnap","message","snapMessage","keepReadme","squash","skipDependencyInstallation","remote","includeDeps","verbose","isFeatureEnabled","BUILD_ON_CI","Boolean","mergeStrategy","getMergeStrategy","BitError","mergeResults","deleteResults","mergeLane","mergeResult","mergeReport","deleteResult","localResult","paintRemoved","remoteResult","map","item","readmeResult","chalk","yellow"],"sources":["merge-lane.cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { getMergeStrategy } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { mergeReport } from '@teambit/merging';\nimport { BUILD_ON_CI, isFeatureEnabled } from '@teambit/legacy/dist/api/consumer/lib/feature-toggle';\nimport { BitError } from '@teambit/bit-error';\nimport paintRemoved from '@teambit/legacy/dist/cli/templates/remove-template';\nimport { MergeLanesMain } from './merge-lanes.main.runtime';\n\nexport class MergeLaneCmd implements Command {\n name = 'merge <lane> [pattern]';\n description = `merge a local or a remote lane`;\n extendedDescription = `if the <lane> exists locally, it will be merged from the local lane.\notherwise, it will fetch the lane from the remote and merge it.\nin case the <lane> exists locally but you want to merge the remote version of it, use --remote flag`;\n arguments = [\n {\n name: 'lane',\n description: 'lane-name or lane-id (if not exists locally) to merge to the current lane',\n },\n {\n name: 'pattern',\n description: 'EXPERIMENTAL. partially merge the lane with the specified component-pattern',\n },\n ];\n alias = '';\n options = [\n ['', 'ours', 'in case of a conflict, override the used version with the current modification'],\n ['', 'theirs', 'in case of a conflict, override the current modification with the specified version'],\n ['', 'manual', 'in case of a conflict, leave the files with a conflict state to resolve them manually later'],\n ['', 'workspace', 'merge only components in a lane that exist in the workspace'],\n ['', 'no-snap', 'do not auto snap in case the merge completed without conflicts'],\n ['', 'build', 'in case of snap during the merge, run the build-pipeline (similar to bit snap --build)'],\n ['m', 'message <message>', 'override the default message for the auto snap'],\n ['', 'keep-readme', 'skip deleting the lane readme component after merging'],\n ['', 'squash', 'EXPERIMENTAL. squash multiple snaps. keep the last one only'],\n ['', 'verbose', 'show details of components that were not merged legitimately'],\n ['', 'skip-dependency-installation', 'do not install packages of the imported components'],\n ['', 'remote', 'relevant when the target-lane locally is differ than the remote and you want the remote'],\n [\n '',\n 'include-deps',\n 'EXPERIMENTAL. relevant for \"--pattern\" and \"--workspace\". merge also dependencies of the given components',\n ],\n ] as CommandOptions;\n loader = true;\n private = true;\n migration = true;\n remoteOp = true;\n\n constructor(private mergeLanes: MergeLanesMain) {}\n\n async report(\n [name, pattern]: [string, string],\n {\n ours = false,\n theirs = false,\n manual = false,\n build,\n workspace: existingOnWorkspaceOnly = false,\n noSnap = false,\n message: snapMessage = '',\n keepReadme = false,\n squash = false,\n skipDependencyInstallation = false,\n remote = false,\n includeDeps = false,\n verbose = false,\n }: {\n ours: boolean;\n theirs: boolean;\n manual: boolean;\n workspace?: boolean;\n build?: boolean;\n noSnap: boolean;\n message: string;\n keepReadme?: boolean;\n squash: boolean;\n skipDependencyInstallation?: boolean;\n remote: boolean;\n includeDeps?: boolean;\n verbose?: boolean;\n }\n ): Promise<string> {\n build = isFeatureEnabled(BUILD_ON_CI) ? Boolean(build) : true;\n const mergeStrategy = getMergeStrategy(ours, theirs, manual);\n if (noSnap && snapMessage) throw new BitError('unable to use \"noSnap\" 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 { mergeResults, deleteResults } = await this.mergeLanes.mergeLane(name, {\n build,\n // @ts-ignore\n mergeStrategy,\n existingOnWorkspaceOnly,\n noSnap,\n snapMessage,\n keepReadme,\n squash,\n pattern,\n skipDependencyInstallation,\n remote,\n includeDeps,\n });\n\n const mergeResult = mergeReport({ ...mergeResults, verbose });\n const deleteResult = `${deleteResults.localResult ? paintRemoved(deleteResults.localResult, false) : ''}${(\n deleteResults.remoteResult || []\n ).map((item) => paintRemoved(item, true))}${\n (deleteResults.readmeResult && chalk.yellow(deleteResults.readmeResult)) || ''\n }\\n`;\n return mergeResult + deleteResult;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;;;;;AAGO,MAAMA,YAAN,CAA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,IAA8B,EAD0E,EAExGC,GAFwG,CAEnGC,IAAD,IAAU,IAAAH,yBAAA,EAAaG,IAAb,EAAmB,IAAnB,CAF0F,CAEhE,GACvCT,aAAa,CAACU,YAAd,IAA8BC,gBAAA,CAAMC,MAAN,CAAaZ,aAAa,CAACU,YAA3B,CAA/B,IAA4E,EAC7E,IAJD;IAKA,OAAOR,WAAW,GAAGE,YAArB;EACD;;AAvG0C"}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.MergeLanesAspect = void 0;
|
7
|
+
|
8
|
+
function _harmony() {
|
9
|
+
const data = require("@teambit/harmony");
|
10
|
+
|
11
|
+
_harmony = function () {
|
12
|
+
return data;
|
13
|
+
};
|
14
|
+
|
15
|
+
return data;
|
16
|
+
}
|
17
|
+
|
18
|
+
const MergeLanesAspect = _harmony().Aspect.create({
|
19
|
+
id: 'teambit.lanes/merge-lanes'
|
20
|
+
});
|
21
|
+
|
22
|
+
exports.MergeLanesAspect = MergeLanesAspect;
|
23
|
+
|
24
|
+
//# sourceMappingURL=merge-lanes.aspect.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["MergeLanesAspect","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;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEO,MAAMA,gBAAgB,GAAGC,iBAAA,CAAOC,MAAP,CAAc;EAC5CC,EAAE,EAAE;AADwC,CAAd,CAAzB"}
|
@@ -0,0 +1,44 @@
|
|
1
|
+
import { CLIMain } from '@teambit/cli';
|
2
|
+
import { LanesMain } from '@teambit/lanes';
|
3
|
+
import { MergingMain } from '@teambit/merging';
|
4
|
+
import { Workspace } from '@teambit/workspace';
|
5
|
+
import { MergeStrategy, ApplyVersionResults } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';
|
6
|
+
import { Logger, LoggerMain } from '@teambit/logger';
|
7
|
+
import { RemoveMain } from '@teambit/remove';
|
8
|
+
export declare type MergeLaneOptions = {
|
9
|
+
mergeStrategy: MergeStrategy;
|
10
|
+
noSnap: boolean;
|
11
|
+
snapMessage: string;
|
12
|
+
existingOnWorkspaceOnly: boolean;
|
13
|
+
build: boolean;
|
14
|
+
keepReadme: boolean;
|
15
|
+
squash: boolean;
|
16
|
+
pattern?: string;
|
17
|
+
includeDeps?: boolean;
|
18
|
+
skipDependencyInstallation?: boolean;
|
19
|
+
remote?: boolean;
|
20
|
+
};
|
21
|
+
export declare class MergeLanesMain {
|
22
|
+
private workspace;
|
23
|
+
private merging;
|
24
|
+
private lanes;
|
25
|
+
private logger;
|
26
|
+
private remove;
|
27
|
+
constructor(workspace: Workspace | undefined, merging: MergingMain, lanes: LanesMain, logger: Logger, remove: RemoveMain);
|
28
|
+
mergeLane(laneName: string, options: MergeLaneOptions): Promise<{
|
29
|
+
mergeResults: ApplyVersionResults;
|
30
|
+
deleteResults: any;
|
31
|
+
}>;
|
32
|
+
static slots: never[];
|
33
|
+
static dependencies: import("@teambit/harmony").Aspect[];
|
34
|
+
static runtime: import("@teambit/harmony").RuntimeDefinition;
|
35
|
+
static provider([lanes, cli, workspace, merging, loggerMain, remove]: [
|
36
|
+
LanesMain,
|
37
|
+
CLIMain,
|
38
|
+
Workspace,
|
39
|
+
MergingMain,
|
40
|
+
LoggerMain,
|
41
|
+
RemoveMain
|
42
|
+
]): Promise<MergeLanesMain>;
|
43
|
+
}
|
44
|
+
export default MergeLanesMain;
|
@@ -0,0 +1,493 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
5
|
+
require("core-js/modules/es.array.iterator.js");
|
6
|
+
|
7
|
+
require("core-js/modules/es.promise.js");
|
8
|
+
|
9
|
+
Object.defineProperty(exports, "__esModule", {
|
10
|
+
value: true
|
11
|
+
});
|
12
|
+
exports.default = exports.MergeLanesMain = void 0;
|
13
|
+
|
14
|
+
function _defineProperty2() {
|
15
|
+
const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
16
|
+
|
17
|
+
_defineProperty2 = function () {
|
18
|
+
return data;
|
19
|
+
};
|
20
|
+
|
21
|
+
return data;
|
22
|
+
}
|
23
|
+
|
24
|
+
function _bitError() {
|
25
|
+
const data = require("@teambit/bit-error");
|
26
|
+
|
27
|
+
_bitError = function () {
|
28
|
+
return data;
|
29
|
+
};
|
30
|
+
|
31
|
+
return data;
|
32
|
+
}
|
33
|
+
|
34
|
+
function _cli() {
|
35
|
+
const data = require("@teambit/cli");
|
36
|
+
|
37
|
+
_cli = function () {
|
38
|
+
return data;
|
39
|
+
};
|
40
|
+
|
41
|
+
return data;
|
42
|
+
}
|
43
|
+
|
44
|
+
function _lanes() {
|
45
|
+
const data = require("@teambit/lanes");
|
46
|
+
|
47
|
+
_lanes = function () {
|
48
|
+
return data;
|
49
|
+
};
|
50
|
+
|
51
|
+
return data;
|
52
|
+
}
|
53
|
+
|
54
|
+
function _merging() {
|
55
|
+
const data = _interopRequireDefault(require("@teambit/merging"));
|
56
|
+
|
57
|
+
_merging = function () {
|
58
|
+
return data;
|
59
|
+
};
|
60
|
+
|
61
|
+
return data;
|
62
|
+
}
|
63
|
+
|
64
|
+
function _workspace() {
|
65
|
+
const data = _interopRequireDefault(require("@teambit/workspace"));
|
66
|
+
|
67
|
+
_workspace = function () {
|
68
|
+
return data;
|
69
|
+
};
|
70
|
+
|
71
|
+
return data;
|
72
|
+
}
|
73
|
+
|
74
|
+
function _chalk() {
|
75
|
+
const data = _interopRequireDefault(require("chalk"));
|
76
|
+
|
77
|
+
_chalk = function () {
|
78
|
+
return data;
|
79
|
+
};
|
80
|
+
|
81
|
+
return data;
|
82
|
+
}
|
83
|
+
|
84
|
+
function _pMapSeries() {
|
85
|
+
const data = _interopRequireDefault(require("p-map-series"));
|
86
|
+
|
87
|
+
_pMapSeries = function () {
|
88
|
+
return data;
|
89
|
+
};
|
90
|
+
|
91
|
+
return data;
|
92
|
+
}
|
93
|
+
|
94
|
+
function _bitId() {
|
95
|
+
const data = require("@teambit/legacy/dist/bit-id");
|
96
|
+
|
97
|
+
_bitId = function () {
|
98
|
+
return data;
|
99
|
+
};
|
100
|
+
|
101
|
+
return data;
|
102
|
+
}
|
103
|
+
|
104
|
+
function _laneId() {
|
105
|
+
const data = require("@teambit/lane-id");
|
106
|
+
|
107
|
+
_laneId = function () {
|
108
|
+
return data;
|
109
|
+
};
|
110
|
+
|
111
|
+
return data;
|
112
|
+
}
|
113
|
+
|
114
|
+
function _repositories() {
|
115
|
+
const data = require("@teambit/legacy/dist/scope/repositories");
|
116
|
+
|
117
|
+
_repositories = function () {
|
118
|
+
return data;
|
119
|
+
};
|
120
|
+
|
121
|
+
return data;
|
122
|
+
}
|
123
|
+
|
124
|
+
function _logger() {
|
125
|
+
const data = require("@teambit/logger");
|
126
|
+
|
127
|
+
_logger = function () {
|
128
|
+
return data;
|
129
|
+
};
|
130
|
+
|
131
|
+
return data;
|
132
|
+
}
|
133
|
+
|
134
|
+
function _remove() {
|
135
|
+
const data = require("@teambit/remove");
|
136
|
+
|
137
|
+
_remove = function () {
|
138
|
+
return data;
|
139
|
+
};
|
140
|
+
|
141
|
+
return data;
|
142
|
+
}
|
143
|
+
|
144
|
+
function _mergeLanes() {
|
145
|
+
const data = require("./merge-lanes.aspect");
|
146
|
+
|
147
|
+
_mergeLanes = function () {
|
148
|
+
return data;
|
149
|
+
};
|
150
|
+
|
151
|
+
return data;
|
152
|
+
}
|
153
|
+
|
154
|
+
function _mergeLane() {
|
155
|
+
const data = require("./merge-lane.cmd");
|
156
|
+
|
157
|
+
_mergeLane = function () {
|
158
|
+
return data;
|
159
|
+
};
|
160
|
+
|
161
|
+
return data;
|
162
|
+
}
|
163
|
+
|
164
|
+
class MergeLanesMain {
|
165
|
+
constructor(workspace, merging, lanes, logger, remove) {
|
166
|
+
this.workspace = workspace;
|
167
|
+
this.merging = merging;
|
168
|
+
this.lanes = lanes;
|
169
|
+
this.logger = logger;
|
170
|
+
this.remove = remove;
|
171
|
+
}
|
172
|
+
|
173
|
+
async mergeLane(laneName, options) {
|
174
|
+
if (!this.workspace) {
|
175
|
+
throw new (_bitError().BitError)(`unable to merge a lane outside of Bit workspace`);
|
176
|
+
}
|
177
|
+
|
178
|
+
const consumer = this.workspace.consumer;
|
179
|
+
const {
|
180
|
+
mergeStrategy,
|
181
|
+
noSnap,
|
182
|
+
snapMessage,
|
183
|
+
existingOnWorkspaceOnly,
|
184
|
+
build,
|
185
|
+
keepReadme,
|
186
|
+
squash,
|
187
|
+
pattern,
|
188
|
+
includeDeps,
|
189
|
+
skipDependencyInstallation,
|
190
|
+
remote
|
191
|
+
} = options;
|
192
|
+
const currentLaneId = consumer.getCurrentLaneId();
|
193
|
+
const otherLaneId = await consumer.getParsedLaneId(laneName);
|
194
|
+
|
195
|
+
if (otherLaneId.isEqual(currentLaneId)) {
|
196
|
+
throw new (_bitError().BitError)(`unable to merge lane "${otherLaneId.toString()}", you're already at this lane. to get updates, simply run "bit checkout head"`);
|
197
|
+
}
|
198
|
+
|
199
|
+
const currentLane = currentLaneId.isDefault() ? null : await consumer.scope.loadLane(currentLaneId);
|
200
|
+
const isDefaultLane = otherLaneId.isDefault();
|
201
|
+
|
202
|
+
const getOtherLane = async () => {
|
203
|
+
if (isDefaultLane) {
|
204
|
+
return undefined;
|
205
|
+
}
|
206
|
+
|
207
|
+
const lane = await consumer.scope.loadLane(otherLaneId);
|
208
|
+
|
209
|
+
if (remote || !lane) {
|
210
|
+
return this.lanes.fetchLaneWithItsComponents(otherLaneId);
|
211
|
+
}
|
212
|
+
|
213
|
+
return lane;
|
214
|
+
};
|
215
|
+
|
216
|
+
const otherLane = await getOtherLane();
|
217
|
+
|
218
|
+
const getBitIds = async () => {
|
219
|
+
if (isDefaultLane) {
|
220
|
+
if (!currentLane) throw new Error(`unable to merge ${_laneId().DEFAULT_LANE}, the current lane was not found`);
|
221
|
+
return consumer.scope.getDefaultLaneIdsFromLane(currentLane);
|
222
|
+
}
|
223
|
+
|
224
|
+
if (!otherLane) throw new Error(`lane must be defined for non-default`);
|
225
|
+
return otherLane.toBitIds();
|
226
|
+
};
|
227
|
+
|
228
|
+
const bitIds = await getBitIds();
|
229
|
+
this.logger.debug(`merging the following bitIds: ${bitIds.toString()}`);
|
230
|
+
const otherLaneName = isDefaultLane ? _laneId().DEFAULT_LANE : otherLaneId.toString();
|
231
|
+
|
232
|
+
const getAllComponentsStatus = async () => {
|
233
|
+
const tmp = new (_repositories().Tmp)(consumer.scope);
|
234
|
+
|
235
|
+
try {
|
236
|
+
const componentsStatus = await Promise.all(bitIds.map(bitId => this.merging.getComponentMergeStatus(bitId, currentLane, otherLaneName)));
|
237
|
+
await tmp.clear();
|
238
|
+
return componentsStatus;
|
239
|
+
} catch (err) {
|
240
|
+
await tmp.clear();
|
241
|
+
throw err;
|
242
|
+
}
|
243
|
+
};
|
244
|
+
|
245
|
+
let allComponentsStatus = await getAllComponentsStatus();
|
246
|
+
|
247
|
+
if (pattern) {
|
248
|
+
const componentIds = await this.workspace.resolveMultipleComponentIds(bitIds);
|
249
|
+
const compIdsFromPattern = this.workspace.scope.filterIdsFromPoolIdsByPattern(pattern, componentIds);
|
250
|
+
allComponentsStatus = await filterComponentsStatus(allComponentsStatus, compIdsFromPattern, bitIds, this.workspace, includeDeps, otherLane || undefined);
|
251
|
+
bitIds.forEach(bitId => {
|
252
|
+
if (!allComponentsStatus.find(c => c.id.isEqualWithoutVersion(bitId))) {
|
253
|
+
allComponentsStatus.push({
|
254
|
+
id: bitId,
|
255
|
+
unmergedLegitimately: true,
|
256
|
+
unmergedMessage: `excluded by pattern`
|
257
|
+
});
|
258
|
+
}
|
259
|
+
});
|
260
|
+
}
|
261
|
+
|
262
|
+
if (existingOnWorkspaceOnly) {
|
263
|
+
const workspaceIds = await this.workspace.listIds();
|
264
|
+
const compIdsFromPattern = workspaceIds.filter(id => allComponentsStatus.find(c => c.id.isEqualWithoutVersion(id._legacy)));
|
265
|
+
allComponentsStatus = await filterComponentsStatus(allComponentsStatus, compIdsFromPattern, bitIds, this.workspace, includeDeps);
|
266
|
+
bitIds.forEach(bitId => {
|
267
|
+
if (!allComponentsStatus.find(c => c.id.isEqualWithoutVersion(bitId))) {
|
268
|
+
allComponentsStatus.push({
|
269
|
+
id: bitId,
|
270
|
+
unmergedLegitimately: true,
|
271
|
+
unmergedMessage: `not in the workspace`
|
272
|
+
});
|
273
|
+
}
|
274
|
+
});
|
275
|
+
}
|
276
|
+
|
277
|
+
throwForFailures();
|
278
|
+
|
279
|
+
if (squash) {
|
280
|
+
squashSnaps(allComponentsStatus, laneName, consumer);
|
281
|
+
}
|
282
|
+
|
283
|
+
const mergeResults = await this.merging.mergeSnaps({
|
284
|
+
mergeStrategy,
|
285
|
+
allComponentsStatus,
|
286
|
+
remoteName: otherLane ? otherLane.scope : null,
|
287
|
+
laneId: otherLaneId,
|
288
|
+
localLane: currentLane,
|
289
|
+
noSnap,
|
290
|
+
snapMessage,
|
291
|
+
build,
|
292
|
+
skipDependencyInstallation
|
293
|
+
});
|
294
|
+
const mergedSuccessfully = !mergeResults.failedComponents || mergeResults.failedComponents.length === 0 || mergeResults.failedComponents.every(failedComponent => failedComponent.unchangedLegitimately);
|
295
|
+
let deleteResults = {};
|
296
|
+
|
297
|
+
if (!keepReadme && otherLane && otherLane.readmeComponent && mergedSuccessfully) {
|
298
|
+
var _otherLane$readmeComp, _otherLane$readmeComp2;
|
299
|
+
|
300
|
+
const readmeComponentId = otherLane.readmeComponent.id.changeVersion((_otherLane$readmeComp = otherLane.readmeComponent) === null || _otherLane$readmeComp === void 0 ? void 0 : (_otherLane$readmeComp2 = _otherLane$readmeComp.head) === null || _otherLane$readmeComp2 === void 0 ? void 0 : _otherLane$readmeComp2.hash).toString();
|
301
|
+
deleteResults = await this.remove.remove({
|
302
|
+
componentsPattern: readmeComponentId,
|
303
|
+
force: false,
|
304
|
+
remote: false,
|
305
|
+
track: false,
|
306
|
+
deleteFiles: true
|
307
|
+
});
|
308
|
+
} else if (otherLane && !otherLane.readmeComponent) {
|
309
|
+
deleteResults = {
|
310
|
+
readmeResult: `\nlane ${otherLane.name} doesn't have a readme component`
|
311
|
+
};
|
312
|
+
}
|
313
|
+
|
314
|
+
await this.workspace.consumer.onDestroy();
|
315
|
+
return {
|
316
|
+
mergeResults,
|
317
|
+
deleteResults
|
318
|
+
};
|
319
|
+
|
320
|
+
function throwForFailures() {
|
321
|
+
const failedComponents = allComponentsStatus.filter(c => c.unmergedMessage && !c.unmergedLegitimately);
|
322
|
+
|
323
|
+
if (failedComponents.length) {
|
324
|
+
const failureMsgs = failedComponents.map(failedComponent => `${_chalk().default.bold(failedComponent.id.toString())} - ${_chalk().default.red(failedComponent.unmergedMessage)}`).join('\n');
|
325
|
+
throw new (_bitError().BitError)(`unable to merge due to the following failures:\n${failureMsgs}`);
|
326
|
+
}
|
327
|
+
}
|
328
|
+
}
|
329
|
+
|
330
|
+
static async provider([lanes, cli, workspace, merging, loggerMain, remove]) {
|
331
|
+
var _lanesCommand$command;
|
332
|
+
|
333
|
+
const logger = loggerMain.createLogger(_mergeLanes().MergeLanesAspect.id);
|
334
|
+
const lanesCommand = cli.getCommand('lane');
|
335
|
+
const mergeLanesMain = new MergeLanesMain(workspace, merging, lanes, logger, remove);
|
336
|
+
lanesCommand === null || lanesCommand === void 0 ? void 0 : (_lanesCommand$command = lanesCommand.commands) === null || _lanesCommand$command === void 0 ? void 0 : _lanesCommand$command.push(new (_mergeLane().MergeLaneCmd)(mergeLanesMain));
|
337
|
+
return mergeLanesMain;
|
338
|
+
}
|
339
|
+
|
340
|
+
}
|
341
|
+
|
342
|
+
exports.MergeLanesMain = MergeLanesMain;
|
343
|
+
(0, _defineProperty2().default)(MergeLanesMain, "slots", []);
|
344
|
+
(0, _defineProperty2().default)(MergeLanesMain, "dependencies", [_lanes().LanesAspect, _cli().CLIAspect, _workspace().default, _merging().default, _logger().LoggerAspect, _remove().RemoveAspect]);
|
345
|
+
(0, _defineProperty2().default)(MergeLanesMain, "runtime", _cli().MainRuntime);
|
346
|
+
|
347
|
+
async function filterComponentsStatus(allComponentsStatus, compIdsToKeep, allBitIds, workspace, includeDeps = false, lane) {
|
348
|
+
const bitIdsFromPattern = _bitId().BitIds.fromArray(compIdsToKeep.map(c => c._legacy));
|
349
|
+
|
350
|
+
const bitIdsNotFromPattern = allBitIds.filter(bitId => !bitIdsFromPattern.hasWithoutVersion(bitId));
|
351
|
+
const filteredComponentStatus = [];
|
352
|
+
const depsToAdd = [];
|
353
|
+
await (0, _pMapSeries().default)(compIdsToKeep, async compId => {
|
354
|
+
const fromStatus = allComponentsStatus.find(c => c.id.isEqualWithoutVersion(compId._legacy));
|
355
|
+
|
356
|
+
if (!fromStatus) {
|
357
|
+
throw new Error(`filterComponentsStatus: unable to find ${compId.toString()} in component-status`);
|
358
|
+
}
|
359
|
+
|
360
|
+
filteredComponentStatus.push(fromStatus);
|
361
|
+
|
362
|
+
if (fromStatus.unmergedMessage) {
|
363
|
+
return;
|
364
|
+
}
|
365
|
+
|
366
|
+
const {
|
367
|
+
divergeData
|
368
|
+
} = fromStatus;
|
369
|
+
|
370
|
+
if (!divergeData) {
|
371
|
+
throw new Error(`filterComponentsStatus: unable to find divergeData for ${compId.toString()}`);
|
372
|
+
}
|
373
|
+
|
374
|
+
const remoteVersions = divergeData.snapsOnRemoteOnly;
|
375
|
+
|
376
|
+
if (!remoteVersions.length) {
|
377
|
+
return;
|
378
|
+
}
|
379
|
+
|
380
|
+
const modelComponent = await workspace.consumer.scope.getModelComponent(compId._legacy); // optimization suggestion: if squash is given, check only the last version.
|
381
|
+
|
382
|
+
const laneIds = lane === null || lane === void 0 ? void 0 : lane.toBitIds();
|
383
|
+
await (0, _pMapSeries().default)(remoteVersions, async remoteVersion => {
|
384
|
+
const versionObj = await modelComponent.loadVersion(remoteVersion.toString(), workspace.consumer.scope.objects);
|
385
|
+
const flattenedDeps = versionObj.getAllFlattenedDependencies();
|
386
|
+
const depsNotIncludeInPattern = flattenedDeps.filter(id => bitIdsNotFromPattern.find(bitId => bitId.isEqualWithoutVersion(id)));
|
387
|
+
|
388
|
+
if (!depsNotIncludeInPattern.length) {
|
389
|
+
return;
|
390
|
+
}
|
391
|
+
|
392
|
+
const depsOnLane = [];
|
393
|
+
await Promise.all(depsNotIncludeInPattern.map(async dep => {
|
394
|
+
const isOnLane = await workspace.consumer.scope.isIdOnLane(dep, lane, laneIds);
|
395
|
+
|
396
|
+
if (isOnLane) {
|
397
|
+
depsOnLane.push(dep);
|
398
|
+
}
|
399
|
+
}));
|
400
|
+
|
401
|
+
if (!depsOnLane.length) {
|
402
|
+
return;
|
403
|
+
}
|
404
|
+
|
405
|
+
if (!includeDeps) {
|
406
|
+
throw new (_bitError().BitError)(`unable to merge ${compId.toString()}.
|
407
|
+
it has (in version ${remoteVersion.toString()}) the following dependencies which were not included in the pattern. consider adding "--include-deps" flag
|
408
|
+
${depsOnLane.map(d => d.toString()).join('\n')}`);
|
409
|
+
}
|
410
|
+
|
411
|
+
depsToAdd.push(...depsOnLane);
|
412
|
+
});
|
413
|
+
});
|
414
|
+
|
415
|
+
if (depsToAdd.length) {
|
416
|
+
const depsUniq = _bitId().BitIds.uniqFromArray(depsToAdd);
|
417
|
+
|
418
|
+
depsUniq.forEach(id => {
|
419
|
+
const fromStatus = allComponentsStatus.find(c => c.id.isEqualWithoutVersion(id));
|
420
|
+
|
421
|
+
if (!fromStatus) {
|
422
|
+
throw new Error(`filterComponentsStatus: unable to find ${id.toString()} in component-status`);
|
423
|
+
}
|
424
|
+
|
425
|
+
filteredComponentStatus.push(fromStatus);
|
426
|
+
});
|
427
|
+
}
|
428
|
+
|
429
|
+
return filteredComponentStatus;
|
430
|
+
}
|
431
|
+
|
432
|
+
function squashSnaps(allComponentsStatus, laneName, consumer) {
|
433
|
+
const succeededComponents = allComponentsStatus.filter(c => !c.unmergedMessage);
|
434
|
+
succeededComponents.forEach(({
|
435
|
+
id,
|
436
|
+
divergeData,
|
437
|
+
componentFromModel
|
438
|
+
}) => {
|
439
|
+
if (!divergeData) {
|
440
|
+
throw new Error(`unable to squash. divergeData is missing from ${id.toString()}`);
|
441
|
+
}
|
442
|
+
|
443
|
+
if (divergeData.isDiverged()) {
|
444
|
+
throw new (_bitError().BitError)(`unable to squash because ${id.toString()} is diverged in history.
|
445
|
+
consider switching to ${laneName} first, merging this lane, then switching back to this lane and merging ${laneName}`);
|
446
|
+
}
|
447
|
+
|
448
|
+
if (divergeData.isLocalAhead()) {
|
449
|
+
// nothing to do. current is ahead, nothing to merge. (it was probably filtered out already as a "failedComponent")
|
450
|
+
return;
|
451
|
+
}
|
452
|
+
|
453
|
+
if (!divergeData.isRemoteAhead()) {
|
454
|
+
// nothing to do. current and remote are the same, nothing to merge. (it was probably filtered out already as a "failedComponent")
|
455
|
+
return;
|
456
|
+
} // remote is ahead and was not diverge.
|
457
|
+
|
458
|
+
|
459
|
+
const remoteSnaps = divergeData.snapsOnRemoteOnly;
|
460
|
+
|
461
|
+
if (remoteSnaps.length === 0) {
|
462
|
+
throw new Error(`remote is ahead but it has no snaps. it's impossible`);
|
463
|
+
}
|
464
|
+
|
465
|
+
if (remoteSnaps.length === 1) {
|
466
|
+
// nothing to squash. it has only one commit.
|
467
|
+
return;
|
468
|
+
}
|
469
|
+
|
470
|
+
if (!componentFromModel) {
|
471
|
+
throw new Error('unable to squash, the componentFromModel is missing');
|
472
|
+
} // do the squash.
|
473
|
+
|
474
|
+
|
475
|
+
if (divergeData.commonSnapBeforeDiverge) {
|
476
|
+
componentFromModel.addAsOnlyParent(divergeData.commonSnapBeforeDiverge);
|
477
|
+
} else {
|
478
|
+
// there is no commonSnapBeforeDiverge. the local has no snaps, all are remote, no need for parents. keep only head.
|
479
|
+
componentFromModel.parents.forEach(ref => componentFromModel.removeParent(ref));
|
480
|
+
}
|
481
|
+
|
482
|
+
const squashedSnaps = remoteSnaps.filter(snap => !snap.isEqual(componentFromModel.hash()));
|
483
|
+
componentFromModel.setSquashed(squashedSnaps);
|
484
|
+
consumer.scope.objects.add(componentFromModel);
|
485
|
+
});
|
486
|
+
}
|
487
|
+
|
488
|
+
_mergeLanes().MergeLanesAspect.addRuntime(MergeLanesMain);
|
489
|
+
|
490
|
+
var _default = MergeLanesMain;
|
491
|
+
exports.default = _default;
|
492
|
+
|
493
|
+
//# sourceMappingURL=merge-lanes.main.runtime.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["MergeLanesMain","constructor","workspace","merging","lanes","logger","remove","mergeLane","laneName","options","BitError","consumer","mergeStrategy","noSnap","snapMessage","existingOnWorkspaceOnly","build","keepReadme","squash","pattern","includeDeps","skipDependencyInstallation","remote","currentLaneId","getCurrentLaneId","otherLaneId","getParsedLaneId","isEqual","toString","currentLane","isDefault","scope","loadLane","isDefaultLane","getOtherLane","undefined","lane","fetchLaneWithItsComponents","otherLane","getBitIds","Error","DEFAULT_LANE","getDefaultLaneIdsFromLane","toBitIds","bitIds","debug","otherLaneName","getAllComponentsStatus","tmp","Tmp","componentsStatus","Promise","all","map","bitId","getComponentMergeStatus","clear","err","allComponentsStatus","componentIds","resolveMultipleComponentIds","compIdsFromPattern","filterIdsFromPoolIdsByPattern","filterComponentsStatus","forEach","find","c","id","isEqualWithoutVersion","push","unmergedLegitimately","unmergedMessage","workspaceIds","listIds","filter","_legacy","throwForFailures","squashSnaps","mergeResults","mergeSnaps","remoteName","laneId","localLane","mergedSuccessfully","failedComponents","length","every","failedComponent","unchangedLegitimately","deleteResults","readmeComponent","readmeComponentId","changeVersion","head","hash","componentsPattern","force","track","deleteFiles","readmeResult","name","onDestroy","failureMsgs","chalk","bold","red","join","provider","cli","loggerMain","createLogger","MergeLanesAspect","lanesCommand","getCommand","mergeLanesMain","commands","MergeLaneCmd","LanesAspect","CLIAspect","WorkspaceAspect","MergingAspect","LoggerAspect","RemoveAspect","MainRuntime","compIdsToKeep","allBitIds","bitIdsFromPattern","BitIds","fromArray","bitIdsNotFromPattern","hasWithoutVersion","filteredComponentStatus","depsToAdd","pMapSeries","compId","fromStatus","divergeData","remoteVersions","snapsOnRemoteOnly","modelComponent","getModelComponent","laneIds","remoteVersion","versionObj","loadVersion","objects","flattenedDeps","getAllFlattenedDependencies","depsNotIncludeInPattern","depsOnLane","dep","isOnLane","isIdOnLane","d","depsUniq","uniqFromArray","succeededComponents","componentFromModel","isDiverged","isLocalAhead","isRemoteAhead","remoteSnaps","commonSnapBeforeDiverge","addAsOnlyParent","parents","ref","removeParent","squashedSnaps","snap","setSquashed","add","addRuntime"],"sources":["merge-lanes.main.runtime.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\nimport { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { LanesAspect, LanesMain } from '@teambit/lanes';\nimport MergingAspect, { MergingMain, ComponentMergeStatus } from '@teambit/merging';\nimport WorkspaceAspect, { Workspace } from '@teambit/workspace';\nimport chalk from 'chalk';\nimport { BitId } from '@teambit/legacy-bit-id';\nimport pMapSeries from 'p-map-series';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport { MergeStrategy, ApplyVersionResults } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { BitIds } from '@teambit/legacy/dist/bit-id';\nimport { ComponentID } from '@teambit/component-id';\nimport { DEFAULT_LANE } from '@teambit/lane-id';\nimport { Lane } from '@teambit/legacy/dist/scope/models';\nimport { Tmp } from '@teambit/legacy/dist/scope/repositories';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { RemoveAspect, RemoveMain } from '@teambit/remove';\nimport { MergeLanesAspect } from './merge-lanes.aspect';\nimport { MergeLaneCmd } from './merge-lane.cmd';\n\nexport type MergeLaneOptions = {\n mergeStrategy: MergeStrategy;\n noSnap: boolean;\n snapMessage: string;\n existingOnWorkspaceOnly: boolean;\n build: boolean;\n keepReadme: boolean;\n squash: boolean;\n pattern?: string;\n includeDeps?: boolean;\n skipDependencyInstallation?: boolean;\n remote?: boolean;\n};\n\nexport class MergeLanesMain {\n constructor(\n private workspace: Workspace | undefined,\n private merging: MergingMain,\n private lanes: LanesMain,\n private logger: Logger,\n private remove: RemoveMain\n ) {}\n\n async mergeLane(\n laneName: string,\n options: MergeLaneOptions\n ): Promise<{ mergeResults: ApplyVersionResults; deleteResults: any }> {\n if (!this.workspace) {\n throw new BitError(`unable to merge a lane outside of Bit workspace`);\n }\n const consumer = this.workspace.consumer;\n\n const {\n mergeStrategy,\n noSnap,\n snapMessage,\n existingOnWorkspaceOnly,\n build,\n keepReadme,\n squash,\n pattern,\n includeDeps,\n skipDependencyInstallation,\n remote,\n } = options;\n\n const currentLaneId = consumer.getCurrentLaneId();\n const otherLaneId = await consumer.getParsedLaneId(laneName);\n if (otherLaneId.isEqual(currentLaneId)) {\n throw new BitError(\n `unable to merge lane \"${otherLaneId.toString()}\", you're already at this lane. to get updates, simply run \"bit checkout head\"`\n );\n }\n const currentLane = currentLaneId.isDefault() ? null : await consumer.scope.loadLane(currentLaneId);\n const isDefaultLane = otherLaneId.isDefault();\n const getOtherLane = async () => {\n if (isDefaultLane) {\n return undefined;\n }\n const lane = await consumer.scope.loadLane(otherLaneId);\n if (remote || !lane) {\n return this.lanes.fetchLaneWithItsComponents(otherLaneId);\n }\n return lane;\n };\n const otherLane = await getOtherLane();\n const getBitIds = async () => {\n if (isDefaultLane) {\n if (!currentLane) throw new Error(`unable to merge ${DEFAULT_LANE}, the current lane was not found`);\n return consumer.scope.getDefaultLaneIdsFromLane(currentLane);\n }\n if (!otherLane) throw new Error(`lane must be defined for non-default`);\n return otherLane.toBitIds();\n };\n const bitIds = await getBitIds();\n this.logger.debug(`merging the following bitIds: ${bitIds.toString()}`);\n const otherLaneName = isDefaultLane ? DEFAULT_LANE : otherLaneId.toString();\n\n const getAllComponentsStatus = async (): Promise<ComponentMergeStatus[]> => {\n const tmp = new Tmp(consumer.scope);\n try {\n const componentsStatus = await Promise.all(\n bitIds.map((bitId) => this.merging.getComponentMergeStatus(bitId, currentLane, otherLaneName))\n );\n await tmp.clear();\n return componentsStatus;\n } catch (err: any) {\n await tmp.clear();\n throw err;\n }\n };\n let allComponentsStatus = await getAllComponentsStatus();\n\n if (pattern) {\n const componentIds = await this.workspace.resolveMultipleComponentIds(bitIds);\n const compIdsFromPattern = this.workspace.scope.filterIdsFromPoolIdsByPattern(pattern, componentIds);\n allComponentsStatus = await filterComponentsStatus(\n allComponentsStatus,\n compIdsFromPattern,\n bitIds,\n this.workspace,\n includeDeps,\n otherLane || undefined\n );\n bitIds.forEach((bitId) => {\n if (!allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(bitId))) {\n allComponentsStatus.push({ id: bitId, unmergedLegitimately: true, unmergedMessage: `excluded by pattern` });\n }\n });\n }\n if (existingOnWorkspaceOnly) {\n const workspaceIds = await this.workspace.listIds();\n const compIdsFromPattern = workspaceIds.filter((id) =>\n allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(id._legacy))\n );\n allComponentsStatus = await filterComponentsStatus(\n allComponentsStatus,\n compIdsFromPattern,\n bitIds,\n this.workspace,\n includeDeps\n );\n bitIds.forEach((bitId) => {\n if (!allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(bitId))) {\n allComponentsStatus.push({ id: bitId, unmergedLegitimately: true, unmergedMessage: `not in the workspace` });\n }\n });\n }\n\n throwForFailures();\n\n if (squash) {\n squashSnaps(allComponentsStatus, laneName, consumer);\n }\n\n const mergeResults = await this.merging.mergeSnaps({\n mergeStrategy,\n allComponentsStatus,\n remoteName: otherLane ? otherLane.scope : null,\n laneId: otherLaneId,\n localLane: currentLane,\n noSnap,\n snapMessage,\n build,\n skipDependencyInstallation,\n });\n\n const mergedSuccessfully =\n !mergeResults.failedComponents ||\n mergeResults.failedComponents.length === 0 ||\n mergeResults.failedComponents.every((failedComponent) => failedComponent.unchangedLegitimately);\n\n let deleteResults = {};\n\n if (!keepReadme && otherLane && otherLane.readmeComponent && mergedSuccessfully) {\n const readmeComponentId = otherLane.readmeComponent.id\n .changeVersion(otherLane.readmeComponent?.head?.hash)\n .toString();\n\n deleteResults = await this.remove.remove({\n componentsPattern: readmeComponentId,\n force: false,\n remote: false,\n track: false,\n deleteFiles: true,\n });\n } else if (otherLane && !otherLane.readmeComponent) {\n deleteResults = { readmeResult: `\\nlane ${otherLane.name} doesn't have a readme component` };\n }\n\n await this.workspace.consumer.onDestroy();\n\n return { mergeResults, deleteResults };\n\n function throwForFailures() {\n const failedComponents = allComponentsStatus.filter((c) => c.unmergedMessage && !c.unmergedLegitimately);\n if (failedComponents.length) {\n const failureMsgs = failedComponents\n .map(\n (failedComponent) =>\n `${chalk.bold(failedComponent.id.toString())} - ${chalk.red(failedComponent.unmergedMessage as string)}`\n )\n .join('\\n');\n throw new BitError(`unable to merge due to the following failures:\\n${failureMsgs}`);\n }\n }\n }\n\n static slots = [];\n static dependencies = [LanesAspect, CLIAspect, WorkspaceAspect, MergingAspect, LoggerAspect, RemoveAspect];\n static runtime = MainRuntime;\n\n static async provider([lanes, cli, workspace, merging, loggerMain, remove]: [\n LanesMain,\n CLIMain,\n Workspace,\n MergingMain,\n LoggerMain,\n RemoveMain\n ]) {\n const logger = loggerMain.createLogger(MergeLanesAspect.id);\n const lanesCommand = cli.getCommand('lane');\n const mergeLanesMain = new MergeLanesMain(workspace, merging, lanes, logger, remove);\n lanesCommand?.commands?.push(new MergeLaneCmd(mergeLanesMain));\n return mergeLanesMain;\n }\n}\n\nasync function filterComponentsStatus(\n allComponentsStatus: ComponentMergeStatus[],\n compIdsToKeep: ComponentID[],\n allBitIds: BitId[],\n workspace: Workspace,\n includeDeps = false,\n lane?: Lane\n): Promise<ComponentMergeStatus[]> {\n const bitIdsFromPattern = BitIds.fromArray(compIdsToKeep.map((c) => c._legacy));\n const bitIdsNotFromPattern = allBitIds.filter((bitId) => !bitIdsFromPattern.hasWithoutVersion(bitId));\n const filteredComponentStatus: ComponentMergeStatus[] = [];\n const depsToAdd: BitId[] = [];\n await pMapSeries(compIdsToKeep, async (compId) => {\n const fromStatus = allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(compId._legacy));\n if (!fromStatus) {\n throw new Error(`filterComponentsStatus: unable to find ${compId.toString()} in component-status`);\n }\n filteredComponentStatus.push(fromStatus);\n if (fromStatus.unmergedMessage) {\n return;\n }\n const { divergeData } = fromStatus;\n if (!divergeData) {\n throw new Error(`filterComponentsStatus: unable to find divergeData for ${compId.toString()}`);\n }\n const remoteVersions = divergeData.snapsOnRemoteOnly;\n if (!remoteVersions.length) {\n return;\n }\n const modelComponent = await workspace.consumer.scope.getModelComponent(compId._legacy);\n // optimization suggestion: if squash is given, check only the last version.\n const laneIds = lane?.toBitIds();\n await pMapSeries(remoteVersions, async (remoteVersion) => {\n const versionObj = await modelComponent.loadVersion(remoteVersion.toString(), workspace.consumer.scope.objects);\n const flattenedDeps = versionObj.getAllFlattenedDependencies();\n const depsNotIncludeInPattern = flattenedDeps.filter((id) =>\n bitIdsNotFromPattern.find((bitId) => bitId.isEqualWithoutVersion(id))\n );\n if (!depsNotIncludeInPattern.length) {\n return;\n }\n const depsOnLane: BitId[] = [];\n await Promise.all(\n depsNotIncludeInPattern.map(async (dep) => {\n const isOnLane = await workspace.consumer.scope.isIdOnLane(dep, lane, laneIds);\n if (isOnLane) {\n depsOnLane.push(dep);\n }\n })\n );\n if (!depsOnLane.length) {\n return;\n }\n if (!includeDeps) {\n throw new BitError(`unable to merge ${compId.toString()}.\nit has (in version ${remoteVersion.toString()}) the following dependencies which were not included in the pattern. consider adding \"--include-deps\" flag\n${depsOnLane.map((d) => d.toString()).join('\\n')}`);\n }\n depsToAdd.push(...depsOnLane);\n });\n });\n if (depsToAdd.length) {\n const depsUniq = BitIds.uniqFromArray(depsToAdd);\n depsUniq.forEach((id) => {\n const fromStatus = allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(id));\n if (!fromStatus) {\n throw new Error(`filterComponentsStatus: unable to find ${id.toString()} in component-status`);\n }\n filteredComponentStatus.push(fromStatus);\n });\n }\n return filteredComponentStatus;\n}\n\nfunction squashSnaps(allComponentsStatus: ComponentMergeStatus[], laneName: string, consumer: Consumer) {\n const succeededComponents = allComponentsStatus.filter((c) => !c.unmergedMessage);\n succeededComponents.forEach(({ id, divergeData, componentFromModel }) => {\n if (!divergeData) {\n throw new Error(`unable to squash. divergeData is missing from ${id.toString()}`);\n }\n if (divergeData.isDiverged()) {\n throw new BitError(`unable to squash because ${id.toString()} is diverged in history.\nconsider switching to ${laneName} first, merging this lane, then switching back to this lane and merging ${laneName}`);\n }\n if (divergeData.isLocalAhead()) {\n // nothing to do. current is ahead, nothing to merge. (it was probably filtered out already as a \"failedComponent\")\n return;\n }\n if (!divergeData.isRemoteAhead()) {\n // nothing to do. current and remote are the same, nothing to merge. (it was probably filtered out already as a \"failedComponent\")\n return;\n }\n // remote is ahead and was not diverge.\n const remoteSnaps = divergeData.snapsOnRemoteOnly;\n if (remoteSnaps.length === 0) {\n throw new Error(`remote is ahead but it has no snaps. it's impossible`);\n }\n if (remoteSnaps.length === 1) {\n // nothing to squash. it has only one commit.\n return;\n }\n if (!componentFromModel) {\n throw new Error('unable to squash, the componentFromModel is missing');\n }\n\n // do the squash.\n if (divergeData.commonSnapBeforeDiverge) {\n componentFromModel.addAsOnlyParent(divergeData.commonSnapBeforeDiverge);\n } else {\n // there is no commonSnapBeforeDiverge. the local has no snaps, all are remote, no need for parents. keep only head.\n componentFromModel.parents.forEach((ref) => componentFromModel.removeParent(ref));\n }\n const squashedSnaps = remoteSnaps.filter((snap) => !snap.isEqual(componentFromModel.hash()));\n componentFromModel.setSquashed(squashedSnaps);\n consumer.scope.objects.add(componentFromModel);\n });\n}\n\nMergeLanesAspect.addRuntime(MergeLanesMain);\n\nexport default MergeLanesMain;\n"],"mappings":";;;;;;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
+
"name": "@teambit/merge-lanes",
|
3
|
+
"version": "0.0.1",
|
4
|
+
"main": "dist/index.js",
|
5
|
+
"componentId": {
|
6
|
+
"scope": "teambit.lanes",
|
7
|
+
"name": "merge-lanes",
|
8
|
+
"version": "0.0.1"
|
9
|
+
},
|
10
|
+
"dependencies": {
|
11
|
+
"chalk": "2.4.2",
|
12
|
+
"p-map-series": "2.1.0",
|
13
|
+
"@babel/runtime": "7.12.18",
|
14
|
+
"core-js": "^3.0.0",
|
15
|
+
"@teambit/harmony": "0.3.3",
|
16
|
+
"@teambit/bit-error": "0.0.394",
|
17
|
+
"@teambit/cli": "0.0.552",
|
18
|
+
"@teambit/merging": "0.0.139",
|
19
|
+
"@teambit/component-id": "0.0.405",
|
20
|
+
"@teambit/lane-id": "0.0.71",
|
21
|
+
"@teambit/lanes": "0.0.396",
|
22
|
+
"@teambit/legacy-bit-id": "0.0.402",
|
23
|
+
"@teambit/logger": "0.0.645",
|
24
|
+
"@teambit/remove": "0.0.1",
|
25
|
+
"@teambit/workspace": "0.0.824"
|
26
|
+
},
|
27
|
+
"devDependencies": {
|
28
|
+
"@types/mocha": "9.1.0",
|
29
|
+
"@types/testing-library__jest-dom": "5.9.5",
|
30
|
+
"@types/jest": "^26.0.0",
|
31
|
+
"@types/react-dom": "^17.0.5",
|
32
|
+
"@types/react": "^17.0.8",
|
33
|
+
"@types/node": "12.20.4"
|
34
|
+
},
|
35
|
+
"peerDependencies": {
|
36
|
+
"@teambit/legacy": "1.0.335",
|
37
|
+
"react-dom": "^16.8.0 || ^17.0.0",
|
38
|
+
"react": "^16.8.0 || ^17.0.0"
|
39
|
+
},
|
40
|
+
"license": "Apache-2.0",
|
41
|
+
"private": false,
|
42
|
+
"engines": {
|
43
|
+
"node": ">=12.22.0"
|
44
|
+
},
|
45
|
+
"repository": {
|
46
|
+
"type": "git",
|
47
|
+
"url": "https://github.com/teambit/bit"
|
48
|
+
},
|
49
|
+
"keywords": [
|
50
|
+
"bit",
|
51
|
+
"bit-aspect",
|
52
|
+
"components",
|
53
|
+
"collaboration",
|
54
|
+
"web",
|
55
|
+
"react",
|
56
|
+
"react-components",
|
57
|
+
"angular",
|
58
|
+
"angular-components",
|
59
|
+
"vue",
|
60
|
+
"vue-components"
|
61
|
+
]
|
62
|
+
}
|
package/tsconfig.json
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
{
|
2
|
+
"compilerOptions": {
|
3
|
+
"lib": [
|
4
|
+
"es2019",
|
5
|
+
"DOM",
|
6
|
+
"ES6",
|
7
|
+
"DOM.Iterable",
|
8
|
+
"ScriptHost"
|
9
|
+
],
|
10
|
+
"target": "es2015",
|
11
|
+
"module": "commonjs",
|
12
|
+
"jsx": "react",
|
13
|
+
"allowJs": true,
|
14
|
+
"composite": true,
|
15
|
+
"declaration": true,
|
16
|
+
"sourceMap": true,
|
17
|
+
"skipLibCheck": true,
|
18
|
+
"experimentalDecorators": true,
|
19
|
+
"outDir": "dist",
|
20
|
+
"moduleResolution": "node",
|
21
|
+
"esModuleInterop": true,
|
22
|
+
"rootDir": ".",
|
23
|
+
"resolveJsonModule": true,
|
24
|
+
"emitDeclarationOnly": true,
|
25
|
+
"emitDecoratorMetadata": true,
|
26
|
+
"allowSyntheticDefaultImports": true,
|
27
|
+
"strictPropertyInitialization": false,
|
28
|
+
"strict": true,
|
29
|
+
"noImplicitAny": false,
|
30
|
+
"preserveConstEnums": true
|
31
|
+
},
|
32
|
+
"exclude": [
|
33
|
+
"dist",
|
34
|
+
"package.json"
|
35
|
+
],
|
36
|
+
"include": [
|
37
|
+
"**/*",
|
38
|
+
"**/*.json"
|
39
|
+
]
|
40
|
+
}
|
package/types/asset.d.ts
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
declare module '*.png' {
|
2
|
+
const value: any;
|
3
|
+
export = value;
|
4
|
+
}
|
5
|
+
declare module '*.svg' {
|
6
|
+
import type { FunctionComponent, SVGProps } from 'react';
|
7
|
+
|
8
|
+
export const ReactComponent: FunctionComponent<SVGProps<SVGSVGElement> & { title?: string }>;
|
9
|
+
const src: string;
|
10
|
+
export default src;
|
11
|
+
}
|
12
|
+
|
13
|
+
// @TODO Gilad
|
14
|
+
declare module '*.jpg' {
|
15
|
+
const value: any;
|
16
|
+
export = value;
|
17
|
+
}
|
18
|
+
declare module '*.jpeg' {
|
19
|
+
const value: any;
|
20
|
+
export = value;
|
21
|
+
}
|
22
|
+
declare module '*.gif' {
|
23
|
+
const value: any;
|
24
|
+
export = value;
|
25
|
+
}
|
26
|
+
declare module '*.bmp' {
|
27
|
+
const value: any;
|
28
|
+
export = value;
|
29
|
+
}
|
package/types/style.d.ts
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
declare module '*.module.css' {
|
2
|
+
const classes: { readonly [key: string]: string };
|
3
|
+
export default classes;
|
4
|
+
}
|
5
|
+
declare module '*.module.scss' {
|
6
|
+
const classes: { readonly [key: string]: string };
|
7
|
+
export default classes;
|
8
|
+
}
|
9
|
+
declare module '*.module.sass' {
|
10
|
+
const classes: { readonly [key: string]: string };
|
11
|
+
export default classes;
|
12
|
+
}
|
13
|
+
|
14
|
+
declare module '*.module.less' {
|
15
|
+
const classes: { readonly [key: string]: string };
|
16
|
+
export default classes;
|
17
|
+
}
|
18
|
+
|
19
|
+
declare module '*.less' {
|
20
|
+
const classes: { readonly [key: string]: string };
|
21
|
+
export default classes;
|
22
|
+
}
|
23
|
+
|
24
|
+
declare module '*.css' {
|
25
|
+
const classes: { readonly [key: string]: string };
|
26
|
+
export default classes;
|
27
|
+
}
|
28
|
+
|
29
|
+
declare module '*.sass' {
|
30
|
+
const classes: { readonly [key: string]: string };
|
31
|
+
export default classes;
|
32
|
+
}
|
33
|
+
|
34
|
+
declare module '*.scss' {
|
35
|
+
const classes: { readonly [key: string]: string };
|
36
|
+
export default classes;
|
37
|
+
}
|
38
|
+
|
39
|
+
declare module '*.mdx' {
|
40
|
+
const component: any;
|
41
|
+
export default component;
|
42
|
+
}
|