@teambit/merging 0.0.335 → 0.0.337
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/config-merge-result.d.ts +1 -0
- package/dist/config-merge-result.js +3 -0
- package/dist/config-merge-result.js.map +1 -1
- package/dist/config-merger.js +21 -11
- package/dist/config-merger.js.map +1 -1
- package/dist/merge-cmd.d.ts +1 -1
- package/dist/merge-cmd.js +12 -2
- package/dist/merge-cmd.js.map +1 -1
- package/dist/merging.main.runtime.d.ts +16 -3
- package/dist/merging.main.runtime.js +176 -10
- package/dist/merging.main.runtime.js.map +1 -1
- package/package-tar/teambit-merging-0.0.337.tgz +0 -0
- package/package.json +15 -14
- package/package-tar/teambit-merging-0.0.335.tgz +0 -0
- /package/dist/{preview-1679304089670.js → preview-1679607263760.js} +0 -0
|
@@ -8,11 +8,13 @@ import { LaneId } from '@teambit/lane-id';
|
|
|
8
8
|
import { AutoTagResult } from '@teambit/legacy/dist/scope/component-ops/auto-tag';
|
|
9
9
|
import { Lane, ModelComponent, Version } from '@teambit/legacy/dist/scope/models';
|
|
10
10
|
import { Ref } from '@teambit/legacy/dist/scope/objects';
|
|
11
|
+
import { ConfigMain } from '@teambit/config';
|
|
11
12
|
import { ComponentWriterMain } from '@teambit/component-writer';
|
|
12
13
|
import ConsumerComponent from '@teambit/legacy/dist/consumer/component/consumer-component';
|
|
13
14
|
import { ImporterMain } from '@teambit/importer';
|
|
14
15
|
import { Logger, LoggerMain } from '@teambit/logger';
|
|
15
16
|
import { MergeResultsThreeWay } from '@teambit/legacy/dist/consumer/versions-ops/merge-version/three-way-merge';
|
|
17
|
+
import { WorkspacePolicyConfigKeysNames } from '@teambit/dependency-resolver';
|
|
16
18
|
import { CheckoutMain } from '@teambit/checkout';
|
|
17
19
|
import { SnapsDistance } from '@teambit/legacy/dist/scope/component-ops/snaps-distance';
|
|
18
20
|
import { InstallMain } from '@teambit/install';
|
|
@@ -21,6 +23,13 @@ declare type ResolveUnrelatedData = {
|
|
|
21
23
|
strategy: MergeStrategy;
|
|
22
24
|
head: Ref;
|
|
23
25
|
};
|
|
26
|
+
export declare type WorkspaceDepsUpdates = {
|
|
27
|
+
[pkgName: string]: [string, string];
|
|
28
|
+
};
|
|
29
|
+
export declare type WorkspaceDepsConflicts = Record<WorkspacePolicyConfigKeysNames, Array<{
|
|
30
|
+
name: string;
|
|
31
|
+
version: string;
|
|
32
|
+
}>>;
|
|
24
33
|
export declare type ComponentMergeStatus = {
|
|
25
34
|
currentComponent?: ConsumerComponent | null;
|
|
26
35
|
componentFromModel?: Version;
|
|
@@ -63,6 +72,7 @@ export declare type ApplyVersionResults = {
|
|
|
63
72
|
newFromLaneAdded?: boolean;
|
|
64
73
|
installationError?: Error;
|
|
65
74
|
compilationError?: Error;
|
|
75
|
+
workspaceDepsUpdates?: WorkspaceDepsUpdates;
|
|
66
76
|
};
|
|
67
77
|
export declare class MergingMain {
|
|
68
78
|
private workspace;
|
|
@@ -72,8 +82,9 @@ export declare class MergingMain {
|
|
|
72
82
|
private logger;
|
|
73
83
|
private componentWriter;
|
|
74
84
|
private importer;
|
|
85
|
+
private config;
|
|
75
86
|
private consumer;
|
|
76
|
-
constructor(workspace: Workspace, install: InstallMain, snapping: SnappingMain, checkout: CheckoutMain, logger: Logger, componentWriter: ComponentWriterMain, importer: ImporterMain);
|
|
87
|
+
constructor(workspace: Workspace, install: InstallMain, snapping: SnappingMain, checkout: CheckoutMain, logger: Logger, componentWriter: ComponentWriterMain, importer: ImporterMain, config: ConfigMain);
|
|
77
88
|
merge(ids: string[], mergeStrategy: MergeStrategy, abort: boolean, resolve: boolean, noSnap: boolean, message: string, build: boolean, skipDependencyInstallation: boolean): Promise<ApplyVersionResults>;
|
|
78
89
|
/**
|
|
79
90
|
* when user is on main, it merges the remote main components into local.
|
|
@@ -95,6 +106,7 @@ export declare class MergingMain {
|
|
|
95
106
|
skipDependencyInstallation?: boolean;
|
|
96
107
|
}): Promise<ApplyVersionResults>;
|
|
97
108
|
private generateConfigMergeConflictFileForAll;
|
|
109
|
+
private updateWorkspaceJsoncWithDepsIfNeeded;
|
|
98
110
|
/**
|
|
99
111
|
* this function gets called from two different commands:
|
|
100
112
|
* 1. "bit merge <ids...>", when merging a component from a remote to the local.
|
|
@@ -121,7 +133,7 @@ export declare class MergingMain {
|
|
|
121
133
|
static slots: never[];
|
|
122
134
|
static dependencies: import("@teambit/harmony").Aspect[];
|
|
123
135
|
static runtime: import("@teambit/harmony").RuntimeDefinition;
|
|
124
|
-
static provider([cli, workspace, snapping, checkout, install, loggerMain, compWriter, importer]: [
|
|
136
|
+
static provider([cli, workspace, snapping, checkout, install, loggerMain, compWriter, importer, config]: [
|
|
125
137
|
CLIMain,
|
|
126
138
|
Workspace,
|
|
127
139
|
SnappingMain,
|
|
@@ -129,7 +141,8 @@ export declare class MergingMain {
|
|
|
129
141
|
InstallMain,
|
|
130
142
|
LoggerMain,
|
|
131
143
|
ComponentWriterMain,
|
|
132
|
-
ImporterMain
|
|
144
|
+
ImporterMain,
|
|
145
|
+
ConfigMain
|
|
133
146
|
]): Promise<MergingMain>;
|
|
134
147
|
}
|
|
135
148
|
export {};
|
|
@@ -5,6 +5,7 @@ require("core-js/modules/es.array.flat.js");
|
|
|
5
5
|
require("core-js/modules/es.array.iterator.js");
|
|
6
6
|
require("core-js/modules/es.array.unscopables.flat.js");
|
|
7
7
|
require("core-js/modules/es.promise.js");
|
|
8
|
+
require("core-js/modules/es.regexp.exec.js");
|
|
8
9
|
Object.defineProperty(exports, "__esModule", {
|
|
9
10
|
value: true
|
|
10
11
|
});
|
|
@@ -107,6 +108,13 @@ function _chalk() {
|
|
|
107
108
|
};
|
|
108
109
|
return data;
|
|
109
110
|
}
|
|
111
|
+
function _config() {
|
|
112
|
+
const data = require("@teambit/config");
|
|
113
|
+
_config = function () {
|
|
114
|
+
return data;
|
|
115
|
+
};
|
|
116
|
+
return data;
|
|
117
|
+
}
|
|
110
118
|
function _repositories() {
|
|
111
119
|
const data = require("@teambit/legacy/dist/scope/repositories");
|
|
112
120
|
_repositories = function () {
|
|
@@ -170,6 +178,13 @@ function _noCommonSnap() {
|
|
|
170
178
|
};
|
|
171
179
|
return data;
|
|
172
180
|
}
|
|
181
|
+
function _dependencyResolver() {
|
|
182
|
+
const data = require("@teambit/dependency-resolver");
|
|
183
|
+
_dependencyResolver = function () {
|
|
184
|
+
return data;
|
|
185
|
+
};
|
|
186
|
+
return data;
|
|
187
|
+
}
|
|
173
188
|
function _checkout() {
|
|
174
189
|
const data = require("@teambit/checkout");
|
|
175
190
|
_checkout = function () {
|
|
@@ -184,6 +199,13 @@ function _componentId() {
|
|
|
184
199
|
};
|
|
185
200
|
return data;
|
|
186
201
|
}
|
|
202
|
+
function _constants() {
|
|
203
|
+
const data = require("@teambit/legacy/dist/constants");
|
|
204
|
+
_constants = function () {
|
|
205
|
+
return data;
|
|
206
|
+
};
|
|
207
|
+
return data;
|
|
208
|
+
}
|
|
187
209
|
function _install() {
|
|
188
210
|
const data = require("@teambit/install");
|
|
189
211
|
_install = function () {
|
|
@@ -212,12 +234,19 @@ function _configMerger() {
|
|
|
212
234
|
};
|
|
213
235
|
return data;
|
|
214
236
|
}
|
|
237
|
+
function _configMergeResult() {
|
|
238
|
+
const data = require("./config-merge-result");
|
|
239
|
+
_configMergeResult = function () {
|
|
240
|
+
return data;
|
|
241
|
+
};
|
|
242
|
+
return data;
|
|
243
|
+
}
|
|
215
244
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
216
245
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
217
246
|
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; }
|
|
218
247
|
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; }
|
|
219
248
|
class MergingMain {
|
|
220
|
-
constructor(workspace, install, snapping, checkout, logger, componentWriter, importer) {
|
|
249
|
+
constructor(workspace, install, snapping, checkout, logger, componentWriter, importer, config) {
|
|
221
250
|
var _this$workspace;
|
|
222
251
|
this.workspace = workspace;
|
|
223
252
|
this.install = install;
|
|
@@ -226,6 +255,7 @@ class MergingMain {
|
|
|
226
255
|
this.logger = logger;
|
|
227
256
|
this.componentWriter = componentWriter;
|
|
228
257
|
this.importer = importer;
|
|
258
|
+
this.config = config;
|
|
229
259
|
(0, _defineProperty2().default)(this, "consumer", void 0);
|
|
230
260
|
this.consumer = (_this$workspace = this.workspace) === null || _this$workspace === void 0 ? void 0 : _this$workspace.consumer;
|
|
231
261
|
}
|
|
@@ -319,8 +349,12 @@ class MergingMain {
|
|
|
319
349
|
configMergeResult
|
|
320
350
|
});
|
|
321
351
|
});
|
|
322
|
-
const allConfigMerge = succeededComponents.map(c => c.configMergeResult);
|
|
323
|
-
|
|
352
|
+
const allConfigMerge = (0, _lodash().compact)(succeededComponents.map(c => c.configMergeResult));
|
|
353
|
+
const {
|
|
354
|
+
workspaceDepsUpdates,
|
|
355
|
+
workspaceDepsConflicts
|
|
356
|
+
} = await this.updateWorkspaceJsoncWithDepsIfNeeded(allConfigMerge);
|
|
357
|
+
await this.generateConfigMergeConflictFileForAll(allConfigMerge, workspaceDepsConflicts);
|
|
324
358
|
if (localLane) consumer.scope.objects.add(localLane);
|
|
325
359
|
await consumer.scope.objects.persist(); // persist anyway, if localLane is null it should save all main heads
|
|
326
360
|
|
|
@@ -376,11 +410,19 @@ class MergingMain {
|
|
|
376
410
|
failedComponents,
|
|
377
411
|
mergeSnapResults,
|
|
378
412
|
mergeSnapError,
|
|
379
|
-
leftUnresolvedConflicts
|
|
413
|
+
leftUnresolvedConflicts,
|
|
414
|
+
workspaceDepsUpdates
|
|
380
415
|
};
|
|
381
416
|
}
|
|
382
|
-
async generateConfigMergeConflictFileForAll(allConfigMerge) {
|
|
417
|
+
async generateConfigMergeConflictFileForAll(allConfigMerge, workspaceDepsConflicts) {
|
|
383
418
|
const configMergeFile = this.workspace.getConflictMergeFile();
|
|
419
|
+
if (workspaceDepsConflicts) {
|
|
420
|
+
const workspaceConflict = new (_configMergeResult().ConfigMergeResult)('WORKSPACE', 'ours', 'theirs', [{
|
|
421
|
+
id: _dependencyResolver().DependencyResolverAspect.id,
|
|
422
|
+
conflict: workspaceDepsConflicts
|
|
423
|
+
}]);
|
|
424
|
+
allConfigMerge.unshift(workspaceConflict);
|
|
425
|
+
}
|
|
384
426
|
allConfigMerge.forEach(configMerge => {
|
|
385
427
|
const conflict = configMerge.generateMergeConflictFile();
|
|
386
428
|
if (!conflict) return;
|
|
@@ -390,6 +432,129 @@ class MergingMain {
|
|
|
390
432
|
await configMergeFile.write();
|
|
391
433
|
}
|
|
392
434
|
}
|
|
435
|
+
async updateWorkspaceJsoncWithDepsIfNeeded(allConfigMerge) {
|
|
436
|
+
const allResults = allConfigMerge.map(c => c.getDepsResolverResult());
|
|
437
|
+
const allDeps = {};
|
|
438
|
+
const allDepsSources = {}; // for logging/debugging purposes
|
|
439
|
+
|
|
440
|
+
allConfigMerge.forEach(configMerge => {
|
|
441
|
+
var _configMerge$getDepsR;
|
|
442
|
+
const mergedConfig = (_configMerge$getDepsR = configMerge.getDepsResolverResult()) === null || _configMerge$getDepsR === void 0 ? void 0 : _configMerge$getDepsR.mergedConfig;
|
|
443
|
+
if (!mergedConfig || mergedConfig === '-') return;
|
|
444
|
+
const policy = mergedConfig.policy || {};
|
|
445
|
+
_constants().DEPENDENCIES_FIELDS.forEach(depField => {
|
|
446
|
+
if (!policy[depField]) return;
|
|
447
|
+
policy[depField].forEach(pkg => {
|
|
448
|
+
if (pkg.force) return; // we only care about auto-detected dependencies
|
|
449
|
+
if (allDeps[pkg.name]) {
|
|
450
|
+
if (!allDeps[pkg.name].includes(pkg.version)) allDeps[pkg.name].push(pkg.version);
|
|
451
|
+
allDepsSources[pkg.name].push(configMerge.compIdStr);
|
|
452
|
+
return;
|
|
453
|
+
}
|
|
454
|
+
allDeps[pkg.name] = [pkg.version];
|
|
455
|
+
allDepsSources[pkg.name] = [configMerge.compIdStr];
|
|
456
|
+
});
|
|
457
|
+
});
|
|
458
|
+
});
|
|
459
|
+
const allConflictDeps = {};
|
|
460
|
+
const conflictDepsSources = {}; // for logging/debugging purposes
|
|
461
|
+
|
|
462
|
+
allConfigMerge.forEach(configMerge => {
|
|
463
|
+
var _configMerge$getDepsR2;
|
|
464
|
+
const policy = (_configMerge$getDepsR2 = configMerge.getDepsResolverResult()) === null || _configMerge$getDepsR2 === void 0 ? void 0 : _configMerge$getDepsR2.conflict;
|
|
465
|
+
if (!policy) return;
|
|
466
|
+
_constants().DEPENDENCIES_FIELDS.forEach(depField => {
|
|
467
|
+
if (!policy[depField]) return;
|
|
468
|
+
policy[depField].forEach(pkg => {
|
|
469
|
+
if (pkg.force) return; // we only care about auto-detected dependencies
|
|
470
|
+
if (allConflictDeps[pkg.name]) {
|
|
471
|
+
if (!allConflictDeps[pkg.name].includes(pkg.version)) allConflictDeps[pkg.name].push(pkg.version);
|
|
472
|
+
conflictDepsSources[pkg.name].push(configMerge.compIdStr);
|
|
473
|
+
return;
|
|
474
|
+
}
|
|
475
|
+
allConflictDeps[pkg.name] = [pkg.version];
|
|
476
|
+
conflictDepsSources[pkg.name] = [configMerge.compIdStr];
|
|
477
|
+
});
|
|
478
|
+
});
|
|
479
|
+
});
|
|
480
|
+
const allPackages = Object.keys(allDeps);
|
|
481
|
+
const allConflictedPackages = Object.keys(allConflictDeps);
|
|
482
|
+
if (!allPackages.length && !allConflictedPackages.length) return {};
|
|
483
|
+
const workspaceConfig = this.config.workspaceConfig;
|
|
484
|
+
if (!workspaceConfig) throw new Error(`updateWorkspaceJsoncWithDepsIfNeeded unable to get workspace config`);
|
|
485
|
+
const depResolver = workspaceConfig.extensions.findCoreExtension(_dependencyResolver().DependencyResolverAspect.id);
|
|
486
|
+
const policy = depResolver === null || depResolver === void 0 ? void 0 : depResolver.config.policy;
|
|
487
|
+
if (!policy) return {};
|
|
488
|
+
const workspaceJsonUpdates = {};
|
|
489
|
+
const WS_DEPS_FIELDS = ['dependencies', 'peerDependencies'];
|
|
490
|
+
const workspaceJsonConflicts = {
|
|
491
|
+
dependencies: [],
|
|
492
|
+
peerDependencies: []
|
|
493
|
+
};
|
|
494
|
+
allPackages.forEach(pkgName => {
|
|
495
|
+
if (allDeps[pkgName].length > 1) {
|
|
496
|
+
// we only want the deps that the other lane has them in the workspace.json and that all comps use the same dep.
|
|
497
|
+
return;
|
|
498
|
+
}
|
|
499
|
+
_constants().DEPENDENCIES_FIELDS.forEach(depField => {
|
|
500
|
+
var _policy$depField;
|
|
501
|
+
if (!((_policy$depField = policy[depField]) !== null && _policy$depField !== void 0 && _policy$depField[pkgName])) return;
|
|
502
|
+
const currentVer = policy[depField][pkgName];
|
|
503
|
+
const newVer = allDeps[pkgName][0];
|
|
504
|
+
if (currentVer === newVer) return;
|
|
505
|
+
workspaceJsonUpdates[pkgName] = [currentVer, newVer];
|
|
506
|
+
policy[depField][pkgName] = newVer;
|
|
507
|
+
this.logger.debug(`update workspace.jsonc: ${pkgName} from ${currentVer} to ${newVer}. Triggered by: ${allDepsSources[pkgName].join(', ')}`);
|
|
508
|
+
});
|
|
509
|
+
});
|
|
510
|
+
allConflictedPackages.forEach(pkgName => {
|
|
511
|
+
if (allConflictDeps[pkgName].length > 1) {
|
|
512
|
+
// we only want the deps that the other lane has them in the workspace.json and that all comps use the same dep.
|
|
513
|
+
return;
|
|
514
|
+
}
|
|
515
|
+
const conflict = allConflictDeps[pkgName][0];
|
|
516
|
+
const [, currentVal, otherVal] = conflict.split('::');
|
|
517
|
+
WS_DEPS_FIELDS.forEach(depField => {
|
|
518
|
+
var _policy$depField2;
|
|
519
|
+
if (!((_policy$depField2 = policy[depField]) !== null && _policy$depField2 !== void 0 && _policy$depField2[pkgName])) return;
|
|
520
|
+
const currentVer = policy[depField][pkgName];
|
|
521
|
+
if (currentVer !== currentVal) return;
|
|
522
|
+
// the version is coming from the workspace.jsonc
|
|
523
|
+
workspaceJsonConflicts[depField].push({
|
|
524
|
+
name: pkgName,
|
|
525
|
+
version: conflict,
|
|
526
|
+
force: false
|
|
527
|
+
});
|
|
528
|
+
this.logger.debug(`conflict workspace.jsonc: ${pkgName} current: ${currentVer}, other: ${otherVal}. Triggered by: ${conflictDepsSources[pkgName].join(', ')}`);
|
|
529
|
+
});
|
|
530
|
+
});
|
|
531
|
+
WS_DEPS_FIELDS.forEach(depField => {
|
|
532
|
+
if ((0, _lodash().isEmpty)(workspaceJsonConflicts[depField])) delete workspaceJsonConflicts[depField];
|
|
533
|
+
});
|
|
534
|
+
if (Object.keys(workspaceJsonConflicts).length) {
|
|
535
|
+
const conflictedPkgs = Object.keys(workspaceJsonConflicts).map(depField => workspaceJsonConflicts[depField].map(d => d.name)).flat();
|
|
536
|
+
allResults.forEach(result => {
|
|
537
|
+
if (result !== null && result !== void 0 && result.conflict) {
|
|
538
|
+
_constants().DEPENDENCIES_FIELDS.forEach(depField => {
|
|
539
|
+
var _result$conflict, _result$conflict2;
|
|
540
|
+
if (!((_result$conflict = result.conflict) !== null && _result$conflict !== void 0 && _result$conflict[depField])) return;
|
|
541
|
+
result.conflict[depField] = (_result$conflict2 = result.conflict) === null || _result$conflict2 === void 0 ? void 0 : _result$conflict2[depField].filter(dep => !conflictedPkgs.includes(dep.name));
|
|
542
|
+
if (!result.conflict[depField].length) delete result.conflict[depField];
|
|
543
|
+
});
|
|
544
|
+
if ((0, _lodash().isEmpty)(result.conflict)) result.conflict = undefined;
|
|
545
|
+
}
|
|
546
|
+
});
|
|
547
|
+
}
|
|
548
|
+
if (Object.keys(workspaceJsonUpdates).length) {
|
|
549
|
+
await workspaceConfig.write();
|
|
550
|
+
}
|
|
551
|
+
this.logger.debug('final workspace.jsonc updates', workspaceJsonUpdates);
|
|
552
|
+
this.logger.debug('final workspace.jsonc conflicts', workspaceJsonConflicts);
|
|
553
|
+
return {
|
|
554
|
+
workspaceDepsUpdates: Object.keys(workspaceJsonUpdates).length ? workspaceJsonUpdates : undefined,
|
|
555
|
+
workspaceDepsConflicts: Object.keys(workspaceJsonConflicts).length ? workspaceJsonConflicts : undefined
|
|
556
|
+
};
|
|
557
|
+
}
|
|
393
558
|
|
|
394
559
|
/**
|
|
395
560
|
* this function gets called from two different commands:
|
|
@@ -409,8 +574,9 @@ class MergingMain {
|
|
|
409
574
|
}
|
|
410
575
|
const componentStatusBeforeMergeAttempt = await (0, _pMapSeries().default)(bitIds, id => this.getComponentStatusBeforeMergeAttempt(id, currentLane, options));
|
|
411
576
|
const toImport = componentStatusBeforeMergeAttempt.map(compStatus => {
|
|
412
|
-
if (!compStatus.divergeData
|
|
413
|
-
|
|
577
|
+
if (!compStatus.divergeData) return [];
|
|
578
|
+
const versionsToImport = (0, _lodash().compact)([...compStatus.divergeData.snapsOnTargetOnly, compStatus.divergeData.commonSnapBeforeDiverge]);
|
|
579
|
+
return versionsToImport.map(v => compStatus.id.changeVersion(v.toString()));
|
|
414
580
|
}).flat();
|
|
415
581
|
await this.consumer.scope.scopeImporter.importManyIfMissingWithoutDeps({
|
|
416
582
|
ids: _bitId().BitIds.fromArray(toImport),
|
|
@@ -872,16 +1038,16 @@ other: ${otherLaneHead.toString()}`);
|
|
|
872
1038
|
}
|
|
873
1039
|
return ids.map(id => consumer.getParsedId(id));
|
|
874
1040
|
}
|
|
875
|
-
static async provider([cli, workspace, snapping, checkout, install, loggerMain, compWriter, importer]) {
|
|
1041
|
+
static async provider([cli, workspace, snapping, checkout, install, loggerMain, compWriter, importer, config]) {
|
|
876
1042
|
const logger = loggerMain.createLogger(_merging().MergingAspect.id);
|
|
877
|
-
const merging = new MergingMain(workspace, install, snapping, checkout, logger, compWriter, importer);
|
|
1043
|
+
const merging = new MergingMain(workspace, install, snapping, checkout, logger, compWriter, importer, config);
|
|
878
1044
|
cli.register(new (_mergeCmd().MergeCmd)(merging));
|
|
879
1045
|
return merging;
|
|
880
1046
|
}
|
|
881
1047
|
}
|
|
882
1048
|
exports.MergingMain = MergingMain;
|
|
883
1049
|
(0, _defineProperty2().default)(MergingMain, "slots", []);
|
|
884
|
-
(0, _defineProperty2().default)(MergingMain, "dependencies", [_cli().CLIAspect, _workspace().default, _snapping().default, _checkout().CheckoutAspect, _install().InstallAspect, _logger().LoggerAspect, _componentWriter().ComponentWriterAspect, _importer().default]);
|
|
1050
|
+
(0, _defineProperty2().default)(MergingMain, "dependencies", [_cli().CLIAspect, _workspace().default, _snapping().default, _checkout().CheckoutAspect, _install().InstallAspect, _logger().LoggerAspect, _componentWriter().ComponentWriterAspect, _importer().default, _config().ConfigAspect]);
|
|
885
1051
|
(0, _defineProperty2().default)(MergingMain, "runtime", _cli().MainRuntime);
|
|
886
1052
|
_merging().MergingAspect.addRuntime(MergingMain);
|
|
887
1053
|
|