@teambit/checkout 1.0.699 → 1.0.702

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.
@@ -186,9 +186,7 @@ once ready, snap/tag the components to persist the changes`;
186
186
  const component = components[0];
187
187
  const componentName = reset ? component.id.toString() : component.id.toStringWithoutVersion();
188
188
  if (reset) return `successfully reset ${_chalk().default.bold(componentName)}\n`;
189
- const title = alternativeTitle || `successfully ${switchedOrReverted} ${_chalk().default.bold(componentName)} to version ${_chalk().default.bold(
190
- // @ts-ignore version is defined when !reset
191
- head || latest ? component.id.version : version)}`;
189
+ const title = alternativeTitle || `successfully ${switchedOrReverted} ${_chalk().default.bold(componentName)} to version ${_chalk().default.bold(head || latest ? component.id.version : version)}`;
192
190
  return _chalk().default.bold(title) + newLine + (0, _componentModules().applyVersionReport)(components, false);
193
191
  }
194
192
  if (reset) {
@@ -200,7 +198,6 @@ once ready, snap/tag the components to persist the changes`;
200
198
  if (head) return 'their head version';
201
199
  if (latest) return 'their latest version';
202
200
  if (main) return 'their main version';
203
- // @ts-ignore version is defined when !reset
204
201
  return `version ${_chalk().default.bold(version)}`;
205
202
  };
206
203
  const versionOutput = getVerOutput();
@@ -1 +1 @@
1
- {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_lodash","_componentModules","_legacy","_componentId","_bitError","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","CheckoutCmd","constructor","checkout","name","description","COMPONENT_PATTERN_HELP","report","to","componentPattern","interactiveMerge","forceOurs","forceTheirs","autoMergeResolve","manual","all","workspaceOnly","verbose","skipDependencyInstallation","revert","BitError","HEAD","checkoutProps","promptMergeOptions","mergeStrategy","isLane","skipNpmInstall","head","LATEST","latest","reset","main","startsWith","ancestor","parseInt","split","isNaN","ComponentID","isValidVersion","version","checkoutResults","checkoutByCLIValues","checkoutOutput","exports","alternativeTitle","components","failedComponents","removedComponents","addedComponents","leftUnresolvedConflicts","workspaceConfigUpdateResult","newFromLane","newFromLaneAdded","installationError","compilationError","realFailedComponents","filter","f","unchangedLegitimately","length","Error","notCheckedOutComponents","getNotCheckedOutOutput","chalk","green","bold","toString","title","body","map","failedComponent","id","unchangedMessage","join","underline","getWsConfigUpdateLogs","logs","logsStr","getConflictSummary","suggestion","conflictSummary","conflictSummaryReport","conflictStr","yellow","getSuccessfulOutput","newLine","switchedOrReverted","component","componentName","toStringWithoutVersion","applyVersionReport","getVerOutput","versionOutput","showVersion","getNewOnLaneOutput","getSummary","checkedOut","notCheckedOutLegitimately","checkedOutStr","unchangedLegitimatelyStr","newOnLaneNum","newOnLaneAddedStr","newOnLaneStr","compact","getRemovedOutput","getAddedOutput","getWorkspaceConfigUpdateOutput","installationErrorOutput","compilationErrorOutput"],"sources":["checkout-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport type { Command, CommandOptions } from '@teambit/cli';\nimport { compact } from 'lodash';\nimport type { ApplyVersionResults, MergeStrategy } from '@teambit/component.modules.merge-helper';\nimport {\n applyVersionReport,\n conflictSummaryReport,\n installationErrorOutput,\n compilationErrorOutput,\n getRemovedOutput,\n getAddedOutput,\n getWorkspaceConfigUpdateOutput,\n} from '@teambit/component.modules.merge-helper';\nimport { COMPONENT_PATTERN_HELP, HEAD, LATEST } from '@teambit/legacy.constants';\nimport { ComponentID } from '@teambit/component-id';\nimport { BitError } from '@teambit/bit-error';\nimport type { 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~x}]. '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 = 'reference/components/merging-changes#checkout-snaps-to-the-working-directory';\n group = 'version-control';\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 (use --latest if you only want semver tags), omit [component-pattern] to checkout head for all\n\\`bit checkout head~x [component-pattern]\\` => go backward x generations from the head and checkout to that version\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). also, if a component dir is deleted from the filesystem, it'll be restored\nwhen on a lane, \"checkout head\" only checks out components on this lane. to update main components, run \"bit lane merge main\"`;\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 [\n 'r',\n 'auto-merge-resolve <merge-strategy>',\n 'in case of merge conflict, resolve according to the provided strategy: [ours, theirs, manual]',\n ],\n [\n '',\n 'manual',\n 'same as \"--auto-merge-resolve manual\". in case of merge conflict, write the files with the conflict markers',\n ],\n ['a', 'all', 'all components'],\n [\n 'e',\n 'workspace-only',\n \"only relevant for 'bit checkout head' when on a lane. don't import components from the remote lane that are not already in the workspace\",\n ],\n ['v', 'verbose', 'showing verbose output for inspection'],\n ['x', 'skip-dependency-installation', 'do not auto-install dependencies of the imported components'],\n ['', 'force-ours', 'do not merge, preserve local files as is'],\n ['', 'force-theirs', 'do not merge, just overwrite with incoming files'],\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 forceOurs,\n forceTheirs,\n autoMergeResolve,\n manual,\n all = false,\n workspaceOnly = false,\n verbose = false,\n skipDependencyInstallation = false,\n revert = false,\n }: {\n interactiveMerge?: boolean;\n forceOurs?: boolean;\n forceTheirs?: boolean;\n autoMergeResolve?: MergeStrategy;\n manual?: boolean;\n all?: boolean;\n workspaceOnly?: boolean;\n verbose?: boolean;\n skipDependencyInstallation?: boolean;\n revert?: boolean;\n }\n ) {\n if (forceOurs && forceTheirs) {\n throw new BitError('please use either --force-ours or --force-theirs, not both');\n }\n if (\n autoMergeResolve &&\n autoMergeResolve !== 'ours' &&\n autoMergeResolve !== 'theirs' &&\n autoMergeResolve !== 'manual'\n ) {\n throw new BitError('--auto-merge-resolve must be one of the following: [ours, theirs, manual]');\n }\n if (manual) autoMergeResolve = 'manual';\n if (workspaceOnly && to !== HEAD) {\n throw new BitError('--workspace-only is only relevant when running \"bit checkout head\" on a lane');\n }\n const checkoutProps: CheckoutProps = {\n promptMergeOptions: interactiveMerge,\n mergeStrategy: autoMergeResolve,\n all,\n verbose,\n isLane: false,\n skipNpmInstall: skipDependencyInstallation,\n workspaceOnly,\n revert,\n forceOurs,\n forceTheirs,\n };\n to = String(to); // it can be a number in case short-hash is used\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 if (to === 'main') checkoutProps.main = true;\n else if (to.startsWith(`${HEAD}~`)) {\n const ancestor = parseInt(to.split('~')[1]);\n if (Number.isNaN(ancestor))\n throw new BitError(`the character after \"${HEAD}~\" must be a number, got ${ancestor}`);\n checkoutProps.ancestor = ancestor;\n } else {\n if (!ComponentID.isValidVersion(to)) throw new BitError(`the specified version \"${to}\" is not a valid version`);\n checkoutProps.version = to;\n }\n\n const checkoutResults = await this.checkout.checkoutByCLIValues(componentPattern || '', checkoutProps);\n return checkoutOutput(checkoutResults, checkoutProps);\n }\n}\n\nexport function checkoutOutput(\n checkoutResults: ApplyVersionResults,\n checkoutProps: CheckoutProps,\n alternativeTitle?: string\n) {\n const {\n components,\n version,\n failedComponents,\n removedComponents,\n addedComponents,\n leftUnresolvedConflicts,\n workspaceConfigUpdateResult,\n newFromLane,\n newFromLaneAdded,\n installationError,\n compilationError,\n }: ApplyVersionResults = checkoutResults;\n\n const { head, reset, latest, main, revert, verbose, all } = checkoutProps;\n\n // components that failed for no legitimate reason. e.g. merge-conflict.\n const realFailedComponents = (failedComponents || []).filter((f) => !f.unchangedLegitimately);\n if (realFailedComponents.length) {\n throw new Error('checkout should throw in case of errors');\n }\n // components that weren't checked out for legitimate reasons, e.g. up-to-date.\n const notCheckedOutComponents = failedComponents || [];\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 = 'checkout was not required for the following component(s)';\n const body = notCheckedOutComponents\n .map((failedComponent) => `${failedComponent.id.toString()} - ${failedComponent.unchangedMessage}`)\n .join('\\n');\n return `${chalk.underline(title)}\\n${body}`;\n };\n const getWsConfigUpdateLogs = () => {\n const logs = workspaceConfigUpdateResult?.logs;\n if (!logs || !logs.length) return '';\n const logsStr = logs.join('\\n');\n return `${chalk.underline('verbose logs of workspace config update')}\\n${logsStr}`;\n };\n const getConflictSummary = () => {\n if (!components || !components.length || !leftUnresolvedConflicts) return '';\n const title = `files with conflicts summary\\n`;\n const suggestion = `\\n\\nfix the conflicts above manually and then run \"bit install\".\nonce ready, snap/tag the components to persist the changes`;\n const conflictSummary = conflictSummaryReport(components);\n return chalk.underline(title) + conflictSummary.conflictStr + chalk.yellow(suggestion);\n };\n const getSuccessfulOutput = () => {\n if (!components || !components.length) return '';\n const newLine = '\\n';\n const switchedOrReverted = revert ? 'reverted' : 'switched';\n if (components.length === 1) {\n const component = components[0];\n const componentName = reset ? component.id.toString() : component.id.toStringWithoutVersion();\n if (reset) return `successfully reset ${chalk.bold(componentName)}\\n`;\n const title =\n alternativeTitle ||\n `successfully ${switchedOrReverted} ${chalk.bold(componentName)} to version ${chalk.bold(\n // @ts-ignore version is defined when !reset\n head || latest ? component.id.version : version\n )}`;\n return chalk.bold(title) + newLine + applyVersionReport(components, false);\n }\n if (reset) {\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 (head) return 'their head version';\n if (latest) return 'their latest version';\n if (main) return 'their main version';\n // @ts-ignore version is defined when !reset\n return `version ${chalk.bold(version)}`;\n };\n const versionOutput = getVerOutput();\n const title =\n alternativeTitle || `successfully ${switchedOrReverted} ${components.length} components to ${versionOutput}`;\n const showVersion = head || reset;\n return chalk.bold(title) + newLine + applyVersionReport(components, true, showVersion);\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 exist on the lane but were not added to the workspace. omit --workspace-only flag to add them`;\n const body = newFromLane.join('\\n');\n return `${chalk.underline(title)}\\n${body}`;\n };\n const getSummary = () => {\n const checkedOut = components?.length || 0;\n const notCheckedOutLegitimately = notCheckedOutComponents.length;\n const title = chalk.bold.underline('Summary');\n const checkedOutStr = `\\nTotal Changed: ${chalk.bold(checkedOut.toString())}`;\n const unchangedLegitimatelyStr = `\\nTotal Unchanged: ${chalk.bold(notCheckedOutLegitimately.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 title + checkedOutStr + unchangedLegitimatelyStr + newOnLaneStr;\n };\n\n return compact([\n getWsConfigUpdateLogs(),\n getNotCheckedOutOutput(),\n getSuccessfulOutput(),\n getRemovedOutput(removedComponents),\n getAddedOutput(addedComponents),\n getNewOnLaneOutput(),\n getWorkspaceConfigUpdateOutput(workspaceConfigUpdateResult),\n getConflictSummary(),\n getSummary(),\n installationErrorOutput(installationError),\n compilationErrorOutput(compilationError),\n ]).join('\\n\\n');\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,C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EAC1C,IAAAuD,0CAAsB,EAACtD,gBAAgB,CAAC,CACzC,CAAC,CAACmB,IAAI,CAAC,MAAM,CAAC;AACjB","ignoreList":[]}
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_lodash","_componentModules","_legacy","_componentId","_bitError","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","CheckoutCmd","constructor","checkout","name","description","COMPONENT_PATTERN_HELP","report","to","componentPattern","interactiveMerge","forceOurs","forceTheirs","autoMergeResolve","manual","all","workspaceOnly","verbose","skipDependencyInstallation","revert","BitError","HEAD","checkoutProps","promptMergeOptions","mergeStrategy","isLane","skipNpmInstall","head","LATEST","latest","reset","main","startsWith","ancestor","parseInt","split","isNaN","ComponentID","isValidVersion","version","checkoutResults","checkoutByCLIValues","checkoutOutput","exports","alternativeTitle","components","failedComponents","removedComponents","addedComponents","leftUnresolvedConflicts","workspaceConfigUpdateResult","newFromLane","newFromLaneAdded","installationError","compilationError","realFailedComponents","filter","f","unchangedLegitimately","length","Error","notCheckedOutComponents","getNotCheckedOutOutput","chalk","green","bold","toString","title","body","map","failedComponent","id","unchangedMessage","join","underline","getWsConfigUpdateLogs","logs","logsStr","getConflictSummary","suggestion","conflictSummary","conflictSummaryReport","conflictStr","yellow","getSuccessfulOutput","newLine","switchedOrReverted","component","componentName","toStringWithoutVersion","applyVersionReport","getVerOutput","versionOutput","showVersion","getNewOnLaneOutput","getSummary","checkedOut","notCheckedOutLegitimately","checkedOutStr","unchangedLegitimatelyStr","newOnLaneNum","newOnLaneAddedStr","newOnLaneStr","compact","getRemovedOutput","getAddedOutput","getWorkspaceConfigUpdateOutput","installationErrorOutput","compilationErrorOutput"],"sources":["checkout-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport type { Command, CommandOptions } from '@teambit/cli';\nimport { compact } from 'lodash';\nimport type { ApplyVersionResults, MergeStrategy } from '@teambit/component.modules.merge-helper';\nimport {\n applyVersionReport,\n conflictSummaryReport,\n installationErrorOutput,\n compilationErrorOutput,\n getRemovedOutput,\n getAddedOutput,\n getWorkspaceConfigUpdateOutput,\n} from '@teambit/component.modules.merge-helper';\nimport { COMPONENT_PATTERN_HELP, HEAD, LATEST } from '@teambit/legacy.constants';\nimport { ComponentID } from '@teambit/component-id';\nimport { BitError } from '@teambit/bit-error';\nimport type { 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~x}]. '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 = 'reference/components/merging-changes#checkout-snaps-to-the-working-directory';\n group = 'version-control';\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 (use --latest if you only want semver tags), omit [component-pattern] to checkout head for all\n\\`bit checkout head~x [component-pattern]\\` => go backward x generations from the head and checkout to that version\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). also, if a component dir is deleted from the filesystem, it'll be restored\nwhen on a lane, \"checkout head\" only checks out components on this lane. to update main components, run \"bit lane merge main\"`;\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 [\n 'r',\n 'auto-merge-resolve <merge-strategy>',\n 'in case of merge conflict, resolve according to the provided strategy: [ours, theirs, manual]',\n ],\n [\n '',\n 'manual',\n 'same as \"--auto-merge-resolve manual\". in case of merge conflict, write the files with the conflict markers',\n ],\n ['a', 'all', 'all components'],\n [\n 'e',\n 'workspace-only',\n \"only relevant for 'bit checkout head' when on a lane. don't import components from the remote lane that are not already in the workspace\",\n ],\n ['v', 'verbose', 'showing verbose output for inspection'],\n ['x', 'skip-dependency-installation', 'do not auto-install dependencies of the imported components'],\n ['', 'force-ours', 'do not merge, preserve local files as is'],\n ['', 'force-theirs', 'do not merge, just overwrite with incoming files'],\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 forceOurs,\n forceTheirs,\n autoMergeResolve,\n manual,\n all = false,\n workspaceOnly = false,\n verbose = false,\n skipDependencyInstallation = false,\n revert = false,\n }: {\n interactiveMerge?: boolean;\n forceOurs?: boolean;\n forceTheirs?: boolean;\n autoMergeResolve?: MergeStrategy;\n manual?: boolean;\n all?: boolean;\n workspaceOnly?: boolean;\n verbose?: boolean;\n skipDependencyInstallation?: boolean;\n revert?: boolean;\n }\n ) {\n if (forceOurs && forceTheirs) {\n throw new BitError('please use either --force-ours or --force-theirs, not both');\n }\n if (\n autoMergeResolve &&\n autoMergeResolve !== 'ours' &&\n autoMergeResolve !== 'theirs' &&\n autoMergeResolve !== 'manual'\n ) {\n throw new BitError('--auto-merge-resolve must be one of the following: [ours, theirs, manual]');\n }\n if (manual) autoMergeResolve = 'manual';\n if (workspaceOnly && to !== HEAD) {\n throw new BitError('--workspace-only is only relevant when running \"bit checkout head\" on a lane');\n }\n const checkoutProps: CheckoutProps = {\n promptMergeOptions: interactiveMerge,\n mergeStrategy: autoMergeResolve,\n all,\n verbose,\n isLane: false,\n skipNpmInstall: skipDependencyInstallation,\n workspaceOnly,\n revert,\n forceOurs,\n forceTheirs,\n };\n to = String(to); // it can be a number in case short-hash is used\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 if (to === 'main') checkoutProps.main = true;\n else if (to.startsWith(`${HEAD}~`)) {\n const ancestor = parseInt(to.split('~')[1]);\n if (Number.isNaN(ancestor))\n throw new BitError(`the character after \"${HEAD}~\" must be a number, got ${ancestor}`);\n checkoutProps.ancestor = ancestor;\n } else {\n if (!ComponentID.isValidVersion(to)) throw new BitError(`the specified version \"${to}\" is not a valid version`);\n checkoutProps.version = to;\n }\n\n const checkoutResults = await this.checkout.checkoutByCLIValues(componentPattern || '', checkoutProps);\n return checkoutOutput(checkoutResults, checkoutProps);\n }\n}\n\nexport function checkoutOutput(\n checkoutResults: ApplyVersionResults,\n checkoutProps: CheckoutProps,\n alternativeTitle?: string\n) {\n const {\n components,\n version,\n failedComponents,\n removedComponents,\n addedComponents,\n leftUnresolvedConflicts,\n workspaceConfigUpdateResult,\n newFromLane,\n newFromLaneAdded,\n installationError,\n compilationError,\n }: ApplyVersionResults = checkoutResults;\n\n const { head, reset, latest, main, revert, verbose, all } = checkoutProps;\n\n // components that failed for no legitimate reason. e.g. merge-conflict.\n const realFailedComponents = (failedComponents || []).filter((f) => !f.unchangedLegitimately);\n if (realFailedComponents.length) {\n throw new Error('checkout should throw in case of errors');\n }\n // components that weren't checked out for legitimate reasons, e.g. up-to-date.\n const notCheckedOutComponents = failedComponents || [];\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 = 'checkout was not required for the following component(s)';\n const body = notCheckedOutComponents\n .map((failedComponent) => `${failedComponent.id.toString()} - ${failedComponent.unchangedMessage}`)\n .join('\\n');\n return `${chalk.underline(title)}\\n${body}`;\n };\n const getWsConfigUpdateLogs = () => {\n const logs = workspaceConfigUpdateResult?.logs;\n if (!logs || !logs.length) return '';\n const logsStr = logs.join('\\n');\n return `${chalk.underline('verbose logs of workspace config update')}\\n${logsStr}`;\n };\n const getConflictSummary = () => {\n if (!components || !components.length || !leftUnresolvedConflicts) return '';\n const title = `files with conflicts summary\\n`;\n const suggestion = `\\n\\nfix the conflicts above manually and then run \"bit install\".\nonce ready, snap/tag the components to persist the changes`;\n const conflictSummary = conflictSummaryReport(components);\n return chalk.underline(title) + conflictSummary.conflictStr + chalk.yellow(suggestion);\n };\n const getSuccessfulOutput = () => {\n if (!components || !components.length) return '';\n const newLine = '\\n';\n const switchedOrReverted = revert ? 'reverted' : 'switched';\n if (components.length === 1) {\n const component = components[0];\n const componentName = reset ? component.id.toString() : component.id.toStringWithoutVersion();\n if (reset) return `successfully reset ${chalk.bold(componentName)}\\n`;\n const title =\n alternativeTitle ||\n `successfully ${switchedOrReverted} ${chalk.bold(componentName)} to version ${chalk.bold(\n head || latest ? component.id.version : version\n )}`;\n return chalk.bold(title) + newLine + applyVersionReport(components, false);\n }\n if (reset) {\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 (head) return 'their head version';\n if (latest) return 'their latest version';\n if (main) return 'their main version';\n return `version ${chalk.bold(version)}`;\n };\n const versionOutput = getVerOutput();\n const title =\n alternativeTitle || `successfully ${switchedOrReverted} ${components.length} components to ${versionOutput}`;\n const showVersion = head || reset;\n return chalk.bold(title) + newLine + applyVersionReport(components, true, showVersion);\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 exist on the lane but were not added to the workspace. omit --workspace-only flag to add them`;\n const body = newFromLane.join('\\n');\n return `${chalk.underline(title)}\\n${body}`;\n };\n const getSummary = () => {\n const checkedOut = components?.length || 0;\n const notCheckedOutLegitimately = notCheckedOutComponents.length;\n const title = chalk.bold.underline('Summary');\n const checkedOutStr = `\\nTotal Changed: ${chalk.bold(checkedOut.toString())}`;\n const unchangedLegitimatelyStr = `\\nTotal Unchanged: ${chalk.bold(notCheckedOutLegitimately.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 title + checkedOutStr + unchangedLegitimatelyStr + newOnLaneStr;\n };\n\n return compact([\n getWsConfigUpdateLogs(),\n getNotCheckedOutOutput(),\n getSuccessfulOutput(),\n getRemovedOutput(removedComponents),\n getAddedOutput(addedComponents),\n getNewOnLaneOutput(),\n getWorkspaceConfigUpdateOutput(workspaceConfigUpdateResult),\n getConflictSummary(),\n getSummary(),\n installationErrorOutput(installationError),\n compilationErrorOutput(compilationError),\n ]).join('\\n\\n');\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,kBAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,iBAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AASA,SAAAK,QAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,OAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,aAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,YAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,UAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,SAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;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IAAI,CAACmC,YAAY,CAAClC,QAAQ,CAAC,CAAC,CAAC,EAAE,GAC3E,EAAE;IAEN,OAAOC,KAAK,GAAG+B,aAAa,GAAGC,wBAAwB,GAAGG,YAAY;EACxE,CAAC;EAED,OAAO,IAAAC,iBAAO,EAAC,CACb5B,qBAAqB,CAAC,CAAC,EACvBb,sBAAsB,CAAC,CAAC,EACxBsB,mBAAmB,CAAC,CAAC,EACrB,IAAAoB,oCAAgB,EAACzD,iBAAiB,CAAC,EACnC,IAAA0D,kCAAc,EAACzD,eAAe,CAAC,EAC/B8C,kBAAkB,CAAC,CAAC,EACpB,IAAAY,kDAA8B,EAACxD,2BAA2B,CAAC,EAC3D4B,kBAAkB,CAAC,CAAC,EACpBiB,UAAU,CAAC,CAAC,EACZ,IAAAY,2CAAuB,EAACtD,iBAAiB,CAAC,EAC1C,IAAAuD,0CAAsB,EAACtD,gBAAgB,CAAC,CACzC,CAAC,CAACmB,IAAI,CAAC,MAAM,CAAC;AACjB","ignoreList":[]}
@@ -123,7 +123,6 @@ mergeResults, checkoutProps) {
123
123
  function updateFileStatus(files, filesStatus, componentFromFS) {
124
124
  files.forEach(file => {
125
125
  const fileFromFs = componentFromFS?.files.find(f => f.relative === file.relative);
126
- // @ts-ignore should be fixed after upgrading @types/node from '12.20.4' to > 20
127
126
  const areFilesEqual = fileFromFs && Buffer.compare(fileFromFs.contents, file.contents) === 0;
128
127
  // @ts-ignore
129
128
  filesStatus[(0, _legacy().pathNormalizeToLinux)(file.relative)] = areFilesEqual ? _componentModules().FileStatus.unchanged : _componentModules().FileStatus.updated;
@@ -1 +1 @@
1
- {"version":3,"names":["_component","data","require","_legacy","_bitError","_chalk","_interopRequireDefault","_componentModules","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","applyVersion","consumer","id","componentFromFS","mergeResults","checkoutProps","isLane","Error","toString","mergeStrategy","forceOurs","filesStatus","hasConflicts","MergeOptions","ours","files","file","pathNormalizeToLinux","relative","FileStatus","unchanged","bitMap","updateComponentId","applyVersionResult","component","loadComponentFromModelImportIfNeeded","componentMap","BitError","updateFileStatus","undefined","removeFilesIfNeeded","modifiedStatus","modifiedFiles","applyModifiedVersion","fileFromFs","find","f","areFilesEqual","Buffer","compare","contents","updated","isExistOnFs","getComponentIdIfExist","ignoreVersion","filePathsFromFS","dataToPersist","DataToPersist","filename","removed","removePath","RemovePath","path","persistAllToFS","throwForFailures","allComponentsStatus","failedComponents","c","unchangedMessage","unchangedLegitimately","failureMsgs","map","failedComponent","chalk","bold","red","join"],"sources":["checkout-version.ts"],"sourcesContent":["import type { Consumer } from '@teambit/legacy.consumer';\nimport type { ComponentID } from '@teambit/component-id';\nimport type { Version } from '@teambit/objects';\nimport type { SourceFile } from '@teambit/component.sources';\nimport { RemovePath, DataToPersist } from '@teambit/component.sources';\nimport { pathNormalizeToLinux } from '@teambit/legacy.utils';\nimport type { ConsumerComponent } from '@teambit/legacy.consumer-component';\nimport { BitError } from '@teambit/bit-error';\nimport chalk from 'chalk';\nimport type { ApplyVersionResult, FilesStatus, MergeResultsThreeWay } from '@teambit/component.modules.merge-helper';\nimport { applyModifiedVersion, FileStatus, MergeOptions } from '@teambit/component.modules.merge-helper';\nimport type { CheckoutProps } from './checkout.main.runtime';\n\nexport type ComponentStatusBase = {\n currentComponent?: ConsumerComponent;\n componentFromModel?: Version;\n id: ComponentID;\n shouldBeRemoved?: boolean; // in case the component is soft-removed, it should be removed from the workspace\n unchangedMessage?: string; // this gets populated either upon skip or failure.\n unchangedLegitimately?: boolean; // true for skipped legitimately (e.g. already up to date). false for failure.\n};\n\nexport type ComponentStatus = ComponentStatusBase & {\n mergeResults?: MergeResultsThreeWay | null | undefined;\n};\n\nexport type ApplyVersionWithComps = {\n applyVersionResult: ApplyVersionResult;\n component?: ConsumerComponent;\n // in case the component needs to be written to the filesystem, this is the component to write.\n legacyCompToWrite?: ConsumerComponent;\n};\n\n/**\n * This function optionally returns \"component\" object. If it returns, it means it needs to be written to the filesystem.\n * Otherwise, it means the component is already up to date and no need to write it.\n *\n * If no need to change anything (ours), then don't return the component object.\n * Otherwise, either return the component object as is (if no conflicts or \"theirs\"), or change the files in this\n * component object. Later, this component object is written to the filesystem.\n *\n * 1) when the files are modified with conflicts and the strategy is \"ours\", or forceOurs was used, leave the FS as is.\n *\n * 2) when the files are modified with conflicts and the strategy is \"theirs\", or forceTheirs was used, write the\n * component according to \"component\" object\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 * 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: ComponentID,\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, forceOurs } = checkoutProps;\n let filesStatus = {};\n if ((mergeResults?.hasConflicts && mergeStrategy === MergeOptions.ours) || forceOurs) {\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 BitError('applyVersion: componentMap was not found');\n\n const files = component.files;\n updateFileStatus(files, filesStatus, componentFromFS || undefined);\n\n await removeFilesIfNeeded(filesStatus, consumer, componentFromFS || undefined);\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 // in case of forceTheirs, the mergeResults is undefined, the \"component\" object is according to \"theirs\", so it'll work\n // expected. (later, it writes the component object).\n\n return {\n applyVersionResult: { id, filesStatus },\n component,\n };\n}\n\nexport function updateFileStatus(files: SourceFile[], filesStatus: FilesStatus, componentFromFS?: ConsumerComponent) {\n files.forEach((file) => {\n const fileFromFs = componentFromFS?.files.find((f) => f.relative === file.relative);\n // @ts-ignore should be fixed after upgrading @types/node from '12.20.4' to > 20\n const areFilesEqual = fileFromFs && Buffer.compare(fileFromFs.contents, file.contents) === 0;\n // @ts-ignore\n filesStatus[pathNormalizeToLinux(file.relative)] = areFilesEqual ? FileStatus.unchanged : FileStatus.updated;\n });\n}\n\n/**\n * when files exist on the filesystem but not on the checked out versions, they need to be deleted.\n * without this function, these files would be left on the filesystem. (we don't delete the comp-dir before writing).\n * this needs to be done *before* the component is written to the filesystem, otherwise, it won't work when a file\n * has a case change. e.g. from uppercase to lowercase. (see merge-lane.e2e 'renaming files from uppercase to lowercase').\n */\nexport async function removeFilesIfNeeded(\n filesStatus: FilesStatus,\n consumer: Consumer,\n componentFromFS?: ConsumerComponent\n) {\n if (!componentFromFS) return;\n // @todo: if the component is not in the FS, it should be passed as undefined here.\n // in the case this is coming from merge-lane, it's sometimes populated from the scope.\n const isExistOnFs = consumer.bitMap.getComponentIdIfExist(componentFromFS.id, { ignoreVersion: true });\n if (!isExistOnFs) return;\n const filePathsFromFS = componentFromFS.files || [];\n const dataToPersist = new DataToPersist();\n filePathsFromFS.forEach((file) => {\n const filename = pathNormalizeToLinux(file.relative);\n if (!filesStatus[filename]) {\n // @ts-ignore todo: typescript has a good point here. it should be the string \"removed\", not chalk.green(removed).\n filesStatus[filename] = FileStatus.removed;\n }\n if (filesStatus[filename] === FileStatus.removed) {\n dataToPersist.removePath(new RemovePath(file.path));\n }\n });\n await dataToPersist.persistAllToFS();\n}\n\nexport function throwForFailures(allComponentsStatus: ComponentStatusBase[]) {\n const failedComponents = allComponentsStatus.filter((c) => c.unchangedMessage && !c.unchangedLegitimately);\n if (failedComponents.length) {\n const failureMsgs = failedComponents\n .map(\n (failedComponent) =>\n `${chalk.bold(failedComponent.id.toString())} - ${chalk.red(failedComponent.unchangedMessage as string)}`\n )\n .join('\\n');\n throw new BitError(`unable to proceed due to the following failures:\\n${failureMsgs}`);\n }\n}\n"],"mappings":";;;;;;;;;AAIA,SAAAA,WAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,UAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,QAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,UAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,SAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,OAAA;EAAA,MAAAJ,IAAA,GAAAK,sBAAA,CAAAJ,OAAA;EAAAG,MAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,kBAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,iBAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAyG,SAAAK,uBAAAE,CAAA,WAAAA,CAAA,IAAA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CAACoC,IAAI,CAAC,CAAC;IACrD;EACF,CAAC,CAAC;EACF,MAAMN,aAAa,CAACO,cAAc,CAAC,CAAC;AACtC;AAEO,SAASC,gBAAgBA,CAACC,mBAA0C,EAAE;EAC3E,MAAMC,gBAAgB,GAAGD,mBAAmB,CAAChF,MAAM,CAAEkF,CAAC,IAAKA,CAAC,CAACC,gBAAgB,IAAI,CAACD,CAAC,CAACE,qBAAqB,CAAC;EAC1G,IAAIH,gBAAgB,CAAC1E,MAAM,EAAE;IAC3B,MAAM8E,WAAW,GAAGJ,gBAAgB,CACjCK,GAAG,CACDC,eAAe,IACd,GAAGC,gBAAK,CAACC,IAAI,CAACF,eAAe,CAAC5D,EAAE,CAACM,QAAQ,CAAC,CAAC,CAAC,MAAMuD,gBAAK,CAACE,GAAG,CAACH,eAAe,CAACJ,gBAA0B,CAAC,EAC3G,CAAC,CACAQ,IAAI,CAAC,IAAI,CAAC;IACb,MAAM,KAAIvC,oBAAQ,EAAC,qDAAqDiC,WAAW,EAAE,CAAC;EACxF;AACF","ignoreList":[]}
1
+ {"version":3,"names":["_component","data","require","_legacy","_bitError","_chalk","_interopRequireDefault","_componentModules","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","applyVersion","consumer","id","componentFromFS","mergeResults","checkoutProps","isLane","Error","toString","mergeStrategy","forceOurs","filesStatus","hasConflicts","MergeOptions","ours","files","file","pathNormalizeToLinux","relative","FileStatus","unchanged","bitMap","updateComponentId","applyVersionResult","component","loadComponentFromModelImportIfNeeded","componentMap","BitError","updateFileStatus","undefined","removeFilesIfNeeded","modifiedStatus","modifiedFiles","applyModifiedVersion","fileFromFs","find","f","areFilesEqual","Buffer","compare","contents","updated","isExistOnFs","getComponentIdIfExist","ignoreVersion","filePathsFromFS","dataToPersist","DataToPersist","filename","removed","removePath","RemovePath","path","persistAllToFS","throwForFailures","allComponentsStatus","failedComponents","c","unchangedMessage","unchangedLegitimately","failureMsgs","map","failedComponent","chalk","bold","red","join"],"sources":["checkout-version.ts"],"sourcesContent":["import type { Consumer } from '@teambit/legacy.consumer';\nimport type { ComponentID } from '@teambit/component-id';\nimport type { Version } from '@teambit/objects';\nimport type { SourceFile } from '@teambit/component.sources';\nimport { RemovePath, DataToPersist } from '@teambit/component.sources';\nimport { pathNormalizeToLinux } from '@teambit/legacy.utils';\nimport type { ConsumerComponent } from '@teambit/legacy.consumer-component';\nimport { BitError } from '@teambit/bit-error';\nimport chalk from 'chalk';\nimport type { ApplyVersionResult, FilesStatus, MergeResultsThreeWay } from '@teambit/component.modules.merge-helper';\nimport { applyModifiedVersion, FileStatus, MergeOptions } from '@teambit/component.modules.merge-helper';\nimport type { CheckoutProps } from './checkout.main.runtime';\n\nexport type ComponentStatusBase = {\n currentComponent?: ConsumerComponent;\n componentFromModel?: Version;\n id: ComponentID;\n shouldBeRemoved?: boolean; // in case the component is soft-removed, it should be removed from the workspace\n unchangedMessage?: string; // this gets populated either upon skip or failure.\n unchangedLegitimately?: boolean; // true for skipped legitimately (e.g. already up to date). false for failure.\n};\n\nexport type ComponentStatus = ComponentStatusBase & {\n mergeResults?: MergeResultsThreeWay | null | undefined;\n};\n\nexport type ApplyVersionWithComps = {\n applyVersionResult: ApplyVersionResult;\n component?: ConsumerComponent;\n // in case the component needs to be written to the filesystem, this is the component to write.\n legacyCompToWrite?: ConsumerComponent;\n};\n\n/**\n * This function optionally returns \"component\" object. If it returns, it means it needs to be written to the filesystem.\n * Otherwise, it means the component is already up to date and no need to write it.\n *\n * If no need to change anything (ours), then don't return the component object.\n * Otherwise, either return the component object as is (if no conflicts or \"theirs\"), or change the files in this\n * component object. Later, this component object is written to the filesystem.\n *\n * 1) when the files are modified with conflicts and the strategy is \"ours\", or forceOurs was used, leave the FS as is.\n *\n * 2) when the files are modified with conflicts and the strategy is \"theirs\", or forceTheirs was used, write the\n * component according to \"component\" object\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 * 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: ComponentID,\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, forceOurs } = checkoutProps;\n let filesStatus = {};\n if ((mergeResults?.hasConflicts && mergeStrategy === MergeOptions.ours) || forceOurs) {\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 BitError('applyVersion: componentMap was not found');\n\n const files = component.files;\n updateFileStatus(files, filesStatus, componentFromFS || undefined);\n\n await removeFilesIfNeeded(filesStatus, consumer, componentFromFS || undefined);\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 // in case of forceTheirs, the mergeResults is undefined, the \"component\" object is according to \"theirs\", so it'll work\n // expected. (later, it writes the component object).\n\n return {\n applyVersionResult: { id, filesStatus },\n component,\n };\n}\n\nexport function updateFileStatus(files: SourceFile[], filesStatus: FilesStatus, componentFromFS?: ConsumerComponent) {\n files.forEach((file) => {\n const fileFromFs = componentFromFS?.files.find((f) => f.relative === file.relative);\n const areFilesEqual = fileFromFs && Buffer.compare(fileFromFs.contents, file.contents) === 0;\n // @ts-ignore\n filesStatus[pathNormalizeToLinux(file.relative)] = areFilesEqual ? FileStatus.unchanged : FileStatus.updated;\n });\n}\n\n/**\n * when files exist on the filesystem but not on the checked out versions, they need to be deleted.\n * without this function, these files would be left on the filesystem. (we don't delete the comp-dir before writing).\n * this needs to be done *before* the component is written to the filesystem, otherwise, it won't work when a file\n * has a case change. e.g. from uppercase to lowercase. (see merge-lane.e2e 'renaming files from uppercase to lowercase').\n */\nexport async function removeFilesIfNeeded(\n filesStatus: FilesStatus,\n consumer: Consumer,\n componentFromFS?: ConsumerComponent\n) {\n if (!componentFromFS) return;\n // @todo: if the component is not in the FS, it should be passed as undefined here.\n // in the case this is coming from merge-lane, it's sometimes populated from the scope.\n const isExistOnFs = consumer.bitMap.getComponentIdIfExist(componentFromFS.id, { ignoreVersion: true });\n if (!isExistOnFs) return;\n const filePathsFromFS = componentFromFS.files || [];\n const dataToPersist = new DataToPersist();\n filePathsFromFS.forEach((file) => {\n const filename = pathNormalizeToLinux(file.relative);\n if (!filesStatus[filename]) {\n // @ts-ignore todo: typescript has a good point here. it should be the string \"removed\", not chalk.green(removed).\n filesStatus[filename] = FileStatus.removed;\n }\n if (filesStatus[filename] === FileStatus.removed) {\n dataToPersist.removePath(new RemovePath(file.path));\n }\n });\n await dataToPersist.persistAllToFS();\n}\n\nexport function throwForFailures(allComponentsStatus: ComponentStatusBase[]) {\n const failedComponents = allComponentsStatus.filter((c) => c.unchangedMessage && !c.unchangedLegitimately);\n if (failedComponents.length) {\n const failureMsgs = failedComponents\n .map(\n (failedComponent) =>\n `${chalk.bold(failedComponent.id.toString())} - ${chalk.red(failedComponent.unchangedMessage as string)}`\n )\n .join('\\n');\n throw new BitError(`unable to proceed due to the following failures:\\n${failureMsgs}`);\n }\n}\n"],"mappings":";;;;;;;;;AAIA,SAAAA,WAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,UAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,QAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,UAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,SAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,OAAA;EAAA,MAAAJ,IAAA,GAAAK,sBAAA,CAAAJ,OAAA;EAAAG,MAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,kBAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,iBAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAyG,SAAAK,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,QAAAH,CAAA,EAAAI,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAP,CAAA,OAAAM,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAR,CAAA,GAAAI,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA,CAAAK,wBAAA,CAAAX,CAAA,EAAAI,CAAA,EAAAQ,UAAA,OAAAP,CAAA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C,gBAAK,CAACC,IAAI,CAACF,eAAe,CAAC5D,EAAE,CAACM,QAAQ,CAAC,CAAC,CAAC,MAAMuD,gBAAK,CAACE,GAAG,CAACH,eAAe,CAACJ,gBAA0B,CAAC,EAC3G,CAAC,CACAQ,IAAI,CAAC,IAAI,CAAC;IACb,MAAM,KAAIvC,oBAAQ,EAAC,qDAAqDiC,WAAW,EAAE,CAAC;EACxF;AACF","ignoreList":[]}
@@ -162,7 +162,7 @@ class CheckoutMain {
162
162
  await this.syncNewComponents(checkoutProps);
163
163
  const addedComponents = await this.restoreMissingComponents(checkoutProps);
164
164
  const newComponents = await this.addNewComponents(checkoutProps);
165
- const bitIds = _componentId().ComponentIdList.fromArray(ids?.map(id => id) || []);
165
+ const bitIds = _componentId().ComponentIdList.fromArray(ids || []);
166
166
  // don't use Promise.all, it loads the components and this operation must be in sequence.
167
167
  const allComponentStatusBeforeMerge = await (0, _pMapSeries().default)(bitIds, id => this.getComponentStatusBeforeMergeAttempt(id, checkoutProps));
168
168
  const compsNeedMerge = allComponentStatusBeforeMerge.filter(c => c.propsForMerge);
@@ -1 +1 @@
1
- {"version":3,"names":["_cli","data","require","_logger","_workspace","_bitError","_lodash","_remove","_componentModules","_importer","_legacy","_componentWriter","_pMapSeries","_interopRequireDefault","_componentId","_objects","_legacy2","_legacy3","_checkoutCmd","_checkout","_checkoutVersion","_revertCmd","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","CheckoutMain","constructor","workspace","logger","componentWriter","importer","remove","checkout","checkoutProps","ensureCheckoutConfiguration","inInstallContext","version","ids","promptMergeOptions","syncNewComponents","addedComponents","restoreMissingComponents","newComponents","addNewComponents","bitIds","ComponentIdList","fromArray","map","id","allComponentStatusBeforeMerge","mapSeries","getComponentStatusBeforeMergeAttempt","compsNeedMerge","c","propsForMerge","compsNotNeedMerge","toImport","compStatus","idsToImport","changeVersion","currentlyUsedVersion","flat","scope","legacyScope","scopeImporter","importWithoutDeps","cache","lane","consumer","getComponentsStatusOfMergeNeeded","tmp","Tmp","afterMergeAttempt","Promise","all","getMergeStatus","clear","err","compStatusMergeNeeded","allComponentsStatus","componentWithConflict","find","component","mergeResults","hasConflicts","mergeStrategy","BitError","toStringWithoutVersion","getMergeStrategyInteractive","throwForFailures","failedComponents","componentStatus","unchangedMessage","shouldBeRemoved","unchangedLegitimately","succeededComponents","checkoutPropsLegacy","componentsResults","currentComponent","applyVersion","componentsLegacy","compact","newFromLane","newFromLaneAdded","head","getNewComponentsFromLane","workspaceOnly","compsNewFromLane","loadComponentFromModelImportIfNeeded","leftUnresolvedConflicts","componentWriterResults","manyComponentsWriterOpts","components","skipDependencyInstallation","skipNpmInstall","verbose","resetConfig","reset","skipUpdatingBitMap","skipUpdatingBitmap","revert","shouldUpdateWorkspaceConfig","reasonForBitmapChange","writeMany","appliedVersionComponents","applyVersionResult","componentIdsToRemove","undefined","removeLocallyByIds","force","reasonForRemoval","removedComponents","n","toString","workspaceConfigUpdateResult","installationError","compilationError","missing","bitMapEntry","bitMap","getBitmapEntry","ignoreVersion","noFilesError","ComponentNotFoundInPath","comps","getMany","state","_consumer","stashedBitmapEntries","newBitmapEntries","entry","defaultScope","newComps","bitmapEntry","existingId","getBitmapEntryIfExist","modelComponent","ModelComponent","fromBitId","repo","objects","consumerComp","toConsumerComponent","newCompId","ComponentID","fromObject","name","fullName","writeToPath","rootDir","addComponent","componentId","files","f","basename","relativePath","relative","test","mainFile","config","triggerOnComponentAdd","compile","write","checkoutByCLIValues","componentPattern","setStatusLine","OutsideWorkspaceError","importCurrentObjects","makeLaneComponentsAvailableOnMain","parseValues","checkoutResults","onDestroy","notExported","isExported","changeScope","scopeComponentsImporter","toVersionLatest","reason","includeUnexported","error","unavailableOnMain","getUnavailableOnMainComponents","makeComponentsAvailableOnMain","includeLocallyDeleted","latest","idsOnWorkspace","listIdsIncludeRemoved","listIds","currentLane","getCurrentLaneObject","currentLaneIds","toComponentIds","hasWithoutVersion","LATEST","console","HEAD","getIds","idsByPattern","includeDeleted","laneBitIds","newComponentIds","bitId","isEqualWithoutVersion","nonRemovedNewIds","isRemoved","isComponentRemoved","headVersion","ancestor","main","latestVersion","versionPerId","forceOurs","forceTheirs","loadStash","existingBitMapId","getComponentIdIfExist","getComponent","results","loadComponents","allowAddingComponentsFromScope","componentModel","getModelComponentIfExist","returnFailure","msg","unmerged","unmergedComponents","getEntry","getNewVersion","headIncludeRemote","previousParent","getRefOfAncestor","getTagOfRefIfExists","latestVersionIfExist","newVersion","hasVersion","divergeDataForMergePending","getDivergeDataForMergePending","isMergePending","isDiverged","isModified","currentVersionObject","loadVersion","isComponentModified","versionRef","getRef","Error","componentVersion","getObject","hash","newId","componentFromModel","componentFromFS","baseVersion","baseComponent","otherComponent","parents","parent","threeWayMerge","otherLabel","currentLabel","provider","cli","loggerMain","compWriter","createLogger","CheckoutAspect","checkoutMain","register","CheckoutCmd","RevertCmd","exports","CLIAspect","WorkspaceAspect","LoggerAspect","ComponentWriterAspect","ImporterAspect","RemoveAspect","MainRuntime","addRuntime","_default"],"sources":["checkout.main.runtime.ts"],"sourcesContent":["import type { CLIMain } from '@teambit/cli';\nimport { CLIAspect, MainRuntime } from '@teambit/cli';\nimport type { Logger, LoggerMain } from '@teambit/logger';\nimport { LoggerAspect } from '@teambit/logger';\nimport type { Workspace } from '@teambit/workspace';\nimport { WorkspaceAspect, OutsideWorkspaceError } from '@teambit/workspace';\nimport { BitError } from '@teambit/bit-error';\nimport { compact } from 'lodash';\nimport type { RemoveMain } from '@teambit/remove';\nimport { RemoveAspect } from '@teambit/remove';\nimport type { ApplyVersionResults, FailedComponents, MergeStrategy } from '@teambit/component.modules.merge-helper';\nimport { threeWayMerge, getMergeStrategyInteractive } from '@teambit/component.modules.merge-helper';\nimport type { ImporterMain } from '@teambit/importer';\nimport { ImporterAspect } from '@teambit/importer';\nimport { HEAD, LATEST } from '@teambit/legacy.constants';\nimport type { ComponentWriterMain } from '@teambit/component-writer';\nimport { ComponentWriterAspect } from '@teambit/component-writer';\nimport mapSeries from 'p-map-series';\nimport { ComponentIdList, ComponentID } from '@teambit/component-id';\nimport type { Version, Lane } from '@teambit/objects';\nimport { ModelComponent } from '@teambit/objects';\nimport { Tmp } from '@teambit/legacy.scope';\nimport { ComponentNotFoundInPath } from '@teambit/legacy.consumer-component';\nimport { CheckoutCmd } from './checkout-cmd';\nimport { CheckoutAspect } from './checkout.aspect';\nimport type { ComponentStatus, ComponentStatusBase } from './checkout-version';\nimport { applyVersion, throwForFailures } from './checkout-version';\nimport { RevertCmd } from './revert-cmd';\nimport type { ComponentMap } from '@teambit/legacy.bit-map';\n\nexport type CheckoutProps = {\n version?: string; // if reset/head/latest is true, the version is undefined\n ids?: ComponentID[];\n head?: boolean;\n ancestor?: number; // how many generations to go backward\n latest?: boolean;\n main?: boolean; // relevant for \"revert\" only\n promptMergeOptions?: boolean;\n mergeStrategy?: MergeStrategy; // strategy to use in case of conflicts\n forceOurs?: boolean; // regardless of conflicts, use ours\n forceTheirs?: boolean; // regardless of conflicts, use theirs\n verbose?: boolean;\n skipNpmInstall?: boolean;\n reset?: boolean; // remove local changes. if set, the version is undefined.\n revert?: boolean; // change the files according to the given version, but don't change the bitmap version and don't try to merge\n all?: boolean; // checkout all ids\n isLane?: boolean;\n lane?: Lane; // currently needed for \"bit switch\" to tell the \"fetch\" where to fetch from\n workspaceOnly?: boolean;\n versionPerId?: ComponentID[]; // if given, the ComponentID.version is the version to checkout to.\n skipUpdatingBitmap?: boolean; // needed for stash\n loadStash?: boolean;\n stashedBitmapEntries?: Array<Partial<ComponentMap>>;\n restoreMissingComponents?: boolean; // in case .bitmap has a component and it's missing from the workspace, restore it (from model)\n allowAddingComponentsFromScope?: boolean; // in case the id doesn't exist in .bitmap, add it from the scope (relevant for switch)\n includeLocallyDeleted?: boolean; // include components that were deleted locally. currently enabled for \"bit checkout reset\" only.\n};\n\nexport type ComponentStatusBeforeMergeAttempt = ComponentStatusBase & {\n propsForMerge?: {\n currentlyUsedVersion: string;\n componentModel: ModelComponent;\n };\n};\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 await this.ensureCheckoutConfiguration(checkoutProps);\n this.workspace.inInstallContext = true;\n const { version, ids, promptMergeOptions } = checkoutProps;\n await this.syncNewComponents(checkoutProps);\n const addedComponents = await this.restoreMissingComponents(checkoutProps);\n const newComponents = await this.addNewComponents(checkoutProps);\n const bitIds = ComponentIdList.fromArray(ids?.map((id) => id) || []);\n // don't use Promise.all, it loads the components and this operation must be in sequence.\n const allComponentStatusBeforeMerge = await mapSeries(bitIds, (id) =>\n this.getComponentStatusBeforeMergeAttempt(id, 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\n await this.workspace.scope.legacyScope.scopeImporter.importWithoutDeps(ComponentIdList.fromArray(toImport), {\n cache: true,\n lane: checkoutProps.lane,\n });\n const consumer = this.workspace.consumer;\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, checkoutProps)));\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 BitError(\n `automatic merge has failed for component ${componentWithConflict.id.toStringWithoutVersion()}.\\nplease use \"--auto-merge-resolve\" with 'manual', 'ours' or 'theirs' to resolve the conflict/s`\n );\n }\n if (!checkoutProps.mergeStrategy) checkoutProps.mergeStrategy = await getMergeStrategyInteractive();\n }\n\n throwForFailures(allComponentsStatus);\n\n const failedComponents: FailedComponents[] = allComponentsStatus\n .filter((componentStatus) => componentStatus.unchangedMessage)\n .filter((componentStatus) => !componentStatus.shouldBeRemoved)\n .map((componentStatus) => ({\n id: componentStatus.id,\n unchangedMessage: componentStatus.unchangedMessage as string,\n unchangedLegitimately: componentStatus.unchangedLegitimately,\n }));\n\n const succeededComponents = allComponentsStatus.filter((componentStatus) => !componentStatus.unchangedMessage);\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) };\n const componentsResults = await mapSeries(succeededComponents, ({ id, currentComponent, mergeResults }) => {\n return applyVersion(consumer, id, currentComponent, mergeResults, checkoutPropsLegacy);\n });\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))\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 skipUpdatingBitMap: checkoutProps.skipUpdatingBitmap || checkoutProps.revert,\n shouldUpdateWorkspaceConfig: true,\n reasonForBitmapChange: 'checkout',\n mergeStrategy: checkoutProps.mergeStrategy,\n };\n componentWriterResults = await this.componentWriter.writeMany(manyComponentsWriterOpts);\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, reasonForRemoval: 'checkout' });\n }\n\n return {\n components: appliedVersionComponents,\n removedComponents: componentIdsToRemove,\n addedComponents,\n newComponents,\n version,\n failedComponents,\n leftUnresolvedConflicts,\n newFromLane: newFromLane?.map((n) => n.toString()),\n newFromLaneAdded,\n workspaceConfigUpdateResult: componentWriterResults?.workspaceConfigUpdateResult,\n installationError: componentWriterResults?.installationError,\n compilationError: componentWriterResults?.compilationError,\n };\n }\n\n /**\n * if .bitmap entry exists but the rootDir is missing from the filesystem, find the component in the scope and restore it.\n * returns the restored component ids.\n */\n async restoreMissingComponents(checkoutProps: CheckoutProps): Promise<ComponentID[] | undefined> {\n if (checkoutProps.reset) {\n checkoutProps.restoreMissingComponents = true;\n }\n if (!checkoutProps.restoreMissingComponents) return undefined;\n const ids = checkoutProps.ids || [];\n const missing: ComponentID[] = [];\n await Promise.all(\n ids.map(async (id) => {\n const bitMapEntry = this.workspace.bitMap.getBitmapEntry(id, { ignoreVersion: true });\n if (bitMapEntry.noFilesError && bitMapEntry.noFilesError instanceof ComponentNotFoundInPath) {\n delete bitMapEntry.noFilesError;\n missing.push(id);\n }\n })\n );\n if (!missing.length) return undefined;\n const comps = await this.workspace.scope.getMany(missing);\n await this.componentWriter.writeMany({\n components: comps.map((c) => c.state._consumer),\n skipDependencyInstallation: true,\n skipUpdatingBitMap: true,\n });\n\n return missing;\n }\n\n async addNewComponents(checkoutProps: CheckoutProps): Promise<undefined | ComponentID[]> {\n const stashedBitmapEntries = checkoutProps.stashedBitmapEntries;\n if (!stashedBitmapEntries) return;\n const newBitmapEntries = stashedBitmapEntries.filter((entry) => entry.defaultScope);\n if (!newBitmapEntries.length) return;\n const newComps = await mapSeries(newBitmapEntries, async (bitmapEntry) => {\n const id = bitmapEntry.id!;\n const existingId = this.workspace.bitMap.getBitmapEntryIfExist(id, { ignoreVersion: true });\n if (existingId) return;\n const modelComponent = ModelComponent.fromBitId(id);\n const repo = this.workspace.scope.legacyScope.objects;\n const consumerComp = await modelComponent.toConsumerComponent(id.version, id.scope, repo);\n const newCompId = ComponentID.fromObject({ name: id.fullName }, bitmapEntry.defaultScope!);\n await this.componentWriter.writeMany({\n components: [consumerComp],\n skipDependencyInstallation: true,\n writeToPath: bitmapEntry.rootDir,\n skipUpdatingBitMap: true,\n });\n\n this.workspace.consumer.bitMap.addComponent({\n componentId: newCompId,\n files: consumerComp.files.map((f) => ({\n name: f.basename,\n relativePath: f.relative,\n test: f.test,\n })),\n mainFile: bitmapEntry.mainFile!,\n config: bitmapEntry.config,\n defaultScope: bitmapEntry.defaultScope,\n });\n await this.workspace.triggerOnComponentAdd(newCompId, { compile: true });\n return newCompId;\n });\n await this.workspace.bitMap.write();\n return compact(newComps);\n }\n\n async checkoutByCLIValues(componentPattern: string, checkoutProps: CheckoutProps): Promise<ApplyVersionResults> {\n const { revert, head } = checkoutProps;\n this.logger.setStatusLine(revert ? 'reverting components...' : 'switching component version...');\n if (!this.workspace) throw new OutsideWorkspaceError();\n const consumer = this.workspace.consumer;\n await this.importer.importCurrentObjects(); // important. among others, it fetches the remote lane object and its new components.\n if (head) await this.makeLaneComponentsAvailableOnMain();\n await this.parseValues(componentPattern, checkoutProps);\n const checkoutResults = await this.checkout(checkoutProps);\n await consumer.onDestroy(`checkout (${componentPattern})`);\n return checkoutResults;\n }\n\n private async syncNewComponents({ ids, head }: CheckoutProps) {\n if (!head) return;\n const notExported = ids?.filter((id) => !this.workspace.isExported(id)).map((id) => id.changeScope(id.scope));\n const scopeComponentsImporter = this.workspace.consumer.scope.scopeImporter;\n try {\n await scopeComponentsImporter.importWithoutDeps(ComponentIdList.fromArray(notExported || []).toVersionLatest(), {\n cache: false,\n reason: 'for making sure the new components are really new and are not out-of-sync',\n includeUnexported: 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 ensureCheckoutConfiguration(checkoutProps: CheckoutProps) {\n if (checkoutProps.reset || checkoutProps.head) {\n checkoutProps.includeLocallyDeleted = true;\n }\n if (checkoutProps.ids?.length) {\n return;\n }\n if (checkoutProps.head || checkoutProps.latest) {\n checkoutProps.all = true;\n }\n if (!checkoutProps.all) {\n return; // no ids and no all.\n }\n const idsOnWorkspace = checkoutProps.includeLocallyDeleted\n ? this.workspace.listIdsIncludeRemoved()\n : this.workspace.listIds();\n\n const currentLane = await this.workspace.consumer.getCurrentLaneObject();\n const currentLaneIds = currentLane?.toComponentIds();\n\n // When on a lane and doing head checkout, only checkout lane components\n const ids =\n currentLaneIds && checkoutProps.head\n ? idsOnWorkspace.filter((id) => currentLaneIds.hasWithoutVersion(id))\n : idsOnWorkspace;\n\n checkoutProps.ids = ids.map((id) => (checkoutProps.head || checkoutProps.latest ? id.changeVersion(LATEST) : id));\n }\n\n private async parseValues(componentPattern: string, checkoutProps: CheckoutProps) {\n // CLI-specific validations and deprecation warnings\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 BitError('please specify either [component-pattern] or --all, not both');\n }\n if (!componentPattern && !checkoutProps.all) {\n throw new BitError('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 if (checkoutProps.reset || checkoutProps.head) {\n checkoutProps.includeLocallyDeleted = true;\n }\n\n const getIds = async () => {\n if (componentPattern) {\n return this.workspace.idsByPattern(componentPattern, true, {\n includeDeleted: checkoutProps.includeLocallyDeleted,\n });\n }\n return checkoutProps.includeLocallyDeleted ? this.workspace.listIdsIncludeRemoved() : this.workspace.listIds();\n };\n\n const idsOnWorkspace = await getIds();\n\n const currentLane = await this.workspace.consumer.getCurrentLaneObject();\n const currentLaneIds = currentLane?.toComponentIds();\n // when no ids were given and the user is on a lane, return lane-ids only.\n // it's relevant for cases like \"bit checkout head\" when on a lane to not checkout main components. (see https://github.com/teambit/bit/pull/6853)\n const ids =\n currentLaneIds && !componentPattern && checkoutProps.head\n ? idsOnWorkspace.filter((id) => currentLaneIds.hasWithoutVersion(id))\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.toComponentIds();\n const newComponentIds = laneBitIds.filter((bitId) => !ids.find((id) => id.isEqualWithoutVersion(bitId)));\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 // eslint-disable-next-line complexity\n private async getComponentStatusBeforeMergeAttempt(\n id: ComponentID,\n checkoutProps: CheckoutProps\n ): Promise<ComponentStatusBeforeMergeAttempt> {\n const consumer = this.workspace.consumer;\n const {\n version,\n head: headVersion,\n ancestor,\n reset,\n revert,\n main,\n latest: latestVersion,\n versionPerId,\n forceOurs,\n forceTheirs,\n loadStash,\n } = checkoutProps;\n const repo = consumer.scope.objects;\n\n let existingBitMapId = consumer.bitMap.getComponentIdIfExist(id, { ignoreVersion: true });\n const getComponent = async () => {\n try {\n const results = await consumer.loadComponents(ComponentIdList.fromArray([id]));\n if (results.components[0]) return results.components[0];\n if (checkoutProps.includeLocallyDeleted && results.removedComponents[0]) {\n return results.removedComponents[0];\n }\n } catch (err) {\n if (checkoutProps.allowAddingComponentsFromScope && !existingBitMapId) return undefined;\n throw err;\n }\n return undefined;\n };\n const component = await getComponent();\n if (component) {\n // the component might fix an out-of-sync issue and as a result, the id has changed\n id = component.id;\n existingBitMapId = consumer.bitMap.getComponentIdIfExist(id, { ignoreVersion: true });\n }\n\n const componentModel = await consumer.scope.getModelComponentIfExist(id);\n const componentStatus: ComponentStatusBeforeMergeAttempt = { id };\n const returnFailure = (msg: string, unchangedLegitimately = false) => {\n componentStatus.unchangedMessage = msg;\n componentStatus.unchangedLegitimately = unchangedLegitimately;\n return componentStatus;\n };\n if (!componentModel) {\n return returnFailure(`component ${id.toString()} is new, no version to checkout`, true);\n }\n if (main && !componentModel.head) {\n return returnFailure(`component ${id.toString()} is not available on main`);\n }\n const unmerged = repo.unmergedComponents.getEntry(id);\n if (!reset && unmerged) {\n return returnFailure(\n `component ${id.toStringWithoutVersion()} is in during-merge state, please snap/tag it first (or use bit merge --resolve/--abort)`\n );\n }\n\n const getNewVersion = async (): Promise<string> => {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n if (reset) return component!.id.version as string;\n if (headVersion) return componentModel.headIncludeRemote(repo);\n if (ancestor) {\n const previousParent = await componentModel.getRefOfAncestor(repo, ancestor);\n return componentModel.getTagOfRefIfExists(previousParent)?.toString() || previousParent.toString();\n }\n // we verified previously that head exists in case of \"main\"\n if (main) return componentModel.head?.toString() as string;\n if (latestVersion) {\n const latest = componentModel.latestVersionIfExist();\n return latest || componentModel.headIncludeRemote(repo);\n }\n if (versionPerId) {\n return versionPerId.find((bitId) => bitId.isEqualWithoutVersion(id))?.version as string;\n }\n\n // if all above are false, the version is defined\n return version as string;\n };\n const newVersion = await getNewVersion();\n if (version && !headVersion) {\n const hasVersion = await componentModel.hasVersion(version, repo);\n if (!hasVersion) return returnFailure(`component ${id.toStringWithoutVersion()} doesn't have version ${version}`);\n }\n const currentlyUsedVersion = existingBitMapId?.version;\n if (existingBitMapId && !currentlyUsedVersion) {\n return returnFailure(`component ${id.toStringWithoutVersion()} is new`);\n }\n\n if ((version && currentlyUsedVersion === version) || (versionPerId && currentlyUsedVersion === newVersion)) {\n // it won't be relevant for 'reset' as it doesn't have a version/versionPerId\n return returnFailure(\n `component ${id.toStringWithoutVersion()} is already at version ${version || newVersion}`,\n true\n );\n }\n if ((headVersion || latestVersion) && currentlyUsedVersion === newVersion) {\n return returnFailure(\n `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 let isModified = false;\n if (currentlyUsedVersion) {\n const currentVersionObject: Version = await componentModel.loadVersion(currentlyUsedVersion, repo);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n isModified = await consumer.isComponentModified(currentVersionObject, component!);\n const isRemoved = component && component.isRemoved();\n if (!isModified && !isRemoved && reset) {\n return returnFailure(`component ${id.toStringWithoutVersion()} is not modified`, true);\n }\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()) {\n if (existingBitMapId) componentStatus.shouldBeRemoved = true;\n return returnFailure(`component has been removed`, true);\n }\n\n const newId = id.changeVersion(newVersion);\n\n if (reset || (!isModified && !loadStash) || revert || !currentlyUsedVersion || forceTheirs || forceOurs) {\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 // in case of \"loadStash\", we want to merge the stashed modifications regardless whether it's modified currently.\n\n // if !currentlyUsedVersion it only exists in the model, so just write it. (happening during bit-switch/bit-lane-import)\n return { currentComponent: component, componentFromModel: componentVersion, id: newId };\n }\n\n const propsForMerge = {\n currentlyUsedVersion,\n componentModel,\n };\n\n return { currentComponent: component, componentFromModel: componentVersion, id: newId, propsForMerge };\n }\n\n private async getMergeStatus(\n { currentComponent: componentFromFS, componentFromModel, id, propsForMerge }: ComponentStatusBeforeMergeAttempt,\n checkoutProps: CheckoutProps\n ): 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 let baseVersion = currentlyUsedVersion;\n const newVersion = id.version as string;\n let baseComponent: Version = await componentModel.loadVersion(baseVersion, repo);\n const otherComponent: Version = await componentModel.loadVersion(newVersion, repo);\n const { loadStash } = checkoutProps;\n if (loadStash && otherComponent.parents.length) {\n // for stash, we want the stashed modifications to be added on top of the current version.\n // for this to happen, the \"base\" must be the parent of the stashed version.\n const parent = otherComponent.parents[0];\n baseVersion = parent.toString();\n baseComponent = await componentModel.loadVersion(baseVersion, repo);\n }\n\n const mergeResults = await threeWayMerge({\n scope: consumer.scope,\n otherComponent,\n otherLabel: loadStash ? 'stash' : newVersion,\n currentComponent: componentFromFS,\n currentLabel: `${currentlyUsedVersion} modified`,\n baseComponent,\n });\n\n return { currentComponent: 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), new RevertCmd(checkoutMain));\n return checkoutMain;\n }\n}\n\nCheckoutAspect.addRuntime(CheckoutMain);\n\nexport default CheckoutMain;\n"],"mappings":";;;;;;AACA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAA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E6K,eAAe;MACjCQ,YAAY,EAAE,GAAG3N,oBAAoB,WAAW;MAChDqN;IACF,CAAC,CAAC;IAEF,OAAO;MAAE/K,gBAAgB,EAAE6K,eAAe;MAAED,kBAAkB;MAAE9N,EAAE;MAAEmC;IAAa,CAAC;EACpF;EAOA,aAAaqM,QAAQA,CAAC,CAACC,GAAG,EAAE9P,SAAS,EAAE+P,UAAU,EAAEC,UAAU,EAAE7P,QAAQ,EAAEC,MAAM,CAO9E,EAAE;IACD,MAAMH,MAAM,GAAG8P,UAAU,CAACE,YAAY,CAACC,0BAAc,CAAC7O,EAAE,CAAC;IACzD,MAAM8O,YAAY,GAAG,IAAIrQ,YAAY,CAACE,SAAS,EAAEC,MAAM,EAAE+P,UAAU,EAAE7P,QAAQ,EAAEC,MAAM,CAAC;IACtF0P,GAAG,CAACM,QAAQ,CAAC,KAAIC,0BAAW,EAACF,YAAY,CAAC,EAAE,KAAIG,sBAAS,EAACH,YAAY,CAAC,CAAC;IACxE,OAAOA,YAAY;EACrB;AACF;AAACI,OAAA,CAAAzQ,YAAA,GAAAA,YAAA;AAAAhB,eAAA,CA3iBYgB,YAAY,WAyhBR,EAAE;AAAAhB,eAAA,CAzhBNgB,YAAY,kBA0hBD,CAAC0Q,gBAAS,EAAEC,4BAAe,EAAEC,sBAAY,EAAEC,wCAAqB,EAAEC,0BAAc,EAAEC,sBAAY,CAAC;AAAA/R,eAAA,CA1hB1GgB,YAAY,aA4hBNgR,kBAAW;AAiB9BZ,0BAAc,CAACa,UAAU,CAACjR,YAAY,CAAC;AAAC,IAAAkR,QAAA,GAAAT,OAAA,CAAA1S,OAAA,GAEzBiC,YAAY","ignoreList":[]}
1
+ {"version":3,"names":["_cli","data","require","_logger","_workspace","_bitError","_lodash","_remove","_componentModules","_importer","_legacy","_componentWriter","_pMapSeries","_interopRequireDefault","_componentId","_objects","_legacy2","_legacy3","_checkoutCmd","_checkout","_checkoutVersion","_revertCmd","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","CheckoutMain","constructor","workspace","logger","componentWriter","importer","remove","checkout","checkoutProps","ensureCheckoutConfiguration","inInstallContext","version","ids","promptMergeOptions","syncNewComponents","addedComponents","restoreMissingComponents","newComponents","addNewComponents","bitIds","ComponentIdList","fromArray","allComponentStatusBeforeMerge","mapSeries","id","getComponentStatusBeforeMergeAttempt","compsNeedMerge","c","propsForMerge","compsNotNeedMerge","toImport","map","compStatus","idsToImport","changeVersion","currentlyUsedVersion","flat","scope","legacyScope","scopeImporter","importWithoutDeps","cache","lane","consumer","getComponentsStatusOfMergeNeeded","tmp","Tmp","afterMergeAttempt","Promise","all","getMergeStatus","clear","err","compStatusMergeNeeded","allComponentsStatus","componentWithConflict","find","component","mergeResults","hasConflicts","mergeStrategy","BitError","toStringWithoutVersion","getMergeStrategyInteractive","throwForFailures","failedComponents","componentStatus","unchangedMessage","shouldBeRemoved","unchangedLegitimately","succeededComponents","checkoutPropsLegacy","componentsResults","currentComponent","applyVersion","componentsLegacy","compact","newFromLane","newFromLaneAdded","head","getNewComponentsFromLane","workspaceOnly","compsNewFromLane","loadComponentFromModelImportIfNeeded","leftUnresolvedConflicts","componentWriterResults","manyComponentsWriterOpts","components","skipDependencyInstallation","skipNpmInstall","verbose","resetConfig","reset","skipUpdatingBitMap","skipUpdatingBitmap","revert","shouldUpdateWorkspaceConfig","reasonForBitmapChange","writeMany","appliedVersionComponents","applyVersionResult","componentIdsToRemove","undefined","removeLocallyByIds","force","reasonForRemoval","removedComponents","n","toString","workspaceConfigUpdateResult","installationError","compilationError","missing","bitMapEntry","bitMap","getBitmapEntry","ignoreVersion","noFilesError","ComponentNotFoundInPath","comps","getMany","state","_consumer","stashedBitmapEntries","newBitmapEntries","entry","defaultScope","newComps","bitmapEntry","existingId","getBitmapEntryIfExist","modelComponent","ModelComponent","fromBitId","repo","objects","consumerComp","toConsumerComponent","newCompId","ComponentID","fromObject","name","fullName","writeToPath","rootDir","addComponent","componentId","files","f","basename","relativePath","relative","test","mainFile","config","triggerOnComponentAdd","compile","write","checkoutByCLIValues","componentPattern","setStatusLine","OutsideWorkspaceError","importCurrentObjects","makeLaneComponentsAvailableOnMain","parseValues","checkoutResults","onDestroy","notExported","isExported","changeScope","scopeComponentsImporter","toVersionLatest","reason","includeUnexported","error","unavailableOnMain","getUnavailableOnMainComponents","makeComponentsAvailableOnMain","includeLocallyDeleted","latest","idsOnWorkspace","listIdsIncludeRemoved","listIds","currentLane","getCurrentLaneObject","currentLaneIds","toComponentIds","hasWithoutVersion","LATEST","console","HEAD","getIds","idsByPattern","includeDeleted","laneBitIds","newComponentIds","bitId","isEqualWithoutVersion","nonRemovedNewIds","isRemoved","isComponentRemoved","headVersion","ancestor","main","latestVersion","versionPerId","forceOurs","forceTheirs","loadStash","existingBitMapId","getComponentIdIfExist","getComponent","results","loadComponents","allowAddingComponentsFromScope","componentModel","getModelComponentIfExist","returnFailure","msg","unmerged","unmergedComponents","getEntry","getNewVersion","headIncludeRemote","previousParent","getRefOfAncestor","getTagOfRefIfExists","latestVersionIfExist","newVersion","hasVersion","divergeDataForMergePending","getDivergeDataForMergePending","isMergePending","isDiverged","isModified","currentVersionObject","loadVersion","isComponentModified","versionRef","getRef","Error","componentVersion","getObject","hash","newId","componentFromModel","componentFromFS","baseVersion","baseComponent","otherComponent","parents","parent","threeWayMerge","otherLabel","currentLabel","provider","cli","loggerMain","compWriter","createLogger","CheckoutAspect","checkoutMain","register","CheckoutCmd","RevertCmd","exports","CLIAspect","WorkspaceAspect","LoggerAspect","ComponentWriterAspect","ImporterAspect","RemoveAspect","MainRuntime","addRuntime","_default"],"sources":["checkout.main.runtime.ts"],"sourcesContent":["import type { CLIMain } from '@teambit/cli';\nimport { CLIAspect, MainRuntime } from '@teambit/cli';\nimport type { Logger, LoggerMain } from '@teambit/logger';\nimport { LoggerAspect } from '@teambit/logger';\nimport type { Workspace } from '@teambit/workspace';\nimport { WorkspaceAspect, OutsideWorkspaceError } from '@teambit/workspace';\nimport { BitError } from '@teambit/bit-error';\nimport { compact } from 'lodash';\nimport type { RemoveMain } from '@teambit/remove';\nimport { RemoveAspect } from '@teambit/remove';\nimport type { ApplyVersionResults, FailedComponents, MergeStrategy } from '@teambit/component.modules.merge-helper';\nimport { threeWayMerge, getMergeStrategyInteractive } from '@teambit/component.modules.merge-helper';\nimport type { ImporterMain } from '@teambit/importer';\nimport { ImporterAspect } from '@teambit/importer';\nimport { HEAD, LATEST } from '@teambit/legacy.constants';\nimport type { ComponentWriterMain } from '@teambit/component-writer';\nimport { ComponentWriterAspect } from '@teambit/component-writer';\nimport mapSeries from 'p-map-series';\nimport { ComponentIdList, ComponentID } from '@teambit/component-id';\nimport type { Version, Lane } from '@teambit/objects';\nimport { ModelComponent } from '@teambit/objects';\nimport { Tmp } from '@teambit/legacy.scope';\nimport { ComponentNotFoundInPath } from '@teambit/legacy.consumer-component';\nimport { CheckoutCmd } from './checkout-cmd';\nimport { CheckoutAspect } from './checkout.aspect';\nimport type { ComponentStatus, ComponentStatusBase } from './checkout-version';\nimport { applyVersion, throwForFailures } from './checkout-version';\nimport { RevertCmd } from './revert-cmd';\nimport type { ComponentMap } from '@teambit/legacy.bit-map';\n\nexport type CheckoutProps = {\n version?: string; // if reset/head/latest is true, the version is undefined\n ids?: ComponentID[];\n head?: boolean;\n ancestor?: number; // how many generations to go backward\n latest?: boolean;\n main?: boolean; // relevant for \"revert\" only\n promptMergeOptions?: boolean;\n mergeStrategy?: MergeStrategy; // strategy to use in case of conflicts\n forceOurs?: boolean; // regardless of conflicts, use ours\n forceTheirs?: boolean; // regardless of conflicts, use theirs\n verbose?: boolean;\n skipNpmInstall?: boolean;\n reset?: boolean; // remove local changes. if set, the version is undefined.\n revert?: boolean; // change the files according to the given version, but don't change the bitmap version and don't try to merge\n all?: boolean; // checkout all ids\n isLane?: boolean;\n lane?: Lane; // currently needed for \"bit switch\" to tell the \"fetch\" where to fetch from\n workspaceOnly?: boolean;\n versionPerId?: ComponentID[]; // if given, the ComponentID.version is the version to checkout to.\n skipUpdatingBitmap?: boolean; // needed for stash\n loadStash?: boolean;\n stashedBitmapEntries?: Array<Partial<ComponentMap>>;\n restoreMissingComponents?: boolean; // in case .bitmap has a component and it's missing from the workspace, restore it (from model)\n allowAddingComponentsFromScope?: boolean; // in case the id doesn't exist in .bitmap, add it from the scope (relevant for switch)\n includeLocallyDeleted?: boolean; // include components that were deleted locally. currently enabled for \"bit checkout reset\" only.\n};\n\nexport type ComponentStatusBeforeMergeAttempt = ComponentStatusBase & {\n propsForMerge?: {\n currentlyUsedVersion: string;\n componentModel: ModelComponent;\n };\n};\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 await this.ensureCheckoutConfiguration(checkoutProps);\n this.workspace.inInstallContext = true;\n const { version, ids, promptMergeOptions } = checkoutProps;\n await this.syncNewComponents(checkoutProps);\n const addedComponents = await this.restoreMissingComponents(checkoutProps);\n const newComponents = await this.addNewComponents(checkoutProps);\n const bitIds = ComponentIdList.fromArray(ids || []);\n // don't use Promise.all, it loads the components and this operation must be in sequence.\n const allComponentStatusBeforeMerge = await mapSeries(bitIds, (id) =>\n this.getComponentStatusBeforeMergeAttempt(id, 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\n await this.workspace.scope.legacyScope.scopeImporter.importWithoutDeps(ComponentIdList.fromArray(toImport), {\n cache: true,\n lane: checkoutProps.lane,\n });\n const consumer = this.workspace.consumer;\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, checkoutProps)));\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 BitError(\n `automatic merge has failed for component ${componentWithConflict.id.toStringWithoutVersion()}.\\nplease use \"--auto-merge-resolve\" with 'manual', 'ours' or 'theirs' to resolve the conflict/s`\n );\n }\n if (!checkoutProps.mergeStrategy) checkoutProps.mergeStrategy = await getMergeStrategyInteractive();\n }\n\n throwForFailures(allComponentsStatus);\n\n const failedComponents: FailedComponents[] = allComponentsStatus\n .filter((componentStatus) => componentStatus.unchangedMessage)\n .filter((componentStatus) => !componentStatus.shouldBeRemoved)\n .map((componentStatus) => ({\n id: componentStatus.id,\n unchangedMessage: componentStatus.unchangedMessage as string,\n unchangedLegitimately: componentStatus.unchangedLegitimately,\n }));\n\n const succeededComponents = allComponentsStatus.filter((componentStatus) => !componentStatus.unchangedMessage);\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) };\n const componentsResults = await mapSeries(succeededComponents, ({ id, currentComponent, mergeResults }) => {\n return applyVersion(consumer, id, currentComponent, mergeResults, checkoutPropsLegacy);\n });\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))\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 skipUpdatingBitMap: checkoutProps.skipUpdatingBitmap || checkoutProps.revert,\n shouldUpdateWorkspaceConfig: true,\n reasonForBitmapChange: 'checkout',\n mergeStrategy: checkoutProps.mergeStrategy,\n };\n componentWriterResults = await this.componentWriter.writeMany(manyComponentsWriterOpts);\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, reasonForRemoval: 'checkout' });\n }\n\n return {\n components: appliedVersionComponents,\n removedComponents: componentIdsToRemove,\n addedComponents,\n newComponents,\n version,\n failedComponents,\n leftUnresolvedConflicts,\n newFromLane: newFromLane?.map((n) => n.toString()),\n newFromLaneAdded,\n workspaceConfigUpdateResult: componentWriterResults?.workspaceConfigUpdateResult,\n installationError: componentWriterResults?.installationError,\n compilationError: componentWriterResults?.compilationError,\n };\n }\n\n /**\n * if .bitmap entry exists but the rootDir is missing from the filesystem, find the component in the scope and restore it.\n * returns the restored component ids.\n */\n async restoreMissingComponents(checkoutProps: CheckoutProps): Promise<ComponentID[] | undefined> {\n if (checkoutProps.reset) {\n checkoutProps.restoreMissingComponents = true;\n }\n if (!checkoutProps.restoreMissingComponents) return undefined;\n const ids = checkoutProps.ids || [];\n const missing: ComponentID[] = [];\n await Promise.all(\n ids.map(async (id) => {\n const bitMapEntry = this.workspace.bitMap.getBitmapEntry(id, { ignoreVersion: true });\n if (bitMapEntry.noFilesError && bitMapEntry.noFilesError instanceof ComponentNotFoundInPath) {\n delete bitMapEntry.noFilesError;\n missing.push(id);\n }\n })\n );\n if (!missing.length) return undefined;\n const comps = await this.workspace.scope.getMany(missing);\n await this.componentWriter.writeMany({\n components: comps.map((c) => c.state._consumer),\n skipDependencyInstallation: true,\n skipUpdatingBitMap: true,\n });\n\n return missing;\n }\n\n async addNewComponents(checkoutProps: CheckoutProps): Promise<undefined | ComponentID[]> {\n const stashedBitmapEntries = checkoutProps.stashedBitmapEntries;\n if (!stashedBitmapEntries) return;\n const newBitmapEntries = stashedBitmapEntries.filter((entry) => entry.defaultScope);\n if (!newBitmapEntries.length) return;\n const newComps = await mapSeries(newBitmapEntries, async (bitmapEntry) => {\n const id = bitmapEntry.id!;\n const existingId = this.workspace.bitMap.getBitmapEntryIfExist(id, { ignoreVersion: true });\n if (existingId) return;\n const modelComponent = ModelComponent.fromBitId(id);\n const repo = this.workspace.scope.legacyScope.objects;\n const consumerComp = await modelComponent.toConsumerComponent(id.version, id.scope, repo);\n const newCompId = ComponentID.fromObject({ name: id.fullName }, bitmapEntry.defaultScope!);\n await this.componentWriter.writeMany({\n components: [consumerComp],\n skipDependencyInstallation: true,\n writeToPath: bitmapEntry.rootDir,\n skipUpdatingBitMap: true,\n });\n\n this.workspace.consumer.bitMap.addComponent({\n componentId: newCompId,\n files: consumerComp.files.map((f) => ({\n name: f.basename,\n relativePath: f.relative,\n test: f.test,\n })),\n mainFile: bitmapEntry.mainFile!,\n config: bitmapEntry.config,\n defaultScope: bitmapEntry.defaultScope,\n });\n await this.workspace.triggerOnComponentAdd(newCompId, { compile: true });\n return newCompId;\n });\n await this.workspace.bitMap.write();\n return compact(newComps);\n }\n\n async checkoutByCLIValues(componentPattern: string, checkoutProps: CheckoutProps): Promise<ApplyVersionResults> {\n const { revert, head } = checkoutProps;\n this.logger.setStatusLine(revert ? 'reverting components...' : 'switching component version...');\n if (!this.workspace) throw new OutsideWorkspaceError();\n const consumer = this.workspace.consumer;\n await this.importer.importCurrentObjects(); // important. among others, it fetches the remote lane object and its new components.\n if (head) await this.makeLaneComponentsAvailableOnMain();\n await this.parseValues(componentPattern, checkoutProps);\n const checkoutResults = await this.checkout(checkoutProps);\n await consumer.onDestroy(`checkout (${componentPattern})`);\n return checkoutResults;\n }\n\n private async syncNewComponents({ ids, head }: CheckoutProps) {\n if (!head) return;\n const notExported = ids?.filter((id) => !this.workspace.isExported(id)).map((id) => id.changeScope(id.scope));\n const scopeComponentsImporter = this.workspace.consumer.scope.scopeImporter;\n try {\n await scopeComponentsImporter.importWithoutDeps(ComponentIdList.fromArray(notExported || []).toVersionLatest(), {\n cache: false,\n reason: 'for making sure the new components are really new and are not out-of-sync',\n includeUnexported: 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 ensureCheckoutConfiguration(checkoutProps: CheckoutProps) {\n if (checkoutProps.reset || checkoutProps.head) {\n checkoutProps.includeLocallyDeleted = true;\n }\n if (checkoutProps.ids?.length) {\n return;\n }\n if (checkoutProps.head || checkoutProps.latest) {\n checkoutProps.all = true;\n }\n if (!checkoutProps.all) {\n return; // no ids and no all.\n }\n const idsOnWorkspace = checkoutProps.includeLocallyDeleted\n ? this.workspace.listIdsIncludeRemoved()\n : this.workspace.listIds();\n\n const currentLane = await this.workspace.consumer.getCurrentLaneObject();\n const currentLaneIds = currentLane?.toComponentIds();\n\n // When on a lane and doing head checkout, only checkout lane components\n const ids =\n currentLaneIds && checkoutProps.head\n ? idsOnWorkspace.filter((id) => currentLaneIds.hasWithoutVersion(id))\n : idsOnWorkspace;\n\n checkoutProps.ids = ids.map((id) => (checkoutProps.head || checkoutProps.latest ? id.changeVersion(LATEST) : id));\n }\n\n private async parseValues(componentPattern: string, checkoutProps: CheckoutProps) {\n // CLI-specific validations and deprecation warnings\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 BitError('please specify either [component-pattern] or --all, not both');\n }\n if (!componentPattern && !checkoutProps.all) {\n throw new BitError('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 if (checkoutProps.reset || checkoutProps.head) {\n checkoutProps.includeLocallyDeleted = true;\n }\n\n const getIds = async () => {\n if (componentPattern) {\n return this.workspace.idsByPattern(componentPattern, true, {\n includeDeleted: checkoutProps.includeLocallyDeleted,\n });\n }\n return checkoutProps.includeLocallyDeleted ? this.workspace.listIdsIncludeRemoved() : this.workspace.listIds();\n };\n\n const idsOnWorkspace = await getIds();\n\n const currentLane = await this.workspace.consumer.getCurrentLaneObject();\n const currentLaneIds = currentLane?.toComponentIds();\n // when no ids were given and the user is on a lane, return lane-ids only.\n // it's relevant for cases like \"bit checkout head\" when on a lane to not checkout main components. (see https://github.com/teambit/bit/pull/6853)\n const ids =\n currentLaneIds && !componentPattern && checkoutProps.head\n ? idsOnWorkspace.filter((id) => currentLaneIds.hasWithoutVersion(id))\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.toComponentIds();\n const newComponentIds = laneBitIds.filter((bitId) => !ids.find((id) => id.isEqualWithoutVersion(bitId)));\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 // eslint-disable-next-line complexity\n private async getComponentStatusBeforeMergeAttempt(\n id: ComponentID,\n checkoutProps: CheckoutProps\n ): Promise<ComponentStatusBeforeMergeAttempt> {\n const consumer = this.workspace.consumer;\n const {\n version,\n head: headVersion,\n ancestor,\n reset,\n revert,\n main,\n latest: latestVersion,\n versionPerId,\n forceOurs,\n forceTheirs,\n loadStash,\n } = checkoutProps;\n const repo = consumer.scope.objects;\n\n let existingBitMapId = consumer.bitMap.getComponentIdIfExist(id, { ignoreVersion: true });\n const getComponent = async () => {\n try {\n const results = await consumer.loadComponents(ComponentIdList.fromArray([id]));\n if (results.components[0]) return results.components[0];\n if (checkoutProps.includeLocallyDeleted && results.removedComponents[0]) {\n return results.removedComponents[0];\n }\n } catch (err) {\n if (checkoutProps.allowAddingComponentsFromScope && !existingBitMapId) return undefined;\n throw err;\n }\n return undefined;\n };\n const component = await getComponent();\n if (component) {\n // the component might fix an out-of-sync issue and as a result, the id has changed\n id = component.id;\n existingBitMapId = consumer.bitMap.getComponentIdIfExist(id, { ignoreVersion: true });\n }\n\n const componentModel = await consumer.scope.getModelComponentIfExist(id);\n const componentStatus: ComponentStatusBeforeMergeAttempt = { id };\n const returnFailure = (msg: string, unchangedLegitimately = false) => {\n componentStatus.unchangedMessage = msg;\n componentStatus.unchangedLegitimately = unchangedLegitimately;\n return componentStatus;\n };\n if (!componentModel) {\n return returnFailure(`component ${id.toString()} is new, no version to checkout`, true);\n }\n if (main && !componentModel.head) {\n return returnFailure(`component ${id.toString()} is not available on main`);\n }\n const unmerged = repo.unmergedComponents.getEntry(id);\n if (!reset && unmerged) {\n return returnFailure(\n `component ${id.toStringWithoutVersion()} is in during-merge state, please snap/tag it first (or use bit merge --resolve/--abort)`\n );\n }\n\n const getNewVersion = async (): Promise<string> => {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n if (reset) return component!.id.version as string;\n if (headVersion) return componentModel.headIncludeRemote(repo);\n if (ancestor) {\n const previousParent = await componentModel.getRefOfAncestor(repo, ancestor);\n return componentModel.getTagOfRefIfExists(previousParent)?.toString() || previousParent.toString();\n }\n // we verified previously that head exists in case of \"main\"\n if (main) return componentModel.head?.toString() as string;\n if (latestVersion) {\n const latest = componentModel.latestVersionIfExist();\n return latest || componentModel.headIncludeRemote(repo);\n }\n if (versionPerId) {\n return versionPerId.find((bitId) => bitId.isEqualWithoutVersion(id))?.version as string;\n }\n\n // if all above are false, the version is defined\n return version as string;\n };\n const newVersion = await getNewVersion();\n if (version && !headVersion) {\n const hasVersion = await componentModel.hasVersion(version, repo);\n if (!hasVersion) return returnFailure(`component ${id.toStringWithoutVersion()} doesn't have version ${version}`);\n }\n const currentlyUsedVersion = existingBitMapId?.version;\n if (existingBitMapId && !currentlyUsedVersion) {\n return returnFailure(`component ${id.toStringWithoutVersion()} is new`);\n }\n\n if ((version && currentlyUsedVersion === version) || (versionPerId && currentlyUsedVersion === newVersion)) {\n // it won't be relevant for 'reset' as it doesn't have a version/versionPerId\n return returnFailure(\n `component ${id.toStringWithoutVersion()} is already at version ${version || newVersion}`,\n true\n );\n }\n if ((headVersion || latestVersion) && currentlyUsedVersion === newVersion) {\n return returnFailure(\n `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 let isModified = false;\n if (currentlyUsedVersion) {\n const currentVersionObject: Version = await componentModel.loadVersion(currentlyUsedVersion, repo);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n isModified = await consumer.isComponentModified(currentVersionObject, component!);\n const isRemoved = component && component.isRemoved();\n if (!isModified && !isRemoved && reset) {\n return returnFailure(`component ${id.toStringWithoutVersion()} is not modified`, true);\n }\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()) {\n if (existingBitMapId) componentStatus.shouldBeRemoved = true;\n return returnFailure(`component has been removed`, true);\n }\n\n const newId = id.changeVersion(newVersion);\n\n if (reset || (!isModified && !loadStash) || revert || !currentlyUsedVersion || forceTheirs || forceOurs) {\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 // in case of \"loadStash\", we want to merge the stashed modifications regardless whether it's modified currently.\n\n // if !currentlyUsedVersion it only exists in the model, so just write it. (happening during bit-switch/bit-lane-import)\n return { currentComponent: component, componentFromModel: componentVersion, id: newId };\n }\n\n const propsForMerge = {\n currentlyUsedVersion,\n componentModel,\n };\n\n return { currentComponent: component, componentFromModel: componentVersion, id: newId, propsForMerge };\n }\n\n private async getMergeStatus(\n { currentComponent: componentFromFS, componentFromModel, id, propsForMerge }: ComponentStatusBeforeMergeAttempt,\n checkoutProps: CheckoutProps\n ): 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 let baseVersion = currentlyUsedVersion;\n const newVersion = id.version as string;\n let baseComponent: Version = await componentModel.loadVersion(baseVersion, repo);\n const otherComponent: Version = await componentModel.loadVersion(newVersion, repo);\n const { loadStash } = checkoutProps;\n if (loadStash && otherComponent.parents.length) {\n // for stash, we want the stashed modifications to be added on top of the current version.\n // for this to happen, the \"base\" must be the parent of the stashed version.\n const parent = otherComponent.parents[0];\n baseVersion = parent.toString();\n baseComponent = await componentModel.loadVersion(baseVersion, repo);\n }\n\n const mergeResults = await threeWayMerge({\n scope: consumer.scope,\n otherComponent,\n otherLabel: loadStash ? 'stash' : newVersion,\n currentComponent: componentFromFS,\n currentLabel: `${currentlyUsedVersion} modified`,\n baseComponent,\n });\n\n return { currentComponent: 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), new RevertCmd(checkoutMain));\n return checkoutMain;\n }\n}\n\nCheckoutAspect.addRuntime(CheckoutMain);\n\nexport default CheckoutMain;\n"],"mappings":";;;;;;AACA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,QAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,WAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,UAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,UAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,SAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,QAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,OAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,QAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,OAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAO,kBAAA;EAAA,MAAAP,IAAA,GAAAC,OAAA;EAAAM,iBAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAQ,UAAA;EAAA,MAAAR,IAAA,GAAAC,OA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,0BAAc,CAACa,UAAU,CAACjR,YAAY,CAAC;AAAC,IAAAkR,QAAA,GAAAT,OAAA,CAAA1S,OAAA,GAEzBiC,YAAY","ignoreList":[]}
package/package.json CHANGED
@@ -1,47 +1,47 @@
1
1
  {
2
2
  "name": "@teambit/checkout",
3
- "version": "1.0.699",
3
+ "version": "1.0.702",
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": "1.0.699"
9
+ "version": "1.0.702"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "4.1.2",
13
13
  "lodash": "4.17.21",
14
14
  "p-map-series": "2.1.0",
15
15
  "@teambit/bit-error": "0.0.404",
16
- "@teambit/cli": "0.0.1258",
17
16
  "@teambit/component-id": "1.2.4",
18
- "@teambit/component.modules.merge-helper": "0.0.5",
19
17
  "@teambit/legacy.constants": "0.0.14",
20
- "@teambit/component.sources": "0.0.117",
21
- "@teambit/legacy.consumer-component": "0.0.66",
22
- "@teambit/legacy.consumer": "0.0.65",
23
18
  "@teambit/legacy.utils": "0.0.23",
24
19
  "@teambit/harmony": "0.4.7",
25
- "@teambit/legacy.bit-map": "0.0.122",
26
- "@teambit/legacy.scope": "0.0.65",
27
- "@teambit/logger": "0.0.1351",
28
- "@teambit/objects": "0.0.206",
29
- "@teambit/component-writer": "1.0.699",
30
- "@teambit/importer": "1.0.699",
31
- "@teambit/remove": "1.0.699",
32
- "@teambit/workspace": "1.0.699"
20
+ "@teambit/cli": "0.0.1261",
21
+ "@teambit/component.modules.merge-helper": "0.0.8",
22
+ "@teambit/component.sources": "0.0.120",
23
+ "@teambit/legacy.consumer-component": "0.0.69",
24
+ "@teambit/legacy.consumer": "0.0.68",
25
+ "@teambit/objects": "0.0.209",
26
+ "@teambit/component-writer": "1.0.702",
27
+ "@teambit/importer": "1.0.702",
28
+ "@teambit/legacy.bit-map": "0.0.125",
29
+ "@teambit/legacy.scope": "0.0.68",
30
+ "@teambit/logger": "0.0.1354",
31
+ "@teambit/remove": "1.0.702",
32
+ "@teambit/workspace": "1.0.702"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/lodash": "4.14.165",
36
36
  "@types/fs-extra": "9.0.7",
37
37
  "fs-extra": "10.0.0",
38
38
  "@types/mocha": "9.1.0",
39
- "@teambit/component.testing.mock-components": "0.0.329",
40
- "@teambit/harmony.testing.load-aspect": "0.0.324",
41
- "@teambit/workspace.testing.mock-workspace": "0.0.111",
42
39
  "@teambit/harmony.envs.core-aspect-env": "0.0.75",
43
- "@teambit/lister": "1.0.699",
44
- "@teambit/snapping": "1.0.699"
40
+ "@teambit/component.testing.mock-components": "0.0.332",
41
+ "@teambit/harmony.testing.load-aspect": "0.0.327",
42
+ "@teambit/lister": "1.0.702",
43
+ "@teambit/snapping": "1.0.702",
44
+ "@teambit/workspace.testing.mock-workspace": "0.0.114"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "chai": "5.2.1",