@teambit/merging 0.0.301 → 0.0.303
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config-merger.d.ts +3 -1
- package/dist/config-merger.js +11 -10
- package/dist/config-merger.js.map +1 -1
- package/dist/merging.main.runtime.js +1 -1
- package/dist/merging.main.runtime.js.map +1 -1
- package/dist/{preview-1676518219857.js → preview-1676604673087.js} +0 -0
- package/package-tar/teambit-merging-0.0.303.tgz +0 -0
- package/package.json +14 -14
- package/package-tar/teambit-merging-0.0.301.tgz +0 -0
package/dist/config-merger.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ComponentID } from '@teambit/component-id';
|
|
2
|
+
import { Logger } from '@teambit/logger';
|
|
2
3
|
import { Lane } from '@teambit/legacy/dist/scope/models';
|
|
3
4
|
import { ExtensionDataList } from '@teambit/legacy/dist/consumer/config/extension-data';
|
|
4
5
|
import { ConfigMergeResult } from './config-merge-result';
|
|
@@ -39,12 +40,13 @@ export declare class ConfigMerger {
|
|
|
39
40
|
private otherAspects;
|
|
40
41
|
private currentLabel;
|
|
41
42
|
private otherLabel;
|
|
43
|
+
private logger;
|
|
42
44
|
private currentEnv;
|
|
43
45
|
private otherEnv;
|
|
44
46
|
private baseEnv?;
|
|
45
47
|
private handledExtIds;
|
|
46
48
|
private otherLaneIdsStr;
|
|
47
|
-
constructor(compIdStr: string, workspaceIds: ComponentID[], otherLane: Lane | undefined, currentAspects: ExtensionDataList, baseAspects: ExtensionDataList, otherAspects: ExtensionDataList, currentLabel: string, otherLabel: string);
|
|
49
|
+
constructor(compIdStr: string, workspaceIds: ComponentID[], otherLane: Lane | undefined, currentAspects: ExtensionDataList, baseAspects: ExtensionDataList, otherAspects: ExtensionDataList, currentLabel: string, otherLabel: string, logger: Logger);
|
|
48
50
|
merge(): ConfigMergeResult;
|
|
49
51
|
private populateEnvs;
|
|
50
52
|
private envStrategy;
|
package/dist/config-merger.js
CHANGED
|
@@ -82,7 +82,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
82
82
|
* see workspace.componentExtension / adjustEnvsOnConfigMerge for more details.
|
|
83
83
|
*/
|
|
84
84
|
class ConfigMerger {
|
|
85
|
-
constructor(compIdStr, workspaceIds, otherLane, currentAspects, baseAspects, otherAspects, currentLabel, otherLabel) {
|
|
85
|
+
constructor(compIdStr, workspaceIds, otherLane, currentAspects, baseAspects, otherAspects, currentLabel, otherLabel, logger) {
|
|
86
86
|
this.compIdStr = compIdStr;
|
|
87
87
|
this.workspaceIds = workspaceIds;
|
|
88
88
|
this.currentAspects = currentAspects;
|
|
@@ -90,6 +90,7 @@ class ConfigMerger {
|
|
|
90
90
|
this.otherAspects = otherAspects;
|
|
91
91
|
this.currentLabel = currentLabel;
|
|
92
92
|
this.otherLabel = otherLabel;
|
|
93
|
+
this.logger = logger;
|
|
93
94
|
(0, _defineProperty2().default)(this, "currentEnv", void 0);
|
|
94
95
|
(0, _defineProperty2().default)(this, "otherEnv", void 0);
|
|
95
96
|
(0, _defineProperty2().default)(this, "baseEnv", void 0);
|
|
@@ -98,6 +99,7 @@ class ConfigMerger {
|
|
|
98
99
|
this.otherLaneIdsStr = (otherLane === null || otherLane === void 0 ? void 0 : otherLane.components.map(c => c.id.toStringWithoutVersion())) || [];
|
|
99
100
|
}
|
|
100
101
|
merge() {
|
|
102
|
+
this.logger.trace(`************** start config-merger for ${this.compIdStr} **************`);
|
|
101
103
|
this.populateEnvs();
|
|
102
104
|
const results = this.currentAspects.map(currentExt => {
|
|
103
105
|
const id = currentExt.stringId;
|
|
@@ -155,6 +157,7 @@ class ConfigMerger {
|
|
|
155
157
|
};
|
|
156
158
|
});
|
|
157
159
|
const envResult = [this.envStrategy()] || [];
|
|
160
|
+
this.logger.trace(`*** end config-merger for ${this.compIdStr} ***\n`);
|
|
158
161
|
return new (_configMergeResult().ConfigMergeResult)(this.compIdStr, (0, _lodash().compact)([...results, ...otherAspectsNotHandledResults, ...envResult]));
|
|
159
162
|
}
|
|
160
163
|
populateEnvs() {
|
|
@@ -288,8 +291,7 @@ class ConfigMerger {
|
|
|
288
291
|
currentConfig,
|
|
289
292
|
otherConfig
|
|
290
293
|
}) {
|
|
291
|
-
|
|
292
|
-
// console.log('basicConflictGenerator', this.compIdStr, id, 'currentConfig', currentConfig, 'otherConfig', otherConfig);
|
|
294
|
+
this.logger.trace(`basicConflictGenerator, aspect-id ${id}, currentConfig, ${currentConfig}, otherConfig, ${otherConfig}`);
|
|
293
295
|
let conflict;
|
|
294
296
|
if (currentConfig === '-') {
|
|
295
297
|
conflict = `${'<'.repeat(7)} ${this.currentLabel}
|
|
@@ -326,6 +328,7 @@ ${'>'.repeat(7)} ${this.otherLabel}
|
|
|
326
328
|
}
|
|
327
329
|
depResolverStrategy(params) {
|
|
328
330
|
if (params.id !== _dependencyResolver().DependencyResolverAspect.id) return undefined;
|
|
331
|
+
this.logger.trace('start depResolverStrategy');
|
|
329
332
|
const {
|
|
330
333
|
currentExt,
|
|
331
334
|
otherExt,
|
|
@@ -515,13 +518,9 @@ ${'>'.repeat(7)} ${this.otherLabel}
|
|
|
515
518
|
force: false
|
|
516
519
|
});
|
|
517
520
|
};
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
// console.log('currentData', currentData.length, '\n', currentData.map((d) => `${d.__type} ${d.id} ${d.version}`).join('\n'));
|
|
522
|
-
// console.log('otherData', otherData.length, '\n', otherData.map((d) => `${d.__type} ${d.id} ${d.version}`).join('\n'));
|
|
523
|
-
// console.log('otherData', baseData.length, '\n', baseData.map((d) => `${d.__type} ${d.id} ${d.version}`).join('\n'));
|
|
524
|
-
// console.log('** END **\n\n');
|
|
521
|
+
this.logger.trace(`currentData, ${currentAllData.length}\n${currentAllData.map(d => `${d.__type} ${d.id} ${d.version}`).join('\n')}`);
|
|
522
|
+
this.logger.trace(`otherData, ${otherData.length}\n${otherData.map(d => `${d.__type} ${d.id} ${d.version}`).join('\n')}`);
|
|
523
|
+
this.logger.trace(`baseData, ${baseData.length}\n${baseData.map(d => `${d.__type} ${d.id} ${d.version}`).join('\n')}`);
|
|
525
524
|
|
|
526
525
|
// eslint-disable-next-line complexity
|
|
527
526
|
currentAndOtherData.forEach(depData => {
|
|
@@ -531,6 +530,8 @@ ${'>'.repeat(7)} ${this.otherLabel}
|
|
|
531
530
|
}
|
|
532
531
|
const currentDep = currentAllData.find(d => d.id === depData.id);
|
|
533
532
|
const otherDep = otherData.find(d => d.id === depData.id);
|
|
533
|
+
this.logger.trace(`currentDep`, currentDep);
|
|
534
|
+
this.logger.trace(`otherDep`, otherDep);
|
|
534
535
|
if (!otherDep) {
|
|
535
536
|
return;
|
|
536
537
|
}
|
|
@@ -1 +1 @@
|
|
|
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","existingExt","_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","getAllDeps","dependencies","policy","d","idWithoutVersion","__type","existingPolicy","find","p","dependencyId","getPolicyVer","value","semver","valid","startsWith","getDataPolicy","getAutoDeps","allDeps","filter","source","currentAutoData","currentAllData","currentDataPolicy","otherData","currentAndOtherData","uniqBy","concat","currentAndOtherComponentsData","baseData","getCompIdStrByPkgNameFromData","pkgName","found","packageName","getFromCurrentDataByPackageName","getFromCurrentDataPolicyByPackageName","mergedPolicy","devDependencies","peerDependencies","conflictedPolicy","hasConflict","conflictIndicator","lifecycleToDepType","runtime","dev","peer","handleConfigMerge","addVariantPolicyEntryToPolicy","dep","fromCurrentData","force","isHash","satisfies","fromCurrentDataPolicy","depType","lifecycleType","name","length","forEach","currentAndOtherConfig","currentDep","otherDep","baseDep","currentVer","otherVer","baseVer","hasConfigForDep","depName","getDepIdAsPkgName","addSerializedDepToPolicy","lifecycle","depData","isEnv","isRange","currentId","conflictStr","mergedConfigSplit","conflictLines","line","currentVal","otherVal","unshift","Object","keys","Boolean","rawConfig","omit","VariantPolicy","fromConfigObject","entries"],"sources":["config-merger.ts"],"sourcesContent":["import { ComponentID } from '@teambit/component-id';\nimport semver from 'semver';\nimport { isHash } from '@teambit/component-version';\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 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) {\n const existingExt = this.currentAspects.findExtension(otherExt.extensionId.toStringWithoutVersion(), true);\n if (existingExt) return null; // the aspect is set currently, no need to add it again.\n id = idFromWorkspace._legacy.toString();\n }\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 getAllDeps = (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.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 const getDataPolicy = (ext: ExtensionDataList): VariantPolicyEntry[] => {\n return ext.findCoreExtension(DependencyResolverAspect.id)?.data.policy || [];\n };\n\n const getAutoDeps = (ext: ExtensionDataList): SerializedDependencyWithPolicy[] => {\n const allDeps = getAllDeps(ext);\n return allDeps.filter((d) => d.source === 'auto');\n };\n\n const currentAutoData = getAutoDeps(this.currentAspects);\n const currentAllData = getAllDeps(this.currentAspects);\n const currentDataPolicy = getDataPolicy(this.currentAspects);\n const otherData = getAutoDeps(this.otherAspects);\n const currentAndOtherData = uniqBy(currentAutoData.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 getFromCurrentDataByPackageName = (pkgName: string) => {\n return currentAllData.find((d) => {\n if (d.__type === 'package') return d.id === pkgName;\n return d.packageName === pkgName;\n });\n };\n\n const getFromCurrentDataPolicyByPackageName = (pkgName: string) => {\n return currentDataPolicy.find((d) => d.dependencyId === pkgName);\n };\n\n const mergedPolicy = {\n dependencies: [],\n devDependencies: [],\n peerDependencies: [],\n };\n const conflictedPolicy = {\n dependencies: [],\n devDependencies: [],\n peerDependencies: [],\n };\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 fromCurrentData = getFromCurrentDataByPackageName(dep.dependencyId);\n if (fromCurrentData && !dep.force) {\n if (fromCurrentData.version === dep.value.version) return;\n if (\n !isHash(fromCurrentData.version) &&\n !isHash(dep.value.version) &&\n semver.satisfies(fromCurrentData.version, dep.value.version)\n ) {\n return;\n }\n }\n const fromCurrentDataPolicy = getFromCurrentDataPolicyByPackageName(dep.dependencyId);\n if (fromCurrentDataPolicy && fromCurrentDataPolicy.value.version === dep.value.version) {\n // that's a bug. if it's in the data.policy, it should be in data.dependencies.\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 };\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 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 };\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 // eslint-disable-next-line complexity\n currentAndOtherData.forEach((depData) => {\n if (this.isEnv(depData.id)) {\n // ignore the envs\n return;\n }\n const currentDep = currentAllData.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 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 return;\n }\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 const depType = lifecycleToDepType[currentDep.lifecycle];\n if (hasConfigForDep(depType, currentDep.id)) {\n return; // there is already config for it.\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\n // @todo: this should be the correct way to check satisfies. currently, it doesn't work correctly because there is no policy\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 (this.compIdStr.includes('teambit.dot-graph/ui/graph!')) console.log('DATA working on ', depData.id, 'POLICY');\n // if (semver.satisfies(currentDep.version, otherDep.policy)) {\n // return;\n // }\n // if (semver.satisfies(otherDep.version, currentDep.policy)) {\n // if (this.compIdStr.includes('teambit.dot-graph/ui/graph!')) console.log('DATA working on ', depData.id, 'FINAL');\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 = Object.keys(mergedPolicy).length ? { 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}\n"],"mappings":";;;;;;;;;;;;;;;;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAQA;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;EAMxBC,WAAW,CACDC,SAAiB,EACjBC,YAA2B,EAC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AAI,CAACJ,eAAe,CAACY,QAAQ,CAACR,EAAE,CAAC;EAClF;EAEQsB,kBAAkB,CAACtB,EAAU,EAA2B;IAC9D,OAAO,IAAI,CAACX,YAAY,CAAC8F,IAAI,CAAEpF,CAAC,IAAKA,CAAC,CAACE,sBAAsB,EAAE,KAAKD,EAAE,CAAC;EACzE;EAEQmJ,KAAK,CAACnJ,EAAU,EAAE;IACxB,OAAOA,EAAE,KAAK,IAAI,CAACwC,UAAU,CAACxC,EAAE,IAAIA,EAAE,KAAK,IAAI,CAACyC,QAAQ,CAACzC,EAAE;EAC7D;EAEQgB,SAAS,CAACgB,GAAuB,EAA0B;IACjE,IAAIA,GAAG,CAACgI,SAAS,KAAK,GAAG,EAAE,OAAOhI,GAAG,CAACgI,SAAS;IAC/C,OAAO,IAAAC,cAAI,EAACjI,GAAG,CAACgI,SAAS,EAAE,CAAC,YAAY,CAAC,CAAC;EAC5C;EAEQvF,SAAS,CAACnC,MAAM,EAAwB;IAC9C,IAAI,CAACA,MAAM,CAACwC,MAAM,EAAE,OAAO,EAAE;IAC7B,OAAOoF,mCAAa,CAACC,gBAAgB,CAAC7H,MAAM,CAACwC,MAAM,CAAC,CAACsF,OAAO;EAC9D;AACF;AAAC"}
|
|
1
|
+
{"version":3,"names":["ConfigMerger","constructor","compIdStr","workspaceIds","otherLane","currentAspects","baseAspects","otherAspects","currentLabel","otherLabel","logger","otherLaneIdsStr","components","map","c","id","toStringWithoutVersion","merge","trace","populateEnvs","results","currentExt","stringId","handledExtIds","includes","push","baseExt","findExtension","otherExt","mergePerStrategy","basicConflictGenerator","currentConfig","getConfig","otherConfig","otherAspectsNotHandledResults","extensionId","hasVersion","idFromWorkspace","getIdFromWorkspace","existingExt","_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","getAllDeps","dependencies","policy","d","idWithoutVersion","__type","existingPolicy","find","p","dependencyId","getPolicyVer","value","semver","valid","startsWith","getDataPolicy","getAutoDeps","allDeps","filter","source","currentAutoData","currentAllData","currentDataPolicy","otherData","currentAndOtherData","uniqBy","concat","currentAndOtherComponentsData","baseData","getCompIdStrByPkgNameFromData","pkgName","found","packageName","getFromCurrentDataByPackageName","getFromCurrentDataPolicyByPackageName","mergedPolicy","devDependencies","peerDependencies","conflictedPolicy","hasConflict","conflictIndicator","lifecycleToDepType","runtime","dev","peer","handleConfigMerge","addVariantPolicyEntryToPolicy","dep","fromCurrentData","force","isHash","satisfies","fromCurrentDataPolicy","depType","lifecycleType","name","length","forEach","currentAndOtherConfig","currentDep","otherDep","baseDep","currentVer","otherVer","baseVer","hasConfigForDep","depName","getDepIdAsPkgName","addSerializedDepToPolicy","lifecycle","depData","isEnv","isRange","currentId","conflictStr","mergedConfigSplit","conflictLines","line","currentVal","otherVal","unshift","Object","keys","Boolean","rawConfig","omit","VariantPolicy","fromConfigObject","entries"],"sources":["config-merger.ts"],"sourcesContent":["import { ComponentID } from '@teambit/component-id';\nimport semver from 'semver';\nimport { Logger } from '@teambit/logger';\nimport { isHash } from '@teambit/component-version';\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 otherLane: Lane | undefined,\n private currentAspects: ExtensionDataList,\n private baseAspects: ExtensionDataList,\n private otherAspects: ExtensionDataList,\n private currentLabel: string,\n private otherLabel: string,\n private logger: Logger\n ) {\n this.otherLaneIdsStr = otherLane?.components.map((c) => c.id.toStringWithoutVersion()) || [];\n }\n\n merge(): ConfigMergeResult {\n this.logger.trace(`************** start config-merger for ${this.compIdStr} **************`);\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) {\n const existingExt = this.currentAspects.findExtension(otherExt.extensionId.toStringWithoutVersion(), true);\n if (existingExt) return null; // the aspect is set currently, no need to add it again.\n id = idFromWorkspace._legacy.toString();\n }\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 this.logger.trace(`*** end config-merger for ${this.compIdStr} ***\\n`);\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\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 this.logger.trace(\n `basicConflictGenerator, aspect-id ${id}, currentConfig, ${currentConfig}, otherConfig, ${otherConfig}`\n );\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 this.logger.trace('start depResolverStrategy');\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 getAllDeps = (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.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 const getDataPolicy = (ext: ExtensionDataList): VariantPolicyEntry[] => {\n return ext.findCoreExtension(DependencyResolverAspect.id)?.data.policy || [];\n };\n\n const getAutoDeps = (ext: ExtensionDataList): SerializedDependencyWithPolicy[] => {\n const allDeps = getAllDeps(ext);\n return allDeps.filter((d) => d.source === 'auto');\n };\n\n const currentAutoData = getAutoDeps(this.currentAspects);\n const currentAllData = getAllDeps(this.currentAspects);\n const currentDataPolicy = getDataPolicy(this.currentAspects);\n const otherData = getAutoDeps(this.otherAspects);\n const currentAndOtherData = uniqBy(currentAutoData.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 getFromCurrentDataByPackageName = (pkgName: string) => {\n return currentAllData.find((d) => {\n if (d.__type === 'package') return d.id === pkgName;\n return d.packageName === pkgName;\n });\n };\n\n const getFromCurrentDataPolicyByPackageName = (pkgName: string) => {\n return currentDataPolicy.find((d) => d.dependencyId === pkgName);\n };\n\n const mergedPolicy = {\n dependencies: [],\n devDependencies: [],\n peerDependencies: [],\n };\n const conflictedPolicy = {\n dependencies: [],\n devDependencies: [],\n peerDependencies: [],\n };\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 fromCurrentData = getFromCurrentDataByPackageName(dep.dependencyId);\n if (fromCurrentData && !dep.force) {\n if (fromCurrentData.version === dep.value.version) return;\n if (\n !isHash(fromCurrentData.version) &&\n !isHash(dep.value.version) &&\n semver.satisfies(fromCurrentData.version, dep.value.version)\n ) {\n return;\n }\n }\n const fromCurrentDataPolicy = getFromCurrentDataPolicyByPackageName(dep.dependencyId);\n if (fromCurrentDataPolicy && fromCurrentDataPolicy.value.version === dep.value.version) {\n // that's a bug. if it's in the data.policy, it should be in data.dependencies.\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 };\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 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 };\n\n this.logger.trace(\n `currentData, ${currentAllData.length}\\n${currentAllData\n .map((d) => `${d.__type} ${d.id} ${d.version}`)\n .join('\\n')}`\n );\n this.logger.trace(\n `otherData, ${otherData.length}\\n${otherData.map((d) => `${d.__type} ${d.id} ${d.version}`).join('\\n')}`\n );\n this.logger.trace(\n `baseData, ${baseData.length}\\n${baseData.map((d) => `${d.__type} ${d.id} ${d.version}`).join('\\n')}`\n );\n\n // eslint-disable-next-line complexity\n currentAndOtherData.forEach((depData) => {\n if (this.isEnv(depData.id)) {\n // ignore the envs\n return;\n }\n const currentDep = currentAllData.find((d) => d.id === depData.id);\n const otherDep = otherData.find((d) => d.id === depData.id);\n this.logger.trace(`currentDep`, currentDep);\n this.logger.trace(`otherDep`, otherDep);\n if (!otherDep) {\n return;\n }\n if (!currentDep) {\n // only on other\n addSerializedDepToPolicy(otherDep);\n return;\n }\n\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 return;\n }\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 const depType = lifecycleToDepType[currentDep.lifecycle];\n if (hasConfigForDep(depType, currentDep.id)) {\n return; // there is already config for it.\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\n // @todo: this should be the correct way to check satisfies. currently, it doesn't work correctly because there is no policy\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 (this.compIdStr.includes('teambit.dot-graph/ui/graph!')) console.log('DATA working on ', depData.id, 'POLICY');\n // if (semver.satisfies(currentDep.version, otherDep.policy)) {\n // return;\n // }\n // if (semver.satisfies(otherDep.version, currentDep.policy)) {\n // if (this.compIdStr.includes('teambit.dot-graph/ui/graph!')) console.log('DATA working on ', depData.id, 'FINAL');\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 = Object.keys(mergedPolicy).length ? { 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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,CAACwC,MAAM,CAAC,CAACsF,OAAO;EAC9D;AACF;AAAC"}
|
|
@@ -637,7 +637,7 @@ other: ${otherLaneHead.toString()}`);
|
|
|
637
637
|
const currentLabel = `${currentId.version} (${currentLaneName === otherLaneName ? 'current' : currentLaneName})`;
|
|
638
638
|
const otherLabel = `${otherLaneHead.toString()} (${otherLaneName === currentLaneName ? 'incoming' : otherLaneName})`;
|
|
639
639
|
const workspaceIds = await this.workspace.listIds();
|
|
640
|
-
const configMerger = new (_configMerger().ConfigMerger)(id.toStringWithoutVersion(), workspaceIds, otherLane, currentComponent.extensions, baseComponent.extensions, otherComponent.extensions, currentLabel, otherLabel);
|
|
640
|
+
const configMerger = new (_configMerger().ConfigMerger)(id.toStringWithoutVersion(), workspaceIds, otherLane, currentComponent.extensions, baseComponent.extensions, otherComponent.extensions, currentLabel, otherLabel, this.logger);
|
|
641
641
|
const configMergeResult = configMerger.merge();
|
|
642
642
|
const mergeResults = await (0, _threeWayMerge().default)({
|
|
643
643
|
consumer,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["MergingMain","constructor","workspace","install","snapping","checkout","logger","componentWriter","importer","consumer","merge","ids","mergeStrategy","abort","resolve","noSnap","message","build","skipDependencyInstallation","OutsideWorkspaceError","mergeResults","resolveMerge","abortMerge","bitIds","getComponentsToMerge","mergeComponentsFromRemote","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","version","allConfigMerge","generateConfigMergeConflictFileForAll","compact","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","configMergeFile","getConflictMergeFile","forEach","configMerge","conflict","generateMergeConflictFile","addConflict","compIdStr","hasConflict","getMergeStatus","currentLane","otherLane","options","importObjectsFromMainIfExist","toBitIds","toVersionLatest","componentStatusBeforeMergeAttempt","getComponentStatusBeforeMergeAttempt","toImport","compStatus","divergeData","commonSnapBeforeDiverge","changeVersion","flat","scopeImporter","importManyIfMissingWithoutDeps","BitIds","fromArray","lane","compStatusNotNeedMerge","mergeProps","compStatusNeedMerge","getComponentsStatusNeedMerge","tmp","Tmp","componentsStatus","Promise","all","getComponentMergeStatus","clear","push","returnUnmerged","msg","getModelComponentIfExist","unmerged","getEntry","toStringWithoutVersion","repo","otherLaneHead","existingBitMapId","bitMap","getBitIdIfExist","ignoreVersion","componentOnOther","loadVersion","isRemoved","getCurrentId","idOnLane","getComponent","head","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","debug","otherComponent","currentLaneName","toLaneId","otherLaneName","DEFAULT_LANE","currentLabel","otherLabel","workspaceIds","listIds","configMerger","ConfigMerger","extensions","threeWayMerge","filesStatus","unmergedComponent","remote","handleResolveUnrelated","addComponent","unrelated","addEntry","markAllFilesAsUnchanged","files","file","pathNormalizeToLinux","relative","FileStatus","unchanged","MergeOptions","ours","remoteId","idToLoad","theirs","componentWithDependencies","loadComponentWithDependenciesFromModel","updated","modifiedStatus","modifiedFiles","applyModifiedVersion","manyComponentsWriterOpts","componentsWithDependencies","writeConfig","writeMany","writtenPath","successfullyMergedConfig","getSuccessfullyMergedConfig","mergedConfig","manual","unmergedPaths","f","filePath","setHead","markVersionAsLocal","values","getIdsForUnmerged","reset","removeComponent","fullName","abortedComponents","snap","legacyBitIds","_legacy","resolvedComponents","localLaneObject","bitId","remoteScopeName","remoteLaneId","remoteLanes","laneIdStr","getComponents","r","BitId","tagMessage","unmodified","idsStr","componentIds","resolveMultipleComponentIds","entry","GeneralError","unresolvedComponents","u","ComponentID","fromLegacy","hasWildcard","componentsList","ComponentsList","listComponentsByIdsWithWildcard","getParsedId","provider","cli","loggerMain","compWriter","createLogger","MergingAspect","merging","register","MergeCmd","CLIAspect","WorkspaceAspect","SnappingAspect","CheckoutAspect","InstallAspect","LoggerAspect","ComponentWriterAspect","ImporterAspect","MainRuntime","addRuntime"],"sources":["merging.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport WorkspaceAspect, { OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport ComponentsList from '@teambit/legacy/dist/consumer/component/components-list';\nimport {\n MergeStrategy,\n FailedComponents,\n FileStatus,\n ApplyVersionResult,\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 { ComponentWriterAspect, ComponentWriterMain } from '@teambit/component-writer';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component/consumer-component';\nimport ImporterAspect, { ImporterMain } from '@teambit/importer';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { compact } from 'lodash';\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 { 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 type ApplyVersionResults = {\n components?: ApplyVersionResult[];\n version?: string;\n failedComponents?: FailedComponents[];\n resolvedComponents?: ConsumerComponent[]; // relevant for bit merge --resolve\n abortedComponents?: ApplyVersionResult[]; // relevant for bit merge --abort\n mergeSnapResults?: { snappedComponents: ConsumerComponent[]; autoSnappedResults: AutoTagResult[] } | null;\n mergeSnapError?: Error;\n leftUnresolvedConflicts?: boolean;\n verbose?: boolean;\n newFromLane?: string[];\n newFromLaneAdded?: boolean;\n installationError?: Error; // in case the package manager failed, it won't throw, instead, it'll return error here\n compilationError?: Error; // in case the compiler failed, it won't throw, instead, it'll return error here\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 private componentWriter: ComponentWriterMain,\n private importer: ImporterMain\n ) {\n this.consumer = this.workspace?.consumer;\n }\n\n async merge(\n ids: 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 if (resolve) {\n mergeResults = await this.resolveMerge(ids, message, build);\n } else if (abort) {\n mergeResults = await this.abortMerge(ids);\n } else {\n const bitIds = this.getComponentsToMerge(consumer, ids);\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 }\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 const allConfigMerge = succeededComponents.map((c) => c.configMergeResult);\n await this.generateConfigMergeConflictFileForAll(compact(allConfigMerge));\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 private async generateConfigMergeConflictFileForAll(allConfigMerge: ConfigMergeResult[]) {\n const configMergeFile = this.workspace.getConflictMergeFile();\n allConfigMerge.forEach((configMerge) => {\n const conflict = configMerge.generateMergeConflictFile();\n if (!conflict) return;\n configMergeFile.addConflict(configMerge.compIdStr, conflict);\n });\n if (configMergeFile.hasConflict()) {\n await configMergeFile.write();\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 if (!currentLane && otherLane) {\n await this.importer.importObjectsFromMainIfExist(otherLane.toBitIds().toVersionLatest());\n }\n const componentStatusBeforeMergeAttempt = await mapSeries(bitIds, (id) =>\n this.getComponentStatusBeforeMergeAttempt(id, currentLane, options)\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 this.logger.debug(`merging snaps details:\nid: ${id.toStringWithoutVersion()}\nbase: ${baseSnap.toString()}\ncurrent: ${currentId.version}\nother: ${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 manyComponentsWriterOpts = {\n consumer,\n componentsWithDependencies: [componentWithDependencies],\n skipDependencyInstallation: true,\n writeConfig: false, // @todo: should write if config exists before, needs to figure out how to do it.\n };\n await this.componentWriter.writeMany(manyComponentsWriterOpts);\n\n if (configMergeResult) {\n if (!componentWithDependencies.component.writtenPath) {\n throw new Error(`componentWithDependencies.component.writtenPath is missing for ${id.toString()}`);\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 = [\n CLIAspect,\n WorkspaceAspect,\n SnappingAspect,\n CheckoutAspect,\n InstallAspect,\n LoggerAspect,\n ComponentWriterAspect,\n ImporterAspect,\n ];\n static runtime = MainRuntime;\n static async provider([cli, workspace, snapping, checkout, install, loggerMain, compWriter, importer]: [\n CLIMain,\n Workspace,\n SnappingMain,\n CheckoutMain,\n InstallMain,\n LoggerMain,\n ComponentWriterMain,\n ImporterMain\n ]) {\n const logger = loggerMain.createLogger(MergingAspect.id);\n const merging = new MergingMain(workspace, install, snapping, checkout, logger, compWriter, importer);\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;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAQA;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;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;AAGA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;E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D,MAAMiQ,OAAO,GAAG,IAAI9S,WAAW,CAACE,SAAS,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,QAAQ,EAAEC,MAAM,EAAEqS,UAAU,EAAEnS,QAAQ,CAAC;IACrGiS,GAAG,CAACM,QAAQ,CAAC,KAAIC,oBAAQ,EAACF,OAAO,CAAC,CAAC;IACnC,OAAOA,OAAO;EAChB;AACF;AAAC;AAAA,gCA5tBY9S,WAAW,WAisBP,EAAE;AAAA,gCAjsBNA,WAAW,kBAksBA,CACpBiT,gBAAS,EACTC,oBAAe,EACfC,mBAAc,EACdC,0BAAc,EACdC,wBAAa,EACbC,sBAAY,EACZC,wCAAqB,EACrBC,mBAAc,CACf;AAAA,gCA3sBUxT,WAAW,aA4sBLyT,kBAAW;AAkB9BZ,wBAAa,CAACa,UAAU,CAAC1T,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"names":["MergingMain","constructor","workspace","install","snapping","checkout","logger","componentWriter","importer","consumer","merge","ids","mergeStrategy","abort","resolve","noSnap","message","build","skipDependencyInstallation","OutsideWorkspaceError","mergeResults","resolveMerge","abortMerge","bitIds","getComponentsToMerge","mergeComponentsFromRemote","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","version","allConfigMerge","generateConfigMergeConflictFileForAll","compact","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","configMergeFile","getConflictMergeFile","forEach","configMerge","conflict","generateMergeConflictFile","addConflict","compIdStr","hasConflict","getMergeStatus","currentLane","otherLane","options","importObjectsFromMainIfExist","toBitIds","toVersionLatest","componentStatusBeforeMergeAttempt","getComponentStatusBeforeMergeAttempt","toImport","compStatus","divergeData","commonSnapBeforeDiverge","changeVersion","flat","scopeImporter","importManyIfMissingWithoutDeps","BitIds","fromArray","lane","compStatusNotNeedMerge","mergeProps","compStatusNeedMerge","getComponentsStatusNeedMerge","tmp","Tmp","componentsStatus","Promise","all","getComponentMergeStatus","clear","push","returnUnmerged","msg","getModelComponentIfExist","unmerged","getEntry","toStringWithoutVersion","repo","otherLaneHead","existingBitMapId","bitMap","getBitIdIfExist","ignoreVersion","componentOnOther","loadVersion","isRemoved","getCurrentId","idOnLane","getComponent","head","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","debug","otherComponent","currentLaneName","toLaneId","otherLaneName","DEFAULT_LANE","currentLabel","otherLabel","workspaceIds","listIds","configMerger","ConfigMerger","extensions","threeWayMerge","filesStatus","unmergedComponent","remote","handleResolveUnrelated","addComponent","unrelated","addEntry","markAllFilesAsUnchanged","files","file","pathNormalizeToLinux","relative","FileStatus","unchanged","MergeOptions","ours","remoteId","idToLoad","theirs","componentWithDependencies","loadComponentWithDependenciesFromModel","updated","modifiedStatus","modifiedFiles","applyModifiedVersion","manyComponentsWriterOpts","componentsWithDependencies","writeConfig","writeMany","writtenPath","successfullyMergedConfig","getSuccessfullyMergedConfig","mergedConfig","manual","unmergedPaths","f","filePath","setHead","markVersionAsLocal","values","getIdsForUnmerged","reset","removeComponent","fullName","abortedComponents","snap","legacyBitIds","_legacy","resolvedComponents","localLaneObject","bitId","remoteScopeName","remoteLaneId","remoteLanes","laneIdStr","getComponents","r","BitId","tagMessage","unmodified","idsStr","componentIds","resolveMultipleComponentIds","entry","GeneralError","unresolvedComponents","u","ComponentID","fromLegacy","hasWildcard","componentsList","ComponentsList","listComponentsByIdsWithWildcard","getParsedId","provider","cli","loggerMain","compWriter","createLogger","MergingAspect","merging","register","MergeCmd","CLIAspect","WorkspaceAspect","SnappingAspect","CheckoutAspect","InstallAspect","LoggerAspect","ComponentWriterAspect","ImporterAspect","MainRuntime","addRuntime"],"sources":["merging.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport WorkspaceAspect, { OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport ComponentsList from '@teambit/legacy/dist/consumer/component/components-list';\nimport {\n MergeStrategy,\n FailedComponents,\n FileStatus,\n ApplyVersionResult,\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 { ComponentWriterAspect, ComponentWriterMain } from '@teambit/component-writer';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component/consumer-component';\nimport ImporterAspect, { ImporterMain } from '@teambit/importer';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { compact } from 'lodash';\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 { 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 type ApplyVersionResults = {\n components?: ApplyVersionResult[];\n version?: string;\n failedComponents?: FailedComponents[];\n resolvedComponents?: ConsumerComponent[]; // relevant for bit merge --resolve\n abortedComponents?: ApplyVersionResult[]; // relevant for bit merge --abort\n mergeSnapResults?: { snappedComponents: ConsumerComponent[]; autoSnappedResults: AutoTagResult[] } | null;\n mergeSnapError?: Error;\n leftUnresolvedConflicts?: boolean;\n verbose?: boolean;\n newFromLane?: string[];\n newFromLaneAdded?: boolean;\n installationError?: Error; // in case the package manager failed, it won't throw, instead, it'll return error here\n compilationError?: Error; // in case the compiler failed, it won't throw, instead, it'll return error here\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 private componentWriter: ComponentWriterMain,\n private importer: ImporterMain\n ) {\n this.consumer = this.workspace?.consumer;\n }\n\n async merge(\n ids: 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 if (resolve) {\n mergeResults = await this.resolveMerge(ids, message, build);\n } else if (abort) {\n mergeResults = await this.abortMerge(ids);\n } else {\n const bitIds = this.getComponentsToMerge(consumer, ids);\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 }\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 const allConfigMerge = succeededComponents.map((c) => c.configMergeResult);\n await this.generateConfigMergeConflictFileForAll(compact(allConfigMerge));\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 private async generateConfigMergeConflictFileForAll(allConfigMerge: ConfigMergeResult[]) {\n const configMergeFile = this.workspace.getConflictMergeFile();\n allConfigMerge.forEach((configMerge) => {\n const conflict = configMerge.generateMergeConflictFile();\n if (!conflict) return;\n configMergeFile.addConflict(configMerge.compIdStr, conflict);\n });\n if (configMergeFile.hasConflict()) {\n await configMergeFile.write();\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 if (!currentLane && otherLane) {\n await this.importer.importObjectsFromMainIfExist(otherLane.toBitIds().toVersionLatest());\n }\n const componentStatusBeforeMergeAttempt = await mapSeries(bitIds, (id) =>\n this.getComponentStatusBeforeMergeAttempt(id, currentLane, options)\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 this.logger.debug(`merging snaps details:\nid: ${id.toStringWithoutVersion()}\nbase: ${baseSnap.toString()}\ncurrent: ${currentId.version}\nother: ${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 this.logger\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 manyComponentsWriterOpts = {\n consumer,\n componentsWithDependencies: [componentWithDependencies],\n skipDependencyInstallation: true,\n writeConfig: false, // @todo: should write if config exists before, needs to figure out how to do it.\n };\n await this.componentWriter.writeMany(manyComponentsWriterOpts);\n\n if (configMergeResult) {\n if (!componentWithDependencies.component.writtenPath) {\n throw new Error(`componentWithDependencies.component.writtenPath is missing for ${id.toString()}`);\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 = [\n CLIAspect,\n WorkspaceAspect,\n SnappingAspect,\n CheckoutAspect,\n InstallAspect,\n LoggerAspect,\n ComponentWriterAspect,\n ImporterAspect,\n ];\n static runtime = MainRuntime;\n static async provider([cli, workspace, snapping, checkout, install, loggerMain, compWriter, importer]: [\n CLIMain,\n Workspace,\n SnappingMain,\n CheckoutMain,\n InstallMain,\n LoggerMain,\n ComponentWriterMain,\n ImporterMain\n ]) {\n const logger = loggerMain.createLogger(MergingAspect.id);\n const merging = new MergingMain(workspace, install, snapping, checkout, logger, compWriter, importer);\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;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAQA;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;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;AAGA;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;E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AQ,EAAEC,MAAM,EAAEqS,UAAU,EAAEnS,QAAQ,CAAC;IACrGiS,GAAG,CAACM,QAAQ,CAAC,KAAIC,oBAAQ,EAACF,OAAO,CAAC,CAAC;IACnC,OAAOA,OAAO;EAChB;AACF;AAAC;AAAA,gCA7tBY9S,WAAW,WAksBP,EAAE;AAAA,gCAlsBNA,WAAW,kBAmsBA,CACpBiT,gBAAS,EACTC,oBAAe,EACfC,mBAAc,EACdC,0BAAc,EACdC,wBAAa,EACbC,sBAAY,EACZC,wCAAqB,EACrBC,mBAAc,CACf;AAAA,gCA5sBUxT,WAAW,aA6sBLyT,kBAAW;AAkB9BZ,wBAAa,CAACa,UAAU,CAAC1T,WAAW,CAAC"}
|
|
File without changes
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/merging",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.303",
|
|
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.
|
|
9
|
+
"version": "0.0.303"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"lodash": "4.17.21",
|
|
@@ -18,18 +18,18 @@
|
|
|
18
18
|
"@teambit/harmony": "0.4.6",
|
|
19
19
|
"@teambit/component-id": "0.0.426",
|
|
20
20
|
"@teambit/component-version": "0.0.408",
|
|
21
|
-
"@teambit/dependency-resolver": "0.0.
|
|
22
|
-
"@teambit/envs": "0.0.
|
|
21
|
+
"@teambit/dependency-resolver": "0.0.988",
|
|
22
|
+
"@teambit/envs": "0.0.988",
|
|
23
|
+
"@teambit/logger": "0.0.756",
|
|
23
24
|
"@teambit/bit-error": "0.0.402",
|
|
24
|
-
"@teambit/cli": "0.0.
|
|
25
|
-
"@teambit/checkout": "0.0.
|
|
26
|
-
"@teambit/component-writer": "0.0.
|
|
27
|
-
"@teambit/importer": "0.0.
|
|
28
|
-
"@teambit/install": "0.0.
|
|
29
|
-
"@teambit/lane-id": "0.0.
|
|
30
|
-
"@teambit/
|
|
31
|
-
"@teambit/
|
|
32
|
-
"@teambit/workspace": "0.0.986"
|
|
25
|
+
"@teambit/cli": "0.0.663",
|
|
26
|
+
"@teambit/checkout": "0.0.157",
|
|
27
|
+
"@teambit/component-writer": "0.0.24",
|
|
28
|
+
"@teambit/importer": "0.0.417",
|
|
29
|
+
"@teambit/install": "0.0.111",
|
|
30
|
+
"@teambit/lane-id": "0.0.180",
|
|
31
|
+
"@teambit/snapping": "0.0.303",
|
|
32
|
+
"@teambit/workspace": "0.0.988"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"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.
|
|
47
|
+
"@teambit/legacy": "1.0.444",
|
|
48
48
|
"react": "^16.8.0 || ^17.0.0",
|
|
49
49
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
50
50
|
},
|
|
Binary file
|