@teambit/checkout 0.0.225 → 0.0.227
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/checkout-cmd.js +2 -1
- package/dist/checkout-cmd.js.map +1 -1
- package/dist/checkout-version.d.ts +1 -0
- package/dist/checkout-version.js.map +1 -1
- package/dist/checkout.main.runtime.d.ts +7 -3
- package/dist/checkout.main.runtime.js +24 -5
- package/dist/checkout.main.runtime.js.map +1 -1
- package/package-tar/teambit-checkout-0.0.227.tgz +0 -0
- package/package.json +10 -9
- package/package-tar/teambit-checkout-0.0.225.tgz +0 -0
- /package/dist/{preview-1684121327240.js → preview-1684294998398.js} +0 -0
package/dist/checkout-cmd.js
CHANGED
|
@@ -88,6 +88,7 @@ class CheckoutCmd {
|
|
|
88
88
|
components,
|
|
89
89
|
version,
|
|
90
90
|
failedComponents,
|
|
91
|
+
removedComponents,
|
|
91
92
|
leftUnresolvedConflicts,
|
|
92
93
|
newFromLane,
|
|
93
94
|
newFromLaneAdded,
|
|
@@ -171,7 +172,7 @@ once ready, snap/tag the components to persist the changes`;
|
|
|
171
172
|
const newOnLaneStr = newOnLaneNum ? `\nNew on lane${newOnLaneAddedStr}: ${_chalk().default.bold(newOnLaneNum.toString())}` : '';
|
|
172
173
|
return newLines + title + checkedOutStr + unchangedLegitimatelyStr + failedToCheckOutStr + newOnLaneStr;
|
|
173
174
|
};
|
|
174
|
-
return getFailureOutput() + getNotCheckedOutOutput() + getSuccessfulOutput() + getNewOnLaneOutput() + getConflictSummary() + getSummary() + (0, _merging().installationErrorOutput)(installationError) + (0, _merging().compilationErrorOutput)(compilationError);
|
|
175
|
+
return getFailureOutput() + getNotCheckedOutOutput() + getSuccessfulOutput() + (0, _merging().getRemovedOutput)(removedComponents) + getNewOnLaneOutput() + getConflictSummary() + getSummary() + (0, _merging().installationErrorOutput)(installationError) + (0, _merging().compilationErrorOutput)(compilationError);
|
|
175
176
|
}
|
|
176
177
|
}
|
|
177
178
|
exports.CheckoutCmd = CheckoutCmd;
|
package/dist/checkout-cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CheckoutCmd","constructor","checkout","name","description","COMPONENT_PATTERN_HELP","report","to","componentPattern","interactiveMerge","ours","theirs","manual","all","workspaceOnly","verbose","skipDependencyInstallation","checkoutProps","promptMergeOptions","mergeStrategy","getMergeStrategy","isLane","skipNpmInstall","components","version","failedComponents","leftUnresolvedConflicts","newFromLane","newFromLaneAdded","installationError","compilationError","checkoutByCLIValues","isHead","isReset","isLatest","realFailedComponents","filter","f","unchangedLegitimately","notCheckedOutComponents","getFailureOutput","length","title","body","map","failedComponent","chalk","bold","id","toString","red","failureMessage","join","underline","getNotCheckedOutOutput","green","getConflictSummary","suggestion","conflictSummaryReport","yellow","getSuccessfulOutput","component","componentName","toStringWithoutVersion","applyVersionReport","getVerOutput","versionOutput","showVersion","componentsStr","getNewOnLaneOutput","getSummary","checkedOut","notCheckedOutLegitimately","failedToCheckOut","newLines","checkedOutStr","unchangedLegitimatelyStr","failedToCheckOutStr","newOnLaneNum","newOnLaneAddedStr","newOnLaneStr","installationErrorOutput","compilationErrorOutput"],"sources":["checkout-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport {\n ApplyVersionResults,\n applyVersionReport,\n conflictSummaryReport,\n installationErrorOutput,\n compilationErrorOutput,\n} from '@teambit/merging';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy/dist/constants';\nimport { getMergeStrategy } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { CheckoutMain, CheckoutProps } from './checkout.main.runtime';\n\nexport class CheckoutCmd implements Command {\n name = 'checkout <to> [component-pattern]';\n arguments = [\n {\n name: 'to',\n description:\n \"permitted values: [head, latest, reset, specific-version]. 'head' - last snap/tag. 'latest' - semver latest tag. 'reset' - removes local changes\",\n },\n {\n name: 'component-pattern',\n description: COMPONENT_PATTERN_HELP,\n },\n ];\n description = 'switch between component versions or remove local changes';\n helpUrl = 'docs/components/merging-changes#checkout-snaps-to-the-working-directory';\n group = 'development';\n extendedDescription = `\n \\`bit checkout <version> [component-pattern]\\` => checkout the specified ids (or all components when --all is used) to the specified version\n \\`bit checkout head [component-pattern]\\` => checkout to the last snap/tag, omit [component-pattern] to checkout head for all\n \\`bit checkout latest [component-pattern]\\` => checkout to the latest satisfying semver tag, omit [component-pattern] to checkout latest for all\n \\`bit checkout reset [component-pattern]\\` => remove local modifications from the specified ids (or all components when --all is used)`;\n alias = 'U';\n options = [\n [\n 'i',\n 'interactive-merge',\n 'when a component is modified and the merge process found conflicts, display options to resolve them',\n ],\n ['o', 'ours', 'in case of a conflict, override the used version with the current modification'],\n ['t', 'theirs', 'in case of a conflict, override the current modification with the specified version'],\n ['m', 'manual', 'in case of a conflict, leave the files with a conflict state to resolve them manually later'],\n ['r', 'reset', 'revert changes that were not snapped/tagged'],\n ['a', 'all', 'all components'],\n [\n 'e',\n 'workspace-only',\n 'when on a lane, avoid introducing new components from the remote lane that do not exist locally',\n ],\n ['v', 'verbose', 'showing verbose output for inspection'],\n ['x', 'skip-dependency-installation', 'do not install packages of the imported components'],\n ] as CommandOptions;\n loader = true;\n\n constructor(private checkout: CheckoutMain) {}\n\n async report(\n [to, componentPattern]: [string, string],\n {\n interactiveMerge = false,\n ours = false,\n theirs = false,\n manual = false,\n all = false,\n workspaceOnly = false,\n verbose = false,\n skipDependencyInstallation = false,\n }: {\n interactiveMerge?: boolean;\n ours?: boolean;\n theirs?: boolean;\n manual?: boolean;\n all?: boolean;\n workspaceOnly?: boolean;\n verbose?: boolean;\n skipDependencyInstallation?: boolean;\n }\n ) {\n const checkoutProps: CheckoutProps = {\n promptMergeOptions: interactiveMerge,\n mergeStrategy: getMergeStrategy(ours, theirs, manual),\n all,\n verbose,\n isLane: false,\n skipNpmInstall: skipDependencyInstallation,\n workspaceOnly,\n };\n const {\n components,\n version,\n failedComponents,\n leftUnresolvedConflicts,\n newFromLane,\n newFromLaneAdded,\n installationError,\n compilationError,\n }: ApplyVersionResults = await this.checkout.checkoutByCLIValues(to, componentPattern || '', checkoutProps);\n const isHead = to === 'head';\n const isReset = to === 'reset';\n const isLatest = to === 'latest';\n // components that failed for no legitimate reason. e.g. merge-conflict.\n const realFailedComponents = (failedComponents || []).filter((f) => !f.unchangedLegitimately);\n // components that weren't checked out for legitimate reasons, e.g. up-to-date.\n const notCheckedOutComponents = (failedComponents || []).filter((f) => f.unchangedLegitimately);\n\n const getFailureOutput = () => {\n if (!realFailedComponents.length) return '';\n const title = 'the checkout has been failed on the following component(s)';\n const body = realFailedComponents\n .map(\n (failedComponent) =>\n `${chalk.bold(failedComponent.id.toString())} - ${chalk.red(failedComponent.failureMessage)}`\n )\n .join('\\n');\n return `${chalk.underline(title)}\\n${body}\\n\\n`;\n };\n const getNotCheckedOutOutput = () => {\n if (!notCheckedOutComponents.length) return '';\n if (!verbose && all) {\n return chalk.green(\n `checkout was not needed for ${chalk.bold(\n notCheckedOutComponents.length.toString()\n )} components (use --verbose to get more details)\\n`\n );\n }\n const title = 'the checkout was not needed on the following component(s)';\n const body = notCheckedOutComponents\n .map((failedComponent) => `${failedComponent.id.toString()} - ${failedComponent.failureMessage}`)\n .join('\\n');\n return `${chalk.underline(title)}\\n${body}\\n\\n`;\n };\n const getConflictSummary = () => {\n if (!components || !components.length || !leftUnresolvedConflicts) return '';\n const title = `\\n\\nfiles with conflicts summary\\n`;\n const suggestion = `\\n\\nfix the conflicts above manually and then run \"bit install\" and \"bit compile\".\nonce ready, snap/tag the components to persist the changes`;\n return chalk.underline(title) + conflictSummaryReport(components) + chalk.yellow(suggestion);\n };\n const getSuccessfulOutput = () => {\n if (!components || !components.length) return '';\n if (components.length === 1) {\n const component = components[0];\n const componentName = isReset ? component.id.toString() : component.id.toStringWithoutVersion();\n if (isReset) return `successfully reset ${chalk.bold(componentName)}\\n`;\n const title = `successfully switched ${chalk.bold(componentName)} to version ${chalk.bold(\n // @ts-ignore version is defined when !isReset\n isHead || isLatest ? component.id.version : version\n )}\\n`;\n return `${chalk.underline(title)} ${applyVersionReport(components, false)}`;\n }\n if (isReset) {\n const title = 'successfully reset the following components\\n\\n';\n const body = components.map((component) => chalk.bold(component.id.toString())).join('\\n');\n return chalk.underline(title) + body;\n }\n const getVerOutput = () => {\n if (isHead) return 'their head version';\n if (isLatest) return 'their latest version';\n // @ts-ignore version is defined when !isReset\n return `version ${chalk.bold(version)}`;\n };\n const versionOutput = getVerOutput();\n const title = `successfully switched the following components to ${versionOutput}\\n\\n`;\n const showVersion = isHead || isReset;\n const componentsStr = applyVersionReport(components, true, showVersion);\n return chalk.underline(title) + componentsStr;\n };\n const getNewOnLaneOutput = () => {\n if (!newFromLane?.length) return '';\n const title = newFromLaneAdded\n ? `successfully added the following components from the lane`\n : `the following components introduced on the lane and were not added. omit --workspace-only flag to add them`;\n const body = newFromLane.join('\\n');\n return `\\n\\n${chalk.underline(title)}\\n${body}`;\n };\n const getSummary = () => {\n const checkedOut = components?.length || 0;\n const notCheckedOutLegitimately = notCheckedOutComponents.length;\n const failedToCheckOut = realFailedComponents.length;\n const newLines = '\\n\\n';\n const title = chalk.bold.underline('Checkout Summary');\n const checkedOutStr = `\\nTotal CheckedOut: ${chalk.bold(checkedOut.toString())}`;\n const unchangedLegitimatelyStr = `\\nTotal Unchanged: ${chalk.bold(notCheckedOutLegitimately.toString())}`;\n const failedToCheckOutStr = `\\nTotal Failed: ${chalk.bold(failedToCheckOut.toString())}`;\n const newOnLaneNum = newFromLane?.length || 0;\n const newOnLaneAddedStr = newFromLaneAdded ? ' (added)' : ' (not added)';\n const newOnLaneStr = newOnLaneNum\n ? `\\nNew on lane${newOnLaneAddedStr}: ${chalk.bold(newOnLaneNum.toString())}`\n : '';\n\n return newLines + title + checkedOutStr + unchangedLegitimatelyStr + failedToCheckOutStr + newOnLaneStr;\n };\n\n return (\n getFailureOutput() +\n getNotCheckedOutOutput() +\n getSuccessfulOutput() +\n getNewOnLaneOutput() +\n getConflictSummary() +\n getSummary() +\n installationErrorOutput(installationError) +\n compilationErrorOutput(compilationError)\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAOA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGO,MAAMA,WAAW,CAAoB;EA2C1CC,WAAW,CAASC,QAAsB,EAAE;IAAA,KAAxBA,QAAsB,GAAtBA,QAAsB;IAAA,8CA1CnC,mCAAmC;IAAA,mDAC9B,CACV;MACEC,IAAI,EAAE,IAAI;MACVC,WAAW,EACT;IACJ,CAAC,EACD;MACED,IAAI,EAAE,mBAAmB;MACzBC,WAAW,EAAEC;IACf,CAAC,CACF;IAAA,qDACa,2DAA2D;IAAA,iDAC/D,yEAAyE;IAAA,+CAC3E,aAAa;IAAA,6DACE;AACzB;AACA;AACA;AACA,yIAAyI;IAAA,+CAC/H,GAAG;IAAA,iDACD,CACR,CACE,GAAG,EACH,mBAAmB,EACnB,qGAAqG,CACtG,EACD,CAAC,GAAG,EAAE,MAAM,EAAE,gFAAgF,CAAC,EAC/F,CAAC,GAAG,EAAE,QAAQ,EAAE,qFAAqF,CAAC,EACtG,CAAC,GAAG,EAAE,QAAQ,EAAE,6FAA6F,CAAC,EAC9G,CAAC,GAAG,EAAE,OAAO,EAAE,6CAA6C,CAAC,EAC7D,CAAC,GAAG,EAAE,KAAK,EAAE,gBAAgB,CAAC,EAC9B,CACE,GAAG,EACH,gBAAgB,EAChB,iGAAiG,CAClG,EACD,CAAC,GAAG,EAAE,SAAS,EAAE,uCAAuC,CAAC,EACzD,CAAC,GAAG,EAAE,8BAA8B,EAAE,oDAAoD,CAAC,CAC5F;IAAA,gDACQ,IAAI;EAEgC;EAE7C,MAAMC,MAAM,CACV,CAACC,EAAE,EAAEC,gBAAgB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M4B,mBAAmB,GAAI,mBAAkB/B,gBAAK,CAACC,IAAI,CAAC0B,gBAAgB,CAACxB,QAAQ,EAAE,CAAE,EAAC;MACxF,MAAM6B,YAAY,GAAG,CAAAnD,WAAW,aAAXA,WAAW,uBAAXA,WAAW,CAAEc,MAAM,KAAI,CAAC;MAC7C,MAAMsC,iBAAiB,GAAGnD,gBAAgB,GAAG,UAAU,GAAG,cAAc;MACxE,MAAMoD,YAAY,GAAGF,YAAY,GAC5B,gBAAeC,iBAAkB,KAAIjC,gBAAK,CAACC,IAAI,CAAC+B,YAAY,CAAC7B,QAAQ,EAAE,CAAE,EAAC,GAC3E,EAAE;MAEN,OAAOyB,QAAQ,GAAGhC,KAAK,GAAGiC,aAAa,GAAGC,wBAAwB,GAAGC,mBAAmB,GAAGG,YAAY;IACzG,CAAC;IAED,OACExC,gBAAgB,EAAE,GAClBc,sBAAsB,EAAE,GACxBM,mBAAmB,EAAE,GACrBS,kBAAkB,EAAE,GACpBb,kBAAkB,EAAE,GACpBc,UAAU,EAAE,GACZ,IAAAW,kCAAuB,EAACpD,iBAAiB,CAAC,GAC1C,IAAAqD,iCAAsB,EAACpD,gBAAgB,CAAC;EAE5C;AACF;AAAC"}
|
|
1
|
+
{"version":3,"names":["CheckoutCmd","constructor","checkout","name","description","COMPONENT_PATTERN_HELP","report","to","componentPattern","interactiveMerge","ours","theirs","manual","all","workspaceOnly","verbose","skipDependencyInstallation","checkoutProps","promptMergeOptions","mergeStrategy","getMergeStrategy","isLane","skipNpmInstall","components","version","failedComponents","removedComponents","leftUnresolvedConflicts","newFromLane","newFromLaneAdded","installationError","compilationError","checkoutByCLIValues","isHead","isReset","isLatest","realFailedComponents","filter","f","unchangedLegitimately","notCheckedOutComponents","getFailureOutput","length","title","body","map","failedComponent","chalk","bold","id","toString","red","failureMessage","join","underline","getNotCheckedOutOutput","green","getConflictSummary","suggestion","conflictSummaryReport","yellow","getSuccessfulOutput","component","componentName","toStringWithoutVersion","applyVersionReport","getVerOutput","versionOutput","showVersion","componentsStr","getNewOnLaneOutput","getSummary","checkedOut","notCheckedOutLegitimately","failedToCheckOut","newLines","checkedOutStr","unchangedLegitimatelyStr","failedToCheckOutStr","newOnLaneNum","newOnLaneAddedStr","newOnLaneStr","getRemovedOutput","installationErrorOutput","compilationErrorOutput"],"sources":["checkout-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport {\n ApplyVersionResults,\n applyVersionReport,\n conflictSummaryReport,\n installationErrorOutput,\n compilationErrorOutput,\n getRemovedOutput,\n} from '@teambit/merging';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy/dist/constants';\nimport { getMergeStrategy } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { CheckoutMain, CheckoutProps } from './checkout.main.runtime';\n\nexport class CheckoutCmd implements Command {\n name = 'checkout <to> [component-pattern]';\n arguments = [\n {\n name: 'to',\n description:\n \"permitted values: [head, latest, reset, specific-version]. 'head' - last snap/tag. 'latest' - semver latest tag. 'reset' - removes local changes\",\n },\n {\n name: 'component-pattern',\n description: COMPONENT_PATTERN_HELP,\n },\n ];\n description = 'switch between component versions or remove local changes';\n helpUrl = 'docs/components/merging-changes#checkout-snaps-to-the-working-directory';\n group = 'development';\n extendedDescription = `\n \\`bit checkout <version> [component-pattern]\\` => checkout the specified ids (or all components when --all is used) to the specified version\n \\`bit checkout head [component-pattern]\\` => checkout to the last snap/tag, omit [component-pattern] to checkout head for all\n \\`bit checkout latest [component-pattern]\\` => checkout to the latest satisfying semver tag, omit [component-pattern] to checkout latest for all\n \\`bit checkout reset [component-pattern]\\` => remove local modifications from the specified ids (or all components when --all is used)`;\n alias = 'U';\n options = [\n [\n 'i',\n 'interactive-merge',\n 'when a component is modified and the merge process found conflicts, display options to resolve them',\n ],\n ['o', 'ours', 'in case of a conflict, override the used version with the current modification'],\n ['t', 'theirs', 'in case of a conflict, override the current modification with the specified version'],\n ['m', 'manual', 'in case of a conflict, leave the files with a conflict state to resolve them manually later'],\n ['r', 'reset', 'revert changes that were not snapped/tagged'],\n ['a', 'all', 'all components'],\n [\n 'e',\n 'workspace-only',\n 'when on a lane, avoid introducing new components from the remote lane that do not exist locally',\n ],\n ['v', 'verbose', 'showing verbose output for inspection'],\n ['x', 'skip-dependency-installation', 'do not install packages of the imported components'],\n ] as CommandOptions;\n loader = true;\n\n constructor(private checkout: CheckoutMain) {}\n\n async report(\n [to, componentPattern]: [string, string],\n {\n interactiveMerge = false,\n ours = false,\n theirs = false,\n manual = false,\n all = false,\n workspaceOnly = false,\n verbose = false,\n skipDependencyInstallation = false,\n }: {\n interactiveMerge?: boolean;\n ours?: boolean;\n theirs?: boolean;\n manual?: boolean;\n all?: boolean;\n workspaceOnly?: boolean;\n verbose?: boolean;\n skipDependencyInstallation?: boolean;\n }\n ) {\n const checkoutProps: CheckoutProps = {\n promptMergeOptions: interactiveMerge,\n mergeStrategy: getMergeStrategy(ours, theirs, manual),\n all,\n verbose,\n isLane: false,\n skipNpmInstall: skipDependencyInstallation,\n workspaceOnly,\n };\n const {\n components,\n version,\n failedComponents,\n removedComponents,\n leftUnresolvedConflicts,\n newFromLane,\n newFromLaneAdded,\n installationError,\n compilationError,\n }: ApplyVersionResults = await this.checkout.checkoutByCLIValues(to, componentPattern || '', checkoutProps);\n const isHead = to === 'head';\n const isReset = to === 'reset';\n const isLatest = to === 'latest';\n // components that failed for no legitimate reason. e.g. merge-conflict.\n const realFailedComponents = (failedComponents || []).filter((f) => !f.unchangedLegitimately);\n // components that weren't checked out for legitimate reasons, e.g. up-to-date.\n const notCheckedOutComponents = (failedComponents || []).filter((f) => f.unchangedLegitimately);\n\n const getFailureOutput = () => {\n if (!realFailedComponents.length) return '';\n const title = 'the checkout has been failed on the following component(s)';\n const body = realFailedComponents\n .map(\n (failedComponent) =>\n `${chalk.bold(failedComponent.id.toString())} - ${chalk.red(failedComponent.failureMessage)}`\n )\n .join('\\n');\n return `${chalk.underline(title)}\\n${body}\\n\\n`;\n };\n const getNotCheckedOutOutput = () => {\n if (!notCheckedOutComponents.length) return '';\n if (!verbose && all) {\n return chalk.green(\n `checkout was not needed for ${chalk.bold(\n notCheckedOutComponents.length.toString()\n )} components (use --verbose to get more details)\\n`\n );\n }\n const title = 'the checkout was not needed on the following component(s)';\n const body = notCheckedOutComponents\n .map((failedComponent) => `${failedComponent.id.toString()} - ${failedComponent.failureMessage}`)\n .join('\\n');\n return `${chalk.underline(title)}\\n${body}\\n\\n`;\n };\n const getConflictSummary = () => {\n if (!components || !components.length || !leftUnresolvedConflicts) return '';\n const title = `\\n\\nfiles with conflicts summary\\n`;\n const suggestion = `\\n\\nfix the conflicts above manually and then run \"bit install\" and \"bit compile\".\nonce ready, snap/tag the components to persist the changes`;\n return chalk.underline(title) + conflictSummaryReport(components) + chalk.yellow(suggestion);\n };\n const getSuccessfulOutput = () => {\n if (!components || !components.length) return '';\n if (components.length === 1) {\n const component = components[0];\n const componentName = isReset ? component.id.toString() : component.id.toStringWithoutVersion();\n if (isReset) return `successfully reset ${chalk.bold(componentName)}\\n`;\n const title = `successfully switched ${chalk.bold(componentName)} to version ${chalk.bold(\n // @ts-ignore version is defined when !isReset\n isHead || isLatest ? component.id.version : version\n )}\\n`;\n return `${chalk.underline(title)} ${applyVersionReport(components, false)}`;\n }\n if (isReset) {\n const title = 'successfully reset the following components\\n\\n';\n const body = components.map((component) => chalk.bold(component.id.toString())).join('\\n');\n return chalk.underline(title) + body;\n }\n const getVerOutput = () => {\n if (isHead) return 'their head version';\n if (isLatest) return 'their latest version';\n // @ts-ignore version is defined when !isReset\n return `version ${chalk.bold(version)}`;\n };\n const versionOutput = getVerOutput();\n const title = `successfully switched the following components to ${versionOutput}\\n\\n`;\n const showVersion = isHead || isReset;\n const componentsStr = applyVersionReport(components, true, showVersion);\n return chalk.underline(title) + componentsStr;\n };\n const getNewOnLaneOutput = () => {\n if (!newFromLane?.length) return '';\n const title = newFromLaneAdded\n ? `successfully added the following components from the lane`\n : `the following components introduced on the lane and were not added. omit --workspace-only flag to add them`;\n const body = newFromLane.join('\\n');\n return `\\n\\n${chalk.underline(title)}\\n${body}`;\n };\n const getSummary = () => {\n const checkedOut = components?.length || 0;\n const notCheckedOutLegitimately = notCheckedOutComponents.length;\n const failedToCheckOut = realFailedComponents.length;\n const newLines = '\\n\\n';\n const title = chalk.bold.underline('Checkout Summary');\n const checkedOutStr = `\\nTotal CheckedOut: ${chalk.bold(checkedOut.toString())}`;\n const unchangedLegitimatelyStr = `\\nTotal Unchanged: ${chalk.bold(notCheckedOutLegitimately.toString())}`;\n const failedToCheckOutStr = `\\nTotal Failed: ${chalk.bold(failedToCheckOut.toString())}`;\n const newOnLaneNum = newFromLane?.length || 0;\n const newOnLaneAddedStr = newFromLaneAdded ? ' (added)' : ' (not added)';\n const newOnLaneStr = newOnLaneNum\n ? `\\nNew on lane${newOnLaneAddedStr}: ${chalk.bold(newOnLaneNum.toString())}`\n : '';\n\n return newLines + title + checkedOutStr + unchangedLegitimatelyStr + failedToCheckOutStr + newOnLaneStr;\n };\n\n return (\n getFailureOutput() +\n getNotCheckedOutOutput() +\n getSuccessfulOutput() +\n getRemovedOutput(removedComponents) +\n getNewOnLaneOutput() +\n getConflictSummary() +\n getSummary() +\n installationErrorOutput(installationError) +\n compilationErrorOutput(compilationError)\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAQA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGO,MAAMA,WAAW,CAAoB;EA2C1CC,WAAW,CAASC,QAAsB,EAAE;IAAA,KAAxBA,QAAsB,GAAtBA,QAAsB;IAAA,8CA1CnC,mCAAmC;IAAA,mDAC9B,CACV;MACEC,IAAI,EAAE,IAAI;MACVC,WAAW,EACT;IACJ,CAAC,EACD;MACED,IAAI,EAA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B,GAAGG,YAAY;IACzG,CAAC;IAED,OACExC,gBAAgB,EAAE,GAClBc,sBAAsB,EAAE,GACxBM,mBAAmB,EAAE,GACrB,IAAAqB,2BAAgB,EAACxD,iBAAiB,CAAC,GACnC4C,kBAAkB,EAAE,GACpBb,kBAAkB,EAAE,GACpBc,UAAU,EAAE,GACZ,IAAAY,kCAAuB,EAACrD,iBAAiB,CAAC,GAC1C,IAAAsD,iCAAsB,EAACrD,gBAAgB,CAAC;EAE5C;AACF;AAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["applyVersion","consumer","id","componentFromFS","mergeResults","checkoutProps","isLane","Error","toString","mergeStrategy","filesStatus","hasConflicts","MergeOptions","ours","files","forEach","file","pathNormalizeToLinux","relative","FileStatus","unchanged","bitMap","updateComponentId","applyVersionResult","component","loadComponentFromModelImportIfNeeded","componentMap","GeneralError","updated","modifiedStatus","modifiedFiles","applyModifiedVersion","componentFiles","map","clone","manual","filePath","path","normalize","foundFile","find","componentFile","conflict","contents","Buffer","from","output","merged","isBinaryConflict","fsFile","binaryConflict","addFiles","m","push","added","deletedConflictFiles","removeFiles","removed","filter","f","remainDeletedFiles","remainDeleted","deletedConflict","overrideFiles","overridden","updatedFiles","content","markFilesToBeRemovedIfNeeded","succeededComponents","componentsResults","succeededComponentsByBitId","reduce","accum","next","bitId","componentResult","existingFilePathsFromModel","succeededComponent","filePathsFromFS","filename","deleteFilesIfNeeded","pathsToRemoveIncludeNull","compResult","Object","keys","writtenPath","join","pathsToRemove","compact","flat","dataToPersist","DataToPersist","removeManyPaths","p","RemovePath","addBasePath","getPath","persistAllToFS"],"sources":["checkout-version.ts"],"sourcesContent":["import { compact } from 'lodash';\nimport * as path from 'path';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport { BitId } from '@teambit/legacy-bit-id';\nimport GeneralError from '@teambit/legacy/dist/error/general-error';\nimport Version from '@teambit/legacy/dist/scope/models/version';\nimport { SourceFile } from '@teambit/legacy/dist/consumer/component/sources';\nimport { pathNormalizeToLinux, PathOsBased } from '@teambit/legacy/dist/utils/path';\nimport DataToPersist from '@teambit/legacy/dist/consumer/component/sources/data-to-persist';\nimport RemovePath from '@teambit/legacy/dist/consumer/component/sources/remove-path';\nimport {\n ApplyVersionResult,\n FileStatus,\n MergeOptions,\n MergeStrategy,\n} from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { MergeResultsThreeWay } from '@teambit/legacy/dist/consumer/versions-ops/merge-version/three-way-merge';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component';\n\nexport type CheckoutProps = {\n version?: string; // if reset is true, the version is undefined\n ids?: BitId[];\n latestVersion?: boolean;\n promptMergeOptions?: boolean;\n mergeStrategy?: MergeStrategy | null;\n verbose?: boolean;\n skipNpmInstall?: boolean;\n ignorePackageJson?: boolean;\n writeConfig?: boolean;\n reset?: boolean; // remove local changes. if set, the version is undefined.\n all?: boolean; // checkout all ids\n ignoreDist?: boolean;\n isLane?: boolean;\n};\nexport type ComponentStatus = {\n componentFromFS?: ConsumerComponent;\n componentFromModel?: Version;\n id: BitId;\n failureMessage?: string;\n unchangedLegitimately?: boolean; // failed to checkout but for a legitimate reason, such as, up-to-date\n mergeResults?: MergeResultsThreeWay | null | undefined;\n};\n\ntype ApplyVersionWithComps = { applyVersionResult: ApplyVersionResult; component?: ConsumerComponent };\n\n/**\n * 1) when the files are modified with conflicts and the strategy is \"ours\", leave the FS as is\n * and update only bitmap id version. (not the componentMap object).\n *\n * 2) when the files are modified with conflicts and the strategy is \"theirs\", write the component\n * according to id.version.\n *\n * 3) when files are modified with no conflict or files are modified with conflicts and the\n * strategy is manual, load the component according to id.version and update component.files.\n * applyModifiedVersion() docs explains what files are updated/added.\n *\n * 4) when --reset flag is used, write the component according to the bitmap version\n *\n * Side note:\n * Deleted file => if files are in used version but not in the modified one, no need to delete it. (similar to git).\n * Added file => if files are not in used version but in the modified one, they'll be under mergeResults.addFiles\n */\nexport async function applyVersion(\n consumer: Consumer,\n id: BitId,\n componentFromFS: ConsumerComponent | null | undefined, // it can be null only when isLanes is true\n mergeResults: MergeResultsThreeWay | null | undefined,\n checkoutProps: CheckoutProps\n): Promise<ApplyVersionWithComps> {\n if (!checkoutProps.isLane && !componentFromFS)\n throw new Error(`applyVersion expect to get componentFromFS for ${id.toString()}`);\n const { mergeStrategy } = checkoutProps;\n let filesStatus = {};\n if (mergeResults && mergeResults.hasConflicts && mergeStrategy === MergeOptions.ours) {\n // even when isLane is true, the mergeResults is possible only when the component is on the filesystem\n // otherwise it's impossible to have conflicts\n if (!componentFromFS) throw new Error(`applyVersion expect to get componentFromFS for ${id.toString()}`);\n componentFromFS.files.forEach((file) => {\n filesStatus[pathNormalizeToLinux(file.relative)] = FileStatus.unchanged;\n });\n consumer.bitMap.updateComponentId(id);\n return { applyVersionResult: { id, filesStatus } };\n }\n const component = await consumer.loadComponentFromModelImportIfNeeded(id);\n const componentMap = componentFromFS && componentFromFS.componentMap;\n if (componentFromFS && !componentMap) throw new GeneralError('applyVersion: componentMap was not found');\n\n const files = component.files;\n files.forEach((file) => {\n filesStatus[pathNormalizeToLinux(file.relative)] = FileStatus.updated;\n });\n if (mergeResults) {\n // update files according to the merge results\n const { filesStatus: modifiedStatus, modifiedFiles } = applyModifiedVersion(files, mergeResults, mergeStrategy);\n filesStatus = { ...filesStatus, ...modifiedStatus };\n component.files = modifiedFiles;\n }\n\n return {\n applyVersionResult: { id, filesStatus },\n component,\n };\n}\n\n/**\n * relevant only when\n * 1) there is no conflict => add files from mergeResults: addFiles, overrideFiles and modifiedFiles.output.\n * 2) there is conflict and mergeStrategy is manual => add files from mergeResults: addFiles, overrideFiles and modifiedFiles.conflict.\n *\n * this function only updates the files content, it doesn't write the files\n */\nexport function applyModifiedVersion(\n componentFiles: SourceFile[],\n mergeResults: MergeResultsThreeWay,\n mergeStrategy: MergeStrategy | null | undefined\n): { filesStatus: Record<string, any>; modifiedFiles: SourceFile[] } {\n let modifiedFiles = componentFiles.map((file) => file.clone());\n const filesStatus = {};\n if (mergeResults.hasConflicts && mergeStrategy !== MergeOptions.manual) {\n return { filesStatus, modifiedFiles };\n }\n mergeResults.modifiedFiles.forEach((file) => {\n const filePath: PathOsBased = path.normalize(file.filePath);\n const foundFile = modifiedFiles.find((componentFile) => componentFile.relative === filePath);\n if (!foundFile) throw new GeneralError(`file ${filePath} not found`);\n if (file.conflict) {\n foundFile.contents = Buffer.from(file.conflict);\n filesStatus[file.filePath] = FileStatus.manual;\n } else if (typeof file.output === 'string') {\n foundFile.contents = Buffer.from(file.output);\n filesStatus[file.filePath] = FileStatus.merged;\n } else if (file.isBinaryConflict) {\n // leave the file as is and notify the user later about it.\n foundFile.contents = file.fsFile.contents;\n filesStatus[file.filePath] = FileStatus.binaryConflict;\n } else {\n throw new GeneralError(`file ${filePath} does not have output nor conflict`);\n }\n });\n\n mergeResults.addFiles.forEach((file) => {\n const filePath: PathOsBased = path.normalize(file.filePath);\n if (modifiedFiles.find((m) => m.relative === filePath)) return;\n modifiedFiles.push(file.fsFile);\n filesStatus[file.filePath] = FileStatus.added;\n });\n mergeResults.deletedConflictFiles.forEach((file) => {\n if (!file.fsFile) return;\n const filePath: PathOsBased = path.normalize(file.filePath);\n if (modifiedFiles.find((m) => m.relative === filePath)) return;\n modifiedFiles.push(file.fsFile);\n filesStatus[file.filePath] = FileStatus.added;\n });\n mergeResults.removeFiles.forEach((file) => {\n const filePath: PathOsBased = path.normalize(file.filePath);\n filesStatus[file.filePath] = FileStatus.removed;\n modifiedFiles = modifiedFiles.filter((f) => f.relative !== filePath);\n });\n mergeResults.remainDeletedFiles.forEach((file) => {\n const filePath: PathOsBased = path.normalize(file.filePath);\n modifiedFiles = modifiedFiles.filter((f) => f.relative !== filePath);\n filesStatus[file.filePath] = FileStatus.remainDeleted;\n });\n mergeResults.deletedConflictFiles.forEach((file) => {\n filesStatus[file.filePath] = FileStatus.deletedConflict;\n });\n\n mergeResults.overrideFiles.forEach((file) => {\n const filePath: PathOsBased = path.normalize(file.filePath);\n const foundFile = modifiedFiles.find((componentFile) => componentFile.relative === filePath);\n if (!foundFile) throw new GeneralError(`file ${filePath} not found`);\n foundFile.contents = file.fsFile.contents;\n filesStatus[file.filePath] = FileStatus.overridden;\n });\n mergeResults.updatedFiles.forEach((file) => {\n const filePath: PathOsBased = path.normalize(file.filePath);\n const foundFile = modifiedFiles.find((componentFile) => componentFile.relative === filePath);\n if (!foundFile) throw new GeneralError(`file ${filePath} not found`);\n foundFile.contents = file.content;\n filesStatus[file.filePath] = FileStatus.updated;\n });\n\n return { filesStatus, modifiedFiles };\n}\n\n/**\n * when files exist on the filesystem but not on the checked out versions, they need to be deleted.\n * this function only mark them as such. later `deleteFilesIfNeeded()` will delete them\n */\nexport function markFilesToBeRemovedIfNeeded(\n succeededComponents: ComponentStatus[],\n componentsResults: ApplyVersionWithComps[]\n) {\n const succeededComponentsByBitId: { [K in string]: ComponentStatus } = succeededComponents.reduce((accum, next) => {\n const bitId = next.id.toString();\n if (!accum[bitId]) accum[bitId] = next;\n return accum;\n }, {});\n\n componentsResults.forEach((componentResult) => {\n const existingFilePathsFromModel = componentResult.applyVersionResult.filesStatus;\n const bitId = componentResult.applyVersionResult.id.toString();\n const succeededComponent = succeededComponentsByBitId[bitId];\n const filePathsFromFS = succeededComponent.componentFromFS?.files || [];\n\n filePathsFromFS.forEach((file) => {\n const filename = pathNormalizeToLinux(file.relative);\n if (!existingFilePathsFromModel[filename]) {\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n existingFilePathsFromModel[filename] = FileStatus.removed;\n }\n });\n });\n}\n\n/**\n * it's needed in case the checked out version removed files that exist on the current version.\n * without this function, these files would be left on the filesystem.\n */\nexport async function deleteFilesIfNeeded(\n componentsResults: ApplyVersionWithComps[],\n consumer: Consumer\n): Promise<void> {\n const pathsToRemoveIncludeNull = componentsResults.map((compResult) => {\n return Object.keys(compResult.applyVersionResult.filesStatus).map((filePath) => {\n if (compResult.applyVersionResult.filesStatus[filePath] === FileStatus.removed) {\n if (!compResult.component?.writtenPath) return null;\n return path.join(compResult.component?.writtenPath, filePath);\n }\n return null;\n });\n });\n const pathsToRemove = compact(pathsToRemoveIncludeNull.flat());\n const dataToPersist = new DataToPersist();\n dataToPersist.removeManyPaths(pathsToRemove.map((p) => new RemovePath(p, true)));\n dataToPersist.addBasePath(consumer.getPath());\n await dataToPersist.persistAllToFS();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAKkE;AAAA;AAAA;AAAA;AA8BlE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,eAAeA,YAAY,CAChCC,QAAkB,EAClBC,EAAS,EACTC,eAAqD;AAAE;AACvDC,YAAqD,EACrDC,aAA4B,EACI;EAChC,IAAI,CAACA,aAAa,CAACC,MAAM,IAAI,CAACH,eAAe,EAC3C,MAAM,IAAII,KAAK,CAAE,kDAAiDL,EAAE,CAACM,QAAQ,EAAG,EAAC,CAAC;EACpF,MAAM;IAAEC;EAAc,CAAC,GAAGJ,aAAa;EACvC,IAAIK,WAAW,GAAG,CAAC,CAAC;EACpB,IAAIN,YAAY,IAAIA,YAAY,CAACO,YAAY,IAAIF,aAAa,KAAKG,4BAAY,CAACC,IAAI,EAAE;IACpF;IACA;IACA,IAAI,CAACV,eAAe,EAAE,MAAM,IAAII,KAAK,CAAE,kDAAiDL,EAAE,CAACM,QAAQ,EAAG,EAAC,CAAC;IACxGL,eAAe,CAACW,KAAK,C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,CAAC,GAAG5D,0BAAU,CAACsC,OAAO;MAC3D;IACF,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ;;AAEA;AACA;AACA;AACA;AACO,eAAeuB,mBAAmB,CACvCX,iBAA0C,EAC1CpE,QAAkB,EACH;EACf,MAAMgF,wBAAwB,GAAGZ,iBAAiB,CAACpC,GAAG,CAAEiD,UAAU,IAAK;IACrE,OAAOC,MAAM,CAACC,IAAI,CAACF,UAAU,CAAC3D,kBAAkB,CAACb,WAAW,CAAC,CAACuB,GAAG,CAAEG,QAAQ,IAAK;MAC9E,IAAI8C,UAAU,CAAC3D,kBAAkB,CAACb,WAAW,CAAC0B,QAAQ,CAAC,KAAKjB,0BAAU,CAACsC,OAAO,EAAE;QAAA;QAC9E,IAAI,2BAACyB,UAAU,CAAC1D,SAAS,kDAApB,sBAAsB6D,WAAW,GAAE,OAAO,IAAI;QACnD,OAAOhD,IAAI,GAACiD,IAAI,2BAACJ,UAAU,CAAC1D,SAAS,2DAApB,uBAAsB6D,WAAW,EAAEjD,QAAQ,CAAC;MAC/D;MACA,OAAO,IAAI;IACb,CAAC,CAAC;EACJ,CAAC,CAAC;EACF,MAAMmD,aAAa,GAAG,IAAAC,iBAAO,EAACP,wBAAwB,CAACQ,IAAI,EAAE,CAAC;EAC9D,MAAMC,aAAa,GAAG,KAAIC,wBAAa,GAAE;EACzCD,aAAa,CAACE,eAAe,CAACL,aAAa,CAACtD,GAAG,CAAE4D,CAAC,IAAK,KAAIC,qBAAU,EAACD,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;EAChFH,aAAa,CAACK,WAAW,CAAC9F,QAAQ,CAAC+F,OAAO,EAAE,CAAC;EAC7C,MAAMN,aAAa,CAACO,cAAc,EAAE;AACtC"}
|
|
1
|
+
{"version":3,"names":["applyVersion","consumer","id","componentFromFS","mergeResults","checkoutProps","isLane","Error","toString","mergeStrategy","filesStatus","hasConflicts","MergeOptions","ours","files","forEach","file","pathNormalizeToLinux","relative","FileStatus","unchanged","bitMap","updateComponentId","applyVersionResult","component","loadComponentFromModelImportIfNeeded","componentMap","GeneralError","updated","modifiedStatus","modifiedFiles","applyModifiedVersion","componentFiles","map","clone","manual","filePath","path","normalize","foundFile","find","componentFile","conflict","contents","Buffer","from","output","merged","isBinaryConflict","fsFile","binaryConflict","addFiles","m","push","added","deletedConflictFiles","removeFiles","removed","filter","f","remainDeletedFiles","remainDeleted","deletedConflict","overrideFiles","overridden","updatedFiles","content","markFilesToBeRemovedIfNeeded","succeededComponents","componentsResults","succeededComponentsByBitId","reduce","accum","next","bitId","componentResult","existingFilePathsFromModel","succeededComponent","filePathsFromFS","filename","deleteFilesIfNeeded","pathsToRemoveIncludeNull","compResult","Object","keys","writtenPath","join","pathsToRemove","compact","flat","dataToPersist","DataToPersist","removeManyPaths","p","RemovePath","addBasePath","getPath","persistAllToFS"],"sources":["checkout-version.ts"],"sourcesContent":["import { compact } from 'lodash';\nimport * as path from 'path';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport { BitId } from '@teambit/legacy-bit-id';\nimport GeneralError from '@teambit/legacy/dist/error/general-error';\nimport Version from '@teambit/legacy/dist/scope/models/version';\nimport { SourceFile } from '@teambit/legacy/dist/consumer/component/sources';\nimport { pathNormalizeToLinux, PathOsBased } from '@teambit/legacy/dist/utils/path';\nimport DataToPersist from '@teambit/legacy/dist/consumer/component/sources/data-to-persist';\nimport RemovePath from '@teambit/legacy/dist/consumer/component/sources/remove-path';\nimport {\n ApplyVersionResult,\n FileStatus,\n MergeOptions,\n MergeStrategy,\n} from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { MergeResultsThreeWay } from '@teambit/legacy/dist/consumer/versions-ops/merge-version/three-way-merge';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component';\n\nexport type CheckoutProps = {\n version?: string; // if reset is true, the version is undefined\n ids?: BitId[];\n latestVersion?: boolean;\n promptMergeOptions?: boolean;\n mergeStrategy?: MergeStrategy | null;\n verbose?: boolean;\n skipNpmInstall?: boolean;\n ignorePackageJson?: boolean;\n writeConfig?: boolean;\n reset?: boolean; // remove local changes. if set, the version is undefined.\n all?: boolean; // checkout all ids\n ignoreDist?: boolean;\n isLane?: boolean;\n};\nexport type ComponentStatus = {\n componentFromFS?: ConsumerComponent;\n componentFromModel?: Version;\n id: BitId;\n failureMessage?: string;\n unchangedLegitimately?: boolean; // failed to checkout but for a legitimate reason, such as, up-to-date\n shouldBeRemoved?: boolean;\n mergeResults?: MergeResultsThreeWay | null | undefined;\n};\n\ntype ApplyVersionWithComps = { applyVersionResult: ApplyVersionResult; component?: ConsumerComponent };\n\n/**\n * 1) when the files are modified with conflicts and the strategy is \"ours\", leave the FS as is\n * and update only bitmap id version. (not the componentMap object).\n *\n * 2) when the files are modified with conflicts and the strategy is \"theirs\", write the component\n * according to id.version.\n *\n * 3) when files are modified with no conflict or files are modified with conflicts and the\n * strategy is manual, load the component according to id.version and update component.files.\n * applyModifiedVersion() docs explains what files are updated/added.\n *\n * 4) when --reset flag is used, write the component according to the bitmap version\n *\n * Side note:\n * Deleted file => if files are in used version but not in the modified one, no need to delete it. (similar to git).\n * Added file => if files are not in used version but in the modified one, they'll be under mergeResults.addFiles\n */\nexport async function applyVersion(\n consumer: Consumer,\n id: BitId,\n componentFromFS: ConsumerComponent | null | undefined, // it can be null only when isLanes is true\n mergeResults: MergeResultsThreeWay | null | undefined,\n checkoutProps: CheckoutProps\n): Promise<ApplyVersionWithComps> {\n if (!checkoutProps.isLane && !componentFromFS)\n throw new Error(`applyVersion expect to get componentFromFS for ${id.toString()}`);\n const { mergeStrategy } = checkoutProps;\n let filesStatus = {};\n if (mergeResults && mergeResults.hasConflicts && mergeStrategy === MergeOptions.ours) {\n // even when isLane is true, the mergeResults is possible only when the component is on the filesystem\n // otherwise it's impossible to have conflicts\n if (!componentFromFS) throw new Error(`applyVersion expect to get componentFromFS for ${id.toString()}`);\n componentFromFS.files.forEach((file) => {\n filesStatus[pathNormalizeToLinux(file.relative)] = FileStatus.unchanged;\n });\n consumer.bitMap.updateComponentId(id);\n return { applyVersionResult: { id, filesStatus } };\n }\n const component = await consumer.loadComponentFromModelImportIfNeeded(id);\n const componentMap = componentFromFS && componentFromFS.componentMap;\n if (componentFromFS && !componentMap) throw new GeneralError('applyVersion: componentMap was not found');\n\n const files = component.files;\n files.forEach((file) => {\n filesStatus[pathNormalizeToLinux(file.relative)] = FileStatus.updated;\n });\n if (mergeResults) {\n // update files according to the merge results\n const { filesStatus: modifiedStatus, modifiedFiles } = applyModifiedVersion(files, mergeResults, mergeStrategy);\n filesStatus = { ...filesStatus, ...modifiedStatus };\n component.files = modifiedFiles;\n }\n\n return {\n applyVersionResult: { id, filesStatus },\n component,\n };\n}\n\n/**\n * relevant only when\n * 1) there is no conflict => add files from mergeResults: addFiles, overrideFiles and modifiedFiles.output.\n * 2) there is conflict and mergeStrategy is manual => add files from mergeResults: addFiles, overrideFiles and modifiedFiles.conflict.\n *\n * this function only updates the files content, it doesn't write the files\n */\nexport function applyModifiedVersion(\n componentFiles: SourceFile[],\n mergeResults: MergeResultsThreeWay,\n mergeStrategy: MergeStrategy | null | undefined\n): { filesStatus: Record<string, any>; modifiedFiles: SourceFile[] } {\n let modifiedFiles = componentFiles.map((file) => file.clone());\n const filesStatus = {};\n if (mergeResults.hasConflicts && mergeStrategy !== MergeOptions.manual) {\n return { filesStatus, modifiedFiles };\n }\n mergeResults.modifiedFiles.forEach((file) => {\n const filePath: PathOsBased = path.normalize(file.filePath);\n const foundFile = modifiedFiles.find((componentFile) => componentFile.relative === filePath);\n if (!foundFile) throw new GeneralError(`file ${filePath} not found`);\n if (file.conflict) {\n foundFile.contents = Buffer.from(file.conflict);\n filesStatus[file.filePath] = FileStatus.manual;\n } else if (typeof file.output === 'string') {\n foundFile.contents = Buffer.from(file.output);\n filesStatus[file.filePath] = FileStatus.merged;\n } else if (file.isBinaryConflict) {\n // leave the file as is and notify the user later about it.\n foundFile.contents = file.fsFile.contents;\n filesStatus[file.filePath] = FileStatus.binaryConflict;\n } else {\n throw new GeneralError(`file ${filePath} does not have output nor conflict`);\n }\n });\n\n mergeResults.addFiles.forEach((file) => {\n const filePath: PathOsBased = path.normalize(file.filePath);\n if (modifiedFiles.find((m) => m.relative === filePath)) return;\n modifiedFiles.push(file.fsFile);\n filesStatus[file.filePath] = FileStatus.added;\n });\n mergeResults.deletedConflictFiles.forEach((file) => {\n if (!file.fsFile) return;\n const filePath: PathOsBased = path.normalize(file.filePath);\n if (modifiedFiles.find((m) => m.relative === filePath)) return;\n modifiedFiles.push(file.fsFile);\n filesStatus[file.filePath] = FileStatus.added;\n });\n mergeResults.removeFiles.forEach((file) => {\n const filePath: PathOsBased = path.normalize(file.filePath);\n filesStatus[file.filePath] = FileStatus.removed;\n modifiedFiles = modifiedFiles.filter((f) => f.relative !== filePath);\n });\n mergeResults.remainDeletedFiles.forEach((file) => {\n const filePath: PathOsBased = path.normalize(file.filePath);\n modifiedFiles = modifiedFiles.filter((f) => f.relative !== filePath);\n filesStatus[file.filePath] = FileStatus.remainDeleted;\n });\n mergeResults.deletedConflictFiles.forEach((file) => {\n filesStatus[file.filePath] = FileStatus.deletedConflict;\n });\n\n mergeResults.overrideFiles.forEach((file) => {\n const filePath: PathOsBased = path.normalize(file.filePath);\n const foundFile = modifiedFiles.find((componentFile) => componentFile.relative === filePath);\n if (!foundFile) throw new GeneralError(`file ${filePath} not found`);\n foundFile.contents = file.fsFile.contents;\n filesStatus[file.filePath] = FileStatus.overridden;\n });\n mergeResults.updatedFiles.forEach((file) => {\n const filePath: PathOsBased = path.normalize(file.filePath);\n const foundFile = modifiedFiles.find((componentFile) => componentFile.relative === filePath);\n if (!foundFile) throw new GeneralError(`file ${filePath} not found`);\n foundFile.contents = file.content;\n filesStatus[file.filePath] = FileStatus.updated;\n });\n\n return { filesStatus, modifiedFiles };\n}\n\n/**\n * when files exist on the filesystem but not on the checked out versions, they need to be deleted.\n * this function only mark them as such. later `deleteFilesIfNeeded()` will delete them\n */\nexport function markFilesToBeRemovedIfNeeded(\n succeededComponents: ComponentStatus[],\n componentsResults: ApplyVersionWithComps[]\n) {\n const succeededComponentsByBitId: { [K in string]: ComponentStatus } = succeededComponents.reduce((accum, next) => {\n const bitId = next.id.toString();\n if (!accum[bitId]) accum[bitId] = next;\n return accum;\n }, {});\n\n componentsResults.forEach((componentResult) => {\n const existingFilePathsFromModel = componentResult.applyVersionResult.filesStatus;\n const bitId = componentResult.applyVersionResult.id.toString();\n const succeededComponent = succeededComponentsByBitId[bitId];\n const filePathsFromFS = succeededComponent.componentFromFS?.files || [];\n\n filePathsFromFS.forEach((file) => {\n const filename = pathNormalizeToLinux(file.relative);\n if (!existingFilePathsFromModel[filename]) {\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n existingFilePathsFromModel[filename] = FileStatus.removed;\n }\n });\n });\n}\n\n/**\n * it's needed in case the checked out version removed files that exist on the current version.\n * without this function, these files would be left on the filesystem.\n */\nexport async function deleteFilesIfNeeded(\n componentsResults: ApplyVersionWithComps[],\n consumer: Consumer\n): Promise<void> {\n const pathsToRemoveIncludeNull = componentsResults.map((compResult) => {\n return Object.keys(compResult.applyVersionResult.filesStatus).map((filePath) => {\n if (compResult.applyVersionResult.filesStatus[filePath] === FileStatus.removed) {\n if (!compResult.component?.writtenPath) return null;\n return path.join(compResult.component?.writtenPath, filePath);\n }\n return null;\n });\n });\n const pathsToRemove = compact(pathsToRemoveIncludeNull.flat());\n const dataToPersist = new DataToPersist();\n dataToPersist.removeManyPaths(pathsToRemove.map((p) => new RemovePath(p, true)));\n dataToPersist.addBasePath(consumer.getPath());\n await dataToPersist.persistAllToFS();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAA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9E,IAAI,2BAACyB,UAAU,CAAC1D,SAAS,kDAApB,sBAAsB6D,WAAW,GAAE,OAAO,IAAI;QACnD,OAAOhD,IAAI,GAACiD,IAAI,2BAACJ,UAAU,CAAC1D,SAAS,2DAApB,uBAAsB6D,WAAW,EAAEjD,QAAQ,CAAC;MAC/D;MACA,OAAO,IAAI;IACb,CAAC,CAAC;EACJ,CAAC,CAAC;EACF,MAAMmD,aAAa,GAAG,IAAAC,iBAAO,EAACP,wBAAwB,CAACQ,IAAI,EAAE,CAAC;EAC9D,MAAMC,aAAa,GAAG,KAAIC,wBAAa,GAAE;EACzCD,aAAa,CAACE,eAAe,CAACL,aAAa,CAACtD,GAAG,CAAE4D,CAAC,IAAK,KAAIC,qBAAU,EAACD,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;EAChFH,aAAa,CAACK,WAAW,CAAC9F,QAAQ,CAAC+F,OAAO,EAAE,CAAC;EAC7C,MAAMN,aAAa,CAACO,cAAc,EAAE;AACtC"}
|
|
@@ -2,6 +2,7 @@ import { CLIMain } from '@teambit/cli';
|
|
|
2
2
|
import { Logger, LoggerMain } from '@teambit/logger';
|
|
3
3
|
import { Workspace } from '@teambit/workspace';
|
|
4
4
|
import { BitId } from '@teambit/legacy-bit-id';
|
|
5
|
+
import { RemoveMain } from '@teambit/remove';
|
|
5
6
|
import { ApplyVersionResults } from '@teambit/merging';
|
|
6
7
|
import { ImporterMain } from '@teambit/importer';
|
|
7
8
|
import { ComponentWriterMain } from '@teambit/component-writer';
|
|
@@ -29,6 +30,7 @@ export declare type ComponentStatusBeforeMergeAttempt = {
|
|
|
29
30
|
id: BitId;
|
|
30
31
|
failureMessage?: string;
|
|
31
32
|
unchangedLegitimately?: boolean;
|
|
33
|
+
shouldBeRemoved?: boolean;
|
|
32
34
|
propsForMerge?: {
|
|
33
35
|
currentlyUsedVersion: string;
|
|
34
36
|
componentModel: ModelComponent;
|
|
@@ -40,7 +42,8 @@ export declare class CheckoutMain {
|
|
|
40
42
|
private logger;
|
|
41
43
|
private componentWriter;
|
|
42
44
|
private importer;
|
|
43
|
-
|
|
45
|
+
private remove;
|
|
46
|
+
constructor(workspace: Workspace, logger: Logger, componentWriter: ComponentWriterMain, importer: ImporterMain, remove: RemoveMain);
|
|
44
47
|
checkout(checkoutProps: CheckoutProps): Promise<ApplyVersionResults>;
|
|
45
48
|
checkoutByCLIValues(to: CheckoutTo, componentPattern: string, checkoutProps: CheckoutProps): Promise<ApplyVersionResults>;
|
|
46
49
|
private syncNewComponents;
|
|
@@ -52,12 +55,13 @@ export declare class CheckoutMain {
|
|
|
52
55
|
static slots: never[];
|
|
53
56
|
static dependencies: import("@teambit/harmony").Aspect[];
|
|
54
57
|
static runtime: import("@teambit/harmony").RuntimeDefinition;
|
|
55
|
-
static provider([cli, workspace, loggerMain, compWriter, importer]: [
|
|
58
|
+
static provider([cli, workspace, loggerMain, compWriter, importer, remove]: [
|
|
56
59
|
CLIMain,
|
|
57
60
|
Workspace,
|
|
58
61
|
LoggerMain,
|
|
59
62
|
ComponentWriterMain,
|
|
60
|
-
ImporterMain
|
|
63
|
+
ImporterMain,
|
|
64
|
+
RemoveMain
|
|
61
65
|
]): Promise<CheckoutMain>;
|
|
62
66
|
}
|
|
63
67
|
export default CheckoutMain;
|
|
@@ -65,6 +65,13 @@ function _loaderMessages() {
|
|
|
65
65
|
};
|
|
66
66
|
return data;
|
|
67
67
|
}
|
|
68
|
+
function _remove() {
|
|
69
|
+
const data = _interopRequireDefault(require("@teambit/remove"));
|
|
70
|
+
_remove = function () {
|
|
71
|
+
return data;
|
|
72
|
+
};
|
|
73
|
+
return data;
|
|
74
|
+
}
|
|
68
75
|
function _importer() {
|
|
69
76
|
const data = _interopRequireDefault(require("@teambit/importer"));
|
|
70
77
|
_importer = function () {
|
|
@@ -147,11 +154,12 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
147
154
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
148
155
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2().default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
149
156
|
class CheckoutMain {
|
|
150
|
-
constructor(workspace, logger, componentWriter, importer) {
|
|
157
|
+
constructor(workspace, logger, componentWriter, importer, remove) {
|
|
151
158
|
this.workspace = workspace;
|
|
152
159
|
this.logger = logger;
|
|
153
160
|
this.componentWriter = componentWriter;
|
|
154
161
|
this.importer = importer;
|
|
162
|
+
this.remove = remove;
|
|
155
163
|
}
|
|
156
164
|
async checkout(checkoutProps) {
|
|
157
165
|
var _checkoutProps$ids, _newFromLane, _componentWriterResul, _componentWriterResul2;
|
|
@@ -202,7 +210,7 @@ class CheckoutMain {
|
|
|
202
210
|
}
|
|
203
211
|
if (!checkoutProps.mergeStrategy) checkoutProps.mergeStrategy = await (0, _mergeVersion().getMergeStrategyInteractive)();
|
|
204
212
|
}
|
|
205
|
-
const failedComponents = allComponentsStatus.filter(componentStatus => componentStatus.failureMessage).map(componentStatus => ({
|
|
213
|
+
const failedComponents = allComponentsStatus.filter(componentStatus => componentStatus.failureMessage).filter(componentStatus => !componentStatus.shouldBeRemoved).map(componentStatus => ({
|
|
206
214
|
id: componentStatus.id,
|
|
207
215
|
failureMessage: componentStatus.failureMessage,
|
|
208
216
|
unchangedLegitimately: componentStatus.unchangedLegitimately
|
|
@@ -245,8 +253,15 @@ class CheckoutMain {
|
|
|
245
253
|
await (0, _checkoutVersion().deleteFilesIfNeeded)(componentsResults, consumer);
|
|
246
254
|
}
|
|
247
255
|
const appliedVersionComponents = componentsResults.map(c => c.applyVersionResult);
|
|
256
|
+
const componentIdsToRemove = allComponentsStatus.filter(componentStatus => componentStatus.shouldBeRemoved).map(c => c.id.changeVersion(undefined));
|
|
257
|
+
if (componentIdsToRemove.length) {
|
|
258
|
+
await this.remove.removeLocallyByIds(componentIdsToRemove, {
|
|
259
|
+
force: true
|
|
260
|
+
});
|
|
261
|
+
}
|
|
248
262
|
return {
|
|
249
263
|
components: appliedVersionComponents,
|
|
264
|
+
removedComponents: componentIdsToRemove,
|
|
250
265
|
version,
|
|
251
266
|
failedComponents,
|
|
252
267
|
leftUnresolvedConflicts,
|
|
@@ -402,6 +417,10 @@ class CheckoutMain {
|
|
|
402
417
|
const versionRef = componentModel.getRef(newVersion);
|
|
403
418
|
if (!versionRef) throw new Error(`unable to get ref ${newVersion} from ${componentModel.id()}`);
|
|
404
419
|
const componentVersion = await consumer.scope.getObject(versionRef.hash);
|
|
420
|
+
if (componentVersion !== null && componentVersion !== void 0 && componentVersion.isRemoved() && existingBitMapId) {
|
|
421
|
+
componentStatus.shouldBeRemoved = true;
|
|
422
|
+
return returnFailure(`component has been removed`, true);
|
|
423
|
+
}
|
|
405
424
|
const newId = component.id.changeVersion(newVersion);
|
|
406
425
|
if (reset || !isModified) {
|
|
407
426
|
// if the component is not modified, no need to try merge the files, they will be written later on according to the
|
|
@@ -465,16 +484,16 @@ class CheckoutMain {
|
|
|
465
484
|
mergeResults
|
|
466
485
|
};
|
|
467
486
|
}
|
|
468
|
-
static async provider([cli, workspace, loggerMain, compWriter, importer]) {
|
|
487
|
+
static async provider([cli, workspace, loggerMain, compWriter, importer, remove]) {
|
|
469
488
|
const logger = loggerMain.createLogger(_checkout().CheckoutAspect.id);
|
|
470
|
-
const checkoutMain = new CheckoutMain(workspace, logger, compWriter, importer);
|
|
489
|
+
const checkoutMain = new CheckoutMain(workspace, logger, compWriter, importer, remove);
|
|
471
490
|
cli.register(new (_checkoutCmd().CheckoutCmd)(checkoutMain));
|
|
472
491
|
return checkoutMain;
|
|
473
492
|
}
|
|
474
493
|
}
|
|
475
494
|
exports.CheckoutMain = CheckoutMain;
|
|
476
495
|
(0, _defineProperty2().default)(CheckoutMain, "slots", []);
|
|
477
|
-
(0, _defineProperty2().default)(CheckoutMain, "dependencies", [_cli().CLIAspect, _workspace().default, _logger().LoggerAspect, _componentWriter().ComponentWriterAspect, _importer().default]);
|
|
496
|
+
(0, _defineProperty2().default)(CheckoutMain, "dependencies", [_cli().CLIAspect, _workspace().default, _logger().LoggerAspect, _componentWriter().ComponentWriterAspect, _importer().default, _remove().default]);
|
|
478
497
|
(0, _defineProperty2().default)(CheckoutMain, "runtime", _cli().MainRuntime);
|
|
479
498
|
_checkout().CheckoutAspect.addRuntime(CheckoutMain);
|
|
480
499
|
var _default = CheckoutMain;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CheckoutMain","constructor","workspace","logger","componentWriter","importer","checkout","checkoutProps","consumer","version","ids","promptMergeOptions","syncNewComponents","importCurrentObjects","bitIds","BitIds","fromArray","map","id","_legacy","components","loadComponents","allComponentStatusBeforeMerge","Promise","all","component","getComponentStatusBeforeMergeAttempt","compsNeedMerge","filter","c","propsForMerge","compsNotNeedMerge","toImport","compStatus","idsToImport","push","changeVersion","currentlyUsedVersion","flat","scope","legacyScope","scopeImporter","importManyIfMissingWithoutDeps","getComponentsStatusOfMergeNeeded","tmp","Tmp","afterMergeAttempt","getMergeStatus","clear","err","compStatusMergeNeeded","allComponentsStatus","componentWithConflict","find","mergeResults","hasConflicts","mergeStrategy","GeneralError","toStringWithoutVersion","getMergeStrategyInteractive","failedComponents","componentStatus","failureMessage","unchangedLegitimately","succeededComponents","checkoutPropsLegacy","componentsResults","mapSeries","componentFromFS","applyVersion","markFilesToBeRemovedIfNeeded","componentsLegacy","compact","newFromLane","newFromLaneAdded","head","getNewComponentsFromLane","workspaceOnly","compsNewFromLane","loadComponentFromModelImportIfNeeded","leftUnresolvedConflicts","componentWriterResults","length","manyComponentsWriterOpts","skipDependencyInstallation","skipNpmInstall","verbose","resetConfig","reset","writeMany","deleteFilesIfNeeded","appliedVersionComponents","applyVersionResult","n","toString","installationError","compilationError","checkoutByCLIValues","to","componentPattern","setStatusLine","BEFORE_CHECKOUT","OutsideWorkspaceError","makeLaneComponentsAvailableOnMain","parseValues","checkoutResults","onDestroy","notExported","hasScope","changeScope","scopeComponentsImporter","importManyDeltaWithoutDeps","fromHead","error","unavailableOnMain","getUnavailableOnMainComponents","bitMap","makeComponentsAvailableOnMain","HEAD","LATEST","latest","BitId","isValidVersion","BitError","console","idsOnWorkspace","idsByPattern","listIds","currentLane","getCurrentLaneObject","currentLaneIds","toBitIds","hasWithoutVersion","lane","laneBitIds","newIds","bitId","isEqualWithoutVersion","newComponentIds","resolveMultipleComponentIds","nonRemovedNewIds","isRemoved","isComponentRemoved","headVersion","latestVersion","repo","objects","componentModel","getModelComponentIfExist","returnFailure","msg","unmerged","unmergedComponents","getEntry","name","getNewVersion","headIncludeRemote","newVersion","hasVersion","existingBitMapId","getBitId","ignoreVersion","divergeDataForMergePending","getDivergeDataForMergePending","isMergePending","isDiverged","currentVersionObject","loadVersion","isModified","isComponentModified","versionRef","getRef","Error","componentVersion","getObject","hash","newId","componentFromModel","baseVersion","baseComponent","otherComponent","threeWayMerge","otherLabel","currentComponent","currentLabel","provider","cli","loggerMain","compWriter","createLogger","CheckoutAspect","checkoutMain","register","CheckoutCmd","CLIAspect","WorkspaceAspect","LoggerAspect","ComponentWriterAspect","ImporterAspect","MainRuntime","addRuntime"],"sources":["checkout.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport WorkspaceAspect, { OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport { BitId } from '@teambit/legacy-bit-id';\nimport { BitError } from '@teambit/bit-error';\nimport { compact } from 'lodash';\nimport { BEFORE_CHECKOUT } from '@teambit/legacy/dist/cli/loader/loader-messages';\nimport { ApplyVersionResults } from '@teambit/merging';\nimport ImporterAspect, { ImporterMain } from '@teambit/importer';\nimport { HEAD, LATEST } from '@teambit/legacy/dist/constants';\nimport { ComponentWriterAspect, ComponentWriterMain } from '@teambit/component-writer';\nimport {\n FailedComponents,\n getMergeStrategyInteractive,\n MergeStrategy,\n threeWayMerge,\n} from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport GeneralError from '@teambit/legacy/dist/error/general-error';\nimport mapSeries from 'p-map-series';\nimport { BitIds } from '@teambit/legacy/dist/bit-id';\nimport { Version, ModelComponent } from '@teambit/legacy/dist/scope/models';\nimport { Tmp } from '@teambit/legacy/dist/scope/repositories';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component';\nimport { ComponentID } from '@teambit/component-id';\nimport { CheckoutCmd } from './checkout-cmd';\nimport { CheckoutAspect } from './checkout.aspect';\nimport { applyVersion, markFilesToBeRemovedIfNeeded, ComponentStatus, deleteFilesIfNeeded } from './checkout-version';\n\nexport type CheckoutProps = {\n version?: string; // if reset is true, the version is undefined\n ids?: ComponentID[];\n head?: boolean;\n latest?: boolean;\n promptMergeOptions?: boolean;\n mergeStrategy?: MergeStrategy | null;\n verbose?: boolean;\n skipNpmInstall?: boolean;\n reset?: boolean; // remove local changes. if set, the version is undefined.\n all?: boolean; // checkout all ids\n isLane?: boolean;\n workspaceOnly?: boolean;\n};\n\nexport type ComponentStatusBeforeMergeAttempt = {\n componentFromFS?: ConsumerComponent;\n componentFromModel?: Version;\n id: BitId;\n failureMessage?: string;\n unchangedLegitimately?: boolean; // failed to checkout but for a legitimate reason, such as, up-to-date\n propsForMerge?: {\n currentlyUsedVersion: string;\n componentModel: ModelComponent;\n };\n};\n\ntype CheckoutTo = 'head' | 'reset' | string;\n\nexport class CheckoutMain {\n constructor(\n private workspace: Workspace,\n private logger: Logger,\n private componentWriter: ComponentWriterMain,\n private importer: ImporterMain\n ) {}\n\n async checkout(checkoutProps: CheckoutProps): Promise<ApplyVersionResults> {\n const consumer = this.workspace.consumer;\n const { version, ids, promptMergeOptions } = checkoutProps;\n await this.syncNewComponents(checkoutProps);\n await this.importer.importCurrentObjects(); // important. among others, it fetches the remote lane object and its new components.\n const bitIds = BitIds.fromArray(ids?.map((id) => id._legacy) || []);\n const { components } = await consumer.loadComponents(bitIds);\n\n const allComponentStatusBeforeMerge = await Promise.all(\n components.map((component) => this.getComponentStatusBeforeMergeAttempt(component, checkoutProps))\n );\n const compsNeedMerge = allComponentStatusBeforeMerge.filter((c) => c.propsForMerge);\n const compsNotNeedMerge = allComponentStatusBeforeMerge.filter((c) => !c.propsForMerge) as ComponentStatus[];\n\n // in case the requested versions to checkout don't exist locally, import them.\n const toImport = allComponentStatusBeforeMerge\n .map((compStatus) => {\n const idsToImport = [compStatus.id];\n if (compStatus.propsForMerge) {\n idsToImport.push(compStatus.id.changeVersion(compStatus.propsForMerge.currentlyUsedVersion));\n }\n return idsToImport;\n })\n .flat();\n await this.workspace.scope.legacyScope.scopeImporter.importManyIfMissingWithoutDeps({\n ids: BitIds.fromArray(toImport),\n });\n\n const getComponentsStatusOfMergeNeeded = async (): Promise<ComponentStatus[]> => {\n const tmp = new Tmp(consumer.scope);\n try {\n const afterMergeAttempt = await Promise.all(compsNeedMerge.map((c) => this.getMergeStatus(c)));\n await tmp.clear();\n return afterMergeAttempt;\n } catch (err: any) {\n await tmp.clear();\n throw err;\n }\n };\n\n const compStatusMergeNeeded = await getComponentsStatusOfMergeNeeded();\n\n const allComponentsStatus: ComponentStatus[] = [...compStatusMergeNeeded, ...compsNotNeedMerge];\n const componentWithConflict = allComponentsStatus.find(\n (component) => component.mergeResults && component.mergeResults.hasConflicts\n );\n if (componentWithConflict) {\n if (!promptMergeOptions && !checkoutProps.mergeStrategy) {\n throw new GeneralError(\n `automatic merge has failed for component ${componentWithConflict.id.toStringWithoutVersion()}.\\nplease use \"--manual\" to manually merge changes or use \"--theirs / --ours\" to choose one of the conflicted versions`\n );\n }\n if (!checkoutProps.mergeStrategy) checkoutProps.mergeStrategy = await getMergeStrategyInteractive();\n }\n const failedComponents: FailedComponents[] = allComponentsStatus\n .filter((componentStatus) => componentStatus.failureMessage)\n .map((componentStatus) => ({\n id: componentStatus.id,\n failureMessage: componentStatus.failureMessage as string,\n unchangedLegitimately: componentStatus.unchangedLegitimately,\n }));\n\n const succeededComponents = allComponentsStatus.filter((componentStatus) => !componentStatus.failureMessage);\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 checkoutPropsLegacy = { ...checkoutProps, ids: checkoutProps.ids?.map((id) => id._legacy) };\n const componentsResults = await mapSeries(succeededComponents, ({ id, componentFromFS, mergeResults }) => {\n return applyVersion(consumer, id, componentFromFS, mergeResults, checkoutPropsLegacy);\n });\n\n markFilesToBeRemovedIfNeeded(succeededComponents, componentsResults);\n\n const componentsLegacy = compact(componentsResults.map((c) => c.component));\n\n let newFromLane: ComponentID[] | undefined;\n let newFromLaneAdded = false;\n if (checkoutProps.head) {\n newFromLane = await this.getNewComponentsFromLane(checkoutProps.ids || []);\n if (!checkoutProps.workspaceOnly) {\n const compsNewFromLane = await Promise.all(\n newFromLane.map((id) => consumer.loadComponentFromModelImportIfNeeded(id._legacy))\n );\n componentsLegacy.push(...compsNewFromLane);\n newFromLaneAdded = true;\n }\n }\n\n const leftUnresolvedConflicts = componentWithConflict && checkoutProps.mergeStrategy === 'manual';\n let componentWriterResults;\n if (componentsLegacy.length) {\n const manyComponentsWriterOpts = {\n components: componentsLegacy,\n skipDependencyInstallation: checkoutProps.skipNpmInstall || leftUnresolvedConflicts,\n verbose: checkoutProps.verbose,\n resetConfig: checkoutProps.reset,\n };\n componentWriterResults = await this.componentWriter.writeMany(manyComponentsWriterOpts);\n await deleteFilesIfNeeded(componentsResults, consumer);\n }\n\n const appliedVersionComponents = componentsResults.map((c) => c.applyVersionResult);\n\n return {\n components: appliedVersionComponents,\n version,\n failedComponents,\n leftUnresolvedConflicts,\n newFromLane: newFromLane?.map((n) => n.toString()),\n newFromLaneAdded,\n installationError: componentWriterResults?.installationError,\n compilationError: componentWriterResults?.compilationError,\n };\n }\n\n async checkoutByCLIValues(\n to: CheckoutTo,\n componentPattern: string,\n checkoutProps: CheckoutProps\n ): Promise<ApplyVersionResults> {\n this.logger.setStatusLine(BEFORE_CHECKOUT);\n if (!this.workspace) throw new OutsideWorkspaceError();\n const consumer = this.workspace.consumer;\n if (to === 'head') await this.makeLaneComponentsAvailableOnMain();\n await this.parseValues(to, componentPattern, checkoutProps);\n const checkoutResults = await this.checkout(checkoutProps);\n await consumer.onDestroy();\n return checkoutResults;\n }\n\n private async syncNewComponents({ ids, head }: CheckoutProps) {\n if (!head) return;\n const notExported = ids?.filter((id) => !id._legacy.hasScope()).map((id) => id._legacy.changeScope(id.scope));\n const scopeComponentsImporter = this.workspace.consumer.scope.scopeImporter;\n try {\n await scopeComponentsImporter.importManyDeltaWithoutDeps({\n ids: BitIds.fromArray(notExported || []),\n fromHead: true,\n });\n } catch (err) {\n // don't stop the process. it's possible that the scope doesn't exist yet because these are new components\n this.logger.error(`unable to sync new components, if these components are really new, ignore the error`, err);\n }\n }\n\n private async makeLaneComponentsAvailableOnMain() {\n const unavailableOnMain = await this.workspace.getUnavailableOnMainComponents();\n if (!unavailableOnMain.length) return;\n this.workspace.bitMap.makeComponentsAvailableOnMain(unavailableOnMain);\n }\n\n private async parseValues(to: CheckoutTo, componentPattern: string, checkoutProps: CheckoutProps) {\n if (to === HEAD) checkoutProps.head = true;\n else if (to === LATEST) checkoutProps.latest = true;\n else if (to === 'reset') checkoutProps.reset = true;\n else {\n if (!BitId.isValidVersion(to)) throw new BitError(`the specified version \"${to}\" is not a valid version`);\n checkoutProps.version = to;\n }\n if (checkoutProps.head && !componentPattern) {\n if (checkoutProps.all) {\n this.logger.console(`\"--all\" is deprecated for \"bit checkout ${HEAD}\", please omit it.`);\n }\n checkoutProps.all = true;\n }\n if (checkoutProps.latest && !componentPattern) {\n if (checkoutProps.all) {\n this.logger.console(`\"--all\" is deprecated for \"bit checkout ${LATEST}\", please omit it.`);\n }\n checkoutProps.all = true;\n }\n if (componentPattern && checkoutProps.all) {\n throw new GeneralError('please specify either [component-pattern] or --all, not both');\n }\n if (!componentPattern && !checkoutProps.all) {\n throw new GeneralError('please specify [component-pattern] or use --all flag');\n }\n if (checkoutProps.workspaceOnly && !checkoutProps.head) {\n throw new BitError(`--workspace-only flag can only be used with \"head\" (bit checkout head --workspace-only)`);\n }\n const idsOnWorkspace = componentPattern\n ? await this.workspace.idsByPattern(componentPattern)\n : await this.workspace.listIds();\n const currentLane = await this.workspace.consumer.getCurrentLaneObject();\n const currentLaneIds = currentLane?.toBitIds();\n const ids = currentLaneIds\n ? idsOnWorkspace.filter((id) => currentLaneIds.hasWithoutVersion(id._legacy))\n : idsOnWorkspace;\n checkoutProps.ids = ids.map((id) => (checkoutProps.head || checkoutProps.latest ? id.changeVersion(LATEST) : id));\n }\n\n private async getNewComponentsFromLane(ids: ComponentID[]): Promise<ComponentID[]> {\n // current lane object is up to date due to the previous `importCurrentObjects()` call\n const lane = await this.workspace.consumer.getCurrentLaneObject();\n if (!lane) {\n return [];\n }\n const laneBitIds = lane.toBitIds();\n const newIds = laneBitIds.filter((bitId) => !ids.find((id) => id._legacy.isEqualWithoutVersion(bitId)));\n const newComponentIds = await this.workspace.resolveMultipleComponentIds(newIds);\n const nonRemovedNewIds: ComponentID[] = [];\n await Promise.all(\n newComponentIds.map(async (id) => {\n const isRemoved = await this.workspace.scope.isComponentRemoved(id);\n if (!isRemoved) nonRemovedNewIds.push(id);\n })\n );\n return nonRemovedNewIds;\n }\n\n private async getComponentStatusBeforeMergeAttempt(\n component: ConsumerComponent,\n checkoutProps: CheckoutProps\n ): Promise<ComponentStatusBeforeMergeAttempt> {\n const consumer = this.workspace.consumer;\n const { version, head: headVersion, reset, latest: latestVersion } = checkoutProps;\n const repo = consumer.scope.objects;\n const componentModel = await consumer.scope.getModelComponentIfExist(component.id);\n const componentStatus: ComponentStatus = { id: component.id };\n const returnFailure = (msg: string, unchangedLegitimately = false) => {\n componentStatus.failureMessage = msg;\n componentStatus.unchangedLegitimately = unchangedLegitimately;\n return componentStatus;\n };\n if (!componentModel) {\n return returnFailure(`component ${component.id.toString()} is new, no version to checkout`, true);\n }\n const unmerged = repo.unmergedComponents.getEntry(component.name);\n if (!reset && unmerged) {\n return returnFailure(\n `component ${component.id.toStringWithoutVersion()} is in during-merge state, please snap/tag it first (or use bit merge --resolve/--abort)`\n );\n }\n const getNewVersion = async (): Promise<string> => {\n if (reset) return component.id.version as string;\n\n if (headVersion) return componentModel.headIncludeRemote(repo);\n if (latestVersion) return componentModel.latestVersion();\n // @ts-ignore if !reset the version is defined\n return version;\n };\n const newVersion = await getNewVersion();\n if (version && !headVersion) {\n const hasVersion = await componentModel.hasVersion(version, repo);\n if (!hasVersion)\n return returnFailure(`component ${component.id.toStringWithoutVersion()} doesn't have version ${version}`);\n }\n const existingBitMapId = consumer.bitMap.getBitId(component.id, { ignoreVersion: true });\n const currentlyUsedVersion = existingBitMapId.version;\n if (!currentlyUsedVersion) {\n return returnFailure(`component ${component.id.toStringWithoutVersion()} is new`);\n }\n if (version && currentlyUsedVersion === version) {\n // it won't be relevant for 'reset' as it doesn't have a version\n return returnFailure(`component ${component.id.toStringWithoutVersion()} is already at version ${version}`, true);\n }\n if (headVersion && currentlyUsedVersion === newVersion) {\n return returnFailure(\n `component ${component.id.toStringWithoutVersion()} is already at the latest version, which is ${newVersion}`,\n true\n );\n }\n if (!reset) {\n const divergeDataForMergePending = await componentModel.getDivergeDataForMergePending(repo);\n const isMergePending = divergeDataForMergePending.isDiverged();\n if (isMergePending) {\n return returnFailure(`component is merge-pending and cannot be checked out, run \"bit status\" for more info`);\n }\n }\n const currentVersionObject: Version = await componentModel.loadVersion(currentlyUsedVersion, repo);\n const isModified = await consumer.isComponentModified(currentVersionObject, component);\n if (!isModified && reset) {\n return returnFailure(`component ${component.id.toStringWithoutVersion()} is not modified`, true);\n }\n\n const versionRef = componentModel.getRef(newVersion);\n if (!versionRef) throw new Error(`unable to get ref ${newVersion} from ${componentModel.id()}`);\n const componentVersion = (await consumer.scope.getObject(versionRef.hash)) as Version;\n const newId = component.id.changeVersion(newVersion);\n\n if (reset || !isModified) {\n // if the component is not modified, no need to try merge the files, they will be written later on according to the\n // checked out version. same thing when no version is specified, it'll be reset to the model-version later.\n return { componentFromFS: component, componentFromModel: componentVersion, id: newId };\n }\n\n const propsForMerge = {\n currentlyUsedVersion,\n componentModel,\n };\n\n return { componentFromFS: component, componentFromModel: componentVersion, id: newId, propsForMerge };\n }\n\n private async getMergeStatus({\n componentFromFS,\n componentFromModel,\n id,\n propsForMerge,\n }: ComponentStatusBeforeMergeAttempt): Promise<ComponentStatus> {\n if (!propsForMerge) throw new Error(`propsForMerge is missing for ${id.toString()}`);\n if (!componentFromFS) throw new Error(`componentFromFS is missing for ${id.toString()}`);\n const consumer = this.workspace.consumer;\n const repo = consumer.scope.objects;\n const { currentlyUsedVersion, componentModel } = propsForMerge;\n\n // this is tricky. imagine the user is 0.0.2+modification and wants to checkout to 0.0.1.\n // the base is 0.0.1, as it's the common version for 0.0.1 and 0.0.2. however, if we let git merge-file use the 0.0.1\n // as the base, then, it'll get the changes done since 0.0.1 to 0.0.1, which is nothing, and put them on top of\n // 0.0.2+modification. in other words, it won't make any change.\n // this scenario of checking out while there are modified files, is forbidden in Git. here, we want to simulate a similar\n // experience of \"git stash\", then \"git checkout\", then \"git stash pop\". practically, we want the changes done on 0.0.2\n // to be added to 0.0.1\n // if there is no modification, it doesn't go the threeWayMerge anyway, so it doesn't matter what the base is.\n const baseVersion = currentlyUsedVersion;\n const newVersion = id.version as string;\n const baseComponent: Version = await componentModel.loadVersion(baseVersion, repo);\n const otherComponent: Version = await componentModel.loadVersion(newVersion, repo);\n const mergeResults = await threeWayMerge({\n consumer,\n otherComponent,\n otherLabel: newVersion,\n currentComponent: componentFromFS,\n currentLabel: `${currentlyUsedVersion} modified`,\n baseComponent,\n });\n\n return { componentFromFS, componentFromModel, id, mergeResults };\n }\n\n static slots = [];\n static dependencies = [CLIAspect, WorkspaceAspect, LoggerAspect, ComponentWriterAspect, ImporterAspect];\n\n static runtime = MainRuntime;\n\n static async provider([cli, workspace, loggerMain, compWriter, importer]: [\n CLIMain,\n Workspace,\n LoggerMain,\n ComponentWriterMain,\n ImporterMain\n ]) {\n const logger = loggerMain.createLogger(CheckoutAspect.id);\n const checkoutMain = new CheckoutMain(workspace, logger, compWriter, importer);\n cli.register(new CheckoutCmd(checkoutMain));\n return checkoutMain;\n }\n}\n\nCheckoutAspect.addRuntime(CheckoutMain);\n\nexport default CheckoutMain;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAMA;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;AAGA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA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NuM,kBAAW;AAgB9BT,0BAAc,CAACU,UAAU,CAACxM,YAAY,CAAC;AAAC,eAEzBA,YAAY;AAAA"}
|
|
1
|
+
{"version":3,"names":["CheckoutMain","constructor","workspace","logger","componentWriter","importer","remove","checkout","checkoutProps","consumer","version","ids","promptMergeOptions","syncNewComponents","importCurrentObjects","bitIds","BitIds","fromArray","map","id","_legacy","components","loadComponents","allComponentStatusBeforeMerge","Promise","all","component","getComponentStatusBeforeMergeAttempt","compsNeedMerge","filter","c","propsForMerge","compsNotNeedMerge","toImport","compStatus","idsToImport","push","changeVersion","currentlyUsedVersion","flat","scope","legacyScope","scopeImporter","importManyIfMissingWithoutDeps","getComponentsStatusOfMergeNeeded","tmp","Tmp","afterMergeAttempt","getMergeStatus","clear","err","compStatusMergeNeeded","allComponentsStatus","componentWithConflict","find","mergeResults","hasConflicts","mergeStrategy","GeneralError","toStringWithoutVersion","getMergeStrategyInteractive","failedComponents","componentStatus","failureMessage","shouldBeRemoved","unchangedLegitimately","succeededComponents","checkoutPropsLegacy","componentsResults","mapSeries","componentFromFS","applyVersion","markFilesToBeRemovedIfNeeded","componentsLegacy","compact","newFromLane","newFromLaneAdded","head","getNewComponentsFromLane","workspaceOnly","compsNewFromLane","loadComponentFromModelImportIfNeeded","leftUnresolvedConflicts","componentWriterResults","length","manyComponentsWriterOpts","skipDependencyInstallation","skipNpmInstall","verbose","resetConfig","reset","writeMany","deleteFilesIfNeeded","appliedVersionComponents","applyVersionResult","componentIdsToRemove","undefined","removeLocallyByIds","force","removedComponents","n","toString","installationError","compilationError","checkoutByCLIValues","to","componentPattern","setStatusLine","BEFORE_CHECKOUT","OutsideWorkspaceError","makeLaneComponentsAvailableOnMain","parseValues","checkoutResults","onDestroy","notExported","hasScope","changeScope","scopeComponentsImporter","importManyDeltaWithoutDeps","fromHead","error","unavailableOnMain","getUnavailableOnMainComponents","bitMap","makeComponentsAvailableOnMain","HEAD","LATEST","latest","BitId","isValidVersion","BitError","console","idsOnWorkspace","idsByPattern","listIds","currentLane","getCurrentLaneObject","currentLaneIds","toBitIds","hasWithoutVersion","lane","laneBitIds","newIds","bitId","isEqualWithoutVersion","newComponentIds","resolveMultipleComponentIds","nonRemovedNewIds","isRemoved","isComponentRemoved","headVersion","latestVersion","repo","objects","componentModel","getModelComponentIfExist","returnFailure","msg","unmerged","unmergedComponents","getEntry","name","getNewVersion","headIncludeRemote","newVersion","hasVersion","existingBitMapId","getBitId","ignoreVersion","divergeDataForMergePending","getDivergeDataForMergePending","isMergePending","isDiverged","currentVersionObject","loadVersion","isModified","isComponentModified","versionRef","getRef","Error","componentVersion","getObject","hash","newId","componentFromModel","baseVersion","baseComponent","otherComponent","threeWayMerge","otherLabel","currentComponent","currentLabel","provider","cli","loggerMain","compWriter","createLogger","CheckoutAspect","checkoutMain","register","CheckoutCmd","CLIAspect","WorkspaceAspect","LoggerAspect","ComponentWriterAspect","ImporterAspect","RemoveAspect","MainRuntime","addRuntime"],"sources":["checkout.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport WorkspaceAspect, { OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport { BitId } from '@teambit/legacy-bit-id';\nimport { BitError } from '@teambit/bit-error';\nimport { compact } from 'lodash';\nimport { BEFORE_CHECKOUT } from '@teambit/legacy/dist/cli/loader/loader-messages';\nimport RemoveAspect, { RemoveMain } from '@teambit/remove';\nimport { ApplyVersionResults } from '@teambit/merging';\nimport ImporterAspect, { ImporterMain } from '@teambit/importer';\nimport { HEAD, LATEST } from '@teambit/legacy/dist/constants';\nimport { ComponentWriterAspect, ComponentWriterMain } from '@teambit/component-writer';\nimport {\n FailedComponents,\n getMergeStrategyInteractive,\n MergeStrategy,\n threeWayMerge,\n} from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport GeneralError from '@teambit/legacy/dist/error/general-error';\nimport mapSeries from 'p-map-series';\nimport { BitIds } from '@teambit/legacy/dist/bit-id';\nimport { Version, ModelComponent } from '@teambit/legacy/dist/scope/models';\nimport { Tmp } from '@teambit/legacy/dist/scope/repositories';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component';\nimport { ComponentID } from '@teambit/component-id';\nimport { CheckoutCmd } from './checkout-cmd';\nimport { CheckoutAspect } from './checkout.aspect';\nimport { applyVersion, markFilesToBeRemovedIfNeeded, ComponentStatus, deleteFilesIfNeeded } from './checkout-version';\n\nexport type CheckoutProps = {\n version?: string; // if reset is true, the version is undefined\n ids?: ComponentID[];\n head?: boolean;\n latest?: boolean;\n promptMergeOptions?: boolean;\n mergeStrategy?: MergeStrategy | null;\n verbose?: boolean;\n skipNpmInstall?: boolean;\n reset?: boolean; // remove local changes. if set, the version is undefined.\n all?: boolean; // checkout all ids\n isLane?: boolean;\n workspaceOnly?: boolean;\n};\n\nexport type ComponentStatusBeforeMergeAttempt = {\n componentFromFS?: ConsumerComponent;\n componentFromModel?: Version;\n id: BitId;\n failureMessage?: string;\n unchangedLegitimately?: boolean; // failed to checkout but for a legitimate reason, such as, up-to-date\n shouldBeRemoved?: boolean; // in case the component is soft-removed, it should be removed from the workspace\n propsForMerge?: {\n currentlyUsedVersion: string;\n componentModel: ModelComponent;\n };\n};\n\ntype CheckoutTo = 'head' | 'reset' | string;\n\nexport class CheckoutMain {\n constructor(\n private workspace: Workspace,\n private logger: Logger,\n private componentWriter: ComponentWriterMain,\n private importer: ImporterMain,\n private remove: RemoveMain\n ) {}\n\n async checkout(checkoutProps: CheckoutProps): Promise<ApplyVersionResults> {\n const consumer = this.workspace.consumer;\n const { version, ids, promptMergeOptions } = checkoutProps;\n await this.syncNewComponents(checkoutProps);\n await this.importer.importCurrentObjects(); // important. among others, it fetches the remote lane object and its new components.\n const bitIds = BitIds.fromArray(ids?.map((id) => id._legacy) || []);\n const { components } = await consumer.loadComponents(bitIds);\n\n const allComponentStatusBeforeMerge = await Promise.all(\n components.map((component) => this.getComponentStatusBeforeMergeAttempt(component, checkoutProps))\n );\n const compsNeedMerge = allComponentStatusBeforeMerge.filter((c) => c.propsForMerge);\n const compsNotNeedMerge = allComponentStatusBeforeMerge.filter((c) => !c.propsForMerge) as ComponentStatus[];\n\n // in case the requested versions to checkout don't exist locally, import them.\n const toImport = allComponentStatusBeforeMerge\n .map((compStatus) => {\n const idsToImport = [compStatus.id];\n if (compStatus.propsForMerge) {\n idsToImport.push(compStatus.id.changeVersion(compStatus.propsForMerge.currentlyUsedVersion));\n }\n return idsToImport;\n })\n .flat();\n await this.workspace.scope.legacyScope.scopeImporter.importManyIfMissingWithoutDeps({\n ids: BitIds.fromArray(toImport),\n });\n\n const getComponentsStatusOfMergeNeeded = async (): Promise<ComponentStatus[]> => {\n const tmp = new Tmp(consumer.scope);\n try {\n const afterMergeAttempt = await Promise.all(compsNeedMerge.map((c) => this.getMergeStatus(c)));\n await tmp.clear();\n return afterMergeAttempt;\n } catch (err: any) {\n await tmp.clear();\n throw err;\n }\n };\n\n const compStatusMergeNeeded = await getComponentsStatusOfMergeNeeded();\n\n const allComponentsStatus: ComponentStatus[] = [...compStatusMergeNeeded, ...compsNotNeedMerge];\n const componentWithConflict = allComponentsStatus.find(\n (component) => component.mergeResults && component.mergeResults.hasConflicts\n );\n if (componentWithConflict) {\n if (!promptMergeOptions && !checkoutProps.mergeStrategy) {\n throw new GeneralError(\n `automatic merge has failed for component ${componentWithConflict.id.toStringWithoutVersion()}.\\nplease use \"--manual\" to manually merge changes or use \"--theirs / --ours\" to choose one of the conflicted versions`\n );\n }\n if (!checkoutProps.mergeStrategy) checkoutProps.mergeStrategy = await getMergeStrategyInteractive();\n }\n const failedComponents: FailedComponents[] = allComponentsStatus\n .filter((componentStatus) => componentStatus.failureMessage)\n .filter((componentStatus) => !componentStatus.shouldBeRemoved)\n .map((componentStatus) => ({\n id: componentStatus.id,\n failureMessage: componentStatus.failureMessage as string,\n unchangedLegitimately: componentStatus.unchangedLegitimately,\n }));\n\n const succeededComponents = allComponentsStatus.filter((componentStatus) => !componentStatus.failureMessage);\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 checkoutPropsLegacy = { ...checkoutProps, ids: checkoutProps.ids?.map((id) => id._legacy) };\n const componentsResults = await mapSeries(succeededComponents, ({ id, componentFromFS, mergeResults }) => {\n return applyVersion(consumer, id, componentFromFS, mergeResults, checkoutPropsLegacy);\n });\n\n markFilesToBeRemovedIfNeeded(succeededComponents, componentsResults);\n\n const componentsLegacy = compact(componentsResults.map((c) => c.component));\n\n let newFromLane: ComponentID[] | undefined;\n let newFromLaneAdded = false;\n if (checkoutProps.head) {\n newFromLane = await this.getNewComponentsFromLane(checkoutProps.ids || []);\n if (!checkoutProps.workspaceOnly) {\n const compsNewFromLane = await Promise.all(\n newFromLane.map((id) => consumer.loadComponentFromModelImportIfNeeded(id._legacy))\n );\n componentsLegacy.push(...compsNewFromLane);\n newFromLaneAdded = true;\n }\n }\n\n const leftUnresolvedConflicts = componentWithConflict && checkoutProps.mergeStrategy === 'manual';\n let componentWriterResults;\n if (componentsLegacy.length) {\n const manyComponentsWriterOpts = {\n components: componentsLegacy,\n skipDependencyInstallation: checkoutProps.skipNpmInstall || leftUnresolvedConflicts,\n verbose: checkoutProps.verbose,\n resetConfig: checkoutProps.reset,\n };\n componentWriterResults = await this.componentWriter.writeMany(manyComponentsWriterOpts);\n await deleteFilesIfNeeded(componentsResults, consumer);\n }\n\n const appliedVersionComponents = componentsResults.map((c) => c.applyVersionResult);\n\n const componentIdsToRemove = allComponentsStatus\n .filter((componentStatus) => componentStatus.shouldBeRemoved)\n .map((c) => c.id.changeVersion(undefined));\n\n if (componentIdsToRemove.length) {\n await this.remove.removeLocallyByIds(componentIdsToRemove, { force: true });\n }\n\n return {\n components: appliedVersionComponents,\n removedComponents: componentIdsToRemove,\n version,\n failedComponents,\n leftUnresolvedConflicts,\n newFromLane: newFromLane?.map((n) => n.toString()),\n newFromLaneAdded,\n installationError: componentWriterResults?.installationError,\n compilationError: componentWriterResults?.compilationError,\n };\n }\n\n async checkoutByCLIValues(\n to: CheckoutTo,\n componentPattern: string,\n checkoutProps: CheckoutProps\n ): Promise<ApplyVersionResults> {\n this.logger.setStatusLine(BEFORE_CHECKOUT);\n if (!this.workspace) throw new OutsideWorkspaceError();\n const consumer = this.workspace.consumer;\n if (to === 'head') await this.makeLaneComponentsAvailableOnMain();\n await this.parseValues(to, componentPattern, checkoutProps);\n const checkoutResults = await this.checkout(checkoutProps);\n await consumer.onDestroy();\n return checkoutResults;\n }\n\n private async syncNewComponents({ ids, head }: CheckoutProps) {\n if (!head) return;\n const notExported = ids?.filter((id) => !id._legacy.hasScope()).map((id) => id._legacy.changeScope(id.scope));\n const scopeComponentsImporter = this.workspace.consumer.scope.scopeImporter;\n try {\n await scopeComponentsImporter.importManyDeltaWithoutDeps({\n ids: BitIds.fromArray(notExported || []),\n fromHead: true,\n });\n } catch (err) {\n // don't stop the process. it's possible that the scope doesn't exist yet because these are new components\n this.logger.error(`unable to sync new components, if these components are really new, ignore the error`, err);\n }\n }\n\n private async makeLaneComponentsAvailableOnMain() {\n const unavailableOnMain = await this.workspace.getUnavailableOnMainComponents();\n if (!unavailableOnMain.length) return;\n this.workspace.bitMap.makeComponentsAvailableOnMain(unavailableOnMain);\n }\n\n private async parseValues(to: CheckoutTo, componentPattern: string, checkoutProps: CheckoutProps) {\n if (to === HEAD) checkoutProps.head = true;\n else if (to === LATEST) checkoutProps.latest = true;\n else if (to === 'reset') checkoutProps.reset = true;\n else {\n if (!BitId.isValidVersion(to)) throw new BitError(`the specified version \"${to}\" is not a valid version`);\n checkoutProps.version = to;\n }\n if (checkoutProps.head && !componentPattern) {\n if (checkoutProps.all) {\n this.logger.console(`\"--all\" is deprecated for \"bit checkout ${HEAD}\", please omit it.`);\n }\n checkoutProps.all = true;\n }\n if (checkoutProps.latest && !componentPattern) {\n if (checkoutProps.all) {\n this.logger.console(`\"--all\" is deprecated for \"bit checkout ${LATEST}\", please omit it.`);\n }\n checkoutProps.all = true;\n }\n if (componentPattern && checkoutProps.all) {\n throw new GeneralError('please specify either [component-pattern] or --all, not both');\n }\n if (!componentPattern && !checkoutProps.all) {\n throw new GeneralError('please specify [component-pattern] or use --all flag');\n }\n if (checkoutProps.workspaceOnly && !checkoutProps.head) {\n throw new BitError(`--workspace-only flag can only be used with \"head\" (bit checkout head --workspace-only)`);\n }\n const idsOnWorkspace = componentPattern\n ? await this.workspace.idsByPattern(componentPattern)\n : await this.workspace.listIds();\n const currentLane = await this.workspace.consumer.getCurrentLaneObject();\n const currentLaneIds = currentLane?.toBitIds();\n const ids = currentLaneIds\n ? idsOnWorkspace.filter((id) => currentLaneIds.hasWithoutVersion(id._legacy))\n : idsOnWorkspace;\n checkoutProps.ids = ids.map((id) => (checkoutProps.head || checkoutProps.latest ? id.changeVersion(LATEST) : id));\n }\n\n private async getNewComponentsFromLane(ids: ComponentID[]): Promise<ComponentID[]> {\n // current lane object is up to date due to the previous `importCurrentObjects()` call\n const lane = await this.workspace.consumer.getCurrentLaneObject();\n if (!lane) {\n return [];\n }\n const laneBitIds = lane.toBitIds();\n const newIds = laneBitIds.filter((bitId) => !ids.find((id) => id._legacy.isEqualWithoutVersion(bitId)));\n const newComponentIds = await this.workspace.resolveMultipleComponentIds(newIds);\n const nonRemovedNewIds: ComponentID[] = [];\n await Promise.all(\n newComponentIds.map(async (id) => {\n const isRemoved = await this.workspace.scope.isComponentRemoved(id);\n if (!isRemoved) nonRemovedNewIds.push(id);\n })\n );\n return nonRemovedNewIds;\n }\n\n private async getComponentStatusBeforeMergeAttempt(\n component: ConsumerComponent,\n checkoutProps: CheckoutProps\n ): Promise<ComponentStatusBeforeMergeAttempt> {\n const consumer = this.workspace.consumer;\n const { version, head: headVersion, reset, latest: latestVersion } = checkoutProps;\n const repo = consumer.scope.objects;\n const componentModel = await consumer.scope.getModelComponentIfExist(component.id);\n const componentStatus: ComponentStatusBeforeMergeAttempt = { id: component.id };\n const returnFailure = (msg: string, unchangedLegitimately = false) => {\n componentStatus.failureMessage = msg;\n componentStatus.unchangedLegitimately = unchangedLegitimately;\n return componentStatus;\n };\n if (!componentModel) {\n return returnFailure(`component ${component.id.toString()} is new, no version to checkout`, true);\n }\n const unmerged = repo.unmergedComponents.getEntry(component.name);\n if (!reset && unmerged) {\n return returnFailure(\n `component ${component.id.toStringWithoutVersion()} is in during-merge state, please snap/tag it first (or use bit merge --resolve/--abort)`\n );\n }\n const getNewVersion = async (): Promise<string> => {\n if (reset) return component.id.version as string;\n\n if (headVersion) return componentModel.headIncludeRemote(repo);\n if (latestVersion) return componentModel.latestVersion();\n // @ts-ignore if !reset the version is defined\n return version;\n };\n const newVersion = await getNewVersion();\n if (version && !headVersion) {\n const hasVersion = await componentModel.hasVersion(version, repo);\n if (!hasVersion)\n return returnFailure(`component ${component.id.toStringWithoutVersion()} doesn't have version ${version}`);\n }\n const existingBitMapId = consumer.bitMap.getBitId(component.id, { ignoreVersion: true });\n const currentlyUsedVersion = existingBitMapId.version;\n if (!currentlyUsedVersion) {\n return returnFailure(`component ${component.id.toStringWithoutVersion()} is new`);\n }\n if (version && currentlyUsedVersion === version) {\n // it won't be relevant for 'reset' as it doesn't have a version\n return returnFailure(`component ${component.id.toStringWithoutVersion()} is already at version ${version}`, true);\n }\n if (headVersion && currentlyUsedVersion === newVersion) {\n return returnFailure(\n `component ${component.id.toStringWithoutVersion()} is already at the latest version, which is ${newVersion}`,\n true\n );\n }\n if (!reset) {\n const divergeDataForMergePending = await componentModel.getDivergeDataForMergePending(repo);\n const isMergePending = divergeDataForMergePending.isDiverged();\n if (isMergePending) {\n return returnFailure(`component is merge-pending and cannot be checked out, run \"bit status\" for more info`);\n }\n }\n const currentVersionObject: Version = await componentModel.loadVersion(currentlyUsedVersion, repo);\n const isModified = await consumer.isComponentModified(currentVersionObject, component);\n if (!isModified && reset) {\n return returnFailure(`component ${component.id.toStringWithoutVersion()} is not modified`, true);\n }\n\n const versionRef = componentModel.getRef(newVersion);\n if (!versionRef) throw new Error(`unable to get ref ${newVersion} from ${componentModel.id()}`);\n const componentVersion = (await consumer.scope.getObject(versionRef.hash)) as Version | undefined;\n if (componentVersion?.isRemoved() && existingBitMapId) {\n componentStatus.shouldBeRemoved = true;\n return returnFailure(`component has been removed`, true);\n }\n\n const newId = component.id.changeVersion(newVersion);\n\n if (reset || !isModified) {\n // if the component is not modified, no need to try merge the files, they will be written later on according to the\n // checked out version. same thing when no version is specified, it'll be reset to the model-version later.\n return { componentFromFS: component, componentFromModel: componentVersion, id: newId };\n }\n\n const propsForMerge = {\n currentlyUsedVersion,\n componentModel,\n };\n\n return { componentFromFS: component, componentFromModel: componentVersion, id: newId, propsForMerge };\n }\n\n private async getMergeStatus({\n componentFromFS,\n componentFromModel,\n id,\n propsForMerge,\n }: ComponentStatusBeforeMergeAttempt): Promise<ComponentStatus> {\n if (!propsForMerge) throw new Error(`propsForMerge is missing for ${id.toString()}`);\n if (!componentFromFS) throw new Error(`componentFromFS is missing for ${id.toString()}`);\n const consumer = this.workspace.consumer;\n const repo = consumer.scope.objects;\n const { currentlyUsedVersion, componentModel } = propsForMerge;\n\n // this is tricky. imagine the user is 0.0.2+modification and wants to checkout to 0.0.1.\n // the base is 0.0.1, as it's the common version for 0.0.1 and 0.0.2. however, if we let git merge-file use the 0.0.1\n // as the base, then, it'll get the changes done since 0.0.1 to 0.0.1, which is nothing, and put them on top of\n // 0.0.2+modification. in other words, it won't make any change.\n // this scenario of checking out while there are modified files, is forbidden in Git. here, we want to simulate a similar\n // experience of \"git stash\", then \"git checkout\", then \"git stash pop\". practically, we want the changes done on 0.0.2\n // to be added to 0.0.1\n // if there is no modification, it doesn't go the threeWayMerge anyway, so it doesn't matter what the base is.\n const baseVersion = currentlyUsedVersion;\n const newVersion = id.version as string;\n const baseComponent: Version = await componentModel.loadVersion(baseVersion, repo);\n const otherComponent: Version = await componentModel.loadVersion(newVersion, repo);\n const mergeResults = await threeWayMerge({\n consumer,\n otherComponent,\n otherLabel: newVersion,\n currentComponent: componentFromFS,\n currentLabel: `${currentlyUsedVersion} modified`,\n baseComponent,\n });\n\n return { componentFromFS, componentFromModel, id, mergeResults };\n }\n\n static slots = [];\n static dependencies = [CLIAspect, WorkspaceAspect, LoggerAspect, ComponentWriterAspect, ImporterAspect, RemoveAspect];\n\n static runtime = MainRuntime;\n\n static async provider([cli, workspace, loggerMain, compWriter, importer, remove]: [\n CLIMain,\n Workspace,\n LoggerMain,\n ComponentWriterMain,\n ImporterMain,\n RemoveMain\n ]) {\n const logger = loggerMain.createLogger(CheckoutAspect.id);\n const checkoutMain = new CheckoutMain(workspace, logger, compWriter, importer, remove);\n cli.register(new CheckoutCmd(checkoutMain));\n return checkoutMain;\n }\n}\n\nCheckoutAspect.addRuntime(CheckoutMain);\n\nexport default CheckoutMain;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAMA;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;AAGA;EAAA;EAAA;IAAA;EAAA;EAAA;AA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B,EAAExH,eAAe;MACjCyH,YAAY,EAAG,GAAEzJ,oBAAqB,WAAU;MAChDoJ;IACF,CAAC,CAAC;IAEF,OAAO;MAAEpH,eAAe;MAAEkH,kBAAkB;MAAErK,EAAE;MAAEoC;IAAa,CAAC;EAClE;EAOA,aAAayI,QAAQ,CAAC,CAACC,GAAG,EAAE/L,SAAS,EAAEgM,UAAU,EAAEC,UAAU,EAAE9L,QAAQ,EAAEC,MAAM,CAO9E,EAAE;IACD,MAAMH,MAAM,GAAG+L,UAAU,CAACE,YAAY,CAACC,0BAAc,CAAClL,EAAE,CAAC;IACzD,MAAMmL,YAAY,GAAG,IAAItM,YAAY,CAACE,SAAS,EAAEC,MAAM,EAAEgM,UAAU,EAAE9L,QAAQ,EAAEC,MAAM,CAAC;IACtF2L,GAAG,CAACM,QAAQ,CAAC,KAAIC,0BAAW,EAACF,YAAY,CAAC,CAAC;IAC3C,OAAOA,YAAY;EACrB;AACF;AAAC;AAAA,gCAnXYtM,YAAY,WAiWR,EAAE;AAAA,gCAjWNA,YAAY,kBAkWD,CAACyM,gBAAS,EAAEC,oBAAe,EAAEC,sBAAY,EAAEC,wCAAqB,EAAEC,mBAAc,EAAEC,iBAAY,CAAC;AAAA,gCAlW1G9M,YAAY,aAoWN+M,kBAAW;AAiB9BV,0BAAc,CAACW,UAAU,CAAChN,YAAY,CAAC;AAAC,eAEzBA,YAAY;AAAA"}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/checkout",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.227",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/component/checkout",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.component",
|
|
8
8
|
"name": "checkout",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.227"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "2.4.2",
|
|
@@ -17,13 +17,14 @@
|
|
|
17
17
|
"@teambit/legacy-bit-id": "0.0.423",
|
|
18
18
|
"@teambit/harmony": "0.4.6",
|
|
19
19
|
"@teambit/component-id": "0.0.427",
|
|
20
|
-
"@teambit/cli": "0.0.
|
|
21
|
-
"@teambit/merging": "0.0.
|
|
20
|
+
"@teambit/cli": "0.0.712",
|
|
21
|
+
"@teambit/merging": "0.0.373",
|
|
22
22
|
"@teambit/bit-error": "0.0.402",
|
|
23
|
-
"@teambit/component-writer": "0.0.
|
|
24
|
-
"@teambit/importer": "0.0.
|
|
25
|
-
"@teambit/logger": "0.0.
|
|
26
|
-
"@teambit/
|
|
23
|
+
"@teambit/component-writer": "0.0.94",
|
|
24
|
+
"@teambit/importer": "0.0.487",
|
|
25
|
+
"@teambit/logger": "0.0.805",
|
|
26
|
+
"@teambit/remove": "0.0.235",
|
|
27
|
+
"@teambit/workspace": "0.0.1058"
|
|
27
28
|
},
|
|
28
29
|
"devDependencies": {
|
|
29
30
|
"@types/lodash": "4.14.165",
|
|
@@ -35,7 +36,7 @@
|
|
|
35
36
|
"@types/testing-library__jest-dom": "5.9.5"
|
|
36
37
|
},
|
|
37
38
|
"peerDependencies": {
|
|
38
|
-
"@teambit/legacy": "1.0.
|
|
39
|
+
"@teambit/legacy": "1.0.492",
|
|
39
40
|
"react": "^16.8.0 || ^17.0.0",
|
|
40
41
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
41
42
|
},
|
|
Binary file
|
|
File without changes
|