@teambit/merging 0.0.126 → 0.0.127
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/merge-cmd.d.ts +2 -1
- package/dist/merge-cmd.js +4 -3
- package/dist/merge-cmd.js.map +1 -1
- package/dist/merging.main.runtime.d.ts +4 -3
- package/dist/merging.main.runtime.js +17 -11
- package/dist/merging.main.runtime.js.map +1 -1
- package/package-tar/teambit-merging-0.0.127.tgz +0 -0
- package/package.json +7 -7
- /package/{preview-1660015726089.js → preview-1660102118004.js} +0 -0
- package/package-tar/teambit-merging-0.0.126.tgz +0 -0
package/dist/merge-cmd.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export declare class MergeCmd implements Command {
|
|
|
11
11
|
options: CommandOptions;
|
|
12
12
|
loader: boolean;
|
|
13
13
|
constructor(merging: MergingMain);
|
|
14
|
-
report([values]: [string[]], { ours, theirs, manual, abort, resolve, build, noSnap, message, }: {
|
|
14
|
+
report([values]: [string[]], { ours, theirs, manual, abort, resolve, build, noSnap, message, skipDependencyInstallation, }: {
|
|
15
15
|
ours?: boolean;
|
|
16
16
|
theirs?: boolean;
|
|
17
17
|
manual?: boolean;
|
|
@@ -20,6 +20,7 @@ export declare class MergeCmd implements Command {
|
|
|
20
20
|
build?: boolean;
|
|
21
21
|
noSnap?: boolean;
|
|
22
22
|
message: string;
|
|
23
|
+
skipDependencyInstallation?: boolean;
|
|
23
24
|
}): Promise<string>;
|
|
24
25
|
}
|
|
25
26
|
export declare function mergeReport({ components, failedComponents, version, mergeSnapResults, leftUnresolvedConflicts, }: ApplyVersionResults): string;
|
package/dist/merge-cmd.js
CHANGED
|
@@ -83,7 +83,7 @@ class MergeCmd {
|
|
|
83
83
|
\`bit merge [ids...]\` => EXPERIMENTAL. merge changes of the remote head into local, optionally use '--abort' or '--resolve'
|
|
84
84
|
${(0, _constants().WILDCARD_HELP)('merge 0.0.1')}`);
|
|
85
85
|
(0, _defineProperty2().default)(this, "alias", '');
|
|
86
|
-
(0, _defineProperty2().default)(this, "options", [['', 'ours', 'in case of a conflict, override the used version with the current modification'], ['', 'theirs', 'in case of a conflict, override the current modification with the specified version'], ['', 'manual', 'in case of a conflict, leave the files with a conflict state to resolve them manually later'], ['', 'abort', 'EXPERIMENTAL. in case of an unresolved merge, revert to the state before the merge began'], ['', 'resolve', 'EXPERIMENTAL. mark an unresolved merge as resolved and create a new snap with the changes'], ['', 'no-snap', 'EXPERIMENTAL. do not auto snap in case the merge completed without conflicts'], ['', 'build', 'in case of snap during the merge, run the build-pipeline (similar to bit snap --build)'], ['m', 'message <message>', 'EXPERIMENTAL. override the default message for the auto snap']]);
|
|
86
|
+
(0, _defineProperty2().default)(this, "options", [['', 'ours', 'in case of a conflict, override the used version with the current modification'], ['', 'theirs', 'in case of a conflict, override the current modification with the specified version'], ['', 'manual', 'in case of a conflict, leave the files with a conflict state to resolve them manually later'], ['', 'abort', 'EXPERIMENTAL. in case of an unresolved merge, revert to the state before the merge began'], ['', 'resolve', 'EXPERIMENTAL. mark an unresolved merge as resolved and create a new snap with the changes'], ['', 'no-snap', 'EXPERIMENTAL. do not auto snap in case the merge completed without conflicts'], ['', 'build', 'in case of snap during the merge, run the build-pipeline (similar to bit snap --build)'], ['', 'skip-dependency-installation', 'do not install packages of the imported components'], ['m', 'message <message>', 'EXPERIMENTAL. override the default message for the auto snap']]);
|
|
87
87
|
(0, _defineProperty2().default)(this, "loader", true);
|
|
88
88
|
}
|
|
89
89
|
|
|
@@ -95,7 +95,8 @@ class MergeCmd {
|
|
|
95
95
|
resolve = false,
|
|
96
96
|
build = false,
|
|
97
97
|
noSnap = false,
|
|
98
|
-
message
|
|
98
|
+
message,
|
|
99
|
+
skipDependencyInstallation = false
|
|
99
100
|
}) {
|
|
100
101
|
build = (0, _featureToggle().isFeatureEnabled)(_featureToggle().BUILD_ON_CI) ? Boolean(build) : true;
|
|
101
102
|
const mergeStrategy = (0, _mergeVersion().getMergeStrategy)(ours, theirs, manual);
|
|
@@ -108,7 +109,7 @@ class MergeCmd {
|
|
|
108
109
|
resolvedComponents,
|
|
109
110
|
abortedComponents,
|
|
110
111
|
mergeSnapResults
|
|
111
|
-
} = await this.merging.merge(values, mergeStrategy, abort, resolve, noSnap, message, build);
|
|
112
|
+
} = await this.merging.merge(values, mergeStrategy, abort, resolve, noSnap, message, build, skipDependencyInstallation);
|
|
112
113
|
|
|
113
114
|
if (resolvedComponents) {
|
|
114
115
|
const title = 'successfully resolved component(s)\n';
|
package/dist/merge-cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["MergeCmd","constructor","merging","WILDCARD_HELP","report","values","ours","theirs","manual","abort","resolve","build","noSnap","message","isFeatureEnabled","BUILD_ON_CI","Boolean","mergeStrategy","getMergeStrategy","BitError","components","failedComponents","version","resolvedComponents","abortedComponents","mergeSnapResults","merge","title","componentsStr","map","c","id","toStringWithoutVersion","join","chalk","underline","green","mergeReport","leftUnresolvedConflicts","getSuccessOutput","length","bold","applyVersionReport","getConflictSummary","suggestion","conflictSummaryReport","yellow","getSnapsOutput","snappedComponents","autoSnappedResults","outputComponents","comps","component","componentOutput","toString","autoTag","filter","result","triggeredBy","searchWithoutScopeAndVersion","autoTagComp","a","AUTO_SNAPPED_MSG","getFailureOutput","body","failedComponent","color","unchangedLegitimately","failureMessage"],"sources":["merge-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { WILDCARD_HELP, AUTO_SNAPPED_MSG } from '@teambit/legacy/dist/constants';\nimport {\n ApplyVersionResults,\n conflictSummaryReport,\n getMergeStrategy,\n applyVersionReport,\n} from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { isFeatureEnabled, BUILD_ON_CI } from '@teambit/legacy/dist/api/consumer/lib/feature-toggle';\nimport { BitError } from '@teambit/bit-error';\nimport { MergingMain } from './merging.main.runtime';\n\nexport class MergeCmd implements Command {\n name = 'merge [values...]';\n description = 'merge changes of different component versions';\n group = 'development';\n extendedDescription = `merge changes of different component versions\n \\`bit merge <version> [ids...]\\` => merge changes of the given version into the checked out version\n \\`bit merge [ids...]\\` => EXPERIMENTAL. merge changes of the remote head into local, optionally use '--abort' or '--resolve'\n ${WILDCARD_HELP('merge 0.0.1')}`;\n alias = '';\n options = [\n ['', 'ours', 'in case of a conflict, override the used version with the current modification'],\n ['', 'theirs', 'in case of a conflict, override the current modification with the specified version'],\n ['', 'manual', 'in case of a conflict, leave the files with a conflict state to resolve them manually later'],\n ['', 'abort', 'EXPERIMENTAL. in case of an unresolved merge, revert to the state before the merge began'],\n ['', 'resolve', 'EXPERIMENTAL. mark an unresolved merge as resolved and create a new snap with the changes'],\n ['', 'no-snap', 'EXPERIMENTAL. do not auto snap in case the merge completed without conflicts'],\n ['', 'build', 'in case of snap during the merge, run the build-pipeline (similar to bit snap --build)'],\n ['m', 'message <message>', 'EXPERIMENTAL. override the default message for the auto snap'],\n ] as CommandOptions;\n loader = true;\n\n constructor(private merging: MergingMain) {}\n\n async report(\n [values = []]: [string[]],\n {\n ours = false,\n theirs = false,\n manual = false,\n abort = false,\n resolve = false,\n build = false,\n noSnap = false,\n message,\n }: {\n ours?: boolean;\n theirs?: boolean;\n manual?: boolean;\n abort?: boolean;\n resolve?: boolean;\n build?: boolean;\n noSnap?: boolean;\n message: string;\n }\n ) {\n build = isFeatureEnabled(BUILD_ON_CI) ? Boolean(build) : true;\n const mergeStrategy = getMergeStrategy(ours, theirs, manual);\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 }: ApplyVersionResults = await this.merging.merge(\n values,\n mergeStrategy as any,\n abort,\n resolve,\n noSnap,\n message,\n build\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 });\n }\n}\n\nexport function mergeReport({\n components,\n failedComponents,\n version,\n mergeSnapResults,\n leftUnresolvedConflicts,\n}: ApplyVersionResults): string {\n const getSuccessOutput = () => {\n if (!components || !components.length) return '';\n // @ts-ignore version is set in case of merge command\n const title = `successfully merged components${version ? `from version ${chalk.bold(version)}` : ''}\\n`;\n // @ts-ignore components is set in case of merge command\n return chalk.underline(title) + chalk.green(applyVersionReport(components));\n };\n\n const getConflictSummary = () => {\n if (!components || !components.length || !leftUnresolvedConflicts) return '';\n const title = `files with conflicts summary\\n`;\n const suggestion = `\\n\\nthe merge process wasn't completed due to the conflicts above. fix them manually and then run \"bit install\".\nonce ready, snap/tag the components to complete the merge.`;\n return chalk.underline(title) + conflictSummaryReport(components) + chalk.yellow(suggestion);\n };\n\n const getSnapsOutput = () => {\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) =>\n result.triggeredBy.searchWithoutScopeAndVersion(component.id)\n );\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 that snapped as a result of the merge'})\\n${outputComponents(snappedComponents)}\\n`;\n };\n\n const getFailureOutput = () => {\n if (!failedComponents || !failedComponents.length) return '';\n const title = '\\nthe merge has been canceled on the following component(s)';\n const body = failedComponents\n .map((failedComponent) => {\n const color = failedComponent.unchangedLegitimately ? 'white' : 'red';\n return `${chalk.bold(failedComponent.id.toString())} - ${chalk[color](failedComponent.failureMessage)}`;\n })\n .join('\\n');\n return `\\n${chalk.underline(title)}\\n${body}\\n\\n`;\n };\n\n return getSuccessOutput() + getFailureOutput() + getSnapsOutput() + getConflictSummary();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAMA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGO,MAAMA,QAAN,CAAkC;EAqBvCC,WAAW,CAASC,OAAT,EAA+B;IAAA,KAAtBA,OAAsB,GAAtBA,OAAsB;IAAA,8CApBnC,mBAoBmC;IAAA,qDAnB5B,+CAmB4B;IAAA,+CAlBlC,aAkBkC;IAAA,6DAjBnB;AACzB;AACA;AACA,IAAI,IAAAC,0BAAA,EAAc,aAAd,CAA6B,EAcW;IAAA,+CAblC,EAakC;IAAA,iDAZhC,CACR,CAAC,EAAD,EAAK,MAAL,EAAa,gFAAb,CADQ,EAER,CAAC,EAAD,EAAK,QAAL,EAAe,qFAAf,CAFQ,EAGR,CAAC,EAAD,EAAK,QAAL,EAAe,6FAAf,CAHQ,EAIR,CAAC,EAAD,EAAK,OAAL,EAAc,0FAAd,CAJQ,EAKR,CAAC,EAAD,EAAK,SAAL,EAAgB,2FAAhB,CALQ,EAMR,CAAC,EAAD,EAAK,SAAL,EAAgB,8EAAhB,CANQ,EAOR,CAAC,EAAD,EAAK,OAAL,EAAc,wFAAd,CAPQ,EAQR,CAAC,GAAD,EAAM,mBAAN,EAA2B,8DAA3B,CARQ,CAYgC;IAA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AD,IAAqB;MACxB,MAAMC,KAAK,GAAGD,eAAe,CAACE,qBAAhB,GAAwC,OAAxC,GAAkD,KAAhE;MACA,OAAQ,GAAEjC,gBAAA,CAAMO,IAAN,CAAWwB,eAAe,CAAClC,EAAhB,CAAmBuB,QAAnB,EAAX,CAA0C,MAAKpB,gBAAA,CAAMgC,KAAN,EAAaD,eAAe,CAACG,cAA7B,CAA6C,EAAtG;IACD,CAJU,EAKVnC,IALU,CAKL,IALK,CAAb;IAMA,OAAQ,KAAIC,gBAAA,CAAMC,SAAN,CAAgBR,KAAhB,CAAuB,KAAIqC,IAAK,MAA5C;EACD,CAVD;;EAYA,OAAOzB,gBAAgB,KAAKwB,gBAAgB,EAArC,GAA0ChB,cAAc,EAAxD,GAA6DJ,kBAAkB,EAAtF;AACD"}
|
|
1
|
+
{"version":3,"names":["MergeCmd","constructor","merging","WILDCARD_HELP","report","values","ours","theirs","manual","abort","resolve","build","noSnap","message","skipDependencyInstallation","isFeatureEnabled","BUILD_ON_CI","Boolean","mergeStrategy","getMergeStrategy","BitError","components","failedComponents","version","resolvedComponents","abortedComponents","mergeSnapResults","merge","title","componentsStr","map","c","id","toStringWithoutVersion","join","chalk","underline","green","mergeReport","leftUnresolvedConflicts","getSuccessOutput","length","bold","applyVersionReport","getConflictSummary","suggestion","conflictSummaryReport","yellow","getSnapsOutput","snappedComponents","autoSnappedResults","outputComponents","comps","component","componentOutput","toString","autoTag","filter","result","triggeredBy","searchWithoutScopeAndVersion","autoTagComp","a","AUTO_SNAPPED_MSG","getFailureOutput","body","failedComponent","color","unchangedLegitimately","failureMessage"],"sources":["merge-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { WILDCARD_HELP, AUTO_SNAPPED_MSG } from '@teambit/legacy/dist/constants';\nimport {\n ApplyVersionResults,\n conflictSummaryReport,\n getMergeStrategy,\n applyVersionReport,\n} from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { isFeatureEnabled, BUILD_ON_CI } from '@teambit/legacy/dist/api/consumer/lib/feature-toggle';\nimport { BitError } from '@teambit/bit-error';\nimport { MergingMain } from './merging.main.runtime';\n\nexport class MergeCmd implements Command {\n name = 'merge [values...]';\n description = 'merge changes of different component versions';\n group = 'development';\n extendedDescription = `merge changes of different component versions\n \\`bit merge <version> [ids...]\\` => merge changes of the given version into the checked out version\n \\`bit merge [ids...]\\` => EXPERIMENTAL. merge changes of the remote head into local, optionally use '--abort' or '--resolve'\n ${WILDCARD_HELP('merge 0.0.1')}`;\n alias = '';\n options = [\n ['', 'ours', 'in case of a conflict, override the used version with the current modification'],\n ['', 'theirs', 'in case of a conflict, override the current modification with the specified version'],\n ['', 'manual', 'in case of a conflict, leave the files with a conflict state to resolve them manually later'],\n ['', 'abort', 'EXPERIMENTAL. in case of an unresolved merge, revert to the state before the merge began'],\n ['', 'resolve', 'EXPERIMENTAL. mark an unresolved merge as resolved and create a new snap with the changes'],\n ['', 'no-snap', 'EXPERIMENTAL. do not auto snap in case the merge completed without conflicts'],\n ['', 'build', 'in case of snap during the merge, run the build-pipeline (similar to bit snap --build)'],\n ['', 'skip-dependency-installation', 'do not install packages of the imported components'],\n ['m', 'message <message>', 'EXPERIMENTAL. override the default message for the auto snap'],\n ] as CommandOptions;\n loader = true;\n\n constructor(private merging: MergingMain) {}\n\n async report(\n [values = []]: [string[]],\n {\n ours = false,\n theirs = false,\n manual = false,\n abort = false,\n resolve = false,\n build = false,\n noSnap = false,\n message,\n skipDependencyInstallation = false,\n }: {\n ours?: boolean;\n theirs?: boolean;\n manual?: boolean;\n abort?: boolean;\n resolve?: boolean;\n build?: boolean;\n noSnap?: boolean;\n message: string;\n skipDependencyInstallation?: boolean;\n }\n ) {\n build = isFeatureEnabled(BUILD_ON_CI) ? Boolean(build) : true;\n const mergeStrategy = getMergeStrategy(ours, theirs, manual);\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 }: ApplyVersionResults = await this.merging.merge(\n values,\n mergeStrategy 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 });\n }\n}\n\nexport function mergeReport({\n components,\n failedComponents,\n version,\n mergeSnapResults,\n leftUnresolvedConflicts,\n}: ApplyVersionResults): string {\n const getSuccessOutput = () => {\n if (!components || !components.length) return '';\n // @ts-ignore version is set in case of merge command\n const title = `successfully merged components${version ? `from version ${chalk.bold(version)}` : ''}\\n`;\n // @ts-ignore components is set in case of merge command\n return chalk.underline(title) + chalk.green(applyVersionReport(components));\n };\n\n const getConflictSummary = () => {\n if (!components || !components.length || !leftUnresolvedConflicts) return '';\n const title = `files with conflicts summary\\n`;\n const suggestion = `\\n\\nthe merge process wasn't completed due to the conflicts above. fix them manually and then run \"bit install\".\nonce ready, snap/tag the components to complete the merge.`;\n return chalk.underline(title) + conflictSummaryReport(components) + chalk.yellow(suggestion);\n };\n\n const getSnapsOutput = () => {\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) =>\n result.triggeredBy.searchWithoutScopeAndVersion(component.id)\n );\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 that snapped as a result of the merge'})\\n${outputComponents(snappedComponents)}\\n`;\n };\n\n const getFailureOutput = () => {\n if (!failedComponents || !failedComponents.length) return '';\n const title = '\\nthe merge has been canceled on the following component(s)';\n const body = failedComponents\n .map((failedComponent) => {\n const color = failedComponent.unchangedLegitimately ? 'white' : 'red';\n return `${chalk.bold(failedComponent.id.toString())} - ${chalk[color](failedComponent.failureMessage)}`;\n })\n .join('\\n');\n return `\\n${chalk.underline(title)}\\n${body}\\n\\n`;\n };\n\n return getSuccessOutput() + getFailureOutput() + getSnapsOutput() + getConflictSummary();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAMA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGO,MAAMA,QAAN,CAAkC;EAsBvCC,WAAW,CAASC,OAAT,EAA+B;IAAA,KAAtBA,OAAsB,GAAtBA,OAAsB;IAAA,8CArBnC,mBAqBmC;IAAA,qDApB5B,+CAoB4B;IAAA,+CAnBlC,aAmBkC;IAAA,6DAlBnB;AACzB;AACA;AACA,IAAI,IAAAC,0BAAA,EAAc,aAAd,CAA6B,EAeW;IAAA,+CAdlC,EAckC;IAAA,iDAbhC,CACR,CAAC,EAAD,EAAK,MAAL,EAAa,gFAAb,CADQ,EAER,CAAC,EAAD,EAAK,QAAL,EAAe,qFAAf,CAFQ,EAGR,CAAC,EAAD,EAAK,QAAL,EAAe,6FAAf,CAHQ,EAIR,CAAC,EAAD,EAAK,OAA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OAAQ,KAAIC,gBAAA,CAAMC,SAAN,CACV,0BADU,CAEV,MAAK,kDAAmD,MAAKe,gBAAgB,CAACF,iBAAD,CAAoB,IAFnG;EAGD,CAtBD;;EAwBA,MAAMe,gBAAgB,GAAG,MAAM;IAC7B,IAAI,CAAC1C,gBAAD,IAAqB,CAACA,gBAAgB,CAACmB,MAA3C,EAAmD,OAAO,EAAP;IACnD,MAAMb,KAAK,GAAG,6DAAd;IACA,MAAMqC,IAAI,GAAG3C,gBAAgB,CAC1BQ,GADU,CACLoC,eAAD,IAAqB;MACxB,MAAMC,KAAK,GAAGD,eAAe,CAACE,qBAAhB,GAAwC,OAAxC,GAAkD,KAAhE;MACA,OAAQ,GAAEjC,gBAAA,CAAMO,IAAN,CAAWwB,eAAe,CAAClC,EAAhB,CAAmBuB,QAAnB,EAAX,CAA0C,MAAKpB,gBAAA,CAAMgC,KAAN,EAAaD,eAAe,CAACG,cAA7B,CAA6C,EAAtG;IACD,CAJU,EAKVnC,IALU,CAKL,IALK,CAAb;IAMA,OAAQ,KAAIC,gBAAA,CAAMC,SAAN,CAAgBR,KAAhB,CAAuB,KAAIqC,IAAK,MAA5C;EACD,CAVD;;EAYA,OAAOzB,gBAAgB,KAAKwB,gBAAgB,EAArC,GAA0ChB,cAAc,EAAxD,GAA6DJ,kBAAkB,EAAtF;AACD"}
|
|
@@ -28,16 +28,16 @@ export declare class MergingMain {
|
|
|
28
28
|
* if the first param is a version, then merge the component ids to that version.
|
|
29
29
|
* otherwise, merge from the remote head to the local.
|
|
30
30
|
*/
|
|
31
|
-
merge(values: string[], mergeStrategy: MergeStrategy, abort: boolean, resolve: boolean, noSnap: boolean, message: string, build: boolean): Promise<ApplyVersionResults>;
|
|
31
|
+
merge(values: string[], mergeStrategy: MergeStrategy, abort: boolean, resolve: boolean, noSnap: boolean, message: string, build: boolean, skipDependencyInstallation: boolean): Promise<ApplyVersionResults>;
|
|
32
32
|
/**
|
|
33
33
|
* when user is on main, it merges the remote main components into local.
|
|
34
34
|
* when user is on a lane, it merges the remote lane components into the local lane.
|
|
35
35
|
*/
|
|
36
|
-
mergeComponentsFromRemote(consumer: Consumer, bitIds: BitId[], mergeStrategy: MergeStrategy, noSnap: boolean, snapMessage: string, build: boolean): Promise<ApplyVersionResults>;
|
|
36
|
+
mergeComponentsFromRemote(consumer: Consumer, bitIds: BitId[], mergeStrategy: MergeStrategy, noSnap: boolean, snapMessage: string, build: boolean, skipDependencyInstallation: boolean): Promise<ApplyVersionResults>;
|
|
37
37
|
/**
|
|
38
38
|
* merge multiple components according to the "allComponentsStatus".
|
|
39
39
|
*/
|
|
40
|
-
mergeSnaps({ mergeStrategy, allComponentsStatus, remoteName, laneId, localLane, noSnap, snapMessage, build, }: {
|
|
40
|
+
mergeSnaps({ mergeStrategy, allComponentsStatus, remoteName, laneId, localLane, noSnap, snapMessage, build, skipDependencyInstallation, }: {
|
|
41
41
|
mergeStrategy: MergeStrategy;
|
|
42
42
|
allComponentsStatus: ComponentMergeStatus[];
|
|
43
43
|
remoteName: string | null;
|
|
@@ -46,6 +46,7 @@ export declare class MergingMain {
|
|
|
46
46
|
noSnap: boolean;
|
|
47
47
|
snapMessage: string;
|
|
48
48
|
build: boolean;
|
|
49
|
+
skipDependencyInstallation?: boolean;
|
|
49
50
|
}): Promise<ApplyVersionResults>;
|
|
50
51
|
/**
|
|
51
52
|
* this function gets called from two different commands:
|
|
@@ -315,7 +315,7 @@ class MergingMain {
|
|
|
315
315
|
*/
|
|
316
316
|
|
|
317
317
|
|
|
318
|
-
async merge(values, mergeStrategy, abort, resolve, noSnap, message, build) {
|
|
318
|
+
async merge(values, mergeStrategy, abort, resolve, noSnap, message, build, skipDependencyInstallation) {
|
|
319
319
|
if (!this.workspace) throw new (_exceptions().ConsumerNotFound)();
|
|
320
320
|
const consumer = this.workspace.consumer;
|
|
321
321
|
let mergeResults;
|
|
@@ -329,7 +329,7 @@ class MergingMain {
|
|
|
329
329
|
} else if (!_bitId().BitId.isValidVersion(firstValue)) {
|
|
330
330
|
const bitIds = this.getComponentsToMerge(consumer, values); // @todo: version could be the lane only or remote/lane
|
|
331
331
|
|
|
332
|
-
mergeResults = await this.mergeComponentsFromRemote(consumer, bitIds, mergeStrategy, noSnap, message, build);
|
|
332
|
+
mergeResults = await this.mergeComponentsFromRemote(consumer, bitIds, mergeStrategy, noSnap, message, build, skipDependencyInstallation);
|
|
333
333
|
} else {
|
|
334
334
|
const version = firstValue;
|
|
335
335
|
|
|
@@ -348,7 +348,7 @@ class MergingMain {
|
|
|
348
348
|
*/
|
|
349
349
|
|
|
350
350
|
|
|
351
|
-
async mergeComponentsFromRemote(consumer, bitIds, mergeStrategy, noSnap, snapMessage, build) {
|
|
351
|
+
async mergeComponentsFromRemote(consumer, bitIds, mergeStrategy, noSnap, snapMessage, build, skipDependencyInstallation) {
|
|
352
352
|
const currentLaneId = consumer.getCurrentLaneId();
|
|
353
353
|
const currentLaneObject = await consumer.getCurrentLaneObject();
|
|
354
354
|
const allComponentsStatus = await this.getAllComponentsStatus(bitIds, currentLaneId, currentLaneObject);
|
|
@@ -367,7 +367,8 @@ class MergingMain {
|
|
|
367
367
|
localLane: currentLaneObject,
|
|
368
368
|
noSnap,
|
|
369
369
|
snapMessage,
|
|
370
|
-
build
|
|
370
|
+
build,
|
|
371
|
+
skipDependencyInstallation
|
|
371
372
|
});
|
|
372
373
|
}
|
|
373
374
|
/**
|
|
@@ -383,7 +384,8 @@ class MergingMain {
|
|
|
383
384
|
localLane,
|
|
384
385
|
noSnap,
|
|
385
386
|
snapMessage,
|
|
386
|
-
build
|
|
387
|
+
build,
|
|
388
|
+
skipDependencyInstallation
|
|
387
389
|
}) {
|
|
388
390
|
const consumer = this.workspace.consumer;
|
|
389
391
|
const componentWithConflict = allComponentsStatus.find(component => component.mergeResults && component.mergeResults.hasConflicts);
|
|
@@ -419,6 +421,15 @@ class MergingMain {
|
|
|
419
421
|
});
|
|
420
422
|
});
|
|
421
423
|
const leftUnresolvedConflicts = componentWithConflict && mergeStrategy === 'manual';
|
|
424
|
+
|
|
425
|
+
if (!skipDependencyInstallation && !leftUnresolvedConflicts) {
|
|
426
|
+
await this.workspace.install(undefined, {
|
|
427
|
+
dedupe: true,
|
|
428
|
+
updateExisting: false,
|
|
429
|
+
import: false
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
|
|
422
433
|
if (localLane) consumer.scope.objects.add(localLane);
|
|
423
434
|
await consumer.scope.objects.persist(); // persist anyway, if localLane is null it should save all main heads
|
|
424
435
|
|
|
@@ -628,11 +639,6 @@ class MergingMain {
|
|
|
628
639
|
return _fsExtra().default.pathExists(packageJsonPath);
|
|
629
640
|
};
|
|
630
641
|
|
|
631
|
-
const shouldInstallNpmPackages = () => {
|
|
632
|
-
if (componentMap && componentMap.origin === _constants().COMPONENT_ORIGINS.AUTHORED) return false;
|
|
633
|
-
return true;
|
|
634
|
-
};
|
|
635
|
-
|
|
636
642
|
const writePackageJson = await shouldWritePackageJson();
|
|
637
643
|
const files = componentWithDependencies.component.files;
|
|
638
644
|
files.forEach(file => {
|
|
@@ -655,7 +661,7 @@ class MergingMain {
|
|
|
655
661
|
const manyComponentsWriter = new (_manyComponentsWriter().default)({
|
|
656
662
|
consumer,
|
|
657
663
|
componentsWithDependencies: [componentWithDependencies],
|
|
658
|
-
installNpmPackages:
|
|
664
|
+
installNpmPackages: false,
|
|
659
665
|
override: true,
|
|
660
666
|
writeConfig: false,
|
|
661
667
|
// @todo: should write if config exists before, needs to figure out how to do it.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["MergingMain","constructor","workspace","snapping","consumer","merge","values","mergeStrategy","abort","resolve","noSnap","message","build","ConsumerNotFound","mergeResults","firstValue","R","head","resolveMerge","abortMerge","BitId","isValidVersion","bitIds","getComponentsToMerge","mergeComponentsFromRemote","version","ids","tail","mergeVersion","onDestroy","snapMessage","currentLaneId","getCurrentLaneId","currentLaneObject","getCurrentLaneObject","allComponentsStatus","getAllComponentsStatus","failedComponents","filter","c","unmergedMessage","unmergedLegitimately","length","failureMsgs","map","failedComponent","chalk","bold","id","toString","red","join","BitError","mergeSnaps","remoteName","isDefault","scope","laneId","localLane","componentWithConflict","find","component","hasConflicts","getMergeStrategyInteractive","componentStatus","failureMessage","unchangedLegitimately","succeededComponents","componentsResults","mapSeries","componentFromFS","modelComponent","getModelComponent","applyVersion","remoteHead","getRef","leftUnresolvedConflicts","objects","add","persist","unmergedComponents","write","mergeSnapResults","snapResolvedComponents","components","getComponentMergeStatus","otherLaneName","returnUnmerged","msg","getModelComponentIfExist","unmerged","getEntry","name","resolved","toStringWithoutVersion","repo","otherLaneHead","existingBitMapId","bitMap","getBitIdIfExist","ignoreVersion","existOnCurrentLane","isIdAvailableOnCurrentLane","componentOnLane","loadVersion","divergeData","getDivergeData","componentFromModel","currentlyUsedVersion","hasHead","loadComponent","componentModificationStatus","getComponentStatusById","modified","laneHeadIsDifferentThanCheckedOut","laneHeadLocal","localHead","Ref","from","Error","err","isDiverged","isLocalAhead","isRemoteAhead","baseSnap","commonSnapBeforeDiverge","baseComponent","otherComponent","threeWayMerge","otherLabel","currentComponent","currentLabel","filesStatus","unmergedComponent","remote","lane","MergeOptions","ours","files","forEach","file","pathNormalizeToLinux","relative","FileStatus","unchanged","addEntry","remoteId","changeVersion","idToLoad","theirs","componentWithDependencies","loadComponentWithDependenciesFromModel","componentMap","GeneralError","origin","COMPONENT_ORIGINS","AUTHORED","dependencies","devDependencies","shouldWritePackageJson","rootDir","packageJsonPath","path","getPath","fs","pathExists","shouldInstallNpmPackages","writePackageJson","updated","modifiedStatus","modifiedFiles","applyModifiedVersion","shouldDependenciesSaveAsComponents","shouldDependenciesSavedAsComponents","dependenciesSavedAsComponents","saveDependenciesAsComponents","manyComponentsWriter","ManyComponentsWriter","componentsWithDependencies","installNpmPackages","override","writeConfig","verbose","writeDists","writeAll","manual","unmergedPaths","f","conflict","filePath","addComponent","setHead","markVersionAsLocal","getIdsForUnresolved","results","checkoutVersion","reset","removeComponent","abortedComponents","snappedComponents","snap","legacyBitIds","BitIds","fromArray","resolvedComponents","localLaneObject","tmp","Tmp","componentsStatus","Promise","all","bitId","remoteScopeName","remoteLaneId","LaneId","remoteLanes","laneIdStr","clear","getResolvedComponents","logger","debug","r","idsStr","getParsedId","entry","unresolvedComponents","getComponents","u","hasWildcard","componentsList","ComponentsList","listComponentsByIdsWithWildcard","provider","cli","merging","register","MergeCmd","CLIAspect","WorkspaceAspect","SnappingAspect","MainRuntime","MergingAspect","addRuntime"],"sources":["merging.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport WorkspaceAspect, { Workspace } from '@teambit/workspace';\nimport R from 'ramda';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport ComponentsList from '@teambit/legacy/dist/consumer/component/components-list';\nimport {\n ApplyVersionResults,\n MergeStrategy,\n mergeVersion,\n ApplyVersionResult,\n FailedComponents,\n FileStatus,\n getMergeStrategyInteractive,\n MergeOptions,\n} from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { ConsumerNotFound } from '@teambit/legacy/dist/consumer/exceptions';\nimport SnappingAspect, { SnappingMain } from '@teambit/snapping';\nimport hasWildcard from '@teambit/legacy/dist/utils/string/has-wildcard';\nimport fs from 'fs-extra';\nimport mapSeries from 'p-map-series';\nimport path from 'path';\nimport { BitId, BitIds } from '@teambit/legacy/dist/bit-id';\nimport { COMPONENT_ORIGINS } from '@teambit/legacy/dist/constants';\nimport { BitError } from '@teambit/bit-error';\nimport GeneralError from '@teambit/legacy/dist/error/general-error';\nimport { LaneId } from '@teambit/lane-id';\nimport logger from '@teambit/legacy/dist/logger/logger';\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, Version } from '@teambit/legacy/dist/scope/models';\nimport { Ref } from '@teambit/legacy/dist/scope/objects';\nimport chalk from 'chalk';\nimport { Tmp } from '@teambit/legacy/dist/scope/repositories';\nimport { pathNormalizeToLinux } from '@teambit/legacy/dist/utils';\nimport ManyComponentsWriter from '@teambit/legacy/dist/consumer/component-ops/many-components-writer';\nimport Component from '@teambit/legacy/dist/consumer/component/consumer-component';\nimport checkoutVersion, { 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 { DivergeData } from '@teambit/legacy/dist/scope/component-ops/diverge-data';\nimport { MergeCmd } from './merge-cmd';\nimport { MergingAspect } from './merging.aspect';\n\nexport type ComponentMergeStatus = {\n componentFromFS?: Component | 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?: DivergeData;\n};\n\nexport class MergingMain {\n private consumer: Consumer;\n constructor(private workspace: Workspace, private snapping: SnappingMain) {\n this.consumer = this.workspace?.consumer;\n }\n\n /**\n * merge components according to the \"values\" param.\n * if the first param is a version, then merge the component ids to that version.\n * otherwise, merge from the remote head to the local.\n */\n async merge(\n values: string[],\n mergeStrategy: MergeStrategy,\n abort: boolean,\n resolve: boolean,\n noSnap: boolean,\n message: string,\n build: boolean\n ): Promise<ApplyVersionResults> {\n if (!this.workspace) throw new ConsumerNotFound();\n const consumer: Consumer = this.workspace.consumer;\n let mergeResults;\n const firstValue = R.head(values);\n if (resolve) {\n mergeResults = await this.resolveMerge(consumer, values, message, build);\n } else if (abort) {\n mergeResults = await this.abortMerge(consumer, values);\n } else if (!BitId.isValidVersion(firstValue)) {\n const bitIds = this.getComponentsToMerge(consumer, values);\n // @todo: version could be the lane only or remote/lane\n mergeResults = await this.mergeComponentsFromRemote(consumer, bitIds, mergeStrategy, noSnap, message, build);\n } else {\n const version = firstValue;\n const ids = R.tail(values);\n const bitIds = this.getComponentsToMerge(consumer, ids);\n mergeResults = await mergeVersion(consumer, version, bitIds, mergeStrategy);\n }\n await consumer.onDestroy();\n return mergeResults;\n }\n\n /**\n * when user is on main, it merges the remote main components into local.\n * when user is on a lane, it merges the remote lane components into the local lane.\n */\n async mergeComponentsFromRemote(\n consumer: Consumer,\n bitIds: BitId[],\n mergeStrategy: MergeStrategy,\n noSnap: boolean,\n snapMessage: string,\n build: boolean\n ): 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 remoteName: currentLaneId.isDefault() ? null : currentLaneId.scope,\n laneId: currentLaneId,\n localLane: currentLaneObject,\n noSnap,\n snapMessage,\n build,\n });\n }\n\n /**\n * merge multiple components according to the \"allComponentsStatus\".\n */\n async mergeSnaps({\n mergeStrategy,\n allComponentsStatus,\n remoteName,\n laneId,\n localLane,\n noSnap,\n snapMessage,\n build,\n }: {\n mergeStrategy: MergeStrategy;\n allComponentsStatus: ComponentMergeStatus[];\n remoteName: string | null;\n laneId: LaneId;\n localLane: Lane | null;\n noSnap: boolean;\n snapMessage: string;\n build: 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(succeededComponents, async ({ componentFromFS, id, mergeResults }) => {\n const modelComponent = await consumer.scope.getModelComponent(id);\n return this.applyVersion({\n consumer,\n componentFromFS,\n id,\n mergeResults,\n mergeStrategy,\n remoteHead: modelComponent.getRef(id.version as string) as Ref,\n remoteName: remoteName || componentFromFS?.scope || null,\n laneId,\n localLane,\n });\n });\n\n const leftUnresolvedConflicts = componentWithConflict && mergeStrategy === 'manual';\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 // if one of the component has conflict, don't snap-merge. otherwise, some of the components would be snap-merged\n // and some not. except the fact that it could by mistake tag dependent, it's a confusing state. better not snap.\n const mergeSnapResults =\n noSnap || leftUnresolvedConflicts ? null : await this.snapResolvedComponents(consumer, snapMessage, build);\n\n return {\n components: componentsResults,\n failedComponents,\n mergeSnapResults,\n leftUnresolvedConflicts,\n };\n }\n\n /**\n * this function gets called from two different commands:\n * 1. \"bit merge <ids...>\", when merging a component from a remote to the local.\n * in this case, the remote and local are on the same lane or both on main.\n * 2. \"bit lane merge\", when merging from one lane to another.\n * @param id\n * @param localLane\n * @param otherLaneName\n * @param existingOnWorkspaceOnly\n * @returns\n */\n async getComponentMergeStatus(\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 otherLaneName: string // the lane name we want to merged to our lane. (can be also \"main\").\n ): Promise<ComponentMergeStatus> {\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 && unmerged.resolved === false) {\n return returnUnmerged(\n `component ${id.toStringWithoutVersion()} has conflicts that need to be resolved first, please 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 existOnCurrentLane = existingBitMapId && consumer.bitMap.isIdAvailableOnCurrentLane(existingBitMapId);\n const componentOnLane: Version = await modelComponent.loadVersion(version, consumer.scope.objects);\n if (!existingBitMapId || !existOnCurrentLane) {\n const divergeData = await getDivergeData(repo, modelComponent, otherLaneHead, null, false);\n return { componentFromFS: null, componentFromModel: componentOnLane, id, mergeResults: null, divergeData };\n }\n const currentlyUsedVersion = existingBitMapId.version;\n if (currentlyUsedVersion === version) {\n // @todo: maybe this check is not needed as we check for diverge later on\n if (localLane || modelComponent.hasHead()) {\n return returnUnmerged(`component ${id.toStringWithoutVersion()} is already merged`, true);\n }\n }\n const component = await consumer.loadComponent(existingBitMapId);\n const componentModificationStatus = await consumer.getComponentStatusById(component.id);\n if (componentModificationStatus.modified) {\n return returnUnmerged(\n `unable to merge ${id.toStringWithoutVersion()}, the component is modified, please snap/tag it first`\n );\n }\n const laneHeadIsDifferentThanCheckedOut =\n localLane && currentlyUsedVersion && modelComponent.laneHeadLocal?.toString() !== currentlyUsedVersion;\n const localHead = laneHeadIsDifferentThanCheckedOut ? Ref.from(currentlyUsedVersion) : null;\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(repo, modelComponent, otherLaneHead, localHead, false);\n if (divergeData.err) {\n return returnUnmerged(`unable to traverse ${component.id.toString()} history. error: ${divergeData.err.message}`);\n }\n if (!divergeData.isDiverged()) {\n if (divergeData.isLocalAhead()) {\n // do nothing!\n return returnUnmerged(`component ${component.id.toString()} is ahead, nothing to merge`, true);\n }\n if (divergeData.isRemoteAhead()) {\n // just override with the model data\n return {\n componentFromFS: component,\n componentFromModel: componentOnLane,\n id,\n mergeResults: null,\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 ${component.id.toString()} is already merged`, true);\n }\n const baseSnap = divergeData.commonSnapBeforeDiverge as Ref; // must be set when isTrueMerge\n const baseComponent: Version = await modelComponent.loadVersion(baseSnap.toString(), repo);\n const otherComponent: Version = await modelComponent.loadVersion(otherLaneHead.toString(), repo);\n const mergeResults = await threeWayMerge({\n consumer,\n otherComponent,\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n otherLabel: `${otherLaneHead.toString()} (${otherLaneName})`,\n currentComponent: component,\n currentLabel: `${currentlyUsedVersion} (local)`,\n baseComponent,\n });\n return { componentFromFS: component, id, mergeResults, divergeData };\n }\n\n private async applyVersion({\n consumer,\n componentFromFS,\n id,\n mergeResults,\n mergeStrategy,\n remoteHead,\n remoteName,\n laneId,\n localLane,\n }: {\n consumer: Consumer;\n componentFromFS: Component | null | undefined;\n id: BitId;\n mergeResults: MergeResultsThreeWay | null | undefined;\n mergeStrategy: MergeStrategy;\n remoteHead: Ref;\n remoteName: string | null;\n laneId: LaneId;\n localLane: Lane | null;\n }): Promise<ApplyVersionResult> {\n let filesStatus = {};\n const unmergedComponent: UnmergedComponent = {\n // @ts-ignore\n id: { name: id.name, scope: id.scope },\n // @ts-ignore\n head: remoteHead,\n // @ts-ignore\n remote: remoteName,\n lane: laneId.name,\n resolved: false, // could be changed later\n };\n id = componentFromFS ? componentFromFS.id : id;\n if (mergeResults && mergeResults.hasConflicts && mergeStrategy === MergeOptions.ours) {\n if (!componentFromFS) throw new Error(`applyVersion expect to get componentFromFS for ${id.toString()}`);\n componentFromFS.files.forEach((file) => {\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n filesStatus[pathNormalizeToLinux(file.relative)] = FileStatus.unchanged;\n });\n unmergedComponent.resolved = true;\n consumer.scope.objects.unmergedComponents.addEntry(unmergedComponent);\n\n return { id, filesStatus };\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 componentMap = componentFromFS && componentFromFS.componentMap;\n if (componentFromFS && !componentMap) throw new GeneralError('applyVersion: componentMap was not found');\n if (componentMap && componentMap.origin === COMPONENT_ORIGINS.AUTHORED && !id.scope) {\n componentWithDependencies.dependencies = [];\n componentWithDependencies.devDependencies = [];\n }\n const shouldWritePackageJson = async (): Promise<boolean> => {\n if (!componentMap) return true;\n const rootDir = componentMap && componentMap.rootDir;\n if (!rootDir) return false;\n const packageJsonPath = path.join(consumer.getPath(), rootDir, 'package.json');\n return fs.pathExists(packageJsonPath);\n };\n const shouldInstallNpmPackages = (): boolean => {\n if (componentMap && componentMap.origin === COMPONENT_ORIGINS.AUTHORED) return false;\n return true;\n };\n const writePackageJson = await shouldWritePackageJson();\n\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 const shouldDependenciesSaveAsComponents = await consumer.shouldDependenciesSavedAsComponents([id]);\n componentWithDependencies.component.dependenciesSavedAsComponents =\n shouldDependenciesSaveAsComponents[0].saveDependenciesAsComponents;\n\n const manyComponentsWriter = new ManyComponentsWriter({\n consumer,\n componentsWithDependencies: [componentWithDependencies],\n installNpmPackages: shouldInstallNpmPackages(),\n override: true,\n writeConfig: false, // @todo: should write if config exists before, needs to figure out how to do it.\n verbose: false, // @todo: do we need a flag here?\n writeDists: true, // @todo: do we need a flag here?\n writePackageJson,\n });\n await manyComponentsWriter.writeAll();\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.resolved = false;\n unmergedComponent.unmergedPaths = mergeResults.modifiedFiles.filter((f) => f.conflict).map((f) => f.filePath);\n } else {\n unmergedComponent.resolved = true;\n }\n consumer.scope.objects.unmergedComponents.addEntry(unmergedComponent);\n } else if (localLane) {\n localLane.addComponent({ id, head: remoteHead });\n } else {\n // this is main\n const modelComponent = await consumer.scope.getModelComponent(id);\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(consumer: Consumer, values: string[]): Promise<ApplyVersionResults> {\n const ids = this.getIdsForUnresolved(consumer, values);\n // @ts-ignore not clear yet what to do with other flags\n const results = await checkoutVersion(consumer, { ids, reset: true });\n ids.forEach((id) => consumer.scope.objects.unmergedComponents.removeComponent(id.name));\n await consumer.scope.objects.unmergedComponents.write();\n return { abortedComponents: results.components };\n }\n\n private async resolveMerge(\n consumer: Consumer,\n values: string[],\n snapMessage: string,\n build: boolean\n ): Promise<ApplyVersionResults> {\n const ids = this.getIdsForUnresolved(consumer, values);\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n const { snappedComponents } = await this.snapping.snap({\n legacyBitIds: BitIds.fromArray(ids),\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 tmp = new Tmp(this.consumer.scope);\n try {\n const componentsStatus = 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 return this.getComponentMergeStatus(bitId.changeVersion(remoteHead.toString()), localLaneObject, laneIdStr);\n })\n );\n await tmp.clear();\n return componentsStatus;\n } catch (err: any) {\n await tmp.clear();\n throw err;\n }\n }\n\n private async snapResolvedComponents(\n consumer: Consumer,\n snapMessage: string,\n build: boolean\n ): Promise<null | { snappedComponents: Component[]; autoSnappedResults: AutoTagResult[] }> {\n const resolvedComponents = consumer.scope.objects.unmergedComponents.getResolvedComponents();\n logger.debug(`merge-snaps, snapResolvedComponents, total ${resolvedComponents.length.toString()} components`);\n if (!resolvedComponents.length) return null;\n const ids = BitIds.fromArray(resolvedComponents.map((r) => new BitId(r.id)));\n return this.snapping.snap({\n legacyBitIds: ids,\n build,\n message: snapMessage,\n });\n }\n\n private getIdsForUnresolved(consumer: Consumer, idsStr?: string[]): BitId[] {\n if (idsStr && idsStr.length) {\n const bitIds = idsStr.map((id) => consumer.getParsedId(id));\n bitIds.forEach((id) => {\n const entry = consumer.scope.objects.unmergedComponents.getEntry(id.name);\n if (!entry) {\n throw new GeneralError(`unable to merge-resolve ${id.toString()}, it is not marked as unresolved`);\n }\n });\n return bitIds;\n }\n const unresolvedComponents = 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) => new BitId(u.id));\n }\n\n private getComponentsToMerge(consumer: Consumer, ids: string[]): BitId[] {\n if (hasWildcard(ids)) {\n const componentsList = new ComponentsList(consumer);\n return componentsList.listComponentsByIdsWithWildcard(ids);\n }\n return ids.map((id) => consumer.getParsedId(id));\n }\n\n static slots = [];\n static dependencies = [CLIAspect, WorkspaceAspect, SnappingAspect];\n static runtime = MainRuntime;\n static async provider([cli, workspace, snapping]: [CLIMain, Workspace, SnappingMain]) {\n const merging = new MergingMain(workspace, snapping);\n cli.register(new MergeCmd(merging));\n return merging;\n }\n}\n\nMergingAspect.addRuntime(MergingMain);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAUA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAA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lP,WAAzB"}
|
|
1
|
+
{"version":3,"names":["MergingMain","constructor","workspace","snapping","consumer","merge","values","mergeStrategy","abort","resolve","noSnap","message","build","skipDependencyInstallation","ConsumerNotFound","mergeResults","firstValue","R","head","resolveMerge","abortMerge","BitId","isValidVersion","bitIds","getComponentsToMerge","mergeComponentsFromRemote","version","ids","tail","mergeVersion","onDestroy","snapMessage","currentLaneId","getCurrentLaneId","currentLaneObject","getCurrentLaneObject","allComponentsStatus","getAllComponentsStatus","failedComponents","filter","c","unmergedMessage","unmergedLegitimately","length","failureMsgs","map","failedComponent","chalk","bold","id","toString","red","join","BitError","mergeSnaps","remoteName","isDefault","scope","laneId","localLane","componentWithConflict","find","component","hasConflicts","getMergeStrategyInteractive","componentStatus","failureMessage","unchangedLegitimately","succeededComponents","componentsResults","mapSeries","componentFromFS","modelComponent","getModelComponent","applyVersion","remoteHead","getRef","leftUnresolvedConflicts","install","undefined","dedupe","updateExisting","import","objects","add","persist","unmergedComponents","write","mergeSnapResults","snapResolvedComponents","components","getComponentMergeStatus","otherLaneName","returnUnmerged","msg","getModelComponentIfExist","unmerged","getEntry","name","resolved","toStringWithoutVersion","repo","otherLaneHead","existingBitMapId","bitMap","getBitIdIfExist","ignoreVersion","existOnCurrentLane","isIdAvailableOnCurrentLane","componentOnLane","loadVersion","divergeData","getDivergeData","componentFromModel","currentlyUsedVersion","hasHead","loadComponent","componentModificationStatus","getComponentStatusById","modified","laneHeadIsDifferentThanCheckedOut","laneHeadLocal","localHead","Ref","from","Error","err","isDiverged","isLocalAhead","isRemoteAhead","baseSnap","commonSnapBeforeDiverge","baseComponent","otherComponent","threeWayMerge","otherLabel","currentComponent","currentLabel","filesStatus","unmergedComponent","remote","lane","MergeOptions","ours","files","forEach","file","pathNormalizeToLinux","relative","FileStatus","unchanged","addEntry","remoteId","changeVersion","idToLoad","theirs","componentWithDependencies","loadComponentWithDependenciesFromModel","componentMap","GeneralError","origin","COMPONENT_ORIGINS","AUTHORED","dependencies","devDependencies","shouldWritePackageJson","rootDir","packageJsonPath","path","getPath","fs","pathExists","writePackageJson","updated","modifiedStatus","modifiedFiles","applyModifiedVersion","shouldDependenciesSaveAsComponents","shouldDependenciesSavedAsComponents","dependenciesSavedAsComponents","saveDependenciesAsComponents","manyComponentsWriter","ManyComponentsWriter","componentsWithDependencies","installNpmPackages","override","writeConfig","verbose","writeDists","writeAll","manual","unmergedPaths","f","conflict","filePath","addComponent","setHead","markVersionAsLocal","getIdsForUnresolved","results","checkoutVersion","reset","removeComponent","abortedComponents","snappedComponents","snap","legacyBitIds","BitIds","fromArray","resolvedComponents","localLaneObject","tmp","Tmp","componentsStatus","Promise","all","bitId","remoteScopeName","remoteLaneId","LaneId","remoteLanes","laneIdStr","clear","getResolvedComponents","logger","debug","r","idsStr","getParsedId","entry","unresolvedComponents","getComponents","u","hasWildcard","componentsList","ComponentsList","listComponentsByIdsWithWildcard","provider","cli","merging","register","MergeCmd","CLIAspect","WorkspaceAspect","SnappingAspect","MainRuntime","MergingAspect","addRuntime"],"sources":["merging.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport WorkspaceAspect, { Workspace } from '@teambit/workspace';\nimport R from 'ramda';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport ComponentsList from '@teambit/legacy/dist/consumer/component/components-list';\nimport {\n ApplyVersionResults,\n MergeStrategy,\n mergeVersion,\n ApplyVersionResult,\n FailedComponents,\n FileStatus,\n getMergeStrategyInteractive,\n MergeOptions,\n} from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { ConsumerNotFound } from '@teambit/legacy/dist/consumer/exceptions';\nimport SnappingAspect, { SnappingMain } from '@teambit/snapping';\nimport hasWildcard from '@teambit/legacy/dist/utils/string/has-wildcard';\nimport fs from 'fs-extra';\nimport mapSeries from 'p-map-series';\nimport path from 'path';\nimport { BitId, BitIds } from '@teambit/legacy/dist/bit-id';\nimport { COMPONENT_ORIGINS } from '@teambit/legacy/dist/constants';\nimport { BitError } from '@teambit/bit-error';\nimport GeneralError from '@teambit/legacy/dist/error/general-error';\nimport { LaneId } from '@teambit/lane-id';\nimport logger from '@teambit/legacy/dist/logger/logger';\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, Version } from '@teambit/legacy/dist/scope/models';\nimport { Ref } from '@teambit/legacy/dist/scope/objects';\nimport chalk from 'chalk';\nimport { Tmp } from '@teambit/legacy/dist/scope/repositories';\nimport { pathNormalizeToLinux } from '@teambit/legacy/dist/utils';\nimport ManyComponentsWriter from '@teambit/legacy/dist/consumer/component-ops/many-components-writer';\nimport Component from '@teambit/legacy/dist/consumer/component/consumer-component';\nimport checkoutVersion, { 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 { DivergeData } from '@teambit/legacy/dist/scope/component-ops/diverge-data';\nimport { MergeCmd } from './merge-cmd';\nimport { MergingAspect } from './merging.aspect';\n\nexport type ComponentMergeStatus = {\n componentFromFS?: Component | 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?: DivergeData;\n};\n\nexport class MergingMain {\n private consumer: Consumer;\n constructor(private workspace: Workspace, private snapping: SnappingMain) {\n this.consumer = this.workspace?.consumer;\n }\n\n /**\n * merge components according to the \"values\" param.\n * if the first param is a version, then merge the component ids to that version.\n * otherwise, merge from the remote head to the local.\n */\n async merge(\n values: string[],\n mergeStrategy: MergeStrategy,\n abort: boolean,\n resolve: boolean,\n noSnap: boolean,\n message: string,\n build: boolean,\n skipDependencyInstallation: boolean\n ): Promise<ApplyVersionResults> {\n if (!this.workspace) throw new ConsumerNotFound();\n const consumer: Consumer = this.workspace.consumer;\n let mergeResults;\n const firstValue = R.head(values);\n if (resolve) {\n mergeResults = await this.resolveMerge(consumer, values, message, build);\n } else if (abort) {\n mergeResults = await this.abortMerge(consumer, values);\n } else if (!BitId.isValidVersion(firstValue)) {\n const bitIds = this.getComponentsToMerge(consumer, values);\n // @todo: version could be the lane only or remote/lane\n mergeResults = await this.mergeComponentsFromRemote(\n consumer,\n bitIds,\n mergeStrategy,\n noSnap,\n message,\n build,\n skipDependencyInstallation\n );\n } else {\n const version = firstValue;\n const ids = R.tail(values);\n const bitIds = this.getComponentsToMerge(consumer, ids);\n mergeResults = await mergeVersion(consumer, version, bitIds, mergeStrategy);\n }\n await consumer.onDestroy();\n return mergeResults;\n }\n\n /**\n * when user is on main, it merges the remote main components into local.\n * when user is on a lane, it merges the remote lane components into the local lane.\n */\n async mergeComponentsFromRemote(\n consumer: Consumer,\n bitIds: BitId[],\n mergeStrategy: MergeStrategy,\n noSnap: boolean,\n snapMessage: string,\n build: boolean,\n skipDependencyInstallation: boolean\n ): Promise<ApplyVersionResults> {\n const currentLaneId = consumer.getCurrentLaneId();\n const currentLaneObject = await consumer.getCurrentLaneObject();\n const allComponentsStatus = await this.getAllComponentsStatus(bitIds, currentLaneId, currentLaneObject);\n const failedComponents = allComponentsStatus.filter((c) => c.unmergedMessage && !c.unmergedLegitimately);\n if (failedComponents.length) {\n const failureMsgs = failedComponents\n .map(\n (failedComponent) =>\n `${chalk.bold(failedComponent.id.toString())} - ${chalk.red(failedComponent.unmergedMessage as string)}`\n )\n .join('\\n');\n throw new BitError(`unable to merge due to the following failures:\\n${failureMsgs}`);\n }\n\n return this.mergeSnaps({\n mergeStrategy,\n allComponentsStatus,\n remoteName: currentLaneId.isDefault() ? null : currentLaneId.scope,\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 remoteName,\n laneId,\n localLane,\n noSnap,\n snapMessage,\n build,\n skipDependencyInstallation,\n }: {\n mergeStrategy: MergeStrategy;\n allComponentsStatus: ComponentMergeStatus[];\n remoteName: string | null;\n laneId: LaneId;\n localLane: Lane | null;\n noSnap: 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(succeededComponents, async ({ componentFromFS, id, mergeResults }) => {\n const modelComponent = await consumer.scope.getModelComponent(id);\n return this.applyVersion({\n consumer,\n componentFromFS,\n id,\n mergeResults,\n mergeStrategy,\n remoteHead: modelComponent.getRef(id.version as string) as Ref,\n remoteName: remoteName || componentFromFS?.scope || null,\n laneId,\n localLane,\n });\n });\n\n const leftUnresolvedConflicts = componentWithConflict && mergeStrategy === 'manual';\n\n if (!skipDependencyInstallation && !leftUnresolvedConflicts) {\n await this.workspace.install(undefined, {\n dedupe: true,\n updateExisting: false,\n import: false,\n });\n }\n\n if (localLane) consumer.scope.objects.add(localLane);\n\n await consumer.scope.objects.persist(); // persist anyway, if localLane is null it should save all main heads\n\n await consumer.scope.objects.unmergedComponents.write();\n\n // if one of the component has conflict, don't snap-merge. otherwise, some of the components would be snap-merged\n // and some not. except the fact that it could by mistake tag dependent, it's a confusing state. better not snap.\n const mergeSnapResults =\n noSnap || leftUnresolvedConflicts ? null : await this.snapResolvedComponents(consumer, snapMessage, build);\n\n return {\n components: componentsResults,\n failedComponents,\n mergeSnapResults,\n leftUnresolvedConflicts,\n };\n }\n\n /**\n * this function gets called from two different commands:\n * 1. \"bit merge <ids...>\", when merging a component from a remote to the local.\n * in this case, the remote and local are on the same lane or both on main.\n * 2. \"bit lane merge\", when merging from one lane to another.\n * @param id\n * @param localLane\n * @param otherLaneName\n * @param existingOnWorkspaceOnly\n * @returns\n */\n async getComponentMergeStatus(\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 otherLaneName: string // the lane name we want to merged to our lane. (can be also \"main\").\n ): Promise<ComponentMergeStatus> {\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 && unmerged.resolved === false) {\n return returnUnmerged(\n `component ${id.toStringWithoutVersion()} has conflicts that need to be resolved first, please 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 existOnCurrentLane = existingBitMapId && consumer.bitMap.isIdAvailableOnCurrentLane(existingBitMapId);\n const componentOnLane: Version = await modelComponent.loadVersion(version, consumer.scope.objects);\n if (!existingBitMapId || !existOnCurrentLane) {\n const divergeData = await getDivergeData(repo, modelComponent, otherLaneHead, null, false);\n return { componentFromFS: null, componentFromModel: componentOnLane, id, mergeResults: null, divergeData };\n }\n const currentlyUsedVersion = existingBitMapId.version;\n if (currentlyUsedVersion === version) {\n // @todo: maybe this check is not needed as we check for diverge later on\n if (localLane || modelComponent.hasHead()) {\n return returnUnmerged(`component ${id.toStringWithoutVersion()} is already merged`, true);\n }\n }\n const component = await consumer.loadComponent(existingBitMapId);\n const componentModificationStatus = await consumer.getComponentStatusById(component.id);\n if (componentModificationStatus.modified) {\n return returnUnmerged(\n `unable to merge ${id.toStringWithoutVersion()}, the component is modified, please snap/tag it first`\n );\n }\n const laneHeadIsDifferentThanCheckedOut =\n localLane && currentlyUsedVersion && modelComponent.laneHeadLocal?.toString() !== currentlyUsedVersion;\n const localHead = laneHeadIsDifferentThanCheckedOut ? Ref.from(currentlyUsedVersion) : null;\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(repo, modelComponent, otherLaneHead, localHead, false);\n if (divergeData.err) {\n return returnUnmerged(`unable to traverse ${component.id.toString()} history. error: ${divergeData.err.message}`);\n }\n if (!divergeData.isDiverged()) {\n if (divergeData.isLocalAhead()) {\n // do nothing!\n return returnUnmerged(`component ${component.id.toString()} is ahead, nothing to merge`, true);\n }\n if (divergeData.isRemoteAhead()) {\n // just override with the model data\n return {\n componentFromFS: component,\n componentFromModel: componentOnLane,\n id,\n mergeResults: null,\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 ${component.id.toString()} is already merged`, true);\n }\n const baseSnap = divergeData.commonSnapBeforeDiverge as Ref; // must be set when isTrueMerge\n const baseComponent: Version = await modelComponent.loadVersion(baseSnap.toString(), repo);\n const otherComponent: Version = await modelComponent.loadVersion(otherLaneHead.toString(), repo);\n const mergeResults = await threeWayMerge({\n consumer,\n otherComponent,\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n otherLabel: `${otherLaneHead.toString()} (${otherLaneName})`,\n currentComponent: component,\n currentLabel: `${currentlyUsedVersion} (local)`,\n baseComponent,\n });\n return { componentFromFS: component, id, mergeResults, divergeData };\n }\n\n private async applyVersion({\n consumer,\n componentFromFS,\n id,\n mergeResults,\n mergeStrategy,\n remoteHead,\n remoteName,\n laneId,\n localLane,\n }: {\n consumer: Consumer;\n componentFromFS: Component | null | undefined;\n id: BitId;\n mergeResults: MergeResultsThreeWay | null | undefined;\n mergeStrategy: MergeStrategy;\n remoteHead: Ref;\n remoteName: string | null;\n laneId: LaneId;\n localLane: Lane | null;\n }): Promise<ApplyVersionResult> {\n let filesStatus = {};\n const unmergedComponent: UnmergedComponent = {\n // @ts-ignore\n id: { name: id.name, scope: id.scope },\n // @ts-ignore\n head: remoteHead,\n // @ts-ignore\n remote: remoteName,\n lane: laneId.name,\n resolved: false, // could be changed later\n };\n id = componentFromFS ? componentFromFS.id : id;\n if (mergeResults && mergeResults.hasConflicts && mergeStrategy === MergeOptions.ours) {\n if (!componentFromFS) throw new Error(`applyVersion expect to get componentFromFS for ${id.toString()}`);\n componentFromFS.files.forEach((file) => {\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n filesStatus[pathNormalizeToLinux(file.relative)] = FileStatus.unchanged;\n });\n unmergedComponent.resolved = true;\n consumer.scope.objects.unmergedComponents.addEntry(unmergedComponent);\n\n return { id, filesStatus };\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 componentMap = componentFromFS && componentFromFS.componentMap;\n if (componentFromFS && !componentMap) throw new GeneralError('applyVersion: componentMap was not found');\n if (componentMap && componentMap.origin === COMPONENT_ORIGINS.AUTHORED && !id.scope) {\n componentWithDependencies.dependencies = [];\n componentWithDependencies.devDependencies = [];\n }\n const shouldWritePackageJson = async (): Promise<boolean> => {\n if (!componentMap) return true;\n const rootDir = componentMap && componentMap.rootDir;\n if (!rootDir) return false;\n const packageJsonPath = path.join(consumer.getPath(), rootDir, 'package.json');\n return fs.pathExists(packageJsonPath);\n };\n const writePackageJson = await shouldWritePackageJson();\n\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 const shouldDependenciesSaveAsComponents = await consumer.shouldDependenciesSavedAsComponents([id]);\n componentWithDependencies.component.dependenciesSavedAsComponents =\n shouldDependenciesSaveAsComponents[0].saveDependenciesAsComponents;\n\n const manyComponentsWriter = new ManyComponentsWriter({\n consumer,\n componentsWithDependencies: [componentWithDependencies],\n installNpmPackages: false,\n override: true,\n writeConfig: false, // @todo: should write if config exists before, needs to figure out how to do it.\n verbose: false, // @todo: do we need a flag here?\n writeDists: true, // @todo: do we need a flag here?\n writePackageJson,\n });\n await manyComponentsWriter.writeAll();\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.resolved = false;\n unmergedComponent.unmergedPaths = mergeResults.modifiedFiles.filter((f) => f.conflict).map((f) => f.filePath);\n } else {\n unmergedComponent.resolved = true;\n }\n consumer.scope.objects.unmergedComponents.addEntry(unmergedComponent);\n } else if (localLane) {\n localLane.addComponent({ id, head: remoteHead });\n } else {\n // this is main\n const modelComponent = await consumer.scope.getModelComponent(id);\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(consumer: Consumer, values: string[]): Promise<ApplyVersionResults> {\n const ids = this.getIdsForUnresolved(consumer, values);\n // @ts-ignore not clear yet what to do with other flags\n const results = await checkoutVersion(consumer, { ids, reset: true });\n ids.forEach((id) => consumer.scope.objects.unmergedComponents.removeComponent(id.name));\n await consumer.scope.objects.unmergedComponents.write();\n return { abortedComponents: results.components };\n }\n\n private async resolveMerge(\n consumer: Consumer,\n values: string[],\n snapMessage: string,\n build: boolean\n ): Promise<ApplyVersionResults> {\n const ids = this.getIdsForUnresolved(consumer, values);\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n const { snappedComponents } = await this.snapping.snap({\n legacyBitIds: BitIds.fromArray(ids),\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 tmp = new Tmp(this.consumer.scope);\n try {\n const componentsStatus = 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 return this.getComponentMergeStatus(bitId.changeVersion(remoteHead.toString()), localLaneObject, laneIdStr);\n })\n );\n await tmp.clear();\n return componentsStatus;\n } catch (err: any) {\n await tmp.clear();\n throw err;\n }\n }\n\n private async snapResolvedComponents(\n consumer: Consumer,\n snapMessage: string,\n build: boolean\n ): Promise<null | { snappedComponents: Component[]; autoSnappedResults: AutoTagResult[] }> {\n const resolvedComponents = consumer.scope.objects.unmergedComponents.getResolvedComponents();\n logger.debug(`merge-snaps, snapResolvedComponents, total ${resolvedComponents.length.toString()} components`);\n if (!resolvedComponents.length) return null;\n const ids = BitIds.fromArray(resolvedComponents.map((r) => new BitId(r.id)));\n return this.snapping.snap({\n legacyBitIds: ids,\n build,\n message: snapMessage,\n });\n }\n\n private getIdsForUnresolved(consumer: Consumer, idsStr?: string[]): BitId[] {\n if (idsStr && idsStr.length) {\n const bitIds = idsStr.map((id) => consumer.getParsedId(id));\n bitIds.forEach((id) => {\n const entry = consumer.scope.objects.unmergedComponents.getEntry(id.name);\n if (!entry) {\n throw new GeneralError(`unable to merge-resolve ${id.toString()}, it is not marked as unresolved`);\n }\n });\n return bitIds;\n }\n const unresolvedComponents = 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) => new BitId(u.id));\n }\n\n private getComponentsToMerge(consumer: Consumer, ids: string[]): BitId[] {\n if (hasWildcard(ids)) {\n const componentsList = new ComponentsList(consumer);\n return componentsList.listComponentsByIdsWithWildcard(ids);\n }\n return ids.map((id) => consumer.getParsedId(id));\n }\n\n static slots = [];\n static dependencies = [CLIAspect, WorkspaceAspect, SnappingAspect];\n static runtime = MainRuntime;\n static async provider([cli, workspace, snapping]: [CLIMain, Workspace, SnappingMain]) {\n const merging = new MergingMain(workspace, snapping);\n cli.register(new MergeCmd(merging));\n return merging;\n }\n}\n\nMergingAspect.addRuntime(MergingMain);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAUA;EAAA;;EAAA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AA/C,CAAP;IACD;;IACD,OAAOA,GAAG,CAACkB,GAAJ,CAASI,EAAD,IAAQ7C,QAAQ,CAACgO,WAAT,CAAqBnL,EAArB,CAAhB,CAAP;EACD;;EAKoB,aAAR4L,QAAQ,CAAC,CAACC,GAAD,EAAM5O,SAAN,EAAiBC,QAAjB,CAAD,EAAiE;IACpF,MAAM4O,OAAO,GAAG,IAAI/O,WAAJ,CAAgBE,SAAhB,EAA2BC,QAA3B,CAAhB;IACA2O,GAAG,CAACE,QAAJ,CAAa,KAAIC,oBAAJ,EAAaF,OAAb,CAAb;IACA,OAAOA,OAAP;EACD;;AA3esB;;;gCAAZ/O,W,WAoeI,E;gCApeJA,W,kBAqeW,CAACkP,gBAAD,EAAYC,oBAAZ,EAA6BC,mBAA7B,C;gCAreXpP,W,aAseMqP,kB;;AAQnBC,wBAAA,CAAcC,UAAd,CAAyBvP,WAAzB"}
|
|
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.127",
|
|
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.127"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "2.4.2",
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
"core-js": "^3.0.0",
|
|
18
18
|
"@teambit/harmony": "0.3.3",
|
|
19
19
|
"@teambit/bit-error": "0.0.394",
|
|
20
|
-
"@teambit/cli": "0.0.
|
|
21
|
-
"@teambit/lane-id": "0.0.
|
|
22
|
-
"@teambit/snapping": "0.0.
|
|
23
|
-
"@teambit/workspace": "0.0.
|
|
20
|
+
"@teambit/cli": "0.0.542",
|
|
21
|
+
"@teambit/lane-id": "0.0.61",
|
|
22
|
+
"@teambit/snapping": "0.0.127",
|
|
23
|
+
"@teambit/workspace": "0.0.812"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/fs-extra": "9.0.7",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@types/node": "12.20.4"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@teambit/legacy": "1.0.
|
|
35
|
+
"@teambit/legacy": "1.0.325",
|
|
36
36
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
37
37
|
"react": "^16.8.0 || ^17.0.0"
|
|
38
38
|
},
|
|
File without changes
|
|
Binary file
|