@teambit/checkout 1.0.487 → 1.0.488
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/artifacts/__bit_junit.xml +4 -4
- package/artifacts/schema.json +7 -3
- package/dist/checkout-cmd.js +7 -7
- package/dist/checkout-cmd.js.map +1 -1
- package/dist/checkout-version.d.ts +3 -3
- package/dist/checkout-version.js.map +1 -1
- package/dist/checkout.main.runtime.d.ts +1 -1
- package/dist/checkout.main.runtime.js +18 -18
- package/dist/checkout.main.runtime.js.map +1 -1
- package/dist/revert-cmd.js +4 -4
- package/dist/revert-cmd.js.map +1 -1
- package/package.json +22 -17
- /package/dist/{preview-1733714450424.js → preview-1733830651067.js} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<testsuites tests="3" failures="0" errors="0" skipped="0">
|
|
3
|
-
<testsuite name="teambit.component/checkout@1.0.
|
|
4
|
-
<testcase classname="dist/checkout.spec.js" name="should bring the files back"/>
|
|
5
|
-
<testcase classname="dist/checkout.spec.js" name="the workspace should get the component as a valid component" time="0.
|
|
6
|
-
<testcase classname="dist/checkout.spec.js" name="should checkout according to the number of generations specified" time="0.
|
|
3
|
+
<testsuite name="teambit.component/checkout@1.0.488" tests="3" failures="0" errors="0" skipped="0">
|
|
4
|
+
<testcase classname="dist/checkout.spec.js" name="should bring the files back" time="0.001"/>
|
|
5
|
+
<testcase classname="dist/checkout.spec.js" name="the workspace should get the component as a valid component" time="0.029"/>
|
|
6
|
+
<testcase classname="dist/checkout.spec.js" name="should checkout according to the number of generations specified" time="0.001"/>
|
|
7
7
|
</testsuite>
|
|
8
8
|
</testsuites>
|
package/artifacts/schema.json
CHANGED
|
@@ -3032,7 +3032,11 @@
|
|
|
3032
3032
|
"character": 5
|
|
3033
3033
|
},
|
|
3034
3034
|
"name": "ModelComponent",
|
|
3035
|
-
"
|
|
3035
|
+
"componentId": {
|
|
3036
|
+
"scope": "teambit.scope",
|
|
3037
|
+
"name": "objects",
|
|
3038
|
+
"version": "0.0.1"
|
|
3039
|
+
}
|
|
3036
3040
|
},
|
|
3037
3041
|
"isOptional": false
|
|
3038
3042
|
}
|
|
@@ -5443,7 +5447,7 @@
|
|
|
5443
5447
|
"_legacy": {
|
|
5444
5448
|
"scope": "teambit.component",
|
|
5445
5449
|
"name": "checkout",
|
|
5446
|
-
"version": "1.0.
|
|
5450
|
+
"version": "1.0.488"
|
|
5447
5451
|
},
|
|
5448
5452
|
"_scope": "teambit.component"
|
|
5449
5453
|
}
|
|
@@ -5542,7 +5546,7 @@
|
|
|
5542
5546
|
"componentId": {
|
|
5543
5547
|
"scope": "teambit.component",
|
|
5544
5548
|
"name": "checkout",
|
|
5545
|
-
"version": "1.0.
|
|
5549
|
+
"version": "1.0.488"
|
|
5546
5550
|
},
|
|
5547
5551
|
"taggedModuleExports": []
|
|
5548
5552
|
}
|
package/dist/checkout-cmd.js
CHANGED
|
@@ -26,9 +26,9 @@ function _merging() {
|
|
|
26
26
|
};
|
|
27
27
|
return data;
|
|
28
28
|
}
|
|
29
|
-
function
|
|
30
|
-
const data = require("@teambit/legacy
|
|
31
|
-
|
|
29
|
+
function _legacy() {
|
|
30
|
+
const data = require("@teambit/legacy.constants");
|
|
31
|
+
_legacy = function () {
|
|
32
32
|
return data;
|
|
33
33
|
};
|
|
34
34
|
return data;
|
|
@@ -60,7 +60,7 @@ class CheckoutCmd {
|
|
|
60
60
|
description: "permitted values: [head, latest, reset, {specific-version}, {head~x}]. 'head' - last snap/tag. 'latest' - semver latest tag. 'reset' - removes local changes"
|
|
61
61
|
}, {
|
|
62
62
|
name: 'component-pattern',
|
|
63
|
-
description:
|
|
63
|
+
description: _legacy().COMPONENT_PATTERN_HELP
|
|
64
64
|
}]);
|
|
65
65
|
_defineProperty(this, "description", 'switch between component versions or remove local changes');
|
|
66
66
|
_defineProperty(this, "helpUrl", 'reference/components/merging-changes#checkout-snaps-to-the-working-directory');
|
|
@@ -95,7 +95,7 @@ when on a lane, "checkout head" only checks out components on this lane. to upda
|
|
|
95
95
|
throw new (_bitError().BitError)('--auto-merge-resolve must be one of the following: [ours, theirs, manual]');
|
|
96
96
|
}
|
|
97
97
|
if (manual) autoMergeResolve = 'manual';
|
|
98
|
-
if (workspaceOnly && to !==
|
|
98
|
+
if (workspaceOnly && to !== _legacy().HEAD) {
|
|
99
99
|
throw new (_bitError().BitError)('--workspace-only is only relevant when running "bit checkout head" on a lane');
|
|
100
100
|
}
|
|
101
101
|
const checkoutProps = {
|
|
@@ -111,9 +111,9 @@ when on a lane, "checkout head" only checks out components on this lane. to upda
|
|
|
111
111
|
forceTheirs
|
|
112
112
|
};
|
|
113
113
|
to = String(to); // it can be a number in case short-hash is used
|
|
114
|
-
if (to ===
|
|
114
|
+
if (to === _legacy().HEAD) checkoutProps.head = true;else if (to === _legacy().LATEST) checkoutProps.latest = true;else if (to === 'reset') checkoutProps.reset = true;else if (to === 'main') checkoutProps.main = true;else if (to.startsWith(`${_legacy().HEAD}~`)) {
|
|
115
115
|
const ancestor = parseInt(to.split('~')[1]);
|
|
116
|
-
if (Number.isNaN(ancestor)) throw new (_bitError().BitError)(`the character after "${
|
|
116
|
+
if (Number.isNaN(ancestor)) throw new (_bitError().BitError)(`the character after "${_legacy().HEAD}~" must be a number, got ${ancestor}`);
|
|
117
117
|
checkoutProps.ancestor = ancestor;
|
|
118
118
|
} else {
|
|
119
119
|
if (!_componentId().ComponentID.isValidVersion(to)) throw new (_bitError().BitError)(`the specified version "${to}" is not a valid version`);
|
package/dist/checkout-cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_lodash","_merging","_constants","_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 { Command, CommandOptions } from '@teambit/cli';\nimport { compact } from 'lodash';\nimport {\n ApplyVersionResults,\n applyVersionReport,\n conflictSummaryReport,\n installationErrorOutput,\n compilationErrorOutput,\n getRemovedOutput,\n getAddedOutput,\n MergeStrategy,\n getWorkspaceConfigUpdateOutput,\n} from '@teambit/merging';\nimport { COMPONENT_PATTERN_HELP, HEAD, LATEST } from '@teambit/legacy/dist/constants';\nimport { ComponentID } from '@teambit/component-id';\nimport { BitError } from '@teambit/bit-error';\nimport { CheckoutMain, CheckoutProps } from './checkout.main.runtime';\n\nexport class CheckoutCmd implements Command {\n name = 'checkout <to> [component-pattern]';\n arguments = [\n {\n name: 'to',\n description:\n \"permitted values: [head, latest, reset, {specific-version}, {head~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 = 'development';\n extendedDescription = `\n\\`bit checkout <version> [component-pattern]\\` => checkout the specified ids (or all components when --all is used) to the specified version\n\\`bit checkout head [component-pattern]\\` => checkout to the last snap/tag (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,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;AACA,SAAAI,SAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,QAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAWA,SAAAK,WAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,UAAA,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;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA8C,SAAAC,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAJ,CAAA,GAAAO,MAAA,CAAAC,cAAA,CAAAR,CAAA,EAAAI,CAAA,IAAA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AAiB,CAAC,EACnC,IAAA0D,yBAAc,EAACzD,eAAe,CAAC,EAC/B8C,kBAAkB,CAAC,CAAC,EACpB,IAAAY,yCAA8B,EAACxD,2BAA2B,CAAC,EAC3D4B,kBAAkB,CAAC,CAAC,EACpBiB,UAAU,CAAC,CAAC,EACZ,IAAAY,kCAAuB,EAACtD,iBAAiB,CAAC,EAC1C,IAAAuD,iCAAsB,EAACtD,gBAAgB,CAAC,CACzC,CAAC,CAACmB,IAAI,CAAC,MAAM,CAAC;AACjB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_lodash","_merging","_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 { Command, CommandOptions } from '@teambit/cli';\nimport { compact } from 'lodash';\nimport {\n ApplyVersionResults,\n applyVersionReport,\n conflictSummaryReport,\n installationErrorOutput,\n compilationErrorOutput,\n getRemovedOutput,\n getAddedOutput,\n MergeStrategy,\n getWorkspaceConfigUpdateOutput,\n} from '@teambit/merging';\nimport { COMPONENT_PATTERN_HELP, HEAD, LATEST } from '@teambit/legacy.constants';\nimport { ComponentID } from '@teambit/component-id';\nimport { BitError } from '@teambit/bit-error';\nimport { CheckoutMain, CheckoutProps } from './checkout.main.runtime';\n\nexport class CheckoutCmd implements Command {\n name = 'checkout <to> [component-pattern]';\n arguments = [\n {\n name: 'to',\n description:\n \"permitted values: [head, latest, reset, {specific-version}, {head~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 = 'development';\n extendedDescription = `\n\\`bit checkout <version> [component-pattern]\\` => checkout the specified ids (or all components when --all is used) to the specified version\n\\`bit checkout head [component-pattern]\\` => checkout to the last snap/tag (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,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;AACA,SAAAI,SAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,QAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAWA,SAAAK,QAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,OAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IA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B,QAAQ,CAAC,CAAC,CAAC,EAAE;IACzG,MAAMkC,YAAY,GAAGjD,WAAW,EAAEQ,MAAM,IAAI,CAAC;IAC7C,MAAM0C,iBAAiB,GAAGjD,gBAAgB,GAAG,UAAU,GAAG,cAAc;IACxE,MAAMkD,YAAY,GAAGF,YAAY,GAC7B,gBAAgBC,iBAAiB,KAAKtC,gBAAK,CAACE,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,2BAAgB,EAACzD,iBAAiB,CAAC,EACnC,IAAA0D,yBAAc,EAACzD,eAAe,CAAC,EAC/B8C,kBAAkB,CAAC,CAAC,EACpB,IAAAY,yCAA8B,EAACxD,2BAA2B,CAAC,EAC3D4B,kBAAkB,CAAC,CAAC,EACpBiB,UAAU,CAAC,CAAC,EACZ,IAAAY,kCAAuB,EAACtD,iBAAiB,CAAC,EAC1C,IAAAuD,iCAAsB,EAACtD,gBAAgB,CAAC,CACzC,CAAC,CAACmB,IAAI,CAAC,MAAM,CAAC;AACjB","ignoreList":[]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Consumer } from '@teambit/legacy
|
|
1
|
+
import { Consumer } from '@teambit/legacy.consumer';
|
|
2
2
|
import { ComponentID } from '@teambit/component-id';
|
|
3
|
-
import Version from '@teambit/
|
|
3
|
+
import { Version } from '@teambit/scope.objects';
|
|
4
4
|
import { SourceFile } from '@teambit/component.sources';
|
|
5
|
-
import ConsumerComponent from '@teambit/legacy
|
|
5
|
+
import { ConsumerComponent } from '@teambit/legacy.consumer-component';
|
|
6
6
|
import { ApplyVersionResult, FilesStatus, MergeStrategy, MergeResultsThreeWay } from '@teambit/merging';
|
|
7
7
|
import { CheckoutProps } from './checkout.main.runtime';
|
|
8
8
|
export type ComponentStatusBase = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["path","data","_interopRequireWildcard","require","_component","_legacy","_bitError","_chalk","_interopRequireDefault","_merging","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ownKeys","keys","getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","_toPropertyKey","value","configurable","writable","_toPrimitive","Symbol","toPrimitive","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","persistAllToFS","componentFiles","map","clone","manual","filePath","normalize","foundFile","componentFile","conflict","from","output","merged","isBinaryConflict","fsFile","binaryConflict","addFiles","m","added","deletedConflictFiles","removeFiles","remainDeletedFiles","remainDeleted","deletedConflict","overrideFiles","overridden","updatedFiles","content","throwForFailures","allComponentsStatus","failedComponents","c","unchangedMessage","unchangedLegitimately","failureMsgs","failedComponent","chalk","bold","red","join"],"sources":["checkout-version.ts"],"sourcesContent":["import * as path from 'path';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport { ComponentID } from '@teambit/component-id';\nimport Version from '@teambit/legacy/dist/scope/models/version';\nimport { SourceFile, RemovePath, DataToPersist } from '@teambit/component.sources';\nimport { pathNormalizeToLinux, PathOsBased } from '@teambit/legacy.utils';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component';\nimport { BitError } from '@teambit/bit-error';\nimport chalk from 'chalk';\nimport {\n ApplyVersionResult,\n FilesStatus,\n FileStatus,\n MergeOptions,\n MergeStrategy,\n MergeResultsThreeWay,\n} from '@teambit/merging';\nimport { 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\n/**\n * relevant only when\n * 1) there is no conflict => add files from mergeResults: addFiles, overrideFiles and modifiedFiles.output.\n * 2) there is conflict and mergeStrategy is manual => add files from mergeResults: addFiles, overrideFiles and modifiedFiles.conflict.\n *\n * this function only updates the files content, it doesn't write the files\n */\nexport function applyModifiedVersion(\n componentFiles: SourceFile[],\n mergeResults: MergeResultsThreeWay,\n mergeStrategy: MergeStrategy | null | undefined\n): { filesStatus: Record<string, any>; modifiedFiles: SourceFile[] } {\n let modifiedFiles = componentFiles.map((file) => file.clone());\n const filesStatus = {};\n if (mergeResults.hasConflicts && mergeStrategy !== MergeOptions.manual) {\n return { filesStatus, modifiedFiles };\n }\n mergeResults.modifiedFiles.forEach((file) => {\n const filePath: PathOsBased = path.normalize(file.filePath);\n const foundFile = modifiedFiles.find((componentFile) => componentFile.relative === filePath);\n if (!foundFile) throw new BitError(`file ${filePath} not found`);\n if (file.conflict) {\n foundFile.contents = Buffer.from(file.conflict);\n filesStatus[file.filePath] = FileStatus.manual;\n } else if (typeof file.output === 'string') {\n foundFile.contents = Buffer.from(file.output);\n filesStatus[file.filePath] = FileStatus.merged;\n } else if (file.isBinaryConflict) {\n // leave the file as is and notify the user later about it.\n foundFile.contents = file.fsFile.contents;\n filesStatus[file.filePath] = FileStatus.binaryConflict;\n } else {\n throw new BitError(`file ${filePath} does not have output nor conflict`);\n }\n });\n\n mergeResults.addFiles.forEach((file) => {\n const filePath: PathOsBased = path.normalize(file.filePath);\n if (modifiedFiles.find((m) => m.relative === filePath)) return;\n modifiedFiles.push(file.fsFile);\n filesStatus[file.filePath] = FileStatus.added;\n });\n mergeResults.deletedConflictFiles.forEach((file) => {\n if (!file.fsFile) return;\n const filePath: PathOsBased = path.normalize(file.filePath);\n if (modifiedFiles.find((m) => m.relative === filePath)) return;\n modifiedFiles.push(file.fsFile);\n filesStatus[file.filePath] = FileStatus.added;\n });\n mergeResults.removeFiles.forEach((file) => {\n const filePath: PathOsBased = path.normalize(file.filePath);\n filesStatus[file.filePath] = FileStatus.removed;\n modifiedFiles = modifiedFiles.filter((f) => f.relative !== filePath);\n });\n mergeResults.remainDeletedFiles.forEach((file) => {\n const filePath: PathOsBased = path.normalize(file.filePath);\n modifiedFiles = modifiedFiles.filter((f) => f.relative !== filePath);\n filesStatus[file.filePath] = FileStatus.remainDeleted;\n });\n mergeResults.deletedConflictFiles.forEach((file) => {\n filesStatus[file.filePath] = FileStatus.deletedConflict;\n });\n\n mergeResults.overrideFiles.forEach((file) => {\n const filePath: PathOsBased = path.normalize(file.filePath);\n const foundFile = modifiedFiles.find((componentFile) => componentFile.relative === filePath);\n if (!foundFile) throw new BitError(`file ${filePath} not found`);\n foundFile.contents = file.fsFile.contents;\n filesStatus[file.filePath] = FileStatus.overridden;\n });\n mergeResults.updatedFiles.forEach((file) => {\n const filePath: PathOsBased = path.normalize(file.filePath);\n const foundFile = modifiedFiles.find((componentFile) => componentFile.relative === filePath);\n if (!foundFile) throw new BitError(`file ${filePath} not found`);\n foundFile.contents = file.content;\n filesStatus[file.filePath] = FileStatus.updated;\n });\n\n return { filesStatus, modifiedFiles };\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":";;;;;;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,uBAAA,CAAAC,OAAA;EAAAH,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIA,SAAAG,WAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,UAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,SAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,OAAA;EAAA,MAAAN,IAAA,GAAAO,sBAAA,CAAAL,OAAA;EAAAI,MAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,SAAA;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,CAAC;IACb,MAAM,KAAIhE,oBAAQ,EAAC,qDAAqD2D,WAAW,EAAE,CAAC;EACxF;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["path","data","_interopRequireWildcard","require","_component","_legacy","_bitError","_chalk","_interopRequireDefault","_merging","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ownKeys","keys","getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","_toPropertyKey","value","configurable","writable","_toPrimitive","Symbol","toPrimitive","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","persistAllToFS","componentFiles","map","clone","manual","filePath","normalize","foundFile","componentFile","conflict","from","output","merged","isBinaryConflict","fsFile","binaryConflict","addFiles","m","added","deletedConflictFiles","removeFiles","remainDeletedFiles","remainDeleted","deletedConflict","overrideFiles","overridden","updatedFiles","content","throwForFailures","allComponentsStatus","failedComponents","c","unchangedMessage","unchangedLegitimately","failureMsgs","failedComponent","chalk","bold","red","join"],"sources":["checkout-version.ts"],"sourcesContent":["import * as path from 'path';\nimport { Consumer } from '@teambit/legacy.consumer';\nimport { ComponentID } from '@teambit/component-id';\nimport { Version } from '@teambit/scope.objects';\nimport { SourceFile, RemovePath, DataToPersist } from '@teambit/component.sources';\nimport { pathNormalizeToLinux, PathOsBased } from '@teambit/legacy.utils';\nimport { ConsumerComponent } from '@teambit/legacy.consumer-component';\nimport { BitError } from '@teambit/bit-error';\nimport chalk from 'chalk';\nimport {\n ApplyVersionResult,\n FilesStatus,\n FileStatus,\n MergeOptions,\n MergeStrategy,\n MergeResultsThreeWay,\n} from '@teambit/merging';\nimport { 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\n/**\n * relevant only when\n * 1) there is no conflict => add files from mergeResults: addFiles, overrideFiles and modifiedFiles.output.\n * 2) there is conflict and mergeStrategy is manual => add files from mergeResults: addFiles, overrideFiles and modifiedFiles.conflict.\n *\n * this function only updates the files content, it doesn't write the files\n */\nexport function applyModifiedVersion(\n componentFiles: SourceFile[],\n mergeResults: MergeResultsThreeWay,\n mergeStrategy: MergeStrategy | null | undefined\n): { filesStatus: Record<string, any>; modifiedFiles: SourceFile[] } {\n let modifiedFiles = componentFiles.map((file) => file.clone());\n const filesStatus = {};\n if (mergeResults.hasConflicts && mergeStrategy !== MergeOptions.manual) {\n return { filesStatus, modifiedFiles };\n }\n mergeResults.modifiedFiles.forEach((file) => {\n const filePath: PathOsBased = path.normalize(file.filePath);\n const foundFile = modifiedFiles.find((componentFile) => componentFile.relative === filePath);\n if (!foundFile) throw new BitError(`file ${filePath} not found`);\n if (file.conflict) {\n foundFile.contents = Buffer.from(file.conflict);\n filesStatus[file.filePath] = FileStatus.manual;\n } else if (typeof file.output === 'string') {\n foundFile.contents = Buffer.from(file.output);\n filesStatus[file.filePath] = FileStatus.merged;\n } else if (file.isBinaryConflict) {\n // leave the file as is and notify the user later about it.\n foundFile.contents = file.fsFile.contents;\n filesStatus[file.filePath] = FileStatus.binaryConflict;\n } else {\n throw new BitError(`file ${filePath} does not have output nor conflict`);\n }\n });\n\n mergeResults.addFiles.forEach((file) => {\n const filePath: PathOsBased = path.normalize(file.filePath);\n if (modifiedFiles.find((m) => m.relative === filePath)) return;\n modifiedFiles.push(file.fsFile);\n filesStatus[file.filePath] = FileStatus.added;\n });\n mergeResults.deletedConflictFiles.forEach((file) => {\n if (!file.fsFile) return;\n const filePath: PathOsBased = path.normalize(file.filePath);\n if (modifiedFiles.find((m) => m.relative === filePath)) return;\n modifiedFiles.push(file.fsFile);\n filesStatus[file.filePath] = FileStatus.added;\n });\n mergeResults.removeFiles.forEach((file) => {\n const filePath: PathOsBased = path.normalize(file.filePath);\n filesStatus[file.filePath] = FileStatus.removed;\n modifiedFiles = modifiedFiles.filter((f) => f.relative !== filePath);\n });\n mergeResults.remainDeletedFiles.forEach((file) => {\n const filePath: PathOsBased = path.normalize(file.filePath);\n modifiedFiles = modifiedFiles.filter((f) => f.relative !== filePath);\n filesStatus[file.filePath] = FileStatus.remainDeleted;\n });\n mergeResults.deletedConflictFiles.forEach((file) => {\n filesStatus[file.filePath] = FileStatus.deletedConflict;\n });\n\n mergeResults.overrideFiles.forEach((file) => {\n const filePath: PathOsBased = path.normalize(file.filePath);\n const foundFile = modifiedFiles.find((componentFile) => componentFile.relative === filePath);\n if (!foundFile) throw new BitError(`file ${filePath} not found`);\n foundFile.contents = file.fsFile.contents;\n filesStatus[file.filePath] = FileStatus.overridden;\n });\n mergeResults.updatedFiles.forEach((file) => {\n const filePath: PathOsBased = path.normalize(file.filePath);\n const foundFile = modifiedFiles.find((componentFile) => componentFile.relative === filePath);\n if (!foundFile) throw new BitError(`file ${filePath} not found`);\n foundFile.contents = file.content;\n filesStatus[file.filePath] = FileStatus.updated;\n });\n\n return { filesStatus, modifiedFiles };\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":";;;;;;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,uBAAA,CAAAC,OAAA;EAAAH,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIA,SAAAG,WAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,UAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,SAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,OAAA;EAAA,MAAAN,IAAA,GAAAO,sBAAA,CAAAL,OAAA;EAAAI,MAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,SAAA;EAAA,MAAAR,IAAA,GAAAE,OAAA;E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,EAAC,qDAAqD2D,WAAW,EAAE,CAAC;EACxF;AACF","ignoreList":[]}
|
|
@@ -6,7 +6,7 @@ import { ApplyVersionResults, MergeStrategy } from '@teambit/merging';
|
|
|
6
6
|
import { ImporterMain } from '@teambit/importer';
|
|
7
7
|
import { ComponentWriterMain } from '@teambit/component-writer';
|
|
8
8
|
import { ComponentID } from '@teambit/component-id';
|
|
9
|
-
import { ModelComponent, Lane } from '@teambit/
|
|
9
|
+
import { ModelComponent, Lane } from '@teambit/scope.objects';
|
|
10
10
|
import { ComponentStatusBase } from './checkout-version';
|
|
11
11
|
import { ComponentMap } from '@teambit/legacy.bit-map';
|
|
12
12
|
export type CheckoutProps = {
|
|
@@ -60,9 +60,9 @@ function _importer() {
|
|
|
60
60
|
};
|
|
61
61
|
return data;
|
|
62
62
|
}
|
|
63
|
-
function
|
|
64
|
-
const data = require("@teambit/legacy
|
|
65
|
-
|
|
63
|
+
function _legacy() {
|
|
64
|
+
const data = require("@teambit/legacy.constants");
|
|
65
|
+
_legacy = function () {
|
|
66
66
|
return data;
|
|
67
67
|
};
|
|
68
68
|
return data;
|
|
@@ -88,23 +88,23 @@ function _componentId() {
|
|
|
88
88
|
};
|
|
89
89
|
return data;
|
|
90
90
|
}
|
|
91
|
-
function
|
|
92
|
-
const data = require("@teambit/
|
|
93
|
-
|
|
91
|
+
function _scope() {
|
|
92
|
+
const data = require("@teambit/scope.objects");
|
|
93
|
+
_scope = function () {
|
|
94
94
|
return data;
|
|
95
95
|
};
|
|
96
96
|
return data;
|
|
97
97
|
}
|
|
98
|
-
function
|
|
99
|
-
const data = require("@teambit/legacy
|
|
100
|
-
|
|
98
|
+
function _legacy2() {
|
|
99
|
+
const data = require("@teambit/legacy.scope");
|
|
100
|
+
_legacy2 = function () {
|
|
101
101
|
return data;
|
|
102
102
|
};
|
|
103
103
|
return data;
|
|
104
104
|
}
|
|
105
|
-
function
|
|
106
|
-
const data =
|
|
107
|
-
|
|
105
|
+
function _legacy3() {
|
|
106
|
+
const data = require("@teambit/legacy.consumer-component");
|
|
107
|
+
_legacy3 = function () {
|
|
108
108
|
return data;
|
|
109
109
|
};
|
|
110
110
|
return data;
|
|
@@ -181,7 +181,7 @@ class CheckoutMain {
|
|
|
181
181
|
lane: checkoutProps.lane
|
|
182
182
|
});
|
|
183
183
|
const getComponentsStatusOfMergeNeeded = async () => {
|
|
184
|
-
const tmp = new (
|
|
184
|
+
const tmp = new (_legacy2().Tmp)(consumer.scope);
|
|
185
185
|
try {
|
|
186
186
|
const afterMergeAttempt = await Promise.all(compsNeedMerge.map(c => this.getMergeStatus(c, checkoutProps)));
|
|
187
187
|
await tmp.clear();
|
|
@@ -284,7 +284,7 @@ class CheckoutMain {
|
|
|
284
284
|
const bitMapEntry = this.workspace.bitMap.getBitmapEntry(id, {
|
|
285
285
|
ignoreVersion: true
|
|
286
286
|
});
|
|
287
|
-
if (bitMapEntry.noFilesError && bitMapEntry.noFilesError instanceof
|
|
287
|
+
if (bitMapEntry.noFilesError && bitMapEntry.noFilesError instanceof _legacy3().ComponentNotFoundInPath) {
|
|
288
288
|
delete bitMapEntry.noFilesError;
|
|
289
289
|
missing.push(id);
|
|
290
290
|
}
|
|
@@ -309,7 +309,7 @@ class CheckoutMain {
|
|
|
309
309
|
ignoreVersion: true
|
|
310
310
|
});
|
|
311
311
|
if (existingId) return;
|
|
312
|
-
const modelComponent =
|
|
312
|
+
const modelComponent = _scope().ModelComponent.fromBitId(id);
|
|
313
313
|
const repo = this.workspace.scope.legacyScope.objects;
|
|
314
314
|
const consumerComp = await modelComponent.toConsumerComponent(id.version, id.scope, repo);
|
|
315
315
|
const newCompId = _componentId().ComponentID.fromObject({
|
|
@@ -381,13 +381,13 @@ class CheckoutMain {
|
|
|
381
381
|
async parseValues(componentPattern, checkoutProps) {
|
|
382
382
|
if (checkoutProps.head && !componentPattern) {
|
|
383
383
|
if (checkoutProps.all) {
|
|
384
|
-
this.logger.console(`"--all" is deprecated for "bit checkout ${
|
|
384
|
+
this.logger.console(`"--all" is deprecated for "bit checkout ${_legacy().HEAD}", please omit it.`);
|
|
385
385
|
}
|
|
386
386
|
checkoutProps.all = true;
|
|
387
387
|
}
|
|
388
388
|
if (checkoutProps.latest && !componentPattern) {
|
|
389
389
|
if (checkoutProps.all) {
|
|
390
|
-
this.logger.console(`"--all" is deprecated for "bit checkout ${
|
|
390
|
+
this.logger.console(`"--all" is deprecated for "bit checkout ${_legacy().LATEST}", please omit it.`);
|
|
391
391
|
}
|
|
392
392
|
checkoutProps.all = true;
|
|
393
393
|
}
|
|
@@ -415,7 +415,7 @@ class CheckoutMain {
|
|
|
415
415
|
const currentLane = await this.workspace.consumer.getCurrentLaneObject();
|
|
416
416
|
const currentLaneIds = currentLane?.toComponentIds();
|
|
417
417
|
const ids = currentLaneIds ? idsOnWorkspace.filter(id => currentLaneIds.hasWithoutVersion(id)) : idsOnWorkspace;
|
|
418
|
-
checkoutProps.ids = ids.map(id => checkoutProps.head || checkoutProps.latest ? id.changeVersion(
|
|
418
|
+
checkoutProps.ids = ids.map(id => checkoutProps.head || checkoutProps.latest ? id.changeVersion(_legacy().LATEST) : id);
|
|
419
419
|
}
|
|
420
420
|
async getNewComponentsFromLane(ids) {
|
|
421
421
|
// current lane object is up to date due to the previous `importCurrentObjects()` call
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_cli","data","require","_logger","_workspace","_bitError","_lodash","_remove","_merging","_importer","_constants","_componentWriter","_pMapSeries","_interopRequireDefault","_componentId","_models","_repositories","_componentNotFoundInPath","_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","inInstallContext","consumer","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","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","console","HEAD","latest","LATEST","includeLocallyDeleted","getIds","idsByPattern","includeDeleted","listIdsIncludeRemoved","listIds","idsOnWorkspace","currentLane","getCurrentLaneObject","currentLaneIds","toComponentIds","hasWithoutVersion","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 { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { WorkspaceAspect, OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport { BitError } from '@teambit/bit-error';\nimport { compact } from 'lodash';\nimport { RemoveAspect, RemoveMain } from '@teambit/remove';\nimport {\n ApplyVersionResults,\n FailedComponents,\n threeWayMerge,\n getMergeStrategyInteractive,\n MergeStrategy,\n} from '@teambit/merging';\nimport { ImporterAspect, ImporterMain } from '@teambit/importer';\nimport { HEAD, LATEST } from '@teambit/legacy/dist/constants';\nimport { ComponentWriterAspect, ComponentWriterMain } from '@teambit/component-writer';\nimport mapSeries from 'p-map-series';\nimport { ComponentIdList, ComponentID } from '@teambit/component-id';\nimport { Version, ModelComponent, Lane } from '@teambit/legacy/dist/scope/models';\nimport { Tmp } from '@teambit/legacy/dist/scope/repositories';\nimport ComponentNotFoundInPath from '@teambit/legacy/dist/consumer/component/exceptions/component-not-found-in-path';\nimport { CheckoutCmd } from './checkout-cmd';\nimport { CheckoutAspect } from './checkout.aspect';\nimport { applyVersion, ComponentStatus, ComponentStatusBase, throwForFailures } from './checkout-version';\nimport { RevertCmd } from './revert-cmd';\nimport { 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 this.workspace.inInstallContext = true;\n const consumer = this.workspace.consumer;\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\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 parseValues(componentPattern: string, checkoutProps: CheckoutProps) {\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 const ids = currentLaneIds ? idsOnWorkspace.filter((id) => currentLaneIds.hasWithoutVersion(id)) : 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":";;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,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;AACA,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;AACA,SAAAM,QAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,OAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,SAAA;EAAA,MAAAP,IAAA,GAAAC,OA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AAhB,eAAA,CAtfNgB,YAAY,kBAufD,CAACyQ,gBAAS,EAAEC,4BAAe,EAAEC,sBAAY,EAAEC,wCAAqB,EAAEC,0BAAc,EAAEC,sBAAY,CAAC;AAAA9R,eAAA,CAvf1GgB,YAAY,aAyfN+Q,kBAAW;AAiB9BZ,0BAAc,CAACa,UAAU,CAAChR,YAAY,CAAC;AAAC,IAAAiR,QAAA,GAAAT,OAAA,CAAAzS,OAAA,GAEzBiC,YAAY","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_cli","data","require","_logger","_workspace","_bitError","_lodash","_remove","_merging","_importer","_legacy","_componentWriter","_pMapSeries","_interopRequireDefault","_componentId","_scope","_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","inInstallContext","consumer","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","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","console","HEAD","latest","LATEST","includeLocallyDeleted","getIds","idsByPattern","includeDeleted","listIdsIncludeRemoved","listIds","idsOnWorkspace","currentLane","getCurrentLaneObject","currentLaneIds","toComponentIds","hasWithoutVersion","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 { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { WorkspaceAspect, OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport { BitError } from '@teambit/bit-error';\nimport { compact } from 'lodash';\nimport { RemoveAspect, RemoveMain } from '@teambit/remove';\nimport {\n ApplyVersionResults,\n FailedComponents,\n threeWayMerge,\n getMergeStrategyInteractive,\n MergeStrategy,\n} from '@teambit/merging';\nimport { ImporterAspect, ImporterMain } from '@teambit/importer';\nimport { HEAD, LATEST } from '@teambit/legacy.constants';\nimport { ComponentWriterAspect, ComponentWriterMain } from '@teambit/component-writer';\nimport mapSeries from 'p-map-series';\nimport { ComponentIdList, ComponentID } from '@teambit/component-id';\nimport { Version, ModelComponent, Lane } from '@teambit/scope.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 { applyVersion, ComponentStatus, ComponentStatusBase, throwForFailures } from './checkout-version';\nimport { RevertCmd } from './revert-cmd';\nimport { 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 this.workspace.inInstallContext = true;\n const consumer = this.workspace.consumer;\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\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 parseValues(componentPattern: string, checkoutProps: CheckoutProps) {\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 const ids = currentLaneIds ? idsOnWorkspace.filter((id) => currentLaneIds.hasWithoutVersion(id)) : 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":";;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,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IACF,CAAC,CAAC;IAEF,OAAO;MAAE/K,gBAAgB,EAAE6K,eAAe;MAAED,kBAAkB;MAAE7N,EAAE;MAAEkC;IAAa,CAAC;EACpF;EAOA,aAAaqM,QAAQA,CAAC,CAACC,GAAG,EAAE7P,SAAS,EAAE8P,UAAU,EAAEC,UAAU,EAAE5P,QAAQ,EAAEC,MAAM,CAO9E,EAAE;IACD,MAAMH,MAAM,GAAG6P,UAAU,CAACE,YAAY,CAACC,0BAAc,CAAC5O,EAAE,CAAC;IACzD,MAAM6O,YAAY,GAAG,IAAIpQ,YAAY,CAACE,SAAS,EAAEC,MAAM,EAAE8P,UAAU,EAAE5P,QAAQ,EAAEC,MAAM,CAAC;IACtFyP,GAAG,CAACM,QAAQ,CAAC,KAAIC,0BAAW,EAACF,YAAY,CAAC,EAAE,KAAIG,sBAAS,EAACH,YAAY,CAAC,CAAC;IACxE,OAAOA,YAAY;EACrB;AACF;AAACI,OAAA,CAAAxQ,YAAA,GAAAA,YAAA;AAAAhB,eAAA,CAxgBYgB,YAAY,WAsfR,EAAE;AAAAhB,eAAA,CAtfNgB,YAAY,kBAufD,CAACyQ,gBAAS,EAAEC,4BAAe,EAAEC,sBAAY,EAAEC,wCAAqB,EAAEC,0BAAc,EAAEC,sBAAY,CAAC;AAAA9R,eAAA,CAvf1GgB,YAAY,aAyfN+Q,kBAAW;AAiB9BZ,0BAAc,CAACa,UAAU,CAAChR,YAAY,CAAC;AAAC,IAAAiR,QAAA,GAAAT,OAAA,CAAAzS,OAAA,GAEzBiC,YAAY","ignoreList":[]}
|
package/dist/revert-cmd.js
CHANGED
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.RevertCmd = void 0;
|
|
7
|
-
function
|
|
8
|
-
const data = require("@teambit/legacy
|
|
9
|
-
|
|
7
|
+
function _legacy() {
|
|
8
|
+
const data = require("@teambit/legacy.constants");
|
|
9
|
+
_legacy = function () {
|
|
10
10
|
return data;
|
|
11
11
|
};
|
|
12
12
|
return data;
|
|
@@ -27,7 +27,7 @@ class RevertCmd {
|
|
|
27
27
|
_defineProperty(this, "name", 'revert <component-pattern> <to>');
|
|
28
28
|
_defineProperty(this, "arguments", [{
|
|
29
29
|
name: 'component-pattern',
|
|
30
|
-
description:
|
|
30
|
+
description: _legacy().COMPONENT_PATTERN_HELP
|
|
31
31
|
}, {
|
|
32
32
|
name: 'to',
|
|
33
33
|
description: "permitted values: [main, specific-version]. 'main' - head version on main."
|
package/dist/revert-cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_legacy","data","require","_checkoutCmd","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","RevertCmd","constructor","checkout","name","description","COMPONENT_PATTERN_HELP","report","componentPattern","to","verbose","skipDependencyInstallation","CheckoutCmd","revert","exports"],"sources":["revert-cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy.constants';\nimport { CheckoutMain } from './checkout.main.runtime';\nimport { CheckoutCmd } from './checkout-cmd';\n\nexport class RevertCmd implements Command {\n name = 'revert <component-pattern> <to>';\n arguments = [\n {\n name: 'component-pattern',\n description: COMPONENT_PATTERN_HELP,\n },\n {\n name: 'to',\n description: \"permitted values: [main, specific-version]. 'main' - head version on main.\",\n },\n ];\n description = 'replace the current component files by the specified version, leave the version intact';\n group = 'development';\n alias = '';\n options = [\n ['v', 'verbose', 'showing verbose output for inspection'],\n ['x', 'skip-dependency-installation', 'do not install packages of the imported components'],\n ] as CommandOptions;\n loader = true;\n\n constructor(private checkout: CheckoutMain) {}\n\n async report(\n [componentPattern, to]: [string, string],\n {\n verbose = false,\n skipDependencyInstallation = false,\n }: {\n verbose?: boolean;\n skipDependencyInstallation?: bool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AAI,EAAE,mBAAmB;MACzBC,WAAW,EAAEC;IACf,CAAC,EACD;MACEF,IAAI,EAAE,IAAI;MACVC,WAAW,EAAE;IACf,CAAC,CACF;IAAAvB,eAAA,sBACa,wFAAwF;IAAAA,eAAA,gBAC9F,aAAa;IAAAA,eAAA,gBACb,EAAE;IAAAA,eAAA,kBACA,CACR,CAAC,GAAG,EAAE,SAAS,EAAE,uCAAuC,CAAC,EACzD,CAAC,GAAG,EAAE,8BAA8B,EAAE,oDAAoD,CAAC,CAC5F;IAAAA,eAAA,iBACQ,IAAI;EAEgC;EAE7C,MAAMyB,MAAMA,CACV,CAACC,gBAAgB,EAAEC,EAAE,CAAmB,EACxC;IACEC,OAAO,GAAG,KAAK;IACfC,0BAA0B,GAAG;EAI/B,CAAC,EACD;IACA,OAAO,KAAIC,0BAAW,EAAC,IAAI,CAACT,QAAQ,CAAC,CAACI,MAAM,CAAC,CAACE,EAAE,EAAED,gBAAgB,CAAC,EAAE;MACnEE,OAAO;MACPC,0BAA0B;MAC1BE,MAAM,EAAE;IACV,CAAC,CAAC;EACJ;AACF;AAACC,OAAA,CAAAb,SAAA,GAAAA,SAAA","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/checkout",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.488",
|
|
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.
|
|
9
|
+
"version": "1.0.488"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "2.4.2",
|
|
@@ -15,16 +15,21 @@
|
|
|
15
15
|
"@teambit/bit-error": "0.0.404",
|
|
16
16
|
"@teambit/component-id": "1.2.2",
|
|
17
17
|
"@teambit/harmony": "0.4.6",
|
|
18
|
-
"@teambit/cli": "0.0.
|
|
19
|
-
"@teambit/
|
|
20
|
-
"@teambit/
|
|
21
|
-
"@teambit/
|
|
22
|
-
"@teambit/component
|
|
23
|
-
"@teambit/
|
|
24
|
-
"@teambit/legacy.
|
|
25
|
-
"@teambit/
|
|
26
|
-
"@teambit/
|
|
27
|
-
"@teambit/
|
|
18
|
+
"@teambit/cli": "0.0.1065",
|
|
19
|
+
"@teambit/legacy.constants": "0.0.1",
|
|
20
|
+
"@teambit/merging": "1.0.488",
|
|
21
|
+
"@teambit/component.sources": "0.0.53",
|
|
22
|
+
"@teambit/legacy.consumer-component": "0.0.2",
|
|
23
|
+
"@teambit/legacy.consumer": "0.0.1",
|
|
24
|
+
"@teambit/legacy.utils": "0.0.8",
|
|
25
|
+
"@teambit/scope.objects": "0.0.1",
|
|
26
|
+
"@teambit/component-writer": "1.0.488",
|
|
27
|
+
"@teambit/importer": "1.0.488",
|
|
28
|
+
"@teambit/legacy.bit-map": "0.0.58",
|
|
29
|
+
"@teambit/legacy.scope": "0.0.1",
|
|
30
|
+
"@teambit/logger": "0.0.1158",
|
|
31
|
+
"@teambit/remove": "1.0.488",
|
|
32
|
+
"@teambit/workspace": "1.0.488"
|
|
28
33
|
},
|
|
29
34
|
"devDependencies": {
|
|
30
35
|
"@types/lodash": "4.14.165",
|
|
@@ -34,11 +39,11 @@
|
|
|
34
39
|
"fs-extra": "10.0.0",
|
|
35
40
|
"@types/mocha": "9.1.0",
|
|
36
41
|
"@teambit/harmony.envs.core-aspect-env": "0.0.63",
|
|
37
|
-
"@teambit/component.testing.mock-components": "0.0.
|
|
38
|
-
"@teambit/harmony.testing.load-aspect": "0.0.
|
|
39
|
-
"@teambit/lister": "1.0.
|
|
40
|
-
"@teambit/snapping": "1.0.
|
|
41
|
-
"@teambit/workspace.testing.mock-workspace": "0.0.
|
|
42
|
+
"@teambit/component.testing.mock-components": "0.0.260",
|
|
43
|
+
"@teambit/harmony.testing.load-aspect": "0.0.255",
|
|
44
|
+
"@teambit/lister": "1.0.488",
|
|
45
|
+
"@teambit/snapping": "1.0.488",
|
|
46
|
+
"@teambit/workspace.testing.mock-workspace": "0.0.28"
|
|
42
47
|
},
|
|
43
48
|
"peerDependencies": {
|
|
44
49
|
"@types/chai-fs": "2.0.5",
|
|
File without changes
|