@teambit/merging 0.0.265 → 0.0.266

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
1
  import { ComponentID } from '@teambit/component-id';
2
+ import { Lane } from '@teambit/legacy/dist/scope/models';
2
3
  import { ExtensionDataList } from '@teambit/legacy/dist/consumer/config/extension-data';
3
4
  import { ConfigMergeResult } from './config-merge-result';
4
5
  declare type GenericConfigOrRemoved = Record<string, any> | '-';
@@ -33,6 +34,7 @@ export declare type MergeStrategyResult = {
33
34
  export declare class ConfigMerger {
34
35
  private compIdStr;
35
36
  private workspaceIds;
37
+ private otherLane;
36
38
  private currentAspects;
37
39
  private baseAspects;
38
40
  private otherAspects;
@@ -42,7 +44,8 @@ export declare class ConfigMerger {
42
44
  private otherEnv;
43
45
  private baseEnv?;
44
46
  private handledExtIds;
45
- constructor(compIdStr: string, workspaceIds: ComponentID[], currentAspects: ExtensionDataList, baseAspects: ExtensionDataList, otherAspects: ExtensionDataList, currentLabel: string, otherLabel: string);
47
+ private otherLaneIdsStr;
48
+ constructor(compIdStr: string, workspaceIds: ComponentID[], otherLane: Lane | undefined, currentAspects: ExtensionDataList, baseAspects: ExtensionDataList, otherAspects: ExtensionDataList, currentLabel: string, otherLabel: string);
46
49
  merge(): ConfigMergeResult;
47
50
  private populateEnvs;
48
51
  private envStrategy;
@@ -75,9 +75,10 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
75
75
  * see workspace.componentExtension / adjustEnvsOnConfigMerge for more details.
76
76
  */
77
77
  class ConfigMerger {
78
- constructor(compIdStr, workspaceIds, currentAspects, baseAspects, otherAspects, currentLabel, otherLabel) {
78
+ constructor(compIdStr, workspaceIds, otherLane, currentAspects, baseAspects, otherAspects, currentLabel, otherLabel) {
79
79
  this.compIdStr = compIdStr;
80
80
  this.workspaceIds = workspaceIds;
81
+ this.otherLane = otherLane;
81
82
  this.currentAspects = currentAspects;
82
83
  this.baseAspects = baseAspects;
83
84
  this.otherAspects = otherAspects;
@@ -87,6 +88,8 @@ class ConfigMerger {
87
88
  (0, _defineProperty2().default)(this, "otherEnv", void 0);
88
89
  (0, _defineProperty2().default)(this, "baseEnv", void 0);
89
90
  (0, _defineProperty2().default)(this, "handledExtIds", []);
91
+ (0, _defineProperty2().default)(this, "otherLaneIdsStr", void 0);
92
+ this.otherLaneIdsStr = (otherLane === null || otherLane === void 0 ? void 0 : otherLane.components.map(c => c.id.toStringWithoutVersion())) || [];
90
93
  }
91
94
  merge() {
92
95
  this.populateEnvs();
@@ -227,6 +230,7 @@ class ConfigMerger {
227
230
  } = mergeStrategyParams;
228
231
  const depResolverResult = this.depResolverStrategy(mergeStrategyParams);
229
232
  if (depResolverResult) {
233
+ // if (depResolverResult.mergedConfig || depResolverResult?.conflict) console.log("\n\nDepResolverResult", this.compIdStr, '\n', JSON.stringify(depResolverResult, undefined, 2))
230
234
  return depResolverResult;
231
235
  }
232
236
  const currentConfig = this.getConfig(currentExt);
@@ -323,6 +327,36 @@ ${'>'.repeat(7)} ${this.otherLabel}
323
327
  const otherPolicy = this.getPolicy(otherConfig);
324
328
  const baseConfig = baseExt ? this.getConfig(baseExt) : undefined;
325
329
  const basePolicy = baseConfig ? this.getPolicy(baseConfig) : undefined;
330
+ const getAutoDeps = ext => {
331
+ var _ext$findCoreExtensio, _ext$findCoreExtensio2;
332
+ const data = (_ext$findCoreExtensio = ext.findCoreExtension(_dependencyResolver().DependencyResolverAspect.id)) === null || _ext$findCoreExtensio === void 0 ? void 0 : _ext$findCoreExtensio.data.dependencies;
333
+ if (!data) return [];
334
+ const policy = ((_ext$findCoreExtensio2 = ext.findCoreExtension(_dependencyResolver().DependencyResolverAspect.id)) === null || _ext$findCoreExtensio2 === void 0 ? void 0 : _ext$findCoreExtensio2.data.policy) || [];
335
+ return data.filter(d => d.source === 'auto').map(d => {
336
+ const idWithoutVersion = d.__type === 'package' ? d.id : d.id.split('@')[0];
337
+ const existingPolicy = policy.find(p => p.dependencyId === idWithoutVersion);
338
+ const getPolicyVer = () => {
339
+ if (d.__type === 'package') return undefined; // for packages, the policy is already the version
340
+ if (existingPolicy) return existingPolicy.value.version; // currently it's missing, will be implemented by @Gilad
341
+ if (!_semver().default.valid(d.version)) return d.version; // could be a hash
342
+ // default to `^` or ~ if starts with zero, until we save the policy from the workspace during tag/snap.
343
+ return d.version.startsWith('0.') ? `~${d.version}` : `^${d.version}`;
344
+ };
345
+ return _objectSpread(_objectSpread({}, d), {}, {
346
+ id: idWithoutVersion,
347
+ policy: getPolicyVer()
348
+ });
349
+ });
350
+ };
351
+ const currentData = getAutoDeps(this.currentAspects);
352
+ const otherData = getAutoDeps(this.otherAspects);
353
+ const currentAndOtherData = (0, _lodash().uniqBy)(currentData.concat(otherData), d => d.id);
354
+ const currentAndOtherComponentsData = currentAndOtherData.filter(c => c.__type === 'component');
355
+ const baseData = getAutoDeps(this.baseAspects);
356
+ const getCompIdStrByPkgNameFromData = pkgName => {
357
+ const found = currentAndOtherComponentsData.find(d => d.packageName === pkgName);
358
+ return found === null || found === void 0 ? void 0 : found.id;
359
+ };
326
360
  const mergedPolicy = {
327
361
  dependencies: [],
328
362
  devDependencies: [],
@@ -343,6 +377,11 @@ ${'>'.repeat(7)} ${this.otherLabel}
343
377
  };
344
378
  const handleConfigMerge = () => {
345
379
  const addVariantPolicyEntryToPolicy = dep => {
380
+ const compIdStr = getCompIdStrByPkgNameFromData(dep.dependencyId);
381
+ if (compIdStr && this.isIdInWorkspace(compIdStr)) {
382
+ // no need to add if the id exists in the workspace (regardless the version)
383
+ return;
384
+ }
346
385
  const depType = lifecycleToDepType[dep.lifecycleType];
347
386
  mergedPolicy[depType].push({
348
387
  name: dep.dependencyId,
@@ -397,15 +436,15 @@ ${'>'.repeat(7)} ${this.otherLabel}
397
436
  if (baseVer && baseVer === otherVer) {
398
437
  return;
399
438
  }
400
- // @todo: needs to ignore if it's in the workspace somehow.
401
- // if (currentDep.__type === 'component' && this.isIdInWorkspace(currentId)) {
402
- // // dependencies that exist in the workspace, should be ignored. they'll be resolved later to the version in the ws.
403
- // return;
404
- // }
405
439
  if (baseVer && baseVer === currentVer) {
406
440
  addVariantPolicyEntryToPolicy(otherDep);
407
441
  return;
408
442
  }
443
+ const compIdStr = getCompIdStrByPkgNameFromData(dep.dependencyId);
444
+ if (compIdStr && this.isIdInWorkspace(compIdStr)) {
445
+ // no need to add if the id exists in the workspace (regardless the version)
446
+ return;
447
+ }
409
448
  hasConflict = true;
410
449
  conflictedPolicy[depType].push({
411
450
  name: currentDep.dependencyId,
@@ -425,6 +464,9 @@ ${'>'.repeat(7)} ${this.otherLabel}
425
464
  };
426
465
  const addSerializedDepToPolicy = dep => {
427
466
  const depType = lifecycleToDepType[dep.lifecycle];
467
+ if (dep.__type === 'component' && this.isIdInWorkspace(dep.id)) {
468
+ return;
469
+ }
428
470
  if (hasConfigForDep(depType, dep.id)) {
429
471
  return; // there is already config for it.
430
472
  }
@@ -436,31 +478,6 @@ ${'>'.repeat(7)} ${this.otherLabel}
436
478
  });
437
479
  isMerged = true;
438
480
  };
439
- const getAutoDeps = ext => {
440
- var _ext$findCoreExtensio, _ext$findCoreExtensio2;
441
- const data = (_ext$findCoreExtensio = ext.findCoreExtension(_dependencyResolver().DependencyResolverAspect.id)) === null || _ext$findCoreExtensio === void 0 ? void 0 : _ext$findCoreExtensio.data.dependencies;
442
- if (!data) return [];
443
- const policy = ((_ext$findCoreExtensio2 = ext.findCoreExtension(_dependencyResolver().DependencyResolverAspect.id)) === null || _ext$findCoreExtensio2 === void 0 ? void 0 : _ext$findCoreExtensio2.data.policy) || [];
444
- return data.filter(d => d.source === 'auto').map(d => {
445
- const idWithoutVersion = d.__type === 'package' ? d.id : d.id.split('@')[0];
446
- const existingPolicy = policy.find(p => p.dependencyId === idWithoutVersion);
447
- const getPolicyVer = () => {
448
- if (d.__type === 'package') return undefined; // for packages, the policy is already the version
449
- if (existingPolicy) return existingPolicy.value.version; // currently it's missing, will be implemented by @Gilad
450
- if (!_semver().default.valid(d.version)) return d.version; // could be a hash
451
- // default to `^` or ~ if starts with zero, until we save the policy from the workspace during tag/snap.
452
- return d.version.startsWith('0.') ? `~${d.version}` : `^${d.version}`;
453
- };
454
- return _objectSpread(_objectSpread({}, d), {}, {
455
- id: idWithoutVersion,
456
- policy: getPolicyVer()
457
- });
458
- });
459
- };
460
- const currentData = getAutoDeps(this.currentAspects);
461
- const otherData = getAutoDeps(this.otherAspects);
462
- const currentAndOtherData = (0, _lodash().uniqBy)(currentData.concat(otherData), d => d.id);
463
- const baseData = getAutoDeps(this.baseAspects);
464
481
 
465
482
  // uncomment to debug
466
483
  // console.log('\n\n**************', this.compIdStr, '**************');
@@ -558,7 +575,7 @@ ${'>'.repeat(7)} ${this.otherLabel}`;
558
575
  };
559
576
  }
560
577
  isIdInWorkspace(id) {
561
- return Boolean(this.getIdFromWorkspace(id));
578
+ return Boolean(this.getIdFromWorkspace(id)) || this.otherLaneIdsStr.includes(id);
562
579
  }
563
580
  getIdFromWorkspace(id) {
564
581
  return this.workspaceIds.find(c => c.toStringWithoutVersion() === id);
@@ -1 +1 @@
1
- {"version":3,"names":["ConfigMerger","constructor","compIdStr","workspaceIds","currentAspects","baseAspects","otherAspects","currentLabel","otherLabel","merge","populateEnvs","results","map","currentExt","id","stringId","handledExtIds","includes","push","baseExt","findExtension","otherExt","mergePerStrategy","basicConflictGenerator","currentConfig","getConfig","otherConfig","otherAspectsNotHandledResults","extensionId","hasVersion","idFromWorkspace","getIdFromWorkspace","toStringWithoutVersion","_legacy","toString","mergedConfig","envResult","envStrategy","ConfigMergeResult","compact","getEnvId","ext","envsAspect","findCoreExtension","EnvsAspect","Error","env","config","data","currentEnv","otherEnv","baseEnv","undefined","currentEnvAspect","version","otherEnvAspect","baseEnvAspect","mergeStrategyParams","baseConfig","isIdInWorkspace","basicConfigMerge","areConfigsEqual","configA","configB","JSON","stringify","depResolverResult","depResolverStrategy","mergeStrategyConfigParams","conflict","repeat","formatConfig","conf","confStr","confStrSplit","split","shift","pop","join","params","DependencyResolverAspect","currentPolicy","getPolicy","otherPolicy","basePolicy","mergedPolicy","dependencies","devDependencies","peerDependencies","conflictedPolicy","isMerged","hasConflict","conflictIndicator","lifecycleToDepType","runtime","dev","peer","handleConfigMerge","addVariantPolicyEntryToPolicy","dep","depType","lifecycleType","name","dependencyId","value","force","length","forEach","policy","currentAndOtherConfig","uniqBy","concat","d","currentDep","find","otherDep","baseDep","currentVer","otherVer","baseVer","hasConfigForDep","depName","getDepIdAsPkgName","__type","packageName","addSerializedDepToPolicy","lifecycle","getAutoDeps","filter","source","idWithoutVersion","existingPolicy","p","getPolicyVer","semver","valid","startsWith","currentData","otherData","currentAndOtherData","baseData","depData","isEnv","currentId","isRange","satisfies","conflictStr","mergedConfigSplit","conflictLines","line","currentVal","otherVal","unshift","Boolean","c","rawConfig","omit","VariantPolicy","fromConfigObject","entries"],"sources":["config-merger.ts"],"sourcesContent":["import { ComponentID } from '@teambit/component-id';\nimport semver from 'semver';\nimport {\n DependencyResolverAspect,\n isRange,\n SerializedDependency,\n VariantPolicy,\n VariantPolicyEntry,\n} from '@teambit/dependency-resolver';\nimport { EnvsAspect } from '@teambit/envs';\nimport { ExtensionDataEntry, ExtensionDataList } from '@teambit/legacy/dist/consumer/config/extension-data';\nimport { compact, omit, uniqBy } from 'lodash';\nimport { ConfigMergeResult } from './config-merge-result';\n\ntype GenericConfigOrRemoved = Record<string, any> | '-';\n\ntype EnvData = { id: string; version?: string; config?: GenericConfigOrRemoved };\n\ntype SerializedDependencyWithPolicy = SerializedDependency & { policy?: string };\n\nexport type MergeStrategyResult = {\n id: string;\n mergedConfig?: GenericConfigOrRemoved;\n conflict?: string;\n};\ntype MergeStrategyParamsWithRemoved = {\n id: string;\n currentConfig: GenericConfigOrRemoved;\n otherConfig: GenericConfigOrRemoved;\n baseConfig?: GenericConfigOrRemoved;\n};\ntype MergeStrategyParams = {\n id: string;\n currentExt: ExtensionDataEntry;\n otherExt: ExtensionDataEntry;\n baseExt?: ExtensionDataEntry;\n};\n\n/**\n * perform 3-way merge of component configuration (aspects).\n * normally this is needed when merging one lane into another. the component may have different aspects config in each lane.\n * the baseAspects are the aspects of the component in the diversion point (the common ancestor of the two lanes).\n * the currentAspects are the aspects of the component in the current lane.\n * the otherAspects are the aspects of the component in the other lane. this is the lane we merge into the current lane.\n *\n * the basic merging strategy is a simple comparison between the aspect-configs, if they're different, we have a conflict.\n * we have two special cases:\n *\n * 1. dependency-resolver: we do a deeper check for the policy, we compare each dependency separately. also, we take\n * into account not only the config, but also the data. this is needed because some dependencies are automatically\n * added by Bit (from the import statements in the code) and they're not in the config. the final config has the deps\n * from both sources, the config and the data. The way we know to differentiate between them is by the \"force\" prop.\n * the config has always force: true.\n *\n * 2. envs: if we don't treat it specially, the user will need to make the change not only in the envs aspect, but also\n * in the deps-resolver (because the env is added as a devDependency) and also in the aspect itself (because\n * teambit.envs/env has only the id and not the version). to make it simpler, we ignore the envs in the deps-resolver\n * we ignore the individual aspect that is the env itself. we only show teambit.envs/env and we put the env id and\n * version. later, when the component is loaded, we split the id and the version and put them in the correct places.\n * see workspace.componentExtension / adjustEnvsOnConfigMerge for more details.\n */\nexport class ConfigMerger {\n private currentEnv: EnvData;\n private otherEnv: EnvData;\n private baseEnv?: EnvData;\n private handledExtIds: string[] = [];\n constructor(\n private compIdStr: string,\n private workspaceIds: ComponentID[],\n private currentAspects: ExtensionDataList,\n private baseAspects: ExtensionDataList,\n private otherAspects: ExtensionDataList,\n private currentLabel: string,\n private otherLabel: string\n ) {}\n\n merge(): ConfigMergeResult {\n this.populateEnvs();\n const results = this.currentAspects.map((currentExt) => {\n const id = currentExt.stringId;\n if (this.handledExtIds.includes(id)) return null;\n this.handledExtIds.push(id);\n const baseExt = this.baseAspects.findExtension(id, true);\n const otherExt = this.otherAspects.findExtension(id, true);\n if (otherExt) {\n // try to 3-way-merge\n return this.mergePerStrategy({ id, currentExt, otherExt, baseExt });\n }\n // exist in current but not in other\n if (baseExt) {\n // was removed on other\n return this.basicConflictGenerator({ id, currentConfig: this.getConfig(currentExt), otherConfig: '-' });\n }\n // exist in current but not in other and base, so it got created on current. nothing to do.\n return null;\n });\n const otherAspectsNotHandledResults = this.otherAspects.map((otherExt) => {\n let id = otherExt.stringId;\n if (this.handledExtIds.includes(id)) return null;\n this.handledExtIds.push(id);\n if (otherExt.extensionId && otherExt.extensionId.hasVersion()) {\n // avoid using the id from the other lane if it exits in the workspace. prefer the id from the workspace.\n const idFromWorkspace = this.getIdFromWorkspace(otherExt.extensionId.toStringWithoutVersion());\n if (idFromWorkspace) id = idFromWorkspace._legacy.toString();\n }\n const baseExt = this.baseAspects.findExtension(id, true);\n if (baseExt) {\n // was removed on current\n return this.basicConflictGenerator({ id, currentConfig: '-', otherConfig: this.getConfig(otherExt) });\n }\n // exist in other but not in current and base, so it got created on other.\n return { id, mergedConfig: this.getConfig(otherExt) };\n });\n const envResult = [this.envStrategy()] || [];\n return new ConfigMergeResult(this.compIdStr, compact([...results, ...otherAspectsNotHandledResults, ...envResult]));\n }\n\n private populateEnvs() {\n // populate ids\n const getEnvId = (ext: ExtensionDataList) => {\n const envsAspect = ext.findCoreExtension(EnvsAspect.id);\n if (!envsAspect) throw new Error(`unable to find ${EnvsAspect.id} aspect for ${this.compIdStr}`);\n const env = envsAspect.config.env || envsAspect.data.id;\n if (!env)\n throw new Error(`unable to find env for ${this.compIdStr}, the config and data of ${EnvsAspect.id} are empty}`);\n return env;\n };\n const currentEnv = getEnvId(this.currentAspects);\n this.currentEnv = { id: currentEnv };\n const otherEnv = getEnvId(this.otherAspects);\n this.otherEnv = { id: otherEnv };\n const baseEnv = this.baseAspects ? getEnvId(this.baseAspects) : undefined;\n if (baseEnv) this.baseEnv = { id: baseEnv };\n\n // populate version\n const currentEnvAspect = this.currentAspects.findExtension(currentEnv, true);\n if (currentEnvAspect) {\n this.handledExtIds.push(currentEnvAspect.stringId);\n this.currentEnv.version = currentEnvAspect.extensionId?.version;\n this.currentEnv.config = this.getConfig(currentEnvAspect);\n }\n const otherEnvAspect = this.otherAspects.findExtension(otherEnv, true);\n if (otherEnvAspect) {\n this.handledExtIds.push(otherEnvAspect.stringId);\n this.otherEnv.version = otherEnvAspect.extensionId?.version;\n this.otherEnv.config = this.getConfig(otherEnvAspect);\n }\n if (this.baseEnv) {\n const baseEnvAspect = this.baseAspects.findExtension(baseEnv, true);\n if (baseEnvAspect) {\n this.baseEnv.version = baseEnvAspect.extensionId?.version;\n this.baseEnv.config = this.getConfig(baseEnvAspect);\n }\n }\n }\n\n private envStrategy(): MergeStrategyResult | null {\n const mergeStrategyParams: MergeStrategyParamsWithRemoved = {\n id: EnvsAspect.id,\n currentConfig: {\n env: this.currentEnv.version ? `${this.currentEnv.id}@${this.currentEnv.version}` : this.currentEnv.id,\n },\n otherConfig: { env: this.otherEnv.version ? `${this.otherEnv.id}@${this.otherEnv.version}` : this.otherEnv.id },\n };\n if (this.baseEnv) {\n mergeStrategyParams.baseConfig = {\n env: this.baseEnv?.version ? `${this.baseEnv.id}@${this.baseEnv.version}` : this.baseEnv?.id,\n };\n }\n if (this.currentEnv.id === this.otherEnv.id && this.currentEnv.version === this.otherEnv.version) {\n return null;\n }\n if (this.isIdInWorkspace(this.currentEnv.id)) {\n // the env currently used is part of the workspace, that's what the user needs. don't try to resolve anything.\n return null;\n }\n return this.basicConfigMerge(mergeStrategyParams);\n }\n\n private areConfigsEqual(configA: GenericConfigOrRemoved, configB: GenericConfigOrRemoved) {\n return JSON.stringify(configA) === JSON.stringify(configB);\n }\n\n private mergePerStrategy(mergeStrategyParams: MergeStrategyParams): MergeStrategyResult | null {\n const { id, currentExt, otherExt, baseExt } = mergeStrategyParams;\n const depResolverResult = this.depResolverStrategy(mergeStrategyParams);\n if (depResolverResult) {\n return depResolverResult;\n }\n const currentConfig = this.getConfig(currentExt);\n const otherConfig = this.getConfig(otherExt);\n const baseConfig = baseExt ? this.getConfig(baseExt) : undefined;\n\n return this.basicConfigMerge({ id, currentConfig, otherConfig, baseConfig });\n }\n\n private basicConfigMerge(mergeStrategyParams: MergeStrategyParamsWithRemoved) {\n const { id, currentConfig, otherConfig, baseConfig } = mergeStrategyParams;\n if (this.areConfigsEqual(currentConfig, otherConfig)) {\n return null;\n }\n if (baseConfig && this.areConfigsEqual(baseConfig, otherConfig)) {\n // was changed on current\n return null;\n }\n if (baseConfig && this.areConfigsEqual(baseConfig, currentConfig)) {\n // was changed on other\n return { id, mergedConfig: otherConfig };\n }\n // either no baseConfig, or baseConfig is also different from both: other and local. that's a conflict.\n const mergeStrategyConfigParams = { id, currentConfig, otherConfig, baseConfig };\n return this.basicConflictGenerator(mergeStrategyConfigParams);\n }\n\n private basicConflictGenerator({\n id,\n currentConfig,\n otherConfig,\n }: MergeStrategyParamsWithRemoved): MergeStrategyResult {\n // uncomment to debug\n // console.log('basicConflictGenerator', this.compIdStr, id, 'currentConfig', currentConfig, 'otherConfig', otherConfig);\n let conflict: string;\n if (currentConfig === '-') {\n conflict = `${'<'.repeat(7)} ${this.currentLabel}\n\"${id}\": \"-\"\n=======\n\"${id}\": ${JSON.stringify(otherConfig, undefined, 2)}\n${'>'.repeat(7)} ${this.otherLabel}`;\n } else if (otherConfig === '-') {\n conflict = `${'<'.repeat(7)} ${this.currentLabel}\n\"${id}\": ${JSON.stringify(currentConfig, undefined, 2)}\n=======\n\"${id}\": \"-\"\n${'>'.repeat(7)} ${this.otherLabel}`;\n } else {\n const formatConfig = (conf: GenericConfigOrRemoved) => {\n const confStr = JSON.stringify(conf, undefined, 2);\n const confStrSplit = confStr.split('\\n');\n confStrSplit.shift(); // remove first {\n confStrSplit.pop(); // remove last }\n return confStrSplit.join('\\n');\n };\n conflict = `\"${id}\": {\n${'<'.repeat(7)} ${this.currentLabel}\n${formatConfig(currentConfig)}\n=======\n${formatConfig(otherConfig)}\n${'>'.repeat(7)} ${this.otherLabel}\n}`;\n }\n\n return { id, conflict };\n }\n\n private depResolverStrategy(params: MergeStrategyParams): MergeStrategyResult | undefined {\n if (params.id !== DependencyResolverAspect.id) return undefined;\n const { currentExt, otherExt, baseExt } = params;\n\n const currentConfig = this.getConfig(currentExt);\n const currentPolicy = this.getPolicy(currentConfig);\n const otherConfig = this.getConfig(otherExt);\n const otherPolicy = this.getPolicy(otherConfig);\n\n const baseConfig = baseExt ? this.getConfig(baseExt) : undefined;\n const basePolicy = baseConfig ? this.getPolicy(baseConfig) : undefined;\n\n const mergedPolicy = {\n dependencies: [],\n devDependencies: [],\n peerDependencies: [],\n };\n const conflictedPolicy = {\n dependencies: [],\n devDependencies: [],\n peerDependencies: [],\n };\n let isMerged = false;\n let hasConflict = false;\n const conflictIndicator = 'CONFLICT::';\n const lifecycleToDepType = {\n runtime: 'dependencies',\n dev: 'devDependencies',\n peer: 'peerDependencies',\n };\n const handleConfigMerge = () => {\n const addVariantPolicyEntryToPolicy = (dep: VariantPolicyEntry) => {\n const depType = lifecycleToDepType[dep.lifecycleType];\n mergedPolicy[depType].push({\n name: dep.dependencyId,\n version: dep.value.version,\n force: dep.force,\n });\n isMerged = true;\n };\n\n if (this.areConfigsEqual(currentConfig, otherConfig)) {\n return;\n }\n if (baseConfig && this.areConfigsEqual(baseConfig, otherConfig)) {\n // was changed on current\n return;\n }\n if (currentConfig === '-' || otherConfig === '-') {\n throw new Error('not implemented. Is it possible to have it as minus?');\n }\n if (baseConfig && this.areConfigsEqual(baseConfig, currentConfig)) {\n // was changed on other\n if (otherPolicy.length) {\n otherPolicy.forEach((dep) => {\n addVariantPolicyEntryToPolicy(dep);\n });\n }\n isMerged = true;\n return;\n }\n\n // either no baseConfig, or baseConfig is also different from both: other and local. that's a conflict.\n if (!currentConfig.policy && !otherConfig.policy) return;\n const currentAndOtherConfig = uniqBy(currentPolicy.concat(otherPolicy), (d) => d.dependencyId);\n currentAndOtherConfig.forEach((dep) => {\n const depType = lifecycleToDepType[dep.lifecycleType];\n const currentDep = currentPolicy.find((d) => d.dependencyId === dep.dependencyId);\n const otherDep = otherPolicy.find((d) => d.dependencyId === dep.dependencyId);\n const baseDep = basePolicy?.find((d) => d.dependencyId === dep.dependencyId);\n\n if (!otherDep) {\n return;\n }\n if (!currentDep) {\n // only on other\n addVariantPolicyEntryToPolicy(otherDep);\n return;\n }\n const currentVer = currentDep.value.version;\n const otherVer = otherDep.value.version;\n if (currentVer === otherVer) {\n return;\n }\n const baseVer = baseDep?.value.version;\n if (baseVer && baseVer === otherVer) {\n return;\n }\n // @todo: needs to ignore if it's in the workspace somehow.\n // if (currentDep.__type === 'component' && this.isIdInWorkspace(currentId)) {\n // // dependencies that exist in the workspace, should be ignored. they'll be resolved later to the version in the ws.\n // return;\n // }\n if (baseVer && baseVer === currentVer) {\n addVariantPolicyEntryToPolicy(otherDep);\n return;\n }\n\n hasConflict = true;\n conflictedPolicy[depType].push({\n name: currentDep.dependencyId,\n version: `${conflictIndicator}${currentVer}::${otherVer}::`,\n force: currentDep.force,\n });\n });\n };\n\n handleConfigMerge();\n\n const hasConfigForDep = (depType: string, depName: string) => mergedPolicy[depType].find((d) => d.name === depName);\n const getDepIdAsPkgName = (dep: SerializedDependencyWithPolicy) => {\n if (dep.__type !== 'component') {\n return dep.id;\n }\n // @ts-ignore\n return dep.packageName;\n };\n\n const addSerializedDepToPolicy = (dep: SerializedDependencyWithPolicy) => {\n const depType = lifecycleToDepType[dep.lifecycle];\n\n if (hasConfigForDep(depType, dep.id)) {\n return; // there is already config for it.\n }\n mergedPolicy[depType].push({\n name: getDepIdAsPkgName(dep),\n version: dep.policy || dep.version,\n force: false,\n });\n isMerged = true;\n };\n\n const getAutoDeps = (ext: ExtensionDataList): SerializedDependencyWithPolicy[] => {\n const data = ext.findCoreExtension(DependencyResolverAspect.id)?.data.dependencies;\n if (!data) return [];\n const policy = ext.findCoreExtension(DependencyResolverAspect.id)?.data.policy || [];\n return data\n .filter((d) => d.source === 'auto')\n .map((d) => {\n const idWithoutVersion = d.__type === 'package' ? d.id : d.id.split('@')[0];\n const existingPolicy = policy.find((p) => p.dependencyId === idWithoutVersion);\n const getPolicyVer = () => {\n if (d.__type === 'package') return undefined; // for packages, the policy is already the version\n if (existingPolicy) return existingPolicy.value.version; // currently it's missing, will be implemented by @Gilad\n if (!semver.valid(d.version)) return d.version; // could be a hash\n // default to `^` or ~ if starts with zero, until we save the policy from the workspace during tag/snap.\n return d.version.startsWith('0.') ? `~${d.version}` : `^${d.version}`;\n };\n return {\n ...d,\n id: idWithoutVersion,\n policy: getPolicyVer(),\n };\n });\n };\n\n const currentData = getAutoDeps(this.currentAspects);\n const otherData = getAutoDeps(this.otherAspects);\n const currentAndOtherData = uniqBy(currentData.concat(otherData), (d) => d.id);\n const baseData = getAutoDeps(this.baseAspects);\n\n // uncomment to debug\n // console.log('\\n\\n**************', this.compIdStr, '**************');\n // console.log('currentData', currentData.length, '\\n', currentData.map((d) => `${d.__type} ${d.id} ${d.version}`).join('\\n'));\n // console.log('otherData', otherData.length, '\\n', otherData.map((d) => `${d.__type} ${d.id} ${d.version}`).join('\\n'));\n // console.log('otherData', baseData.length, '\\n', baseData.map((d) => `${d.__type} ${d.id} ${d.version}`).join('\\n'));\n // console.log('** END **\\n\\n');\n\n currentAndOtherData.forEach((depData) => {\n if (this.isEnv(depData.id)) {\n // ignore the envs\n return;\n }\n const currentDep = currentData.find((d) => d.id === depData.id);\n const otherDep = otherData.find((d) => d.id === depData.id);\n if (!otherDep) {\n return;\n }\n if (!currentDep) {\n // only on other\n addSerializedDepToPolicy(otherDep);\n return;\n }\n const currentId = currentDep.id;\n const currentVer = currentDep.policy || currentDep.version;\n const otherVer = otherDep.policy || otherDep.version;\n if (currentVer === otherVer) {\n return;\n }\n const baseDep = baseData.find((d) => d.id === currentId);\n const baseVer = baseDep?.policy || baseDep?.version;\n if (baseVer && baseVer === otherVer) {\n return;\n }\n if (currentDep.__type === 'component' && this.isIdInWorkspace(currentId)) {\n // dependencies that exist in the workspace, should be ignored. they'll be resolved later to the version in the ws.\n return;\n }\n if (baseVer && baseVer === currentVer) {\n addSerializedDepToPolicy(otherDep);\n return;\n }\n // either no baseVal, or baseVal is also different from both: other and local. that's probably a conflict.\n const depType = lifecycleToDepType[currentDep.lifecycle];\n if (hasConfigForDep(depType, currentDep.id)) {\n return; // there is already config for it.\n }\n // try to resolve according to semver\n if (\n currentDep.policy &&\n otherDep.policy &&\n isRange(currentDep.policy, currentDep.id) &&\n isRange(otherDep.policy, otherDep.id)\n ) {\n if (semver.satisfies(currentDep.version, otherDep.policy)) {\n return;\n }\n if (semver.satisfies(otherDep.version, currentDep.policy)) {\n addSerializedDepToPolicy(otherDep);\n return;\n }\n }\n hasConflict = true;\n conflictedPolicy[depType].push({\n name: getDepIdAsPkgName(currentDep),\n version: `${conflictIndicator}${currentVer}::${otherVer}::`,\n force: false,\n });\n });\n\n ['dependencies', 'devDependencies', 'peerDependencies'].forEach((depType) => {\n if (!mergedPolicy[depType].length) delete mergedPolicy[depType];\n if (!conflictedPolicy[depType].length) delete conflictedPolicy[depType];\n });\n\n let conflictStr: string | undefined;\n if (hasConflict) {\n const mergedConfigSplit = JSON.stringify({ policy: conflictedPolicy }, undefined, 2).split('\\n');\n const conflictLines = mergedConfigSplit.map((line) => {\n if (!line.includes(conflictIndicator)) return line;\n const [, currentVal, otherVal] = line.split('::');\n return `${'<'.repeat(7)} ${this.currentLabel}\n \"version\": \"${currentVal}\",\n=======\n \"version\": \"${otherVal}\",\n${'>'.repeat(7)} ${this.otherLabel}`;\n });\n // replace the first line with line with the id\n conflictLines.shift();\n conflictLines.unshift(`\"${params.id}\": {`);\n conflictStr = conflictLines.join('\\n');\n }\n const config = isMerged ? { policy: mergedPolicy } : undefined;\n\n return { id: params.id, mergedConfig: config, conflict: conflictStr };\n }\n\n private isIdInWorkspace(id: string): boolean {\n return Boolean(this.getIdFromWorkspace(id));\n }\n\n private getIdFromWorkspace(id: string): ComponentID | undefined {\n return this.workspaceIds.find((c) => c.toStringWithoutVersion() === id);\n }\n\n private isEnv(id: string) {\n return id === this.currentEnv.id || id === this.otherEnv.id;\n }\n\n private getConfig(ext: ExtensionDataEntry): GenericConfigOrRemoved {\n if (ext.rawConfig === '-') return ext.rawConfig;\n return omit(ext.rawConfig, ['__specific']);\n }\n\n private getPolicy(config): VariantPolicyEntry[] {\n if (!config.policy) return [];\n return VariantPolicy.fromConfigObject(config.policy).entries;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAOA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAA0D;AAAA;AA0B1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,YAAY,CAAC;EAKxBC,WAAW,CACDC,SAAiB,EACjBC,YAA2B,EAC3BC,cAAiC,EACjCC,WAA8B,EAC9BC,YAA+B,EAC/BC,YAAoB,EACpBC,UAAkB,EAC1B;IAAA,KAPQN,SAAiB,GAAjBA,SAAiB;IAAA,KACjBC,YAA2B,GAA3BA,YAA2B;IAAA,KAC3BC,cAAiC,GAAjCA,cAAiC;IAAA,KACjCC,WAA8B,GAA9BA,WAA8B;IAAA,KAC9BC,YAA+B,GAA/BA,YAA+B;IAAA,KAC/BC,YAAoB,GAApBA,YAAoB;IAAA,KACpBC,UAAkB,GAAlBA,UAAkB;IAAA;IAAA;IAAA;IAAA,uDARM,EAAE;EASjC;EAEHC,KAAK,GAAsB;IACzB,IAAI,CAACC,YAAY,EAAE;IACnB,MAAMC,OAAO,GAAG,IAAI,CAACP,cAAc,CAACQ,GAAG,CAAEC,UAAU,IAAK;MACtD,MAAMC,EAAE,GAAGD,UAAU,CAACE,QAAQ;MAC9B,IAAI,IAAI,CAACC,aAAa,CAACC,QAAQ,CAACH,E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AC1CoI,WAAW,GAAGE,aAAa,CAACtE,IAAI,CAAC,IAAI,CAAC;IACxC;IACA,MAAM/B,MAAM,GAAG2C,QAAQ,GAAG;MAAEkB,MAAM,EAAEvB;IAAa,CAAC,GAAGjC,SAAS;IAE9D,OAAO;MAAEtC,EAAE,EAAEiE,MAAM,CAACjE,EAAE;MAAEqB,YAAY,EAAEY,MAAM;MAAEsB,QAAQ,EAAE6E;IAAY,CAAC;EACvE;EAEQvF,eAAe,CAAC7C,EAAU,EAAW;IAC3C,OAAO2I,OAAO,CAAC,IAAI,CAAC1H,kBAAkB,CAACjB,EAAE,CAAC,CAAC;EAC7C;EAEQiB,kBAAkB,CAACjB,EAAU,EAA2B;IAC9D,OAAO,IAAI,CAACX,YAAY,CAAC+G,IAAI,CAAEwC,CAAC,IAAKA,CAAC,CAAC1H,sBAAsB,EAAE,KAAKlB,EAAE,CAAC;EACzE;EAEQgI,KAAK,CAAChI,EAAU,EAAE;IACxB,OAAOA,EAAE,KAAK,IAAI,CAACmC,UAAU,CAACnC,EAAE,IAAIA,EAAE,KAAK,IAAI,CAACoC,QAAQ,CAACpC,EAAE;EAC7D;EAEQW,SAAS,CAACgB,GAAuB,EAA0B;IACjE,IAAIA,GAAG,CAACkH,SAAS,KAAK,GAAG,EAAE,OAAOlH,GAAG,CAACkH,SAAS;IAC/C,OAAO,IAAAC,cAAI,EAACnH,GAAG,CAACkH,SAAS,EAAE,CAAC,YAAY,CAAC,CAAC;EAC5C;EAEQzE,SAAS,CAACnC,MAAM,EAAwB;IAC9C,IAAI,CAACA,MAAM,CAAC6D,MAAM,EAAE,OAAO,EAAE;IAC7B,OAAOiD,mCAAa,CAACC,gBAAgB,CAAC/G,MAAM,CAAC6D,MAAM,CAAC,CAACmD,OAAO;EAC9D;AACF;AAAC"}
1
+ {"version":3,"names":["ConfigMerger","constructor","compIdStr","workspaceIds","otherLane","currentAspects","baseAspects","otherAspects","currentLabel","otherLabel","otherLaneIdsStr","components","map","c","id","toStringWithoutVersion","merge","populateEnvs","results","currentExt","stringId","handledExtIds","includes","push","baseExt","findExtension","otherExt","mergePerStrategy","basicConflictGenerator","currentConfig","getConfig","otherConfig","otherAspectsNotHandledResults","extensionId","hasVersion","idFromWorkspace","getIdFromWorkspace","_legacy","toString","mergedConfig","envResult","envStrategy","ConfigMergeResult","compact","getEnvId","ext","envsAspect","findCoreExtension","EnvsAspect","Error","env","config","data","currentEnv","otherEnv","baseEnv","undefined","currentEnvAspect","version","otherEnvAspect","baseEnvAspect","mergeStrategyParams","baseConfig","isIdInWorkspace","basicConfigMerge","areConfigsEqual","configA","configB","JSON","stringify","depResolverResult","depResolverStrategy","mergeStrategyConfigParams","conflict","repeat","formatConfig","conf","confStr","confStrSplit","split","shift","pop","join","params","DependencyResolverAspect","currentPolicy","getPolicy","otherPolicy","basePolicy","getAutoDeps","dependencies","policy","filter","d","source","idWithoutVersion","__type","existingPolicy","find","p","dependencyId","getPolicyVer","value","semver","valid","startsWith","currentData","otherData","currentAndOtherData","uniqBy","concat","currentAndOtherComponentsData","baseData","getCompIdStrByPkgNameFromData","pkgName","found","packageName","mergedPolicy","devDependencies","peerDependencies","conflictedPolicy","isMerged","hasConflict","conflictIndicator","lifecycleToDepType","runtime","dev","peer","handleConfigMerge","addVariantPolicyEntryToPolicy","dep","depType","lifecycleType","name","force","length","forEach","currentAndOtherConfig","currentDep","otherDep","baseDep","currentVer","otherVer","baseVer","hasConfigForDep","depName","getDepIdAsPkgName","addSerializedDepToPolicy","lifecycle","depData","isEnv","currentId","isRange","satisfies","conflictStr","mergedConfigSplit","conflictLines","line","currentVal","otherVal","unshift","Boolean","rawConfig","omit","VariantPolicy","fromConfigObject","entries"],"sources":["config-merger.ts"],"sourcesContent":["import { ComponentID } from '@teambit/component-id';\nimport semver from 'semver';\nimport {\n DependencyResolverAspect,\n isRange,\n SerializedDependency,\n VariantPolicy,\n VariantPolicyEntry,\n} from '@teambit/dependency-resolver';\nimport { Lane } from '@teambit/legacy/dist/scope/models';\nimport { EnvsAspect } from '@teambit/envs';\nimport { ExtensionDataEntry, ExtensionDataList } from '@teambit/legacy/dist/consumer/config/extension-data';\nimport { compact, omit, uniqBy } from 'lodash';\nimport { ConfigMergeResult } from './config-merge-result';\n\ntype GenericConfigOrRemoved = Record<string, any> | '-';\n\ntype EnvData = { id: string; version?: string; config?: GenericConfigOrRemoved };\n\ntype SerializedDependencyWithPolicy = SerializedDependency & { policy?: string; packageName?: string };\n\nexport type MergeStrategyResult = {\n id: string;\n mergedConfig?: GenericConfigOrRemoved;\n conflict?: string;\n};\ntype MergeStrategyParamsWithRemoved = {\n id: string;\n currentConfig: GenericConfigOrRemoved;\n otherConfig: GenericConfigOrRemoved;\n baseConfig?: GenericConfigOrRemoved;\n};\ntype MergeStrategyParams = {\n id: string;\n currentExt: ExtensionDataEntry;\n otherExt: ExtensionDataEntry;\n baseExt?: ExtensionDataEntry;\n};\n\n/**\n * perform 3-way merge of component configuration (aspects).\n * normally this is needed when merging one lane into another. the component may have different aspects config in each lane.\n * the baseAspects are the aspects of the component in the diversion point (the common ancestor of the two lanes).\n * the currentAspects are the aspects of the component in the current lane.\n * the otherAspects are the aspects of the component in the other lane. this is the lane we merge into the current lane.\n *\n * the basic merging strategy is a simple comparison between the aspect-configs, if they're different, we have a conflict.\n * we have two special cases:\n *\n * 1. dependency-resolver: we do a deeper check for the policy, we compare each dependency separately. also, we take\n * into account not only the config, but also the data. this is needed because some dependencies are automatically\n * added by Bit (from the import statements in the code) and they're not in the config. the final config has the deps\n * from both sources, the config and the data. The way we know to differentiate between them is by the \"force\" prop.\n * the config has always force: true.\n *\n * 2. envs: if we don't treat it specially, the user will need to make the change not only in the envs aspect, but also\n * in the deps-resolver (because the env is added as a devDependency) and also in the aspect itself (because\n * teambit.envs/env has only the id and not the version). to make it simpler, we ignore the envs in the deps-resolver\n * we ignore the individual aspect that is the env itself. we only show teambit.envs/env and we put the env id and\n * version. later, when the component is loaded, we split the id and the version and put them in the correct places.\n * see workspace.componentExtension / adjustEnvsOnConfigMerge for more details.\n */\nexport class ConfigMerger {\n private currentEnv: EnvData;\n private otherEnv: EnvData;\n private baseEnv?: EnvData;\n private handledExtIds: string[] = [];\n private otherLaneIdsStr: string[];\n constructor(\n private compIdStr: string,\n private workspaceIds: ComponentID[],\n private otherLane: Lane | undefined,\n private currentAspects: ExtensionDataList,\n private baseAspects: ExtensionDataList,\n private otherAspects: ExtensionDataList,\n private currentLabel: string,\n private otherLabel: string\n ) {\n this.otherLaneIdsStr = otherLane?.components.map((c) => c.id.toStringWithoutVersion()) || [];\n }\n\n merge(): ConfigMergeResult {\n this.populateEnvs();\n const results = this.currentAspects.map((currentExt) => {\n const id = currentExt.stringId;\n if (this.handledExtIds.includes(id)) return null;\n this.handledExtIds.push(id);\n const baseExt = this.baseAspects.findExtension(id, true);\n const otherExt = this.otherAspects.findExtension(id, true);\n if (otherExt) {\n // try to 3-way-merge\n return this.mergePerStrategy({ id, currentExt, otherExt, baseExt });\n }\n // exist in current but not in other\n if (baseExt) {\n // was removed on other\n return this.basicConflictGenerator({ id, currentConfig: this.getConfig(currentExt), otherConfig: '-' });\n }\n // exist in current but not in other and base, so it got created on current. nothing to do.\n return null;\n });\n const otherAspectsNotHandledResults = this.otherAspects.map((otherExt) => {\n let id = otherExt.stringId;\n if (this.handledExtIds.includes(id)) return null;\n this.handledExtIds.push(id);\n if (otherExt.extensionId && otherExt.extensionId.hasVersion()) {\n // avoid using the id from the other lane if it exits in the workspace. prefer the id from the workspace.\n const idFromWorkspace = this.getIdFromWorkspace(otherExt.extensionId.toStringWithoutVersion());\n if (idFromWorkspace) id = idFromWorkspace._legacy.toString();\n }\n const baseExt = this.baseAspects.findExtension(id, true);\n if (baseExt) {\n // was removed on current\n return this.basicConflictGenerator({ id, currentConfig: '-', otherConfig: this.getConfig(otherExt) });\n }\n // exist in other but not in current and base, so it got created on other.\n return { id, mergedConfig: this.getConfig(otherExt) };\n });\n const envResult = [this.envStrategy()] || [];\n return new ConfigMergeResult(this.compIdStr, compact([...results, ...otherAspectsNotHandledResults, ...envResult]));\n }\n\n private populateEnvs() {\n // populate ids\n const getEnvId = (ext: ExtensionDataList) => {\n const envsAspect = ext.findCoreExtension(EnvsAspect.id);\n if (!envsAspect) throw new Error(`unable to find ${EnvsAspect.id} aspect for ${this.compIdStr}`);\n const env = envsAspect.config.env || envsAspect.data.id;\n if (!env)\n throw new Error(`unable to find env for ${this.compIdStr}, the config and data of ${EnvsAspect.id} are empty}`);\n return env;\n };\n const currentEnv = getEnvId(this.currentAspects);\n this.currentEnv = { id: currentEnv };\n const otherEnv = getEnvId(this.otherAspects);\n this.otherEnv = { id: otherEnv };\n const baseEnv = this.baseAspects ? getEnvId(this.baseAspects) : undefined;\n if (baseEnv) this.baseEnv = { id: baseEnv };\n\n // populate version\n const currentEnvAspect = this.currentAspects.findExtension(currentEnv, true);\n if (currentEnvAspect) {\n this.handledExtIds.push(currentEnvAspect.stringId);\n this.currentEnv.version = currentEnvAspect.extensionId?.version;\n this.currentEnv.config = this.getConfig(currentEnvAspect);\n }\n const otherEnvAspect = this.otherAspects.findExtension(otherEnv, true);\n if (otherEnvAspect) {\n this.handledExtIds.push(otherEnvAspect.stringId);\n this.otherEnv.version = otherEnvAspect.extensionId?.version;\n this.otherEnv.config = this.getConfig(otherEnvAspect);\n }\n if (this.baseEnv) {\n const baseEnvAspect = this.baseAspects.findExtension(baseEnv, true);\n if (baseEnvAspect) {\n this.baseEnv.version = baseEnvAspect.extensionId?.version;\n this.baseEnv.config = this.getConfig(baseEnvAspect);\n }\n }\n }\n\n private envStrategy(): MergeStrategyResult | null {\n const mergeStrategyParams: MergeStrategyParamsWithRemoved = {\n id: EnvsAspect.id,\n currentConfig: {\n env: this.currentEnv.version ? `${this.currentEnv.id}@${this.currentEnv.version}` : this.currentEnv.id,\n },\n otherConfig: { env: this.otherEnv.version ? `${this.otherEnv.id}@${this.otherEnv.version}` : this.otherEnv.id },\n };\n if (this.baseEnv) {\n mergeStrategyParams.baseConfig = {\n env: this.baseEnv?.version ? `${this.baseEnv.id}@${this.baseEnv.version}` : this.baseEnv?.id,\n };\n }\n if (this.currentEnv.id === this.otherEnv.id && this.currentEnv.version === this.otherEnv.version) {\n return null;\n }\n if (this.isIdInWorkspace(this.currentEnv.id)) {\n // the env currently used is part of the workspace, that's what the user needs. don't try to resolve anything.\n return null;\n }\n return this.basicConfigMerge(mergeStrategyParams);\n }\n\n private areConfigsEqual(configA: GenericConfigOrRemoved, configB: GenericConfigOrRemoved) {\n return JSON.stringify(configA) === JSON.stringify(configB);\n }\n\n private mergePerStrategy(mergeStrategyParams: MergeStrategyParams): MergeStrategyResult | null {\n const { id, currentExt, otherExt, baseExt } = mergeStrategyParams;\n const depResolverResult = this.depResolverStrategy(mergeStrategyParams);\n if (depResolverResult) {\n // if (depResolverResult.mergedConfig || depResolverResult?.conflict) console.log(\"\\n\\nDepResolverResult\", this.compIdStr, '\\n', JSON.stringify(depResolverResult, undefined, 2))\n return depResolverResult;\n }\n const currentConfig = this.getConfig(currentExt);\n const otherConfig = this.getConfig(otherExt);\n const baseConfig = baseExt ? this.getConfig(baseExt) : undefined;\n\n return this.basicConfigMerge({ id, currentConfig, otherConfig, baseConfig });\n }\n\n private basicConfigMerge(mergeStrategyParams: MergeStrategyParamsWithRemoved) {\n const { id, currentConfig, otherConfig, baseConfig } = mergeStrategyParams;\n if (this.areConfigsEqual(currentConfig, otherConfig)) {\n return null;\n }\n if (baseConfig && this.areConfigsEqual(baseConfig, otherConfig)) {\n // was changed on current\n return null;\n }\n if (baseConfig && this.areConfigsEqual(baseConfig, currentConfig)) {\n // was changed on other\n return { id, mergedConfig: otherConfig };\n }\n // either no baseConfig, or baseConfig is also different from both: other and local. that's a conflict.\n const mergeStrategyConfigParams = { id, currentConfig, otherConfig, baseConfig };\n return this.basicConflictGenerator(mergeStrategyConfigParams);\n }\n\n private basicConflictGenerator({\n id,\n currentConfig,\n otherConfig,\n }: MergeStrategyParamsWithRemoved): MergeStrategyResult {\n // uncomment to debug\n // console.log('basicConflictGenerator', this.compIdStr, id, 'currentConfig', currentConfig, 'otherConfig', otherConfig);\n let conflict: string;\n if (currentConfig === '-') {\n conflict = `${'<'.repeat(7)} ${this.currentLabel}\n\"${id}\": \"-\"\n=======\n\"${id}\": ${JSON.stringify(otherConfig, undefined, 2)}\n${'>'.repeat(7)} ${this.otherLabel}`;\n } else if (otherConfig === '-') {\n conflict = `${'<'.repeat(7)} ${this.currentLabel}\n\"${id}\": ${JSON.stringify(currentConfig, undefined, 2)}\n=======\n\"${id}\": \"-\"\n${'>'.repeat(7)} ${this.otherLabel}`;\n } else {\n const formatConfig = (conf: GenericConfigOrRemoved) => {\n const confStr = JSON.stringify(conf, undefined, 2);\n const confStrSplit = confStr.split('\\n');\n confStrSplit.shift(); // remove first {\n confStrSplit.pop(); // remove last }\n return confStrSplit.join('\\n');\n };\n conflict = `\"${id}\": {\n${'<'.repeat(7)} ${this.currentLabel}\n${formatConfig(currentConfig)}\n=======\n${formatConfig(otherConfig)}\n${'>'.repeat(7)} ${this.otherLabel}\n}`;\n }\n\n return { id, conflict };\n }\n\n private depResolverStrategy(params: MergeStrategyParams): MergeStrategyResult | undefined {\n if (params.id !== DependencyResolverAspect.id) return undefined;\n const { currentExt, otherExt, baseExt } = params;\n\n const currentConfig = this.getConfig(currentExt);\n const currentPolicy = this.getPolicy(currentConfig);\n const otherConfig = this.getConfig(otherExt);\n const otherPolicy = this.getPolicy(otherConfig);\n\n const baseConfig = baseExt ? this.getConfig(baseExt) : undefined;\n const basePolicy = baseConfig ? this.getPolicy(baseConfig) : undefined;\n\n const getAutoDeps = (ext: ExtensionDataList): SerializedDependencyWithPolicy[] => {\n const data = ext.findCoreExtension(DependencyResolverAspect.id)?.data.dependencies;\n if (!data) return [];\n const policy = ext.findCoreExtension(DependencyResolverAspect.id)?.data.policy || [];\n return data\n .filter((d) => d.source === 'auto')\n .map((d) => {\n const idWithoutVersion = d.__type === 'package' ? d.id : d.id.split('@')[0];\n const existingPolicy = policy.find((p) => p.dependencyId === idWithoutVersion);\n const getPolicyVer = () => {\n if (d.__type === 'package') return undefined; // for packages, the policy is already the version\n if (existingPolicy) return existingPolicy.value.version; // currently it's missing, will be implemented by @Gilad\n if (!semver.valid(d.version)) return d.version; // could be a hash\n // default to `^` or ~ if starts with zero, until we save the policy from the workspace during tag/snap.\n return d.version.startsWith('0.') ? `~${d.version}` : `^${d.version}`;\n };\n return {\n ...d,\n id: idWithoutVersion,\n policy: getPolicyVer(),\n };\n });\n };\n\n const currentData = getAutoDeps(this.currentAspects);\n const otherData = getAutoDeps(this.otherAspects);\n const currentAndOtherData = uniqBy(currentData.concat(otherData), (d) => d.id);\n const currentAndOtherComponentsData = currentAndOtherData.filter((c) => c.__type === 'component');\n const baseData = getAutoDeps(this.baseAspects);\n\n const getCompIdStrByPkgNameFromData = (pkgName: string): string | undefined => {\n const found = currentAndOtherComponentsData.find((d) => d.packageName === pkgName);\n return found?.id;\n };\n\n const mergedPolicy = {\n dependencies: [],\n devDependencies: [],\n peerDependencies: [],\n };\n const conflictedPolicy = {\n dependencies: [],\n devDependencies: [],\n peerDependencies: [],\n };\n let isMerged = false;\n let hasConflict = false;\n const conflictIndicator = 'CONFLICT::';\n const lifecycleToDepType = {\n runtime: 'dependencies',\n dev: 'devDependencies',\n peer: 'peerDependencies',\n };\n const handleConfigMerge = () => {\n const addVariantPolicyEntryToPolicy = (dep: VariantPolicyEntry) => {\n const compIdStr = getCompIdStrByPkgNameFromData(dep.dependencyId);\n if (compIdStr && this.isIdInWorkspace(compIdStr)) {\n // no need to add if the id exists in the workspace (regardless the version)\n return;\n }\n const depType = lifecycleToDepType[dep.lifecycleType];\n mergedPolicy[depType].push({\n name: dep.dependencyId,\n version: dep.value.version,\n force: dep.force,\n });\n isMerged = true;\n };\n\n if (this.areConfigsEqual(currentConfig, otherConfig)) {\n return;\n }\n if (baseConfig && this.areConfigsEqual(baseConfig, otherConfig)) {\n // was changed on current\n return;\n }\n if (currentConfig === '-' || otherConfig === '-') {\n throw new Error('not implemented. Is it possible to have it as minus?');\n }\n if (baseConfig && this.areConfigsEqual(baseConfig, currentConfig)) {\n // was changed on other\n if (otherPolicy.length) {\n otherPolicy.forEach((dep) => {\n addVariantPolicyEntryToPolicy(dep);\n });\n }\n isMerged = true;\n return;\n }\n\n // either no baseConfig, or baseConfig is also different from both: other and local. that's a conflict.\n if (!currentConfig.policy && !otherConfig.policy) return;\n const currentAndOtherConfig = uniqBy(currentPolicy.concat(otherPolicy), (d) => d.dependencyId);\n currentAndOtherConfig.forEach((dep) => {\n const depType = lifecycleToDepType[dep.lifecycleType];\n const currentDep = currentPolicy.find((d) => d.dependencyId === dep.dependencyId);\n const otherDep = otherPolicy.find((d) => d.dependencyId === dep.dependencyId);\n const baseDep = basePolicy?.find((d) => d.dependencyId === dep.dependencyId);\n\n if (!otherDep) {\n return;\n }\n if (!currentDep) {\n // only on other\n addVariantPolicyEntryToPolicy(otherDep);\n return;\n }\n const currentVer = currentDep.value.version;\n const otherVer = otherDep.value.version;\n if (currentVer === otherVer) {\n return;\n }\n const baseVer = baseDep?.value.version;\n if (baseVer && baseVer === otherVer) {\n return;\n }\n if (baseVer && baseVer === currentVer) {\n addVariantPolicyEntryToPolicy(otherDep);\n return;\n }\n const compIdStr = getCompIdStrByPkgNameFromData(dep.dependencyId);\n if (compIdStr && this.isIdInWorkspace(compIdStr)) {\n // no need to add if the id exists in the workspace (regardless the version)\n return;\n }\n\n hasConflict = true;\n conflictedPolicy[depType].push({\n name: currentDep.dependencyId,\n version: `${conflictIndicator}${currentVer}::${otherVer}::`,\n force: currentDep.force,\n });\n });\n };\n\n handleConfigMerge();\n\n const hasConfigForDep = (depType: string, depName: string) => mergedPolicy[depType].find((d) => d.name === depName);\n const getDepIdAsPkgName = (dep: SerializedDependencyWithPolicy) => {\n if (dep.__type !== 'component') {\n return dep.id;\n }\n // @ts-ignore\n return dep.packageName;\n };\n\n const addSerializedDepToPolicy = (dep: SerializedDependencyWithPolicy) => {\n const depType = lifecycleToDepType[dep.lifecycle];\n if (dep.__type === 'component' && this.isIdInWorkspace(dep.id)) {\n return;\n }\n if (hasConfigForDep(depType, dep.id)) {\n return; // there is already config for it.\n }\n mergedPolicy[depType].push({\n name: getDepIdAsPkgName(dep),\n version: dep.policy || dep.version,\n force: false,\n });\n isMerged = true;\n };\n\n // uncomment to debug\n // console.log('\\n\\n**************', this.compIdStr, '**************');\n // console.log('currentData', currentData.length, '\\n', currentData.map((d) => `${d.__type} ${d.id} ${d.version}`).join('\\n'));\n // console.log('otherData', otherData.length, '\\n', otherData.map((d) => `${d.__type} ${d.id} ${d.version}`).join('\\n'));\n // console.log('otherData', baseData.length, '\\n', baseData.map((d) => `${d.__type} ${d.id} ${d.version}`).join('\\n'));\n // console.log('** END **\\n\\n');\n\n currentAndOtherData.forEach((depData) => {\n if (this.isEnv(depData.id)) {\n // ignore the envs\n return;\n }\n const currentDep = currentData.find((d) => d.id === depData.id);\n const otherDep = otherData.find((d) => d.id === depData.id);\n if (!otherDep) {\n return;\n }\n if (!currentDep) {\n // only on other\n addSerializedDepToPolicy(otherDep);\n return;\n }\n const currentId = currentDep.id;\n const currentVer = currentDep.policy || currentDep.version;\n const otherVer = otherDep.policy || otherDep.version;\n if (currentVer === otherVer) {\n return;\n }\n const baseDep = baseData.find((d) => d.id === currentId);\n const baseVer = baseDep?.policy || baseDep?.version;\n if (baseVer && baseVer === otherVer) {\n return;\n }\n if (currentDep.__type === 'component' && this.isIdInWorkspace(currentId)) {\n // dependencies that exist in the workspace, should be ignored. they'll be resolved later to the version in the ws.\n return;\n }\n if (baseVer && baseVer === currentVer) {\n addSerializedDepToPolicy(otherDep);\n return;\n }\n // either no baseVal, or baseVal is also different from both: other and local. that's probably a conflict.\n const depType = lifecycleToDepType[currentDep.lifecycle];\n if (hasConfigForDep(depType, currentDep.id)) {\n return; // there is already config for it.\n }\n // try to resolve according to semver\n if (\n currentDep.policy &&\n otherDep.policy &&\n isRange(currentDep.policy, currentDep.id) &&\n isRange(otherDep.policy, otherDep.id)\n ) {\n if (semver.satisfies(currentDep.version, otherDep.policy)) {\n return;\n }\n if (semver.satisfies(otherDep.version, currentDep.policy)) {\n addSerializedDepToPolicy(otherDep);\n return;\n }\n }\n hasConflict = true;\n conflictedPolicy[depType].push({\n name: getDepIdAsPkgName(currentDep),\n version: `${conflictIndicator}${currentVer}::${otherVer}::`,\n force: false,\n });\n });\n\n ['dependencies', 'devDependencies', 'peerDependencies'].forEach((depType) => {\n if (!mergedPolicy[depType].length) delete mergedPolicy[depType];\n if (!conflictedPolicy[depType].length) delete conflictedPolicy[depType];\n });\n\n let conflictStr: string | undefined;\n if (hasConflict) {\n const mergedConfigSplit = JSON.stringify({ policy: conflictedPolicy }, undefined, 2).split('\\n');\n const conflictLines = mergedConfigSplit.map((line) => {\n if (!line.includes(conflictIndicator)) return line;\n const [, currentVal, otherVal] = line.split('::');\n return `${'<'.repeat(7)} ${this.currentLabel}\n \"version\": \"${currentVal}\",\n=======\n \"version\": \"${otherVal}\",\n${'>'.repeat(7)} ${this.otherLabel}`;\n });\n // replace the first line with line with the id\n conflictLines.shift();\n conflictLines.unshift(`\"${params.id}\": {`);\n conflictStr = conflictLines.join('\\n');\n }\n const config = isMerged ? { policy: mergedPolicy } : undefined;\n\n return { id: params.id, mergedConfig: config, conflict: conflictStr };\n }\n\n private isIdInWorkspace(id: string): boolean {\n return Boolean(this.getIdFromWorkspace(id)) || this.otherLaneIdsStr.includes(id);\n }\n\n private getIdFromWorkspace(id: string): ComponentID | undefined {\n return this.workspaceIds.find((c) => c.toStringWithoutVersion() === id);\n }\n\n private isEnv(id: string) {\n return id === this.currentEnv.id || id === this.otherEnv.id;\n }\n\n private getConfig(ext: ExtensionDataEntry): GenericConfigOrRemoved {\n if (ext.rawConfig === '-') return ext.rawConfig;\n return omit(ext.rawConfig, ['__specific']);\n }\n\n private getPolicy(config): VariantPolicyEntry[] {\n if (!config.policy) return [];\n return VariantPolicy.fromConfigObject(config.policy).entries;\n }\n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;EAClF;EAEQsB,kBAAkB,CAACtB,EAAU,EAA2B;IAC9D,OAAO,IAAI,CAACX,YAAY,CAAC+F,IAAI,CAAErF,CAAC,IAAKA,CAAC,CAACE,sBAAsB,EAAE,KAAKD,EAAE,CAAC;EACzE;EAEQwI,KAAK,CAACxI,EAAU,EAAE;IACxB,OAAOA,EAAE,KAAK,IAAI,CAACuC,UAAU,CAACvC,EAAE,IAAIA,EAAE,KAAK,IAAI,CAACwC,QAAQ,CAACxC,EAAE;EAC7D;EAEQgB,SAAS,CAACe,GAAuB,EAA0B;IACjE,IAAIA,GAAG,CAACqH,SAAS,KAAK,GAAG,EAAE,OAAOrH,GAAG,CAACqH,SAAS;IAC/C,OAAO,IAAAC,cAAI,EAACtH,GAAG,CAACqH,SAAS,EAAE,CAAC,YAAY,CAAC,CAAC;EAC5C;EAEQ5E,SAAS,CAACnC,MAAM,EAAwB;IAC9C,IAAI,CAACA,MAAM,CAACwC,MAAM,EAAE,OAAO,EAAE;IAC7B,OAAOyE,mCAAa,CAACC,gBAAgB,CAAClH,MAAM,CAACwC,MAAM,CAAC,CAAC2E,OAAO;EAC9D;AACF;AAAC"}
@@ -426,11 +426,10 @@ class MergingMain {
426
426
  });
427
427
  const compStatusNotNeedMerge = componentStatusBeforeMergeAttempt.filter(c => !c.mergeProps);
428
428
  const compStatusNeedMerge = componentStatusBeforeMergeAttempt.filter(c => c.mergeProps);
429
- const otherLaneName = otherLane ? otherLane.toLaneId().toString() : _laneId().DEFAULT_LANE;
430
429
  const getComponentsStatusNeedMerge = async () => {
431
430
  const tmp = new (_repositories().Tmp)(this.consumer.scope);
432
431
  try {
433
- const componentsStatus = await Promise.all(compStatusNeedMerge.map(compStatus => this.getComponentMergeStatus(currentLane, otherLaneName, compStatus)));
432
+ const componentsStatus = await Promise.all(compStatusNeedMerge.map(compStatus => this.getComponentMergeStatus(currentLane, otherLane || undefined, compStatus)));
434
433
  await tmp.clear();
435
434
  return componentsStatus;
436
435
  } catch (err) {
@@ -614,7 +613,7 @@ class MergingMain {
614
613
  }
615
614
  async getComponentMergeStatus(localLane,
616
615
  // currently checked out lane. if on main, then it's null.
617
- otherLaneName,
616
+ otherLane,
618
617
  // the lane name we want to merged to our lane. (can be also "main").
619
618
  componentMergeStatusBeforeMergeAttempt) {
620
619
  const {
@@ -639,10 +638,11 @@ class MergingMain {
639
638
  const baseComponent = await modelComponent.loadVersion(baseSnap.toString(), repo);
640
639
  const otherComponent = await modelComponent.loadVersion(otherLaneHead.toString(), repo);
641
640
  const currentLaneName = (localLane === null || localLane === void 0 ? void 0 : localLane.toLaneId().toString()) || 'main';
641
+ const otherLaneName = otherLane ? otherLane.toLaneId().toString() : _laneId().DEFAULT_LANE;
642
642
  const currentLabel = `${currentId.version} (${currentLaneName === otherLaneName ? 'current' : currentLaneName})`;
643
643
  const otherLabel = `${otherLaneHead.toString()} (${otherLaneName === currentLaneName ? 'incoming' : otherLaneName})`;
644
644
  const workspaceIds = await this.workspace.listIds();
645
- const configMerger = new (_configMerger().ConfigMerger)(id.toStringWithoutVersion(), workspaceIds, currentComponent.extensions, baseComponent.extensions, otherComponent.extensions, currentLabel, otherLabel);
645
+ const configMerger = new (_configMerger().ConfigMerger)(id.toStringWithoutVersion(), workspaceIds, otherLane, currentComponent.extensions, baseComponent.extensions, otherComponent.extensions, currentLabel, otherLabel);
646
646
  const configMergeResult = configMerger.merge();
647
647
  const mergeResults = await (0, _threeWayMerge().default)({
648
648
  consumer,
@@ -1 +1 @@
1
- {"version":3,"names":["MergingMain","constructor","workspace","install","snapping","checkout","logger","consumer","merge","values","mergeStrategy","abort","resolve","noSnap","message","build","skipDependencyInstallation","OutsideWorkspaceError","mergeResults","firstValue","R","head","resolveMerge","abortMerge","BitId","isValidVersion","bitIds","getComponentsToMerge","mergeComponentsFromRemote","version","ids","tail","mergeVersion","onDestroy","snapMessage","currentLaneId","getCurrentLaneId","currentLaneObject","getCurrentLaneObject","allComponentsStatus","getAllComponentsStatus","failedComponents","filter","c","unmergedMessage","unmergedLegitimately","length","failureMsgs","map","failedComponent","chalk","bold","id","toString","red","join","BitError","mergeSnaps","laneId","localLane","tag","componentWithConflict","find","component","hasConflicts","getMergeStrategyInteractive","componentStatus","failureMessage","unchangedLegitimately","succeededComponents","componentsResults","mapSeries","currentComponent","resolvedUnrelated","configMergeResult","modelComponent","scope","getModelComponent","updatedLaneId","isDefault","LaneId","from","name","applyVersion","remoteHead","getRef","objects","add","persist","unmergedComponents","write","writeBitMap","componentsHasConfigMergeConflicts","some","leftUnresolvedConflicts","undefined","dedupe","updateExisting","import","err","error","consoleError","getSnapOrTagResults","idsToTag","results","tagAllLaneComponent","taggedComponents","autoTaggedResults","snappedComponents","autoSnappedResults","snapResolvedComponents","mergeSnapResults","mergeSnapError","components","getMergeStatus","currentLane","otherLane","options","componentStatusBeforeMergeAttempt","Promise","all","getComponentStatusBeforeMergeAttempt","toImport","compStatus","divergeData","commonSnapBeforeDiverge","changeVersion","flat","scopeImporter","importManyIfMissingWithoutDeps","BitIds","fromArray","lane","compStatusNotNeedMerge","mergeProps","compStatusNeedMerge","otherLaneName","toLaneId","DEFAULT_LANE","getComponentsStatusNeedMerge","tmp","Tmp","componentsStatus","getComponentMergeStatus","clear","push","returnUnmerged","msg","getModelComponentIfExist","unmerged","getEntry","toStringWithoutVersion","repo","otherLaneHead","existingBitMapId","bitMap","getBitIdIfExist","ignoreVersion","componentOnOther","loadVersion","isRemoved","getCurrentId","idOnLane","getComponent","getHeadAsTagIfExist","currentId","getDivergeData","targetHead","throws","componentFromModel","getCurrentComponent","loadComponent","getConsumerComponent","removed","isModified","componentModificationStatus","getComponentStatusById","modified","baseComponent","ignoreConfigChanges","isComponentSourceCodeModified","isComponentModified","Error","mainHead","NoCommonSnap","resolveUnrelated","hasResolvedFromMain","hashToCompare","divergeDataFromMain","sourceHead","hasResolvedLocally","getHeadRegardlessOfLane","hasResolvedRemotely","versionToSaveInLane","resolvedRef","strategy","isDiverged","isSourceAhead","isTargetAhead","componentMergeStatusBeforeMergeAttempt","baseSnap","otherComponent","currentLaneName","currentLabel","otherLabel","workspaceIds","listIds","configMerger","ConfigMerger","extensions","threeWayMerge","filesStatus","unmergedComponent","remote","handleResolveUnrelated","addComponent","unrelated","addEntry","markAllFilesAsUnchanged","files","forEach","file","pathNormalizeToLinux","relative","FileStatus","unchanged","MergeOptions","ours","remoteId","idToLoad","theirs","componentWithDependencies","loadComponentWithDependenciesFromModel","updated","modifiedStatus","modifiedFiles","applyModifiedVersion","manyComponentsWriter","ManyComponentsWriter","componentsWithDependencies","installNpmPackages","override","writeConfig","verbose","writeAll","writtenPath","configMergeConflictFile","generateMergeConflictFile","configMergePath","path","getPath","MergeConfigFilename","fs","outputFile","successfullyMergedConfig","getSuccessfullyMergedConfig","mergedConfig","manual","unmergedPaths","f","conflict","filePath","setHead","markVersionAsLocal","getIdsForUnmerged","reset","removeComponent","fullName","abortedComponents","snap","legacyBitIds","_legacy","resolvedComponents","localLaneObject","bitId","remoteScopeName","remoteLaneId","remoteLanes","laneIdStr","getComponents","debug","r","tagMessage","unmodified","idsStr","componentIds","resolveMultipleComponentIds","entry","GeneralError","unresolvedComponents","u","ComponentID","fromLegacy","hasWildcard","componentsList","ComponentsList","listComponentsByIdsWithWildcard","getParsedId","provider","cli","loggerMain","createLogger","MergingAspect","merging","register","MergeCmd","CLIAspect","WorkspaceAspect","SnappingAspect","CheckoutAspect","InstallAspect","LoggerAspect","MainRuntime","addRuntime"],"sources":["merging.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport path from 'path';\nimport fs from 'fs-extra';\nimport WorkspaceAspect, { OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport R from 'ramda';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport ComponentsList from '@teambit/legacy/dist/consumer/component/components-list';\nimport {\n ApplyVersionResults,\n MergeStrategy,\n mergeVersion,\n ApplyVersionResult,\n FailedComponents,\n FileStatus,\n getMergeStrategyInteractive,\n MergeOptions,\n} from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport SnappingAspect, { SnappingMain, TagResults } from '@teambit/snapping';\nimport hasWildcard from '@teambit/legacy/dist/utils/string/has-wildcard';\nimport mapSeries from 'p-map-series';\nimport { BitId, BitIds } from '@teambit/legacy/dist/bit-id';\nimport { BitError } from '@teambit/bit-error';\nimport GeneralError from '@teambit/legacy/dist/error/general-error';\nimport { DEFAULT_LANE, LaneId } from '@teambit/lane-id';\nimport { AutoTagResult } from '@teambit/legacy/dist/scope/component-ops/auto-tag';\nimport { getDivergeData } from '@teambit/legacy/dist/scope/component-ops/get-diverge-data';\nimport { UnmergedComponent } from '@teambit/legacy/dist/scope/lanes/unmerged-components';\nimport { Lane, ModelComponent, Version } from '@teambit/legacy/dist/scope/models';\nimport { Ref } from '@teambit/legacy/dist/scope/objects';\nimport chalk from 'chalk';\nimport { Tmp } from '@teambit/legacy/dist/scope/repositories';\nimport { pathNormalizeToLinux } from '@teambit/legacy/dist/utils';\nimport ManyComponentsWriter from '@teambit/legacy/dist/consumer/component-ops/many-components-writer';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component/consumer-component';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { applyModifiedVersion } from '@teambit/legacy/dist/consumer/versions-ops/checkout-version';\nimport threeWayMerge, {\n MergeResultsThreeWay,\n} from '@teambit/legacy/dist/consumer/versions-ops/merge-version/three-way-merge';\nimport { NoCommonSnap } from '@teambit/legacy/dist/scope/exceptions/no-common-snap';\nimport { CheckoutAspect, CheckoutMain } from '@teambit/checkout';\nimport { ComponentID } from '@teambit/component-id';\nimport { MergeConfigFilename } from '@teambit/legacy/dist/constants';\nimport { SnapsDistance } from '@teambit/legacy/dist/scope/component-ops/snaps-distance';\nimport { InstallMain, InstallAspect } from '@teambit/install';\nimport { MergeCmd } from './merge-cmd';\nimport { MergingAspect } from './merging.aspect';\nimport { ConfigMerger } from './config-merger';\nimport { ConfigMergeResult } from './config-merge-result';\n\ntype ResolveUnrelatedData = { strategy: MergeStrategy; head: Ref };\n\nexport type ComponentMergeStatus = {\n currentComponent?: ConsumerComponent | null;\n componentFromModel?: Version;\n id: BitId;\n unmergedMessage?: string;\n unmergedLegitimately?: boolean; // failed to merge but for a legitimate reason, such as, up-to-date\n mergeResults?: MergeResultsThreeWay | null;\n divergeData?: SnapsDistance;\n resolvedUnrelated?: ResolveUnrelatedData;\n configMergeResult?: ConfigMergeResult;\n};\n\nexport type ComponentMergeStatusBeforeMergeAttempt = {\n currentComponent?: ConsumerComponent | null;\n componentFromModel?: Version;\n id: BitId;\n unmergedMessage?: string;\n unmergedLegitimately?: boolean; // failed to merge but for a legitimate reason, such as, up-to-date\n divergeData?: SnapsDistance;\n resolvedUnrelated?: ResolveUnrelatedData;\n mergeProps?: {\n otherLaneHead: Ref;\n currentId: BitId;\n modelComponent: ModelComponent;\n };\n};\n\nexport class MergingMain {\n private consumer: Consumer;\n constructor(\n private workspace: Workspace,\n private install: InstallMain,\n private snapping: SnappingMain,\n private checkout: CheckoutMain,\n private logger: Logger\n ) {\n this.consumer = this.workspace?.consumer;\n }\n\n /**\n * merge components according to the \"values\" param.\n * if the first param is a version, then merge the component ids to that version.\n * otherwise, merge from the remote head to the local.\n */\n async merge(\n values: string[],\n mergeStrategy: MergeStrategy,\n abort: boolean,\n resolve: boolean,\n noSnap: boolean,\n message: string,\n build: boolean,\n skipDependencyInstallation: boolean\n ): Promise<ApplyVersionResults> {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const consumer: Consumer = this.workspace.consumer;\n let mergeResults;\n const firstValue = R.head(values);\n if (resolve) {\n mergeResults = await this.resolveMerge(values, message, build);\n } else if (abort) {\n mergeResults = await this.abortMerge(values);\n } else if (!BitId.isValidVersion(firstValue)) {\n const bitIds = this.getComponentsToMerge(consumer, values);\n // @todo: version could be the lane only or remote/lane\n mergeResults = await this.mergeComponentsFromRemote(\n consumer,\n bitIds,\n mergeStrategy,\n noSnap,\n message,\n build,\n skipDependencyInstallation\n );\n } else {\n const version = firstValue;\n const ids = R.tail(values);\n const bitIds = this.getComponentsToMerge(consumer, ids);\n mergeResults = await mergeVersion(consumer, version, bitIds, mergeStrategy);\n }\n await consumer.onDestroy();\n return mergeResults;\n }\n\n /**\n * when user is on main, it merges the remote main components into local.\n * when user is on a lane, it merges the remote lane components into the local lane.\n */\n async mergeComponentsFromRemote(\n consumer: Consumer,\n bitIds: BitId[],\n mergeStrategy: MergeStrategy,\n noSnap: boolean,\n snapMessage: string,\n build: boolean,\n skipDependencyInstallation: boolean\n ): Promise<ApplyVersionResults> {\n const currentLaneId = consumer.getCurrentLaneId();\n const currentLaneObject = await consumer.getCurrentLaneObject();\n const allComponentsStatus = await this.getAllComponentsStatus(bitIds, currentLaneId, currentLaneObject);\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 return this.mergeSnaps({\n mergeStrategy,\n allComponentsStatus,\n laneId: currentLaneId,\n localLane: currentLaneObject,\n noSnap,\n snapMessage,\n build,\n skipDependencyInstallation,\n });\n }\n\n /**\n * merge multiple components according to the \"allComponentsStatus\".\n */\n async mergeSnaps({\n mergeStrategy,\n allComponentsStatus,\n laneId,\n localLane,\n noSnap,\n tag,\n snapMessage,\n build,\n skipDependencyInstallation,\n }: {\n mergeStrategy: MergeStrategy;\n allComponentsStatus: ComponentMergeStatus[];\n laneId: LaneId;\n localLane: Lane | null;\n noSnap: boolean;\n tag?: boolean;\n snapMessage: string;\n build: boolean;\n skipDependencyInstallation?: boolean;\n }): Promise<ApplyVersionResults> {\n const consumer = this.workspace.consumer;\n const componentWithConflict = allComponentsStatus.find(\n (component) => component.mergeResults && component.mergeResults.hasConflicts\n );\n if (componentWithConflict && !mergeStrategy) {\n mergeStrategy = await getMergeStrategyInteractive();\n }\n const failedComponents: FailedComponents[] = allComponentsStatus\n .filter((componentStatus) => componentStatus.unmergedMessage)\n .map((componentStatus) => ({\n id: componentStatus.id,\n failureMessage: componentStatus.unmergedMessage as string,\n unchangedLegitimately: componentStatus.unmergedLegitimately,\n }));\n const succeededComponents = allComponentsStatus.filter((componentStatus) => !componentStatus.unmergedMessage);\n // do not use Promise.all for applyVersion. otherwise, it'll write all components in parallel,\n // which can be an issue when some components are also dependencies of others\n const componentsResults = await mapSeries(\n succeededComponents,\n async ({ currentComponent, id, mergeResults, resolvedUnrelated, configMergeResult }) => {\n const modelComponent = await consumer.scope.getModelComponent(id);\n const updatedLaneId = laneId.isDefault() ? LaneId.from(laneId.name, id.scope as string) : laneId;\n return this.applyVersion({\n currentComponent,\n id,\n mergeResults,\n mergeStrategy,\n remoteHead: modelComponent.getRef(id.version as string) as Ref,\n laneId: updatedLaneId,\n localLane,\n resolvedUnrelated,\n configMergeResult,\n });\n }\n );\n\n if (localLane) consumer.scope.objects.add(localLane);\n\n await consumer.scope.objects.persist(); // persist anyway, if localLane is null it should save all main heads\n\n await consumer.scope.objects.unmergedComponents.write();\n\n await consumer.writeBitMap();\n\n const componentsHasConfigMergeConflicts = allComponentsStatus.some((c) => c.configMergeResult?.hasConflicts());\n const leftUnresolvedConflicts = componentWithConflict && mergeStrategy === 'manual';\n if (!skipDependencyInstallation && !leftUnresolvedConflicts && !componentsHasConfigMergeConflicts) {\n try {\n await this.install.install(undefined, {\n dedupe: true,\n updateExisting: false,\n import: false,\n });\n } catch (err: any) {\n this.logger.error(`failed installing packages`, err);\n this.logger.consoleError(`failed installing packages, see the log for full stacktrace. error: ${err.message}`);\n }\n }\n\n const getSnapOrTagResults = async () => {\n // if one of the component has conflict, don't snap-merge. otherwise, some of the components would be snap-merged\n // and some not. besides the fact that it could by mistake tag dependent, it's a confusing state. better not snap.\n if (noSnap || leftUnresolvedConflicts || componentsHasConfigMergeConflicts) {\n return null;\n }\n if (tag) {\n const idsToTag = allComponentsStatus.map((c) => c.id);\n const results = await this.tagAllLaneComponent(idsToTag, snapMessage, build);\n if (!results) return null;\n const { taggedComponents, autoTaggedResults } = results;\n return { snappedComponents: taggedComponents, autoSnappedResults: autoTaggedResults };\n }\n return this.snapResolvedComponents(consumer, snapMessage, build);\n };\n let mergeSnapResults: ApplyVersionResults['mergeSnapResults'] = null;\n let mergeSnapError: Error | undefined;\n try {\n mergeSnapResults = await getSnapOrTagResults();\n } catch (err: any) {\n mergeSnapError = err;\n }\n\n return {\n components: componentsResults,\n failedComponents,\n mergeSnapResults,\n mergeSnapError,\n leftUnresolvedConflicts,\n };\n }\n\n /**\n * this function gets called from two different commands:\n * 1. \"bit merge <ids...>\", when merging a component from a remote to the local.\n * in this case, the remote and local are on the same lane or both on main.\n * 2. \"bit lane merge\", when merging from one lane to another.\n */\n async getMergeStatus(\n bitIds: BitId[], // the id.version is the version we want to merge to the current component\n currentLane: Lane | null, // currently checked out lane. if on main, then it's null.\n otherLane?: Lane | null, // the lane we want to merged to our lane. (null if it's \"main\").\n options?: { resolveUnrelated?: MergeStrategy; ignoreConfigChanges?: boolean }\n ): Promise<ComponentMergeStatus[]> {\n const componentStatusBeforeMergeAttempt = await Promise.all(\n bitIds.map((id) => this.getComponentStatusBeforeMergeAttempt(id, currentLane, options))\n );\n\n const toImport = componentStatusBeforeMergeAttempt\n .map((compStatus) => {\n if (!compStatus.divergeData || !compStatus.divergeData.commonSnapBeforeDiverge) return [];\n return [compStatus.id.changeVersion(compStatus.divergeData.commonSnapBeforeDiverge.toString())];\n })\n .flat();\n\n await this.consumer.scope.scopeImporter.importManyIfMissingWithoutDeps({\n ids: BitIds.fromArray(toImport),\n lane: otherLane || undefined,\n });\n\n const compStatusNotNeedMerge = componentStatusBeforeMergeAttempt.filter(\n (c) => !c.mergeProps\n ) as ComponentMergeStatus[];\n const compStatusNeedMerge = componentStatusBeforeMergeAttempt.filter((c) => c.mergeProps);\n\n const otherLaneName = otherLane ? otherLane.toLaneId().toString() : DEFAULT_LANE;\n const getComponentsStatusNeedMerge = async (): Promise<ComponentMergeStatus[]> => {\n const tmp = new Tmp(this.consumer.scope);\n try {\n const componentsStatus = await Promise.all(\n compStatusNeedMerge.map((compStatus) => this.getComponentMergeStatus(currentLane, otherLaneName, compStatus))\n );\n await tmp.clear();\n return componentsStatus;\n } catch (err: any) {\n await tmp.clear();\n throw err;\n }\n };\n const results = await getComponentsStatusNeedMerge();\n\n results.push(...compStatusNotNeedMerge);\n return results;\n }\n\n private async getComponentStatusBeforeMergeAttempt(\n id: BitId, // the id.version is the version we want to merge to the current component\n localLane: Lane | null, // currently checked out lane. if on main, then it's null.\n options?: { resolveUnrelated?: MergeStrategy; ignoreConfigChanges?: boolean }\n ): Promise<ComponentMergeStatusBeforeMergeAttempt> {\n const consumer = this.workspace.consumer;\n const componentStatus: ComponentMergeStatus = { id };\n const returnUnmerged = (msg: string, unmergedLegitimately = false) => {\n componentStatus.unmergedMessage = msg;\n componentStatus.unmergedLegitimately = unmergedLegitimately;\n return componentStatus;\n };\n const modelComponent = await consumer.scope.getModelComponentIfExist(id);\n if (!modelComponent) {\n return returnUnmerged(\n `component ${id.toString()} is on the lane/main but its objects were not found, please re-import the lane`\n );\n }\n const unmerged = consumer.scope.objects.unmergedComponents.getEntry(id.name);\n if (unmerged) {\n return returnUnmerged(\n `component ${id.toStringWithoutVersion()} is in during-merge state a previous merge, please snap/tag it first (or use bit merge --resolve/--abort)`\n );\n }\n const repo = consumer.scope.objects;\n const version = id.version as string;\n const otherLaneHead = modelComponent.getRef(version);\n const existingBitMapId = consumer.bitMap.getBitIdIfExist(id, { ignoreVersion: true });\n const componentOnOther: Version = await modelComponent.loadVersion(version, consumer.scope.objects);\n if (componentOnOther.isRemoved()) {\n return returnUnmerged(`component has been removed`, true);\n }\n const getCurrentId = () => {\n if (existingBitMapId) return existingBitMapId;\n if (localLane) {\n const idOnLane = localLane.getComponent(id);\n if (!idOnLane) return null;\n return idOnLane.id.changeVersion(idOnLane.head.toString());\n }\n // it's on main\n const head = modelComponent.getHeadAsTagIfExist();\n if (head) {\n return id.changeVersion(head);\n }\n return null;\n };\n const currentId = getCurrentId();\n if (!currentId) {\n const divergeData = await getDivergeData({ repo, modelComponent, targetHead: otherLaneHead, throws: false });\n return { currentComponent: null, componentFromModel: componentOnOther, id, divergeData };\n }\n const getCurrentComponent = () => {\n if (existingBitMapId) return consumer.loadComponent(existingBitMapId);\n return consumer.scope.getConsumerComponent(currentId);\n };\n const currentComponent = await getCurrentComponent();\n if (currentComponent.removed) {\n return returnUnmerged(`component has been removed`, true);\n }\n const isModified = async () => {\n const componentModificationStatus = await consumer.getComponentStatusById(currentComponent.id);\n if (!componentModificationStatus.modified) return false;\n if (!existingBitMapId) return false;\n const baseComponent = await modelComponent.loadVersion(\n existingBitMapId.version as string,\n consumer.scope.objects\n );\n return options?.ignoreConfigChanges\n ? consumer.isComponentSourceCodeModified(baseComponent, currentComponent)\n : true;\n };\n\n const isComponentModified = await isModified();\n\n if (isComponentModified) {\n return returnUnmerged(`component is modified, please snap/tag it first`);\n }\n if (!otherLaneHead) {\n throw new Error(`merging: unable finding a hash for the version ${version} of ${id.toString()}`);\n }\n const divergeData = await getDivergeData({\n repo,\n modelComponent,\n targetHead: otherLaneHead,\n throws: false,\n });\n if (divergeData.err) {\n const mainHead = modelComponent.head;\n if (divergeData.err instanceof NoCommonSnap && options?.resolveUnrelated && mainHead) {\n const hasResolvedFromMain = async (hashToCompare: Ref | null) => {\n const divergeDataFromMain = await getDivergeData({\n repo,\n modelComponent,\n sourceHead: hashToCompare,\n targetHead: mainHead,\n throws: false,\n });\n if (!divergeDataFromMain.err) return true;\n return !(divergeDataFromMain.err instanceof NoCommonSnap);\n };\n const hasResolvedLocally = await hasResolvedFromMain(modelComponent.getHeadRegardlessOfLane() as Ref);\n const hasResolvedRemotely = await hasResolvedFromMain(otherLaneHead);\n if (!hasResolvedLocally && !hasResolvedRemotely) {\n return returnUnmerged(\n `unable to traverse ${currentComponent.id.toString()} history. the main-head ${mainHead.toString()} doesn't appear in both lanes, it was probably created in each lane separately`\n );\n }\n const versionToSaveInLane = hasResolvedLocally ? currentComponent.id.version : id.version;\n const resolvedRef = modelComponent.getRef(versionToSaveInLane as string);\n if (!resolvedRef) throw new Error(`unable to get ref of \"${versionToSaveInLane}\" for \"${id.toString()}\"`);\n if (options?.resolveUnrelated === 'theirs') {\n // just override with the model data\n return {\n currentComponent,\n componentFromModel: componentOnOther,\n id,\n divergeData,\n resolvedUnrelated: { strategy: 'theirs', head: resolvedRef },\n };\n }\n if (options?.resolveUnrelated === 'ours') {\n return {\n currentComponent,\n id,\n divergeData,\n resolvedUnrelated: { strategy: 'ours', head: resolvedRef },\n };\n }\n throw new Error(\n `unsupported strategy \"${options?.resolveUnrelated}\" of resolve-unrelated. supported strategies are: [ours, theirs]`\n );\n }\n return returnUnmerged(\n `unable to traverse ${currentComponent.id.toString()} history. error: ${divergeData.err.message}`\n );\n }\n if (!divergeData.isDiverged()) {\n if (divergeData.isSourceAhead()) {\n // do nothing!\n return returnUnmerged(`component ${currentComponent.id.toString()} is ahead, nothing to merge`, true);\n }\n if (divergeData.isTargetAhead()) {\n // just override with the model data\n return {\n currentComponent,\n componentFromModel: componentOnOther,\n id,\n divergeData,\n };\n }\n // we know that localHead and remoteHead are set, so if none of them is ahead they must be equal\n return returnUnmerged(`component ${currentComponent.id.toString()} is already merged`, true);\n }\n\n // it's diverged and needs merge operation\n const mergeProps = {\n otherLaneHead,\n currentId,\n modelComponent,\n };\n return { currentComponent, id, divergeData, mergeProps };\n }\n\n private async getComponentMergeStatus(\n localLane: Lane | null, // currently checked out lane. if on main, then it's null.\n otherLaneName: string, // the lane name we want to merged to our lane. (can be also \"main\").\n componentMergeStatusBeforeMergeAttempt: ComponentMergeStatusBeforeMergeAttempt\n ) {\n const { id, divergeData, currentComponent, mergeProps } = componentMergeStatusBeforeMergeAttempt;\n if (!mergeProps) throw new Error(`getDivergedMergeStatus, mergeProps is missing for ${id.toString()}`);\n const { otherLaneHead, currentId, modelComponent } = mergeProps;\n const consumer = this.workspace.consumer;\n const repo = consumer.scope.objects;\n if (!divergeData) throw new Error(`getDivergedMergeStatus, divergeData is missing for ${id.toString()}`);\n if (!currentComponent) throw new Error(`getDivergedMergeStatus, currentComponent is missing for ${id.toString()}`);\n\n const baseSnap = divergeData.commonSnapBeforeDiverge as Ref; // must be set when isTrueMerge\n // uncomment for debugging\n // console.log('id', id.toStringWithoutVersion(), 'baseSnap', baseSnap.toString(), 'current', currentId.version, 'other', otherLaneHead.toString());\n const baseComponent: Version = await modelComponent.loadVersion(baseSnap.toString(), repo);\n const otherComponent: Version = await modelComponent.loadVersion(otherLaneHead.toString(), repo);\n\n const currentLaneName = localLane?.toLaneId().toString() || 'main';\n const currentLabel = `${currentId.version} (${currentLaneName === otherLaneName ? 'current' : currentLaneName})`;\n const otherLabel = `${otherLaneHead.toString()} (${\n otherLaneName === currentLaneName ? 'incoming' : otherLaneName\n })`;\n const workspaceIds = await this.workspace.listIds();\n const configMerger = new ConfigMerger(\n id.toStringWithoutVersion(),\n workspaceIds,\n currentComponent.extensions,\n baseComponent.extensions,\n otherComponent.extensions,\n currentLabel,\n otherLabel\n );\n const configMergeResult = configMerger.merge();\n\n const mergeResults = await threeWayMerge({\n consumer,\n otherComponent,\n otherLabel,\n currentComponent,\n currentLabel,\n baseComponent,\n });\n return { currentComponent, id, mergeResults, divergeData, configMergeResult };\n }\n\n private async applyVersion({\n currentComponent,\n id,\n mergeResults,\n mergeStrategy,\n remoteHead,\n laneId,\n localLane,\n resolvedUnrelated,\n configMergeResult,\n }: {\n currentComponent: ConsumerComponent | null | undefined;\n id: BitId;\n mergeResults: MergeResultsThreeWay | null | undefined;\n mergeStrategy: MergeStrategy;\n remoteHead: Ref;\n laneId: LaneId;\n localLane: Lane | null;\n resolvedUnrelated?: ResolveUnrelatedData;\n configMergeResult?: ConfigMergeResult;\n }): Promise<ApplyVersionResult> {\n const consumer = this.workspace.consumer;\n let filesStatus = {};\n const unmergedComponent: UnmergedComponent = {\n // @ts-ignore\n id: { name: id.name, scope: id.scope },\n head: remoteHead,\n remote: laneId.scope, // @todo: remove. it has been deprecated around 0.0.832\n lane: laneId.name, // @todo: remove. it has been deprecated around 0.0.832\n laneId,\n };\n id = currentComponent ? currentComponent.id : id;\n\n const modelComponent = await consumer.scope.getModelComponent(id);\n const handleResolveUnrelated = () => {\n if (!currentComponent) throw new Error('currentComponent must be defined when resolvedUnrelated');\n if (!localLane) throw new Error('localLane must be defined when resolvedUnrelated');\n if (!resolvedUnrelated?.head) throw new Error('resolvedUnrelated must have head prop');\n localLane.addComponent({ id, head: resolvedUnrelated.head });\n const head = modelComponent.getRef(currentComponent.id.version as string);\n if (!head) throw new Error(`unable to get the head for resolved-unrelated ${id.toString()}`);\n unmergedComponent.laneId = localLane.toLaneId();\n unmergedComponent.head = head;\n unmergedComponent.unrelated = true;\n consumer.scope.objects.unmergedComponents.addEntry(unmergedComponent);\n return { id, filesStatus };\n };\n\n const markAllFilesAsUnchanged = () => {\n if (!currentComponent) throw new Error(`applyVersion expect to get currentComponent for ${id.toString()}`);\n currentComponent.files.forEach((file) => {\n filesStatus[pathNormalizeToLinux(file.relative)] = FileStatus.unchanged;\n });\n };\n if (mergeResults && mergeResults.hasConflicts && mergeStrategy === MergeOptions.ours) {\n markAllFilesAsUnchanged();\n consumer.scope.objects.unmergedComponents.addEntry(unmergedComponent);\n return { id, filesStatus };\n }\n if (resolvedUnrelated?.strategy === 'ours') {\n markAllFilesAsUnchanged();\n return handleResolveUnrelated();\n }\n const remoteId = id.changeVersion(remoteHead.toString());\n const idToLoad = !mergeResults || mergeStrategy === MergeOptions.theirs ? remoteId : id;\n const componentWithDependencies = await consumer.loadComponentWithDependenciesFromModel(idToLoad);\n const files = componentWithDependencies.component.files;\n files.forEach((file) => {\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n filesStatus[pathNormalizeToLinux(file.relative)] = FileStatus.updated;\n });\n\n if (mergeResults) {\n // update files according to the merge results\n const { filesStatus: modifiedStatus, modifiedFiles } = applyModifiedVersion(files, mergeResults, mergeStrategy);\n componentWithDependencies.component.files = modifiedFiles;\n filesStatus = { ...filesStatus, ...modifiedStatus };\n }\n\n const manyComponentsWriter = new ManyComponentsWriter({\n consumer,\n componentsWithDependencies: [componentWithDependencies],\n installNpmPackages: false,\n override: true,\n writeConfig: false, // @todo: should write if config exists before, needs to figure out how to do it.\n verbose: false, // @todo: do we need a flag here?\n });\n await manyComponentsWriter.writeAll();\n\n if (configMergeResult) {\n if (!componentWithDependencies.component.writtenPath) {\n throw new Error(`componentWithDependencies.component.writtenPath is missing for ${id.toString()}`);\n }\n const configMergeConflictFile = configMergeResult.generateMergeConflictFile();\n if (configMergeConflictFile) {\n const configMergePath = path.join(\n consumer.getPath(),\n componentWithDependencies.component.writtenPath,\n MergeConfigFilename\n );\n await fs.outputFile(configMergePath, configMergeConflictFile);\n }\n const successfullyMergedConfig = configMergeResult.getSuccessfullyMergedConfig();\n if (successfullyMergedConfig) {\n unmergedComponent.mergedConfig = successfullyMergedConfig;\n // no need to `unmergedComponents.addEntry` here. it'll be added in the next lines inside `if (mergeResults)`.\n // because if `configMergeResult` is set, `mergeResults` must be set as well. both happen on diverge.\n }\n }\n\n // if mergeResults, the head snap is going to be updated on a later phase when snapping with two parents\n // otherwise, update the head of the current lane or main\n if (mergeResults) {\n if (mergeResults.hasConflicts && mergeStrategy === MergeOptions.manual) {\n unmergedComponent.unmergedPaths = mergeResults.modifiedFiles.filter((f) => f.conflict).map((f) => f.filePath);\n }\n consumer.scope.objects.unmergedComponents.addEntry(unmergedComponent);\n } else if (localLane) {\n if (resolvedUnrelated) {\n // must be \"theirs\"\n return handleResolveUnrelated();\n }\n localLane.addComponent({ id, head: remoteHead });\n } else {\n // this is main\n modelComponent.setHead(remoteHead);\n // mark it as local, otherwise, when importing this component from a remote, it'll override it.\n modelComponent.markVersionAsLocal(remoteHead.toString());\n consumer.scope.objects.add(modelComponent);\n }\n\n return { id, filesStatus };\n }\n\n private async abortMerge(values: string[]): Promise<ApplyVersionResults> {\n const consumer = this.workspace.consumer;\n const ids = await this.getIdsForUnmerged(values);\n const results = await this.checkout.checkout({ ids, reset: true });\n ids.forEach((id) => consumer.scope.objects.unmergedComponents.removeComponent(id.fullName));\n await consumer.scope.objects.unmergedComponents.write();\n return { abortedComponents: results.components };\n }\n\n private async resolveMerge(values: string[], snapMessage: string, build: boolean): Promise<ApplyVersionResults> {\n const ids = await this.getIdsForUnmerged(values);\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n const { snappedComponents } = await this.snapping.snap({\n legacyBitIds: BitIds.fromArray(ids.map((id) => id._legacy)),\n build,\n message: snapMessage,\n });\n return { resolvedComponents: snappedComponents };\n }\n\n private async getAllComponentsStatus(\n bitIds: BitId[],\n laneId: LaneId,\n localLaneObject: Lane | null\n ): Promise<ComponentMergeStatus[]> {\n const ids = await Promise.all(\n bitIds.map(async (bitId) => {\n const remoteScopeName = laneId.isDefault() ? bitId.scope : laneId.scope;\n const remoteLaneId = LaneId.from(laneId.name, remoteScopeName as string);\n const remoteHead = await this.consumer.scope.objects.remoteLanes.getRef(remoteLaneId, bitId);\n const laneIdStr = remoteLaneId.toString();\n if (!remoteHead) {\n throw new BitError(`unable to find a remote head of \"${bitId.toStringWithoutVersion()}\" in \"${laneIdStr}\"`);\n }\n return bitId.changeVersion(remoteHead.toString());\n })\n );\n\n return this.getMergeStatus(ids, localLaneObject, localLaneObject);\n }\n\n private async snapResolvedComponents(\n consumer: Consumer,\n snapMessage: string,\n build: boolean\n ): Promise<null | { snappedComponents: ConsumerComponent[]; autoSnappedResults: AutoTagResult[] }> {\n const unmergedComponents = consumer.scope.objects.unmergedComponents.getComponents();\n this.logger.debug(`merge-snaps, snapResolvedComponents, total ${unmergedComponents.length.toString()} components`);\n if (!unmergedComponents.length) return null;\n const ids = BitIds.fromArray(unmergedComponents.map((r) => new BitId(r.id)));\n return this.snapping.snap({\n legacyBitIds: ids,\n build,\n message: snapMessage,\n });\n }\n\n private async tagAllLaneComponent(idsToTag: BitId[], tagMessage: string, build: boolean): Promise<TagResults | null> {\n const ids = idsToTag.map((id) => {\n return id.toStringWithoutVersion();\n });\n this.logger.debug(`merge-snaps, tagResolvedComponents, total ${idsToTag.length.toString()} components`);\n return this.snapping.tag({\n ids,\n build,\n message: tagMessage,\n unmodified: true,\n });\n }\n\n private async getIdsForUnmerged(idsStr?: string[]): Promise<ComponentID[]> {\n if (idsStr && idsStr.length) {\n const componentIds = await this.workspace.resolveMultipleComponentIds(idsStr);\n componentIds.forEach((id) => {\n const entry = this.workspace.consumer.scope.objects.unmergedComponents.getEntry(id.fullName);\n if (!entry) {\n throw new GeneralError(`unable to merge-resolve ${id.toString()}, it is not marked as unresolved`);\n }\n });\n return componentIds;\n }\n const unresolvedComponents = this.workspace.consumer.scope.objects.unmergedComponents.getComponents();\n if (!unresolvedComponents.length) throw new GeneralError(`all components are resolved already, nothing to do`);\n return unresolvedComponents.map((u) => ComponentID.fromLegacy(new BitId(u.id)));\n }\n\n private getComponentsToMerge(consumer: Consumer, ids: string[]): BitId[] {\n if (hasWildcard(ids)) {\n const componentsList = new ComponentsList(consumer);\n return componentsList.listComponentsByIdsWithWildcard(ids);\n }\n return ids.map((id) => consumer.getParsedId(id));\n }\n\n static slots = [];\n static dependencies = [CLIAspect, WorkspaceAspect, SnappingAspect, CheckoutAspect, InstallAspect, LoggerAspect];\n static runtime = MainRuntime;\n static async provider([cli, workspace, snapping, checkout, install, loggerMain]: [\n CLIMain,\n Workspace,\n SnappingMain,\n CheckoutMain,\n InstallMain,\n LoggerMain\n ]) {\n const logger = loggerMain.createLogger(MergingAspect.id);\n const merging = new MergingMain(workspace, install, snapping, checkout, logger);\n cli.register(new MergeCmd(merging));\n return merging;\n }\n}\n\nMergingAspect.addRuntime(MergingMain);\n"],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,CAACzT,WAAW,CAAC"}
1
+ {"version":3,"names":["MergingMain","constructor","workspace","install","snapping","checkout","logger","consumer","merge","values","mergeStrategy","abort","resolve","noSnap","message","build","skipDependencyInstallation","OutsideWorkspaceError","mergeResults","firstValue","R","head","resolveMerge","abortMerge","BitId","isValidVersion","bitIds","getComponentsToMerge","mergeComponentsFromRemote","version","ids","tail","mergeVersion","onDestroy","snapMessage","currentLaneId","getCurrentLaneId","currentLaneObject","getCurrentLaneObject","allComponentsStatus","getAllComponentsStatus","failedComponents","filter","c","unmergedMessage","unmergedLegitimately","length","failureMsgs","map","failedComponent","chalk","bold","id","toString","red","join","BitError","mergeSnaps","laneId","localLane","tag","componentWithConflict","find","component","hasConflicts","getMergeStrategyInteractive","componentStatus","failureMessage","unchangedLegitimately","succeededComponents","componentsResults","mapSeries","currentComponent","resolvedUnrelated","configMergeResult","modelComponent","scope","getModelComponent","updatedLaneId","isDefault","LaneId","from","name","applyVersion","remoteHead","getRef","objects","add","persist","unmergedComponents","write","writeBitMap","componentsHasConfigMergeConflicts","some","leftUnresolvedConflicts","undefined","dedupe","updateExisting","import","err","error","consoleError","getSnapOrTagResults","idsToTag","results","tagAllLaneComponent","taggedComponents","autoTaggedResults","snappedComponents","autoSnappedResults","snapResolvedComponents","mergeSnapResults","mergeSnapError","components","getMergeStatus","currentLane","otherLane","options","componentStatusBeforeMergeAttempt","Promise","all","getComponentStatusBeforeMergeAttempt","toImport","compStatus","divergeData","commonSnapBeforeDiverge","changeVersion","flat","scopeImporter","importManyIfMissingWithoutDeps","BitIds","fromArray","lane","compStatusNotNeedMerge","mergeProps","compStatusNeedMerge","getComponentsStatusNeedMerge","tmp","Tmp","componentsStatus","getComponentMergeStatus","clear","push","returnUnmerged","msg","getModelComponentIfExist","unmerged","getEntry","toStringWithoutVersion","repo","otherLaneHead","existingBitMapId","bitMap","getBitIdIfExist","ignoreVersion","componentOnOther","loadVersion","isRemoved","getCurrentId","idOnLane","getComponent","getHeadAsTagIfExist","currentId","getDivergeData","targetHead","throws","componentFromModel","getCurrentComponent","loadComponent","getConsumerComponent","removed","isModified","componentModificationStatus","getComponentStatusById","modified","baseComponent","ignoreConfigChanges","isComponentSourceCodeModified","isComponentModified","Error","mainHead","NoCommonSnap","resolveUnrelated","hasResolvedFromMain","hashToCompare","divergeDataFromMain","sourceHead","hasResolvedLocally","getHeadRegardlessOfLane","hasResolvedRemotely","versionToSaveInLane","resolvedRef","strategy","isDiverged","isSourceAhead","isTargetAhead","componentMergeStatusBeforeMergeAttempt","baseSnap","otherComponent","currentLaneName","toLaneId","otherLaneName","DEFAULT_LANE","currentLabel","otherLabel","workspaceIds","listIds","configMerger","ConfigMerger","extensions","threeWayMerge","filesStatus","unmergedComponent","remote","handleResolveUnrelated","addComponent","unrelated","addEntry","markAllFilesAsUnchanged","files","forEach","file","pathNormalizeToLinux","relative","FileStatus","unchanged","MergeOptions","ours","remoteId","idToLoad","theirs","componentWithDependencies","loadComponentWithDependenciesFromModel","updated","modifiedStatus","modifiedFiles","applyModifiedVersion","manyComponentsWriter","ManyComponentsWriter","componentsWithDependencies","installNpmPackages","override","writeConfig","verbose","writeAll","writtenPath","configMergeConflictFile","generateMergeConflictFile","configMergePath","path","getPath","MergeConfigFilename","fs","outputFile","successfullyMergedConfig","getSuccessfullyMergedConfig","mergedConfig","manual","unmergedPaths","f","conflict","filePath","setHead","markVersionAsLocal","getIdsForUnmerged","reset","removeComponent","fullName","abortedComponents","snap","legacyBitIds","_legacy","resolvedComponents","localLaneObject","bitId","remoteScopeName","remoteLaneId","remoteLanes","laneIdStr","getComponents","debug","r","tagMessage","unmodified","idsStr","componentIds","resolveMultipleComponentIds","entry","GeneralError","unresolvedComponents","u","ComponentID","fromLegacy","hasWildcard","componentsList","ComponentsList","listComponentsByIdsWithWildcard","getParsedId","provider","cli","loggerMain","createLogger","MergingAspect","merging","register","MergeCmd","CLIAspect","WorkspaceAspect","SnappingAspect","CheckoutAspect","InstallAspect","LoggerAspect","MainRuntime","addRuntime"],"sources":["merging.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport path from 'path';\nimport fs from 'fs-extra';\nimport WorkspaceAspect, { OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport R from 'ramda';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport ComponentsList from '@teambit/legacy/dist/consumer/component/components-list';\nimport {\n ApplyVersionResults,\n MergeStrategy,\n mergeVersion,\n ApplyVersionResult,\n FailedComponents,\n FileStatus,\n getMergeStrategyInteractive,\n MergeOptions,\n} from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport SnappingAspect, { SnappingMain, TagResults } from '@teambit/snapping';\nimport hasWildcard from '@teambit/legacy/dist/utils/string/has-wildcard';\nimport mapSeries from 'p-map-series';\nimport { BitId, BitIds } from '@teambit/legacy/dist/bit-id';\nimport { BitError } from '@teambit/bit-error';\nimport GeneralError from '@teambit/legacy/dist/error/general-error';\nimport { DEFAULT_LANE, LaneId } from '@teambit/lane-id';\nimport { AutoTagResult } from '@teambit/legacy/dist/scope/component-ops/auto-tag';\nimport { getDivergeData } from '@teambit/legacy/dist/scope/component-ops/get-diverge-data';\nimport { UnmergedComponent } from '@teambit/legacy/dist/scope/lanes/unmerged-components';\nimport { Lane, ModelComponent, Version } from '@teambit/legacy/dist/scope/models';\nimport { Ref } from '@teambit/legacy/dist/scope/objects';\nimport chalk from 'chalk';\nimport { Tmp } from '@teambit/legacy/dist/scope/repositories';\nimport { pathNormalizeToLinux } from '@teambit/legacy/dist/utils';\nimport ManyComponentsWriter from '@teambit/legacy/dist/consumer/component-ops/many-components-writer';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component/consumer-component';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { applyModifiedVersion } from '@teambit/legacy/dist/consumer/versions-ops/checkout-version';\nimport threeWayMerge, {\n MergeResultsThreeWay,\n} from '@teambit/legacy/dist/consumer/versions-ops/merge-version/three-way-merge';\nimport { NoCommonSnap } from '@teambit/legacy/dist/scope/exceptions/no-common-snap';\nimport { CheckoutAspect, CheckoutMain } from '@teambit/checkout';\nimport { ComponentID } from '@teambit/component-id';\nimport { MergeConfigFilename } from '@teambit/legacy/dist/constants';\nimport { SnapsDistance } from '@teambit/legacy/dist/scope/component-ops/snaps-distance';\nimport { InstallMain, InstallAspect } from '@teambit/install';\nimport { MergeCmd } from './merge-cmd';\nimport { MergingAspect } from './merging.aspect';\nimport { ConfigMerger } from './config-merger';\nimport { ConfigMergeResult } from './config-merge-result';\n\ntype ResolveUnrelatedData = { strategy: MergeStrategy; head: Ref };\n\nexport type ComponentMergeStatus = {\n currentComponent?: ConsumerComponent | null;\n componentFromModel?: Version;\n id: BitId;\n unmergedMessage?: string;\n unmergedLegitimately?: boolean; // failed to merge but for a legitimate reason, such as, up-to-date\n mergeResults?: MergeResultsThreeWay | null;\n divergeData?: SnapsDistance;\n resolvedUnrelated?: ResolveUnrelatedData;\n configMergeResult?: ConfigMergeResult;\n};\n\nexport type ComponentMergeStatusBeforeMergeAttempt = {\n currentComponent?: ConsumerComponent | null;\n componentFromModel?: Version;\n id: BitId;\n unmergedMessage?: string;\n unmergedLegitimately?: boolean; // failed to merge but for a legitimate reason, such as, up-to-date\n divergeData?: SnapsDistance;\n resolvedUnrelated?: ResolveUnrelatedData;\n mergeProps?: {\n otherLaneHead: Ref;\n currentId: BitId;\n modelComponent: ModelComponent;\n };\n};\n\nexport class MergingMain {\n private consumer: Consumer;\n constructor(\n private workspace: Workspace,\n private install: InstallMain,\n private snapping: SnappingMain,\n private checkout: CheckoutMain,\n private logger: Logger\n ) {\n this.consumer = this.workspace?.consumer;\n }\n\n /**\n * merge components according to the \"values\" param.\n * if the first param is a version, then merge the component ids to that version.\n * otherwise, merge from the remote head to the local.\n */\n async merge(\n values: string[],\n mergeStrategy: MergeStrategy,\n abort: boolean,\n resolve: boolean,\n noSnap: boolean,\n message: string,\n build: boolean,\n skipDependencyInstallation: boolean\n ): Promise<ApplyVersionResults> {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const consumer: Consumer = this.workspace.consumer;\n let mergeResults;\n const firstValue = R.head(values);\n if (resolve) {\n mergeResults = await this.resolveMerge(values, message, build);\n } else if (abort) {\n mergeResults = await this.abortMerge(values);\n } else if (!BitId.isValidVersion(firstValue)) {\n const bitIds = this.getComponentsToMerge(consumer, values);\n // @todo: version could be the lane only or remote/lane\n mergeResults = await this.mergeComponentsFromRemote(\n consumer,\n bitIds,\n mergeStrategy,\n noSnap,\n message,\n build,\n skipDependencyInstallation\n );\n } else {\n const version = firstValue;\n const ids = R.tail(values);\n const bitIds = this.getComponentsToMerge(consumer, ids);\n mergeResults = await mergeVersion(consumer, version, bitIds, mergeStrategy);\n }\n await consumer.onDestroy();\n return mergeResults;\n }\n\n /**\n * when user is on main, it merges the remote main components into local.\n * when user is on a lane, it merges the remote lane components into the local lane.\n */\n async mergeComponentsFromRemote(\n consumer: Consumer,\n bitIds: BitId[],\n mergeStrategy: MergeStrategy,\n noSnap: boolean,\n snapMessage: string,\n build: boolean,\n skipDependencyInstallation: boolean\n ): Promise<ApplyVersionResults> {\n const currentLaneId = consumer.getCurrentLaneId();\n const currentLaneObject = await consumer.getCurrentLaneObject();\n const allComponentsStatus = await this.getAllComponentsStatus(bitIds, currentLaneId, currentLaneObject);\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 return this.mergeSnaps({\n mergeStrategy,\n allComponentsStatus,\n laneId: currentLaneId,\n localLane: currentLaneObject,\n noSnap,\n snapMessage,\n build,\n skipDependencyInstallation,\n });\n }\n\n /**\n * merge multiple components according to the \"allComponentsStatus\".\n */\n async mergeSnaps({\n mergeStrategy,\n allComponentsStatus,\n laneId,\n localLane,\n noSnap,\n tag,\n snapMessage,\n build,\n skipDependencyInstallation,\n }: {\n mergeStrategy: MergeStrategy;\n allComponentsStatus: ComponentMergeStatus[];\n laneId: LaneId;\n localLane: Lane | null;\n noSnap: boolean;\n tag?: boolean;\n snapMessage: string;\n build: boolean;\n skipDependencyInstallation?: boolean;\n }): Promise<ApplyVersionResults> {\n const consumer = this.workspace.consumer;\n const componentWithConflict = allComponentsStatus.find(\n (component) => component.mergeResults && component.mergeResults.hasConflicts\n );\n if (componentWithConflict && !mergeStrategy) {\n mergeStrategy = await getMergeStrategyInteractive();\n }\n const failedComponents: FailedComponents[] = allComponentsStatus\n .filter((componentStatus) => componentStatus.unmergedMessage)\n .map((componentStatus) => ({\n id: componentStatus.id,\n failureMessage: componentStatus.unmergedMessage as string,\n unchangedLegitimately: componentStatus.unmergedLegitimately,\n }));\n const succeededComponents = allComponentsStatus.filter((componentStatus) => !componentStatus.unmergedMessage);\n // do not use Promise.all for applyVersion. otherwise, it'll write all components in parallel,\n // which can be an issue when some components are also dependencies of others\n const componentsResults = await mapSeries(\n succeededComponents,\n async ({ currentComponent, id, mergeResults, resolvedUnrelated, configMergeResult }) => {\n const modelComponent = await consumer.scope.getModelComponent(id);\n const updatedLaneId = laneId.isDefault() ? LaneId.from(laneId.name, id.scope as string) : laneId;\n return this.applyVersion({\n currentComponent,\n id,\n mergeResults,\n mergeStrategy,\n remoteHead: modelComponent.getRef(id.version as string) as Ref,\n laneId: updatedLaneId,\n localLane,\n resolvedUnrelated,\n configMergeResult,\n });\n }\n );\n\n if (localLane) consumer.scope.objects.add(localLane);\n\n await consumer.scope.objects.persist(); // persist anyway, if localLane is null it should save all main heads\n\n await consumer.scope.objects.unmergedComponents.write();\n\n await consumer.writeBitMap();\n\n const componentsHasConfigMergeConflicts = allComponentsStatus.some((c) => c.configMergeResult?.hasConflicts());\n const leftUnresolvedConflicts = componentWithConflict && mergeStrategy === 'manual';\n if (!skipDependencyInstallation && !leftUnresolvedConflicts && !componentsHasConfigMergeConflicts) {\n try {\n await this.install.install(undefined, {\n dedupe: true,\n updateExisting: false,\n import: false,\n });\n } catch (err: any) {\n this.logger.error(`failed installing packages`, err);\n this.logger.consoleError(`failed installing packages, see the log for full stacktrace. error: ${err.message}`);\n }\n }\n\n const getSnapOrTagResults = async () => {\n // if one of the component has conflict, don't snap-merge. otherwise, some of the components would be snap-merged\n // and some not. besides the fact that it could by mistake tag dependent, it's a confusing state. better not snap.\n if (noSnap || leftUnresolvedConflicts || componentsHasConfigMergeConflicts) {\n return null;\n }\n if (tag) {\n const idsToTag = allComponentsStatus.map((c) => c.id);\n const results = await this.tagAllLaneComponent(idsToTag, snapMessage, build);\n if (!results) return null;\n const { taggedComponents, autoTaggedResults } = results;\n return { snappedComponents: taggedComponents, autoSnappedResults: autoTaggedResults };\n }\n return this.snapResolvedComponents(consumer, snapMessage, build);\n };\n let mergeSnapResults: ApplyVersionResults['mergeSnapResults'] = null;\n let mergeSnapError: Error | undefined;\n try {\n mergeSnapResults = await getSnapOrTagResults();\n } catch (err: any) {\n mergeSnapError = err;\n }\n\n return {\n components: componentsResults,\n failedComponents,\n mergeSnapResults,\n mergeSnapError,\n leftUnresolvedConflicts,\n };\n }\n\n /**\n * this function gets called from two different commands:\n * 1. \"bit merge <ids...>\", when merging a component from a remote to the local.\n * in this case, the remote and local are on the same lane or both on main.\n * 2. \"bit lane merge\", when merging from one lane to another.\n */\n async getMergeStatus(\n bitIds: BitId[], // the id.version is the version we want to merge to the current component\n currentLane: Lane | null, // currently checked out lane. if on main, then it's null.\n otherLane?: Lane | null, // the lane we want to merged to our lane. (null if it's \"main\").\n options?: { resolveUnrelated?: MergeStrategy; ignoreConfigChanges?: boolean }\n ): Promise<ComponentMergeStatus[]> {\n const componentStatusBeforeMergeAttempt = await Promise.all(\n bitIds.map((id) => this.getComponentStatusBeforeMergeAttempt(id, currentLane, options))\n );\n\n const toImport = componentStatusBeforeMergeAttempt\n .map((compStatus) => {\n if (!compStatus.divergeData || !compStatus.divergeData.commonSnapBeforeDiverge) return [];\n return [compStatus.id.changeVersion(compStatus.divergeData.commonSnapBeforeDiverge.toString())];\n })\n .flat();\n\n await this.consumer.scope.scopeImporter.importManyIfMissingWithoutDeps({\n ids: BitIds.fromArray(toImport),\n lane: otherLane || undefined,\n });\n\n const compStatusNotNeedMerge = componentStatusBeforeMergeAttempt.filter(\n (c) => !c.mergeProps\n ) as ComponentMergeStatus[];\n const compStatusNeedMerge = componentStatusBeforeMergeAttempt.filter((c) => c.mergeProps);\n\n const getComponentsStatusNeedMerge = async (): Promise<ComponentMergeStatus[]> => {\n const tmp = new Tmp(this.consumer.scope);\n try {\n const componentsStatus = await Promise.all(\n compStatusNeedMerge.map((compStatus) =>\n this.getComponentMergeStatus(currentLane, otherLane || undefined, compStatus)\n )\n );\n await tmp.clear();\n return componentsStatus;\n } catch (err: any) {\n await tmp.clear();\n throw err;\n }\n };\n const results = await getComponentsStatusNeedMerge();\n\n results.push(...compStatusNotNeedMerge);\n return results;\n }\n\n private async getComponentStatusBeforeMergeAttempt(\n id: BitId, // the id.version is the version we want to merge to the current component\n localLane: Lane | null, // currently checked out lane. if on main, then it's null.\n options?: { resolveUnrelated?: MergeStrategy; ignoreConfigChanges?: boolean }\n ): Promise<ComponentMergeStatusBeforeMergeAttempt> {\n const consumer = this.workspace.consumer;\n const componentStatus: ComponentMergeStatus = { id };\n const returnUnmerged = (msg: string, unmergedLegitimately = false) => {\n componentStatus.unmergedMessage = msg;\n componentStatus.unmergedLegitimately = unmergedLegitimately;\n return componentStatus;\n };\n const modelComponent = await consumer.scope.getModelComponentIfExist(id);\n if (!modelComponent) {\n return returnUnmerged(\n `component ${id.toString()} is on the lane/main but its objects were not found, please re-import the lane`\n );\n }\n const unmerged = consumer.scope.objects.unmergedComponents.getEntry(id.name);\n if (unmerged) {\n return returnUnmerged(\n `component ${id.toStringWithoutVersion()} is in during-merge state a previous merge, please snap/tag it first (or use bit merge --resolve/--abort)`\n );\n }\n const repo = consumer.scope.objects;\n const version = id.version as string;\n const otherLaneHead = modelComponent.getRef(version);\n const existingBitMapId = consumer.bitMap.getBitIdIfExist(id, { ignoreVersion: true });\n const componentOnOther: Version = await modelComponent.loadVersion(version, consumer.scope.objects);\n if (componentOnOther.isRemoved()) {\n return returnUnmerged(`component has been removed`, true);\n }\n const getCurrentId = () => {\n if (existingBitMapId) return existingBitMapId;\n if (localLane) {\n const idOnLane = localLane.getComponent(id);\n if (!idOnLane) return null;\n return idOnLane.id.changeVersion(idOnLane.head.toString());\n }\n // it's on main\n const head = modelComponent.getHeadAsTagIfExist();\n if (head) {\n return id.changeVersion(head);\n }\n return null;\n };\n const currentId = getCurrentId();\n if (!currentId) {\n const divergeData = await getDivergeData({ repo, modelComponent, targetHead: otherLaneHead, throws: false });\n return { currentComponent: null, componentFromModel: componentOnOther, id, divergeData };\n }\n const getCurrentComponent = () => {\n if (existingBitMapId) return consumer.loadComponent(existingBitMapId);\n return consumer.scope.getConsumerComponent(currentId);\n };\n const currentComponent = await getCurrentComponent();\n if (currentComponent.removed) {\n return returnUnmerged(`component has been removed`, true);\n }\n const isModified = async () => {\n const componentModificationStatus = await consumer.getComponentStatusById(currentComponent.id);\n if (!componentModificationStatus.modified) return false;\n if (!existingBitMapId) return false;\n const baseComponent = await modelComponent.loadVersion(\n existingBitMapId.version as string,\n consumer.scope.objects\n );\n return options?.ignoreConfigChanges\n ? consumer.isComponentSourceCodeModified(baseComponent, currentComponent)\n : true;\n };\n\n const isComponentModified = await isModified();\n\n if (isComponentModified) {\n return returnUnmerged(`component is modified, please snap/tag it first`);\n }\n if (!otherLaneHead) {\n throw new Error(`merging: unable finding a hash for the version ${version} of ${id.toString()}`);\n }\n const divergeData = await getDivergeData({\n repo,\n modelComponent,\n targetHead: otherLaneHead,\n throws: false,\n });\n if (divergeData.err) {\n const mainHead = modelComponent.head;\n if (divergeData.err instanceof NoCommonSnap && options?.resolveUnrelated && mainHead) {\n const hasResolvedFromMain = async (hashToCompare: Ref | null) => {\n const divergeDataFromMain = await getDivergeData({\n repo,\n modelComponent,\n sourceHead: hashToCompare,\n targetHead: mainHead,\n throws: false,\n });\n if (!divergeDataFromMain.err) return true;\n return !(divergeDataFromMain.err instanceof NoCommonSnap);\n };\n const hasResolvedLocally = await hasResolvedFromMain(modelComponent.getHeadRegardlessOfLane() as Ref);\n const hasResolvedRemotely = await hasResolvedFromMain(otherLaneHead);\n if (!hasResolvedLocally && !hasResolvedRemotely) {\n return returnUnmerged(\n `unable to traverse ${currentComponent.id.toString()} history. the main-head ${mainHead.toString()} doesn't appear in both lanes, it was probably created in each lane separately`\n );\n }\n const versionToSaveInLane = hasResolvedLocally ? currentComponent.id.version : id.version;\n const resolvedRef = modelComponent.getRef(versionToSaveInLane as string);\n if (!resolvedRef) throw new Error(`unable to get ref of \"${versionToSaveInLane}\" for \"${id.toString()}\"`);\n if (options?.resolveUnrelated === 'theirs') {\n // just override with the model data\n return {\n currentComponent,\n componentFromModel: componentOnOther,\n id,\n divergeData,\n resolvedUnrelated: { strategy: 'theirs', head: resolvedRef },\n };\n }\n if (options?.resolveUnrelated === 'ours') {\n return {\n currentComponent,\n id,\n divergeData,\n resolvedUnrelated: { strategy: 'ours', head: resolvedRef },\n };\n }\n throw new Error(\n `unsupported strategy \"${options?.resolveUnrelated}\" of resolve-unrelated. supported strategies are: [ours, theirs]`\n );\n }\n return returnUnmerged(\n `unable to traverse ${currentComponent.id.toString()} history. error: ${divergeData.err.message}`\n );\n }\n if (!divergeData.isDiverged()) {\n if (divergeData.isSourceAhead()) {\n // do nothing!\n return returnUnmerged(`component ${currentComponent.id.toString()} is ahead, nothing to merge`, true);\n }\n if (divergeData.isTargetAhead()) {\n // just override with the model data\n return {\n currentComponent,\n componentFromModel: componentOnOther,\n id,\n divergeData,\n };\n }\n // we know that localHead and remoteHead are set, so if none of them is ahead they must be equal\n return returnUnmerged(`component ${currentComponent.id.toString()} is already merged`, true);\n }\n\n // it's diverged and needs merge operation\n const mergeProps = {\n otherLaneHead,\n currentId,\n modelComponent,\n };\n return { currentComponent, id, divergeData, mergeProps };\n }\n\n private async getComponentMergeStatus(\n localLane: Lane | null, // currently checked out lane. if on main, then it's null.\n otherLane: Lane | undefined, // the lane name we want to merged to our lane. (can be also \"main\").\n componentMergeStatusBeforeMergeAttempt: ComponentMergeStatusBeforeMergeAttempt\n ) {\n const { id, divergeData, currentComponent, mergeProps } = componentMergeStatusBeforeMergeAttempt;\n if (!mergeProps) throw new Error(`getDivergedMergeStatus, mergeProps is missing for ${id.toString()}`);\n const { otherLaneHead, currentId, modelComponent } = mergeProps;\n const consumer = this.workspace.consumer;\n const repo = consumer.scope.objects;\n if (!divergeData) throw new Error(`getDivergedMergeStatus, divergeData is missing for ${id.toString()}`);\n if (!currentComponent) throw new Error(`getDivergedMergeStatus, currentComponent is missing for ${id.toString()}`);\n\n const baseSnap = divergeData.commonSnapBeforeDiverge as Ref; // must be set when isTrueMerge\n // uncomment for debugging\n // console.log('id', id.toStringWithoutVersion(), 'baseSnap', baseSnap.toString(), 'current', currentId.version, 'other', otherLaneHead.toString());\n const baseComponent: Version = await modelComponent.loadVersion(baseSnap.toString(), repo);\n const otherComponent: Version = await modelComponent.loadVersion(otherLaneHead.toString(), repo);\n\n const currentLaneName = localLane?.toLaneId().toString() || 'main';\n const otherLaneName = otherLane ? otherLane.toLaneId().toString() : DEFAULT_LANE;\n const currentLabel = `${currentId.version} (${currentLaneName === otherLaneName ? 'current' : currentLaneName})`;\n const otherLabel = `${otherLaneHead.toString()} (${\n otherLaneName === currentLaneName ? 'incoming' : otherLaneName\n })`;\n const workspaceIds = await this.workspace.listIds();\n const configMerger = new ConfigMerger(\n id.toStringWithoutVersion(),\n workspaceIds,\n otherLane,\n currentComponent.extensions,\n baseComponent.extensions,\n otherComponent.extensions,\n currentLabel,\n otherLabel\n );\n const configMergeResult = configMerger.merge();\n\n const mergeResults = await threeWayMerge({\n consumer,\n otherComponent,\n otherLabel,\n currentComponent,\n currentLabel,\n baseComponent,\n });\n return { currentComponent, id, mergeResults, divergeData, configMergeResult };\n }\n\n private async applyVersion({\n currentComponent,\n id,\n mergeResults,\n mergeStrategy,\n remoteHead,\n laneId,\n localLane,\n resolvedUnrelated,\n configMergeResult,\n }: {\n currentComponent: ConsumerComponent | null | undefined;\n id: BitId;\n mergeResults: MergeResultsThreeWay | null | undefined;\n mergeStrategy: MergeStrategy;\n remoteHead: Ref;\n laneId: LaneId;\n localLane: Lane | null;\n resolvedUnrelated?: ResolveUnrelatedData;\n configMergeResult?: ConfigMergeResult;\n }): Promise<ApplyVersionResult> {\n const consumer = this.workspace.consumer;\n let filesStatus = {};\n const unmergedComponent: UnmergedComponent = {\n // @ts-ignore\n id: { name: id.name, scope: id.scope },\n head: remoteHead,\n remote: laneId.scope, // @todo: remove. it has been deprecated around 0.0.832\n lane: laneId.name, // @todo: remove. it has been deprecated around 0.0.832\n laneId,\n };\n id = currentComponent ? currentComponent.id : id;\n\n const modelComponent = await consumer.scope.getModelComponent(id);\n const handleResolveUnrelated = () => {\n if (!currentComponent) throw new Error('currentComponent must be defined when resolvedUnrelated');\n if (!localLane) throw new Error('localLane must be defined when resolvedUnrelated');\n if (!resolvedUnrelated?.head) throw new Error('resolvedUnrelated must have head prop');\n localLane.addComponent({ id, head: resolvedUnrelated.head });\n const head = modelComponent.getRef(currentComponent.id.version as string);\n if (!head) throw new Error(`unable to get the head for resolved-unrelated ${id.toString()}`);\n unmergedComponent.laneId = localLane.toLaneId();\n unmergedComponent.head = head;\n unmergedComponent.unrelated = true;\n consumer.scope.objects.unmergedComponents.addEntry(unmergedComponent);\n return { id, filesStatus };\n };\n\n const markAllFilesAsUnchanged = () => {\n if (!currentComponent) throw new Error(`applyVersion expect to get currentComponent for ${id.toString()}`);\n currentComponent.files.forEach((file) => {\n filesStatus[pathNormalizeToLinux(file.relative)] = FileStatus.unchanged;\n });\n };\n if (mergeResults && mergeResults.hasConflicts && mergeStrategy === MergeOptions.ours) {\n markAllFilesAsUnchanged();\n consumer.scope.objects.unmergedComponents.addEntry(unmergedComponent);\n return { id, filesStatus };\n }\n if (resolvedUnrelated?.strategy === 'ours') {\n markAllFilesAsUnchanged();\n return handleResolveUnrelated();\n }\n const remoteId = id.changeVersion(remoteHead.toString());\n const idToLoad = !mergeResults || mergeStrategy === MergeOptions.theirs ? remoteId : id;\n const componentWithDependencies = await consumer.loadComponentWithDependenciesFromModel(idToLoad);\n const files = componentWithDependencies.component.files;\n files.forEach((file) => {\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n filesStatus[pathNormalizeToLinux(file.relative)] = FileStatus.updated;\n });\n\n if (mergeResults) {\n // update files according to the merge results\n const { filesStatus: modifiedStatus, modifiedFiles } = applyModifiedVersion(files, mergeResults, mergeStrategy);\n componentWithDependencies.component.files = modifiedFiles;\n filesStatus = { ...filesStatus, ...modifiedStatus };\n }\n\n const manyComponentsWriter = new ManyComponentsWriter({\n consumer,\n componentsWithDependencies: [componentWithDependencies],\n installNpmPackages: false,\n override: true,\n writeConfig: false, // @todo: should write if config exists before, needs to figure out how to do it.\n verbose: false, // @todo: do we need a flag here?\n });\n await manyComponentsWriter.writeAll();\n\n if (configMergeResult) {\n if (!componentWithDependencies.component.writtenPath) {\n throw new Error(`componentWithDependencies.component.writtenPath is missing for ${id.toString()}`);\n }\n const configMergeConflictFile = configMergeResult.generateMergeConflictFile();\n if (configMergeConflictFile) {\n const configMergePath = path.join(\n consumer.getPath(),\n componentWithDependencies.component.writtenPath,\n MergeConfigFilename\n );\n await fs.outputFile(configMergePath, configMergeConflictFile);\n }\n const successfullyMergedConfig = configMergeResult.getSuccessfullyMergedConfig();\n if (successfullyMergedConfig) {\n unmergedComponent.mergedConfig = successfullyMergedConfig;\n // no need to `unmergedComponents.addEntry` here. it'll be added in the next lines inside `if (mergeResults)`.\n // because if `configMergeResult` is set, `mergeResults` must be set as well. both happen on diverge.\n }\n }\n\n // if mergeResults, the head snap is going to be updated on a later phase when snapping with two parents\n // otherwise, update the head of the current lane or main\n if (mergeResults) {\n if (mergeResults.hasConflicts && mergeStrategy === MergeOptions.manual) {\n unmergedComponent.unmergedPaths = mergeResults.modifiedFiles.filter((f) => f.conflict).map((f) => f.filePath);\n }\n consumer.scope.objects.unmergedComponents.addEntry(unmergedComponent);\n } else if (localLane) {\n if (resolvedUnrelated) {\n // must be \"theirs\"\n return handleResolveUnrelated();\n }\n localLane.addComponent({ id, head: remoteHead });\n } else {\n // this is main\n modelComponent.setHead(remoteHead);\n // mark it as local, otherwise, when importing this component from a remote, it'll override it.\n modelComponent.markVersionAsLocal(remoteHead.toString());\n consumer.scope.objects.add(modelComponent);\n }\n\n return { id, filesStatus };\n }\n\n private async abortMerge(values: string[]): Promise<ApplyVersionResults> {\n const consumer = this.workspace.consumer;\n const ids = await this.getIdsForUnmerged(values);\n const results = await this.checkout.checkout({ ids, reset: true });\n ids.forEach((id) => consumer.scope.objects.unmergedComponents.removeComponent(id.fullName));\n await consumer.scope.objects.unmergedComponents.write();\n return { abortedComponents: results.components };\n }\n\n private async resolveMerge(values: string[], snapMessage: string, build: boolean): Promise<ApplyVersionResults> {\n const ids = await this.getIdsForUnmerged(values);\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n const { snappedComponents } = await this.snapping.snap({\n legacyBitIds: BitIds.fromArray(ids.map((id) => id._legacy)),\n build,\n message: snapMessage,\n });\n return { resolvedComponents: snappedComponents };\n }\n\n private async getAllComponentsStatus(\n bitIds: BitId[],\n laneId: LaneId,\n localLaneObject: Lane | null\n ): Promise<ComponentMergeStatus[]> {\n const ids = await Promise.all(\n bitIds.map(async (bitId) => {\n const remoteScopeName = laneId.isDefault() ? bitId.scope : laneId.scope;\n const remoteLaneId = LaneId.from(laneId.name, remoteScopeName as string);\n const remoteHead = await this.consumer.scope.objects.remoteLanes.getRef(remoteLaneId, bitId);\n const laneIdStr = remoteLaneId.toString();\n if (!remoteHead) {\n throw new BitError(`unable to find a remote head of \"${bitId.toStringWithoutVersion()}\" in \"${laneIdStr}\"`);\n }\n return bitId.changeVersion(remoteHead.toString());\n })\n );\n\n return this.getMergeStatus(ids, localLaneObject, localLaneObject);\n }\n\n private async snapResolvedComponents(\n consumer: Consumer,\n snapMessage: string,\n build: boolean\n ): Promise<null | { snappedComponents: ConsumerComponent[]; autoSnappedResults: AutoTagResult[] }> {\n const unmergedComponents = consumer.scope.objects.unmergedComponents.getComponents();\n this.logger.debug(`merge-snaps, snapResolvedComponents, total ${unmergedComponents.length.toString()} components`);\n if (!unmergedComponents.length) return null;\n const ids = BitIds.fromArray(unmergedComponents.map((r) => new BitId(r.id)));\n return this.snapping.snap({\n legacyBitIds: ids,\n build,\n message: snapMessage,\n });\n }\n\n private async tagAllLaneComponent(idsToTag: BitId[], tagMessage: string, build: boolean): Promise<TagResults | null> {\n const ids = idsToTag.map((id) => {\n return id.toStringWithoutVersion();\n });\n this.logger.debug(`merge-snaps, tagResolvedComponents, total ${idsToTag.length.toString()} components`);\n return this.snapping.tag({\n ids,\n build,\n message: tagMessage,\n unmodified: true,\n });\n }\n\n private async getIdsForUnmerged(idsStr?: string[]): Promise<ComponentID[]> {\n if (idsStr && idsStr.length) {\n const componentIds = await this.workspace.resolveMultipleComponentIds(idsStr);\n componentIds.forEach((id) => {\n const entry = this.workspace.consumer.scope.objects.unmergedComponents.getEntry(id.fullName);\n if (!entry) {\n throw new GeneralError(`unable to merge-resolve ${id.toString()}, it is not marked as unresolved`);\n }\n });\n return componentIds;\n }\n const unresolvedComponents = this.workspace.consumer.scope.objects.unmergedComponents.getComponents();\n if (!unresolvedComponents.length) throw new GeneralError(`all components are resolved already, nothing to do`);\n return unresolvedComponents.map((u) => ComponentID.fromLegacy(new BitId(u.id)));\n }\n\n private getComponentsToMerge(consumer: Consumer, ids: string[]): BitId[] {\n if (hasWildcard(ids)) {\n const componentsList = new ComponentsList(consumer);\n return componentsList.listComponentsByIdsWithWildcard(ids);\n }\n return ids.map((id) => consumer.getParsedId(id));\n }\n\n static slots = [];\n static dependencies = [CLIAspect, WorkspaceAspect, SnappingAspect, CheckoutAspect, InstallAspect, LoggerAspect];\n static runtime = MainRuntime;\n static async provider([cli, workspace, snapping, checkout, install, loggerMain]: [\n CLIMain,\n Workspace,\n SnappingMain,\n CheckoutMain,\n InstallMain,\n LoggerMain\n ]) {\n const logger = loggerMain.createLogger(MergingAspect.id);\n const merging = new MergingMain(workspace, install, snapping, checkout, logger);\n cli.register(new MergeCmd(merging));\n return merging;\n }\n}\n\nMergingAspect.addRuntime(MergingMain);\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;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;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAUA;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;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAIA;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;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;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AQ,EAAEC,QAAQ,EAAEC,MAAM,CAAC;IAC/EqS,GAAG,CAACK,QAAQ,CAAC,KAAIC,oBAAQ,EAACF,OAAO,CAAC,CAAC;IACnC,OAAOA,OAAO;EAChB;AACF;AAAC;AAAA,gCAjtBY/S,WAAW,WAisBP,EAAE;AAAA,gCAjsBNA,WAAW,kBAksBA,CAACkT,gBAAS,EAAEC,oBAAe,EAAEC,mBAAc,EAAEC,0BAAc,EAAEC,wBAAa,EAAEC,sBAAY,CAAC;AAAA,gCAlsBpGvT,WAAW,aAmsBLwT,kBAAW;AAgB9BV,wBAAa,CAACW,UAAU,CAACzT,WAAW,CAAC"}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/merging",
3
- "version": "0.0.265",
3
+ "version": "0.0.266",
4
4
  "homepage": "https://bit.dev/teambit/component/merging",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.component",
8
8
  "name": "merging",
9
- "version": "0.0.265"
9
+ "version": "0.0.266"
10
10
  },
11
11
  "dependencies": {
12
12
  "lodash": "4.17.21",
@@ -19,16 +19,16 @@
19
19
  "@babel/runtime": "7.20.0",
20
20
  "@teambit/harmony": "0.4.6",
21
21
  "@teambit/component-id": "0.0.425",
22
- "@teambit/dependency-resolver": "0.0.950",
23
- "@teambit/envs": "0.0.950",
22
+ "@teambit/dependency-resolver": "0.0.951",
23
+ "@teambit/envs": "0.0.951",
24
24
  "@teambit/bit-error": "0.0.402",
25
- "@teambit/cli": "0.0.636",
26
- "@teambit/checkout": "0.0.119",
27
- "@teambit/install": "0.0.84",
28
- "@teambit/lane-id": "0.0.154",
29
- "@teambit/logger": "0.0.729",
30
- "@teambit/snapping": "0.0.265",
31
- "@teambit/workspace": "0.0.950"
25
+ "@teambit/cli": "0.0.637",
26
+ "@teambit/checkout": "0.0.120",
27
+ "@teambit/install": "0.0.85",
28
+ "@teambit/lane-id": "0.0.155",
29
+ "@teambit/logger": "0.0.730",
30
+ "@teambit/snapping": "0.0.266",
31
+ "@teambit/workspace": "0.0.951"
32
32
  },
33
33
  "devDependencies": {
34
34
  "chai": "4.3.0",
@@ -44,7 +44,7 @@
44
44
  "@types/testing-library__jest-dom": "5.9.5"
45
45
  },
46
46
  "peerDependencies": {
47
- "@teambit/legacy": "1.0.417",
47
+ "@teambit/legacy": "1.0.418",
48
48
  "react": "^16.8.0 || ^17.0.0",
49
49
  "react-dom": "^16.8.0 || ^17.0.0"
50
50
  },