@teambit/merging 1.0.132 → 1.0.134

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import { MergingAspect } from './merging.aspect';
2
2
  export { mergeReport, applyVersionReport, conflictSummaryReport, installationErrorOutput, compilationErrorOutput, getRemovedOutput, getAddedOutput, } from './merge-cmd';
3
3
  export type { MergingMain, ComponentMergeStatus, ApplyVersionResults, ApplyVersionResult, FilesStatus, FailedComponents, } from './merging.main.runtime';
4
- export { ConfigMergeResult } from './config-merge-result';
5
4
  export default MergingAspect;
6
5
  export { MergingAspect };
package/dist/index.js CHANGED
@@ -3,12 +3,6 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- Object.defineProperty(exports, "ConfigMergeResult", {
7
- enumerable: true,
8
- get: function () {
9
- return _configMergeResult().ConfigMergeResult;
10
- }
11
- });
12
6
  Object.defineProperty(exports, "MergingAspect", {
13
7
  enumerable: true,
14
8
  get: function () {
@@ -72,13 +66,6 @@ function _mergeCmd() {
72
66
  };
73
67
  return data;
74
68
  }
75
- function _configMergeResult() {
76
- const data = require("./config-merge-result");
77
- _configMergeResult = function () {
78
- return data;
79
- };
80
- return data;
81
- }
82
69
  var _default = exports.default = _merging().MergingAspect;
83
70
 
84
71
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["_merging","data","require","_mergeCmd","_configMergeResult","_default","exports","default","MergingAspect"],"sources":["index.ts"],"sourcesContent":["import { MergingAspect } from './merging.aspect';\n\nexport {\n mergeReport,\n applyVersionReport,\n conflictSummaryReport,\n installationErrorOutput,\n compilationErrorOutput,\n getRemovedOutput,\n getAddedOutput,\n} from './merge-cmd';\nexport type {\n MergingMain,\n ComponentMergeStatus,\n ApplyVersionResults,\n ApplyVersionResult,\n FilesStatus,\n FailedComponents,\n} from './merging.main.runtime';\nexport { ConfigMergeResult } from './config-merge-result';\nexport default MergingAspect;\nexport { MergingAspect };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,UAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,SAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAiBA,SAAAG,mBAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,kBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0D,IAAAI,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAC3CC,wBAAa"}
1
+ {"version":3,"names":["_merging","data","require","_mergeCmd","_default","exports","default","MergingAspect"],"sources":["index.ts"],"sourcesContent":["import { MergingAspect } from './merging.aspect';\n\nexport {\n mergeReport,\n applyVersionReport,\n conflictSummaryReport,\n installationErrorOutput,\n compilationErrorOutput,\n getRemovedOutput,\n getAddedOutput,\n} from './merge-cmd';\nexport type {\n MergingMain,\n ComponentMergeStatus,\n ApplyVersionResults,\n ApplyVersionResult,\n FilesStatus,\n FailedComponents,\n} from './merging.main.runtime';\nexport default MergingAspect;\nexport { MergingAspect };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,UAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,SAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAQqB,IAAAG,QAAA,GAAAC,OAAA,CAAAC,OAAA,GASNC,wBAAa"}
@@ -2,8 +2,8 @@ import { Command, CommandOptions } from '@teambit/cli';
2
2
  import { ComponentID } from '@teambit/component-id';
3
3
  import { MergeStrategy } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';
4
4
  import { GlobalConfigMain } from '@teambit/global-config';
5
+ import { ConfigMergeResult } from '@teambit/config-merger';
5
6
  import { ApplyVersionResults, MergingMain, ApplyVersionResult } from './merging.main.runtime';
6
- import { ConfigMergeResult } from './config-merge-result';
7
7
  export declare class MergeCmd implements Command {
8
8
  private merging;
9
9
  private globalConfig;
@@ -1 +1 @@
1
- {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_lodash","_constants","_mergeVersion","_bitError","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","MergeCmd","constructor","merging","globalConfig","WILDCARD_HELP","report","ids","ours","theirs","manual","autoMergeResolve","abort","resolve","build","noSnap","verbose","message","skipDependencyInstallation","getBool","CFG_FORCE_LOCAL_BUILD","Boolean","BitError","components","failedComponents","version","resolvedComponents","abortedComponents","mergeSnapResults","mergeSnapError","merge","title","componentsStr","map","c","id","toStringWithoutVersion","join","chalk","underline","green","mergeReport","exports","removedComponents","leftUnresolvedConflicts","configMergeResults","workspaceDepsUpdates","workspaceDepsConflicts","workspaceConflictError","getSuccessOutput","length","bold","fileChangesReport","applyVersionReport","componentsWithConflicts","getConflictSummary","suggestion","conflictSummary","conflictSummaryReport","conflictedComponents","conflictStr","yellow","configMergeWithConflicts","filter","hasConflicts","getConfigMergeConflictSummary","comps","compIdStr","MergeConfigFilename","getSnapsOutput","snappedComponents","autoSnappedResults","outputComponents","component","componentOutput","toString","autoTag","result","triggeredBy","searchWithoutVersion","autoTagComp","a","AUTO_SNAPPED_MSG","getWorkspaceDepsOutput","body","keys","pkgName","from","to","getWorkspaceConflictsOutput","red","getFailureOutput","compact","failedComponent","white","unchangedMessage","getSummary","merged","unchangedLegitimately","f","autoSnapped","getConflictStr","ws","mergeConfig","newLines","mergedStr","unchangedLegitimatelyStr","autoSnappedStr","removedStr","getRemovedOutput","addName","showVersion","tab","fileChanges","name","files","filesStatus","file","FileStatus","unchanged","note","cyan","FILE_CHANGES_CHECKOUT_MSG","conflictedFiles","installationErrorOutput","installationError","subTitle","compilationErrorOutput","compilationError","getAddedOutput","addedComponents"],"sources":["merge-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { ComponentID } from '@teambit/component-id';\nimport { compact } from 'lodash';\nimport {\n WILDCARD_HELP,\n AUTO_SNAPPED_MSG,\n MergeConfigFilename,\n FILE_CHANGES_CHECKOUT_MSG,\n CFG_FORCE_LOCAL_BUILD,\n} from '@teambit/legacy/dist/constants';\nimport { FileStatus, MergeStrategy } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { GlobalConfigMain } from '@teambit/global-config';\nimport { BitError } from '@teambit/bit-error';\nimport { ApplyVersionResults, MergingMain, ApplyVersionResult } from './merging.main.runtime';\nimport { ConfigMergeResult } from './config-merge-result';\n\nexport class MergeCmd implements Command {\n name = 'merge [ids...]';\n description = 'merge changes of the remote head into local - auto-snaps all merged components';\n helpUrl = 'reference/components/merging-changes';\n group = 'development';\n extendedDescription = `merge changes of the remote head into local when they are diverged. when on a lane, merge the remote head of the lane into the local\nand creates snaps for merged components that have diverged, on the lane.\nif no ids are specified, all pending-merge components will be merged. (run \"bit status\" to list them).\noptionally use '--abort' to revert the last merge. to revert a lane merge, use \"bit lane merge-abort\" command.\n${WILDCARD_HELP('merge')}`;\n alias = '';\n options = [\n ['', 'ours', 'DEPRECATED. use --auto-merge-resolve. in case of a conflict, keep the local modification'],\n [\n '',\n 'theirs',\n 'DEPRECATED. use --auto-merge-resolve. in case of a conflict, override the local modification with the specified version',\n ],\n ['', 'manual', 'DEPRECATED. use --auto-merge-resolve'],\n [\n '',\n 'auto-merge-resolve <merge-strategy>',\n 'in case of a conflict, resolve according to the strategy: [ours, theirs, manual]',\n ],\n ['', 'abort', 'in case of an unresolved merge, revert to pre-merge state'],\n ['', 'resolve', 'mark an unresolved merge as resolved and create a new snap with the changes'],\n ['', 'no-snap', 'do not auto snap even if the merge completed without conflicts'],\n ['', 'build', 'in case of snap during the merge, run the build-pipeline (similar to bit snap --build)'],\n ['', 'verbose', 'show details of components that were not merged successfully'],\n ['x', 'skip-dependency-installation', 'do not install new dependencies resulting from the merge'],\n ['m', 'message <message>', 'override the default message for the auto snap'],\n ] as CommandOptions;\n loader = true;\n\n constructor(private merging: MergingMain, private globalConfig: GlobalConfigMain) {}\n\n async report(\n [ids = []]: [string[]],\n {\n ours = false,\n theirs = false,\n manual = false,\n autoMergeResolve,\n abort = false,\n resolve = false,\n build = false,\n noSnap = false,\n verbose = false,\n message,\n skipDependencyInstallation = false,\n }: {\n ours?: boolean;\n theirs?: boolean;\n manual?: boolean;\n autoMergeResolve?: MergeStrategy;\n abort?: boolean;\n resolve?: boolean;\n build?: boolean;\n noSnap?: boolean;\n verbose?: boolean;\n message: string;\n skipDependencyInstallation?: boolean;\n }\n ) {\n build = (await this.globalConfig.getBool(CFG_FORCE_LOCAL_BUILD)) || Boolean(build);\n if (ours || theirs || manual) {\n throw new BitError(\n 'the \"--ours\", \"--theirs\" and \"--manual\" flags are deprecated. use \"--auto-merge-resolve\" instead'\n );\n }\n if (\n autoMergeResolve &&\n autoMergeResolve !== 'ours' &&\n autoMergeResolve !== 'theirs' &&\n autoMergeResolve !== 'manual'\n ) {\n throw new BitError('--auto-merge-resolve must be one of the following: [ours, theirs, manual]');\n }\n if (abort && resolve) throw new BitError('unable to use \"abort\" and \"resolve\" flags together');\n if (noSnap && message) throw new BitError('unable to use \"noSnap\" and \"message\" flags together');\n const {\n components,\n failedComponents,\n version,\n resolvedComponents,\n abortedComponents,\n mergeSnapResults,\n mergeSnapError,\n }: ApplyVersionResults = await this.merging.merge(\n ids,\n autoMergeResolve as any,\n abort,\n resolve,\n noSnap,\n message,\n build,\n skipDependencyInstallation\n );\n if (resolvedComponents) {\n const title = 'successfully resolved component(s)\\n';\n const componentsStr = resolvedComponents.map((c) => c.id.toStringWithoutVersion()).join('\\n');\n return chalk.underline(title) + chalk.green(componentsStr);\n }\n if (abortedComponents) {\n const title = 'successfully aborted the merge of the following component(s)\\n';\n const componentsStr = abortedComponents.map((c) => c.id.toStringWithoutVersion()).join('\\n');\n return chalk.underline(title) + chalk.green(componentsStr);\n }\n\n return mergeReport({\n components,\n failedComponents,\n version,\n mergeSnapResults,\n mergeSnapError,\n verbose,\n });\n }\n}\n\nexport function mergeReport({\n components,\n failedComponents,\n removedComponents,\n version,\n mergeSnapResults,\n mergeSnapError,\n leftUnresolvedConflicts,\n verbose,\n configMergeResults,\n workspaceDepsUpdates,\n workspaceDepsConflicts,\n workspaceConflictError,\n}: ApplyVersionResults & { configMergeResults?: ConfigMergeResult[] }): string {\n const getSuccessOutput = () => {\n if (!components || !components.length) return '';\n const title = `successfully merged ${components.length} components${\n version ? `from version ${chalk.bold(version)}` : ''\n }\\n`;\n const fileChangesReport = applyVersionReport(components);\n\n return chalk.bold(title) + fileChangesReport;\n };\n\n let componentsWithConflicts = 0;\n const getConflictSummary = () => {\n if (!components || !components.length || !leftUnresolvedConflicts) return '';\n const title = `\\n\\nfiles with conflicts summary\\n`;\n const suggestion = `\\n\\nmerge process not completed due to the conflicts above. fix conflicts manually and then run \"bit install\".\nonce ready, snap/tag the components to complete the merge.`;\n const conflictSummary = conflictSummaryReport(components);\n componentsWithConflicts = conflictSummary.conflictedComponents;\n return chalk.underline(title) + conflictSummary.conflictStr + chalk.yellow(suggestion);\n };\n\n const configMergeWithConflicts = configMergeResults?.filter((c) => c.hasConflicts()) || [];\n const getConfigMergeConflictSummary = () => {\n if (!configMergeWithConflicts.length) return '';\n const comps = configMergeWithConflicts.map((c) => c.compIdStr).join('\\n');\n const title = `\\n\\ncomponents with config-merge conflicts\\n`;\n const suggestion = `\\nconflicts were found while trying to merge the config. fix them manually by editing the ${MergeConfigFilename} file in the workspace root.\nonce ready, snap/tag the components to complete the merge.`;\n return chalk.underline(title) + comps + chalk.yellow(suggestion);\n };\n\n const getSnapsOutput = () => {\n if (mergeSnapError) {\n return `\n${chalk.bold('snapping merged components failed with the following error, please fix the issues and snap manually')}\n${mergeSnapError.message}\n`;\n }\n if (!mergeSnapResults || !mergeSnapResults.snappedComponents) return '';\n const { snappedComponents, autoSnappedResults } = mergeSnapResults;\n const outputComponents = (comps) => {\n return comps\n .map((component) => {\n let componentOutput = ` > ${component.id.toString()}`;\n const autoTag = autoSnappedResults.filter((result) => result.triggeredBy.searchWithoutVersion(component.id));\n if (autoTag.length) {\n const autoTagComp = autoTag.map((a) => a.component.id.toString());\n componentOutput += `\\n ${AUTO_SNAPPED_MSG}: ${autoTagComp.join(', ')}`;\n }\n return componentOutput;\n })\n .join('\\n');\n };\n\n return `\\n${chalk.underline(\n 'merge-snapped components'\n )}\\n(${'components snapped as a result of the merge'})\\n${outputComponents(snappedComponents)}\\n`;\n };\n\n const getWorkspaceDepsOutput = () => {\n if (!workspaceDepsUpdates) return '';\n\n const title = '\\nworkspace.jsonc has been updated with the following dependencies';\n const body = Object.keys(workspaceDepsUpdates)\n .map((pkgName) => {\n const [from, to] = workspaceDepsUpdates[pkgName];\n return ` ${pkgName}: ${from} => ${to}`;\n })\n .join('\\n');\n\n return `\\n${chalk.underline(title)}\\n${body}\\n\\n`;\n };\n\n const getWorkspaceConflictsOutput = () => {\n if (!workspaceDepsConflicts && !workspaceConflictError) return '';\n if (workspaceConflictError) {\n return `\\n${chalk.red(workspaceConflictError.message)}\\n\\n`;\n }\n return chalk.yellow('\\nworkspace.jsonc has conflicts, please edit the file and fix them\\n\\n');\n };\n\n const getFailureOutput = () => {\n if (!failedComponents || !failedComponents.length) return '';\n const title = '\\nmerge skipped for the following component(s)';\n const body = compact(\n failedComponents.map((failedComponent) => {\n // all failures here are \"unchangedLegitimately\". otherwise, it would have been thrown as an error\n if (!verbose) return null;\n return `${chalk.bold(failedComponent.id.toString())} - ${chalk.white(failedComponent.unchangedMessage)}`;\n })\n ).join('\\n');\n if (!body) {\n return `${chalk.bold(`\\nmerge skipped legitimately for ${failedComponents.length} component(s)`)}\n(use --verbose to list them next time)`;\n }\n return `\\n${chalk.underline(title)}\\n${body}\\n\\n`;\n };\n\n const getSummary = () => {\n const merged = components?.length || 0;\n const unchangedLegitimately = failedComponents?.filter((f) => f.unchangedLegitimately).length || 0;\n const autoSnapped =\n (mergeSnapResults?.snappedComponents.length || 0) + (mergeSnapResults?.autoSnappedResults.length || 0);\n const getConflictStr = () => {\n const comps = componentsWithConflicts ? `${componentsWithConflicts} components` : '';\n const ws = workspaceDepsConflicts ? 'workspace.jsonc file' : '';\n const mergeConfig = configMergeWithConflicts.length ? `${MergeConfigFilename} file` : '';\n return compact([comps, ws, mergeConfig]).join(', ');\n };\n\n const newLines = '\\n\\n';\n const title = chalk.bold.underline('Merge Summary');\n const mergedStr = `\\nTotal Merged: ${chalk.bold(merged.toString())}`;\n const unchangedLegitimatelyStr = `\\nTotal Unchanged: ${chalk.bold(unchangedLegitimately.toString())}`;\n const autoSnappedStr = `\\nTotal Snapped: ${chalk.bold(autoSnapped.toString())}`;\n const removedStr = `\\nTotal Removed: ${chalk.bold(removedComponents?.length.toString() || '0')}`;\n const conflictStr = `\\nConflicts: ${chalk.bold(getConflictStr() || 'none')}`;\n\n return newLines + title + mergedStr + unchangedLegitimatelyStr + autoSnappedStr + removedStr + conflictStr;\n };\n\n return (\n getSuccessOutput() +\n getFailureOutput() +\n getRemovedOutput(removedComponents) +\n getSnapsOutput() +\n getWorkspaceDepsOutput() +\n getConfigMergeConflictSummary() +\n getWorkspaceConflictsOutput() +\n getConflictSummary() +\n getSummary()\n );\n}\n\n/**\n * shows only the file-changes section.\n * if all files are \"unchanged\", it returns an empty string\n */\nexport function applyVersionReport(components: ApplyVersionResult[], addName = true, showVersion = false): string {\n const tab = addName ? '\\t' : '';\n const fileChanges = compact(\n components.map((component: ApplyVersionResult) => {\n const name = showVersion ? component.id.toString() : component.id.toStringWithoutVersion();\n const files = compact(\n Object.keys(component.filesStatus).map((file) => {\n if (component.filesStatus[file] === FileStatus.unchanged) return null;\n const note =\n component.filesStatus[file] === FileStatus.manual\n ? chalk.white('automatic merge failed. please fix conflicts manually and then run \"bit install\"')\n : '';\n return `${tab}${String(component.filesStatus[file])} ${chalk.bold(file)} ${note}`;\n })\n ).join('\\n');\n if (!files) return null;\n return `${addName ? name : ''}\\n${chalk.cyan(files)}`;\n })\n ).join('\\n\\n');\n if (!fileChanges) {\n return '';\n }\n const title = `\\n${FILE_CHANGES_CHECKOUT_MSG}\\n`;\n return chalk.underline(title) + fileChanges;\n}\n\nexport function conflictSummaryReport(components: ApplyVersionResult[]): {\n conflictedComponents: number;\n conflictedFiles: number;\n conflictStr: string;\n} {\n const tab = '\\t';\n let conflictedComponents = 0;\n let conflictedFiles = 0;\n const conflictStr = compact(\n components.map((component: ApplyVersionResult) => {\n const name = component.id.toStringWithoutVersion();\n const files = compact(\n Object.keys(component.filesStatus).map((file) => {\n if (component.filesStatus[file] === FileStatus.manual) {\n conflictedFiles += 1;\n return `${tab}${String(component.filesStatus[file])} ${chalk.bold(file)}`;\n }\n return null;\n })\n );\n if (!files.length) return null;\n conflictedComponents += 1;\n return `${name}\\n${chalk.cyan(files.join('\\n'))}`;\n })\n ).join('\\n');\n\n return { conflictedComponents, conflictedFiles, conflictStr };\n}\n\nexport function installationErrorOutput(installationError?: Error) {\n if (!installationError) return '';\n const title = chalk.underline('Installation Error');\n const subTitle = 'The following error was thrown by the package manager, please fix the issue and run \"bit install\"';\n const body = chalk.red(installationError.message);\n return `\\n\\n${title}\\n${subTitle}\\n${body}`;\n}\n\nexport function compilationErrorOutput(compilationError?: Error) {\n if (!compilationError) return '';\n const title = chalk.underline('Compilation Error');\n const subTitle = 'The following error was thrown by the compiler, please fix the issue and run \"bit compile\"';\n const body = chalk.red(compilationError.message);\n return `\\n\\n${title}\\n${subTitle}\\n${body}`;\n}\n\nexport function getRemovedOutput(removedComponents?: ComponentID[]) {\n if (!removedComponents?.length) return '';\n const title = `the following ${removedComponents.length} component(s) have been removed`;\n const body = removedComponents.join('\\n');\n return `\\n\\n${chalk.underline(title)}\\n${body}\\n\\n`;\n}\n\nexport function getAddedOutput(addedComponents?: ComponentID[]) {\n if (!addedComponents?.length) return '';\n const title = `the following ${addedComponents.length} component(s) have been added`;\n const body = addedComponents.join('\\n');\n return `\\n\\n${chalk.underline(title)}\\n${body}\\n\\n`;\n}\n"],"mappings":";;;;;;;;;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,WAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,UAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAOA,SAAAK,cAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,aAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,UAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,SAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA8C,SAAAC,uBAAAM,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAA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I,GAAG8C,eAAe,CAAC7F,IAAI,CAAC,IAAI,CAAC;EACvC,OAAQ,OAAMC,gBAAK,CAACC,SAAS,CAACR,KAAK,CAAE,KAAIqD,IAAK,MAAK;AACrD"}
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_lodash","_constants","_mergeVersion","_bitError","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","MergeCmd","constructor","merging","globalConfig","WILDCARD_HELP","report","ids","ours","theirs","manual","autoMergeResolve","abort","resolve","build","noSnap","verbose","message","skipDependencyInstallation","getBool","CFG_FORCE_LOCAL_BUILD","Boolean","BitError","components","failedComponents","version","resolvedComponents","abortedComponents","mergeSnapResults","mergeSnapError","merge","title","componentsStr","map","c","id","toStringWithoutVersion","join","chalk","underline","green","mergeReport","exports","removedComponents","leftUnresolvedConflicts","configMergeResults","workspaceDepsUpdates","workspaceDepsConflicts","workspaceConflictError","getSuccessOutput","length","bold","fileChangesReport","applyVersionReport","componentsWithConflicts","getConflictSummary","suggestion","conflictSummary","conflictSummaryReport","conflictedComponents","conflictStr","yellow","configMergeWithConflicts","filter","hasConflicts","getConfigMergeConflictSummary","comps","compIdStr","MergeConfigFilename","getSnapsOutput","snappedComponents","autoSnappedResults","outputComponents","component","componentOutput","toString","autoTag","result","triggeredBy","searchWithoutVersion","autoTagComp","a","AUTO_SNAPPED_MSG","getWorkspaceDepsOutput","body","keys","pkgName","from","to","getWorkspaceConflictsOutput","red","getFailureOutput","compact","failedComponent","white","unchangedMessage","getSummary","merged","unchangedLegitimately","f","autoSnapped","getConflictStr","ws","mergeConfig","newLines","mergedStr","unchangedLegitimatelyStr","autoSnappedStr","removedStr","getRemovedOutput","addName","showVersion","tab","fileChanges","name","files","filesStatus","file","FileStatus","unchanged","note","cyan","FILE_CHANGES_CHECKOUT_MSG","conflictedFiles","installationErrorOutput","installationError","subTitle","compilationErrorOutput","compilationError","getAddedOutput","addedComponents"],"sources":["merge-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { ComponentID } from '@teambit/component-id';\nimport { compact } from 'lodash';\nimport {\n WILDCARD_HELP,\n AUTO_SNAPPED_MSG,\n MergeConfigFilename,\n FILE_CHANGES_CHECKOUT_MSG,\n CFG_FORCE_LOCAL_BUILD,\n} from '@teambit/legacy/dist/constants';\nimport { FileStatus, MergeStrategy } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { GlobalConfigMain } from '@teambit/global-config';\nimport { ConfigMergeResult } from '@teambit/config-merger';\nimport { BitError } from '@teambit/bit-error';\nimport { ApplyVersionResults, MergingMain, ApplyVersionResult } from './merging.main.runtime';\n\nexport class MergeCmd implements Command {\n name = 'merge [ids...]';\n description = 'merge changes of the remote head into local - auto-snaps all merged components';\n helpUrl = 'reference/components/merging-changes';\n group = 'development';\n extendedDescription = `merge changes of the remote head into local when they are diverged. when on a lane, merge the remote head of the lane into the local\nand creates snaps for merged components that have diverged, on the lane.\nif no ids are specified, all pending-merge components will be merged. (run \"bit status\" to list them).\noptionally use '--abort' to revert the last merge. to revert a lane merge, use \"bit lane merge-abort\" command.\n${WILDCARD_HELP('merge')}`;\n alias = '';\n options = [\n ['', 'ours', 'DEPRECATED. use --auto-merge-resolve. in case of a conflict, keep the local modification'],\n [\n '',\n 'theirs',\n 'DEPRECATED. use --auto-merge-resolve. in case of a conflict, override the local modification with the specified version',\n ],\n ['', 'manual', 'DEPRECATED. use --auto-merge-resolve'],\n [\n '',\n 'auto-merge-resolve <merge-strategy>',\n 'in case of a conflict, resolve according to the strategy: [ours, theirs, manual]',\n ],\n ['', 'abort', 'in case of an unresolved merge, revert to pre-merge state'],\n ['', 'resolve', 'mark an unresolved merge as resolved and create a new snap with the changes'],\n ['', 'no-snap', 'do not auto snap even if the merge completed without conflicts'],\n ['', 'build', 'in case of snap during the merge, run the build-pipeline (similar to bit snap --build)'],\n ['', 'verbose', 'show details of components that were not merged successfully'],\n ['x', 'skip-dependency-installation', 'do not install new dependencies resulting from the merge'],\n ['m', 'message <message>', 'override the default message for the auto snap'],\n ] as CommandOptions;\n loader = true;\n\n constructor(private merging: MergingMain, private globalConfig: GlobalConfigMain) {}\n\n async report(\n [ids = []]: [string[]],\n {\n ours = false,\n theirs = false,\n manual = false,\n autoMergeResolve,\n abort = false,\n resolve = false,\n build = false,\n noSnap = false,\n verbose = false,\n message,\n skipDependencyInstallation = false,\n }: {\n ours?: boolean;\n theirs?: boolean;\n manual?: boolean;\n autoMergeResolve?: MergeStrategy;\n abort?: boolean;\n resolve?: boolean;\n build?: boolean;\n noSnap?: boolean;\n verbose?: boolean;\n message: string;\n skipDependencyInstallation?: boolean;\n }\n ) {\n build = (await this.globalConfig.getBool(CFG_FORCE_LOCAL_BUILD)) || Boolean(build);\n if (ours || theirs || manual) {\n throw new BitError(\n 'the \"--ours\", \"--theirs\" and \"--manual\" flags are deprecated. use \"--auto-merge-resolve\" instead'\n );\n }\n if (\n autoMergeResolve &&\n autoMergeResolve !== 'ours' &&\n autoMergeResolve !== 'theirs' &&\n autoMergeResolve !== 'manual'\n ) {\n throw new BitError('--auto-merge-resolve must be one of the following: [ours, theirs, manual]');\n }\n if (abort && resolve) throw new BitError('unable to use \"abort\" and \"resolve\" flags together');\n if (noSnap && message) throw new BitError('unable to use \"noSnap\" and \"message\" flags together');\n const {\n components,\n failedComponents,\n version,\n resolvedComponents,\n abortedComponents,\n mergeSnapResults,\n mergeSnapError,\n }: ApplyVersionResults = await this.merging.merge(\n ids,\n autoMergeResolve as any,\n abort,\n resolve,\n noSnap,\n message,\n build,\n skipDependencyInstallation\n );\n if (resolvedComponents) {\n const title = 'successfully resolved component(s)\\n';\n const componentsStr = resolvedComponents.map((c) => c.id.toStringWithoutVersion()).join('\\n');\n return chalk.underline(title) + chalk.green(componentsStr);\n }\n if (abortedComponents) {\n const title = 'successfully aborted the merge of the following component(s)\\n';\n const componentsStr = abortedComponents.map((c) => c.id.toStringWithoutVersion()).join('\\n');\n return chalk.underline(title) + chalk.green(componentsStr);\n }\n\n return mergeReport({\n components,\n failedComponents,\n version,\n mergeSnapResults,\n mergeSnapError,\n verbose,\n });\n }\n}\n\nexport function mergeReport({\n components,\n failedComponents,\n removedComponents,\n version,\n mergeSnapResults,\n mergeSnapError,\n leftUnresolvedConflicts,\n verbose,\n configMergeResults,\n workspaceDepsUpdates,\n workspaceDepsConflicts,\n workspaceConflictError,\n}: ApplyVersionResults & { configMergeResults?: ConfigMergeResult[] }): string {\n const getSuccessOutput = () => {\n if (!components || !components.length) return '';\n const title = `successfully merged ${components.length} components${\n version ? `from version ${chalk.bold(version)}` : ''\n }\\n`;\n const fileChangesReport = applyVersionReport(components);\n\n return chalk.bold(title) + fileChangesReport;\n };\n\n let componentsWithConflicts = 0;\n const getConflictSummary = () => {\n if (!components || !components.length || !leftUnresolvedConflicts) return '';\n const title = `\\n\\nfiles with conflicts summary\\n`;\n const suggestion = `\\n\\nmerge process not completed due to the conflicts above. fix conflicts manually and then run \"bit install\".\nonce ready, snap/tag the components to complete the merge.`;\n const conflictSummary = conflictSummaryReport(components);\n componentsWithConflicts = conflictSummary.conflictedComponents;\n return chalk.underline(title) + conflictSummary.conflictStr + chalk.yellow(suggestion);\n };\n\n const configMergeWithConflicts = configMergeResults?.filter((c) => c.hasConflicts()) || [];\n const getConfigMergeConflictSummary = () => {\n if (!configMergeWithConflicts.length) return '';\n const comps = configMergeWithConflicts.map((c) => c.compIdStr).join('\\n');\n const title = `\\n\\ncomponents with config-merge conflicts\\n`;\n const suggestion = `\\nconflicts were found while trying to merge the config. fix them manually by editing the ${MergeConfigFilename} file in the workspace root.\nonce ready, snap/tag the components to complete the merge.`;\n return chalk.underline(title) + comps + chalk.yellow(suggestion);\n };\n\n const getSnapsOutput = () => {\n if (mergeSnapError) {\n return `\n${chalk.bold('snapping merged components failed with the following error, please fix the issues and snap manually')}\n${mergeSnapError.message}\n`;\n }\n if (!mergeSnapResults || !mergeSnapResults.snappedComponents) return '';\n const { snappedComponents, autoSnappedResults } = mergeSnapResults;\n const outputComponents = (comps) => {\n return comps\n .map((component) => {\n let componentOutput = ` > ${component.id.toString()}`;\n const autoTag = autoSnappedResults.filter((result) => result.triggeredBy.searchWithoutVersion(component.id));\n if (autoTag.length) {\n const autoTagComp = autoTag.map((a) => a.component.id.toString());\n componentOutput += `\\n ${AUTO_SNAPPED_MSG}: ${autoTagComp.join(', ')}`;\n }\n return componentOutput;\n })\n .join('\\n');\n };\n\n return `\\n${chalk.underline(\n 'merge-snapped components'\n )}\\n(${'components snapped as a result of the merge'})\\n${outputComponents(snappedComponents)}\\n`;\n };\n\n const getWorkspaceDepsOutput = () => {\n if (!workspaceDepsUpdates) return '';\n\n const title = '\\nworkspace.jsonc has been updated with the following dependencies';\n const body = Object.keys(workspaceDepsUpdates)\n .map((pkgName) => {\n const [from, to] = workspaceDepsUpdates[pkgName];\n return ` ${pkgName}: ${from} => ${to}`;\n })\n .join('\\n');\n\n return `\\n${chalk.underline(title)}\\n${body}\\n\\n`;\n };\n\n const getWorkspaceConflictsOutput = () => {\n if (!workspaceDepsConflicts && !workspaceConflictError) return '';\n if (workspaceConflictError) {\n return `\\n${chalk.red(workspaceConflictError.message)}\\n\\n`;\n }\n return chalk.yellow('\\nworkspace.jsonc has conflicts, please edit the file and fix them\\n\\n');\n };\n\n const getFailureOutput = () => {\n if (!failedComponents || !failedComponents.length) return '';\n const title = '\\nmerge skipped for the following component(s)';\n const body = compact(\n failedComponents.map((failedComponent) => {\n // all failures here are \"unchangedLegitimately\". otherwise, it would have been thrown as an error\n if (!verbose) return null;\n return `${chalk.bold(failedComponent.id.toString())} - ${chalk.white(failedComponent.unchangedMessage)}`;\n })\n ).join('\\n');\n if (!body) {\n return `${chalk.bold(`\\nmerge skipped legitimately for ${failedComponents.length} component(s)`)}\n(use --verbose to list them next time)`;\n }\n return `\\n${chalk.underline(title)}\\n${body}\\n\\n`;\n };\n\n const getSummary = () => {\n const merged = components?.length || 0;\n const unchangedLegitimately = failedComponents?.filter((f) => f.unchangedLegitimately).length || 0;\n const autoSnapped =\n (mergeSnapResults?.snappedComponents.length || 0) + (mergeSnapResults?.autoSnappedResults.length || 0);\n const getConflictStr = () => {\n const comps = componentsWithConflicts ? `${componentsWithConflicts} components` : '';\n const ws = workspaceDepsConflicts ? 'workspace.jsonc file' : '';\n const mergeConfig = configMergeWithConflicts.length ? `${MergeConfigFilename} file` : '';\n return compact([comps, ws, mergeConfig]).join(', ');\n };\n\n const newLines = '\\n\\n';\n const title = chalk.bold.underline('Merge Summary');\n const mergedStr = `\\nTotal Merged: ${chalk.bold(merged.toString())}`;\n const unchangedLegitimatelyStr = `\\nTotal Unchanged: ${chalk.bold(unchangedLegitimately.toString())}`;\n const autoSnappedStr = `\\nTotal Snapped: ${chalk.bold(autoSnapped.toString())}`;\n const removedStr = `\\nTotal Removed: ${chalk.bold(removedComponents?.length.toString() || '0')}`;\n const conflictStr = `\\nConflicts: ${chalk.bold(getConflictStr() || 'none')}`;\n\n return newLines + title + mergedStr + unchangedLegitimatelyStr + autoSnappedStr + removedStr + conflictStr;\n };\n\n return (\n getSuccessOutput() +\n getFailureOutput() +\n getRemovedOutput(removedComponents) +\n getSnapsOutput() +\n getWorkspaceDepsOutput() +\n getConfigMergeConflictSummary() +\n getWorkspaceConflictsOutput() +\n getConflictSummary() +\n getSummary()\n );\n}\n\n/**\n * shows only the file-changes section.\n * if all files are \"unchanged\", it returns an empty string\n */\nexport function applyVersionReport(components: ApplyVersionResult[], addName = true, showVersion = false): string {\n const tab = addName ? '\\t' : '';\n const fileChanges = compact(\n components.map((component: ApplyVersionResult) => {\n const name = showVersion ? component.id.toString() : component.id.toStringWithoutVersion();\n const files = compact(\n Object.keys(component.filesStatus).map((file) => {\n if (component.filesStatus[file] === FileStatus.unchanged) return null;\n const note =\n component.filesStatus[file] === FileStatus.manual\n ? chalk.white('automatic merge failed. please fix conflicts manually and then run \"bit install\"')\n : '';\n return `${tab}${String(component.filesStatus[file])} ${chalk.bold(file)} ${note}`;\n })\n ).join('\\n');\n if (!files) return null;\n return `${addName ? name : ''}\\n${chalk.cyan(files)}`;\n })\n ).join('\\n\\n');\n if (!fileChanges) {\n return '';\n }\n const title = `\\n${FILE_CHANGES_CHECKOUT_MSG}\\n`;\n return chalk.underline(title) + fileChanges;\n}\n\nexport function conflictSummaryReport(components: ApplyVersionResult[]): {\n conflictedComponents: number;\n conflictedFiles: number;\n conflictStr: string;\n} {\n const tab = '\\t';\n let conflictedComponents = 0;\n let conflictedFiles = 0;\n const conflictStr = compact(\n components.map((component: ApplyVersionResult) => {\n const name = component.id.toStringWithoutVersion();\n const files = compact(\n Object.keys(component.filesStatus).map((file) => {\n if (component.filesStatus[file] === FileStatus.manual) {\n conflictedFiles += 1;\n return `${tab}${String(component.filesStatus[file])} ${chalk.bold(file)}`;\n }\n return null;\n })\n );\n if (!files.length) return null;\n conflictedComponents += 1;\n return `${name}\\n${chalk.cyan(files.join('\\n'))}`;\n })\n ).join('\\n');\n\n return { conflictedComponents, conflictedFiles, conflictStr };\n}\n\nexport function installationErrorOutput(installationError?: Error) {\n if (!installationError) return '';\n const title = chalk.underline('Installation Error');\n const subTitle = 'The following error was thrown by the package manager, please fix the issue and run \"bit install\"';\n const body = chalk.red(installationError.message);\n return `\\n\\n${title}\\n${subTitle}\\n${body}`;\n}\n\nexport function compilationErrorOutput(compilationError?: Error) {\n if (!compilationError) return '';\n const title = chalk.underline('Compilation Error');\n const subTitle = 'The following error was thrown by the compiler, please fix the issue and run \"bit compile\"';\n const body = chalk.red(compilationError.message);\n return `\\n\\n${title}\\n${subTitle}\\n${body}`;\n}\n\nexport function getRemovedOutput(removedComponents?: ComponentID[]) {\n if (!removedComponents?.length) return '';\n const title = `the following ${removedComponents.length} component(s) have been removed`;\n const body = removedComponents.join('\\n');\n return `\\n\\n${chalk.underline(title)}\\n${body}\\n\\n`;\n}\n\nexport function getAddedOutput(addedComponents?: ComponentID[]) {\n if (!addedComponents?.length) return '';\n const title = `the following ${addedComponents.length} component(s) have been added`;\n const body = addedComponents.join('\\n');\n return `\\n\\n${chalk.underline(title)}\\n${body}\\n\\n`;\n}\n"],"mappings":";;;;;;;;;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,WAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,UAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAOA,SAAAK,cAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,aAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAM,UAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,SAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA8C,SAAAC,uBAAAM,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,gBAAAH,GAAA,EAAAI,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAJ,GAAA,IAAAO,MAAA,CAAAC,cAAA,CAAAR,GAAA,EAAAI,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAX,GAAA,CAAAI,GAAA,IAAAC,KAAA,WAAAL,GAAA;AAAA,SAAA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EACjD,OAAQ,OAAMc,KAAM,KAAI+F,QAAS,KAAI1C,IAAK,EAAC;AAC7C;AAEO,SAAS2C,sBAAsBA,CAACC,gBAAwB,EAAE;EAC/D,IAAI,CAACA,gBAAgB,EAAE,OAAO,EAAE;EAChC,MAAMjG,KAAK,GAAGO,gBAAK,CAACC,SAAS,CAAC,mBAAmB,CAAC;EAClD,MAAMuF,QAAQ,GAAG,4FAA4F;EAC7G,MAAM1C,IAAI,GAAG9C,gBAAK,CAACoD,GAAG,CAACsC,gBAAgB,CAAC/G,OAAO,CAAC;EAChD,OAAQ,OAAMc,KAAM,KAAI+F,QAAS,KAAI1C,IAAK,EAAC;AAC7C;AAEO,SAASyB,gBAAgBA,CAAClE,iBAAiC,EAAE;EAClE,IAAI,CAACA,iBAAiB,EAAEO,MAAM,EAAE,OAAO,EAAE;EACzC,MAAMnB,KAAK,GAAI,iBAAgBY,iBAAiB,CAACO,MAAO,iCAAgC;EACxF,MAAMkC,IAAI,GAAGzC,iBAAiB,CAACN,IAAI,CAAC,IAAI,CAAC;EACzC,OAAQ,OAAMC,gBAAK,CAACC,SAAS,CAACR,KAAK,CAAE,KAAIqD,IAAK,MAAK;AACrD;AAEO,SAAS6C,cAAcA,CAACC,eAA+B,EAAE;EAC9D,IAAI,CAACA,eAAe,EAAEhF,MAAM,EAAE,OAAO,EAAE;EACvC,MAAMnB,KAAK,GAAI,iBAAgBmG,eAAe,CAAChF,MAAO,+BAA8B;EACpF,MAAMkC,IAAI,GAAG8C,eAAe,CAAC7F,IAAI,CAAC,IAAI,CAAC;EACvC,OAAQ,OAAMC,gBAAK,CAACC,SAAS,CAACR,KAAK,CAAE,KAAIqD,IAAK,MAAK;AACrD"}
@@ -61,7 +61,7 @@ function _noCommonSnap() {
61
61
  return data;
62
62
  }
63
63
  function _configMerger() {
64
- const data = require("./config-merger");
64
+ const data = require("@teambit/config-merger");
65
65
  _configMerger = function () {
66
66
  return data;
67
67
  };
@@ -159,7 +159,7 @@ other: ${otherLaneHead.toString()}`);
159
159
  const currentLabel = `${currentId.version} (${currentLaneName === otherLaneName ? 'current' : currentLaneName})`;
160
160
  const otherLabel = `${otherLaneHead.toString()} (${otherLaneName === currentLaneName ? 'incoming' : otherLaneName})`;
161
161
  const workspaceIds = await this.workspace.listIds();
162
- const configMerger = new (_configMerger().ConfigMerger)(id.toStringWithoutVersion(), workspaceIds, this.otherLane, currentComponent.extensions, baseComponent.extensions, otherComponent.extensions, currentLabel, otherLabel, this.logger);
162
+ const configMerger = new (_configMerger().ComponentConfigMerger)(id.toStringWithoutVersion(), workspaceIds, this.otherLane, currentComponent.extensions, baseComponent.extensions, otherComponent.extensions, currentLabel, otherLabel, this.logger);
163
163
  const configMergeResult = configMerger.merge();
164
164
  const mergeResults = await (0, _threeWayMerge().default)({
165
165
  consumer: this.workspace.consumer,
@@ -1 +1 @@
1
- {"version":3,"names":["_pMapSeries","data","_interopRequireDefault","require","_componentId","_laneId","_getDivergeData","_repositories","_lodash","_threeWayMerge","_noCommonSnap","_configMerger","obj","__esModule","default","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","key","value","_toPropertyKey","configurable","writable","i","_toPrimitive","String","Symbol","toPrimitive","call","TypeError","Number","MergeStatusProvider","constructor","workspace","logger","importer","currentLane","otherLane","options","getStatus","bitIds","importObjectsFromMainIfExist","toBitIds","toVersionLatest","componentStatusBeforeMergeAttempt","mapSeries","id","getComponentStatusBeforeMergeAttempt","shouldImportHistoryOfOtherLane","shouldSquash","scope","toImport","map","compStatus","divergeData","versionsToImport","commonSnapBeforeDiverge","snapsOnTargetOnly","compact","v","changeVersion","toString","flat","reason","consumer","scopeImporter","importWithoutDeps","ComponentIdList","fromArray","lane","cache","includeVersionHistory","compStatusNotNeedMerge","c","mergeProps","compStatusNeedMerge","getComponentsStatusNeedMerge","tmp","Tmp","componentsStatus","Promise","all","getComponentMergeStatus","clear","err","results","componentMergeStatusBeforeMergeAttempt","currentComponent","Error","otherLaneHead","currentId","modelComponent","repo","objects","baseSnap","debug","toStringWithoutVersion","version","baseComponent","loadVersion","otherComponent","currentLaneName","toLaneId","otherLaneName","DEFAULT_LANE","currentLabel","otherLabel","workspaceIds","listIds","configMerger","ConfigMerger","extensions","configMergeResult","merge","mergeResults","threeWayMerge","returnUnmerged","msg","unmergedLegitimately","componentStatus","unchangedMessage","unchangedLegitimately","getModelComponentIfExist","unmerged","unmergedComponents","getEntry","getRef","existingBitMapId","bitMap","getComponentIdIfExist","ignoreVersion","componentOnOther","idOnCurrentLane","getComponent","isRemoved","shouldMerge","shouldRemoveFromMain","shouldBeRemoved","getCurrentId","head","getHeadAsTagIfExist","getDivergeData","targetHead","throws","componentFromModel","getCurrentComponent","loadComponent","getConsumerComponent","isTargetNotAhead","isTargetAhead","shouldIgnore","isModified","componentModificationStatus","getComponentStatusById","modified","undefined","isSourceCodeModified","isComponentSourceCodeModified","modifiedType","ignoreConfigChanges","NoCommonSnap","resolveUnrelated","message","handleNoCommonSnap","isDiverged","isSourceAhead","mainHead","returnAccordingToOurs","headToSaveInLane","unrelatedHead","unrelatedLaneId","resolvedUnrelated","strategy","headOnCurrentLane","returnAccordingToTheirs","resolvedRef","unrelatedHeadRef","currentVersionRef","otherVersionRef","hasResolvedFromMain","hashToCompare","divergeDataFromMain","sourceHead","hasResolvedLocally","getHeadRegardlessOfLane","hasResolvedRemotely","refToSaveInLane","exports"],"sources":["merge-status-provider.ts"],"sourcesContent":["import { Workspace } from '@teambit/workspace';\nimport { MergeStrategy } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport mapSeries from 'p-map-series';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport { DEFAULT_LANE, LaneId } from '@teambit/lane-id';\nimport { getDivergeData } from '@teambit/legacy/dist/scope/component-ops/get-diverge-data';\nimport { Lane, ModelComponent, Version } from '@teambit/legacy/dist/scope/models';\nimport { Ref } from '@teambit/legacy/dist/scope/objects';\nimport { Tmp } from '@teambit/legacy/dist/scope/repositories';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component/consumer-component';\nimport { ImporterMain } from '@teambit/importer';\nimport { Logger } from '@teambit/logger';\nimport { compact } from 'lodash';\nimport threeWayMerge from '@teambit/legacy/dist/consumer/versions-ops/merge-version/three-way-merge';\nimport { SnapsDistance } from '@teambit/legacy/dist/scope/component-ops/snaps-distance';\nimport { NoCommonSnap } from '@teambit/legacy/dist/scope/exceptions/no-common-snap';\nimport { ConfigMerger } from './config-merger';\nimport { ComponentMergeStatus, ComponentMergeStatusBeforeMergeAttempt } from './merging.main.runtime';\n\nexport type MergeStatusProviderOptions = {\n resolveUnrelated?: MergeStrategy;\n ignoreConfigChanges?: boolean;\n shouldSquash?: boolean;\n};\n\nexport class MergeStatusProvider {\n constructor(\n private workspace: Workspace,\n private logger: Logger,\n private importer: ImporterMain,\n private currentLane?: Lane, // currently checked out lane. if on main, then it's undefined.\n private otherLane?: Lane, // the lane we want to merged to our lane. (undefined if it's \"main\").\n private options?: MergeStatusProviderOptions\n ) {}\n\n async getStatus(\n bitIds: ComponentID[] // the id.version is the version we want to merge to the current component\n ): Promise<ComponentMergeStatus[]> {\n if (!this.currentLane && this.otherLane) {\n await this.importer.importObjectsFromMainIfExist(this.otherLane.toBitIds().toVersionLatest());\n }\n const componentStatusBeforeMergeAttempt = await mapSeries(bitIds, (id) =>\n this.getComponentStatusBeforeMergeAttempt(id)\n );\n // whether or not we need to import the gap between the common-snap and the other lane.\n // the common-snap itself we need anyway in order to get the files hash/content for checking conflicts.\n const shouldImportHistoryOfOtherLane =\n !this.options?.shouldSquash && // when squashing, no need for all history, only the head is going to be pushed\n (!this.currentLane || // on main. we need all history in order to push each component to its remote\n this.currentLane.scope !== this.otherLane?.scope); // on lane, but the other lane is from a different scope. we need all history in order to push to the current lane's scope\n const toImport = componentStatusBeforeMergeAttempt\n .map((compStatus) => {\n if (!compStatus.divergeData) return [];\n const versionsToImport = [compStatus.divergeData.commonSnapBeforeDiverge];\n if (shouldImportHistoryOfOtherLane) {\n versionsToImport.push(...compStatus.divergeData.snapsOnTargetOnly);\n }\n return compact(versionsToImport).map((v) => compStatus.id.changeVersion(v.toString()));\n })\n .flat();\n const reason = shouldImportHistoryOfOtherLane\n ? `for filling the gap between the common-snap and the head of ${this.otherLane?.id() || 'main'}`\n : `for getting the common-snap between ${this.currentLane?.id() || 'main'} and ${this.otherLane?.id() || 'main'}`;\n await this.workspace.consumer.scope.scopeImporter.importWithoutDeps(ComponentIdList.fromArray(toImport), {\n lane: this.otherLane,\n cache: true,\n includeVersionHistory: false,\n reason,\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.workspace.consumer.scope);\n try {\n const componentsStatus = await Promise.all(\n compStatusNeedMerge.map((compStatus) => this.getComponentMergeStatus(compStatus))\n );\n await tmp.clear();\n return componentsStatus;\n } catch (err: any) {\n await tmp.clear();\n throw err;\n }\n };\n const results = await getComponentsStatusNeedMerge();\n\n results.push(...compStatusNotNeedMerge);\n return results;\n }\n\n private async getComponentMergeStatus(\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 repo = this.workspace.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 = this.currentLane?.toLaneId().toString() || 'main';\n const otherLaneName = this.otherLane ? this.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 this.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: this.workspace.consumer,\n otherComponent,\n otherLabel,\n currentComponent,\n currentLabel,\n baseComponent,\n });\n return { currentComponent, id, mergeResults, divergeData, configMergeResult };\n }\n\n private returnUnmerged(\n id: ComponentID,\n msg: string,\n unmergedLegitimately = false\n ): ComponentMergeStatusBeforeMergeAttempt {\n const componentStatus: ComponentMergeStatusBeforeMergeAttempt = { id };\n componentStatus.unchangedMessage = msg;\n componentStatus.unchangedLegitimately = unmergedLegitimately;\n return componentStatus;\n }\n\n private async getComponentStatusBeforeMergeAttempt(\n id: ComponentID // the id.version is the version we want to merge to the current component\n ): Promise<ComponentMergeStatusBeforeMergeAttempt> {\n const consumer = this.workspace.consumer;\n const componentStatus: ComponentMergeStatusBeforeMergeAttempt = { id };\n const modelComponent = await consumer.scope.getModelComponentIfExist(id);\n if (!modelComponent) {\n return this.returnUnmerged(\n id,\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);\n if (unmerged) {\n return this.returnUnmerged(\n id,\n `component ${id.toStringWithoutVersion()} is in during-merge state a previous merge, please snap/tag it first (or use bit merge --resolve/--abort/ bit lane merge-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.getComponentIdIfExist(id, { ignoreVersion: true });\n const componentOnOther: Version = await modelComponent.loadVersion(version, consumer.scope.objects);\n const idOnCurrentLane = this.currentLane?.getComponent(id);\n\n if (componentOnOther.isRemoved()) {\n // if exist in current lane, we want the current lane to get the soft-remove update.\n // or if it was removed with --update-main, we want to merge it so then main will get the update.\n const shouldMerge = idOnCurrentLane || componentOnOther.shouldRemoveFromMain();\n if (shouldMerge) {\n // remove the component from the workspace if exist.\n componentStatus.shouldBeRemoved = true;\n } else {\n // on main, don't merge soft-removed components unless it's marked with removeOnMain.\n // on lane, if it's not part of the current lane, don't merge it.\n return this.returnUnmerged(id, `component has been removed`, true);\n }\n }\n const getCurrentId = () => {\n if (existingBitMapId) return existingBitMapId;\n if (this.currentLane) {\n if (!idOnCurrentLane) return null;\n return idOnCurrentLane.id.changeVersion(idOnCurrentLane.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 { ...componentStatus, componentFromModel: componentOnOther, 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.isRemoved()) {\n // we have a few options:\n // 1. \"other\" is main. in this case, we don't care what happens on main, we want the component to stay deleted on\n // this lane. (even when main is ahead, we don't want to merge it).\n // 2. other is ahead. in this case, other recovered the component. so we can continue with the merge.\n // it is possible that it is diverged, in which case, still continue with the merge, and later on, the\n // merge-config will show a config conflict of the remove aspect.\n // 3. other is not ahead. in this case, just ignore this component, no point to merge it, we want it removed.\n const divergeData = await getDivergeData({ repo, modelComponent, targetHead: otherLaneHead, throws: false });\n const isTargetNotAhead = !divergeData.err && !divergeData.isTargetAhead();\n const shouldIgnore = this.otherLane\n ? isTargetNotAhead // option #2 and #3 above\n : true; // it's main. option #1 above.\n if (shouldIgnore) {\n return this.returnUnmerged(id, `component has been removed`, true);\n }\n }\n\n const isModified = async (): Promise<undefined | 'code' | 'config'> => {\n const componentModificationStatus = await this.workspace.getComponentStatusById(currentComponent.id);\n if (!componentModificationStatus.modified) return undefined;\n if (!existingBitMapId) return undefined;\n const baseComponent = await modelComponent.loadVersion(\n existingBitMapId.version as string,\n consumer.scope.objects\n );\n const isSourceCodeModified = await consumer.isComponentSourceCodeModified(baseComponent, currentComponent);\n if (isSourceCodeModified) return 'code';\n return 'config';\n };\n\n const modifiedType = await isModified();\n if (modifiedType === 'config' && !this.options?.ignoreConfigChanges) {\n return this.returnUnmerged(\n id,\n `component has config changes, please snap/tag it first. alternatively, use --ignore-config-changes flag to bypass`\n );\n }\n if (modifiedType === 'code') {\n return this.returnUnmerged(id, `component is modified, please snap/tag it first`);\n }\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 if (!(divergeData.err instanceof NoCommonSnap) || !this.options?.resolveUnrelated) {\n return this.returnUnmerged(\n id,\n `unable to traverse ${currentComponent.id.toString()} history. error: ${divergeData.err.message}`\n );\n }\n return this.handleNoCommonSnap(\n modelComponent,\n id,\n otherLaneHead,\n currentComponent,\n componentOnOther,\n divergeData\n );\n }\n if (!divergeData.isDiverged()) {\n if (divergeData.isSourceAhead()) {\n // do nothing!\n return this.returnUnmerged(id, `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 ...componentStatus,\n currentComponent,\n componentFromModel: componentOnOther,\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 this.returnUnmerged(id, `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\n return { ...componentStatus, currentComponent, mergeProps, divergeData };\n }\n\n private async handleNoCommonSnap(\n modelComponent: ModelComponent,\n id: ComponentID,\n otherLaneHead: Ref,\n currentComponent: ConsumerComponent,\n componentOnOther?: Version,\n divergeData?: SnapsDistance\n ): Promise<ComponentMergeStatusBeforeMergeAttempt> {\n let { resolveUnrelated } = this.options || {};\n if (currentComponent.isRemoved()) {\n resolveUnrelated = 'theirs';\n }\n if (!resolveUnrelated) throw new Error(`handleNoCommonSnap expects resolveUnrelated to be set`);\n const consumer = this.workspace.consumer;\n const repo = consumer.scope.objects;\n const mainHead = modelComponent.head;\n\n const returnAccordingToOurs = (\n headToSaveInLane: Ref,\n unrelatedHead: Ref,\n unrelatedLaneId: LaneId\n ): ComponentMergeStatusBeforeMergeAttempt => {\n return {\n currentComponent,\n id,\n divergeData,\n resolvedUnrelated: {\n strategy: 'ours',\n headOnCurrentLane: headToSaveInLane,\n unrelatedHead,\n unrelatedLaneId,\n },\n };\n };\n const returnAccordingToTheirs = (\n resolvedRef: Ref,\n unrelatedHeadRef: Ref,\n unrelatedLaneId: LaneId\n ): ComponentMergeStatusBeforeMergeAttempt => {\n // just override with the model data\n return {\n currentComponent,\n componentFromModel: componentOnOther,\n id,\n divergeData,\n resolvedUnrelated: {\n strategy: 'theirs',\n headOnCurrentLane: resolvedRef,\n unrelatedHead: unrelatedHeadRef,\n unrelatedLaneId,\n },\n };\n };\n\n const currentVersionRef = modelComponent.getRef(currentComponent.id.version as string);\n if (!currentVersionRef)\n throw new Error(\n `handleNoCommonSnap, unable to get ref of current version \"${\n currentComponent.id.version\n }\" for \"${id.toString()}\"`\n );\n const otherVersionRef = modelComponent.getRef(id.version as string);\n if (!otherVersionRef)\n throw new Error(`handleNoCommonSnap, unable to get ref of other version \"${id.version}\" for \"${id.toString()}\"`);\n\n if (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 this.returnUnmerged(\n id,\n `unable to traverse ${currentComponent.id.toString()} history. the main-head ${mainHead.toString()} doesn't appear in both lanes.\nit was probably created in each lane separately and it also exists on main. please merge main first to one of these lanes`\n );\n }\n const refToSaveInLane = hasResolvedLocally ? currentVersionRef : otherVersionRef;\n const unrelatedHeadRef = hasResolvedLocally ? otherVersionRef : currentVersionRef;\n if (resolveUnrelated === 'ours') {\n return returnAccordingToOurs(refToSaveInLane, unrelatedHeadRef, this.currentLane?.toLaneId() as LaneId);\n }\n if (resolveUnrelated === 'theirs') {\n return returnAccordingToTheirs(refToSaveInLane, unrelatedHeadRef, this.currentLane?.toLaneId() as LaneId);\n }\n throw new Error(\n `unsupported strategy \"${resolveUnrelated}\" of resolve-unrelated. supported strategies are: [ours, theirs]`\n );\n }\n\n const refToSaveInLane = resolveUnrelated === 'ours' ? currentVersionRef : otherVersionRef;\n const unrelatedHeadRef = resolveUnrelated === 'ours' ? otherVersionRef : currentVersionRef;\n if (resolveUnrelated === 'ours') {\n return returnAccordingToOurs(refToSaveInLane, unrelatedHeadRef, this.otherLane?.toLaneId() as LaneId);\n }\n if (resolveUnrelated === 'theirs') {\n return returnAccordingToTheirs(refToSaveInLane, unrelatedHeadRef, this.currentLane?.toLaneId() as LaneId);\n }\n throw new Error(\n `unsupported strategy \"${resolveUnrelated}\" of resolve-unrelated. supported strategies are: [ours, theirs]`\n );\n }\n}\n"],"mappings":";;;;;;AAEA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,aAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,YAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,gBAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,eAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAM,cAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,aAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIA,SAAAO,QAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,OAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,eAAA;EAAA,MAAAR,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAM,cAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAS,cAAA;EAAA,MAAAT,IAAA,GAAAE,OAAA;EAAAO,aAAA,YAAAA,CAAA;IAAA,OAAAT,IAAA;EAAA;EA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,uBAAuB,CAACY,eAAe,EAAEV,gBAAgB,EAAE,IAAI,CAAC5I,WAAW,EAAEkE,QAAQ,CAAC,CAAW,CAAC;IAC3G;IACA,MAAM,IAAId,KAAK,CACZ,yBAAwByE,gBAAiB,kEAC5C,CAAC;EACH;AACF;AAAC0B,OAAA,CAAA5J,mBAAA,GAAAA,mBAAA"}
1
+ {"version":3,"names":["_pMapSeries","data","_interopRequireDefault","require","_componentId","_laneId","_getDivergeData","_repositories","_lodash","_threeWayMerge","_noCommonSnap","_configMerger","obj","__esModule","default","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","key","value","_toPropertyKey","configurable","writable","i","_toPrimitive","String","Symbol","toPrimitive","call","TypeError","Number","MergeStatusProvider","constructor","workspace","logger","importer","currentLane","otherLane","options","getStatus","bitIds","importObjectsFromMainIfExist","toBitIds","toVersionLatest","componentStatusBeforeMergeAttempt","mapSeries","id","getComponentStatusBeforeMergeAttempt","shouldImportHistoryOfOtherLane","shouldSquash","scope","toImport","map","compStatus","divergeData","versionsToImport","commonSnapBeforeDiverge","snapsOnTargetOnly","compact","v","changeVersion","toString","flat","reason","consumer","scopeImporter","importWithoutDeps","ComponentIdList","fromArray","lane","cache","includeVersionHistory","compStatusNotNeedMerge","c","mergeProps","compStatusNeedMerge","getComponentsStatusNeedMerge","tmp","Tmp","componentsStatus","Promise","all","getComponentMergeStatus","clear","err","results","componentMergeStatusBeforeMergeAttempt","currentComponent","Error","otherLaneHead","currentId","modelComponent","repo","objects","baseSnap","debug","toStringWithoutVersion","version","baseComponent","loadVersion","otherComponent","currentLaneName","toLaneId","otherLaneName","DEFAULT_LANE","currentLabel","otherLabel","workspaceIds","listIds","configMerger","ComponentConfigMerger","extensions","configMergeResult","merge","mergeResults","threeWayMerge","returnUnmerged","msg","unmergedLegitimately","componentStatus","unchangedMessage","unchangedLegitimately","getModelComponentIfExist","unmerged","unmergedComponents","getEntry","getRef","existingBitMapId","bitMap","getComponentIdIfExist","ignoreVersion","componentOnOther","idOnCurrentLane","getComponent","isRemoved","shouldMerge","shouldRemoveFromMain","shouldBeRemoved","getCurrentId","head","getHeadAsTagIfExist","getDivergeData","targetHead","throws","componentFromModel","getCurrentComponent","loadComponent","getConsumerComponent","isTargetNotAhead","isTargetAhead","shouldIgnore","isModified","componentModificationStatus","getComponentStatusById","modified","undefined","isSourceCodeModified","isComponentSourceCodeModified","modifiedType","ignoreConfigChanges","NoCommonSnap","resolveUnrelated","message","handleNoCommonSnap","isDiverged","isSourceAhead","mainHead","returnAccordingToOurs","headToSaveInLane","unrelatedHead","unrelatedLaneId","resolvedUnrelated","strategy","headOnCurrentLane","returnAccordingToTheirs","resolvedRef","unrelatedHeadRef","currentVersionRef","otherVersionRef","hasResolvedFromMain","hashToCompare","divergeDataFromMain","sourceHead","hasResolvedLocally","getHeadRegardlessOfLane","hasResolvedRemotely","refToSaveInLane","exports"],"sources":["merge-status-provider.ts"],"sourcesContent":["import { Workspace } from '@teambit/workspace';\nimport { MergeStrategy } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport mapSeries from 'p-map-series';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport { DEFAULT_LANE, LaneId } from '@teambit/lane-id';\nimport { getDivergeData } from '@teambit/legacy/dist/scope/component-ops/get-diverge-data';\nimport { Lane, ModelComponent, Version } from '@teambit/legacy/dist/scope/models';\nimport { Ref } from '@teambit/legacy/dist/scope/objects';\nimport { Tmp } from '@teambit/legacy/dist/scope/repositories';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component/consumer-component';\nimport { ImporterMain } from '@teambit/importer';\nimport { Logger } from '@teambit/logger';\nimport { compact } from 'lodash';\nimport threeWayMerge from '@teambit/legacy/dist/consumer/versions-ops/merge-version/three-way-merge';\nimport { SnapsDistance } from '@teambit/legacy/dist/scope/component-ops/snaps-distance';\nimport { NoCommonSnap } from '@teambit/legacy/dist/scope/exceptions/no-common-snap';\nimport { ComponentConfigMerger } from '@teambit/config-merger';\nimport { ComponentMergeStatus, ComponentMergeStatusBeforeMergeAttempt } from './merging.main.runtime';\n\nexport type MergeStatusProviderOptions = {\n resolveUnrelated?: MergeStrategy;\n ignoreConfigChanges?: boolean;\n shouldSquash?: boolean;\n};\n\nexport class MergeStatusProvider {\n constructor(\n private workspace: Workspace,\n private logger: Logger,\n private importer: ImporterMain,\n private currentLane?: Lane, // currently checked out lane. if on main, then it's undefined.\n private otherLane?: Lane, // the lane we want to merged to our lane. (undefined if it's \"main\").\n private options?: MergeStatusProviderOptions\n ) {}\n\n async getStatus(\n bitIds: ComponentID[] // the id.version is the version we want to merge to the current component\n ): Promise<ComponentMergeStatus[]> {\n if (!this.currentLane && this.otherLane) {\n await this.importer.importObjectsFromMainIfExist(this.otherLane.toBitIds().toVersionLatest());\n }\n const componentStatusBeforeMergeAttempt = await mapSeries(bitIds, (id) =>\n this.getComponentStatusBeforeMergeAttempt(id)\n );\n // whether or not we need to import the gap between the common-snap and the other lane.\n // the common-snap itself we need anyway in order to get the files hash/content for checking conflicts.\n const shouldImportHistoryOfOtherLane =\n !this.options?.shouldSquash && // when squashing, no need for all history, only the head is going to be pushed\n (!this.currentLane || // on main. we need all history in order to push each component to its remote\n this.currentLane.scope !== this.otherLane?.scope); // on lane, but the other lane is from a different scope. we need all history in order to push to the current lane's scope\n const toImport = componentStatusBeforeMergeAttempt\n .map((compStatus) => {\n if (!compStatus.divergeData) return [];\n const versionsToImport = [compStatus.divergeData.commonSnapBeforeDiverge];\n if (shouldImportHistoryOfOtherLane) {\n versionsToImport.push(...compStatus.divergeData.snapsOnTargetOnly);\n }\n return compact(versionsToImport).map((v) => compStatus.id.changeVersion(v.toString()));\n })\n .flat();\n const reason = shouldImportHistoryOfOtherLane\n ? `for filling the gap between the common-snap and the head of ${this.otherLane?.id() || 'main'}`\n : `for getting the common-snap between ${this.currentLane?.id() || 'main'} and ${this.otherLane?.id() || 'main'}`;\n await this.workspace.consumer.scope.scopeImporter.importWithoutDeps(ComponentIdList.fromArray(toImport), {\n lane: this.otherLane,\n cache: true,\n includeVersionHistory: false,\n reason,\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.workspace.consumer.scope);\n try {\n const componentsStatus = await Promise.all(\n compStatusNeedMerge.map((compStatus) => this.getComponentMergeStatus(compStatus))\n );\n await tmp.clear();\n return componentsStatus;\n } catch (err: any) {\n await tmp.clear();\n throw err;\n }\n };\n const results = await getComponentsStatusNeedMerge();\n\n results.push(...compStatusNotNeedMerge);\n return results;\n }\n\n private async getComponentMergeStatus(\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 repo = this.workspace.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 = this.currentLane?.toLaneId().toString() || 'main';\n const otherLaneName = this.otherLane ? this.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 ComponentConfigMerger(\n id.toStringWithoutVersion(),\n workspaceIds,\n this.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: this.workspace.consumer,\n otherComponent,\n otherLabel,\n currentComponent,\n currentLabel,\n baseComponent,\n });\n return { currentComponent, id, mergeResults, divergeData, configMergeResult };\n }\n\n private returnUnmerged(\n id: ComponentID,\n msg: string,\n unmergedLegitimately = false\n ): ComponentMergeStatusBeforeMergeAttempt {\n const componentStatus: ComponentMergeStatusBeforeMergeAttempt = { id };\n componentStatus.unchangedMessage = msg;\n componentStatus.unchangedLegitimately = unmergedLegitimately;\n return componentStatus;\n }\n\n private async getComponentStatusBeforeMergeAttempt(\n id: ComponentID // the id.version is the version we want to merge to the current component\n ): Promise<ComponentMergeStatusBeforeMergeAttempt> {\n const consumer = this.workspace.consumer;\n const componentStatus: ComponentMergeStatusBeforeMergeAttempt = { id };\n const modelComponent = await consumer.scope.getModelComponentIfExist(id);\n if (!modelComponent) {\n return this.returnUnmerged(\n id,\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);\n if (unmerged) {\n return this.returnUnmerged(\n id,\n `component ${id.toStringWithoutVersion()} is in during-merge state a previous merge, please snap/tag it first (or use bit merge --resolve/--abort/ bit lane merge-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.getComponentIdIfExist(id, { ignoreVersion: true });\n const componentOnOther: Version = await modelComponent.loadVersion(version, consumer.scope.objects);\n const idOnCurrentLane = this.currentLane?.getComponent(id);\n\n if (componentOnOther.isRemoved()) {\n // if exist in current lane, we want the current lane to get the soft-remove update.\n // or if it was removed with --update-main, we want to merge it so then main will get the update.\n const shouldMerge = idOnCurrentLane || componentOnOther.shouldRemoveFromMain();\n if (shouldMerge) {\n // remove the component from the workspace if exist.\n componentStatus.shouldBeRemoved = true;\n } else {\n // on main, don't merge soft-removed components unless it's marked with removeOnMain.\n // on lane, if it's not part of the current lane, don't merge it.\n return this.returnUnmerged(id, `component has been removed`, true);\n }\n }\n const getCurrentId = () => {\n if (existingBitMapId) return existingBitMapId;\n if (this.currentLane) {\n if (!idOnCurrentLane) return null;\n return idOnCurrentLane.id.changeVersion(idOnCurrentLane.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 { ...componentStatus, componentFromModel: componentOnOther, 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.isRemoved()) {\n // we have a few options:\n // 1. \"other\" is main. in this case, we don't care what happens on main, we want the component to stay deleted on\n // this lane. (even when main is ahead, we don't want to merge it).\n // 2. other is ahead. in this case, other recovered the component. so we can continue with the merge.\n // it is possible that it is diverged, in which case, still continue with the merge, and later on, the\n // merge-config will show a config conflict of the remove aspect.\n // 3. other is not ahead. in this case, just ignore this component, no point to merge it, we want it removed.\n const divergeData = await getDivergeData({ repo, modelComponent, targetHead: otherLaneHead, throws: false });\n const isTargetNotAhead = !divergeData.err && !divergeData.isTargetAhead();\n const shouldIgnore = this.otherLane\n ? isTargetNotAhead // option #2 and #3 above\n : true; // it's main. option #1 above.\n if (shouldIgnore) {\n return this.returnUnmerged(id, `component has been removed`, true);\n }\n }\n\n const isModified = async (): Promise<undefined | 'code' | 'config'> => {\n const componentModificationStatus = await this.workspace.getComponentStatusById(currentComponent.id);\n if (!componentModificationStatus.modified) return undefined;\n if (!existingBitMapId) return undefined;\n const baseComponent = await modelComponent.loadVersion(\n existingBitMapId.version as string,\n consumer.scope.objects\n );\n const isSourceCodeModified = await consumer.isComponentSourceCodeModified(baseComponent, currentComponent);\n if (isSourceCodeModified) return 'code';\n return 'config';\n };\n\n const modifiedType = await isModified();\n if (modifiedType === 'config' && !this.options?.ignoreConfigChanges) {\n return this.returnUnmerged(\n id,\n `component has config changes, please snap/tag it first. alternatively, use --ignore-config-changes flag to bypass`\n );\n }\n if (modifiedType === 'code') {\n return this.returnUnmerged(id, `component is modified, please snap/tag it first`);\n }\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 if (!(divergeData.err instanceof NoCommonSnap) || !this.options?.resolveUnrelated) {\n return this.returnUnmerged(\n id,\n `unable to traverse ${currentComponent.id.toString()} history. error: ${divergeData.err.message}`\n );\n }\n return this.handleNoCommonSnap(\n modelComponent,\n id,\n otherLaneHead,\n currentComponent,\n componentOnOther,\n divergeData\n );\n }\n if (!divergeData.isDiverged()) {\n if (divergeData.isSourceAhead()) {\n // do nothing!\n return this.returnUnmerged(id, `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 ...componentStatus,\n currentComponent,\n componentFromModel: componentOnOther,\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 this.returnUnmerged(id, `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\n return { ...componentStatus, currentComponent, mergeProps, divergeData };\n }\n\n private async handleNoCommonSnap(\n modelComponent: ModelComponent,\n id: ComponentID,\n otherLaneHead: Ref,\n currentComponent: ConsumerComponent,\n componentOnOther?: Version,\n divergeData?: SnapsDistance\n ): Promise<ComponentMergeStatusBeforeMergeAttempt> {\n let { resolveUnrelated } = this.options || {};\n if (currentComponent.isRemoved()) {\n resolveUnrelated = 'theirs';\n }\n if (!resolveUnrelated) throw new Error(`handleNoCommonSnap expects resolveUnrelated to be set`);\n const consumer = this.workspace.consumer;\n const repo = consumer.scope.objects;\n const mainHead = modelComponent.head;\n\n const returnAccordingToOurs = (\n headToSaveInLane: Ref,\n unrelatedHead: Ref,\n unrelatedLaneId: LaneId\n ): ComponentMergeStatusBeforeMergeAttempt => {\n return {\n currentComponent,\n id,\n divergeData,\n resolvedUnrelated: {\n strategy: 'ours',\n headOnCurrentLane: headToSaveInLane,\n unrelatedHead,\n unrelatedLaneId,\n },\n };\n };\n const returnAccordingToTheirs = (\n resolvedRef: Ref,\n unrelatedHeadRef: Ref,\n unrelatedLaneId: LaneId\n ): ComponentMergeStatusBeforeMergeAttempt => {\n // just override with the model data\n return {\n currentComponent,\n componentFromModel: componentOnOther,\n id,\n divergeData,\n resolvedUnrelated: {\n strategy: 'theirs',\n headOnCurrentLane: resolvedRef,\n unrelatedHead: unrelatedHeadRef,\n unrelatedLaneId,\n },\n };\n };\n\n const currentVersionRef = modelComponent.getRef(currentComponent.id.version as string);\n if (!currentVersionRef)\n throw new Error(\n `handleNoCommonSnap, unable to get ref of current version \"${\n currentComponent.id.version\n }\" for \"${id.toString()}\"`\n );\n const otherVersionRef = modelComponent.getRef(id.version as string);\n if (!otherVersionRef)\n throw new Error(`handleNoCommonSnap, unable to get ref of other version \"${id.version}\" for \"${id.toString()}\"`);\n\n if (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 this.returnUnmerged(\n id,\n `unable to traverse ${currentComponent.id.toString()} history. the main-head ${mainHead.toString()} doesn't appear in both lanes.\nit was probably created in each lane separately and it also exists on main. please merge main first to one of these lanes`\n );\n }\n const refToSaveInLane = hasResolvedLocally ? currentVersionRef : otherVersionRef;\n const unrelatedHeadRef = hasResolvedLocally ? otherVersionRef : currentVersionRef;\n if (resolveUnrelated === 'ours') {\n return returnAccordingToOurs(refToSaveInLane, unrelatedHeadRef, this.currentLane?.toLaneId() as LaneId);\n }\n if (resolveUnrelated === 'theirs') {\n return returnAccordingToTheirs(refToSaveInLane, unrelatedHeadRef, this.currentLane?.toLaneId() as LaneId);\n }\n throw new Error(\n `unsupported strategy \"${resolveUnrelated}\" of resolve-unrelated. supported strategies are: [ours, theirs]`\n );\n }\n\n const refToSaveInLane = resolveUnrelated === 'ours' ? currentVersionRef : otherVersionRef;\n const unrelatedHeadRef = resolveUnrelated === 'ours' ? otherVersionRef : currentVersionRef;\n if (resolveUnrelated === 'ours') {\n return returnAccordingToOurs(refToSaveInLane, unrelatedHeadRef, this.otherLane?.toLaneId() as LaneId);\n }\n if (resolveUnrelated === 'theirs') {\n return returnAccordingToTheirs(refToSaveInLane, unrelatedHeadRef, this.currentLane?.toLaneId() as LaneId);\n }\n throw new Error(\n `unsupported strategy \"${resolveUnrelated}\" of resolve-unrelated. supported strategies are: [ours, theirs]`\n );\n }\n}\n"],"mappings":";;;;;;AAEA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA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Main } from '@teambit/logger';
17
17
  import { GlobalConfigMain } from '@teambit/global-config';
18
18
  import { MergeResultsThreeWay } from '@teambit/legacy/dist/consumer/versions-ops/merge-version/three-way-merge';
19
- import { WorkspacePolicyConfigKeysNames } from '@teambit/dependency-resolver';
20
19
  import { CheckoutMain, ComponentStatusBase } from '@teambit/checkout';
20
+ import { ConfigMergerMain, ConfigMergeResult, WorkspaceDepsUpdates, WorkspaceDepsConflicts } from '@teambit/config-merger';
21
21
  import { SnapsDistance } from '@teambit/legacy/dist/scope/component-ops/snaps-distance';
22
22
  import { InstallMain } from '@teambit/install';
23
- import { ConfigMergeResult } from './config-merge-result';
24
23
  import { MergeStatusProviderOptions } from './merge-status-provider';
25
24
  type ResolveUnrelatedData = {
26
25
  strategy: MergeStrategy;
@@ -28,13 +27,6 @@ type ResolveUnrelatedData = {
28
27
  unrelatedHead: Ref;
29
28
  unrelatedLaneId: LaneId;
30
29
  };
31
- export type WorkspaceDepsUpdates = {
32
- [pkgName: string]: [string, string];
33
- };
34
- export type WorkspaceDepsConflicts = Record<WorkspacePolicyConfigKeysNames, Array<{
35
- name: string;
36
- version: string;
37
- }>>;
38
30
  export type ComponentMergeStatus = ComponentStatusBase & {
39
31
  mergeResults?: MergeResultsThreeWay | null;
40
32
  divergeData?: SnapsDistance;
@@ -96,7 +88,8 @@ export declare class MergingMain {
96
88
  private importer;
97
89
  private config;
98
90
  private remove;
99
- constructor(workspace: Workspace, install: InstallMain, snapping: SnappingMain, checkout: CheckoutMain, logger: Logger, componentWriter: ComponentWriterMain, importer: ImporterMain, config: ConfigMain, remove: RemoveMain);
91
+ private configMerger;
92
+ constructor(workspace: Workspace, install: InstallMain, snapping: SnappingMain, checkout: CheckoutMain, logger: Logger, componentWriter: ComponentWriterMain, importer: ImporterMain, config: ConfigMain, remove: RemoveMain, configMerger: ConfigMergerMain);
100
93
  merge(ids: string[], mergeStrategy: MergeStrategy, abort: boolean, resolve: boolean, noSnap: boolean, message: string, build: boolean, skipDependencyInstallation: boolean): Promise<ApplyVersionResults>;
101
94
  /**
102
95
  * when user is on main, it merges the remote main components into local.
@@ -117,10 +110,6 @@ export declare class MergingMain {
117
110
  build: boolean;
118
111
  skipDependencyInstallation?: boolean;
119
112
  }): Promise<ApplyVersionResults>;
120
- private generateConfigMergeConflictFileForAll;
121
- writeWorkspaceJsoncWithConflictsGracefully(workspaceDepsConflicts: WorkspaceDepsConflicts): Promise<Error | undefined>;
122
- private writeWorkspaceJsoncWithConflicts;
123
- private updateWorkspaceJsoncWithDepsIfNeeded;
124
113
  /**
125
114
  * this function gets called from two different commands:
126
115
  * 1. "bit merge <ids...>", when merging a component from a remote to the local.
@@ -143,7 +132,7 @@ export declare class MergingMain {
143
132
  static slots: any[];
144
133
  static dependencies: import("@teambit/harmony").Aspect[];
145
134
  static runtime: import("@teambit/harmony").RuntimeDefinition;
146
- static provider([cli, workspace, snapping, checkout, install, loggerMain, compWriter, importer, config, remove, globalConfig,]: [
135
+ static provider([cli, workspace, snapping, checkout, install, loggerMain, compWriter, importer, config, remove, globalConfig, configMerger,]: [
147
136
  CLIMain,
148
137
  Workspace,
149
138
  SnappingMain,
@@ -154,7 +143,8 @@ export declare class MergingMain {
154
143
  ImporterMain,
155
144
  ConfigMain,
156
145
  RemoveMain,
157
- GlobalConfigMain
146
+ GlobalConfigMain,
147
+ ConfigMergerMain
158
148
  ]): Promise<MergingMain>;
159
149
  }
160
150
  export {};